From 06c41d3ccafb41c703690f3b53e4c1df23e8b009 Mon Sep 17 00:00:00 2001 From: fifthsegment <5513549+fifthsegment@users.noreply.github.com> Date: Thu, 24 Sep 2026 16:03:38 -0400 Subject: [PATCH 1/2] Fix durable Tailscale device identity Persist last-known overlay aliases, reconcile safe transient duplicates, and retain canonical policy identity across restarts and offline periods. Co-Authored-By: [CC] --- application/backup/backup.go | 4 +- application/backup/backup_test.go | 6 +- application/dns/discovery/persistence.go | 36 +++-- application/dns/discovery/persistence_test.go | 69 ++++++++- application/dns/discovery/store.go | 132 +++++++++++++++-- application/dns/discovery/store_test.go | 134 +++++++++++++++++- application/dns/discovery/types.go | 17 ++- application/dns/server/ddns.go | 9 +- application/dns/server/ddns_test.go | 37 +++++ application/dns/server/server.go | 34 +++-- application/dns/server/server_test.go | 17 +++ .../webserver/frontend/files/fs/bundle.js | 62 ++++---- .../components/__tests__/tailscale_ui.test.ts | 5 + ui/src/routes/devices/devicelist.svelte | 16 ++- 14 files changed, 489 insertions(+), 89 deletions(-) diff --git a/application/backup/backup.go b/application/backup/backup.go index ed0a2751..4c2af1b1 100644 --- a/application/backup/backup.go +++ b/application/backup/backup.go @@ -27,7 +27,7 @@ const maxSettingsSchemaVersion = 1 // maxDeviceAssignmentsVersion must match discovery.deviceAssignmentsVersion in // persistence.go. Same duplication rationale as above. -const maxDeviceAssignmentsVersion = 2 +const maxDeviceAssignmentsVersion = 3 const ( settingsSchemaKey = "settings_schema_version" @@ -168,7 +168,7 @@ func validateDeviceAssignmentsVersion(raw string) error { return errors.New("device assignments are missing version") } if *doc.Version < 1 || *doc.Version > maxDeviceAssignmentsVersion { - return fmt.Errorf("device assignments version %d is not supported (expected 1 or %d)", *doc.Version, maxDeviceAssignmentsVersion) + return fmt.Errorf("device assignments version %d is not supported (expected 1 through %d)", *doc.Version, maxDeviceAssignmentsVersion) } var assignments map[string]json.RawMessage if len(doc.Assignments) == 0 { diff --git a/application/backup/backup_test.go b/application/backup/backup_test.go index af4ae68f..50e9a93e 100644 --- a/application/backup/backup_test.go +++ b/application/backup/backup_test.go @@ -77,7 +77,7 @@ func TestCreateBackupSeedsEmptyDeviceAssignments(t *testing.T) { if err != nil { t.Fatalf("clean-install backup is not restorable: %v", err) } - if got := archive.Devices[deviceAssignmentsKey]; got != `{"version":2,"assignments":{}}` { + if got := archive.Devices[deviceAssignmentsKey]; got != `{"version":3,"assignments":{}}` { t.Fatalf("assignments = %q", got) } } @@ -212,7 +212,7 @@ func TestValidateArchiveInvalid(t *testing.T) { } func TestValidateDeviceAssignmentsVersionCompatibility(t *testing.T) { - for _, version := range []int{1, 2} { + for _, version := range []int{1, 2, 3} { t.Run(fmt.Sprintf("accepts_v%d", version), func(t *testing.T) { raw := fmt.Sprintf(`{"version":%d,"assignments":{}}`, version) if err := validateDeviceAssignmentsVersion(raw); err != nil { @@ -229,7 +229,7 @@ func TestValidateDeviceAssignmentsVersionCompatibility(t *testing.T) { {name: "zero version", raw: `{"version":0,"assignments":{}}`}, {name: "negative version", raw: `{"version":-1,"assignments":{}}`}, {name: "malformed version", raw: `{"version":"2","assignments":{}}`}, - {name: "unsupported version", raw: `{"version":3,"assignments":{}}`}, + {name: "unsupported version", raw: `{"version":4,"assignments":{}}`}, {name: "malformed document", raw: `{"version":2`}, {name: "missing assignments", raw: `{"version":2}`}, {name: "null assignments", raw: `{"version":2,"assignments":null}`}, diff --git a/application/dns/discovery/persistence.go b/application/dns/discovery/persistence.go index b93383c8..a40801ff 100644 --- a/application/dns/discovery/persistence.go +++ b/application/dns/discovery/persistence.go @@ -10,9 +10,8 @@ import ( ) // DeviceAssignment is the durable subset of Device. Discovery owns observed -// identity at runtime (IPs, last-seen, sources, online state); this record -// owns only user-managed identity and the stable identifiers needed to merge -// re-discovered traffic into the same device. +// LAN identity and reachability at runtime; this record owns user-managed +// identity plus stable linked identifiers and their last-known overlay aliases. type DeviceAssignment struct { ID string `json:"id"` DNSName string `json:"dns_name"` @@ -27,8 +26,8 @@ type DeviceAssignment struct { TailscaleNodes []TailscaleIdentity `json:"tailscale_nodes,omitempty"` } -// deviceAssignments is the persisted format. Version 2 adds durable linked -// Tailscale node identities while keeping runtime addresses out of storage. +// deviceAssignments is the persisted format. Version 3 keeps last-known +// Tailscale addresses with linked node identities so aliases survive restarts. type deviceAssignments struct { Version int `json:"version"` Assignments map[string]DeviceAssignment `json:"assignments"` @@ -36,7 +35,7 @@ type deviceAssignments struct { const ( DeviceAssignmentsKey = "assignments" - deviceAssignmentsVersion = 2 + deviceAssignmentsVersion = 3 ) // Persistence couples a DeviceStore to one durable destination for user-managed @@ -166,8 +165,8 @@ func (p *Persistence) remove(id string) error { } // persistIfChanged writes only when the durable subset differs from the stored -// record. Observed-only churn (IP, last-seen, online, sources) therefore does -// not create writes, which keeps discovery traffic from writing user data. +// record. LAN observations, last-seen, online, and source churn therefore do +// not write user data; linked Tailscale alias changes do. func (p *Persistence) persistIfChanged(device Device) error { return p.persistDevicesIfChanged([]Device{device}) } @@ -274,8 +273,8 @@ func decodeDeviceAssignmentsVersion(current string) (deviceAssignments, int, err if err := json.Unmarshal([]byte(current), &decoded); err != nil { return deviceAssignments{}, 0, fmt.Errorf("parse device assignments: %w", err) } - if decoded.Version != 1 && decoded.Version != deviceAssignmentsVersion { - return deviceAssignments{}, 0, fmt.Errorf("device assignments version %d is not supported (expected 1 or %d); restore the matching GateSentry binary or the pre-upgrade data directory backup", decoded.Version, deviceAssignmentsVersion) + if decoded.Version < 1 || decoded.Version > deviceAssignmentsVersion { + return deviceAssignments{}, 0, fmt.Errorf("device assignments version %d is not supported (expected 1 through %d); restore the matching GateSentry binary or the pre-upgrade data directory backup", decoded.Version, deviceAssignmentsVersion) } if decoded.Assignments == nil { return deviceAssignments{}, 0, errors.New("device assignments payload must contain an assignments object") @@ -288,7 +287,7 @@ func decodeDeviceAssignmentsVersion(current string) (deviceAssignments, int, err return deviceAssignments{}, 0, fmt.Errorf("device assignment key %q does not match record id %q", id, assignment.ID) } } - if decoded.Version == deviceAssignmentsVersion { + if decoded.Version >= 2 { nodeOwners := make(map[string]string) for deviceID, assignment := range decoded.Assignments { for _, identity := range assignment.TailscaleNodes { @@ -327,9 +326,20 @@ func shouldPersistDevice(device Device) bool { func durableTailscaleIdentities(identities []TailscaleIdentity) []TailscaleIdentity { result := make([]TailscaleIdentity, 0, len(identities)) for _, identity := range identities { - if nodeID := normalizeNodeID(identity.NodeID); nodeID != "" { - result = append(result, TailscaleIdentity{NodeID: nodeID, Name: strings.TrimSpace(identity.Name), DNSName: strings.TrimSpace(identity.DNSName)}) + nodeID := normalizeNodeID(identity.NodeID) + if nodeID == "" { + continue } + addresses := make([]string, 0, len(identity.Addresses)) + for _, value := range identity.Addresses { + if address := normalizeIP(value); address != "" { + addresses = append(addresses, address) + } + } + result = append(result, TailscaleIdentity{ + NodeID: nodeID, Name: strings.TrimSpace(identity.Name), DNSName: strings.TrimSpace(identity.DNSName), + Addresses: mergeStringSlice(addresses, nil), + }) } return result } diff --git a/application/dns/discovery/persistence_test.go b/application/dns/discovery/persistence_test.go index 273936ee..1b575429 100644 --- a/application/dns/discovery/persistence_test.go +++ b/application/dns/discovery/persistence_test.go @@ -208,7 +208,7 @@ func TestDeviceAssignmentInvalidPayloadLeavesBytesAndRAMUnchanged(t *testing.T) }{ {name: "malformed json", raw: `{"version":1,"assignments":`}, {name: "malformed assignments", raw: `{"version":1,"assignments":[]}`}, - {name: "future version", raw: `{"version":3,"assignments":{"new":{"id":"new","persistent":true}}}`}, + {name: "future version", raw: `{"version":4,"assignments":{"new":{"id":"new","persistent":true}}}`}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -600,8 +600,8 @@ func TestDeviceAssignmentV1MigrationKeepsOnlyDurableIntent(t *testing.T) { if err != nil { t.Fatal(err) } - if sourceVersion != 2 || decoded.Version != 2 { - t.Fatalf("versions = %d/%d, want 2", sourceVersion, decoded.Version) + if sourceVersion != deviceAssignmentsVersion || decoded.Version != deviceAssignmentsVersion { + t.Fatalf("versions = %d/%d, want %d", sourceVersion, decoded.Version, deviceAssignmentsVersion) } if len(decoded.Assignments) != 4 { t.Fatalf("migrated assignments = %v, want four durable records", decoded.Assignments) @@ -663,14 +663,73 @@ func TestLinkedTailscaleIdentityPersistsWithoutRuntimeMetadata(t *testing.T) { if identity.NodeID != "node-1" || identity.Name != "pixel" || identity.DNSName != "pixel.tailnet" { t.Fatalf("durable identity = %+v", identity) } - if identity.Online || len(identity.Addresses) != 0 || len(identity.WoLMACs) != 0 || !identity.LastSeen.IsZero() { - t.Fatalf("runtime metadata persisted: %+v", identity) + if identity.Online || len(identity.Addresses) != 1 || identity.Addresses[0] != "100.64.0.7" || len(identity.WoLMACs) != 0 || !identity.LastSeen.IsZero() { + t.Fatalf("restored identity metadata: %+v", identity) + } + if got := restarted.FindDeviceByIP("100.64.0.7"); got == nil || got.ID != "dev-1" { + t.Fatalf("restored Tailscale alias = %+v", got) } if device.Online || !device.LastSeen.IsZero() { t.Fatalf("restored reachability = online:%v last_seen:%v", device.Online, device.LastSeen) } } +func TestPersistedTailscaleAliasPreventsDuplicateAfterRestart(t *testing.T) { + store, _ := assignmentsStore(t) + ds := NewDeviceStore("local") + if err := ds.AttachPersistence(store); err != nil { + t.Fatal(err) + } + if _, err := ds.UpsertDeviceE(&Device{ID: "phone", ManualName: "Pixel", Persistent: true}); err != nil { + t.Fatal(err) + } + if _, err := ds.LinkTailscaleIdentityE("phone", TailscaleIdentity{NodeID: "node-1", Addresses: []string{"100.64.0.8"}, Online: true}); err != nil { + t.Fatal(err) + } + + restarted := NewDeviceStore("local") + if err := restarted.AttachPersistence(store); err != nil { + t.Fatal(err) + } + id, created, err := restarted.ObserveDevice(Device{IPv4: "100.64.0.8", Source: SourcePassive}) + if err != nil { + t.Fatal(err) + } + if created || id != "phone" || restarted.DeviceCount() != 1 { + t.Fatalf("observation = id %q created %v count %d", id, created, restarted.DeviceCount()) + } + device := restarted.GetDevice("phone") + if device.IPv4 != "" { + t.Fatalf("overlay alias was copied into LAN IPv4: %+v", device) + } +} + +func TestDeviceAssignmentV2MigratesWithoutTailscaleAddresses(t *testing.T) { + store, _ := assignmentsStore(t) + if err := store.Update(DeviceAssignmentsKey, `{"version":2,"assignments":{"phone":{"id":"phone","manual_name":"Pixel","tailscale_nodes":[{"node_id":"node-1","name":"pixel"}]}}}`); err != nil { + t.Fatal(err) + } + ds := NewDeviceStore("local") + if err := ds.AttachPersistence(store); err != nil { + t.Fatal(err) + } + device := ds.GetDevice("phone") + if device == nil || len(device.TailscaleNodes) != 1 || len(device.TailscaleNodes[0].Addresses) != 0 { + t.Fatalf("migrated v2 device = %+v", device) + } + raw, err := store.GetE(DeviceAssignmentsKey) + if err != nil { + t.Fatal(err) + } + decoded, version, err := decodeDeviceAssignmentsVersion(raw) + if err != nil { + t.Fatal(err) + } + if version != deviceAssignmentsVersion || decoded.Version != deviceAssignmentsVersion { + t.Fatalf("migrated versions = %d/%d", version, decoded.Version) + } +} + func TestTransientPassiveAndMDNSDevicesAreNotPersisted(t *testing.T) { store, _ := assignmentsStore(t) ds := NewDeviceStore("local") diff --git a/application/dns/discovery/store.go b/application/dns/discovery/store.go index 394bd08d..2d5d86a5 100644 --- a/application/dns/discovery/store.go +++ b/application/dns/discovery/store.go @@ -350,6 +350,26 @@ func (ds *DeviceStore) FindDeviceByIP(ip string) *Device { return cloneDevice(d) } +// FindDeviceByLANIP returns a device only when the address is an unambiguous +// current LAN claim. Overlay aliases are not evidence for DDNS/LAN enrichment. +func (ds *DeviceStore) FindDeviceByLANIP(ip string) *Device { + ip = normalizeIP(ip) + ds.mu.RLock() + defer ds.mu.RUnlock() + var match *Device + for _, id := range ds.deviceByIPClaims[ip] { + device := ds.devices[id] + if !deviceHasLANIP(device, ip) { + continue + } + if match != nil && match.ID != id { + return nil + } + match = device + } + return cloneDevice(match) +} + // LastSeenForIP returns freshness for the specific address claim. LAN // observations and Tailscale aliases have independent lifecycles: activity on // one must not extend policy ownership of the other. @@ -387,6 +407,40 @@ func (ds *DeviceStore) IPClaimCount(ip string) int { return len(ds.deviceByIPClaims[normalizeIP(ip)]) } +// ResolveIPClaim returns one consistent view of address ownership for policy +// resolution. A sole linked overlay alias is durable identity and never expires; +// LAN claims retain the ordinary observation freshness timestamp. +func (ds *DeviceStore) ResolveIPClaim(ip string) (deviceID string, ambiguous bool, lastSeen time.Time, tailscaleAlias bool) { + ip = normalizeIP(ip) + ds.mu.RLock() + defer ds.mu.RUnlock() + claims := ds.deviceByIPClaims[ip] + ambiguous = len(claims) > 1 + deviceID = ds.deviceByIP[ip] + device := ds.devices[deviceID] + if device == nil { + return "", ambiguous, time.Time{}, false + } + if deviceHasLANIP(device, ip) { + lastSeen = device.LANLastSeen + if lastSeen.IsZero() { + lastSeen = device.LastSeen + } + } + for _, identity := range device.TailscaleNodes { + for _, address := range identity.Addresses { + if normalizeIP(address) != ip { + continue + } + tailscaleAlias = true + if identity.LastSeen.After(lastSeen) { + lastSeen = identity.LastSeen + } + } + } + return deviceID, ambiguous, lastSeen, tailscaleAlias +} + // IPClaimDeviceIDs returns every canonical device currently claiming an address // in deterministic order. Callers use this to reject identity changes that // would discard policy-bearing records rather than choosing a winner silently. @@ -636,19 +690,36 @@ func (ds *DeviceStore) UnlinkTailscaleIdentityE(deviceID, nodeID string) (*Devic return cloneDevice(&result), nil } -// ApplyTailscaleSnapshot refreshes runtime metadata for nodes that have already -// been explicitly linked. Unlinked peers never create inventory records. +// ApplyTailscaleSnapshot refreshes linked nodes without creating inventory for +// unlinked peers. Callers without policy state get the same fail-closed address +// conflict behavior, but cannot identify otherwise transient protected rows. func (ds *DeviceStore) ApplyTailscaleSnapshot(peers []TailscaleIdentity) error { + return ds.ApplyTailscaleSnapshotProtected(peers, nil) +} + +// ApplyTailscaleSnapshotProtected refreshes linked nodes and reconciles only +// disposable address-only observations. Durable or externally referenced rows +// remain as ambiguous claims rather than being silently consolidated. +func (ds *DeviceStore) ApplyTailscaleSnapshotProtected(peers []TailscaleIdentity, protectedIDs map[string]bool) error { ds.mutationMu.Lock() defer ds.mutationMu.Unlock() byID := make(map[string]TailscaleIdentity, len(peers)) for _, peer := range peers { peer.NodeID = normalizeNodeID(peer.NodeID) - if peer.NodeID != "" { - byID[peer.NodeID] = peer + if peer.NodeID == "" { + continue } + addresses := make([]string, 0, len(peer.Addresses)) + for _, value := range peer.Addresses { + if address := normalizeIP(value); address != "" { + addresses = append(addresses, address) + } + } + peer.Addresses = mergeStringSlice(addresses, nil) + byID[peer.NodeID] = peer } + ds.mu.Lock() updatedDevices := make(map[string]*Device) var changed []Device @@ -672,7 +743,6 @@ func (ds *DeviceStore) ApplyTailscaleSnapshot(peers []TailscaleIdentity) error { for i, linked := range updated.TailscaleNodes { peer, ok := byID[normalizeNodeID(linked.NodeID)] if !ok { - updated.TailscaleNodes[i].Addresses = nil updated.TailscaleNodes[i].Online = false continue } @@ -683,9 +753,10 @@ func (ds *DeviceStore) ApplyTailscaleSnapshot(peers []TailscaleIdentity) error { if peer.DNSName == "" { peer.DNSName = linked.DNSName } - if !peer.Online { - peer.Addresses = nil - } else { + if len(peer.Addresses) == 0 { + peer.Addresses = append([]string(nil), linked.Addresses...) + } + if peer.Online { observedOnline = true if peer.LastSeen.IsZero() { peer.LastSeen = time.Now() @@ -700,8 +771,6 @@ func (ds *DeviceStore) ApplyTailscaleSnapshot(peers []TailscaleIdentity) error { updated.Online = true updated.LastSeen = latestSeen } else if previousTailscaleOnline && !previousTailscaleSeen.IsZero() && !updated.LastSeen.After(previousTailscaleSeen) { - // No newer LAN/passive observation exists, so the previous online - // state came from Tailscale and must be cleared with its address claim. updated.Online = false } updated.DisplayName = updated.GetDisplayName() @@ -720,13 +789,28 @@ func (ds *DeviceStore) ApplyTailscaleSnapshot(peers []TailscaleIdentity) error { for id, device := range updatedDevices { ds.devices[id] = device } + // Rebuild once so address churn no longer leaves old aliases in the claim + // index before deciding which pre-existing rows are safe to consolidate. + ds.rebuildIndexes() + for id, device := range updatedDevices { + for _, identity := range device.TailscaleNodes { + for _, address := range identity.Addresses { + for _, owner := range append([]string(nil), ds.deviceByIPClaims[normalizeIP(address)]...) { + if owner == id || protectedIDs[owner] || !isDisposableTailscaleAliasObservation(ds.devices[owner], address) { + continue + } + delete(ds.devices, owner) + } + } + } + } ds.rebuildIndexes() ds.mu.Unlock() return nil } -// ClearTailscaleObservations removes runtime addresses and reachability while -// retaining explicit node links and their last-known durable labels. +// ClearTailscaleObservations removes runtime reachability while retaining +// explicit node links, labels, and their durable last-known overlay aliases. func (ds *DeviceStore) ClearTailscaleObservations() { ds.mutationMu.Lock() defer ds.mutationMu.Unlock() @@ -734,10 +818,16 @@ func (ds *DeviceStore) ClearTailscaleObservations() { ds.mu.Lock() defer ds.mu.Unlock() for _, device := range ds.devices { + previousTailscaleSeen := time.Time{} for i := range device.TailscaleNodes { - device.TailscaleNodes[i].Addresses = nil + if device.TailscaleNodes[i].LastSeen.After(previousTailscaleSeen) { + previousTailscaleSeen = device.TailscaleNodes[i].LastSeen + } device.TailscaleNodes[i].Online = false } + if !previousTailscaleSeen.IsZero() && !device.LastSeen.After(previousTailscaleSeen) { + device.Online = false + } } ds.rebuildIndexes() } @@ -746,6 +836,22 @@ func isDurableDevice(device *Device) bool { return device.Persistent || device.ManualName != "" || device.Owner != "" || device.Category != "" || len(device.TailscaleNodes) > 0 } +func isDisposableTailscaleAliasObservation(device *Device, address string) bool { + if device == nil || isDurableDevice(device) || len(device.MACs) > 0 || len(device.Hostnames) > 0 || len(device.MDNSNames) > 0 { + return false + } + address = normalizeIP(address) + if address == "" || !deviceHasLANIP(device, address) { + return false + } + for _, claimed := range deviceAddresses(device) { + if claimed != address { + return false + } + } + return device.Source == SourcePassive && len(device.Sources) <= 1 +} + // UpsertDevice adds or updates a device in the store and regenerates // its DNS records. The device is matched by ID if it already exists. // Returns the device ID. diff --git a/application/dns/discovery/store_test.go b/application/dns/discovery/store_test.go index bc0b4ca3..d978fe31 100644 --- a/application/dns/discovery/store_test.go +++ b/application/dns/discovery/store_test.go @@ -1280,7 +1280,7 @@ func TestObserveDeviceConcurrentFirstObservationConverges(t *testing.T) { } } -func TestTailscaleLinkResolvesCanonicalDeviceAndClearsOfflineAlias(t *testing.T) { +func TestTailscaleLinkResolvesCanonicalDeviceAndRetainsOfflineAlias(t *testing.T) { store := NewDeviceStore("local") if _, err := store.UpsertDeviceE(&Device{ID: "phone", IPv4: "192.0.2.30", MACs: []string{"aa:bb:cc:dd:ee:ff"}, Persistent: true}); err != nil { t.Fatal(err) @@ -1295,15 +1295,141 @@ func TestTailscaleLinkResolvesCanonicalDeviceAndClearsOfflineAlias(t *testing.T) if err := store.ApplyTailscaleSnapshot([]TailscaleIdentity{{NodeID: "node-1", Name: "Pixel", Addresses: []string{"100.64.0.30"}, Online: false}}); err != nil { t.Fatal(err) } - if got := store.FindDeviceByIP("100.64.0.30"); got != nil { - t.Fatalf("offline peer retained active address claim: %+v", got) + if got := store.FindDeviceByIP("100.64.0.30"); got == nil || got.ID != "phone" { + t.Fatalf("offline peer lost durable address claim: %+v", got) } device := store.GetDevice("phone") - if device == nil || len(device.TailscaleNodes) != 1 || device.TailscaleNodes[0].Online || len(device.TailscaleNodes[0].Addresses) != 0 { + if device == nil || len(device.TailscaleNodes) != 1 || device.TailscaleNodes[0].Online || len(device.TailscaleNodes[0].Addresses) != 1 { t.Fatalf("offline linked device = %+v", device) } } +func TestTailscaleSnapshotMovesAliasToNewAddress(t *testing.T) { + store := NewDeviceStore("local") + if _, err := store.UpsertDeviceE(&Device{ID: "phone", Persistent: true}); err != nil { + t.Fatal(err) + } + if _, err := store.LinkTailscaleIdentityE("phone", TailscaleIdentity{NodeID: "node-1", Addresses: []string{"100.64.0.7"}, Online: true}); err != nil { + t.Fatal(err) + } + + if err := store.ApplyTailscaleSnapshot([]TailscaleIdentity{{NodeID: "node-1", Addresses: []string{"100.64.0.8"}, Online: true}}); err != nil { + t.Fatal(err) + } + if got := store.FindDeviceByIP("100.64.0.7"); got != nil { + t.Fatalf("old alias still resolves: %+v", got) + } + if got := store.FindDeviceByIP("100.64.0.8"); got == nil || got.ID != "phone" { + t.Fatalf("new alias = %+v", got) + } +} + +func TestTailscaleSnapshotRetainsAliasWhenPeerMissing(t *testing.T) { + store := NewDeviceStore("local") + if _, err := store.UpsertDeviceE(&Device{ID: "phone", Persistent: true}); err != nil { + t.Fatal(err) + } + if _, err := store.LinkTailscaleIdentityE("phone", TailscaleIdentity{NodeID: "node-1", Addresses: []string{"100.64.0.9"}, Online: true, LastSeen: time.Now()}); err != nil { + t.Fatal(err) + } + + if err := store.ApplyTailscaleSnapshot(nil); err != nil { + t.Fatal(err) + } + if got := store.FindDeviceByIP("100.64.0.9"); got == nil || got.ID != "phone" || got.TailscaleNodes[0].Online { + t.Fatalf("missing peer alias = %+v", got) + } +} + +func TestTailscaleSnapshotDoesNotCreateUnlinkedPeer(t *testing.T) { + store := NewDeviceStore("local") + if err := store.ApplyTailscaleSnapshot([]TailscaleIdentity{{NodeID: "node-1", Addresses: []string{"100.64.0.10"}, Online: true}}); err != nil { + t.Fatal(err) + } + if store.DeviceCount() != 0 || store.FindDeviceByIP("100.64.0.10") != nil { + t.Fatalf("unlinked peer entered inventory: %+v", store.GetAllDevices()) + } +} + +func TestTailscaleSnapshotReconcilesTransientDuplicate(t *testing.T) { + store := NewDeviceStore("local") + if _, err := store.UpsertDeviceE(&Device{ID: "phone", ManualName: "Pixel", Persistent: true}); err != nil { + t.Fatal(err) + } + if _, err := store.LinkTailscaleIdentityE("phone", TailscaleIdentity{NodeID: "node-1", Name: "Pixel"}); err != nil { + t.Fatal(err) + } + if _, err := store.UpsertDeviceE(&Device{ID: "observed", IPv4: "100.64.0.40", Source: SourcePassive}); err != nil { + t.Fatal(err) + } + + if err := store.ApplyTailscaleSnapshotProtected([]TailscaleIdentity{{NodeID: "node-1", Addresses: []string{"100.64.0.40"}, Online: true}}, nil); err != nil { + t.Fatal(err) + } + if store.GetDevice("observed") != nil || store.DeviceCount() != 1 { + t.Fatalf("transient duplicate survived snapshot: %+v", store.GetAllDevices()) + } + if got := store.FindDeviceByIP("100.64.0.40"); got == nil || got.ID != "phone" || store.IPClaimCount("100.64.0.40") != 1 { + t.Fatalf("canonical alias = %+v, claims = %d", got, store.IPClaimCount("100.64.0.40")) + } +} + +func TestTailscaleSnapshotKeepsEnrichedConflictAmbiguous(t *testing.T) { + store := NewDeviceStore("local") + if _, err := store.UpsertDeviceE(&Device{ID: "phone", Persistent: true}); err != nil { + t.Fatal(err) + } + if _, err := store.LinkTailscaleIdentityE("phone", TailscaleIdentity{NodeID: "node-1"}); err != nil { + t.Fatal(err) + } + if _, err := store.UpsertDeviceE(&Device{ID: "observed", IPv4: "100.64.0.39", MACs: []string{"aa:bb:cc:dd:ee:ff"}, Source: SourcePassive}); err != nil { + t.Fatal(err) + } + + if err := store.ApplyTailscaleSnapshotProtected([]TailscaleIdentity{{NodeID: "node-1", Addresses: []string{"100.64.0.39"}, Online: true}}, nil); err != nil { + t.Fatal(err) + } + if store.GetDevice("observed") == nil || store.IPClaimCount("100.64.0.39") != 2 { + t.Fatalf("enriched conflict was consolidated: %+v", store.GetAllDevices()) + } +} + +func TestTailscaleSnapshotKeepsProtectedConflictAmbiguous(t *testing.T) { + store := NewDeviceStore("local") + if _, err := store.UpsertDeviceE(&Device{ID: "phone", Persistent: true}); err != nil { + t.Fatal(err) + } + if _, err := store.LinkTailscaleIdentityE("phone", TailscaleIdentity{NodeID: "node-1"}); err != nil { + t.Fatal(err) + } + if _, err := store.UpsertDeviceE(&Device{ID: "observed", IPv4: "100.64.0.41", Source: SourcePassive}); err != nil { + t.Fatal(err) + } + + if err := store.ApplyTailscaleSnapshotProtected([]TailscaleIdentity{{NodeID: "node-1", Addresses: []string{"100.64.0.41"}, Online: true}}, map[string]bool{"observed": true}); err != nil { + t.Fatal(err) + } + if store.GetDevice("observed") == nil || store.IPClaimCount("100.64.0.41") != 2 { + t.Fatalf("protected conflict was consolidated: %+v", store.GetAllDevices()) + } +} + +func TestTailscaleClearRetainsLastKnownAlias(t *testing.T) { + store := NewDeviceStore("local") + if _, err := store.UpsertDeviceE(&Device{ID: "phone", Persistent: true}); err != nil { + t.Fatal(err) + } + if _, err := store.LinkTailscaleIdentityE("phone", TailscaleIdentity{NodeID: "node-1", Addresses: []string{"100.64.0.42"}, Online: true, LastSeen: time.Now()}); err != nil { + t.Fatal(err) + } + + store.ClearTailscaleObservations() + device := store.FindDeviceByIP("100.64.0.42") + if device == nil || device.ID != "phone" || device.TailscaleNodes[0].Online || device.Online { + t.Fatalf("cleared linked device = %+v", device) + } +} + func TestTailscaleLinkProtectsReferencedTransientAddressOwner(t *testing.T) { store := NewDeviceStore("local") if _, err := store.UpsertDeviceE(&Device{ID: "phone", IPv4: "192.0.2.40", Persistent: true}); err != nil { diff --git a/application/dns/discovery/types.go b/application/dns/discovery/types.go index bdc1ceea..cde3034f 100644 --- a/application/dns/discovery/types.go +++ b/application/dns/discovery/types.go @@ -20,8 +20,8 @@ const ( ) // TailscaleIdentity links one stable tailscaled node to a canonical device. -// Addresses and reachability are runtime observations; NodeID and names are the -// durable link metadata. WoLMACs are informational and are never LAN identity. +// NodeID, names, and last-known Tailscale addresses are durable link metadata; +// reachability is runtime-only. WoLMACs are informational and never LAN identity. type TailscaleIdentity struct { NodeID string `json:"node_id"` Name string `json:"name,omitempty"` @@ -165,9 +165,20 @@ func (d *Device) HasIP(ip string) bool { if d.IPv4 == ip || d.IPv6 == ip { return true } + return d.HasTailscaleIP(ip) +} + +// HasTailscaleIP reports whether ip is a last-known alias of an explicitly +// linked stable node. These aliases remain useful identity after reachability +// observations expire; address conflicts are handled by the store claim index. +func (d *Device) HasTailscaleIP(ip string) bool { + ip = normalizeIP(ip) + if ip == "" { + return false + } for _, identity := range d.TailscaleNodes { for _, address := range identity.Addresses { - if address == ip { + if normalizeIP(address) == ip { return true } } diff --git a/application/dns/server/ddns.go b/application/dns/server/ddns.go index 62d2c695..7dea25ef 100644 --- a/application/dns/server/ddns.go +++ b/application/dns/server/ddns.go @@ -191,10 +191,10 @@ func applyDDNSAdd(update ddnsUpdate, zone string) { // Match existing device by hostname or IP to merge existing := deviceStore.FindDeviceByHostname(hostname) if existing == nil && device.IPv4 != "" { - existing = deviceStore.FindDeviceByIP(device.IPv4) + existing = deviceStore.FindDeviceByLANIP(device.IPv4) } if existing == nil && device.IPv6 != "" { - existing = deviceStore.FindDeviceByIP(device.IPv6) + existing = deviceStore.FindDeviceByLANIP(device.IPv6) } if existing != nil { device.ID = existing.ID @@ -257,13 +257,14 @@ func applyDDNSDelete(update ddnsUpdate) { } } -// cleanupOrphanedDevices removes addressless, non-persistent devices. +// cleanupOrphanedDevices removes addressless, non-persistent devices that have +// no durable linked overlay identity. func cleanupOrphanedDevices() { if deviceStore == nil { return } for _, d := range deviceStore.GetAllDevices() { - if d.IPv4 == "" && d.IPv6 == "" && !d.Persistent { + if d.IPv4 == "" && d.IPv6 == "" && !d.Persistent && len(d.TailscaleNodes) == 0 { deviceStore.RemoveDevice(d.ID) log.Printf("[DDNS] Cleaned up addressless device: %s (ID: %s)", d.DisplayName, d.ID) } diff --git a/application/dns/server/ddns_test.go b/application/dns/server/ddns_test.go index 38282de2..076a2fda 100644 --- a/application/dns/server/ddns_test.go +++ b/application/dns/server/ddns_test.go @@ -622,6 +622,43 @@ func TestHandleDDNSUpdate_EmptyZoneSection(t *testing.T) { } } +func TestDDNSAddressMatchDoesNotMergeTailscaleAlias(t *testing.T) { + cleanup := setupDDNSTestServer(t) + defer cleanup() + + if _, err := deviceStore.UpsertDeviceE(&discovery.Device{ID: "phone", Persistent: true}); err != nil { + t.Fatal(err) + } + if _, err := deviceStore.LinkTailscaleIdentityE("phone", discovery.TailscaleIdentity{NodeID: "node-1", Addresses: []string{"100.64.0.50"}}); err != nil { + t.Fatal(err) + } + applyDDNSAdd(ddnsUpdate{name: "other.local", rrtype: dns.TypeA, value: "100.64.0.50"}, "local") + + linked := deviceStore.GetDevice("phone") + if linked == nil || len(linked.Hostnames) != 0 || linked.IPv4 != "" { + t.Fatalf("DDNS merged LAN metadata into linked alias: %+v", linked) + } + if deviceStore.DeviceCount() != 2 || deviceStore.IPClaimCount("100.64.0.50") != 2 { + t.Fatalf("DDNS alias collision did not remain ambiguous: %+v", deviceStore.GetAllDevices()) + } +} + +func TestCleanupOrphanedDevicesRetainsLinkedTailscaleDevice(t *testing.T) { + cleanup := setupDDNSTestServer(t) + defer cleanup() + + if _, err := deviceStore.UpsertDeviceE(&discovery.Device{ID: "phone"}); err != nil { + t.Fatal(err) + } + if _, err := deviceStore.LinkTailscaleIdentityE("phone", discovery.TailscaleIdentity{NodeID: "node-1", Name: "Pixel"}); err != nil { + t.Fatal(err) + } + cleanupOrphanedDevices() + if got := deviceStore.GetDevice("phone"); got == nil { + t.Fatal("DDNS cleanup removed linked Tailscale device") + } +} + func TestHandleDDNSUpdate_EnrichPassiveDevice(t *testing.T) { cleanup := setupDDNSTestServer(t) defer cleanup() diff --git a/application/dns/server/server.go b/application/dns/server/server.go index 745c727c..6c1529a0 100644 --- a/application/dns/server/server.go +++ b/application/dns/server/server.go @@ -233,7 +233,10 @@ func startTailscaleManager(lifecycle *tailscaleManagerLifecycle, enabled bool, n // tailscaleDeviceAdapter is the only bridge between the LocalAPI model and // discovery's linked identity model. -type tailscaleDeviceAdapter struct{ store *discovery.DeviceStore } +type tailscaleDeviceAdapter struct { + store *discovery.DeviceStore + protectedIDs func() map[string]bool +} func (a tailscaleDeviceAdapter) ApplyTailscaleSnapshot(peers []gatesentryTailscale.Peer) error { identities := make([]discovery.TailscaleIdentity, 0, len(peers)) @@ -244,7 +247,11 @@ func (a tailscaleDeviceAdapter) ApplyTailscaleSnapshot(peers []gatesentryTailsca LastSeen: peer.LastSeen, WoLMACs: append([]string(nil), peer.WoLMACs...), }) } - return a.store.ApplyTailscaleSnapshot(identities) + var protectedIDs map[string]bool + if a.protectedIDs != nil { + protectedIDs = a.protectedIDs() + } + return a.store.ApplyTailscaleSnapshotProtected(identities, protectedIDs) } func (a tailscaleDeviceAdapter) ClearTailscaleObservations() { @@ -291,17 +298,18 @@ func (deviceResolver) ResolveDeviceByIP(ip string) (string, bool, bool) { if deviceStore == nil { return "", false, false } - device := deviceStore.FindDeviceByIP(ip) - if device == nil { - return "", false, false + deviceID, ambiguous, lastSeen, tailscaleAlias := deviceStore.ResolveIPClaim(ip) + if deviceID == "" { + return "", ambiguous, false } // The claim index includes both LAN and explicitly linked Tailscale // addresses. A shared overlay/LAN address must fall back to the default // policy just like any other ambiguous client address. - ambiguous := deviceStore.IPClaimCount(ip) > 1 - lastSeen := deviceStore.LastSeenForIP(ip) + if !ambiguous && tailscaleAlias { + return deviceID, false, false + } stale := lastSeen.IsZero() || time.Since(lastSeen) > policyStaleDeviceThreshold - return device.ID, ambiguous, stale + return deviceID, ambiguous, stale } // GetPolicyService returns the DNS policy service, or nil before startup. @@ -435,7 +443,15 @@ func StartPolicyEnforcement(basePath string, blockedLists []string, settings *ga func() TailscaleManager { return gatesentryTailscale.NewManager( gatesentryTailscale.NewClient(), - tailscaleDeviceAdapter{store: deviceStore}, + tailscaleDeviceAdapter{ + store: deviceStore, + protectedIDs: func() map[string]bool { + if policyService == nil { + return nil + } + return policyService.ReferencedDeviceIDs() + }, + }, 0, ) }, diff --git a/application/dns/server/server_test.go b/application/dns/server/server_test.go index e33f94d7..fbf3cb3d 100644 --- a/application/dns/server/server_test.go +++ b/application/dns/server/server_test.go @@ -429,6 +429,23 @@ func TestHandleDNS_BareHostname(t *testing.T) { } } +func TestDeviceResolverKeepsLastKnownTailscaleAliasFresh(t *testing.T) { + original := deviceStore + deviceStore = discovery.NewDeviceStore("local") + defer func() { deviceStore = original }() + if _, err := deviceStore.UpsertDeviceE(&discovery.Device{ + ID: "linked-device", + TailscaleNodes: []discovery.TailscaleIdentity{{NodeID: "node-1", Addresses: []string{"100.64.0.7"}}}, + }); err != nil { + t.Fatal(err) + } + + deviceID, ambiguous, stale := (deviceResolver{}).ResolveDeviceByIP("100.64.0.7") + if deviceID != "linked-device" || ambiguous || stale { + t.Fatalf("resolved alias = %q ambiguous=%v stale=%v", deviceID, ambiguous, stale) + } +} + func TestDeviceResolverTreatsTailscaleAddressCollisionAsAmbiguous(t *testing.T) { original := deviceStore deviceStore = discovery.NewDeviceStore("local") diff --git a/application/webserver/frontend/files/fs/bundle.js b/application/webserver/frontend/files/fs/bundle.js index 01f54ea9..58d033e1 100644 --- a/application/webserver/frontend/files/fs/bundle.js +++ b/application/webserver/frontend/files/fs/bundle.js @@ -1,16 +1,16 @@ -var pI=Object.defineProperty;var bI=(t,e,n)=>e in t?pI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var vI=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var sl=(t,e,n)=>(bI(t,typeof e!="symbol"?e+"":e,n),n);var Vbe=vI((El,Ml)=>{(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const r of l)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(l){const r={};return l.integrity&&(r.integrity=l.integrity),l.referrerPolicy&&(r.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?r.credentials="include":l.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(l){if(l.ep)return;l.ep=!0;const r=n(l);fetch(l.href,r)}})();const kI="modulepreload",wI=function(t){return"/"+t},fp={},yI=function(e,n,i){if(!n||n.length===0)return e();const l=document.getElementsByTagName("link");return Promise.all(n.map(r=>{if(r=wI(r),r in fp)return;fp[r]=!0;const s=r.endsWith(".css"),o=s?'[rel="stylesheet"]':"";if(!!i)for(let f=l.length-1;f>=0;f--){const c=l[f];if(c.href===r&&(!s||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${o}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":kI,s||(u.as="script",u.crossOrigin=""),u.href=r,document.head.appendChild(u),s)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>e()).catch(r=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=r,window.dispatchEvent(s),!s.defaultPrevented)throw r})};function he(){}const TI=t=>t;function Y(t,e){for(const n in e)t[n]=e[n];return t}function SI(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function cT(t){return t()}function cp(){return Object.create(null)}function vt(t){t.forEach(cT)}function $s(t){return typeof t=="function"}function Ie(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function EI(t){return Object.keys(t).length===0}function W1(t,...e){if(t==null){for(const i of e)i(void 0);return he}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function MI(t){let e;return W1(t,n=>e=n)(),e}function Mt(t,e,n){t.$$.on_destroy.push(W1(e,n))}function Ze(t,e,n,i){if(t){const l=dT(t,e,n,i);return t[0](l)}}function dT(t,e,n,i){return t[1]&&i?Y(n.ctx.slice(),t[1](i(e))):n.ctx}function Xe(t,e,n,i){if(t[2]&&i){const l=t[2](i(n));if(e.dirty===void 0)return l;if(typeof l=="object"){const r=[],s=Math.max(e.dirty.length,l.length);for(let o=0;o32){const e=[],n=t.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),q1=hT?t=>requestAnimationFrame(t):he;const qo=new Set;function mT(t){qo.forEach(e=>{e.c(t)||(qo.delete(e),e.f())}),qo.size!==0&&q1(mT)}function CI(t){let e;return qo.size===0&&q1(mT),{promise:new Promise(n=>{qo.add(e={c:t,f:n})}),abort(){qo.delete(e)}}}const LI=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function T(t,e){t.appendChild(e)}function gT(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function II(t){const e=R("style");return e.textContent="/* empty */",RI(gT(t),e),e.sheet}function RI(t,e){return T(t.head||t,e),e.sheet}function y(t,e,n){t.insertBefore(e,n||null)}function w(t){t.parentNode&&t.parentNode.removeChild(t)}function Vn(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function ma(t){return function(e){return e.preventDefault(),t.call(this,e)}}function kr(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function P(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}const DI=["width","height"];function Ae(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const i in e)e[i]==null?t.removeAttribute(i):i==="style"?t.style.cssText=e[i]:i==="__value"?t.value=t[i]=e[i]:n[i]&&n[i].set&&DI.indexOf(i)===-1?t[i]=e[i]:P(t,i,e[i])}function rt(t,e){for(const n in e)P(t,n,e[n])}function PI(t){return Array.from(t.childNodes)}function Z(t,e){e=""+e,t.data!==e&&(t.data=e)}function NI(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function BI(t,e,n){~OI.indexOf(n)?NI(t,e):Z(t,e)}function Wl(t,e){t.value=e??""}function wt(t,e,n,i){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function E(t,e,n){t.classList.toggle(e,!!n)}function _T(t,e,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:i})}class zI{constructor(e=!1){sl(this,"is_svg",!1);sl(this,"e");sl(this,"n");sl(this,"t");sl(this,"a");this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,i=null){this.e||(this.is_svg?this.e=Me(n.nodeName):this.e=R(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let n=0;n>>0}function UI(t,e){const n={stylesheet:II(e),rules:{}};return gc.set(t,n),n}function dp(t,e,n,i,l,r,s,o=0){const a=16.666/i;let u=`{ +var bI=Object.defineProperty;var vI=(t,e,n)=>e in t?bI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var kI=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var sl=(t,e,n)=>(vI(t,typeof e!="symbol"?e+"":e,n),n);var Wbe=kI((El,Ml)=>{(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const r of l)if(r.type==="childList")for(const s of r.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&i(s)}).observe(document,{childList:!0,subtree:!0});function n(l){const r={};return l.integrity&&(r.integrity=l.integrity),l.referrerPolicy&&(r.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?r.credentials="include":l.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function i(l){if(l.ep)return;l.ep=!0;const r=n(l);fetch(l.href,r)}})();const wI="modulepreload",yI=function(t){return"/"+t},fp={},TI=function(e,n,i){if(!n||n.length===0)return e();const l=document.getElementsByTagName("link");return Promise.all(n.map(r=>{if(r=yI(r),r in fp)return;fp[r]=!0;const s=r.endsWith(".css"),o=s?'[rel="stylesheet"]':"";if(!!i)for(let f=l.length-1;f>=0;f--){const c=l[f];if(c.href===r&&(!s||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${r}"]${o}`))return;const u=document.createElement("link");if(u.rel=s?"stylesheet":wI,s||(u.as="script",u.crossOrigin=""),u.href=r,document.head.appendChild(u),s)return new Promise((f,c)=>{u.addEventListener("load",f),u.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>e()).catch(r=>{const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=r,window.dispatchEvent(s),!s.defaultPrevented)throw r})};function he(){}const SI=t=>t;function Y(t,e){for(const n in e)t[n]=e[n];return t}function EI(t){return!!t&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function cT(t){return t()}function cp(){return Object.create(null)}function vt(t){t.forEach(cT)}function $s(t){return typeof t=="function"}function Ie(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}function MI(t){return Object.keys(t).length===0}function W1(t,...e){if(t==null){for(const i of e)i(void 0);return he}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function OI(t){let e;return W1(t,n=>e=n)(),e}function Mt(t,e,n){t.$$.on_destroy.push(W1(e,n))}function Ze(t,e,n,i){if(t){const l=dT(t,e,n,i);return t[0](l)}}function dT(t,e,n,i){return t[1]&&i?Y(n.ctx.slice(),t[1](i(e))):n.ctx}function Xe(t,e,n,i){if(t[2]&&i){const l=t[2](i(n));if(e.dirty===void 0)return l;if(typeof l=="object"){const r=[],s=Math.max(e.dirty.length,l.length);for(let o=0;o32){const e=[],n=t.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),q1=hT?t=>requestAnimationFrame(t):he;const qo=new Set;function mT(t){qo.forEach(e=>{e.c(t)||(qo.delete(e),e.f())}),qo.size!==0&&q1(mT)}function LI(t){let e;return qo.size===0&&q1(mT),{promise:new Promise(n=>{qo.add(e={c:t,f:n})}),abort(){qo.delete(e)}}}const gT=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function T(t,e){t.appendChild(e)}function _T(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function II(t){const e=R("style");return e.textContent="/* empty */",RI(_T(t),e),e.sheet}function RI(t,e){return T(t.head||t,e),e.sheet}function y(t,e,n){t.insertBefore(e,n||null)}function w(t){t.parentNode&&t.parentNode.removeChild(t)}function Vn(t,e){for(let n=0;nt.removeEventListener(e,n,i)}function ma(t){return function(e){return e.preventDefault(),t.call(this,e)}}function kr(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function P(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}const DI=["width","height"];function Ae(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const i in e)e[i]==null?t.removeAttribute(i):i==="style"?t.style.cssText=e[i]:i==="__value"?t.value=t[i]=e[i]:n[i]&&n[i].set&&DI.indexOf(i)===-1?t[i]=e[i]:P(t,i,e[i])}function rt(t,e){for(const n in e)P(t,n,e[n])}function PI(t){return Array.from(t.childNodes)}function Z(t,e){e=""+e,t.data!==e&&(t.data=e)}function NI(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function BI(t,e,n){~AI.indexOf(n)?NI(t,e):Z(t,e)}function Wl(t,e){t.value=e??""}function wt(t,e,n,i){n==null?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function E(t,e,n){t.classList.toggle(e,!!n)}function pT(t,e,{bubbles:n=!1,cancelable:i=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:i})}class zI{constructor(e=!1){sl(this,"is_svg",!1);sl(this,"e");sl(this,"n");sl(this,"t");sl(this,"a");this.is_svg=e,this.e=this.n=null}c(e){this.h(e)}m(e,n,i=null){this.e||(this.is_svg?this.e=Me(n.nodeName):this.e=R(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(e)),this.i(i)}h(e){this.e.innerHTML=e,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(e){for(let n=0;n>>0}function UI(t,e){const n={stylesheet:II(e),rules:{}};return gc.set(t,n),n}function dp(t,e,n,i,l,r,s,o=0){const a=16.666/i;let u=`{ `;for(let v=0;v<=1;v+=a){const S=e+(n-e)*r(v);u+=v*100+`%{${s(S,1-S)}} `}const f=u+`100% {${s(n,1-n)}} -}`,c=`__svelte_${HI(f)}_${o}`,d=gT(t),{stylesheet:h,rules:g}=gc.get(d)||UI(d,t);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const _=t.style.animation||"";return t.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,_c+=1,c}function FI(t,e){const n=(t.style.animation||"").split(", "),i=n.filter(e?r=>r.indexOf(e)<0:r=>r.indexOf("__svelte")===-1),l=n.length-i.length;l&&(t.style.animation=i.join(", "),_c-=l,_c||GI())}function GI(){q1(()=>{_c||(gc.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&w(e)}),gc.clear())})}let hu;function Gr(t){hu=t}function Ss(){if(!hu)throw new Error("Function called outside component initialization");return hu}function VI(t){Ss().$$.before_update.push(t)}function _n(t){Ss().$$.on_mount.push(t)}function Cl(t){Ss().$$.after_update.push(t)}function Es(t){Ss().$$.on_destroy.push(t)}function yn(){const t=Ss();return(e,n,{cancelable:i=!1}={})=>{const l=t.$$.callbacks[e];if(l){const r=_T(e,n,{cancelable:i});return l.slice().forEach(s=>{s.call(t,r)}),!r.defaultPrevented}return!0}}function Wi(t,e){return Ss().$$.context.set(t,e),e}function bi(t){return Ss().$$.context.get(t)}function te(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(i=>i.call(this,e))}const Ho=[],ft=[];let jo=[];const Dm=[],pT=Promise.resolve();let Pm=!1;function bT(){Pm||(Pm=!0,pT.then(j1))}function pc(){return bT(),pT}function Qs(t){jo.push(t)}function jt(t){Dm.push(t)}const Yh=new Set;let Io=0;function j1(){if(Io!==0)return;const t=hu;do{try{for(;Iot.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),jo=e}let Va;function jI(){return Va||(Va=Promise.resolve(),Va.then(()=>{Va=null})),Va}function Zh(t,e,n){t.dispatchEvent(_T(`${e?"intro":"outro"}${n}`))}const ec=new Set;let Vr;function fe(){Vr={r:0,c:[],p:Vr}}function ce(){Vr.r||vt(Vr.c),Vr=Vr.p}function b(t,e){t&&t.i&&(ec.delete(t),t.i(e))}function k(t,e,n,i){if(t&&t.o){if(ec.has(t))return;ec.add(t),Vr.c.push(()=>{ec.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}const YI={duration:0};function hp(t,e,n,i){let r=e(t,n,{direction:"both"}),s=i?0:1,o=null,a=null,u=null,f;function c(){u&&FI(t,u)}function d(g,_){const v=g.b-s;return _*=Math.abs(v),{a:s,b:g.b,d:v,duration:_,start:g.start,end:g.start+_,group:g.group}}function h(g){const{delay:_=0,duration:v=300,easing:S=TI,tick:A=he,css:C}=r||YI,I={start:AI()+_,b:g};g||(I.group=Vr,Vr.r+=1),"inert"in t&&(g?f!==void 0&&(t.inert=f):(f=t.inert,t.inert=!0)),o||a?a=I:(C&&(c(),u=dp(t,s,g,v,_,S,C)),g&&A(0,1),o=d(I,v),Qs(()=>Zh(t,g,"start")),CI(M=>{if(a&&M>a.start&&(o=d(a,v),a=null,Zh(t,o.b,"start"),C&&(c(),u=dp(t,s,o.b,o.duration,0,S,r.css))),o){if(M>=o.end)A(s=o.b,1-s),Zh(t,o.b,"end"),a||(o.b?c():--o.group.r||vt(o.group.c)),o=null;else if(M>=o.start){const L=M-o.start;s=o.a+o.d*S(L/o.duration),A(s,1-s)}}return!!(o||a)}))}return{run(g){$s(r)?jI().then(()=>{r=r({direction:g?"in":"out"}),h(g)}):h(g)},end(){c(),o=a=null}}}function Nm(t,e){const n=e.token={};function i(l,r,s,o){if(e.token!==n)return;e.resolved=o;let a=e.ctx;s!==void 0&&(a=a.slice(),a[s]=o);const u=l&&(e.current=l)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==r&&c&&(fe(),k(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ce())}):e.block.d(1),u.c(),b(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[r]=u),f&&j1()}if(SI(t)){const l=Ss();if(t.then(r=>{Gr(l),i(e.then,1,e.value,r),Gr(null)},r=>{if(Gr(l),i(e.catch,2,e.error,r),Gr(null),!e.hasCatch)throw r}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,t),!0;e.resolved=t}}function vT(t,e,n){const i=e.slice(),{resolved:l}=t;t.current===t.then&&(i[t.value]=l),t.current===t.catch&&(i[t.error]=l),t.block.p(i,n)}function ct(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function kT(t,e){t.d(1),e.delete(t.key)}function Qn(t,e){k(t,1,1,()=>{e.delete(t.key)})}function Wn(t,e,n,i,l,r,s,o,a,u,f,c){let d=t.length,h=r.length,g=d;const _={};for(;g--;)_[t[g].key]=g;const v=[],S=new Map,A=new Map,C=[];for(g=h;g--;){const N=c(l,r,g),z=n(N);let W=s.get(z);W?i&&C.push(()=>W.p(N,e)):(W=u(z,N),W.c()),S.set(z,v[g]=W),z in _&&A.set(z,Math.abs(g-_[z]))}const I=new Set,M=new Set;function L(N){b(N,1),N.m(o,f),s.set(N.key,N),f=N.first,h--}for(;d&&h;){const N=v[h-1],z=t[d-1],W=N.key,D=z.key;N===z?(f=N.first,d--,h--):S.has(D)?!s.has(W)||I.has(W)?L(N):M.has(D)?d--:A.get(W)>A.get(D)?(M.add(W),L(N)):(I.add(D),d--):(a(z,s),d--)}for(;d--;){const N=t[d];S.has(N.key)||a(N,s)}for(;h;)L(v[h-1]);return vt(C),v}function Ue(t,e){const n={},i={},l={$$scope:1};let r=t.length;for(;r--;){const s=t[r],o=e[r];if(o){for(const a in s)a in o||(i[a]=1);for(const a in o)l[a]||(n[a]=o[a],l[a]=1);t[r]=o}else for(const a in s)l[a]=1}for(const s in i)s in n||(n[s]=void 0);return n}function ul(t){return typeof t=="object"&&t!==null?t:{}}function Yt(t,e,n){const i=t.$$.props[e];i!==void 0&&(t.$$.bound[i]=n,n(t.$$.ctx[i]))}function F(t){t&&t.c()}function H(t,e,n){const{fragment:i,after_update:l}=t.$$;i&&i.m(e,n),Qs(()=>{const r=t.$$.on_mount.map(cT).filter($s);t.$$.on_destroy?t.$$.on_destroy.push(...r):vt(r),t.$$.on_mount=[]}),l.forEach(Qs)}function U(t,e){const n=t.$$;n.fragment!==null&&(qI(n.after_update),vt(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ZI(t,e){t.$$.dirty[0]===-1&&(Ho.push(t),bT(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const g=h.length?h[0]:d;return u.ctx&&l(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&ZI(t,c)),d}):[],u.update(),f=!0,vt(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=PI(e.target);u.fragment&&u.fragment.l(c),c.forEach(w)}else u.fragment&&u.fragment.c();e.intro&&b(t.$$.fragment),H(t,e.target,e.anchor),j1()}Gr(a)}class De{constructor(){sl(this,"$$");sl(this,"$$set")}$destroy(){U(this,1),this.$destroy=he}$on(e,n){if(!$s(n))return he;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!EI(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const XI="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(XI);const Ro=[];function KI(t,e){return{subscribe:un(t,e).subscribe}}function un(t,e=he){let n;const i=new Set;function l(o){if(Ie(t,o)&&(t=o,n)){const a=!Ro.length;for(const u of i)u[1](),Ro.push(u,t);if(a){for(let u=0;u{i.delete(u),i.size===0&&n&&(n(),n=null)}}return{set:l,update:r,subscribe:s}}function Ms(t,e,n){const i=!Array.isArray(t),l=i?[t]:t;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const r=e.length<2;return KI(n,(s,o)=>{let a=!1;const u=[];let f=0,c=he;const d=()=>{if(f)return;c();const g=e(i?u[0]:u,s,o);r?s(g):c=$s(g)?g:he},h=l.map((g,_)=>W1(g,v=>{u[_]=v,f&=~(1<<_),a&&d()},()=>{f|=1<<_}));return a=!0,d(),function(){vt(h),c(),a=!1}})}function mp(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function $I(t){let e,n,i=t[1]&&mp(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let QI=class extends De{constructor(e){super(),Re(this,e,JI,$I,Ie,{size:0,title:1})}};const wT=QI;function gp(t,e,n){const i=t.slice();return i[7]=e[n],i}function _p(t,e){let n,i,l;return{key:t,first:null,c(){n=R("div"),i=R("span"),i.textContent=" ",l=B(),E(i,"bx--link",!0),E(n,"bx--breadcrumb-item",!0),this.first=n},m(r,s){y(r,n,s),T(n,i),T(n,l)},p(r,s){},d(r){r&&w(n)}}}function xI(t){let e,n=[],i=new Map,l,r,s=ct(Array.from({length:t[1]},pp));const o=f=>f[7];for(let f=0;fe;function eR(t,e,n){const i=["noTrailingSlash","count"];let l=ae(e,i),{noTrailingSlash:r=!1}=e,{count:s=3}=e;function o(c){te.call(this,t,c)}function a(c){te.call(this,t,c)}function u(c){te.call(this,t,c)}function f(c){te.call(this,t,c)}return t.$$set=c=>{e=Y(Y({},e),Se(c)),n(2,l=ae(e,i)),"noTrailingSlash"in c&&n(0,r=c.noTrailingSlash),"count"in c&&n(1,s=c.count)},[r,s,l,o,a,u,f]}class tR extends De{constructor(e){super(),Re(this,e,eR,xI,Ie,{noTrailingSlash:0,count:1})}}const nR=tR;function iR(t){let e,n,i,l,r;const s=t[4].default,o=Ze(s,t,t[3],null);let a=[{"aria-label":"Breadcrumb"},t[2]],u={};for(let f=0;f{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function sR(t,e,n){const i=["noTrailingSlash","skeleton"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{noTrailingSlash:o=!1}=e,{skeleton:a=!1}=e;function u(S){te.call(this,t,S)}function f(S){te.call(this,t,S)}function c(S){te.call(this,t,S)}function d(S){te.call(this,t,S)}function h(S){te.call(this,t,S)}function g(S){te.call(this,t,S)}function _(S){te.call(this,t,S)}function v(S){te.call(this,t,S)}return t.$$set=S=>{e=Y(Y({},e),Se(S)),n(2,l=ae(e,i)),"noTrailingSlash"in S&&n(0,o=S.noTrailingSlash),"skeleton"in S&&n(1,a=S.skeleton),"$$scope"in S&&n(3,s=S.$$scope)},[o,a,l,s,r,u,f,c,d,h,g,_,v]}class oR extends De{constructor(e){super(),Re(this,e,sR,rR,Ie,{noTrailingSlash:0,skeleton:1})}}const Kr=oR,aR=t=>({}),bp=t=>({}),uR=t=>({}),vp=t=>({});function fR(t){let e,n,i,l,r,s;const o=t[10].default,a=Ze(o,t,t[9],null);let u=!t[3]&&(t[8].icon||t[4])&&kp(t),f=[{rel:i=t[7].target==="_blank"?"noopener noreferrer":void 0},{href:t[2]},t[7]],c={};for(let d=0;d{u=null}),ce()),Ae(e,c=Ue(f,[(!l||h&128&&i!==(i=d[7].target==="_blank"?"noopener noreferrer":void 0))&&{rel:i},(!l||h&4)&&{href:d[2]},h&128&&d[7]])),E(e,"bx--link",!0),E(e,"bx--link--disabled",d[5]),E(e,"bx--link--inline",d[3]),E(e,"bx--link--visited",d[6]),E(e,"bx--link--sm",d[1]==="sm"),E(e,"bx--link--lg",d[1]==="lg")},i(d){l||(b(a,d),b(u),l=!0)},o(d){k(a,d),k(u),l=!1},d(d){d&&w(e),a&&a.d(d),u&&u.d(),t[20](null),r=!1,vt(s)}}}function cR(t){let e,n,i,l,r;const s=t[10].default,o=Ze(s,t,t[9],null);let a=!t[3]&&(t[8].icon||t[4])&&wp(t),u=[t[7]],f={};for(let c=0;c{a=null}),ce()),Ae(e,f=Ue(u,[d&128&&c[7]])),E(e,"bx--link",!0),E(e,"bx--link--disabled",c[5]),E(e,"bx--link--inline",c[3]),E(e,"bx--link--visited",c[6])},i(c){i||(b(o,c),b(a),i=!0)},o(c){k(o,c),k(a),i=!1},d(c){c&&w(e),o&&o.d(c),a&&a.d(),t[19](null),l=!1,vt(r)}}}function kp(t){let e,n;const i=t[10].icon,l=Ze(i,t,t[9],bp),r=l||dR(t);return{c(){e=R("div"),r&&r.c(),E(e,"bx--link__icon",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&512)&&Ke(l,i,s,s[9],n?Xe(i,s[9],o,aR):$e(s[9]),bp):r&&r.p&&(!n||o&16)&&r.p(s,n?o:-1)},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function dR(t){let e,n,i;var l=t[4];function r(s,o){return{}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&16&&l!==(l=s[4])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function wp(t){let e,n;const i=t[10].icon,l=Ze(i,t,t[9],vp),r=l||hR(t);return{c(){e=R("div"),r&&r.c(),E(e,"bx--link__icon",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&512)&&Ke(l,i,s,s[9],n?Xe(i,s[9],o,uR):$e(s[9]),vp):r&&r.p&&(!n||o&16)&&r.p(s,n?o:-1)},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function hR(t){let e,n,i;var l=t[4];function r(s,o){return{}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&16&&l!==(l=s[4])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function mR(t){let e,n,i,l;const r=[cR,fR],s=[];function o(a,u){return a[5]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,[u]){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function gR(t,e,n){const i=["size","href","inline","icon","disabled","visited","ref"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e;const o=Yi(r);let{size:a=void 0}=e,{href:u=void 0}=e,{inline:f=!1}=e,{icon:c=void 0}=e,{disabled:d=!1}=e,{visited:h=!1}=e,{ref:g=null}=e;function _(W){te.call(this,t,W)}function v(W){te.call(this,t,W)}function S(W){te.call(this,t,W)}function A(W){te.call(this,t,W)}function C(W){te.call(this,t,W)}function I(W){te.call(this,t,W)}function M(W){te.call(this,t,W)}function L(W){te.call(this,t,W)}function N(W){ft[W?"unshift":"push"](()=>{g=W,n(0,g)})}function z(W){ft[W?"unshift":"push"](()=>{g=W,n(0,g)})}return t.$$set=W=>{e=Y(Y({},e),Se(W)),n(7,l=ae(e,i)),"size"in W&&n(1,a=W.size),"href"in W&&n(2,u=W.href),"inline"in W&&n(3,f=W.inline),"icon"in W&&n(4,c=W.icon),"disabled"in W&&n(5,d=W.disabled),"visited"in W&&n(6,h=W.visited),"ref"in W&&n(0,g=W.ref),"$$scope"in W&&n(9,s=W.$$scope)},[g,a,u,f,c,d,h,l,o,s,r,_,v,S,A,C,I,M,L,N,z]}class _R extends De{constructor(e){super(),Re(this,e,gR,mR,Ie,{size:1,href:2,inline:3,icon:4,disabled:5,visited:6,ref:0})}}const pR=_R,bR=t=>({props:t&4}),yp=t=>({props:{"aria-current":t[2]["aria-current"],class:"bx--link"}});function vR(t){let e;const n=t[3].default,i=Ze(n,t,t[8],yp);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&260)&&Ke(i,n,l,l[8],e?Xe(n,l[8],r,bR):$e(l[8]),yp)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function kR(t){let e,n;return e=new pR({props:{href:t[0],"aria-current":t[2]["aria-current"],$$slots:{default:[wR]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.href=i[0]),l&4&&(r["aria-current"]=i[2]["aria-current"]),l&256&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function wR(t){let e;const n=t[3].default,i=Ze(n,t,t[8],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&256)&&Ke(i,n,l,l[8],e?Xe(n,l[8],r,null):$e(l[8]),null)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function yR(t){let e,n,i,l,r,s;const o=[kR,vR],a=[];function u(d,h){return d[0]?0:1}n=u(t),i=a[n]=o[n](t);let f=[t[2]],c={};for(let d=0;d{a[g]=null}),ce(),i=a[n],i?i.p(d,h):(i=a[n]=o[n](d),i.c()),b(i,1),i.m(e,null)),Ae(e,c=Ue(f,[h&4&&d[2]])),E(e,"bx--breadcrumb-item",!0),E(e,"bx--breadcrumb-item--current",d[1]&&d[2]["aria-current"]!=="page")},i(d){l||(b(i),l=!0)},o(d){k(i),l=!1},d(d){d&&w(e),a[n].d(),r=!1,vt(s)}}}function TR(t,e,n){const i=["href","isCurrentPage"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{href:o=void 0}=e,{isCurrentPage:a=!1}=e;Wi("BreadcrumbItem",{});function u(h){te.call(this,t,h)}function f(h){te.call(this,t,h)}function c(h){te.call(this,t,h)}function d(h){te.call(this,t,h)}return t.$$set=h=>{e=Y(Y({},e),Se(h)),n(2,l=ae(e,i)),"href"in h&&n(0,o=h.href),"isCurrentPage"in h&&n(1,a=h.isCurrentPage),"$$scope"in h&&n(8,s=h.$$scope)},[o,a,l,r,u,f,c,d,s]}class SR extends De{constructor(e){super(),Re(this,e,TR,yR,Ie,{href:0,isCurrentPage:1})}}const Si=SR;function ER(t){let e,n,i,l=[t[2]],r={};for(let s=0;s{e=Y(Y({},e),Se(_)),n(2,l=ae(e,i)),"href"in _&&n(0,r=_.href),"size"in _&&n(1,s=_.size)},[r,s,l,o,a,u,f,c,d,h,g]}class CR extends De{constructor(e){super(),Re(this,e,AR,OR,Ie,{href:0,size:1})}}const LR=CR,IR=t=>({props:t[0]&512}),Tp=t=>({props:t[9]});function RR(t){let e,n,i,l,r,s,o=t[8]&&Sp(t);const a=t[19].default,u=Ze(a,t,t[18],null);var f=t[2];function c(g,_){return{props:{"aria-hidden":"true",class:"bx--btn__icon",style:g[8]?"margin-left: 0":void 0,"aria-label":g[3]}}}f&&(i=cn(f,c(t)));let d=[t[9]],h={};for(let g=0;g{U(v,1)}),ce()}f?(i=cn(f,c(g)),F(i.$$.fragment),b(i.$$.fragment,1),H(i,e,null)):i=null}else if(f){const v={};_[0]&256&&(v.style=g[8]?"margin-left: 0":void 0),_[0]&8&&(v["aria-label"]=g[3]),i.$set(v)}Ae(e,h=Ue(d,[_[0]&512&&g[9]]))},i(g){l||(b(u,g),i&&b(i.$$.fragment,g),l=!0)},o(g){k(u,g),i&&k(i.$$.fragment,g),l=!1},d(g){g&&w(e),o&&o.d(),u&&u.d(g),i&&U(i),t[33](null),r=!1,vt(s)}}}function DR(t){let e,n,i,l,r,s,o=t[8]&&Ep(t);const a=t[19].default,u=Ze(a,t,t[18],null);var f=t[2];function c(g,_){return{props:{"aria-hidden":"true",class:"bx--btn__icon","aria-label":g[3]}}}f&&(i=cn(f,c(t)));let d=[t[9]],h={};for(let g=0;g{U(v,1)}),ce()}f?(i=cn(f,c(g)),F(i.$$.fragment),b(i.$$.fragment,1),H(i,e,null)):i=null}else if(f){const v={};_[0]&8&&(v["aria-label"]=g[3]),i.$set(v)}Ae(e,h=Ue(d,[_[0]&512&&g[9]]))},i(g){l||(b(u,g),i&&b(i.$$.fragment,g),l=!0)},o(g){k(u,g),i&&k(i.$$.fragment,g),l=!1},d(g){g&&w(e),o&&o.d(),u&&u.d(g),i&&U(i),t[32](null),r=!1,vt(s)}}}function PR(t){let e;const n=t[19].default,i=Ze(n,t,t[18],Tp);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r[0]&262656)&&Ke(i,n,l,l[18],e?Xe(n,l[18],r,IR):$e(l[18]),Tp)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function NR(t){let e,n;const i=[{href:t[7]},{size:t[1]},t[10],{style:t[8]&&"width: 3rem;"}];let l={};for(let r=0;r{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function zR(t,e,n){let i,l;const r=["kind","size","expressive","isSelected","icon","iconDescription","tooltipAlignment","tooltipPosition","as","skeleton","disabled","href","tabindex","type","ref"];let s=ae(e,r),{$$slots:o={},$$scope:a}=e;const u=Yi(o);let{kind:f="primary"}=e,{size:c="default"}=e,{expressive:d=!1}=e,{isSelected:h=!1}=e,{icon:g=void 0}=e,{iconDescription:_=void 0}=e,{tooltipAlignment:v="center"}=e,{tooltipPosition:S="bottom"}=e,{as:A=!1}=e,{skeleton:C=!1}=e,{disabled:I=!1}=e,{href:M=void 0}=e,{tabindex:L="0"}=e,{type:N="button"}=e,{ref:z=null}=e;const W=bi("ComposedModal");function D(pe){te.call(this,t,pe)}function G(pe){te.call(this,t,pe)}function $(pe){te.call(this,t,pe)}function j(pe){te.call(this,t,pe)}function Q(pe){te.call(this,t,pe)}function le(pe){te.call(this,t,pe)}function oe(pe){te.call(this,t,pe)}function X(pe){te.call(this,t,pe)}function de(pe){te.call(this,t,pe)}function re(pe){te.call(this,t,pe)}function x(pe){te.call(this,t,pe)}function me(pe){te.call(this,t,pe)}function ee(pe){ft[pe?"unshift":"push"](()=>{z=pe,n(0,z)})}function ke(pe){ft[pe?"unshift":"push"](()=>{z=pe,n(0,z)})}return t.$$set=pe=>{e=Y(Y({},e),Se(pe)),n(10,s=ae(e,r)),"kind"in pe&&n(11,f=pe.kind),"size"in pe&&n(1,c=pe.size),"expressive"in pe&&n(12,d=pe.expressive),"isSelected"in pe&&n(13,h=pe.isSelected),"icon"in pe&&n(2,g=pe.icon),"iconDescription"in pe&&n(3,_=pe.iconDescription),"tooltipAlignment"in pe&&n(14,v=pe.tooltipAlignment),"tooltipPosition"in pe&&n(15,S=pe.tooltipPosition),"as"in pe&&n(4,A=pe.as),"skeleton"in pe&&n(5,C=pe.skeleton),"disabled"in pe&&n(6,I=pe.disabled),"href"in pe&&n(7,M=pe.href),"tabindex"in pe&&n(16,L=pe.tabindex),"type"in pe&&n(17,N=pe.type),"ref"in pe&&n(0,z=pe.ref),"$$scope"in pe&&n(18,a=pe.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&1&&W&&z&&W.declareRef(z),t.$$.dirty[0]&4&&n(8,i=g&&!u.default),n(9,l={type:M&&!I?void 0:N,tabindex:L,disabled:I===!0?!0:void 0,href:M,"aria-pressed":i&&f==="ghost"&&!M?h:void 0,...s,class:["bx--btn",d&&"bx--btn--expressive",(c==="small"&&!d||c==="sm"&&!d||c==="small"&&!d)&&"bx--btn--sm",c==="field"&&!d||c==="md"&&!d&&"bx--btn--md",c==="field"&&"bx--btn--field",c==="small"&&"bx--btn--sm",c==="lg"&&"bx--btn--lg",c==="xl"&&"bx--btn--xl",f&&`bx--btn--${f}`,I&&"bx--btn--disabled",i&&"bx--btn--icon-only",i&&"bx--tooltip__trigger",i&&"bx--tooltip--a11y",i&&S&&`bx--btn--icon-only--${S}`,i&&v&&`bx--tooltip--align-${v}`,i&&h&&f==="ghost"&&"bx--btn--selected",s.class].filter(Boolean).join(" ")})},[z,c,g,_,A,C,I,M,i,l,s,f,d,h,v,S,L,N,a,o,D,G,$,j,Q,le,oe,X,de,re,x,me,ee,ke]}class HR extends De{constructor(e){super(),Re(this,e,zR,BR,Ie,{kind:11,size:1,expressive:12,isSelected:13,icon:2,iconDescription:3,tooltipAlignment:14,tooltipPosition:15,as:4,skeleton:5,disabled:6,href:7,tabindex:16,type:17,ref:0},null,[-1,-1])}}const Rt=HR;function UR(t){let e,n;const i=t[3].default,l=Ze(i,t,t[2],null);let r=[t[1]],s={};for(let o=0;o{e=Y(Y({},e),Se(a)),n(1,l=ae(e,i)),"stacked"in a&&n(0,o=a.stacked),"$$scope"in a&&n(2,s=a.$$scope)},[o,l,s,r]}class GR extends De{constructor(e){super(),Re(this,e,FR,UR,Ie,{stacked:0})}}const VR=GR;function WR(t){let e,n,i,l,r=[t[0]],s={};for(let o=0;o{e=Y(Y({},e),Se(u)),n(0,l=ae(e,i))},[l,r,s,o,a]}class jR extends De{constructor(e){super(),Re(this,e,qR,WR,Ie,{})}}const YR=jR,ZR=t=>({}),Mp=t=>({});function XR(t){let e,n,i,l,r,s,o,a;const u=t[19].labelText,f=Ze(u,t,t[18],Mp),c=f||$R(t);let d=[t[16]],h={};for(let g=0;g{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function QR(t,e,n){let i,l;const r=["value","checked","group","indeterminate","skeleton","required","readonly","disabled","labelText","hideLabel","name","title","id","ref"];let s=ae(e,r),{$$slots:o={},$$scope:a}=e,{value:u=""}=e,{checked:f=!1}=e,{group:c=void 0}=e,{indeterminate:d=!1}=e,{skeleton:h=!1}=e,{required:g=!1}=e,{readonly:_=!1}=e,{disabled:v=!1}=e,{labelText:S=""}=e,{hideLabel:A=!1}=e,{name:C=""}=e,{title:I=void 0}=e,{id:M="ccs-"+Math.random().toString(36)}=e,{ref:L=null}=e;const N=yn();let z=null;function W(ee){te.call(this,t,ee)}function D(ee){te.call(this,t,ee)}function G(ee){te.call(this,t,ee)}function $(ee){te.call(this,t,ee)}function j(ee){te.call(this,t,ee)}function Q(ee){te.call(this,t,ee)}function le(ee){te.call(this,t,ee)}function oe(ee){te.call(this,t,ee)}function X(ee){te.call(this,t,ee)}function de(ee){te.call(this,t,ee)}function re(ee){ft[ee?"unshift":"push"](()=>{L=ee,n(3,L)})}const x=()=>{i?n(1,c=c.includes(u)?c.filter(ee=>ee!==u):[...c,u]):n(0,f=!f)};function me(ee){ft[ee?"unshift":"push"](()=>{z=ee,n(14,z)})}return t.$$set=ee=>{e=Y(Y({},e),Se(ee)),n(16,s=ae(e,r)),"value"in ee&&n(4,u=ee.value),"checked"in ee&&n(0,f=ee.checked),"group"in ee&&n(1,c=ee.group),"indeterminate"in ee&&n(5,d=ee.indeterminate),"skeleton"in ee&&n(6,h=ee.skeleton),"required"in ee&&n(7,g=ee.required),"readonly"in ee&&n(8,_=ee.readonly),"disabled"in ee&&n(9,v=ee.disabled),"labelText"in ee&&n(10,S=ee.labelText),"hideLabel"in ee&&n(11,A=ee.hideLabel),"name"in ee&&n(12,C=ee.name),"title"in ee&&n(2,I=ee.title),"id"in ee&&n(13,M=ee.id),"ref"in ee&&n(3,L=ee.ref),"$$scope"in ee&&n(18,a=ee.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&2&&n(15,i=Array.isArray(c)),t.$$.dirty[0]&32787&&n(0,f=i?c.includes(u):f),t.$$.dirty[0]&1&&N("check",f),t.$$.dirty[0]&16384&&n(17,l=(z==null?void 0:z.offsetWidth)<(z==null?void 0:z.scrollWidth)),t.$$.dirty[0]&147460&&n(2,I=!I&&l?z==null?void 0:z.innerText:I)},[f,c,I,L,u,d,h,g,_,v,S,A,C,M,z,i,s,l,a,o,W,D,G,$,j,Q,le,oe,X,de,re,x,me]}class xR extends De{constructor(e){super(),Re(this,e,QR,JR,Ie,{value:4,checked:0,group:1,indeterminate:5,skeleton:6,required:7,readonly:8,disabled:9,labelText:10,hideLabel:11,name:12,title:2,id:13,ref:3},null,[-1,-1])}}const yT=xR;function eD(t){let e,n,i,l,r,s,o,a,u,f=[{type:"checkbox"},{checked:i=t[2]?!1:t[1]},{indeterminate:t[2]},{id:t[4]},t[5],{"aria-checked":l=t[2]?void 0:t[1]}],c={};for(let d=0;d{u=d,n(0,u)})}return t.$$set=d=>{n(6,e=Y(Y({},e),Se(d))),n(5,l=ae(e,i)),"checked"in d&&n(1,r=d.checked),"indeterminate"in d&&n(2,s=d.indeterminate),"title"in d&&n(3,o=d.title),"id"in d&&n(4,a=d.id),"ref"in d&&n(0,u=d.ref)},e=Se(e),[u,r,s,o,a,l,e,f,c]}class nD extends De{constructor(e){super(),Re(this,e,tD,eD,Ie,{checked:1,indeterminate:2,title:3,id:4,ref:0})}}const TT=nD;function iD(t){let e,n,i,l;const r=t[6].default,s=Ze(r,t,t[5],null);let o=[{role:"tablist"},t[1]],a={};for(let u=0;u{C&&n(2,u=l.length),n(4,l=[...l,{id:S,text:A,selected:C}])},update:S=>{n(2,u=l.map(({id:A})=>A).indexOf(S))},change:S=>{let A=i+S;A<0?A=l.length-1:A>=l.length&&(A=0),n(2,u=A)}}),Cl(()=>{u!==i&&n(3,i=u)});function h(S){te.call(this,t,S)}function g(S){te.call(this,t,S)}function _(S){te.call(this,t,S)}function v(S){te.call(this,t,S)}return t.$$set=S=>{e=Y(Y({},e),Se(S)),n(1,s=ae(e,r)),"selectedIndex"in S&&n(2,u=S.selectedIndex),"size"in S&&n(0,f=S.size),"$$scope"in S&&n(5,a=S.$$scope)},t.$$.update=()=>{t.$$.dirty&24&&l[i]&&(c("change",i),d.set(l[i].id))},n(3,i=-1),n(4,l=[]),[f,s,u,i,l,a,o,h,g,_,v]}class rD extends De{constructor(e){super(),Re(this,e,lD,iD,Ie,{selectedIndex:2,size:0})}}const sD=rD;function oD(t){let e;return{c(){e=q(t[2])},m(n,i){y(n,e,i)},p(n,i){i&4&&Z(e,n[2])},d(n){n&&w(e)}}}function aD(t){let e,n,i,l,r,s;const o=t[8].default,a=Ze(o,t,t[7],null),u=a||oD(t);let f=[{type:"button"},{role:"tab"},{tabindex:i=t[0]?"0":"-1"},{"aria-selected":t[0]},{disabled:t[3]},{id:t[4]},t[6]],c={};for(let d=0;d{n(0,a=L===f)});Cl(()=>{a&&c.focus()}),_n(()=>()=>h());function g(L){te.call(this,t,L)}function _(L){te.call(this,t,L)}function v(L){te.call(this,t,L)}function S(L){te.call(this,t,L)}function A(L){te.call(this,t,L)}function C(L){ft[L?"unshift":"push"](()=>{c=L,n(1,c)})}const I=()=>{d.update(f)},M=({key:L})=>{L==="ArrowRight"?d.change(1):L==="ArrowLeft"&&d.change(-1)};return t.$$set=L=>{e=Y(Y({},e),Se(L)),n(6,l=ae(e,i)),"text"in L&&n(2,o=L.text),"selected"in L&&n(0,a=L.selected),"disabled"in L&&n(3,u=L.disabled),"id"in L&&n(4,f=L.id),"ref"in L&&n(1,c=L.ref),"$$scope"in L&&n(7,s=L.$$scope)},[a,c,o,u,f,d,l,s,r,g,_,v,S,A,C,I,M]}class fD extends De{constructor(e){super(),Re(this,e,uD,aD,Ie,{text:2,selected:0,disabled:3,id:4,ref:1})}}const Op=fD;function Ap(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function cD(t){let e,n,i,l=t[1]&&Ap(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class hD extends De{constructor(e){super(),Re(this,e,dD,cD,Ie,{size:0,title:1})}}const mD=hD;function gD(t){let e,n,i,l,r,s,o,a;n=new mD({props:{class:"bx--snippet__icon"}});let u=[{type:"button"},{"aria-live":"polite"},{"aria-label":t[2]},{title:t[2]},t[8]],f={};for(let c=0;c{try{await navigator.clipboard.writeText(S)}catch(A){console.log(A)}}}=e;const f=yn();let c,d;_n(()=>()=>clearTimeout(d));function h(S){te.call(this,t,S)}function g(S){te.call(this,t,S)}const _=()=>{a!==void 0&&(u(a),f("copy")),c!=="fade-in"&&(n(5,c="fade-in"),n(6,d=setTimeout(()=>{n(5,c="fade-out")},s)))},v=({animationName:S})=>{S==="hide-feedback"&&n(5,c=void 0)};return t.$$set=S=>{e=Y(Y({},e),Se(S)),n(8,l=ae(e,i)),"feedback"in S&&n(0,r=S.feedback),"feedbackTimeout"in S&&n(1,s=S.feedbackTimeout),"iconDescription"in S&&n(2,o=S.iconDescription),"text"in S&&n(3,a=S.text),"copy"in S&&n(4,u=S.copy)},[r,s,o,a,u,c,d,f,l,h,g,_,v]}class pD extends De{constructor(e){super(),Re(this,e,_D,gD,Ie,{feedback:0,feedbackTimeout:1,iconDescription:2,text:3,copy:4})}}const bD=pD;function Cp(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function vD(t){let e,n,i,l=t[1]&&Cp(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class wD extends De{constructor(e){super(),Re(this,e,kD,vD,Ie,{size:0,title:1})}}const Os=wD;function Lp(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function yD(t){let e,n,i,l,r=t[1]&&Lp(t),s=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],o={};for(let a=0;a{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class SD extends De{constructor(e){super(),Re(this,e,TD,yD,Ie,{size:0,title:1})}}const Lu=SD;function Ip(t){let e,n;return{c(){e=R("div"),n=q(t[6]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&64&&Z(n,i[6])},d(i){i&&w(e)}}}function Rp(t){let e,n;return{c(){e=R("div"),n=q(t[8]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&256&&Z(n,i[8])},d(i){i&&w(e)}}}function ED(t){let e,n,i,l,r,s,o,a;const u=t[11].default,f=Ze(u,t,t[10],null);let c=[{role:"listbox"},{tabindex:"-1"},{"data-invalid":n=t[5]||void 0},t[9]],d={};for(let _=0;_{t.key==="Escape"&&t.stopPropagation()};function OD(t,e,n){const i=["size","type","open","light","disabled","invalid","invalidText","warn","warnText"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{size:o=void 0}=e,{type:a="default"}=e,{open:u=!1}=e,{light:f=!1}=e,{disabled:c=!1}=e,{invalid:d=!1}=e,{invalidText:h=""}=e,{warn:g=!1}=e,{warnText:_=""}=e;function v(A){te.call(this,t,A)}function S(A){te.call(this,t,A)}return t.$$set=A=>{e=Y(Y({},e),Se(A)),n(9,l=ae(e,i)),"size"in A&&n(0,o=A.size),"type"in A&&n(1,a=A.type),"open"in A&&n(2,u=A.open),"light"in A&&n(3,f=A.light),"disabled"in A&&n(4,c=A.disabled),"invalid"in A&&n(5,d=A.invalid),"invalidText"in A&&n(6,h=A.invalidText),"warn"in A&&n(7,g=A.warn),"warnText"in A&&n(8,_=A.warnText),"$$scope"in A&&n(10,s=A.$$scope)},[o,a,u,f,c,d,h,g,_,l,s,r,v,S]}class AD extends De{constructor(e){super(),Re(this,e,OD,ED,Ie,{size:0,type:1,open:2,light:3,disabled:4,invalid:5,invalidText:6,warn:7,warnText:8})}}const CD=AD;function LD(t){let e,n,i,l,r,s,o,a;const u=t[11].default,f=Ze(u,t,t[10],null);let c=[{role:t[2]},{"aria-expanded":t[6]},{"aria-owns":n=t[6]&&t[5]||void 0},{"aria-controls":i=t[6]&&t[5]||void 0},{"aria-disabled":t[1]},{"aria-label":l=t[6]?t[4]("close"):t[4]("open")},{tabindex:r=t[1]?"-1":t[3]},t[7]],d={};for(let h=0;hv[D]}=e,{id:g="ccs-"+Math.random().toString(36)}=e,{ref:_=null}=e;const v={[d.close]:"Close menu",[d.open]:"Open menu"},S=bi("MultiSelect");function A(D){te.call(this,t,D)}function C(D){te.call(this,t,D)}function I(D){te.call(this,t,D)}function M(D){te.call(this,t,D)}function L(D){te.call(this,t,D)}function N(D){te.call(this,t,D)}function z(D){te.call(this,t,D)}function W(D){ft[D?"unshift":"push"](()=>{_=D,n(0,_)})}return t.$$set=D=>{n(22,e=Y(Y({},e),Se(D))),n(7,s=ae(e,r)),"disabled"in D&&n(1,u=D.disabled),"role"in D&&n(2,f=D.role),"tabindex"in D&&n(3,c=D.tabindex),"translateWithId"in D&&n(4,h=D.translateWithId),"id"in D&&n(9,g=D.id),"ref"in D&&n(0,_=D.ref),"$$scope"in D&&n(10,a=D.$$scope)},t.$$.update=()=>{t.$$.dirty&1&&S&&_&&S.declareRef({key:"field",ref:_}),n(6,i=e["aria-expanded"]),t.$$.dirty&512&&n(5,l=`menu-${g}`)},e=Se(e),[_,u,f,c,h,l,i,s,d,g,a,o,A,C,I,M,L,N,z,W]}class RD extends De{constructor(e){super(),Re(this,e,ID,LD,Ie,{disabled:1,role:2,tabindex:3,translationIds:8,translateWithId:4,id:9,ref:0})}get translationIds(){return this.$$.ctx[8]}}const DD=RD;function PD(t){let e,n,i,l,r;const s=t[4].default,o=Ze(s,t,t[3],null);let a=[{role:"listbox"},{id:n="menu-"+t[1]},t[2]],u={};for(let f=0;f{a=c,n(0,a)})}return t.$$set=c=>{e=Y(Y({},e),Se(c)),n(2,l=ae(e,i)),"id"in c&&n(1,o=c.id),"ref"in c&&n(0,a=c.ref),"$$scope"in c&&n(3,s=c.$$scope)},[a,o,l,s,r,u,f]}class BD extends De{constructor(e){super(),Re(this,e,ND,PD,Ie,{id:1,ref:0})}}const zD=BD;function Dp(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function HD(t){let e,n,i=t[1]&&Dp(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let FD=class extends De{constructor(e){super(),Re(this,e,UD,HD,Ie,{size:0,title:1})}};const ga=FD;function GD(t){let e,n,i,l,r;n=new ga({props:{"aria-label":t[1],title:t[1]}});let s=[t[2]],o={};for(let a=0;af[d]}=e;const f={[a.close]:"Close menu",[a.open]:"Open menu"};function c(d){te.call(this,t,d)}return t.$$set=d=>{e=Y(Y({},e),Se(d)),n(2,s=ae(e,r)),"open"in d&&n(0,o=d.open),"translateWithId"in d&&n(4,u=d.translateWithId)},t.$$.update=()=>{t.$$.dirty&1&&n(5,i=o?a.close:a.open),t.$$.dirty&48&&n(1,l=(u==null?void 0:u(i))??f[i])},[o,l,s,a,u,i,c]}class WD extends De{constructor(e){super(),Re(this,e,VD,GD,Ie,{open:0,translationIds:3,translateWithId:4})}get translationIds(){return this.$$.ctx[3]}}const ST=WD;function qD(t){let e,n,i,l,r,s;const o=t[8].default,a=Ze(o,t,t[7],null);let u=[{role:"option"},{tabindex:"-1"},{"aria-selected":t[0]},{disabled:i=t[2]?!0:void 0},t[5]],f={};for(let c=0;c{d=S,n(3,d)})}return t.$$set=S=>{e=Y(Y({},e),Se(S)),n(5,s=ae(e,r)),"active"in S&&n(0,u=S.active),"highlighted"in S&&n(1,f=S.highlighted),"disabled"in S&&n(2,c=S.disabled),"$$scope"in S&&n(7,a=S.$$scope)},t.$$.update=()=>{t.$$.dirty&8&&n(6,i=(d==null?void 0:d.offsetWidth)<(d==null?void 0:d.scrollWidth)),t.$$.dirty&72&&n(4,l=i?d==null?void 0:d.innerText:void 0),t.$$.dirty&10&&f&&d&&!d.matches(":hover")&&d.scrollIntoView({block:"nearest"})},[u,f,c,d,l,s,i,a,o,h,g,_,v]}class YD extends De{constructor(e){super(),Re(this,e,jD,qD,Ie,{active:0,highlighted:1,disabled:2})}}const ZD=YD;function Pp(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function XD(t){let e,n,i=t[1]&&Pp(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let $D=class extends De{constructor(e){super(),Re(this,e,KD,XD,Ie,{size:0,title:1})}};const ql=$D;function JD(t){let e,n,i,l,r,s,o,a=t[1]!==void 0&&Np(t);i=new ql({});let u=[{role:"button"},{"aria-label":t[4]},{title:t[4]},{tabindex:l=t[2]?"-1":"0"},t[6]],f={};for(let c=0;c{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function eP(t,e,n){let i,l;const r=["selectionCount","disabled","translationIds","translateWithId","ref"];let s=ae(e,r),{selectionCount:o=void 0}=e,{disabled:a=!1}=e;const u={clearAll:"clearAll",clearSelection:"clearSelection"};let{translateWithId:f=M=>d[M]}=e,{ref:c=null}=e;const d={[u.clearAll]:"Clear all selected items",[u.clearSelection]:"Clear selected item"},h=yn(),g=bi("MultiSelect");function _(M){ft[M?"unshift":"push"](()=>{c=M,n(0,c)})}const v=M=>{a||h("clear",M)},S=M=>{!a&&M.key==="Enter"&&h("clear",M)};function A(M){ft[M?"unshift":"push"](()=>{c=M,n(0,c)})}const C=M=>{a||h("clear",M)},I=M=>{!a&&M.key==="Enter"&&h("clear",M)};return t.$$set=M=>{e=Y(Y({},e),Se(M)),n(6,s=ae(e,r)),"selectionCount"in M&&n(1,o=M.selectionCount),"disabled"in M&&n(2,a=M.disabled),"translateWithId"in M&&n(7,f=M.translateWithId),"ref"in M&&n(0,c=M.ref)},t.$$.update=()=>{t.$$.dirty&1&&g&&c&&g.declareRef({key:"selection",ref:c}),t.$$.dirty&2&&n(8,i=o?u.clearAll:u.clearSelection),t.$$.dirty&384&&n(4,l=(f==null?void 0:f(i))??d[i])},[c,o,a,u,l,h,s,f,i,_,v,S,A,C,I]}class tP extends De{constructor(e){super(),Re(this,e,eP,xD,Ie,{selectionCount:1,disabled:2,translationIds:3,translateWithId:7,ref:0})}get translationIds(){return this.$$.ctx[3]}}const ET=tP,Bm=new Set,MT=un(0),Bp=()=>MT.set([...Bm].filter(t=>MI(t)).length),OT=t=>_n(()=>{Bm.add(t);const e=t.subscribe(Bp);return()=>{e(),Bm.delete(t),Bp()}});MT.subscribe(t=>{typeof document<"u"&&document.body.classList.toggle("bx--body--with-modal-open",t>0)});function nP(t){let e,n,i,l,r,s;const o=t[18].default,a=Ze(o,t,t[17],null);let u=[{role:"presentation"},t[14]],f={};for(let c=0;cn(9,o=x));let C=null,I=null,M=!1;Wi("ComposedModal",{closeModal:()=>{n(0,c=!1)},submit:()=>{S("submit"),S("click:button--primary")},declareRef:x=>{C=x},updateLabel:x=>{A.set(x)}});function L(x){var ee;if(_==null)return;const me=((ee=x||I)==null?void 0:ee.querySelector(_))||C;me!=null&&me.focus()}let N=!1;const z=un(c);Mt(t,z,x=>n(32,s=x)),OT(z),_n(()=>{pc().then(()=>{L()})}),Cl(()=>{N?c||(N=!1,S("close")):c&&(N=!0,S("open"))});function W(x){te.call(this,t,x)}function D(x){te.call(this,t,x)}function G(x){te.call(this,t,x)}function $(x){te.call(this,t,x)}function j(x){te.call(this,t,x)}function Q(x){ft[x?"unshift":"push"](()=>{I=x,n(6,I)})}const le=()=>{n(7,M=!0)};function oe(x){ft[x?"unshift":"push"](()=>{v=x,n(1,v)})}const X=x=>{if(c){if(x.key==="Escape")n(0,c=!1);else if(x.key==="Tab"){const me=` +}`,c=`__svelte_${HI(f)}_${o}`,d=_T(t),{stylesheet:h,rules:g}=gc.get(d)||UI(d,t);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const _=t.style.animation||"";return t.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,_c+=1,c}function FI(t,e){const n=(t.style.animation||"").split(", "),i=n.filter(e?r=>r.indexOf(e)<0:r=>r.indexOf("__svelte")===-1),l=n.length-i.length;l&&(t.style.animation=i.join(", "),_c-=l,_c||GI())}function GI(){q1(()=>{_c||(gc.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&w(e)}),gc.clear())})}let hu;function Gr(t){hu=t}function Ss(){if(!hu)throw new Error("Function called outside component initialization");return hu}function VI(t){Ss().$$.before_update.push(t)}function _n(t){Ss().$$.on_mount.push(t)}function Cl(t){Ss().$$.after_update.push(t)}function Es(t){Ss().$$.on_destroy.push(t)}function yn(){const t=Ss();return(e,n,{cancelable:i=!1}={})=>{const l=t.$$.callbacks[e];if(l){const r=pT(e,n,{cancelable:i});return l.slice().forEach(s=>{s.call(t,r)}),!r.defaultPrevented}return!0}}function Wi(t,e){return Ss().$$.context.set(t,e),e}function bi(t){return Ss().$$.context.get(t)}function te(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(i=>i.call(this,e))}const Ho=[],ft=[];let jo=[];const Dm=[],bT=Promise.resolve();let Pm=!1;function vT(){Pm||(Pm=!0,bT.then(j1))}function pc(){return vT(),bT}function Qs(t){jo.push(t)}function jt(t){Dm.push(t)}const Yh=new Set;let Io=0;function j1(){if(Io!==0)return;const t=hu;do{try{for(;Iot.indexOf(i)===-1?e.push(i):n.push(i)),n.forEach(i=>i()),jo=e}let Va;function jI(){return Va||(Va=Promise.resolve(),Va.then(()=>{Va=null})),Va}function Zh(t,e,n){t.dispatchEvent(pT(`${e?"intro":"outro"}${n}`))}const ec=new Set;let Vr;function fe(){Vr={r:0,c:[],p:Vr}}function ce(){Vr.r||vt(Vr.c),Vr=Vr.p}function b(t,e){t&&t.i&&(ec.delete(t),t.i(e))}function k(t,e,n,i){if(t&&t.o){if(ec.has(t))return;ec.add(t),Vr.c.push(()=>{ec.delete(t),i&&(n&&t.d(1),i())}),t.o(e)}else i&&i()}const YI={duration:0};function hp(t,e,n,i){let r=e(t,n,{direction:"both"}),s=i?0:1,o=null,a=null,u=null,f;function c(){u&&FI(t,u)}function d(g,_){const v=g.b-s;return _*=Math.abs(v),{a:s,b:g.b,d:v,duration:_,start:g.start,end:g.start+_,group:g.group}}function h(g){const{delay:_=0,duration:v=300,easing:S=SI,tick:A=he,css:C}=r||YI,I={start:CI()+_,b:g};g||(I.group=Vr,Vr.r+=1),"inert"in t&&(g?f!==void 0&&(t.inert=f):(f=t.inert,t.inert=!0)),o||a?a=I:(C&&(c(),u=dp(t,s,g,v,_,S,C)),g&&A(0,1),o=d(I,v),Qs(()=>Zh(t,g,"start")),LI(M=>{if(a&&M>a.start&&(o=d(a,v),a=null,Zh(t,o.b,"start"),C&&(c(),u=dp(t,s,o.b,o.duration,0,S,r.css))),o){if(M>=o.end)A(s=o.b,1-s),Zh(t,o.b,"end"),a||(o.b?c():--o.group.r||vt(o.group.c)),o=null;else if(M>=o.start){const L=M-o.start;s=o.a+o.d*S(L/o.duration),A(s,1-s)}}return!!(o||a)}))}return{run(g){$s(r)?jI().then(()=>{r=r({direction:g?"in":"out"}),h(g)}):h(g)},end(){c(),o=a=null}}}function Nm(t,e){const n=e.token={};function i(l,r,s,o){if(e.token!==n)return;e.resolved=o;let a=e.ctx;s!==void 0&&(a=a.slice(),a[s]=o);const u=l&&(e.current=l)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==r&&c&&(fe(),k(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),ce())}):e.block.d(1),u.c(),b(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[r]=u),f&&j1()}if(EI(t)){const l=Ss();if(t.then(r=>{Gr(l),i(e.then,1,e.value,r),Gr(null)},r=>{if(Gr(l),i(e.catch,2,e.error,r),Gr(null),!e.hasCatch)throw r}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,t),!0;e.resolved=t}}function kT(t,e,n){const i=e.slice(),{resolved:l}=t;t.current===t.then&&(i[t.value]=l),t.current===t.catch&&(i[t.error]=l),t.block.p(i,n)}function ct(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function wT(t,e){t.d(1),e.delete(t.key)}function Qn(t,e){k(t,1,1,()=>{e.delete(t.key)})}function Wn(t,e,n,i,l,r,s,o,a,u,f,c){let d=t.length,h=r.length,g=d;const _={};for(;g--;)_[t[g].key]=g;const v=[],S=new Map,A=new Map,C=[];for(g=h;g--;){const N=c(l,r,g),z=n(N);let W=s.get(z);W?i&&C.push(()=>W.p(N,e)):(W=u(z,N),W.c()),S.set(z,v[g]=W),z in _&&A.set(z,Math.abs(g-_[z]))}const I=new Set,M=new Set;function L(N){b(N,1),N.m(o,f),s.set(N.key,N),f=N.first,h--}for(;d&&h;){const N=v[h-1],z=t[d-1],W=N.key,D=z.key;N===z?(f=N.first,d--,h--):S.has(D)?!s.has(W)||I.has(W)?L(N):M.has(D)?d--:A.get(W)>A.get(D)?(M.add(W),L(N)):(I.add(D),d--):(a(z,s),d--)}for(;d--;){const N=t[d];S.has(N.key)||a(N,s)}for(;h;)L(v[h-1]);return vt(C),v}function Ue(t,e){const n={},i={},l={$$scope:1};let r=t.length;for(;r--;){const s=t[r],o=e[r];if(o){for(const a in s)a in o||(i[a]=1);for(const a in o)l[a]||(n[a]=o[a],l[a]=1);t[r]=o}else for(const a in s)l[a]=1}for(const s in i)s in n||(n[s]=void 0);return n}function ul(t){return typeof t=="object"&&t!==null?t:{}}function Yt(t,e,n){const i=t.$$.props[e];i!==void 0&&(t.$$.bound[i]=n,n(t.$$.ctx[i]))}function F(t){t&&t.c()}function H(t,e,n){const{fragment:i,after_update:l}=t.$$;i&&i.m(e,n),Qs(()=>{const r=t.$$.on_mount.map(cT).filter($s);t.$$.on_destroy?t.$$.on_destroy.push(...r):vt(r),t.$$.on_mount=[]}),l.forEach(Qs)}function U(t,e){const n=t.$$;n.fragment!==null&&(qI(n.after_update),vt(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function ZI(t,e){t.$$.dirty[0]===-1&&(Ho.push(t),vT(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const g=h.length?h[0]:d;return u.ctx&&l(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&ZI(t,c)),d}):[],u.update(),f=!0,vt(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=PI(e.target);u.fragment&&u.fragment.l(c),c.forEach(w)}else u.fragment&&u.fragment.c();e.intro&&b(t.$$.fragment),H(t,e.target,e.anchor),j1()}Gr(a)}class De{constructor(){sl(this,"$$");sl(this,"$$set")}$destroy(){U(this,1),this.$destroy=he}$on(e,n){if(!$s(n))return he;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const l=i.indexOf(n);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!MI(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const XI="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(XI);const Ro=[];function KI(t,e){return{subscribe:un(t,e).subscribe}}function un(t,e=he){let n;const i=new Set;function l(o){if(Ie(t,o)&&(t=o,n)){const a=!Ro.length;for(const u of i)u[1](),Ro.push(u,t);if(a){for(let u=0;u{i.delete(u),i.size===0&&n&&(n(),n=null)}}return{set:l,update:r,subscribe:s}}function Ms(t,e,n){const i=!Array.isArray(t),l=i?[t]:t;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const r=e.length<2;return KI(n,(s,o)=>{let a=!1;const u=[];let f=0,c=he;const d=()=>{if(f)return;c();const g=e(i?u[0]:u,s,o);r?s(g):c=$s(g)?g:he},h=l.map((g,_)=>W1(g,v=>{u[_]=v,f&=~(1<<_),a&&d()},()=>{f|=1<<_}));return a=!0,d(),function(){vt(h),c(),a=!1}})}function mp(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function $I(t){let e,n,i=t[1]&&mp(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let QI=class extends De{constructor(e){super(),Re(this,e,JI,$I,Ie,{size:0,title:1})}};const yT=QI;function gp(t,e,n){const i=t.slice();return i[7]=e[n],i}function _p(t,e){let n,i,l;return{key:t,first:null,c(){n=R("div"),i=R("span"),i.textContent=" ",l=B(),E(i,"bx--link",!0),E(n,"bx--breadcrumb-item",!0),this.first=n},m(r,s){y(r,n,s),T(n,i),T(n,l)},p(r,s){},d(r){r&&w(n)}}}function xI(t){let e,n=[],i=new Map,l,r,s=ct(Array.from({length:t[1]},pp));const o=f=>f[7];for(let f=0;fe;function eR(t,e,n){const i=["noTrailingSlash","count"];let l=ae(e,i),{noTrailingSlash:r=!1}=e,{count:s=3}=e;function o(c){te.call(this,t,c)}function a(c){te.call(this,t,c)}function u(c){te.call(this,t,c)}function f(c){te.call(this,t,c)}return t.$$set=c=>{e=Y(Y({},e),Se(c)),n(2,l=ae(e,i)),"noTrailingSlash"in c&&n(0,r=c.noTrailingSlash),"count"in c&&n(1,s=c.count)},[r,s,l,o,a,u,f]}class tR extends De{constructor(e){super(),Re(this,e,eR,xI,Ie,{noTrailingSlash:0,count:1})}}const nR=tR;function iR(t){let e,n,i,l,r;const s=t[4].default,o=Ze(s,t,t[3],null);let a=[{"aria-label":"Breadcrumb"},t[2]],u={};for(let f=0;f{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function sR(t,e,n){const i=["noTrailingSlash","skeleton"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{noTrailingSlash:o=!1}=e,{skeleton:a=!1}=e;function u(S){te.call(this,t,S)}function f(S){te.call(this,t,S)}function c(S){te.call(this,t,S)}function d(S){te.call(this,t,S)}function h(S){te.call(this,t,S)}function g(S){te.call(this,t,S)}function _(S){te.call(this,t,S)}function v(S){te.call(this,t,S)}return t.$$set=S=>{e=Y(Y({},e),Se(S)),n(2,l=ae(e,i)),"noTrailingSlash"in S&&n(0,o=S.noTrailingSlash),"skeleton"in S&&n(1,a=S.skeleton),"$$scope"in S&&n(3,s=S.$$scope)},[o,a,l,s,r,u,f,c,d,h,g,_,v]}class oR extends De{constructor(e){super(),Re(this,e,sR,rR,Ie,{noTrailingSlash:0,skeleton:1})}}const Kr=oR,aR=t=>({}),bp=t=>({}),uR=t=>({}),vp=t=>({});function fR(t){let e,n,i,l,r,s;const o=t[10].default,a=Ze(o,t,t[9],null);let u=!t[3]&&(t[8].icon||t[4])&&kp(t),f=[{rel:i=t[7].target==="_blank"?"noopener noreferrer":void 0},{href:t[2]},t[7]],c={};for(let d=0;d{u=null}),ce()),Ae(e,c=Ue(f,[(!l||h&128&&i!==(i=d[7].target==="_blank"?"noopener noreferrer":void 0))&&{rel:i},(!l||h&4)&&{href:d[2]},h&128&&d[7]])),E(e,"bx--link",!0),E(e,"bx--link--disabled",d[5]),E(e,"bx--link--inline",d[3]),E(e,"bx--link--visited",d[6]),E(e,"bx--link--sm",d[1]==="sm"),E(e,"bx--link--lg",d[1]==="lg")},i(d){l||(b(a,d),b(u),l=!0)},o(d){k(a,d),k(u),l=!1},d(d){d&&w(e),a&&a.d(d),u&&u.d(),t[20](null),r=!1,vt(s)}}}function cR(t){let e,n,i,l,r;const s=t[10].default,o=Ze(s,t,t[9],null);let a=!t[3]&&(t[8].icon||t[4])&&wp(t),u=[t[7]],f={};for(let c=0;c{a=null}),ce()),Ae(e,f=Ue(u,[d&128&&c[7]])),E(e,"bx--link",!0),E(e,"bx--link--disabled",c[5]),E(e,"bx--link--inline",c[3]),E(e,"bx--link--visited",c[6])},i(c){i||(b(o,c),b(a),i=!0)},o(c){k(o,c),k(a),i=!1},d(c){c&&w(e),o&&o.d(c),a&&a.d(),t[19](null),l=!1,vt(r)}}}function kp(t){let e,n;const i=t[10].icon,l=Ze(i,t,t[9],bp),r=l||dR(t);return{c(){e=R("div"),r&&r.c(),E(e,"bx--link__icon",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&512)&&Ke(l,i,s,s[9],n?Xe(i,s[9],o,aR):$e(s[9]),bp):r&&r.p&&(!n||o&16)&&r.p(s,n?o:-1)},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function dR(t){let e,n,i;var l=t[4];function r(s,o){return{}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&16&&l!==(l=s[4])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function wp(t){let e,n;const i=t[10].icon,l=Ze(i,t,t[9],vp),r=l||hR(t);return{c(){e=R("div"),r&&r.c(),E(e,"bx--link__icon",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&512)&&Ke(l,i,s,s[9],n?Xe(i,s[9],o,uR):$e(s[9]),vp):r&&r.p&&(!n||o&16)&&r.p(s,n?o:-1)},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function hR(t){let e,n,i;var l=t[4];function r(s,o){return{}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&16&&l!==(l=s[4])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function mR(t){let e,n,i,l;const r=[cR,fR],s=[];function o(a,u){return a[5]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,[u]){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function gR(t,e,n){const i=["size","href","inline","icon","disabled","visited","ref"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e;const o=Yi(r);let{size:a=void 0}=e,{href:u=void 0}=e,{inline:f=!1}=e,{icon:c=void 0}=e,{disabled:d=!1}=e,{visited:h=!1}=e,{ref:g=null}=e;function _(W){te.call(this,t,W)}function v(W){te.call(this,t,W)}function S(W){te.call(this,t,W)}function A(W){te.call(this,t,W)}function C(W){te.call(this,t,W)}function I(W){te.call(this,t,W)}function M(W){te.call(this,t,W)}function L(W){te.call(this,t,W)}function N(W){ft[W?"unshift":"push"](()=>{g=W,n(0,g)})}function z(W){ft[W?"unshift":"push"](()=>{g=W,n(0,g)})}return t.$$set=W=>{e=Y(Y({},e),Se(W)),n(7,l=ae(e,i)),"size"in W&&n(1,a=W.size),"href"in W&&n(2,u=W.href),"inline"in W&&n(3,f=W.inline),"icon"in W&&n(4,c=W.icon),"disabled"in W&&n(5,d=W.disabled),"visited"in W&&n(6,h=W.visited),"ref"in W&&n(0,g=W.ref),"$$scope"in W&&n(9,s=W.$$scope)},[g,a,u,f,c,d,h,l,o,s,r,_,v,S,A,C,I,M,L,N,z]}class _R extends De{constructor(e){super(),Re(this,e,gR,mR,Ie,{size:1,href:2,inline:3,icon:4,disabled:5,visited:6,ref:0})}}const pR=_R,bR=t=>({props:t&4}),yp=t=>({props:{"aria-current":t[2]["aria-current"],class:"bx--link"}});function vR(t){let e;const n=t[3].default,i=Ze(n,t,t[8],yp);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&260)&&Ke(i,n,l,l[8],e?Xe(n,l[8],r,bR):$e(l[8]),yp)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function kR(t){let e,n;return e=new pR({props:{href:t[0],"aria-current":t[2]["aria-current"],$$slots:{default:[wR]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.href=i[0]),l&4&&(r["aria-current"]=i[2]["aria-current"]),l&256&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function wR(t){let e;const n=t[3].default,i=Ze(n,t,t[8],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&256)&&Ke(i,n,l,l[8],e?Xe(n,l[8],r,null):$e(l[8]),null)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function yR(t){let e,n,i,l,r,s;const o=[kR,vR],a=[];function u(d,h){return d[0]?0:1}n=u(t),i=a[n]=o[n](t);let f=[t[2]],c={};for(let d=0;d{a[g]=null}),ce(),i=a[n],i?i.p(d,h):(i=a[n]=o[n](d),i.c()),b(i,1),i.m(e,null)),Ae(e,c=Ue(f,[h&4&&d[2]])),E(e,"bx--breadcrumb-item",!0),E(e,"bx--breadcrumb-item--current",d[1]&&d[2]["aria-current"]!=="page")},i(d){l||(b(i),l=!0)},o(d){k(i),l=!1},d(d){d&&w(e),a[n].d(),r=!1,vt(s)}}}function TR(t,e,n){const i=["href","isCurrentPage"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{href:o=void 0}=e,{isCurrentPage:a=!1}=e;Wi("BreadcrumbItem",{});function u(h){te.call(this,t,h)}function f(h){te.call(this,t,h)}function c(h){te.call(this,t,h)}function d(h){te.call(this,t,h)}return t.$$set=h=>{e=Y(Y({},e),Se(h)),n(2,l=ae(e,i)),"href"in h&&n(0,o=h.href),"isCurrentPage"in h&&n(1,a=h.isCurrentPage),"$$scope"in h&&n(8,s=h.$$scope)},[o,a,l,r,u,f,c,d,s]}class SR extends De{constructor(e){super(),Re(this,e,TR,yR,Ie,{href:0,isCurrentPage:1})}}const Si=SR;function ER(t){let e,n,i,l=[t[2]],r={};for(let s=0;s{e=Y(Y({},e),Se(_)),n(2,l=ae(e,i)),"href"in _&&n(0,r=_.href),"size"in _&&n(1,s=_.size)},[r,s,l,o,a,u,f,c,d,h,g]}class CR extends De{constructor(e){super(),Re(this,e,AR,OR,Ie,{href:0,size:1})}}const LR=CR,IR=t=>({props:t[0]&512}),Tp=t=>({props:t[9]});function RR(t){let e,n,i,l,r,s,o=t[8]&&Sp(t);const a=t[19].default,u=Ze(a,t,t[18],null);var f=t[2];function c(g,_){return{props:{"aria-hidden":"true",class:"bx--btn__icon",style:g[8]?"margin-left: 0":void 0,"aria-label":g[3]}}}f&&(i=cn(f,c(t)));let d=[t[9]],h={};for(let g=0;g{U(v,1)}),ce()}f?(i=cn(f,c(g)),F(i.$$.fragment),b(i.$$.fragment,1),H(i,e,null)):i=null}else if(f){const v={};_[0]&256&&(v.style=g[8]?"margin-left: 0":void 0),_[0]&8&&(v["aria-label"]=g[3]),i.$set(v)}Ae(e,h=Ue(d,[_[0]&512&&g[9]]))},i(g){l||(b(u,g),i&&b(i.$$.fragment,g),l=!0)},o(g){k(u,g),i&&k(i.$$.fragment,g),l=!1},d(g){g&&w(e),o&&o.d(),u&&u.d(g),i&&U(i),t[33](null),r=!1,vt(s)}}}function DR(t){let e,n,i,l,r,s,o=t[8]&&Ep(t);const a=t[19].default,u=Ze(a,t,t[18],null);var f=t[2];function c(g,_){return{props:{"aria-hidden":"true",class:"bx--btn__icon","aria-label":g[3]}}}f&&(i=cn(f,c(t)));let d=[t[9]],h={};for(let g=0;g{U(v,1)}),ce()}f?(i=cn(f,c(g)),F(i.$$.fragment),b(i.$$.fragment,1),H(i,e,null)):i=null}else if(f){const v={};_[0]&8&&(v["aria-label"]=g[3]),i.$set(v)}Ae(e,h=Ue(d,[_[0]&512&&g[9]]))},i(g){l||(b(u,g),i&&b(i.$$.fragment,g),l=!0)},o(g){k(u,g),i&&k(i.$$.fragment,g),l=!1},d(g){g&&w(e),o&&o.d(),u&&u.d(g),i&&U(i),t[32](null),r=!1,vt(s)}}}function PR(t){let e;const n=t[19].default,i=Ze(n,t,t[18],Tp);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r[0]&262656)&&Ke(i,n,l,l[18],e?Xe(n,l[18],r,IR):$e(l[18]),Tp)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function NR(t){let e,n;const i=[{href:t[7]},{size:t[1]},t[10],{style:t[8]&&"width: 3rem;"}];let l={};for(let r=0;r{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function zR(t,e,n){let i,l;const r=["kind","size","expressive","isSelected","icon","iconDescription","tooltipAlignment","tooltipPosition","as","skeleton","disabled","href","tabindex","type","ref"];let s=ae(e,r),{$$slots:o={},$$scope:a}=e;const u=Yi(o);let{kind:f="primary"}=e,{size:c="default"}=e,{expressive:d=!1}=e,{isSelected:h=!1}=e,{icon:g=void 0}=e,{iconDescription:_=void 0}=e,{tooltipAlignment:v="center"}=e,{tooltipPosition:S="bottom"}=e,{as:A=!1}=e,{skeleton:C=!1}=e,{disabled:I=!1}=e,{href:M=void 0}=e,{tabindex:L="0"}=e,{type:N="button"}=e,{ref:z=null}=e;const W=bi("ComposedModal");function D(pe){te.call(this,t,pe)}function G(pe){te.call(this,t,pe)}function $(pe){te.call(this,t,pe)}function j(pe){te.call(this,t,pe)}function Q(pe){te.call(this,t,pe)}function le(pe){te.call(this,t,pe)}function oe(pe){te.call(this,t,pe)}function X(pe){te.call(this,t,pe)}function de(pe){te.call(this,t,pe)}function re(pe){te.call(this,t,pe)}function x(pe){te.call(this,t,pe)}function me(pe){te.call(this,t,pe)}function ee(pe){ft[pe?"unshift":"push"](()=>{z=pe,n(0,z)})}function ke(pe){ft[pe?"unshift":"push"](()=>{z=pe,n(0,z)})}return t.$$set=pe=>{e=Y(Y({},e),Se(pe)),n(10,s=ae(e,r)),"kind"in pe&&n(11,f=pe.kind),"size"in pe&&n(1,c=pe.size),"expressive"in pe&&n(12,d=pe.expressive),"isSelected"in pe&&n(13,h=pe.isSelected),"icon"in pe&&n(2,g=pe.icon),"iconDescription"in pe&&n(3,_=pe.iconDescription),"tooltipAlignment"in pe&&n(14,v=pe.tooltipAlignment),"tooltipPosition"in pe&&n(15,S=pe.tooltipPosition),"as"in pe&&n(4,A=pe.as),"skeleton"in pe&&n(5,C=pe.skeleton),"disabled"in pe&&n(6,I=pe.disabled),"href"in pe&&n(7,M=pe.href),"tabindex"in pe&&n(16,L=pe.tabindex),"type"in pe&&n(17,N=pe.type),"ref"in pe&&n(0,z=pe.ref),"$$scope"in pe&&n(18,a=pe.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&1&&W&&z&&W.declareRef(z),t.$$.dirty[0]&4&&n(8,i=g&&!u.default),n(9,l={type:M&&!I?void 0:N,tabindex:L,disabled:I===!0?!0:void 0,href:M,"aria-pressed":i&&f==="ghost"&&!M?h:void 0,...s,class:["bx--btn",d&&"bx--btn--expressive",(c==="small"&&!d||c==="sm"&&!d||c==="small"&&!d)&&"bx--btn--sm",c==="field"&&!d||c==="md"&&!d&&"bx--btn--md",c==="field"&&"bx--btn--field",c==="small"&&"bx--btn--sm",c==="lg"&&"bx--btn--lg",c==="xl"&&"bx--btn--xl",f&&`bx--btn--${f}`,I&&"bx--btn--disabled",i&&"bx--btn--icon-only",i&&"bx--tooltip__trigger",i&&"bx--tooltip--a11y",i&&S&&`bx--btn--icon-only--${S}`,i&&v&&`bx--tooltip--align-${v}`,i&&h&&f==="ghost"&&"bx--btn--selected",s.class].filter(Boolean).join(" ")})},[z,c,g,_,A,C,I,M,i,l,s,f,d,h,v,S,L,N,a,o,D,G,$,j,Q,le,oe,X,de,re,x,me,ee,ke]}class HR extends De{constructor(e){super(),Re(this,e,zR,BR,Ie,{kind:11,size:1,expressive:12,isSelected:13,icon:2,iconDescription:3,tooltipAlignment:14,tooltipPosition:15,as:4,skeleton:5,disabled:6,href:7,tabindex:16,type:17,ref:0},null,[-1,-1])}}const Rt=HR;function UR(t){let e,n;const i=t[3].default,l=Ze(i,t,t[2],null);let r=[t[1]],s={};for(let o=0;o{e=Y(Y({},e),Se(a)),n(1,l=ae(e,i)),"stacked"in a&&n(0,o=a.stacked),"$$scope"in a&&n(2,s=a.$$scope)},[o,l,s,r]}class GR extends De{constructor(e){super(),Re(this,e,FR,UR,Ie,{stacked:0})}}const VR=GR;function WR(t){let e,n,i,l,r=[t[0]],s={};for(let o=0;o{e=Y(Y({},e),Se(u)),n(0,l=ae(e,i))},[l,r,s,o,a]}class jR extends De{constructor(e){super(),Re(this,e,qR,WR,Ie,{})}}const YR=jR,ZR=t=>({}),Mp=t=>({});function XR(t){let e,n,i,l,r,s,o,a;const u=t[19].labelText,f=Ze(u,t,t[18],Mp),c=f||$R(t);let d=[t[16]],h={};for(let g=0;g{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function QR(t,e,n){let i,l;const r=["value","checked","group","indeterminate","skeleton","required","readonly","disabled","labelText","hideLabel","name","title","id","ref"];let s=ae(e,r),{$$slots:o={},$$scope:a}=e,{value:u=""}=e,{checked:f=!1}=e,{group:c=void 0}=e,{indeterminate:d=!1}=e,{skeleton:h=!1}=e,{required:g=!1}=e,{readonly:_=!1}=e,{disabled:v=!1}=e,{labelText:S=""}=e,{hideLabel:A=!1}=e,{name:C=""}=e,{title:I=void 0}=e,{id:M="ccs-"+Math.random().toString(36)}=e,{ref:L=null}=e;const N=yn();let z=null;function W(ee){te.call(this,t,ee)}function D(ee){te.call(this,t,ee)}function G(ee){te.call(this,t,ee)}function $(ee){te.call(this,t,ee)}function j(ee){te.call(this,t,ee)}function Q(ee){te.call(this,t,ee)}function le(ee){te.call(this,t,ee)}function oe(ee){te.call(this,t,ee)}function X(ee){te.call(this,t,ee)}function de(ee){te.call(this,t,ee)}function re(ee){ft[ee?"unshift":"push"](()=>{L=ee,n(3,L)})}const x=()=>{i?n(1,c=c.includes(u)?c.filter(ee=>ee!==u):[...c,u]):n(0,f=!f)};function me(ee){ft[ee?"unshift":"push"](()=>{z=ee,n(14,z)})}return t.$$set=ee=>{e=Y(Y({},e),Se(ee)),n(16,s=ae(e,r)),"value"in ee&&n(4,u=ee.value),"checked"in ee&&n(0,f=ee.checked),"group"in ee&&n(1,c=ee.group),"indeterminate"in ee&&n(5,d=ee.indeterminate),"skeleton"in ee&&n(6,h=ee.skeleton),"required"in ee&&n(7,g=ee.required),"readonly"in ee&&n(8,_=ee.readonly),"disabled"in ee&&n(9,v=ee.disabled),"labelText"in ee&&n(10,S=ee.labelText),"hideLabel"in ee&&n(11,A=ee.hideLabel),"name"in ee&&n(12,C=ee.name),"title"in ee&&n(2,I=ee.title),"id"in ee&&n(13,M=ee.id),"ref"in ee&&n(3,L=ee.ref),"$$scope"in ee&&n(18,a=ee.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&2&&n(15,i=Array.isArray(c)),t.$$.dirty[0]&32787&&n(0,f=i?c.includes(u):f),t.$$.dirty[0]&1&&N("check",f),t.$$.dirty[0]&16384&&n(17,l=(z==null?void 0:z.offsetWidth)<(z==null?void 0:z.scrollWidth)),t.$$.dirty[0]&147460&&n(2,I=!I&&l?z==null?void 0:z.innerText:I)},[f,c,I,L,u,d,h,g,_,v,S,A,C,M,z,i,s,l,a,o,W,D,G,$,j,Q,le,oe,X,de,re,x,me]}class xR extends De{constructor(e){super(),Re(this,e,QR,JR,Ie,{value:4,checked:0,group:1,indeterminate:5,skeleton:6,required:7,readonly:8,disabled:9,labelText:10,hideLabel:11,name:12,title:2,id:13,ref:3},null,[-1,-1])}}const TT=xR;function eD(t){let e,n,i,l,r,s,o,a,u,f=[{type:"checkbox"},{checked:i=t[2]?!1:t[1]},{indeterminate:t[2]},{id:t[4]},t[5],{"aria-checked":l=t[2]?void 0:t[1]}],c={};for(let d=0;d{u=d,n(0,u)})}return t.$$set=d=>{n(6,e=Y(Y({},e),Se(d))),n(5,l=ae(e,i)),"checked"in d&&n(1,r=d.checked),"indeterminate"in d&&n(2,s=d.indeterminate),"title"in d&&n(3,o=d.title),"id"in d&&n(4,a=d.id),"ref"in d&&n(0,u=d.ref)},e=Se(e),[u,r,s,o,a,l,e,f,c]}class nD extends De{constructor(e){super(),Re(this,e,tD,eD,Ie,{checked:1,indeterminate:2,title:3,id:4,ref:0})}}const ST=nD;function iD(t){let e,n,i,l;const r=t[6].default,s=Ze(r,t,t[5],null);let o=[{role:"tablist"},t[1]],a={};for(let u=0;u{C&&n(2,u=l.length),n(4,l=[...l,{id:S,text:A,selected:C}])},update:S=>{n(2,u=l.map(({id:A})=>A).indexOf(S))},change:S=>{let A=i+S;A<0?A=l.length-1:A>=l.length&&(A=0),n(2,u=A)}}),Cl(()=>{u!==i&&n(3,i=u)});function h(S){te.call(this,t,S)}function g(S){te.call(this,t,S)}function _(S){te.call(this,t,S)}function v(S){te.call(this,t,S)}return t.$$set=S=>{e=Y(Y({},e),Se(S)),n(1,s=ae(e,r)),"selectedIndex"in S&&n(2,u=S.selectedIndex),"size"in S&&n(0,f=S.size),"$$scope"in S&&n(5,a=S.$$scope)},t.$$.update=()=>{t.$$.dirty&24&&l[i]&&(c("change",i),d.set(l[i].id))},n(3,i=-1),n(4,l=[]),[f,s,u,i,l,a,o,h,g,_,v]}class rD extends De{constructor(e){super(),Re(this,e,lD,iD,Ie,{selectedIndex:2,size:0})}}const sD=rD;function oD(t){let e;return{c(){e=q(t[2])},m(n,i){y(n,e,i)},p(n,i){i&4&&Z(e,n[2])},d(n){n&&w(e)}}}function aD(t){let e,n,i,l,r,s;const o=t[8].default,a=Ze(o,t,t[7],null),u=a||oD(t);let f=[{type:"button"},{role:"tab"},{tabindex:i=t[0]?"0":"-1"},{"aria-selected":t[0]},{disabled:t[3]},{id:t[4]},t[6]],c={};for(let d=0;d{n(0,a=L===f)});Cl(()=>{a&&c.focus()}),_n(()=>()=>h());function g(L){te.call(this,t,L)}function _(L){te.call(this,t,L)}function v(L){te.call(this,t,L)}function S(L){te.call(this,t,L)}function A(L){te.call(this,t,L)}function C(L){ft[L?"unshift":"push"](()=>{c=L,n(1,c)})}const I=()=>{d.update(f)},M=({key:L})=>{L==="ArrowRight"?d.change(1):L==="ArrowLeft"&&d.change(-1)};return t.$$set=L=>{e=Y(Y({},e),Se(L)),n(6,l=ae(e,i)),"text"in L&&n(2,o=L.text),"selected"in L&&n(0,a=L.selected),"disabled"in L&&n(3,u=L.disabled),"id"in L&&n(4,f=L.id),"ref"in L&&n(1,c=L.ref),"$$scope"in L&&n(7,s=L.$$scope)},[a,c,o,u,f,d,l,s,r,g,_,v,S,A,C,I,M]}class fD extends De{constructor(e){super(),Re(this,e,uD,aD,Ie,{text:2,selected:0,disabled:3,id:4,ref:1})}}const Op=fD;function Ap(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function cD(t){let e,n,i,l=t[1]&&Ap(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class hD extends De{constructor(e){super(),Re(this,e,dD,cD,Ie,{size:0,title:1})}}const mD=hD;function gD(t){let e,n,i,l,r,s,o,a;n=new mD({props:{class:"bx--snippet__icon"}});let u=[{type:"button"},{"aria-live":"polite"},{"aria-label":t[2]},{title:t[2]},t[8]],f={};for(let c=0;c{try{await navigator.clipboard.writeText(S)}catch(A){console.log(A)}}}=e;const f=yn();let c,d;_n(()=>()=>clearTimeout(d));function h(S){te.call(this,t,S)}function g(S){te.call(this,t,S)}const _=()=>{a!==void 0&&(u(a),f("copy")),c!=="fade-in"&&(n(5,c="fade-in"),n(6,d=setTimeout(()=>{n(5,c="fade-out")},s)))},v=({animationName:S})=>{S==="hide-feedback"&&n(5,c=void 0)};return t.$$set=S=>{e=Y(Y({},e),Se(S)),n(8,l=ae(e,i)),"feedback"in S&&n(0,r=S.feedback),"feedbackTimeout"in S&&n(1,s=S.feedbackTimeout),"iconDescription"in S&&n(2,o=S.iconDescription),"text"in S&&n(3,a=S.text),"copy"in S&&n(4,u=S.copy)},[r,s,o,a,u,c,d,f,l,h,g,_,v]}class pD extends De{constructor(e){super(),Re(this,e,_D,gD,Ie,{feedback:0,feedbackTimeout:1,iconDescription:2,text:3,copy:4})}}const bD=pD;function Cp(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function vD(t){let e,n,i,l=t[1]&&Cp(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class wD extends De{constructor(e){super(),Re(this,e,kD,vD,Ie,{size:0,title:1})}}const Os=wD;function Lp(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function yD(t){let e,n,i,l,r=t[1]&&Lp(t),s=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],o={};for(let a=0;a{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class SD extends De{constructor(e){super(),Re(this,e,TD,yD,Ie,{size:0,title:1})}}const Lu=SD;function Ip(t){let e,n;return{c(){e=R("div"),n=q(t[6]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&64&&Z(n,i[6])},d(i){i&&w(e)}}}function Rp(t){let e,n;return{c(){e=R("div"),n=q(t[8]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&256&&Z(n,i[8])},d(i){i&&w(e)}}}function ED(t){let e,n,i,l,r,s,o,a;const u=t[11].default,f=Ze(u,t,t[10],null);let c=[{role:"listbox"},{tabindex:"-1"},{"data-invalid":n=t[5]||void 0},t[9]],d={};for(let _=0;_{t.key==="Escape"&&t.stopPropagation()};function OD(t,e,n){const i=["size","type","open","light","disabled","invalid","invalidText","warn","warnText"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{size:o=void 0}=e,{type:a="default"}=e,{open:u=!1}=e,{light:f=!1}=e,{disabled:c=!1}=e,{invalid:d=!1}=e,{invalidText:h=""}=e,{warn:g=!1}=e,{warnText:_=""}=e;function v(A){te.call(this,t,A)}function S(A){te.call(this,t,A)}return t.$$set=A=>{e=Y(Y({},e),Se(A)),n(9,l=ae(e,i)),"size"in A&&n(0,o=A.size),"type"in A&&n(1,a=A.type),"open"in A&&n(2,u=A.open),"light"in A&&n(3,f=A.light),"disabled"in A&&n(4,c=A.disabled),"invalid"in A&&n(5,d=A.invalid),"invalidText"in A&&n(6,h=A.invalidText),"warn"in A&&n(7,g=A.warn),"warnText"in A&&n(8,_=A.warnText),"$$scope"in A&&n(10,s=A.$$scope)},[o,a,u,f,c,d,h,g,_,l,s,r,v,S]}class AD extends De{constructor(e){super(),Re(this,e,OD,ED,Ie,{size:0,type:1,open:2,light:3,disabled:4,invalid:5,invalidText:6,warn:7,warnText:8})}}const CD=AD;function LD(t){let e,n,i,l,r,s,o,a;const u=t[11].default,f=Ze(u,t,t[10],null);let c=[{role:t[2]},{"aria-expanded":t[6]},{"aria-owns":n=t[6]&&t[5]||void 0},{"aria-controls":i=t[6]&&t[5]||void 0},{"aria-disabled":t[1]},{"aria-label":l=t[6]?t[4]("close"):t[4]("open")},{tabindex:r=t[1]?"-1":t[3]},t[7]],d={};for(let h=0;hv[D]}=e,{id:g="ccs-"+Math.random().toString(36)}=e,{ref:_=null}=e;const v={[d.close]:"Close menu",[d.open]:"Open menu"},S=bi("MultiSelect");function A(D){te.call(this,t,D)}function C(D){te.call(this,t,D)}function I(D){te.call(this,t,D)}function M(D){te.call(this,t,D)}function L(D){te.call(this,t,D)}function N(D){te.call(this,t,D)}function z(D){te.call(this,t,D)}function W(D){ft[D?"unshift":"push"](()=>{_=D,n(0,_)})}return t.$$set=D=>{n(22,e=Y(Y({},e),Se(D))),n(7,s=ae(e,r)),"disabled"in D&&n(1,u=D.disabled),"role"in D&&n(2,f=D.role),"tabindex"in D&&n(3,c=D.tabindex),"translateWithId"in D&&n(4,h=D.translateWithId),"id"in D&&n(9,g=D.id),"ref"in D&&n(0,_=D.ref),"$$scope"in D&&n(10,a=D.$$scope)},t.$$.update=()=>{t.$$.dirty&1&&S&&_&&S.declareRef({key:"field",ref:_}),n(6,i=e["aria-expanded"]),t.$$.dirty&512&&n(5,l=`menu-${g}`)},e=Se(e),[_,u,f,c,h,l,i,s,d,g,a,o,A,C,I,M,L,N,z,W]}class RD extends De{constructor(e){super(),Re(this,e,ID,LD,Ie,{disabled:1,role:2,tabindex:3,translationIds:8,translateWithId:4,id:9,ref:0})}get translationIds(){return this.$$.ctx[8]}}const DD=RD;function PD(t){let e,n,i,l,r;const s=t[4].default,o=Ze(s,t,t[3],null);let a=[{role:"listbox"},{id:n="menu-"+t[1]},t[2]],u={};for(let f=0;f{a=c,n(0,a)})}return t.$$set=c=>{e=Y(Y({},e),Se(c)),n(2,l=ae(e,i)),"id"in c&&n(1,o=c.id),"ref"in c&&n(0,a=c.ref),"$$scope"in c&&n(3,s=c.$$scope)},[a,o,l,s,r,u,f]}class BD extends De{constructor(e){super(),Re(this,e,ND,PD,Ie,{id:1,ref:0})}}const zD=BD;function Dp(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function HD(t){let e,n,i=t[1]&&Dp(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let FD=class extends De{constructor(e){super(),Re(this,e,UD,HD,Ie,{size:0,title:1})}};const ga=FD;function GD(t){let e,n,i,l,r;n=new ga({props:{"aria-label":t[1],title:t[1]}});let s=[t[2]],o={};for(let a=0;af[d]}=e;const f={[a.close]:"Close menu",[a.open]:"Open menu"};function c(d){te.call(this,t,d)}return t.$$set=d=>{e=Y(Y({},e),Se(d)),n(2,s=ae(e,r)),"open"in d&&n(0,o=d.open),"translateWithId"in d&&n(4,u=d.translateWithId)},t.$$.update=()=>{t.$$.dirty&1&&n(5,i=o?a.close:a.open),t.$$.dirty&48&&n(1,l=(u==null?void 0:u(i))??f[i])},[o,l,s,a,u,i,c]}class WD extends De{constructor(e){super(),Re(this,e,VD,GD,Ie,{open:0,translationIds:3,translateWithId:4})}get translationIds(){return this.$$.ctx[3]}}const ET=WD;function qD(t){let e,n,i,l,r,s;const o=t[8].default,a=Ze(o,t,t[7],null);let u=[{role:"option"},{tabindex:"-1"},{"aria-selected":t[0]},{disabled:i=t[2]?!0:void 0},t[5]],f={};for(let c=0;c{d=S,n(3,d)})}return t.$$set=S=>{e=Y(Y({},e),Se(S)),n(5,s=ae(e,r)),"active"in S&&n(0,u=S.active),"highlighted"in S&&n(1,f=S.highlighted),"disabled"in S&&n(2,c=S.disabled),"$$scope"in S&&n(7,a=S.$$scope)},t.$$.update=()=>{t.$$.dirty&8&&n(6,i=(d==null?void 0:d.offsetWidth)<(d==null?void 0:d.scrollWidth)),t.$$.dirty&72&&n(4,l=i?d==null?void 0:d.innerText:void 0),t.$$.dirty&10&&f&&d&&!d.matches(":hover")&&d.scrollIntoView({block:"nearest"})},[u,f,c,d,l,s,i,a,o,h,g,_,v]}class YD extends De{constructor(e){super(),Re(this,e,jD,qD,Ie,{active:0,highlighted:1,disabled:2})}}const ZD=YD;function Pp(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function XD(t){let e,n,i=t[1]&&Pp(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let $D=class extends De{constructor(e){super(),Re(this,e,KD,XD,Ie,{size:0,title:1})}};const ql=$D;function JD(t){let e,n,i,l,r,s,o,a=t[1]!==void 0&&Np(t);i=new ql({});let u=[{role:"button"},{"aria-label":t[4]},{title:t[4]},{tabindex:l=t[2]?"-1":"0"},t[6]],f={};for(let c=0;c{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function eP(t,e,n){let i,l;const r=["selectionCount","disabled","translationIds","translateWithId","ref"];let s=ae(e,r),{selectionCount:o=void 0}=e,{disabled:a=!1}=e;const u={clearAll:"clearAll",clearSelection:"clearSelection"};let{translateWithId:f=M=>d[M]}=e,{ref:c=null}=e;const d={[u.clearAll]:"Clear all selected items",[u.clearSelection]:"Clear selected item"},h=yn(),g=bi("MultiSelect");function _(M){ft[M?"unshift":"push"](()=>{c=M,n(0,c)})}const v=M=>{a||h("clear",M)},S=M=>{!a&&M.key==="Enter"&&h("clear",M)};function A(M){ft[M?"unshift":"push"](()=>{c=M,n(0,c)})}const C=M=>{a||h("clear",M)},I=M=>{!a&&M.key==="Enter"&&h("clear",M)};return t.$$set=M=>{e=Y(Y({},e),Se(M)),n(6,s=ae(e,r)),"selectionCount"in M&&n(1,o=M.selectionCount),"disabled"in M&&n(2,a=M.disabled),"translateWithId"in M&&n(7,f=M.translateWithId),"ref"in M&&n(0,c=M.ref)},t.$$.update=()=>{t.$$.dirty&1&&g&&c&&g.declareRef({key:"selection",ref:c}),t.$$.dirty&2&&n(8,i=o?u.clearAll:u.clearSelection),t.$$.dirty&384&&n(4,l=(f==null?void 0:f(i))??d[i])},[c,o,a,u,l,h,s,f,i,_,v,S,A,C,I]}class tP extends De{constructor(e){super(),Re(this,e,eP,xD,Ie,{selectionCount:1,disabled:2,translationIds:3,translateWithId:7,ref:0})}get translationIds(){return this.$$.ctx[3]}}const MT=tP,Bm=new Set,OT=un(0),Bp=()=>OT.set([...Bm].filter(t=>OI(t)).length),AT=t=>_n(()=>{Bm.add(t);const e=t.subscribe(Bp);return()=>{e(),Bm.delete(t),Bp()}});OT.subscribe(t=>{typeof document<"u"&&document.body.classList.toggle("bx--body--with-modal-open",t>0)});function nP(t){let e,n,i,l,r,s;const o=t[18].default,a=Ze(o,t,t[17],null);let u=[{role:"presentation"},t[14]],f={};for(let c=0;cn(9,o=x));let C=null,I=null,M=!1;Wi("ComposedModal",{closeModal:()=>{n(0,c=!1)},submit:()=>{S("submit"),S("click:button--primary")},declareRef:x=>{C=x},updateLabel:x=>{A.set(x)}});function L(x){var ee;if(_==null)return;const me=((ee=x||I)==null?void 0:ee.querySelector(_))||C;me!=null&&me.focus()}let N=!1;const z=un(c);Mt(t,z,x=>n(32,s=x)),AT(z),_n(()=>{pc().then(()=>{L()})}),Cl(()=>{N?c||(N=!1,S("close")):c&&(N=!0,S("open"))});function W(x){te.call(this,t,x)}function D(x){te.call(this,t,x)}function G(x){te.call(this,t,x)}function $(x){te.call(this,t,x)}function j(x){te.call(this,t,x)}function Q(x){ft[x?"unshift":"push"](()=>{I=x,n(6,I)})}const le=()=>{n(7,M=!0)};function oe(x){ft[x?"unshift":"push"](()=>{v=x,n(1,v)})}const X=x=>{if(c){if(x.key==="Escape")n(0,c=!1);else if(x.key==="Tab"){const me=` a[href], area[href], input:not([disabled]):not([tabindex='-1']), button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']), textarea:not([disabled]):not([tabindex='-1']), iframe, object, embed, *[tabindex]:not([tabindex='-1']):not([disabled]), *[contenteditable=true] -`,ee=Array.from(v.querySelectorAll(me));let ke=ee.indexOf(document.activeElement);ke===-1&&x.shiftKey&&(ke=0),ke+=ee.length+(x.shiftKey?-1:1),ke%=ee.length,ee[ke].focus(),x.preventDefault()}}},de=()=>{!M&&!h&&n(0,c=!1),n(7,M=!1)},re=({propertyName:x,currentTarget:me})=>{x==="transform"&&S("transitionend",{open:c}),i&&(L(me),n(8,i=!1))};return t.$$set=x=>{n(15,e=Y(Y({},e),Se(x))),n(14,r=ae(e,l)),"size"in x&&n(2,f=x.size),"open"in x&&n(0,c=x.open),"danger"in x&&n(3,d=x.danger),"preventCloseOnClickOutside"in x&&n(4,h=x.preventCloseOnClickOutside),"containerClass"in x&&n(5,g=x.containerClass),"selectorPrimaryFocus"in x&&n(16,_=x.selectorPrimaryFocus),"ref"in x&&n(1,v=x.ref),"$$scope"in x&&n(17,u=x.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&1&&n(8,i=c),t.$$.dirty[0]&1&&Js(z,s=c,s)},e=Se(e),[c,v,f,d,h,g,I,M,i,o,S,A,L,z,r,e,_,u,a,W,D,G,$,j,Q,le,oe,X,de,re]}class lP extends De{constructor(e){super(),Re(this,e,iP,nP,Ie,{size:2,open:0,danger:3,preventCloseOnClickOutside:4,containerClass:5,selectorPrimaryFocus:16,ref:1},null,[-1,-1])}}const Iu=lP;function zp(t){let e,n;return{c(){e=R("h2"),n=q(t[1]),P(e,"class",t[2]),E(e,"bx--modal-header__label",!0),E(e,"bx--type-delta",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1]),l&4&&P(e,"class",i[2]),l&4&&E(e,"bx--modal-header__label",!0),l&4&&E(e,"bx--type-delta",!0)},d(i){i&&w(e)}}}function Hp(t){let e,n;return{c(){e=R("h3"),n=q(t[0]),P(e,"class",t[3]),E(e,"bx--modal-header__heading",!0),E(e,"bx--type-beta",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&1&&Z(n,i[0]),l&8&&P(e,"class",i[3]),l&8&&E(e,"bx--modal-header__heading",!0),l&8&&E(e,"bx--type-beta",!0)},d(i){i&&w(e)}}}function rP(t){let e,n,i,l,r,s,o,a,u,f=t[1]&&zp(t),c=t[0]&&Hp(t);const d=t[10].default,h=Ze(d,t,t[9],null);s=new ql({props:{size:20,class:"bx--modal-close__icon "+t[5],"aria-hidden":"true"}});let g=[t[8]],_={};for(let v=0;v{e=Y(Y({},e),Se(S)),n(8,l=ae(e,i)),"title"in S&&n(0,o=S.title),"label"in S&&n(1,a=S.label),"labelClass"in S&&n(2,u=S.labelClass),"titleClass"in S&&n(3,f=S.titleClass),"closeClass"in S&&n(4,c=S.closeClass),"closeIconClass"in S&&n(5,d=S.closeIconClass),"iconDescription"in S&&n(6,h=S.iconDescription),"$$scope"in S&&n(9,s=S.$$scope)},t.$$.update=()=>{t.$$.dirty&2&&_(a)},[o,a,u,f,c,d,h,g,l,s,r,v]}class oP extends De{constructor(e){super(),Re(this,e,sP,rP,Ie,{title:0,label:1,labelClass:2,titleClass:3,closeClass:4,closeIconClass:5,iconDescription:6})}}const Ru=oP;function Up(t){let e;return{c(){e=R("div"),E(e,"bx--modal-content--overflow-indicator",!0)},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function aP(t){let e,n,i,l,r,s;const o=t[4].default,a=Ze(o,t,t[3],null);let u=[{tabindex:n=t[1]?"0":void 0},{role:i=t[1]?"region":void 0},t[2]],f={};for(let d=0;d{e=Y(Y({},e),Se(u)),n(2,l=ae(e,i)),"hasForm"in u&&n(0,o=u.hasForm),"hasScrollingContent"in u&&n(1,a=u.hasScrollingContent),"$$scope"in u&&n(3,s=u.$$scope)},[o,a,l,s,r]}class fP extends De{constructor(e){super(),Re(this,e,uP,aP,Ie,{hasForm:0,hasScrollingContent:1})}}const Du=fP;function Fp(t,e,n){const i=t.slice();return i[16]=e[n],i}function cP(t){let e,n;return e=new Rt({props:{kind:"secondary",class:t[6],$$slots:{default:[hP]},$$scope:{ctx:t}}}),e.$on("click",t[14]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&64&&(r.class=i[6]),l&32784&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function dP(t){let e,n,i=ct(t[5]),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s0?0:_[4]?1:-1}~(n=u(t))&&(i=a[n]=o[n](t));let f=t[0]&&Vp(t);const c=t[12].default,d=Ze(c,t,t[15],null);let h=[t[11]],g={};for(let _=0;_{a[S]=null}),ce()),~n?(i=a[n],i?i.p(_,v):(i=a[n]=o[n](_),i.c()),b(i,1),i.m(e,l)):i=null),_[0]?f?(f.p(_,v),v&1&&b(f,1)):(f=Vp(_),f.c(),b(f,1),f.m(e,r)):f&&(fe(),k(f,1,1,()=>{f=null}),ce()),d&&d.p&&(!s||v&32768)&&Ke(d,c,_,_[15],s?Xe(c,_[15],v,null):$e(_[15]),null),Ae(e,g=Ue(h,[v&2048&&_[11]])),E(e,"bx--modal-footer",!0),E(e,"bx--modal-footer--three-button",_[5].length===2)},i(_){s||(b(i),b(f),b(d,_),s=!0)},o(_){k(i),k(f),k(d,_),s=!1},d(_){_&&w(e),~n&&a[n].d(),f&&f.d(),d&&d.d(_)}}}function pP(t,e,n){const i=["primaryButtonText","primaryButtonIcon","primaryButtonDisabled","primaryClass","secondaryButtonText","secondaryButtons","secondaryClass","danger"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{primaryButtonText:o=""}=e,{primaryButtonIcon:a=void 0}=e,{primaryButtonDisabled:u=!1}=e,{primaryClass:f=void 0}=e,{secondaryButtonText:c=""}=e,{secondaryButtons:d=[]}=e,{secondaryClass:h=void 0}=e,{danger:g=!1}=e;const _=yn(),{closeModal:v,submit:S}=bi("ComposedModal"),A=I=>{_("click:button--secondary",{text:I.text})},C=()=>{v(),_("click:button--secondary",{text:c})};return t.$$set=I=>{e=Y(Y({},e),Se(I)),n(11,l=ae(e,i)),"primaryButtonText"in I&&n(0,o=I.primaryButtonText),"primaryButtonIcon"in I&&n(1,a=I.primaryButtonIcon),"primaryButtonDisabled"in I&&n(2,u=I.primaryButtonDisabled),"primaryClass"in I&&n(3,f=I.primaryClass),"secondaryButtonText"in I&&n(4,c=I.secondaryButtonText),"secondaryButtons"in I&&n(5,d=I.secondaryButtons),"secondaryClass"in I&&n(6,h=I.secondaryClass),"danger"in I&&n(7,g=I.danger),"$$scope"in I&&n(15,s=I.$$scope)},[o,a,u,f,c,d,h,g,_,v,S,l,r,A,C,s]}class bP extends De{constructor(e){super(),Re(this,e,pP,_P,Ie,{primaryButtonText:0,primaryButtonIcon:1,primaryButtonDisabled:2,primaryClass:3,secondaryButtonText:4,secondaryButtons:5,secondaryClass:6,danger:7})}}const Pu=bP;function vP(t){let e,n,i,l,r;return{c(){e=R("span"),n=B(),i=R("span"),l=B(),r=R("span")},m(s,o){y(s,e,o),y(s,n,o),y(s,i,o),y(s,l,o),y(s,r,o)},d(s){s&&(w(e),w(n),w(i),w(l),w(r))}}}function kP(t){let e;return{c(){e=R("span")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function wP(t){let e,n,i,l;function r(f,c){if(f[0]==="single")return kP;if(f[0]==="multi")return vP}let s=r(t),o=s&&s(t),a=[t[1]],u={};for(let f=0;f{e=Y(Y({},e),Se(f)),n(1,l=ae(e,i)),"type"in f&&n(0,r=f.type)},[r,l,s,o,a,u]}class TP extends De{constructor(e){super(),Re(this,e,yP,wP,Ie,{type:0})}}const SP=TP;function EP(t){let e,n,i,l,r,s,o,a=`${t[19]}px`,u,f,c,d,h;const g=t[25].default,_=Ze(g,t,t[44],null),v=_||AP(t);let S=!t[6]&&Wp(t),A=t[2]&&qp(t),C=[t[22]],I={};for(let M=0;M{S=null}),ce()):S?(S.p(M,L),L[0]&64&&b(S,1)):(S=Wp(M),S.c(),b(S,1),S.m(e,f)),M[2]?A?(A.p(M,L),L[0]&4&&b(A,1)):(A=qp(M),A.c(),b(A,1),A.m(e,null)):A&&(fe(),k(A,1,1,()=>{A=null}),ce()),Ae(e,I=Ue(C,[L[0]&4194304&&M[22]])),E(e,"bx--snippet",!0),E(e,"bx--snippet--expand",M[0]),E(e,"bx--snippet--light",M[9]),E(e,"bx--snippet--no-copy",M[6]),E(e,"bx--snippet--wraptext",M[8]),E(e,"bx--snippet--single",M[3]==="single"),E(e,"bx--snippet--inline",M[3]==="inline"),E(e,"bx--snippet--multi",M[3]==="multi"),E(e,"bx--snippet--disabled",M[3]!=="inline"&&M[7])},i(M){c||(b(v,M),b(S),b(A),c=!0)},o(M){k(v,M),k(S),k(A),c=!1},d(M){M&&w(e),v&&v.d(M),t[39](null),S&&S.d(),A&&A.d(),d=!1,vt(h)}}}function MP(t){let e,n,i,l;const r=[IP,LP],s=[];function o(a,u){return a[6]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function OP(t){let e,n;const i=[{type:t[3]},t[22]];let l={};for(let r=0;r{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function NP(t,e,n){let i,l,r;const s=["type","code","copy","expanded","hideCopyButton","disabled","wrapText","light","skeleton","copyButtonDescription","copyLabel","feedback","feedbackTimeout","showLessText","showMoreText","showMoreLess","id","ref"];let o=ae(e,s),{$$slots:a={},$$scope:u}=e,{type:f="single"}=e,{code:c=void 0}=e,{copy:d=async Oe=>{try{await navigator.clipboard.writeText(Oe)}catch(dt){console.log(dt)}}}=e,{expanded:h=!1}=e,{hideCopyButton:g=!1}=e,{disabled:_=!1}=e,{wrapText:v=!1}=e,{light:S=!1}=e,{skeleton:A=!1}=e,{copyButtonDescription:C=void 0}=e,{copyLabel:I=void 0}=e,{feedback:M="Copied!"}=e,{feedbackTimeout:L=2e3}=e,{showLessText:N="Show less"}=e,{showMoreText:z="Show more"}=e,{showMoreLess:W=!1}=e,{id:D="ccs-"+Math.random().toString(36)}=e,{ref:G=null}=e;const $=yn();let j,Q;function le(){const{height:Oe}=G.getBoundingClientRect();Oe>0&&n(2,W=G.getBoundingClientRect().height>255)}_n(()=>()=>clearTimeout(Q));function oe(Oe){te.call(this,t,Oe)}function X(Oe){te.call(this,t,Oe)}function de(Oe){te.call(this,t,Oe)}function re(Oe){te.call(this,t,Oe)}function x(Oe){te.call(this,t,Oe)}function me(Oe){te.call(this,t,Oe)}function ee(Oe){te.call(this,t,Oe)}function ke(Oe){te.call(this,t,Oe)}function pe(Oe){te.call(this,t,Oe)}function Fe(Oe){te.call(this,t,Oe)}function Ve(Oe){te.call(this,t,Oe)}const Ee=()=>{d(c),$("copy"),j!=="fade-in"&&(n(16,j="fade-in"),n(17,Q=setTimeout(()=>{n(16,j="fade-out")},L)))},We=({animationName:Oe})=>{Oe==="hide-feedback"&&n(16,j=void 0)};function ge(Oe){ft[Oe?"unshift":"push"](()=>{G=Oe,n(1,G)})}function ve(Oe){te.call(this,t,Oe)}function be(Oe){te.call(this,t,Oe)}function ue(Oe){te.call(this,t,Oe)}const nt=()=>{n(0,h=!h)};return t.$$set=Oe=>{e=Y(Y({},e),Se(Oe)),n(22,o=ae(e,s)),"type"in Oe&&n(3,f=Oe.type),"code"in Oe&&n(4,c=Oe.code),"copy"in Oe&&n(5,d=Oe.copy),"expanded"in Oe&&n(0,h=Oe.expanded),"hideCopyButton"in Oe&&n(6,g=Oe.hideCopyButton),"disabled"in Oe&&n(7,_=Oe.disabled),"wrapText"in Oe&&n(8,v=Oe.wrapText),"light"in Oe&&n(9,S=Oe.light),"skeleton"in Oe&&n(10,A=Oe.skeleton),"copyButtonDescription"in Oe&&n(11,C=Oe.copyButtonDescription),"copyLabel"in Oe&&n(12,I=Oe.copyLabel),"feedback"in Oe&&n(13,M=Oe.feedback),"feedbackTimeout"in Oe&&n(14,L=Oe.feedbackTimeout),"showLessText"in Oe&&n(23,N=Oe.showLessText),"showMoreText"in Oe&&n(24,z=Oe.showMoreText),"showMoreLess"in Oe&&n(2,W=Oe.showMoreLess),"id"in Oe&&n(15,D=Oe.id),"ref"in Oe&&n(1,G=Oe.ref),"$$scope"in Oe&&n(44,u=Oe.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&25165825&&n(20,i=h?N:z),t.$$.dirty[0]&1&&n(19,l=h?16*15:48),t.$$.dirty[0]&1&&n(18,r=h?"none":16*15+"px"),t.$$.dirty[0]&26&&f==="multi"&&G&&(c===void 0&&le(),c&&pc().then(le)),t.$$.dirty[0]&9&&f==="multi"&&$(h?"expand":"collapse")},[h,G,W,f,c,d,g,_,v,S,A,C,I,M,L,D,j,Q,r,l,i,$,o,N,z,a,oe,X,de,re,x,me,ee,ke,pe,Fe,Ve,Ee,We,ge,ve,be,ue,nt,u]}class BP extends De{constructor(e){super(),Re(this,e,NP,PP,Ie,{type:3,code:4,copy:5,expanded:0,hideCopyButton:6,disabled:7,wrapText:8,light:9,skeleton:10,copyButtonDescription:11,copyLabel:12,feedback:13,feedbackTimeout:14,showLessText:23,showMoreText:24,showMoreLess:2,id:15,ref:1},null,[-1,-1])}}const zP=BP,HP=t=>({}),jp=t=>({});function Yp(t){let e,n;const i=t[16].labelText,l=Ze(i,t,t[15],jp),r=l||UP(t);return{c(){e=R("span"),r&&r.c(),E(e,"bx--visually-hidden",t[7])},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&32768)&&Ke(l,i,s,s[15],n?Xe(i,s[15],o,HP):$e(s[15]),jp):r&&r.p&&(!n||o&64)&&r.p(s,n?o:-1),(!n||o&128)&&E(e,"bx--visually-hidden",s[7])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function UP(t){let e;return{c(){e=q(t[6])},m(n,i){y(n,e,i)},p(n,i){i&64&&Z(e,n[6])},d(n){n&&w(e)}}}function FP(t){let e,n,i,l,r,s,o,a,u,f=(t[6]||t[13].labelText)&&Yp(t),c=[t[12]],d={};for(let h=0;h{f=null}),ce()),(!o||g&256)&&P(l,"for",h[8]),Ae(e,d=Ue(c,[g&4096&&h[12]])),E(e,"bx--radio-button-wrapper",!0),E(e,"bx--radio-button-wrapper--label-left",h[5]==="left")},i(h){o||(b(f),o=!0)},o(h){k(f),o=!1},d(h){h&&w(e),t[18](null),f&&f.d(),a=!1,vt(u)}}}function GP(t,e,n){const i=["value","checked","disabled","required","labelPosition","labelText","hideLabel","id","name","ref"];let l=ae(e,i),r,{$$slots:s={},$$scope:o}=e;const a=Yi(s);let{value:u=""}=e,{checked:f=!1}=e,{disabled:c=!1}=e,{required:d=!1}=e,{labelPosition:h="right"}=e,{labelText:g=""}=e,{hideLabel:_=!1}=e,{id:v="ccs-"+Math.random().toString(36)}=e,{name:S=""}=e,{ref:A=null}=e;const C=bi("RadioButtonGroup"),I=C?C.selectedValue:un(f?u:void 0);Mt(t,I,z=>n(14,r=z)),C&&C.add({id:v,checked:f,disabled:c,value:u});function M(z){te.call(this,t,z)}function L(z){ft[z?"unshift":"push"](()=>{A=z,n(1,A)})}const N=()=>{C&&C.update(u)};return t.$$set=z=>{e=Y(Y({},e),Se(z)),n(12,l=ae(e,i)),"value"in z&&n(2,u=z.value),"checked"in z&&n(0,f=z.checked),"disabled"in z&&n(3,c=z.disabled),"required"in z&&n(4,d=z.required),"labelPosition"in z&&n(5,h=z.labelPosition),"labelText"in z&&n(6,g=z.labelText),"hideLabel"in z&&n(7,_=z.hideLabel),"id"in z&&n(8,v=z.id),"name"in z&&n(9,S=z.name),"ref"in z&&n(1,A=z.ref),"$$scope"in z&&n(15,o=z.$$scope)},t.$$.update=()=>{t.$$.dirty&16388&&n(0,f=r===u)},[f,A,u,c,d,h,g,_,v,S,C,I,l,a,r,o,s,M,L,N]}class VP extends De{constructor(e){super(),Re(this,e,GP,FP,Ie,{value:2,checked:0,disabled:3,required:4,labelPosition:5,labelText:6,hideLabel:7,id:8,name:9,ref:1})}}const mu=VP;function WP(t){let e,n;const i=t[8].default,l=Ze(i,t,t[7],null);let r=[t[6],{style:t[5]}],s={};for(let o=0;o{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function YP(t,e,n){const i=["size","zebra","useStaticWidth","sortable","stickyHeader","tableStyle"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{size:o=void 0}=e,{zebra:a=!1}=e,{useStaticWidth:u=!1}=e,{sortable:f=!1}=e,{stickyHeader:c=!1}=e,{tableStyle:d=void 0}=e;return t.$$set=h=>{e=Y(Y({},e),Se(h)),n(6,l=ae(e,i)),"size"in h&&n(0,o=h.size),"zebra"in h&&n(1,a=h.zebra),"useStaticWidth"in h&&n(2,u=h.useStaticWidth),"sortable"in h&&n(3,f=h.sortable),"stickyHeader"in h&&n(4,c=h.stickyHeader),"tableStyle"in h&&n(5,d=h.tableStyle),"$$scope"in h&&n(7,s=h.$$scope)},[o,a,u,f,c,d,l,s,r]}class ZP extends De{constructor(e){super(),Re(this,e,YP,jP,Ie,{size:0,zebra:1,useStaticWidth:2,sortable:3,stickyHeader:4,tableStyle:5})}}const XP=ZP;function KP(t){let e,n;const i=t[2].default,l=Ze(i,t,t[1],null);let r=[{"aria-live":"polite"},t[0]],s={};for(let o=0;o{e=Y(Y({},e),Se(o)),n(0,l=ae(e,i)),"$$scope"in o&&n(1,s=o.$$scope)},[l,s,r]}class JP extends De{constructor(e){super(),Re(this,e,$P,KP,Ie,{})}}const QP=JP;function xP(t){let e,n,i,l;const r=t[2].default,s=Ze(r,t,t[1],null);let o=[t[0]],a={};for(let u=0;u{e=Y(Y({},e),Se(c)),n(0,l=ae(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class tN extends De{constructor(e){super(),Re(this,e,eN,xP,Ie,{})}}const Y1=tN;function Zp(t){let e,n,i,l,r,s;return{c(){e=R("div"),n=R("h4"),i=q(t[0]),l=B(),r=R("p"),s=q(t[1]),E(n,"bx--data-table-header__title",!0),E(r,"bx--data-table-header__description",!0),E(e,"bx--data-table-header",!0)},m(o,a){y(o,e,a),T(e,n),T(n,i),T(e,l),T(e,r),T(r,s)},p(o,a){a&1&&Z(i,o[0]),a&2&&Z(s,o[1])},d(o){o&&w(e)}}}function nN(t){let e,n,i,l=t[0]&&Zp(t);const r=t[6].default,s=Ze(r,t,t[5],null);let o=[t[4]],a={};for(let u=0;u{e=Y(Y({},e),Se(c)),n(4,l=ae(e,i)),"title"in c&&n(0,o=c.title),"description"in c&&n(1,a=c.description),"stickyHeader"in c&&n(2,u=c.stickyHeader),"useStaticWidth"in c&&n(3,f=c.useStaticWidth),"$$scope"in c&&n(5,s=c.$$scope)},[o,a,u,f,l,s,r]}class lN extends De{constructor(e){super(),Re(this,e,iN,nN,Ie,{title:0,description:1,stickyHeader:2,useStaticWidth:3})}}const rN=lN;function sN(t){let e,n,i,l;const r=t[2].default,s=Ze(r,t,t[1],null);let o=[t[0]],a={};for(let u=0;u{e=Y(Y({},e),Se(c)),n(0,l=ae(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class aN extends De{constructor(e){super(),Re(this,e,oN,sN,Ie,{})}}const uN=aN;function Xp(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function fN(t){let e,n,i=t[1]&&Xp(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class dN extends De{constructor(e){super(),Re(this,e,cN,fN,Ie,{size:0,title:1})}}const hN=dN;function Kp(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function mN(t){let e,n,i=t[1]&&Kp(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class _N extends De{constructor(e){super(),Re(this,e,gN,mN,Ie,{size:0,title:1})}}const pN=_N;function bN(t){let e,n,i,l,r;const s=t[9].default,o=Ze(s,t,t[8],null);let a=[{scope:t[3]},{"data-header":t[4]},t[6]],u={};for(let f=0;f{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function wN(t,e,n){let i;const l=["sortable","sortDirection","active","scope","translateWithId","id"];let r=ae(e,l),{$$slots:s={},$$scope:o}=e,{sortable:a=!1}=e,{sortDirection:u="none"}=e,{active:f=!1}=e,{scope:c="col"}=e,{translateWithId:d=()=>""}=e,{id:h="ccs-"+Math.random().toString(36)}=e;function g(L){te.call(this,t,L)}function _(L){te.call(this,t,L)}function v(L){te.call(this,t,L)}function S(L){te.call(this,t,L)}function A(L){te.call(this,t,L)}function C(L){te.call(this,t,L)}function I(L){te.call(this,t,L)}function M(L){te.call(this,t,L)}return t.$$set=L=>{e=Y(Y({},e),Se(L)),n(6,r=ae(e,l)),"sortable"in L&&n(0,a=L.sortable),"sortDirection"in L&&n(1,u=L.sortDirection),"active"in L&&n(2,f=L.active),"scope"in L&&n(3,c=L.scope),"translateWithId"in L&&n(7,d=L.translateWithId),"id"in L&&n(4,h=L.id),"$$scope"in L&&n(8,o=L.$$scope)},t.$$.update=()=>{t.$$.dirty&128&&n(5,i=d())},[a,u,f,c,h,i,r,d,o,s,g,_,v,S,A,C,I,M]}class yN extends De{constructor(e){super(),Re(this,e,wN,kN,Ie,{sortable:0,sortDirection:1,active:2,scope:3,translateWithId:7,id:4})}}const TN=yN;function SN(t){let e,n,i,l;const r=t[2].default,s=Ze(r,t,t[1],null);let o=[t[0]],a={};for(let u=0;u{e=Y(Y({},e),Se(c)),n(0,l=ae(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class MN extends De{constructor(e){super(),Re(this,e,EN,SN,Ie,{})}}const AT=MN;function $p(t,e,n){const i=t.slice();return i[66]=e[n],i[68]=n,i}const ON=t=>({row:t[0]&201850880}),Jp=t=>({row:t[66]});function Qp(t,e,n){const i=t.slice();return i[69]=e[n],i[71]=n,i}const AN=t=>({row:t[0]&201850880,cell:t[0]&470286336,rowIndex:t[0]&201850880,cellIndex:t[0]&470286336}),xp=t=>({row:t[66],cell:t[69],rowIndex:t[68],cellIndex:t[71]}),CN=t=>({row:t[0]&201850880,cell:t[0]&470286336,rowIndex:t[0]&201850880,cellIndex:t[0]&470286336}),eb=t=>({row:t[66],cell:t[69],rowIndex:t[68],cellIndex:t[71]});function tb(t,e,n){const i=t.slice();return i[72]=e[n],i}const LN=t=>({header:t[0]&64}),nb=t=>({header:t[72]}),IN=t=>({}),ib=t=>({}),RN=t=>({}),lb=t=>({});function rb(t){let e,n,i,l=(t[8]||t[38].title)&&sb(t),r=(t[9]||t[38].description)&&ob(t);return{c(){e=R("div"),l&&l.c(),n=B(),r&&r.c(),E(e,"bx--data-table-header",!0)},m(s,o){y(s,e,o),l&&l.m(e,null),T(e,n),r&&r.m(e,null),i=!0},p(s,o){s[8]||s[38].title?l?(l.p(s,o),o[0]&256|o[1]&128&&b(l,1)):(l=sb(s),l.c(),b(l,1),l.m(e,n)):l&&(fe(),k(l,1,1,()=>{l=null}),ce()),s[9]||s[38].description?r?(r.p(s,o),o[0]&512|o[1]&128&&b(r,1)):(r=ob(s),r.c(),b(r,1),r.m(e,null)):r&&(fe(),k(r,1,1,()=>{r=null}),ce())},i(s){i||(b(l),b(r),i=!0)},o(s){k(l),k(r),i=!1},d(s){s&&w(e),l&&l.d(),r&&r.d()}}}function sb(t){let e,n;const i=t[48].title,l=Ze(i,t,t[62],lb),r=l||DN(t);return{c(){e=R("h4"),r&&r.c(),E(e,"bx--data-table-header__title",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[2]&1)&&Ke(l,i,s,s[62],n?Xe(i,s[62],o,RN):$e(s[62]),lb):r&&r.p&&(!n||o[0]&256)&&r.p(s,n?o:[-1,-1,-1])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function DN(t){let e;return{c(){e=q(t[8])},m(n,i){y(n,e,i)},p(n,i){i[0]&256&&Z(e,n[8])},d(n){n&&w(e)}}}function ob(t){let e,n;const i=t[48].description,l=Ze(i,t,t[62],ib),r=l||PN(t);return{c(){e=R("p"),r&&r.c(),E(e,"bx--data-table-header__description",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[2]&1)&&Ke(l,i,s,s[62],n?Xe(i,s[62],o,IN):$e(s[62]),ib):r&&r.p&&(!n||o[0]&512)&&r.p(s,n?o:[-1,-1,-1])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function PN(t){let e;return{c(){e=q(t[9])},m(n,i){y(n,e,i)},p(n,i){i[0]&512&&Z(e,n[9])},d(n){n&&w(e)}}}function ab(t){let e,n,i,l=t[12]&&ub(t);return{c(){e=R("th"),l&&l.c(),P(e,"scope","col"),P(e,"data-previous-value",n=t[22]?"collapsed":void 0),E(e,"bx--table-expand",!0)},m(r,s){y(r,e,s),l&&l.m(e,null),i=!0},p(r,s){r[12]?l?(l.p(r,s),s[0]&4096&&b(l,1)):(l=ub(r),l.c(),b(l,1),l.m(e,null)):l&&(fe(),k(l,1,1,()=>{l=null}),ce()),(!i||s[0]&4194304&&n!==(n=r[22]?"collapsed":void 0))&&P(e,"data-previous-value",n)},i(r){i||(b(l),i=!0)},o(r){k(l),i=!1},d(r){r&&w(e),l&&l.d()}}}function ub(t){let e,n,i,l,r;return n=new wT({props:{class:"bx--table-expand__svg"}}),{c(){e=R("button"),F(n.$$.fragment),P(e,"type","button"),E(e,"bx--table-expand__button",!0)},m(s,o){y(s,e,o),H(n,e,null),i=!0,l||(r=J(e,"click",t[49]),l=!0)},p:he,i(s){i||(b(n.$$.fragment,s),i=!0)},o(s){k(n.$$.fragment,s),i=!1},d(s){s&&w(e),U(n),l=!1,r()}}}function fb(t){let e;return{c(){e=R("th"),P(e,"scope","col")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function cb(t){let e,n,i,l;function r(o){t[50](o)}let s={"aria-label":"Select all rows",checked:t[30],indeterminate:t[29]};return t[24]!==void 0&&(s.ref=t[24]),n=new TT({props:s}),ft.push(()=>Yt(n,"ref",r)),n.$on("change",t[51]),{c(){e=R("th"),F(n.$$.fragment),P(e,"scope","col"),E(e,"bx--table-column-checkbox",!0)},m(o,a){y(o,e,a),H(n,e,null),l=!0},p(o,a){const u={};a[0]&1073741824&&(u.checked=o[30]),a[0]&536870912&&(u.indeterminate=o[29]),!i&&a[0]&16777216&&(i=!0,u.ref=o[24],jt(()=>i=!1)),n.$set(u)},i(o){l||(b(n.$$.fragment,o),l=!0)},o(o){k(n.$$.fragment,o),l=!1},d(o){o&&w(e),U(n)}}}function NN(t){let e,n;function i(){return t[52](t[72])}return e=new TN({props:{id:t[72].key,style:t[36](t[72]),sortable:t[11]&&t[72].sort!==!1,sortDirection:t[0]===t[72].key?t[1]:"none",active:t[0]===t[72].key,$$slots:{default:[HN]},$$scope:{ctx:t}}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&64&&(s.id=t[72].key),r[0]&64&&(s.style=t[36](t[72])),r[0]&2112&&(s.sortable=t[11]&&t[72].sort!==!1),r[0]&67&&(s.sortDirection=t[0]===t[72].key?t[1]:"none"),r[0]&65&&(s.active=t[0]===t[72].key),r[0]&64|r[2]&1&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function BN(t){let e,n;return{c(){e=R("th"),P(e,"scope","col"),P(e,"style",n=t[36](t[72]))},m(i,l){y(i,e,l)},p(i,l){l[0]&64&&n!==(n=i[36](i[72]))&&P(e,"style",n)},i:he,o:he,d(i){i&&w(e)}}}function zN(t){let e=t[72].value+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[72].value+"")&&Z(n,e)},d(i){i&&w(n)}}}function HN(t){let e,n;const i=t[48]["cell-header"],l=Ze(i,t,t[62],nb),r=l||zN(t);return{c(){r&&r.c(),e=B()},m(s,o){r&&r.m(s,o),y(s,e,o),n=!0},p(s,o){l?l.p&&(!n||o[0]&64|o[2]&1)&&Ke(l,i,s,s[62],n?Xe(i,s[62],o,LN):$e(s[62]),nb):r&&r.p&&(!n||o[0]&64)&&r.p(s,n?o:[-1,-1,-1])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function db(t,e){let n,i,l,r,s;const o=[BN,NN],a=[];function u(f,c){return f[72].empty?0:1}return i=u(e),l=a[i]=o[i](e),{key:t,first:null,c(){n=qe(),l.c(),r=qe(),this.first=n},m(f,c){y(f,n,c),a[i].m(f,c),y(f,r,c),s=!0},p(f,c){e=f;let d=i;i=u(e),i===d?a[i].p(e,c):(fe(),k(a[d],1,1,()=>{a[d]=null}),ce(),l=a[i],l?l.p(e,c):(l=a[i]=o[i](e),l.c()),b(l,1),l.m(r.parentNode,r))},i(f){s||(b(l),s=!0)},o(f){k(l),s=!1},d(f){f&&(w(n),w(r)),a[i].d(f)}}}function UN(t){let e,n,i,l=[],r=new Map,s,o,a=t[4]&&ab(t),u=t[5]&&!t[15]&&fb(),f=t[15]&&!t[14]&&cb(t),c=ct(t[6]);const d=h=>h[72].key;for(let h=0;h{a=null}),ce()),h[5]&&!h[15]?u||(u=fb(),u.c(),u.m(n.parentNode,n)):u&&(u.d(1),u=null),h[15]&&!h[14]?f?(f.p(h,g),g[0]&49152&&b(f,1)):(f=cb(h),f.c(),b(f,1),f.m(i.parentNode,i)):f&&(fe(),k(f,1,1,()=>{f=null}),ce()),g[0]&2115|g[1]&46|g[2]&1&&(c=ct(h[6]),fe(),l=Wn(l,g,d,1,h,c,r,s.parentNode,Qn,db,s,tb),ce())},i(h){if(!o){b(a),b(f);for(let g=0;g{l=null}),ce())},i(r){i||(b(l),i=!0)},o(r){k(l),i=!1},d(r){r&&w(n),l&&l.d(r)}}}function gb(t){let e,n=!t[16].includes(t[66].id),i,l=n&&_b(t);return{c(){e=R("td"),l&&l.c(),E(e,"bx--table-column-checkbox",!0),E(e,"bx--table-column-radio",t[14])},m(r,s){y(r,e,s),l&&l.m(e,null),i=!0},p(r,s){s[0]&201916416&&(n=!r[16].includes(r[66].id)),n?l?(l.p(r,s),s[0]&201916416&&b(l,1)):(l=_b(r),l.c(),b(l,1),l.m(e,null)):l&&(fe(),k(l,1,1,()=>{l=null}),ce()),(!i||s[0]&16384)&&E(e,"bx--table-column-radio",r[14])},i(r){i||(b(l),i=!0)},o(r){k(l),i=!1},d(r){r&&w(e),l&&l.d()}}}function _b(t){let e,n,i,l;const r=[WN,VN],s=[];function o(a,u){return a[14]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function VN(t){let e,n;function i(){return t[55](t[66])}return e=new TT({props:{name:"select-row-"+t[66].id,checked:t[3].includes(t[66].id)}}),e.$on("change",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&201850880&&(s.name="select-row-"+t[66].id),r[0]&201850888&&(s.checked=t[3].includes(t[66].id)),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function WN(t){let e,n;function i(){return t[54](t[66])}return e=new mu({props:{name:"select-row-"+t[66].id,checked:t[3].includes(t[66].id)}}),e.$on("change",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&201850880&&(s.name="select-row-"+t[66].id),r[0]&201850888&&(s.checked=t[3].includes(t[66].id)),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function qN(t){let e,n;function i(){return t[56](t[66],t[69])}return e=new Y1({props:{$$slots:{default:[ZN]},$$scope:{ctx:t}}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&470286336|r[2]&1&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function jN(t){let e,n,i;const l=t[48].cell,r=Ze(l,t,t[62],eb),s=r||XN(t);return{c(){e=R("td"),s&&s.c(),n=B(),E(e,"bx--table-column-menu",t[6][t[71]].columnMenu)},m(o,a){y(o,e,a),s&&s.m(e,null),T(e,n),i=!0},p(o,a){r?r.p&&(!i||a[0]&470286336|a[2]&1)&&Ke(r,l,o,o[62],i?Xe(l,o[62],a,CN):$e(o[62]),eb):s&&s.p&&(!i||a[0]&470286336)&&s.p(o,i?a:[-1,-1,-1]),(!i||a[0]&470286400)&&E(e,"bx--table-column-menu",o[6][o[71]].columnMenu)},i(o){i||(b(s,o),i=!0)},o(o){k(s,o),i=!1},d(o){o&&w(e),s&&s.d(o)}}}function YN(t){let e=(t[69].display?t[69].display(t[69].value):t[69].value)+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&470286336&&e!==(e=(i[69].display?i[69].display(i[69].value):i[69].value)+"")&&Z(n,e)},d(i){i&&w(n)}}}function ZN(t){let e,n;const i=t[48].cell,l=Ze(i,t,t[62],xp),r=l||YN(t);return{c(){r&&r.c(),e=B()},m(s,o){r&&r.m(s,o),y(s,e,o),n=!0},p(s,o){l?l.p&&(!n||o[0]&470286336|o[2]&1)&&Ke(l,i,s,s[62],n?Xe(i,s[62],o,AN):$e(s[62]),xp):r&&r.p&&(!n||o[0]&470286336)&&r.p(s,n?o:[-1,-1,-1])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function XN(t){let e=(t[69].display?t[69].display(t[69].value):t[69].value)+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&470286336&&e!==(e=(i[69].display?i[69].display(i[69].value):i[69].value)+"")&&Z(n,e)},d(i){i&&w(n)}}}function pb(t,e){let n,i,l,r,s;const o=[jN,qN],a=[];function u(f,c){return f[6][f[71]].empty?0:1}return i=u(e),l=a[i]=o[i](e),{key:t,first:null,c(){n=qe(),l.c(),r=qe(),this.first=n},m(f,c){y(f,n,c),a[i].m(f,c),y(f,r,c),s=!0},p(f,c){e=f;let d=i;i=u(e),i===d?a[i].p(e,c):(fe(),k(a[d],1,1,()=>{a[d]=null}),ce(),l=a[i],l?l.p(e,c):(l=a[i]=o[i](e),l.c()),b(l,1),l.m(r.parentNode,r))},i(f){s||(b(l),s=!0)},o(f){k(l),s=!1},d(f){f&&(w(n),w(r)),a[i].d(f)}}}function KN(t){let e,n,i=[],l=new Map,r,s,o=t[4]&&hb(t),a=t[5]&&gb(t),u=ct(t[28][t[66].id]);const f=c=>c[69].key;for(let c=0;c{o=null}),ce()),c[5]?a?(a.p(c,d),d[0]&32&&b(a,1)):(a=gb(c),a.c(),b(a,1),a.m(n.parentNode,n)):a&&(fe(),k(a,1,1,()=>{a=null}),ce()),d[0]&470286400|d[1]&8|d[2]&1&&(u=ct(c[28][c[66].id]),fe(),i=Wn(i,d,f,1,c,u,l,r.parentNode,Qn,pb,r,Qp),ce())},i(c){if(!s){b(o),b(a);for(let d=0;d{o=null}),ce())},i(f){l||(b(o),l=!0)},o(f){k(o),l=!1},d(f){f&&w(e),o&&o.d(),r=!1,vt(s)}}}function vb(t){let e,n;return e=new Y1({props:{colspan:t[5]?t[6].length+2:t[6].length+1,$$slots:{default:[$N]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&96&&(r.colspan=i[5]?i[6].length+2:i[6].length+1),l[0]&201850880|l[2]&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function $N(t){let e,n;const i=t[48]["expanded-row"],l=Ze(i,t,t[62],Jp);return{c(){e=R("div"),l&&l.c(),E(e,"bx--child-row-inner-container",!0)},m(r,s){y(r,e,s),l&&l.m(e,null),n=!0},p(r,s){l&&l.p&&(!n||s[0]&201850880|s[2]&1)&&Ke(l,i,r,r[62],n?Xe(i,r[62],s,ON):$e(r[62]),Jp)},i(r){n||(b(l,r),n=!0)},o(r){k(l,r),n=!1},d(r){r&&w(e),l&&l.d(r)}}}function kb(t,e){let n,i,l,r,s;function o(...c){return e[57](e[66],...c)}function a(){return e[58](e[66])}function u(){return e[59](e[66])}i=new AT({props:{"data-row":e[66].id,"data-parent-row":e[4]?!0:void 0,class:(e[3].includes(e[66].id)?"bx--data-table--selected":"")+" "+(e[31][e[66].id]?"bx--expandable-row":"")+" "+(e[4]?"bx--parent-row":"")+" "+(e[4]&&e[23]===e[66].id?"bx--expandable-row--hover":""),$$slots:{default:[KN]},$$scope:{ctx:e}}}),i.$on("click",o),i.$on("mouseenter",a),i.$on("mouseleave",u);let f=e[4]&&bb(e);return{key:t,first:null,c(){n=qe(),F(i.$$.fragment),l=B(),f&&f.c(),r=qe(),this.first=n},m(c,d){y(c,n,d),H(i,c,d),y(c,l,d),f&&f.m(c,d),y(c,r,d),s=!0},p(c,d){e=c;const h={};d[0]&201850880&&(h["data-row"]=e[66].id),d[0]&16&&(h["data-parent-row"]=e[4]?!0:void 0),d[0]&210239512|d[1]&1&&(h.class=(e[3].includes(e[66].id)?"bx--data-table--selected":"")+" "+(e[31][e[66].id]?"bx--expandable-row":"")+" "+(e[4]?"bx--parent-row":"")+" "+(e[4]&&e[23]===e[66].id?"bx--expandable-row--hover":"")),d[0]&470376572|d[1]&1|d[2]&1&&(h.$$scope={dirty:d,ctx:e}),i.$set(h),e[4]?f?(f.p(e,d),d[0]&16&&b(f,1)):(f=bb(e),f.c(),b(f,1),f.m(r.parentNode,r)):f&&(fe(),k(f,1,1,()=>{f=null}),ce())},i(c){s||(b(i.$$.fragment,c),b(f),s=!0)},o(c){k(i.$$.fragment,c),k(f),s=!1},d(c){c&&(w(n),w(l),w(r)),U(i,c),f&&f.d(c)}}}function JN(t){let e=[],n=new Map,i,l,r=ct(t[19]?t[26]:t[27]);const s=o=>o[66].id;for(let o=0;o{r=null}),ce()),o&&o.p&&(!l||u[2]&1)&&Ke(o,s,a,a[62],l?Xe(s,a[62],u,null):$e(a[62]),null);const f={};u[0]&1024&&(f.zebra=a[10]),u[0]&128&&(f.size=a[7]),u[0]&131072&&(f.stickyHeader=a[17]),u[0]&2048&&(f.sortable=a[11]),u[0]&262144&&(f.useStaticWidth=a[18]),u[0]&33554432&&(f.tableStyle=a[25]&&"table-layout: fixed"),u[0]&2113534079|u[1]&3|u[2]&1&&(f.$$scope={dirty:u,ctx:a}),i.$set(f)},i(a){l||(b(r),b(o,a),b(i.$$.fragment,a),l=!0)},o(a){k(r),k(o,a),k(i.$$.fragment,a),l=!1},d(a){a&&(w(e),w(n)),r&&r.d(a),o&&o.d(a),U(i,a)}}}function eB(t){let e,n;const i=[{useStaticWidth:t[18]},t[37]];let l={$$slots:{default:[xN]},$$scope:{ctx:t}};for(let r=0;rn(47,M=Be));const dt=(Be,Ot)=>Ot in Be?Be[Ot]:Ot.split(/[\.\[\]\'\"]/).filter(kt=>kt).reduce((kt,Pt)=>kt&&typeof kt=="object"?kt[Pt]:kt,Be);Wi("DataTable",{batchSelectedIds:nt,tableRows:Oe,resetSelectedRowIds:()=>{n(30,a=!1),n(3,Fe=[]),ut&&n(24,ut.checked=!1,ut)}});let yt=!1,at=null,ut=null;const At=(Be,Ot,kt)=>Ot&&kt?Be.slice((Ot-1)*kt,Ot*kt):Be,xe=Be=>{const Ot=[Be.width&&`width: ${Be.width}`,Be.minWidth&&`min-width: ${Be.minWidth}`].filter(Boolean);if(Ot.length!==0)return Ot.join(";")},mt=()=>{n(22,yt=!yt),n(2,x=yt?s:[]),ue("click:header--expand",{expanded:yt})};function we(Be){ut=Be,n(24,ut)}const gt=Be=>{if(ue("click:header--select",{indeterminate:u,selected:!u&&Be.target.checked}),u){Be.target.checked=!1,n(30,a=!1),n(3,Fe=[]);return}Be.target.checked?n(3,Fe=o):n(3,Fe=[])},It=Be=>{if(ue("click",{header:Be}),Be.sort===!1)ue("click:header",{header:Be});else{let Ot=oe===Be.key?X:"none";n(1,X=be[Ot]),n(0,oe=X==="none"?null:i[Be.key]),ue("click:header",{header:Be,sortDirection:X})}},Ht=Be=>{const Ot=!!l[Be.id];n(2,x=Ot?x.filter(kt=>kt!==Be.id):[...x,Be.id]),ue("click:row--expand",{row:Be,expanded:!Ot})},Wt=Be=>{n(3,Fe=[Be.id]),ue("click:row--select",{row:Be,selected:!0})},qt=Be=>{Fe.includes(Be.id)?(n(3,Fe=Fe.filter(Ot=>Ot!==Be.id)),ue("click:row--select",{row:Be,selected:!1})):(n(3,Fe=[...Fe,Be.id]),ue("click:row--select",{row:Be,selected:!0}))},Xt=(Be,Ot)=>{ue("click",{row:Be,cell:Ot}),ue("click:cell",Ot)},Ce=(Be,{target:Ot})=>{[...Ot.classList].some(kt=>/^bx--(overflow-menu|checkbox|radio-button)/.test(kt))||(ue("click",{row:Be}),ue("click:row",Be))},se=Be=>{ue("mouseenter:row",Be)},Le=Be=>{ue("mouseleave:row",Be)},_t=Be=>{me.includes(Be.id)||n(23,at=Be.id)},zt=Be=>{me.includes(Be.id)||n(23,at=null)};return t.$$set=Be=>{e=Y(Y({},e),Se(Be)),n(37,I=ae(e,C)),"headers"in Be&&n(6,W=Be.headers),"rows"in Be&&n(39,D=Be.rows),"size"in Be&&n(7,G=Be.size),"title"in Be&&n(8,$=Be.title),"description"in Be&&n(9,j=Be.description),"zebra"in Be&&n(10,Q=Be.zebra),"sortable"in Be&&n(11,le=Be.sortable),"sortKey"in Be&&n(0,oe=Be.sortKey),"sortDirection"in Be&&n(1,X=Be.sortDirection),"expandable"in Be&&n(4,de=Be.expandable),"batchExpansion"in Be&&n(12,re=Be.batchExpansion),"expandedRowIds"in Be&&n(2,x=Be.expandedRowIds),"nonExpandableRowIds"in Be&&n(13,me=Be.nonExpandableRowIds),"radio"in Be&&n(14,ee=Be.radio),"selectable"in Be&&n(5,ke=Be.selectable),"batchSelection"in Be&&n(15,pe=Be.batchSelection),"selectedRowIds"in Be&&n(3,Fe=Be.selectedRowIds),"nonSelectableRowIds"in Be&&n(16,Ve=Be.nonSelectableRowIds),"stickyHeader"in Be&&n(17,Ee=Be.stickyHeader),"useStaticWidth"in Be&&n(18,We=Be.useStaticWidth),"pageSize"in Be&&n(40,ge=Be.pageSize),"page"in Be&&n(41,ve=Be.page),"$$scope"in Be&&n(62,N=Be.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&64&&n(32,i=W.reduce((Be,Ot)=>({...Be,[Ot.key]:Ot.key}),{})),t.$$.dirty[0]&4&&n(31,l=x.reduce((Be,Ot)=>({...Be,[Ot]:!0}),{})),t.$$.dirty[0]&8&&nt.set(Fe),t.$$.dirty[0]&64&&n(45,f=W.map(({key:Be})=>Be)),t.$$.dirty[0]&64|t.$$.dirty[1]&16640&&n(28,c=D.reduce((Be,Ot)=>(Be[Ot.id]=f.map((kt,Pt)=>({key:kt,value:dt(Ot,kt),display:W[Pt].display})),Be),{})),t.$$.dirty[1]&256&&Js(Oe,M=D,M),t.$$.dirty[1]&65536&&n(46,r=M.map(Be=>Be.id)),t.$$.dirty[0]&8192|t.$$.dirty[1]&32768&&n(20,s=r.filter(Be=>!me.includes(Be))),t.$$.dirty[0]&65536|t.$$.dirty[1]&32768&&n(21,o=r.filter(Be=>!Ve.includes(Be))),t.$$.dirty[0]&2097160&&n(30,a=o.length>0&&Fe.length===o.length),t.$$.dirty[0]&2097160&&n(29,u=Fe.length>0&&Fe.lengthBe.key===oe)),t.$$.dirty[0]&524291|t.$$.dirty[1]&77824&&g&&(X==="none"?n(42,d=M):n(42,d=[...M].sort((Be,Ot)=>{const kt=dt(h?Be:Ot,oe),Pt=dt(h?Ot:Be,oe);return _!=null&&_.sort?_.sort(kt,Pt):typeof kt=="number"&&typeof Pt=="number"?kt-Pt:[kt,Pt].every(Ye=>!Ye&&Ye!==0)?0:!kt&&kt!==0?h?1:-1:!Pt&&Pt!==0?h?-1:1:kt.toString().localeCompare(Pt.toString(),"en",{numeric:!0})}))),t.$$.dirty[1]&67072&&n(27,v=At(M,ve,ge)),t.$$.dirty[1]&3584&&n(26,S=At(d,ve,ge)),t.$$.dirty[0]&64&&n(25,A=W.some(Be=>Be.width||Be.minWidth))},[oe,X,x,Fe,de,ke,W,G,$,j,Q,le,re,me,ee,pe,Ve,Ee,We,g,s,o,yt,at,ut,A,S,v,c,u,a,l,i,be,ue,Oe,xe,I,z,D,ge,ve,d,h,_,f,r,M,L,mt,we,gt,It,Ht,Wt,qt,Xt,Ce,se,Le,_t,zt,N]}class nB extends De{constructor(e){super(),Re(this,e,tB,eB,Ie,{headers:6,rows:39,size:7,title:8,description:9,zebra:10,sortable:11,sortKey:0,sortDirection:1,expandable:4,batchExpansion:12,expandedRowIds:2,nonExpandableRowIds:13,radio:14,selectable:5,batchSelection:15,selectedRowIds:3,nonSelectableRowIds:16,stickyHeader:17,useStaticWidth:18,pageSize:40,page:41},null,[-1,-1,-1])}}const Ol=nB;function iB(t){let e,n;const i=t[4].default,l=Ze(i,t,t[3],null);let r=[{"aria-label":"data table toolbar"},t[2]],s={};for(let o=0;o{u.set(c),a&&n(1,a.style.overflow=c?"visible":"inherit",a)}});function f(c){ft[c?"unshift":"push"](()=>{a=c,n(1,a)})}return t.$$set=c=>{e=Y(Y({},e),Se(c)),n(2,l=ae(e,i)),"size"in c&&n(0,o=c.size),"$$scope"in c&&n(3,s=c.$$scope)},[o,a,l,s,r,f]}class rB extends De{constructor(e){super(),Re(this,e,lB,iB,Ie,{size:0})}}const Z1=rB;function sB(t){let e,n;const i=t[1].default,l=Ze(i,t,t[0],null);return{c(){e=R("div"),l&&l.c(),E(e,"bx--toolbar-content",!0)},m(r,s){y(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Ke(l,i,r,r[0],n?Xe(i,r[0],s,null):$e(r[0]),null)},i(r){n||(b(l,r),n=!0)},o(r){k(l,r),n=!1},d(r){r&&w(e),l&&l.d(r)}}}function oB(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class aB extends De{constructor(e){super(),Re(this,e,oB,sB,Ie,{})}}const X1=aB;function wb(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function uB(t){let e,n,i=t[1]&&wb(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class cB extends De{constructor(e){super(),Re(this,e,fB,uB,Ie,{size:0,title:1})}}const dB=cB;function hB(t){let e,n,i,l,r,s,o=[t[1]],a={};for(let u=0;u{e=Y(Y({},e),Se(f)),n(1,l=ae(e,i)),"size"in f&&n(0,r=f.size)},[r,l,s,o,a,u]}class gB extends De{constructor(e){super(),Re(this,e,mB,hB,Ie,{size:0})}}const _B=gB,pB=t=>({}),yb=t=>({});function bB(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v;var S=t[14];function A(D,G){return{props:{class:"bx--search-magnifier-icon"}}}S&&(i=cn(S,A()));const C=t[20].labelText,I=Ze(C,t,t[19],yb),M=I||kB(t);let L=[{type:"text"},{role:"searchbox"},{autofocus:u=t[11]===!0?!0:void 0},{autocomplete:t[10]},{disabled:t[7]},{id:t[15]},{placeholder:t[9]},t[18]],N={};for(let D=0;D{U($,1)}),ce()}S?(i=cn(S,A()),F(i.$$.fragment),b(i.$$.fragment,1),H(i,n,null)):i=null}if(I?I.p&&(!g||G[0]&524288)&&Ke(I,C,D,D[19],g?Xe(C,D[19],G,pB):$e(D[19]),yb):M&&M.p&&(!g||G[0]&8192)&&M.p(D,g?G:[-1,-1]),(!g||G[0]&32768&&s!==(s=D[15]+"-search"))&&P(r,"id",s),(!g||G[0]&32768)&&P(r,"for",D[15]),Ae(a,N=Ue(L,[{type:"text"},{role:"searchbox"},(!g||G[0]&2048&&u!==(u=D[11]===!0?!0:void 0))&&{autofocus:u},(!g||G[0]&1024)&&{autocomplete:D[10]},(!g||G[0]&128)&&{disabled:D[7]},(!g||G[0]&32768)&&{id:D[15]},(!g||G[0]&512)&&{placeholder:D[9]},G[0]&262144&&D[18]])),G[0]&4&&a.value!==D[2]&&Wl(a,D[2]),E(a,"bx--search-input",!0),z!==(z=ql)){if(d){fe();const $=d;k($.$$.fragment,1,0,()=>{U($,1)}),ce()}z?(d=cn(z,W(D)),F(d.$$.fragment),b(d.$$.fragment,1),H(d,c,null)):d=null}else if(z){const $={};G[0]&8&&($.size=D[3]==="xl"?20:16),d.$set($)}(!g||G[0]&4096)&&P(c,"aria-label",D[12]),(!g||G[0]&128)&&(c.disabled=D[7]),(!g||G[0]&4)&&E(c,"bx--search-close--hidden",D[2]===""),(!g||G[0]&32768&&h!==(h=D[15]+"-search"))&&P(e,"aria-labelledby",h),(!g||G[0]&16)&&P(e,"class",D[4]),(!g||G[0]&16)&&E(e,"bx--search",!0),(!g||G[0]&80)&&E(e,"bx--search--light",D[6]),(!g||G[0]&144)&&E(e,"bx--search--disabled",D[7]),(!g||G[0]&24)&&E(e,"bx--search--sm",D[3]==="sm"),(!g||G[0]&24)&&E(e,"bx--search--lg",D[3]==="lg"),(!g||G[0]&24)&&E(e,"bx--search--xl",D[3]==="xl"),(!g||G[0]&272)&&E(e,"bx--search--expandable",D[8]),(!g||G[0]&17)&&E(e,"bx--search--expanded",D[0])},i(D){g||(i&&b(i.$$.fragment,D),b(M,D),d&&b(d.$$.fragment,D),g=!0)},o(D){i&&k(i.$$.fragment,D),k(M,D),d&&k(d.$$.fragment,D),g=!1},d(D){D&&w(e),i&&U(i),t[33](null),M&&M.d(D),t[35](null),d&&U(d),_=!1,vt(v)}}}function vB(t){let e,n;const i=[{size:t[3]},t[18]];let l={};for(let r=0;r{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function yB(t,e,n){const i=["value","size","searchClass","skeleton","light","disabled","expandable","expanded","placeholder","autocomplete","autofocus","closeButtonLabelText","labelText","icon","id","ref"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{value:o=""}=e,{size:a="xl"}=e,{searchClass:u=""}=e,{skeleton:f=!1}=e,{light:c=!1}=e,{disabled:d=!1}=e,{expandable:h=!1}=e,{expanded:g=!1}=e,{placeholder:_="Search..."}=e,{autocomplete:v="off"}=e,{autofocus:S=!1}=e,{closeButtonLabelText:A="Clear search input"}=e,{labelText:C=""}=e,{icon:I=dB}=e,{id:M="ccs-"+Math.random().toString(36)}=e,{ref:L=null}=e;const N=yn();let z=null;function W(ge){te.call(this,t,ge)}function D(ge){te.call(this,t,ge)}function G(ge){te.call(this,t,ge)}function $(ge){te.call(this,t,ge)}function j(ge){te.call(this,t,ge)}function Q(ge){te.call(this,t,ge)}function le(ge){te.call(this,t,ge)}function oe(ge){te.call(this,t,ge)}function X(ge){te.call(this,t,ge)}function de(ge){te.call(this,t,ge)}function re(ge){te.call(this,t,ge)}function x(ge){te.call(this,t,ge)}function me(ge){ft[ge?"unshift":"push"](()=>{z=ge,n(16,z)})}const ee=()=>{h&&n(0,g=!0)};function ke(ge){ft[ge?"unshift":"push"](()=>{L=ge,n(1,L)})}function pe(){o=this.value,n(2,o)}const Fe=()=>{h&&n(0,g=!0)},Ve=()=>{g&&o.trim().length===0&&n(0,g=!1)},Ee=({key:ge})=>{ge==="Escape"&&(n(2,o=""),N("clear"))},We=()=>{n(2,o=""),L.focus(),N("clear")};return t.$$set=ge=>{e=Y(Y({},e),Se(ge)),n(18,l=ae(e,i)),"value"in ge&&n(2,o=ge.value),"size"in ge&&n(3,a=ge.size),"searchClass"in ge&&n(4,u=ge.searchClass),"skeleton"in ge&&n(5,f=ge.skeleton),"light"in ge&&n(6,c=ge.light),"disabled"in ge&&n(7,d=ge.disabled),"expandable"in ge&&n(8,h=ge.expandable),"expanded"in ge&&n(0,g=ge.expanded),"placeholder"in ge&&n(9,_=ge.placeholder),"autocomplete"in ge&&n(10,v=ge.autocomplete),"autofocus"in ge&&n(11,S=ge.autofocus),"closeButtonLabelText"in ge&&n(12,A=ge.closeButtonLabelText),"labelText"in ge&&n(13,C=ge.labelText),"icon"in ge&&n(14,I=ge.icon),"id"in ge&&n(15,M=ge.id),"ref"in ge&&n(1,L=ge.ref),"$$scope"in ge&&n(19,s=ge.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&3&&g&&L&&L.focus(),t.$$.dirty[0]&1&&N(g?"expand":"collapse")},[g,L,o,a,u,f,c,d,h,_,v,S,A,C,I,M,z,N,l,s,r,W,D,G,$,j,Q,le,oe,X,de,re,x,me,ee,ke,pe,Fe,Ve,Ee,We]}class TB extends De{constructor(e){super(),Re(this,e,yB,wB,Ie,{value:2,size:3,searchClass:4,skeleton:5,light:6,disabled:7,expandable:8,expanded:0,placeholder:9,autocomplete:10,autofocus:11,closeButtonLabelText:12,labelText:13,icon:14,id:15,ref:1},null,[-1,-1])}}const CT=TB;function SB(t){let e,n,i,l;const r=[{tabindex:t[5]},{disabled:t[4]},t[9],{searchClass:t[6]+" "+t[9].class}];function s(u){t[14](u)}function o(u){t[15](u)}let a={};for(let u=0;uYt(e,"ref",s)),ft.push(()=>Yt(e,"value",o)),e.$on("clear",t[16]),e.$on("clear",t[8]),e.$on("change",t[17]),e.$on("input",t[18]),e.$on("focus",t[19]),e.$on("focus",t[8]),e.$on("blur",t[20]),e.$on("blur",t[21]),e.$on("keyup",t[22]),e.$on("keydown",t[23]),e.$on("paste",t[24]),{c(){F(e.$$.fragment)},m(u,f){H(e,u,f),l=!0},p(u,[f]){const c=f&624?Ue(r,[f&32&&{tabindex:u[5]},f&16&&{disabled:u[4]},f&512&&ul(u[9]),f&576&&{searchClass:u[6]+" "+u[9].class}]):{};!n&&f&4&&(n=!0,c.ref=u[2],jt(()=>n=!1)),!i&&f&1&&(i=!0,c.value=u[0],jt(()=>i=!1)),e.$set(c)},i(u){l||(b(e.$$.fragment,u),l=!0)},o(u){k(e.$$.fragment,u),l=!1},d(u){U(e,u)}}}function EB(t,e,n){let i,l;const r=["value","expanded","persistent","disabled","shouldFilterRows","filteredRowIds","tabindex","ref"];let s=ae(e,r),o,{value:a=""}=e,{expanded:u=!1}=e,{persistent:f=!1}=e,{disabled:c=!1}=e,{shouldFilterRows:d=!1}=e,{filteredRowIds:h=[]}=e,{tabindex:g="0"}=e,{ref:_=null}=e;const{tableRows:v}=bi("DataTable")??{};Mt(t,v,j=>n(13,o=j));async function S(){await pc(),!(c||f||u)&&(n(1,u=!0),await pc(),_.focus())}function A(j){_=j,n(2,_)}function C(j){a=j,n(0,a)}function I(j){te.call(this,t,j)}function M(j){te.call(this,t,j)}function L(j){te.call(this,t,j)}function N(j){te.call(this,t,j)}function z(j){te.call(this,t,j)}const W=()=>{n(1,u=!f&&!!a.length)};function D(j){te.call(this,t,j)}function G(j){te.call(this,t,j)}function $(j){te.call(this,t,j)}return t.$$set=j=>{e=Y(Y({},e),Se(j)),n(9,s=ae(e,r)),"value"in j&&n(0,a=j.value),"expanded"in j&&n(1,u=j.expanded),"persistent"in j&&n(3,f=j.persistent),"disabled"in j&&n(4,c=j.disabled),"shouldFilterRows"in j&&n(11,d=j.shouldFilterRows),"filteredRowIds"in j&&n(10,h=j.filteredRowIds),"tabindex"in j&&n(5,g=j.tabindex),"ref"in j&&n(2,_=j.ref)},t.$$.update=()=>{if(t.$$.dirty&8192&&n(12,i=v?[...o]:[]),t.$$.dirty&6145&&d){let j=i;a.trim().length>0&&(d===!0?j=j.filter(Q=>Object.entries(Q).filter(([le])=>le!=="id").some(([le,oe])=>{if(typeof oe=="string"||typeof oe=="number")return(oe+"").toLowerCase().includes(a.trim().toLowerCase())})):typeof d=="function"&&(j=j.filter(Q=>d(Q,a)??!1))),v.set(j),n(10,h=j.map(Q=>Q.id))}t.$$.dirty&1&&n(1,u=!!a.length),t.$$.dirty&26&&n(6,l=[u&&"bx--toolbar-search-container-active",f?"bx--toolbar-search-container-persistent":"bx--toolbar-search-container-expandable",c&&"bx--toolbar-search-container-disabled"].filter(Boolean).join(" "))},[a,u,_,f,c,g,l,v,S,s,h,d,i,o,A,C,I,M,L,N,z,W,D,G,$]}class MB extends De{constructor(e){super(),Re(this,e,EB,SB,Ie,{value:0,expanded:1,persistent:3,disabled:4,shouldFilterRows:11,filteredRowIds:10,tabindex:5,ref:2})}}const LT=MB;function Tb(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function OB(t){let e,n,i,l,r=t[1]&&Tb(t),s=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],o={};for(let a=0;a{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class CB extends De{constructor(e){super(),Re(this,e,AB,OB,Ie,{size:0,title:1})}}const LB=CB;function Sb(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function IB(t){let e,n,i,l,r=t[1]&&Sb(t),s=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],o={};for(let a=0;a{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class DB extends De{constructor(e){super(),Re(this,e,RB,IB,Ie,{size:0,title:1})}}const PB=DB,NB=t=>({}),Eb=t=>({});function BB(t){let e,n,i;var l=t[1];function r(s,o){return{props:{"aria-label":s[10],title:s[10],class:"bx--overflow-menu__icon "+s[9]}}}return l&&(e=cn(l,r(t))),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o[0]&2&&l!==(l=s[1])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r(s)),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}else if(l){const a={};o[0]&1024&&(a["aria-label"]=s[10]),o[0]&1024&&(a.title=s[10]),o[0]&512&&(a.class="bx--overflow-menu__icon "+s[9]),e.$set(a)}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function Mb(t){let e,n;const i=t[24].default,l=Ze(i,t,t[23],null);return{c(){e=R("ul"),l&&l.c(),P(e,"role","menu"),P(e,"tabindex","-1"),P(e,"aria-label",t[13]),P(e,"data-floating-menu-direction",t[5]),P(e,"class",t[8]),E(e,"bx--overflow-menu-options",!0),E(e,"bx--overflow-menu--flip",t[7]),E(e,"bx--overflow-menu-options--open",t[0]),E(e,"bx--overflow-menu-options--light",t[6]),E(e,"bx--overflow-menu-options--sm",t[4]==="sm"),E(e,"bx--overflow-menu-options--xl",t[4]==="xl"),E(e,"bx--breadcrumb-menu-options",!!t[14])},m(r,s){y(r,e,s),l&&l.m(e,null),t[31](e),n=!0},p(r,s){l&&l.p&&(!n||s[0]&8388608)&&Ke(l,i,r,r[23],n?Xe(i,r[23],s,null):$e(r[23]),null),(!n||s[0]&8192)&&P(e,"aria-label",r[13]),(!n||s[0]&32)&&P(e,"data-floating-menu-direction",r[5]),(!n||s[0]&256)&&P(e,"class",r[8]),(!n||s[0]&256)&&E(e,"bx--overflow-menu-options",!0),(!n||s[0]&384)&&E(e,"bx--overflow-menu--flip",r[7]),(!n||s[0]&257)&&E(e,"bx--overflow-menu-options--open",r[0]),(!n||s[0]&320)&&E(e,"bx--overflow-menu-options--light",r[6]),(!n||s[0]&272)&&E(e,"bx--overflow-menu-options--sm",r[4]==="sm"),(!n||s[0]&272)&&E(e,"bx--overflow-menu-options--xl",r[4]==="xl"),(!n||s[0]&16640)&&E(e,"bx--breadcrumb-menu-options",!!r[14])},i(r){n||(b(l,r),n=!0)},o(r){k(l,r),n=!1},d(r){r&&w(e),l&&l.d(r),t[31](null)}}}function zB(t){let e,n,i,l,r,s,o,a;const u=t[24].menu,f=Ze(u,t,t[23],Eb),c=f||BB(t);let d=t[0]&&Mb(t),h=[{type:"button"},{"aria-haspopup":""},{"aria-expanded":t[0]},{"aria-label":t[13]},{id:t[11]},t[19]],g={};for(let _=0;_{d=null}),ce()),Ae(l,g=Ue(h,[{type:"button"},{"aria-haspopup":""},(!s||v[0]&1)&&{"aria-expanded":_[0]},(!s||v[0]&8192)&&{"aria-label":_[13]},(!s||v[0]&2048)&&{id:_[11]},v[0]&524288&&_[19]])),E(l,"bx--overflow-menu",!0),E(l,"bx--overflow-menu--open",_[0]),E(l,"bx--overflow-menu--light",_[6]),E(l,"bx--overflow-menu--sm",_[4]==="sm"),E(l,"bx--overflow-menu--xl",_[4]==="xl")},i(_){s||(b(c,_),b(d),s=!0)},o(_){k(c,_),k(d),s=!1},d(_){_&&(e.d(),w(i),w(l)),w(n),c&&c.d(_),d&&d.d(),t[32](null),o=!1,vt(a)}}}function HB(t,e,n){let i,l;const r=["size","direction","open","light","flipped","menuOptionsClass","icon","iconClass","iconDescription","id","buttonRef","menuRef"];let s=ae(e,r),o,a,u,{$$slots:f={},$$scope:c}=e,{size:d=void 0}=e,{direction:h="bottom"}=e,{open:g=!1}=e,{light:_=!1}=e,{flipped:v=!1}=e,{menuOptionsClass:S=void 0}=e,{icon:A=LB}=e,{iconClass:C=void 0}=e,{iconDescription:I="Open and close list of options"}=e,{id:M="ccs-"+Math.random().toString(36)}=e,{buttonRef:L=null}=e,{menuRef:N=null}=e;const z=bi("BreadcrumbItem"),W=yn(),D=un([]);Mt(t,D,Ee=>n(22,a=Ee));const G=un(void 0);Mt(t,G,Ee=>n(37,u=Ee));const $=un(void 0),j=un(-1);Mt(t,j,Ee=>n(21,o=Ee));let Q,le=!0;Wi("OverflowMenu",{focusedId:$,add:({id:Ee,text:We,primaryFocus:ge,disabled:ve})=>{D.update(be=>(ge&&j.set(be.length),[...be,{id:Ee,text:We,primaryFocus:ge,disabled:ve,index:be.length}]))},update:Ee=>{G.set(Ee)},change:Ee=>{let We=o+Ee;We<0?We=a.length-1:We>=a.length&&(We=0);let ge=a[We].disabled;for(;ge;)We=We+Ee,We<0?We=a.length-1:We>=a.length&&(We=0),ge=a[We].disabled;j.set(We)}}),Cl(()=>{if(u){const{index:Ee,text:We}=a.filter(ge=>ge.id===u)[0];W("close",{index:Ee,text:We}),n(0,g=!1)}if(g){const{width:Ee,height:We}=L.getBoundingClientRect();n(20,Q=Ee),!le&&o<0&&N.focus(),v&&(n(3,N.style.left="auto",N),n(3,N.style.right=0,N)),h==="top"?(n(3,N.style.top="auto",N),n(3,N.style.bottom=We+"px",N)):h==="bottom"&&n(3,N.style.top=We+"px",N),z&&(n(3,N.style.top=We+10+"px",N),n(3,N.style.left="-11px",N))}g||(D.set([]),G.set(void 0),j.set(0)),le=!1});function oe(Ee){te.call(this,t,Ee)}function X(Ee){te.call(this,t,Ee)}function de(Ee){te.call(this,t,Ee)}function re(Ee){te.call(this,t,Ee)}function x(Ee){te.call(this,t,Ee)}const me=({target:Ee})=>{L&&L.contains(Ee)||N&&!N.contains(Ee)&&n(0,g=!1)};function ee(Ee){ft[Ee?"unshift":"push"](()=>{N=Ee,n(3,N)})}function ke(Ee){ft[Ee?"unshift":"push"](()=>{L=Ee,n(2,L)})}const pe=({target:Ee})=>{N&&N.contains(Ee)||(n(0,g=!g),g||W("close"))},Fe=Ee=>{g&&(["ArrowDown","ArrowLeft","ArrowRight","ArrowUp"].includes(Ee.key)?Ee.preventDefault():Ee.key==="Escape"&&(Ee.stopPropagation(),W("close"),n(0,g=!1),L.focus()))},Ve=Ee=>{g&&(L.contains(Ee.relatedTarget)||(W("close"),n(0,g=!1)))};return t.$$set=Ee=>{n(39,e=Y(Y({},e),Se(Ee))),n(19,s=ae(e,r)),"size"in Ee&&n(4,d=Ee.size),"direction"in Ee&&n(5,h=Ee.direction),"open"in Ee&&n(0,g=Ee.open),"light"in Ee&&n(6,_=Ee.light),"flipped"in Ee&&n(7,v=Ee.flipped),"menuOptionsClass"in Ee&&n(8,S=Ee.menuOptionsClass),"icon"in Ee&&n(1,A=Ee.icon),"iconClass"in Ee&&n(9,C=Ee.iconClass),"iconDescription"in Ee&&n(10,I=Ee.iconDescription),"id"in Ee&&n(11,M=Ee.id),"buttonRef"in Ee&&n(2,L=Ee.buttonRef),"menuRef"in Ee&&n(3,N=Ee.menuRef),"$$scope"in Ee&&n(23,c=Ee.$$scope)},t.$$.update=()=>{n(13,i=e["aria-label"]||"menu"),t.$$.dirty[0]&6291456&&a[o]&&$.set(a[o].id),t.$$.dirty[0]&1050624&&n(12,l=``)},z&&n(1,A=PB),e=Se(e),[g,A,L,N,d,h,_,v,S,C,I,M,l,i,z,W,D,G,j,s,Q,o,a,c,f,oe,X,de,re,x,me,ee,ke,pe,Fe,Ve]}class UB extends De{constructor(e){super(),Re(this,e,HB,zB,Ie,{size:4,direction:5,open:0,light:6,flipped:7,menuOptionsClass:8,icon:1,iconClass:9,iconDescription:10,id:11,buttonRef:2,menuRef:3},null,[-1,-1])}}const FB=UB;function GB(t){let e,n,i,l;const r=t[16].default,s=Ze(r,t,t[15],null),o=s||WB(t);let a=[t[7]],u={};for(let f=0;f{s[d]=null}),ce(),i=s[n],i?i.p(f,c):(i=s[n]=r[n](f),i.c()),b(i,1),i.m(e,null)),Ae(e,u=Ue(a,[{role:"none"},(!l||c&64)&&{id:f[6]},c&2048&&f[11]])),E(e,"bx--overflow-menu-options__option",!0),E(e,"bx--overflow-menu--divider",f[4]),E(e,"bx--overflow-menu-options__option--danger",f[5]),E(e,"bx--overflow-menu-options__option--disabled",f[3])},i(f){l||(b(i),l=!0)},o(f){k(i),l=!1},d(f){f&&w(e),s[n].d()}}}function YB(t,e,n){let i;const l=["text","href","primaryFocus","disabled","hasDivider","danger","requireTitle","id","ref"];let r=ae(e,l),s,{$$slots:o={},$$scope:a}=e;const u=Yi(o);let{text:f="Provide text"}=e,{href:c=""}=e,{primaryFocus:d=!1}=e,{disabled:h=!1}=e,{hasDivider:g=!1}=e,{danger:_=!1}=e,{requireTitle:v=!0}=e,{id:S="ccs-"+Math.random().toString(36)}=e,{ref:A=null}=e;const{focusedId:C,add:I,update:M,change:L}=bi("OverflowMenu");Mt(t,C,X=>n(14,s=X)),I({id:S,text:f,primaryFocus:d,disabled:h}),Cl(()=>{A&&d&&A.focus()});function N(X){te.call(this,t,X)}function z(X){te.call(this,t,X)}function W(X){te.call(this,t,X)}function D(X){te.call(this,t,X)}function G(X){ft[X?"unshift":"push"](()=>{A=X,n(0,A)})}const $=()=>{M(S)},j=({key:X})=>{X==="ArrowDown"?L(1):X==="ArrowUp"&&L(-1)};function Q(X){ft[X?"unshift":"push"](()=>{A=X,n(0,A)})}const le=()=>{M(S)},oe=({key:X})=>{X==="ArrowDown"?L(1):X==="ArrowUp"&&L(-1)};return t.$$set=X=>{e=Y(Y({},e),Se(X)),n(11,r=ae(e,l)),"text"in X&&n(1,f=X.text),"href"in X&&n(2,c=X.href),"primaryFocus"in X&&n(12,d=X.primaryFocus),"disabled"in X&&n(3,h=X.disabled),"hasDivider"in X&&n(4,g=X.hasDivider),"danger"in X&&n(5,_=X.danger),"requireTitle"in X&&n(13,v=X.requireTitle),"id"in X&&n(6,S=X.id),"ref"in X&&n(0,A=X.ref),"$$scope"in X&&n(15,a=X.$$scope)},t.$$.update=()=>{t.$$.dirty&16448&&n(12,d=s===S),t.$$.dirty&8206&&n(7,i={role:"menuitem",tabindex:"-1",class:"bx--overflow-menu-options__btn",disabled:c?void 0:h,href:c||void 0,title:v?u.default?void 0:f:void 0})},[A,f,c,h,g,_,S,i,C,M,L,r,d,v,s,a,o,N,z,W,D,G,$,j,Q,le,oe]}class ZB extends De{constructor(e){super(),Re(this,e,YB,jB,Ie,{text:1,href:2,primaryFocus:12,disabled:3,hasDivider:4,danger:5,requireTitle:13,id:6,ref:0})}}const Xh=ZB;function Ob(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function XB(t){let e,n,i,l=t[1]&&Ob(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class $B extends De{constructor(e){super(),Re(this,e,KB,XB,Ie,{size:0,title:1})}}const IT=$B;function JB(t){let e,n,i,l,r,s,o=t[0]&&Ab(t),a=[{"aria-atomic":"true"},{"aria-live":s=t[1]?"assertive":"off"},t[5]],u={};for(let f=0;f{e=Y(Y({},e),Se(f)),n(5,r=ae(e,l)),"small"in f&&n(0,s=f.small),"active"in f&&n(1,o=f.active),"withOverlay"in f&&n(2,a=f.withOverlay),"description"in f&&n(3,u=f.description)},t.$$.update=()=>{t.$$.dirty&1&&n(4,i=s?"42":"44")},[s,o,a,u,i,r]}class tz extends De{constructor(e){super(),Re(this,e,ez,xB,Ie,{small:0,active:1,withOverlay:2,description:3})}}const K1=tz;function nz(t){let e,n,i,l;const r=t[3].default,s=Ze(r,t,t[2],null);let o=[t[1]],a={};for(let u=0;u{o=_,n(0,o)})}return t.$$set=_=>{e=Y(Y({},e),Se(_)),n(1,l=ae(e,i)),"ref"in _&&n(0,o=_.ref),"$$scope"in _&&n(2,s=_.$$scope)},[o,l,s,r,a,u,f,c,d,h,g]}class lz extends De{constructor(e){super(),Re(this,e,iz,nz,Ie,{ref:0})}}const RT=lz;function rz(t){let e;const n=t[1].default,i=Ze(n,t,t[8],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&256)&&Ke(i,n,l,l[8],e?Xe(n,l[8],r,null):$e(l[8]),null)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function sz(t){let e,n;const i=[t[0],{class:"bx--form--fluid "+t[0].class}];let l={$$slots:{default:[rz]},$$scope:{ctx:t}};for(let r=0;r{e=Y(Y({},e),Se(h)),n(0,l=ae(e,i)),"$$scope"in h&&n(8,s=h.$$scope)},[l,r,o,a,u,f,c,d,s]}class az extends De{constructor(e){super(),Re(this,e,oz,sz,Ie,{})}}const DT=az;function Lb(t){let e,n,i;return{c(){e=R("legend"),n=q(t[4]),P(e,"id",i=t[5]||t[6]["aria-labelledby"]),E(e,"bx--label",!0)},m(l,r){y(l,e,r),T(e,n)},p(l,r){r&16&&Z(n,l[4]),r&96&&i!==(i=l[5]||l[6]["aria-labelledby"])&&P(e,"id",i)},d(l){l&&w(e)}}}function Ib(t){let e,n;return{c(){e=R("div"),n=q(t[3]),E(e,"bx--form__requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&8&&Z(n,i[3])},d(i){i&&w(e)}}}function uz(t){let e,n,i,l,r,s,o,a,u=t[4]&&Lb(t);const f=t[8].default,c=Ze(f,t,t[7],null);let d=t[2]&&Ib(t),h=[{"data-invalid":l=t[1]||void 0},{"aria-labelledby":r=t[6]["aria-labelledby"]||t[5]},t[6]],g={};for(let _=0;_{e=Y(Y({},e),Se(S)),n(6,l=ae(e,i)),"noMargin"in S&&n(0,o=S.noMargin),"invalid"in S&&n(1,a=S.invalid),"message"in S&&n(2,u=S.message),"messageText"in S&&n(3,f=S.messageText),"legendText"in S&&n(4,c=S.legendText),"legendId"in S&&n(5,d=S.legendId),"$$scope"in S&&n(7,s=S.$$scope)},[o,a,u,f,c,d,l,s,r,h,g,_,v]}class cz extends De{constructor(e){super(),Re(this,e,fz,uz,Ie,{noMargin:0,invalid:1,message:2,messageText:3,legendText:4,legendId:5})}}const dz=cz;function hz(t){let e,n,i,l;const r=t[3].default,s=Ze(r,t,t[2],null);let o=[{for:t[0]},t[1]],a={};for(let u=0;u{e=Y(Y({},e),Se(d)),n(1,l=ae(e,i)),"id"in d&&n(0,o=d.id),"$$scope"in d&&n(2,s=d.$$scope)},[o,l,s,r,a,u,f,c]}class gz extends De{constructor(e){super(),Re(this,e,mz,hz,Ie,{id:0})}}const _z=gz,pz=t=>({props:t&2}),Rb=t=>({props:t[1]});function bz(t){let e,n;const i=t[10].default,l=Ze(i,t,t[9],null);let r=[t[1]],s={};for(let o=0;o{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function wz(t,e,n){let i;const l=["as","condensed","narrow","fullWidth","noGutter","noGutterLeft","noGutterRight","padding"];let r=ae(e,l),{$$slots:s={},$$scope:o}=e,{as:a=!1}=e,{condensed:u=!1}=e,{narrow:f=!1}=e,{fullWidth:c=!1}=e,{noGutter:d=!1}=e,{noGutterLeft:h=!1}=e,{noGutterRight:g=!1}=e,{padding:_=!1}=e;return t.$$set=v=>{e=Y(Y({},e),Se(v)),n(11,r=ae(e,l)),"as"in v&&n(0,a=v.as),"condensed"in v&&n(2,u=v.condensed),"narrow"in v&&n(3,f=v.narrow),"fullWidth"in v&&n(4,c=v.fullWidth),"noGutter"in v&&n(5,d=v.noGutter),"noGutterLeft"in v&&n(6,h=v.noGutterLeft),"noGutterRight"in v&&n(7,g=v.noGutterRight),"padding"in v&&n(8,_=v.padding),"$$scope"in v&&n(9,o=v.$$scope)},t.$$.update=()=>{n(1,i={...r,class:[r.class,"bx--grid",u&&"bx--grid--condensed",f&&"bx--grid--narrow",c&&"bx--grid--full-width",d&&"bx--no-gutter",h&&"bx--no-gutter--left",g&&"bx--no-gutter--right",_&&"bx--row-padding"].filter(Boolean).join(" ")})},[a,i,u,f,c,d,h,g,_,o,s]}class yz extends De{constructor(e){super(),Re(this,e,wz,kz,Ie,{as:0,condensed:2,narrow:3,fullWidth:4,noGutter:5,noGutterLeft:6,noGutterRight:7,padding:8})}}const PT=yz,Tz=t=>({props:t&2}),Db=t=>({props:t[1]});function Sz(t){let e,n;const i=t[9].default,l=Ze(i,t,t[8],null);let r=[t[1]],s={};for(let o=0;o{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function Oz(t,e,n){let i;const l=["as","condensed","narrow","noGutter","noGutterLeft","noGutterRight","padding"];let r=ae(e,l),{$$slots:s={},$$scope:o}=e,{as:a=!1}=e,{condensed:u=!1}=e,{narrow:f=!1}=e,{noGutter:c=!1}=e,{noGutterLeft:d=!1}=e,{noGutterRight:h=!1}=e,{padding:g=!1}=e;return t.$$set=_=>{e=Y(Y({},e),Se(_)),n(10,r=ae(e,l)),"as"in _&&n(0,a=_.as),"condensed"in _&&n(2,u=_.condensed),"narrow"in _&&n(3,f=_.narrow),"noGutter"in _&&n(4,c=_.noGutter),"noGutterLeft"in _&&n(5,d=_.noGutterLeft),"noGutterRight"in _&&n(6,h=_.noGutterRight),"padding"in _&&n(7,g=_.padding),"$$scope"in _&&n(8,o=_.$$scope)},t.$$.update=()=>{n(1,i={...r,class:[r.class,"bx--row",u&&"bx--row--condensed",f&&"bx--row--narrow",c&&"bx--no-gutter",d&&"bx--no-gutter--left",h&&"bx--no-gutter--right",g&&"bx--row-padding"].filter(Boolean).join(" ")})},[a,i,u,f,c,d,h,g,o,s]}class Az extends De{constructor(e){super(),Re(this,e,Oz,Mz,Ie,{as:0,condensed:2,narrow:3,noGutter:4,noGutterLeft:5,noGutterRight:6,padding:7})}}const dl=Az,Cz=t=>({props:t&2}),Pb=t=>({props:t[1]});function Lz(t){let e,n;const i=t[14].default,l=Ze(i,t,t[13],null);let r=[t[1]],s={};for(let o=0;o{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function Dz(t,e,n){let i,l;const r=["as","noGutter","noGutterLeft","noGutterRight","padding","aspectRatio","sm","md","lg","xlg","max"];let s=ae(e,r),{$$slots:o={},$$scope:a}=e,{as:u=!1}=e,{noGutter:f=!1}=e,{noGutterLeft:c=!1}=e,{noGutterRight:d=!1}=e,{padding:h=!1}=e,{aspectRatio:g=void 0}=e,{sm:_=void 0}=e,{md:v=void 0}=e,{lg:S=void 0}=e,{xlg:A=void 0}=e,{max:C=void 0}=e;const I=["sm","md","lg","xlg","max"];return t.$$set=M=>{e=Y(Y({},e),Se(M)),n(16,s=ae(e,r)),"as"in M&&n(0,u=M.as),"noGutter"in M&&n(2,f=M.noGutter),"noGutterLeft"in M&&n(3,c=M.noGutterLeft),"noGutterRight"in M&&n(4,d=M.noGutterRight),"padding"in M&&n(5,h=M.padding),"aspectRatio"in M&&n(6,g=M.aspectRatio),"sm"in M&&n(7,_=M.sm),"md"in M&&n(8,v=M.md),"lg"in M&&n(9,S=M.lg),"xlg"in M&&n(10,A=M.xlg),"max"in M&&n(11,C=M.max),"$$scope"in M&&n(13,a=M.$$scope)},t.$$.update=()=>{t.$$.dirty&3968&&n(12,i=[_,v,S,A,C].map((M,L)=>{const N=I[L];if(M===!0)return`bx--col-${N}`;if(typeof M=="number")return`bx--col-${N}-${M}`;if(typeof M=="object"){let z=[];return typeof M.span=="number"?z=[...z,`bx--col-${N}-${M.span}`]:M.span===!0&&(z=[...z,`bx--col-${N}`]),typeof M.offset=="number"&&(z=[...z,`bx--offset-${N}-${M.offset}`]),z.join(" ")}}).filter(Boolean).join(" ")),n(1,l={...s,class:[s.class,i,!i&&"bx--col",f&&"bx--no-gutter",c&&"bx--no-gutter--left",d&&"bx--no-gutter--right",g&&`bx--aspect-ratio bx--aspect-ratio--${g}`,h&&"bx--col-padding"].filter(Boolean).join(" ")})},[u,l,f,c,d,h,g,_,v,S,A,C,i,a,o]}class Pz extends De{constructor(e){super(),Re(this,e,Dz,Rz,Ie,{as:0,noGutter:2,noGutterLeft:3,noGutterRight:4,padding:5,aspectRatio:6,sm:7,md:8,lg:9,xlg:10,max:11})}}const zn=Pz;function Nz(t){const e=t-1;return e*e*e+1}function Nb(t,{delay:e=0,duration:n=400,easing:i=Nz,axis:l="y"}={}){const r=getComputedStyle(t),s=+r.opacity,o=l==="y"?"height":"width",a=parseFloat(r[o]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(S=>`${S[0].toUpperCase()}${S.slice(1)}`),c=parseFloat(r[`padding${f[0]}`]),d=parseFloat(r[`padding${f[1]}`]),h=parseFloat(r[`margin${f[0]}`]),g=parseFloat(r[`margin${f[1]}`]),_=parseFloat(r[`border${f[0]}Width`]),v=parseFloat(r[`border${f[1]}Width`]);return{delay:e,duration:n,easing:i,css:S=>`overflow: hidden;opacity: ${Math.min(S*20,1)*s};${o}: ${S*a}px;padding-${u[0]}: ${S*c}px;padding-${u[1]}: ${S*d}px;margin-${u[0]}: ${S*h}px;margin-${u[1]}: ${S*g}px;border-${u[0]}-width: ${S*_}px;border-${u[1]}-width: ${S*v}px;`}}function Bb(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Bz(t){let e,n,i,l=t[1]&&Bb(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Hz extends De{constructor(e){super(),Re(this,e,zz,Bz,Ie,{size:0,title:1})}}const NT=Hz;function Uz(t){let e,n;return e=new K1({props:{small:!0,description:t[2],withOverlay:!1,active:t[0]==="active"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4&&(r.description=i[2]),l&1&&(r.active=i[0]==="active"),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Fz(t){let e,n;return e=new IT({props:{class:"bx--inline-loading__checkmark-container",title:t[2]||t[0]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&5&&(r.title=i[2]||i[0]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Gz(t){let e,n;return e=new NT({props:{class:"bx--inline-loading--error",title:t[2]||t[0]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&5&&(r.title=i[2]||i[0]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function zb(t){let e,n;return{c(){e=R("div"),n=q(t[1]),E(e,"bx--inline-loading__text",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Vz(t){let e,n,i,l,r,s,o,a;const u=[Gz,Fz,Uz],f=[];function c(_,v){return _[0]==="error"?0:_[0]==="finished"?1:_[0]==="inactive"||_[0]==="active"?2:-1}~(i=c(t))&&(l=f[i]=u[i](t));let d=t[1]&&zb(t),h=[{"aria-live":"assertive"},t[3]],g={};for(let _=0;_{f[S]=null}),ce()),~i?(l=f[i],l?l.p(_,v):(l=f[i]=u[i](_),l.c()),b(l,1),l.m(n,null)):l=null),_[1]?d?d.p(_,v):(d=zb(_),d.c(),d.m(e,null)):d&&(d.d(1),d=null),Ae(e,g=Ue(h,[{"aria-live":"assertive"},v&8&&_[3]])),E(e,"bx--inline-loading",!0)},i(_){s||(b(l),s=!0)},o(_){k(l),s=!1},d(_){_&&w(e),~i&&f[i].d(),d&&d.d(),o=!1,vt(a)}}}function Wz(t,e,n){const i=["status","description","iconDescription","successDelay"];let l=ae(e,i),{status:r="active"}=e,{description:s=void 0}=e,{iconDescription:o=void 0}=e,{successDelay:a=1500}=e;const u=yn();let f;_n(()=>()=>{clearTimeout(f)}),Cl(()=>{r==="finished"&&(f=setTimeout(()=>{u("success")},a))});function c(_){te.call(this,t,_)}function d(_){te.call(this,t,_)}function h(_){te.call(this,t,_)}function g(_){te.call(this,t,_)}return t.$$set=_=>{e=Y(Y({},e),Se(_)),n(3,l=ae(e,i)),"status"in _&&n(0,r=_.status),"description"in _&&n(1,s=_.description),"iconDescription"in _&&n(2,o=_.iconDescription),"successDelay"in _&&n(4,a=_.successDelay)},[r,s,o,l,a,c,d,h,g]}class qz extends De{constructor(e){super(),Re(this,e,Wz,Vz,Ie,{status:0,description:1,iconDescription:2,successDelay:4})}}const oo=qz;function Hb(t,e,n){const i=t.slice();return i[74]=e[n],i[76]=n,i}const jz=t=>({item:t[0]&1610616832,index:t[0]&1610616832}),Ub=t=>({slot:"labelText",item:t[74],index:t[76]}),Yz=t=>({}),Fb=t=>({});function Gb(t){let e,n;const i=t[46].titleText,l=Ze(i,t,t[68],Fb),r=l||Zz(t);return{c(){e=R("label"),r&&r.c(),P(e,"for",t[26]),E(e,"bx--label",!0),E(e,"bx--label--disabled",t[11]),E(e,"bx--visually-hidden",t[25])},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[2]&64)&&Ke(l,i,s,s[68],n?Xe(i,s[68],o,Yz):$e(s[68]),Fb):r&&r.p&&(!n||o[0]&131072)&&r.p(s,n?o:[-1,-1,-1]),(!n||o[0]&67108864)&&P(e,"for",s[26]),(!n||o[0]&2048)&&E(e,"bx--label--disabled",s[11]),(!n||o[0]&33554432)&&E(e,"bx--visually-hidden",s[25])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function Zz(t){let e;return{c(){e=q(t[17])},m(n,i){y(n,e,i)},p(n,i){i[0]&131072&&Z(e,n[17])},d(n){n&&w(e)}}}function Vb(t){let e,n;return e=new Os({props:{class:"bx--list-box__invalid-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Wb(t){let e,n;return e=new Lu({props:{class:"bx--list-box__invalid-icon bx--list-box__invalid-icon--warning"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function qb(t){let e,n;return e=new ET({props:{selectionCount:t[31].length,translateWithId:t[16],disabled:t[11]}}),e.$on("clear",t[53]),e.$on("clear",t[54]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[1]&1&&(r.selectionCount=i[31].length),l[0]&65536&&(r.translateWithId=i[16]),l[0]&2048&&(r.disabled=i[11]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function jb(t){let e,n,i,l,r,s,o,a,u=[t[38],{role:"combobox"},{tabindex:"0"},{autocomplete:"off"},{"aria-autocomplete":"list"},{"aria-expanded":t[1]},{"aria-activedescendant":t[6]},{"aria-disabled":t[11]},{"aria-controls":t[34]},{disabled:t[11]},{placeholder:t[14]},{id:t[26]},{name:t[27]}],f={};for(let h=0;h{c=null}),ce()),h[0]?d?(d.p(h,g),g[0]&1&&b(d,1)):(d=Zb(h),d.c(),b(d,1),d.m(l.parentNode,l)):d&&(fe(),k(d,1,1,()=>{d=null}),ce());const _={};g[0]&2&&(_.style="pointer-events: "+(h[1]?"auto":"none")),g[0]&32768&&(_.translateWithId=h[15]),g[0]&2&&(_.open=h[1]),r.$set(_)},i(h){s||(b(c),b(d),b(r.$$.fragment,h),s=!0)},o(h){k(c),k(d),k(r.$$.fragment,h),s=!1},d(h){h&&(w(e),w(n),w(i),w(l)),t[55](null),c&&c.d(h),d&&d.d(h),U(r,h),o=!1,vt(a)}}}function Yb(t){let e,n;return e=new Os({props:{class:"bx--list-box__invalid-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Zb(t){let e,n;return e=new ET({props:{translateWithId:t[16],disabled:t[11],open:t[1]}}),e.$on("clear",t[58]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.translateWithId=i[16]),l[0]&2048&&(r.disabled=i[11]),l[0]&2&&(r.open=i[1]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Xb(t){let e,n,i,l,r;return l=new ST({props:{open:t[1],translateWithId:t[15]}}),{c(){e=R("span"),n=q(t[24]),i=B(),F(l.$$.fragment),E(e,"bx--list-box__label",!0)},m(s,o){y(s,e,o),T(e,n),y(s,i,o),H(l,s,o),r=!0},p(s,o){(!r||o[0]&16777216)&&Z(n,s[24]);const a={};o[0]&2&&(a.open=s[1]),o[0]&32768&&(a.translateWithId=s[15]),l.$set(a)},i(s){r||(b(l.$$.fragment,s),r=!0)},o(s){k(l.$$.fragment,s),r=!1},d(s){s&&(w(e),w(i)),U(l,s)}}}function Xz(t){let e,n,i,l,r=t[31].length>0&&qb(t),s=t[12]&&jb(t),o=!t[12]&&Xb(t);return{c(){r&&r.c(),e=B(),s&&s.c(),n=B(),o&&o.c(),i=qe()},m(a,u){r&&r.m(a,u),y(a,e,u),s&&s.m(a,u),y(a,n,u),o&&o.m(a,u),y(a,i,u),l=!0},p(a,u){a[31].length>0?r?(r.p(a,u),u[1]&1&&b(r,1)):(r=qb(a),r.c(),b(r,1),r.m(e.parentNode,e)):r&&(fe(),k(r,1,1,()=>{r=null}),ce()),a[12]?s?(s.p(a,u),u[0]&4096&&b(s,1)):(s=jb(a),s.c(),b(s,1),s.m(n.parentNode,n)):s&&(fe(),k(s,1,1,()=>{s=null}),ce()),a[12]?o&&(fe(),k(o,1,1,()=>{o=null}),ce()):o?(o.p(a,u),u[0]&4096&&b(o,1)):(o=Xb(a),o.c(),b(o,1),o.m(i.parentNode,i))},i(a){l||(b(r),b(s),b(o),l=!0)},o(a){k(r),k(s),k(o),l=!1},d(a){a&&(w(e),w(n),w(i)),r&&r.d(a),s&&s.d(a),o&&o.d(a)}}}function Kb(t){let e,n;return e=new zD({props:{"aria-label":t[32],id:t[26],"aria-multiselectable":"true",$$slots:{default:[Qz]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[1]&2&&(r["aria-label"]=i[32]),l[0]&67108864&&(r.id=i[26]),l[0]&1879314834|l[2]&64&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Kz(t){let e=t[7](t[74])+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&1610616960&&e!==(e=i[7](i[74])+"")&&Z(n,e)},d(i){i&&w(n)}}}function $z(t){let e;const n=t[46].default,i=Ze(n,t,t[68],Ub),l=i||Kz(t);return{c(){l&&l.c()},m(r,s){l&&l.m(r,s),e=!0},p(r,s){i?i.p&&(!e||s[0]&1610616832|s[2]&64)&&Ke(i,n,r,r[68],e?Xe(n,r[68],s,jz):$e(r[68]),Ub):l&&l.p&&(!e||s[0]&1610616960)&&l.p(r,e?s:[-1,-1,-1])},i(r){e||(b(l,r),e=!0)},o(r){k(l,r),e=!1},d(r){l&&l.d(r)}}}function Jz(t){let e,n,i;const l=[{name:t[74].id},{title:t[18]?t[7](t[74]):void 0},t[8](t[74]),{readonly:!0},{tabindex:"-1"},{id:"checkbox-"+t[74].id},{checked:t[74].checked},{disabled:t[74].disabled}];function r(){return t[64](t[76])}let s={$$slots:{labelText:[$z]},$$scope:{ctx:t}};for(let o=0;oo[74].id;for(let o=0;o{o=null}),ce()),!f[19]&&f[21]?a?c[0]&2621440&&b(a,1):(a=Wb(),a.c(),b(a,1),a.m(n.parentNode,n)):a&&(fe(),k(a,1,1,()=>{a=null}),ce());const d={};c[0]&2&&(d["aria-expanded"]=f[1]),c[0]&67108864&&(d.id=f[26]),c[0]&2048&&(d.disabled=f[11]),c[0]&32768&&(d.translateWithId=f[15]),c[0]&755628119|c[1]&137|c[2]&64&&(d.$$scope={dirty:c,ctx:f}),i.$set(d),f[1]?u?(u.p(f,c),c[0]&2&&b(u,1)):(u=Kb(f),u.c(),b(u,1),u.m(r.parentNode,r)):u&&(fe(),k(u,1,1,()=>{u=null}),ce())},i(f){s||(b(o),b(a),b(i.$$.fragment,f),b(u),s=!0)},o(f){k(o),k(a),k(i.$$.fragment,f),k(u),s=!1},d(f){f&&(w(e),w(n),w(l),w(r)),o&&o.d(f),a&&a.d(f),U(i,f),u&&u.d(f)}}}function Jb(t){let e,n;return{c(){e=R("div"),n=q(t[23]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[11])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&8388608&&Z(n,i[23]),l[0]&2048&&E(e,"bx--form__helper-text--disabled",i[11])},d(i){i&&w(e)}}}function eH(t){let e,n,i,l,r,s,o,a=(t[17]||t[37].titleText)&&Gb(t);i=new CD({props:{role:void 0,disabled:t[11],invalid:t[19],invalidText:t[20],open:t[1],light:t[13],size:t[9],warn:t[21],warnText:t[22],class:"bx--multi-select "+(t[10]==="top"&&"bx--list-box--up")+" "+(t[12]&&"bx--combo-box")+` + `)},z&&n(1,A=PB),e=Se(e),[g,A,L,N,d,h,_,v,S,C,I,M,l,i,z,W,D,G,j,s,Q,o,a,c,f,oe,X,de,re,x,me,ee,ke,pe,Fe,Ve]}class UB extends De{constructor(e){super(),Re(this,e,HB,zB,Ie,{size:4,direction:5,open:0,light:6,flipped:7,menuOptionsClass:8,icon:1,iconClass:9,iconDescription:10,id:11,buttonRef:2,menuRef:3},null,[-1,-1])}}const FB=UB;function GB(t){let e,n,i,l;const r=t[16].default,s=Ze(r,t,t[15],null),o=s||WB(t);let a=[t[7]],u={};for(let f=0;f{s[d]=null}),ce(),i=s[n],i?i.p(f,c):(i=s[n]=r[n](f),i.c()),b(i,1),i.m(e,null)),Ae(e,u=Ue(a,[{role:"none"},(!l||c&64)&&{id:f[6]},c&2048&&f[11]])),E(e,"bx--overflow-menu-options__option",!0),E(e,"bx--overflow-menu--divider",f[4]),E(e,"bx--overflow-menu-options__option--danger",f[5]),E(e,"bx--overflow-menu-options__option--disabled",f[3])},i(f){l||(b(i),l=!0)},o(f){k(i),l=!1},d(f){f&&w(e),s[n].d()}}}function YB(t,e,n){let i;const l=["text","href","primaryFocus","disabled","hasDivider","danger","requireTitle","id","ref"];let r=ae(e,l),s,{$$slots:o={},$$scope:a}=e;const u=Yi(o);let{text:f="Provide text"}=e,{href:c=""}=e,{primaryFocus:d=!1}=e,{disabled:h=!1}=e,{hasDivider:g=!1}=e,{danger:_=!1}=e,{requireTitle:v=!0}=e,{id:S="ccs-"+Math.random().toString(36)}=e,{ref:A=null}=e;const{focusedId:C,add:I,update:M,change:L}=bi("OverflowMenu");Mt(t,C,X=>n(14,s=X)),I({id:S,text:f,primaryFocus:d,disabled:h}),Cl(()=>{A&&d&&A.focus()});function N(X){te.call(this,t,X)}function z(X){te.call(this,t,X)}function W(X){te.call(this,t,X)}function D(X){te.call(this,t,X)}function G(X){ft[X?"unshift":"push"](()=>{A=X,n(0,A)})}const $=()=>{M(S)},j=({key:X})=>{X==="ArrowDown"?L(1):X==="ArrowUp"&&L(-1)};function Q(X){ft[X?"unshift":"push"](()=>{A=X,n(0,A)})}const le=()=>{M(S)},oe=({key:X})=>{X==="ArrowDown"?L(1):X==="ArrowUp"&&L(-1)};return t.$$set=X=>{e=Y(Y({},e),Se(X)),n(11,r=ae(e,l)),"text"in X&&n(1,f=X.text),"href"in X&&n(2,c=X.href),"primaryFocus"in X&&n(12,d=X.primaryFocus),"disabled"in X&&n(3,h=X.disabled),"hasDivider"in X&&n(4,g=X.hasDivider),"danger"in X&&n(5,_=X.danger),"requireTitle"in X&&n(13,v=X.requireTitle),"id"in X&&n(6,S=X.id),"ref"in X&&n(0,A=X.ref),"$$scope"in X&&n(15,a=X.$$scope)},t.$$.update=()=>{t.$$.dirty&16448&&n(12,d=s===S),t.$$.dirty&8206&&n(7,i={role:"menuitem",tabindex:"-1",class:"bx--overflow-menu-options__btn",disabled:c?void 0:h,href:c||void 0,title:v?u.default?void 0:f:void 0})},[A,f,c,h,g,_,S,i,C,M,L,r,d,v,s,a,o,N,z,W,D,G,$,j,Q,le,oe]}class ZB extends De{constructor(e){super(),Re(this,e,YB,jB,Ie,{text:1,href:2,primaryFocus:12,disabled:3,hasDivider:4,danger:5,requireTitle:13,id:6,ref:0})}}const Xh=ZB;function Ob(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function XB(t){let e,n,i,l=t[1]&&Ob(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class $B extends De{constructor(e){super(),Re(this,e,KB,XB,Ie,{size:0,title:1})}}const RT=$B;function JB(t){let e,n,i,l,r,s,o=t[0]&&Ab(t),a=[{"aria-atomic":"true"},{"aria-live":s=t[1]?"assertive":"off"},t[5]],u={};for(let f=0;f{e=Y(Y({},e),Se(f)),n(5,r=ae(e,l)),"small"in f&&n(0,s=f.small),"active"in f&&n(1,o=f.active),"withOverlay"in f&&n(2,a=f.withOverlay),"description"in f&&n(3,u=f.description)},t.$$.update=()=>{t.$$.dirty&1&&n(4,i=s?"42":"44")},[s,o,a,u,i,r]}class tz extends De{constructor(e){super(),Re(this,e,ez,xB,Ie,{small:0,active:1,withOverlay:2,description:3})}}const K1=tz;function nz(t){let e,n,i,l;const r=t[3].default,s=Ze(r,t,t[2],null);let o=[t[1]],a={};for(let u=0;u{o=_,n(0,o)})}return t.$$set=_=>{e=Y(Y({},e),Se(_)),n(1,l=ae(e,i)),"ref"in _&&n(0,o=_.ref),"$$scope"in _&&n(2,s=_.$$scope)},[o,l,s,r,a,u,f,c,d,h,g]}class lz extends De{constructor(e){super(),Re(this,e,iz,nz,Ie,{ref:0})}}const DT=lz;function rz(t){let e;const n=t[1].default,i=Ze(n,t,t[8],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&256)&&Ke(i,n,l,l[8],e?Xe(n,l[8],r,null):$e(l[8]),null)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function sz(t){let e,n;const i=[t[0],{class:"bx--form--fluid "+t[0].class}];let l={$$slots:{default:[rz]},$$scope:{ctx:t}};for(let r=0;r{e=Y(Y({},e),Se(h)),n(0,l=ae(e,i)),"$$scope"in h&&n(8,s=h.$$scope)},[l,r,o,a,u,f,c,d,s]}class az extends De{constructor(e){super(),Re(this,e,oz,sz,Ie,{})}}const PT=az;function Lb(t){let e,n,i;return{c(){e=R("legend"),n=q(t[4]),P(e,"id",i=t[5]||t[6]["aria-labelledby"]),E(e,"bx--label",!0)},m(l,r){y(l,e,r),T(e,n)},p(l,r){r&16&&Z(n,l[4]),r&96&&i!==(i=l[5]||l[6]["aria-labelledby"])&&P(e,"id",i)},d(l){l&&w(e)}}}function Ib(t){let e,n;return{c(){e=R("div"),n=q(t[3]),E(e,"bx--form__requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&8&&Z(n,i[3])},d(i){i&&w(e)}}}function uz(t){let e,n,i,l,r,s,o,a,u=t[4]&&Lb(t);const f=t[8].default,c=Ze(f,t,t[7],null);let d=t[2]&&Ib(t),h=[{"data-invalid":l=t[1]||void 0},{"aria-labelledby":r=t[6]["aria-labelledby"]||t[5]},t[6]],g={};for(let _=0;_{e=Y(Y({},e),Se(S)),n(6,l=ae(e,i)),"noMargin"in S&&n(0,o=S.noMargin),"invalid"in S&&n(1,a=S.invalid),"message"in S&&n(2,u=S.message),"messageText"in S&&n(3,f=S.messageText),"legendText"in S&&n(4,c=S.legendText),"legendId"in S&&n(5,d=S.legendId),"$$scope"in S&&n(7,s=S.$$scope)},[o,a,u,f,c,d,l,s,r,h,g,_,v]}class cz extends De{constructor(e){super(),Re(this,e,fz,uz,Ie,{noMargin:0,invalid:1,message:2,messageText:3,legendText:4,legendId:5})}}const dz=cz;function hz(t){let e,n,i,l;const r=t[3].default,s=Ze(r,t,t[2],null);let o=[{for:t[0]},t[1]],a={};for(let u=0;u{e=Y(Y({},e),Se(d)),n(1,l=ae(e,i)),"id"in d&&n(0,o=d.id),"$$scope"in d&&n(2,s=d.$$scope)},[o,l,s,r,a,u,f,c]}class gz extends De{constructor(e){super(),Re(this,e,mz,hz,Ie,{id:0})}}const _z=gz,pz=t=>({props:t&2}),Rb=t=>({props:t[1]});function bz(t){let e,n;const i=t[10].default,l=Ze(i,t,t[9],null);let r=[t[1]],s={};for(let o=0;o{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function wz(t,e,n){let i;const l=["as","condensed","narrow","fullWidth","noGutter","noGutterLeft","noGutterRight","padding"];let r=ae(e,l),{$$slots:s={},$$scope:o}=e,{as:a=!1}=e,{condensed:u=!1}=e,{narrow:f=!1}=e,{fullWidth:c=!1}=e,{noGutter:d=!1}=e,{noGutterLeft:h=!1}=e,{noGutterRight:g=!1}=e,{padding:_=!1}=e;return t.$$set=v=>{e=Y(Y({},e),Se(v)),n(11,r=ae(e,l)),"as"in v&&n(0,a=v.as),"condensed"in v&&n(2,u=v.condensed),"narrow"in v&&n(3,f=v.narrow),"fullWidth"in v&&n(4,c=v.fullWidth),"noGutter"in v&&n(5,d=v.noGutter),"noGutterLeft"in v&&n(6,h=v.noGutterLeft),"noGutterRight"in v&&n(7,g=v.noGutterRight),"padding"in v&&n(8,_=v.padding),"$$scope"in v&&n(9,o=v.$$scope)},t.$$.update=()=>{n(1,i={...r,class:[r.class,"bx--grid",u&&"bx--grid--condensed",f&&"bx--grid--narrow",c&&"bx--grid--full-width",d&&"bx--no-gutter",h&&"bx--no-gutter--left",g&&"bx--no-gutter--right",_&&"bx--row-padding"].filter(Boolean).join(" ")})},[a,i,u,f,c,d,h,g,_,o,s]}class yz extends De{constructor(e){super(),Re(this,e,wz,kz,Ie,{as:0,condensed:2,narrow:3,fullWidth:4,noGutter:5,noGutterLeft:6,noGutterRight:7,padding:8})}}const NT=yz,Tz=t=>({props:t&2}),Db=t=>({props:t[1]});function Sz(t){let e,n;const i=t[9].default,l=Ze(i,t,t[8],null);let r=[t[1]],s={};for(let o=0;o{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function Oz(t,e,n){let i;const l=["as","condensed","narrow","noGutter","noGutterLeft","noGutterRight","padding"];let r=ae(e,l),{$$slots:s={},$$scope:o}=e,{as:a=!1}=e,{condensed:u=!1}=e,{narrow:f=!1}=e,{noGutter:c=!1}=e,{noGutterLeft:d=!1}=e,{noGutterRight:h=!1}=e,{padding:g=!1}=e;return t.$$set=_=>{e=Y(Y({},e),Se(_)),n(10,r=ae(e,l)),"as"in _&&n(0,a=_.as),"condensed"in _&&n(2,u=_.condensed),"narrow"in _&&n(3,f=_.narrow),"noGutter"in _&&n(4,c=_.noGutter),"noGutterLeft"in _&&n(5,d=_.noGutterLeft),"noGutterRight"in _&&n(6,h=_.noGutterRight),"padding"in _&&n(7,g=_.padding),"$$scope"in _&&n(8,o=_.$$scope)},t.$$.update=()=>{n(1,i={...r,class:[r.class,"bx--row",u&&"bx--row--condensed",f&&"bx--row--narrow",c&&"bx--no-gutter",d&&"bx--no-gutter--left",h&&"bx--no-gutter--right",g&&"bx--row-padding"].filter(Boolean).join(" ")})},[a,i,u,f,c,d,h,g,o,s]}class Az extends De{constructor(e){super(),Re(this,e,Oz,Mz,Ie,{as:0,condensed:2,narrow:3,noGutter:4,noGutterLeft:5,noGutterRight:6,padding:7})}}const dl=Az,Cz=t=>({props:t&2}),Pb=t=>({props:t[1]});function Lz(t){let e,n;const i=t[14].default,l=Ze(i,t,t[13],null);let r=[t[1]],s={};for(let o=0;o{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function Dz(t,e,n){let i,l;const r=["as","noGutter","noGutterLeft","noGutterRight","padding","aspectRatio","sm","md","lg","xlg","max"];let s=ae(e,r),{$$slots:o={},$$scope:a}=e,{as:u=!1}=e,{noGutter:f=!1}=e,{noGutterLeft:c=!1}=e,{noGutterRight:d=!1}=e,{padding:h=!1}=e,{aspectRatio:g=void 0}=e,{sm:_=void 0}=e,{md:v=void 0}=e,{lg:S=void 0}=e,{xlg:A=void 0}=e,{max:C=void 0}=e;const I=["sm","md","lg","xlg","max"];return t.$$set=M=>{e=Y(Y({},e),Se(M)),n(16,s=ae(e,r)),"as"in M&&n(0,u=M.as),"noGutter"in M&&n(2,f=M.noGutter),"noGutterLeft"in M&&n(3,c=M.noGutterLeft),"noGutterRight"in M&&n(4,d=M.noGutterRight),"padding"in M&&n(5,h=M.padding),"aspectRatio"in M&&n(6,g=M.aspectRatio),"sm"in M&&n(7,_=M.sm),"md"in M&&n(8,v=M.md),"lg"in M&&n(9,S=M.lg),"xlg"in M&&n(10,A=M.xlg),"max"in M&&n(11,C=M.max),"$$scope"in M&&n(13,a=M.$$scope)},t.$$.update=()=>{t.$$.dirty&3968&&n(12,i=[_,v,S,A,C].map((M,L)=>{const N=I[L];if(M===!0)return`bx--col-${N}`;if(typeof M=="number")return`bx--col-${N}-${M}`;if(typeof M=="object"){let z=[];return typeof M.span=="number"?z=[...z,`bx--col-${N}-${M.span}`]:M.span===!0&&(z=[...z,`bx--col-${N}`]),typeof M.offset=="number"&&(z=[...z,`bx--offset-${N}-${M.offset}`]),z.join(" ")}}).filter(Boolean).join(" ")),n(1,l={...s,class:[s.class,i,!i&&"bx--col",f&&"bx--no-gutter",c&&"bx--no-gutter--left",d&&"bx--no-gutter--right",g&&`bx--aspect-ratio bx--aspect-ratio--${g}`,h&&"bx--col-padding"].filter(Boolean).join(" ")})},[u,l,f,c,d,h,g,_,v,S,A,C,i,a,o]}class Pz extends De{constructor(e){super(),Re(this,e,Dz,Rz,Ie,{as:0,noGutter:2,noGutterLeft:3,noGutterRight:4,padding:5,aspectRatio:6,sm:7,md:8,lg:9,xlg:10,max:11})}}const zn=Pz;function Nz(t){const e=t-1;return e*e*e+1}function Nb(t,{delay:e=0,duration:n=400,easing:i=Nz,axis:l="y"}={}){const r=getComputedStyle(t),s=+r.opacity,o=l==="y"?"height":"width",a=parseFloat(r[o]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(S=>`${S[0].toUpperCase()}${S.slice(1)}`),c=parseFloat(r[`padding${f[0]}`]),d=parseFloat(r[`padding${f[1]}`]),h=parseFloat(r[`margin${f[0]}`]),g=parseFloat(r[`margin${f[1]}`]),_=parseFloat(r[`border${f[0]}Width`]),v=parseFloat(r[`border${f[1]}Width`]);return{delay:e,duration:n,easing:i,css:S=>`overflow: hidden;opacity: ${Math.min(S*20,1)*s};${o}: ${S*a}px;padding-${u[0]}: ${S*c}px;padding-${u[1]}: ${S*d}px;margin-${u[0]}: ${S*h}px;margin-${u[1]}: ${S*g}px;border-${u[0]}-width: ${S*_}px;border-${u[1]}-width: ${S*v}px;`}}function Bb(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Bz(t){let e,n,i,l=t[1]&&Bb(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Hz extends De{constructor(e){super(),Re(this,e,zz,Bz,Ie,{size:0,title:1})}}const BT=Hz;function Uz(t){let e,n;return e=new K1({props:{small:!0,description:t[2],withOverlay:!1,active:t[0]==="active"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4&&(r.description=i[2]),l&1&&(r.active=i[0]==="active"),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Fz(t){let e,n;return e=new RT({props:{class:"bx--inline-loading__checkmark-container",title:t[2]||t[0]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&5&&(r.title=i[2]||i[0]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Gz(t){let e,n;return e=new BT({props:{class:"bx--inline-loading--error",title:t[2]||t[0]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&5&&(r.title=i[2]||i[0]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function zb(t){let e,n;return{c(){e=R("div"),n=q(t[1]),E(e,"bx--inline-loading__text",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Vz(t){let e,n,i,l,r,s,o,a;const u=[Gz,Fz,Uz],f=[];function c(_,v){return _[0]==="error"?0:_[0]==="finished"?1:_[0]==="inactive"||_[0]==="active"?2:-1}~(i=c(t))&&(l=f[i]=u[i](t));let d=t[1]&&zb(t),h=[{"aria-live":"assertive"},t[3]],g={};for(let _=0;_{f[S]=null}),ce()),~i?(l=f[i],l?l.p(_,v):(l=f[i]=u[i](_),l.c()),b(l,1),l.m(n,null)):l=null),_[1]?d?d.p(_,v):(d=zb(_),d.c(),d.m(e,null)):d&&(d.d(1),d=null),Ae(e,g=Ue(h,[{"aria-live":"assertive"},v&8&&_[3]])),E(e,"bx--inline-loading",!0)},i(_){s||(b(l),s=!0)},o(_){k(l),s=!1},d(_){_&&w(e),~i&&f[i].d(),d&&d.d(),o=!1,vt(a)}}}function Wz(t,e,n){const i=["status","description","iconDescription","successDelay"];let l=ae(e,i),{status:r="active"}=e,{description:s=void 0}=e,{iconDescription:o=void 0}=e,{successDelay:a=1500}=e;const u=yn();let f;_n(()=>()=>{clearTimeout(f)}),Cl(()=>{r==="finished"&&(f=setTimeout(()=>{u("success")},a))});function c(_){te.call(this,t,_)}function d(_){te.call(this,t,_)}function h(_){te.call(this,t,_)}function g(_){te.call(this,t,_)}return t.$$set=_=>{e=Y(Y({},e),Se(_)),n(3,l=ae(e,i)),"status"in _&&n(0,r=_.status),"description"in _&&n(1,s=_.description),"iconDescription"in _&&n(2,o=_.iconDescription),"successDelay"in _&&n(4,a=_.successDelay)},[r,s,o,l,a,c,d,h,g]}class qz extends De{constructor(e){super(),Re(this,e,Wz,Vz,Ie,{status:0,description:1,iconDescription:2,successDelay:4})}}const oo=qz;function Hb(t,e,n){const i=t.slice();return i[74]=e[n],i[76]=n,i}const jz=t=>({item:t[0]&1610616832,index:t[0]&1610616832}),Ub=t=>({slot:"labelText",item:t[74],index:t[76]}),Yz=t=>({}),Fb=t=>({});function Gb(t){let e,n;const i=t[46].titleText,l=Ze(i,t,t[68],Fb),r=l||Zz(t);return{c(){e=R("label"),r&&r.c(),P(e,"for",t[26]),E(e,"bx--label",!0),E(e,"bx--label--disabled",t[11]),E(e,"bx--visually-hidden",t[25])},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[2]&64)&&Ke(l,i,s,s[68],n?Xe(i,s[68],o,Yz):$e(s[68]),Fb):r&&r.p&&(!n||o[0]&131072)&&r.p(s,n?o:[-1,-1,-1]),(!n||o[0]&67108864)&&P(e,"for",s[26]),(!n||o[0]&2048)&&E(e,"bx--label--disabled",s[11]),(!n||o[0]&33554432)&&E(e,"bx--visually-hidden",s[25])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function Zz(t){let e;return{c(){e=q(t[17])},m(n,i){y(n,e,i)},p(n,i){i[0]&131072&&Z(e,n[17])},d(n){n&&w(e)}}}function Vb(t){let e,n;return e=new Os({props:{class:"bx--list-box__invalid-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Wb(t){let e,n;return e=new Lu({props:{class:"bx--list-box__invalid-icon bx--list-box__invalid-icon--warning"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function qb(t){let e,n;return e=new MT({props:{selectionCount:t[31].length,translateWithId:t[16],disabled:t[11]}}),e.$on("clear",t[53]),e.$on("clear",t[54]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[1]&1&&(r.selectionCount=i[31].length),l[0]&65536&&(r.translateWithId=i[16]),l[0]&2048&&(r.disabled=i[11]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function jb(t){let e,n,i,l,r,s,o,a,u=[t[38],{role:"combobox"},{tabindex:"0"},{autocomplete:"off"},{"aria-autocomplete":"list"},{"aria-expanded":t[1]},{"aria-activedescendant":t[6]},{"aria-disabled":t[11]},{"aria-controls":t[34]},{disabled:t[11]},{placeholder:t[14]},{id:t[26]},{name:t[27]}],f={};for(let h=0;h{c=null}),ce()),h[0]?d?(d.p(h,g),g[0]&1&&b(d,1)):(d=Zb(h),d.c(),b(d,1),d.m(l.parentNode,l)):d&&(fe(),k(d,1,1,()=>{d=null}),ce());const _={};g[0]&2&&(_.style="pointer-events: "+(h[1]?"auto":"none")),g[0]&32768&&(_.translateWithId=h[15]),g[0]&2&&(_.open=h[1]),r.$set(_)},i(h){s||(b(c),b(d),b(r.$$.fragment,h),s=!0)},o(h){k(c),k(d),k(r.$$.fragment,h),s=!1},d(h){h&&(w(e),w(n),w(i),w(l)),t[55](null),c&&c.d(h),d&&d.d(h),U(r,h),o=!1,vt(a)}}}function Yb(t){let e,n;return e=new Os({props:{class:"bx--list-box__invalid-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Zb(t){let e,n;return e=new MT({props:{translateWithId:t[16],disabled:t[11],open:t[1]}}),e.$on("clear",t[58]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.translateWithId=i[16]),l[0]&2048&&(r.disabled=i[11]),l[0]&2&&(r.open=i[1]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Xb(t){let e,n,i,l,r;return l=new ET({props:{open:t[1],translateWithId:t[15]}}),{c(){e=R("span"),n=q(t[24]),i=B(),F(l.$$.fragment),E(e,"bx--list-box__label",!0)},m(s,o){y(s,e,o),T(e,n),y(s,i,o),H(l,s,o),r=!0},p(s,o){(!r||o[0]&16777216)&&Z(n,s[24]);const a={};o[0]&2&&(a.open=s[1]),o[0]&32768&&(a.translateWithId=s[15]),l.$set(a)},i(s){r||(b(l.$$.fragment,s),r=!0)},o(s){k(l.$$.fragment,s),r=!1},d(s){s&&(w(e),w(i)),U(l,s)}}}function Xz(t){let e,n,i,l,r=t[31].length>0&&qb(t),s=t[12]&&jb(t),o=!t[12]&&Xb(t);return{c(){r&&r.c(),e=B(),s&&s.c(),n=B(),o&&o.c(),i=qe()},m(a,u){r&&r.m(a,u),y(a,e,u),s&&s.m(a,u),y(a,n,u),o&&o.m(a,u),y(a,i,u),l=!0},p(a,u){a[31].length>0?r?(r.p(a,u),u[1]&1&&b(r,1)):(r=qb(a),r.c(),b(r,1),r.m(e.parentNode,e)):r&&(fe(),k(r,1,1,()=>{r=null}),ce()),a[12]?s?(s.p(a,u),u[0]&4096&&b(s,1)):(s=jb(a),s.c(),b(s,1),s.m(n.parentNode,n)):s&&(fe(),k(s,1,1,()=>{s=null}),ce()),a[12]?o&&(fe(),k(o,1,1,()=>{o=null}),ce()):o?(o.p(a,u),u[0]&4096&&b(o,1)):(o=Xb(a),o.c(),b(o,1),o.m(i.parentNode,i))},i(a){l||(b(r),b(s),b(o),l=!0)},o(a){k(r),k(s),k(o),l=!1},d(a){a&&(w(e),w(n),w(i)),r&&r.d(a),s&&s.d(a),o&&o.d(a)}}}function Kb(t){let e,n;return e=new zD({props:{"aria-label":t[32],id:t[26],"aria-multiselectable":"true",$$slots:{default:[Qz]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[1]&2&&(r["aria-label"]=i[32]),l[0]&67108864&&(r.id=i[26]),l[0]&1879314834|l[2]&64&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Kz(t){let e=t[7](t[74])+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&1610616960&&e!==(e=i[7](i[74])+"")&&Z(n,e)},d(i){i&&w(n)}}}function $z(t){let e;const n=t[46].default,i=Ze(n,t,t[68],Ub),l=i||Kz(t);return{c(){l&&l.c()},m(r,s){l&&l.m(r,s),e=!0},p(r,s){i?i.p&&(!e||s[0]&1610616832|s[2]&64)&&Ke(i,n,r,r[68],e?Xe(n,r[68],s,jz):$e(r[68]),Ub):l&&l.p&&(!e||s[0]&1610616960)&&l.p(r,e?s:[-1,-1,-1])},i(r){e||(b(l,r),e=!0)},o(r){k(l,r),e=!1},d(r){l&&l.d(r)}}}function Jz(t){let e,n,i;const l=[{name:t[74].id},{title:t[18]?t[7](t[74]):void 0},t[8](t[74]),{readonly:!0},{tabindex:"-1"},{id:"checkbox-"+t[74].id},{checked:t[74].checked},{disabled:t[74].disabled}];function r(){return t[64](t[76])}let s={$$slots:{labelText:[$z]},$$scope:{ctx:t}};for(let o=0;oo[74].id;for(let o=0;o{o=null}),ce()),!f[19]&&f[21]?a?c[0]&2621440&&b(a,1):(a=Wb(),a.c(),b(a,1),a.m(n.parentNode,n)):a&&(fe(),k(a,1,1,()=>{a=null}),ce());const d={};c[0]&2&&(d["aria-expanded"]=f[1]),c[0]&67108864&&(d.id=f[26]),c[0]&2048&&(d.disabled=f[11]),c[0]&32768&&(d.translateWithId=f[15]),c[0]&755628119|c[1]&137|c[2]&64&&(d.$$scope={dirty:c,ctx:f}),i.$set(d),f[1]?u?(u.p(f,c),c[0]&2&&b(u,1)):(u=Kb(f),u.c(),b(u,1),u.m(r.parentNode,r)):u&&(fe(),k(u,1,1,()=>{u=null}),ce())},i(f){s||(b(o),b(a),b(i.$$.fragment,f),b(u),s=!0)},o(f){k(o),k(a),k(i.$$.fragment,f),k(u),s=!1},d(f){f&&(w(e),w(n),w(l),w(r)),o&&o.d(f),a&&a.d(f),U(i,f),u&&u.d(f)}}}function Jb(t){let e,n;return{c(){e=R("div"),n=q(t[23]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[11])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&8388608&&Z(n,i[23]),l[0]&2048&&E(e,"bx--form__helper-text--disabled",i[11])},d(i){i&&w(e)}}}function eH(t){let e,n,i,l,r,s,o,a=(t[17]||t[37].titleText)&&Gb(t);i=new CD({props:{role:void 0,disabled:t[11],invalid:t[19],invalidText:t[20],open:t[1],light:t[13],size:t[9],warn:t[21],warnText:t[22],class:"bx--multi-select "+(t[10]==="top"&&"bx--list-box--up")+" "+(t[12]&&"bx--combo-box")+` `+(t[12]&&"bx--multi-select--filterable")+` `+(t[19]&&"bx--multi-select--invalid")+` `+(t[33]&&"bx--multi-select--inline")+` @@ -18,28 +18,28 @@ var pI=Object.defineProperty;var bI=(t,e,n)=>e in t?pI(t,e,{enumerable:!0,config `+(f[12]&&"bx--multi-select--filterable")+` `+(f[19]&&"bx--multi-select--invalid")+` `+(f[33]&&"bx--multi-select--inline")+` - `+(f[31].length>0&&"bx--multi-select--selected")),c[0]&2100165111|c[1]&139|c[2]&64&&(d.$$scope={dirty:c,ctx:f}),i.$set(d),!f[33]&&!f[19]&&!f[21]&&f[23]?u?u.p(f,c):(u=Jb(f),u.c(),u.m(e,null)):u&&(u.d(1),u=null),(!r||c[1]&4)&&E(e,"bx--multi-select__wrapper--inline",f[33]),(!r||c[1]&4)&&E(e,"bx--list-box__wrapper--inline",f[33]),(!r||c[0]&524288|c[1]&4)&&E(e,"bx--multi-select__wrapper--inline--invalid",f[33]&&f[19])},i(f){r||(b(a),b(i.$$.fragment,f),r=!0)},o(f){k(a),k(i.$$.fragment,f),r=!1},d(f){f&&w(e),a&&a.d(),U(i),u&&u.d(),t[67](null),s=!1,o()}}}function tH(t,e,n){let i,l,r,s,o,a,u;const f=["items","itemToString","itemToInput","selectedIds","value","size","type","direction","selectionFeedback","disabled","filterable","filterItem","open","light","locale","placeholder","sortItem","translateWithId","translateWithIdSelection","titleText","useTitleInItem","invalid","invalidText","warn","warnText","helperText","label","hideLabel","id","name","inputRef","multiSelectRef","fieldRef","selectionRef","highlightedId"];let c=ae(e,f),{$$slots:d={},$$scope:h}=e;const g=Yi(d);let{items:_=[]}=e,{itemToString:v=He=>He.text||He.id}=e,{itemToInput:S=He=>{}}=e,{selectedIds:A=[]}=e,{value:C=""}=e,{size:I=void 0}=e,{type:M="default"}=e,{direction:L="bottom"}=e,{selectionFeedback:N="top-after-reopen"}=e,{disabled:z=!1}=e,{filterable:W=!1}=e,{filterItem:D=(He,Tt)=>He.text.toLowerCase().includes(Tt.trim().toLowerCase())}=e,{open:G=!1}=e,{light:$=!1}=e,{locale:j="en"}=e,{placeholder:Q=""}=e,{sortItem:le=(He,Tt)=>He.text.localeCompare(Tt.text,j,{numeric:!0})}=e,{translateWithId:oe=void 0}=e,{translateWithIdSelection:X=void 0}=e,{titleText:de=""}=e,{useTitleInItem:re=!1}=e,{invalid:x=!1}=e,{invalidText:me=""}=e,{warn:ee=!1}=e,{warnText:ke=""}=e,{helperText:pe=""}=e,{label:Fe=""}=e,{hideLabel:Ve=!1}=e,{id:Ee="ccs-"+Math.random().toString(36)}=e,{name:We=void 0}=e,{inputRef:ge=null}=e,{multiSelectRef:ve=null}=e,{fieldRef:be=null}=e,{selectionRef:ue=null}=e,{highlightedId:nt=null}=e;const Oe=yn();let dt=!1,yt=-1,at=[];Wi("MultiSelect",{declareRef:({key:He,ref:Tt})=>{switch(He){case"field":n(4,be=Tt);break;case"selection":n(5,ue=Tt);break}}});function ut(He){let Tt=yt+He;const Bt=W?u.length:_.length;if(Bt===0)return;Tt<0?Tt=Bt-1:Tt>=Bt&&(Tt=0);let qn=_[Tt].disabled;for(;qn;)Tt=Tt+He,Tt<0?Tt=_.length-1:Tt>=_.length&&(Tt=0),qn=_[Tt].disabled;n(28,yt=Tt)}function At(){return[...o.length>1?o.sort(le):o,...a.sort(le)]}Cl(()=>{o.length!==at.length&&(N==="top"&&n(29,s=At()),at=o,n(40,A=o.map(({id:He})=>He)),Oe("select",{selectedIds:A,selected:o,unselected:a})),G||((!dt||N!=="fixed")&&(n(29,s=At()),dt=!0),n(28,yt=-1),n(0,C="")),n(39,_=s)});function xe(He){te.call(this,t,He)}function mt(He){te.call(this,t,He)}function we(He){te.call(this,t,He)}function gt(He){te.call(this,t,He)}function It(He){te.call(this,t,He)}const Ht=({target:He})=>{G&&ve&&!ve.contains(He)&&n(1,G=!1)};function Wt(He){te.call(this,t,He)}const qt=()=>{n(29,s=s.map(He=>({...He,checked:!1}))),be&&be.blur()};function Xt(He){ft[He?"unshift":"push"](()=>{ge=He,n(2,ge)})}function Ce(){C=this.value,n(0,C)}const se=({key:He})=>{if(He==="Enter"){if(nt){const Tt=s.findIndex(Bt=>Bt.id===nt);n(29,s=s.map((Bt,qn)=>qn!==Tt?Bt:{...Bt,checked:!Bt.checked}))}}else He==="Tab"?(n(1,G=!1),ge.blur()):He==="ArrowDown"?ut(1):He==="ArrowUp"?ut(-1):He==="Escape"?n(1,G=!1):He===" "&&(G||n(1,G=!0))},Le=()=>{n(0,C=""),n(1,G=!1)},_t=He=>{He.stopPropagation(),n(1,G=!G)},zt=()=>{z||(W?(n(1,G=!0),ge.focus()):n(1,G=!G))},Be=He=>{if(W)return;const Tt=He.key;[" ","ArrowUp","ArrowDown"].includes(Tt)&&He.preventDefault(),Tt===" "?n(1,G=!G):Tt==="Tab"?ue&&o.length>0?ue.focus():(n(1,G=!1),be.blur()):Tt==="ArrowDown"?ut(1):Tt==="ArrowUp"?ut(-1):Tt==="Enter"?yt>-1&&n(29,s=s.map((Bt,qn)=>qn!==yt?Bt:{...Bt,checked:!Bt.checked})):Tt==="Escape"&&n(1,G=!1)},Ot=()=>{W&&(n(1,G=!0),ge&&ge.focus())},kt=He=>{W||Oe("blur",He)},Pt=He=>{He===u.length-1&&n(1,G=!1)},Ye=(He,Tt)=>{if(He.disabled){Tt.stopPropagation();return}n(29,s=s.map(Bt=>Bt.id===He.id?{...Bt,checked:!Bt.checked}:Bt)),be.focus()},ze=(He,Tt)=>{He.disabled||n(28,yt=Tt)};function Qe(He){ft[He?"unshift":"push"](()=>{ve=He,n(3,ve)})}return t.$$set=He=>{n(73,e=Y(Y({},e),Se(He))),n(38,c=ae(e,f)),"items"in He&&n(39,_=He.items),"itemToString"in He&&n(7,v=He.itemToString),"itemToInput"in He&&n(8,S=He.itemToInput),"selectedIds"in He&&n(40,A=He.selectedIds),"value"in He&&n(0,C=He.value),"size"in He&&n(9,I=He.size),"type"in He&&n(41,M=He.type),"direction"in He&&n(10,L=He.direction),"selectionFeedback"in He&&n(42,N=He.selectionFeedback),"disabled"in He&&n(11,z=He.disabled),"filterable"in He&&n(12,W=He.filterable),"filterItem"in He&&n(43,D=He.filterItem),"open"in He&&n(1,G=He.open),"light"in He&&n(13,$=He.light),"locale"in He&&n(44,j=He.locale),"placeholder"in He&&n(14,Q=He.placeholder),"sortItem"in He&&n(45,le=He.sortItem),"translateWithId"in He&&n(15,oe=He.translateWithId),"translateWithIdSelection"in He&&n(16,X=He.translateWithIdSelection),"titleText"in He&&n(17,de=He.titleText),"useTitleInItem"in He&&n(18,re=He.useTitleInItem),"invalid"in He&&n(19,x=He.invalid),"invalidText"in He&&n(20,me=He.invalidText),"warn"in He&&n(21,ee=He.warn),"warnText"in He&&n(22,ke=He.warnText),"helperText"in He&&n(23,pe=He.helperText),"label"in He&&n(24,Fe=He.label),"hideLabel"in He&&n(25,Ve=He.hideLabel),"id"in He&&n(26,Ee=He.id),"name"in He&&n(27,We=He.name),"inputRef"in He&&n(2,ge=He.inputRef),"multiSelectRef"in He&&n(3,ve=He.multiSelectRef),"fieldRef"in He&&n(4,be=He.fieldRef),"selectionRef"in He&&n(5,ue=He.selectionRef),"highlightedId"in He&&n(6,nt=He.highlightedId),"$$scope"in He&&n(68,h=He.$$scope)},t.$$.update=()=>{var He;t.$$.dirty[0]&67108864&&n(34,i=`menu-${Ee}`),t.$$.dirty[1]&1024&&n(33,l=M==="inline"),n(32,r=e["aria-label"]||"Choose an item"),t.$$.dirty[1]&768&&n(29,s=_.map(Tt=>({...Tt,checked:A.includes(Tt.id)}))),t.$$.dirty[0]&536870912&&n(31,o=s.filter(({checked:Tt})=>Tt)),t.$$.dirty[0]&536870912&&(a=s.filter(({checked:Tt})=>!Tt)),t.$$.dirty[0]&536870913|t.$$.dirty[1]&4096&&n(30,u=s.filter(Tt=>D(Tt,C))),t.$$.dirty[0]&1879052288&&n(6,nt=yt>-1?((He=(W?u:s)[yt])==null?void 0:He.id)??null:null)},e=Se(e),[C,G,ge,ve,be,ue,nt,v,S,I,L,z,W,$,Q,oe,X,de,re,x,me,ee,ke,pe,Fe,Ve,Ee,We,yt,s,u,o,r,l,i,Oe,ut,g,c,_,A,M,N,D,j,le,d,xe,mt,we,gt,It,Ht,Wt,qt,Xt,Ce,se,Le,_t,zt,Be,Ot,kt,Pt,Ye,ze,Qe,h]}class nH extends De{constructor(e){super(),Re(this,e,tH,eH,Ie,{items:39,itemToString:7,itemToInput:8,selectedIds:40,value:0,size:9,type:41,direction:10,selectionFeedback:42,disabled:11,filterable:12,filterItem:43,open:1,light:13,locale:44,placeholder:14,sortItem:45,translateWithId:15,translateWithIdSelection:16,titleText:17,useTitleInItem:18,invalid:19,invalidText:20,warn:21,warnText:22,helperText:23,label:24,hideLabel:25,id:26,name:27,inputRef:2,multiSelectRef:3,fieldRef:4,selectionRef:5,highlightedId:6},null,[-1,-1,-1])}}const cd=nH;function Qb(t,e,n){const i=t.slice();return i[55]=e[n],i}const iH=t=>({}),xb=t=>({}),lH=t=>({}),e2=t=>({});function t2(t){let e,n,i,l,r;return n=new ql({props:{size:20,class:"bx--modal-close__icon","aria-hidden":"true"}}),{c(){e=R("button"),F(n.$$.fragment),P(e,"type","button"),P(e,"aria-label",t[8]),E(e,"bx--modal-close",!0)},m(s,o){y(s,e,o),H(n,e,null),t[37](e),i=!0,l||(r=J(e,"click",t[38]),l=!0)},p(s,o){(!i||o[0]&256)&&P(e,"aria-label",s[8])},i(s){i||(b(n.$$.fragment,s),i=!0)},o(s){k(n.$$.fragment,s),i=!1},d(s){s&&w(e),U(n),t[37](null),l=!1,r()}}}function n2(t){let e,n;const i=t[31].label,l=Ze(i,t,t[50],e2),r=l||rH(t);return{c(){e=R("h2"),r&&r.c(),P(e,"id",t[25]),E(e,"bx--modal-header__label",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[1]&524288)&&Ke(l,i,s,s[50],n?Xe(i,s[50],o,lH):$e(s[50]),e2):r&&r.p&&(!n||o[0]&128)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&33554432)&&P(e,"id",s[25])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function rH(t){let e;return{c(){e=q(t[7])},m(n,i){y(n,e,i)},p(n,i){i[0]&128&&Z(e,n[7])},d(n){n&&w(e)}}}function sH(t){let e;return{c(){e=q(t[6])},m(n,i){y(n,e,i)},p(n,i){i[0]&64&&Z(e,n[6])},d(n){n&&w(e)}}}function i2(t){let e,n,i,l,r;return n=new ql({props:{size:20,class:"bx--modal-close__icon","aria-hidden":"true"}}),{c(){e=R("button"),F(n.$$.fragment),P(e,"type","button"),P(e,"aria-label",t[8]),E(e,"bx--modal-close",!0)},m(s,o){y(s,e,o),H(n,e,null),t[39](e),i=!0,l||(r=J(e,"click",t[40]),l=!0)},p(s,o){(!i||o[0]&256)&&P(e,"aria-label",s[8])},i(s){i||(b(n.$$.fragment,s),i=!0)},o(s){k(n.$$.fragment,s),i=!1},d(s){s&&w(e),U(n),t[39](null),l=!1,r()}}}function l2(t){let e;return{c(){e=R("div"),E(e,"bx--modal-content--overflow-indicator",!0)},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function r2(t){let e,n,i,l,r,s;const o=[aH,oH],a=[];function u(f,c){return f[16].length>0?0:f[15]?1:-1}return~(n=u(t))&&(i=a[n]=o[n](t)),r=new Rt({props:{kind:t[3]?"danger":"primary",disabled:t[12],icon:t[13],$$slots:{default:[cH]},$$scope:{ctx:t}}}),r.$on("click",t[43]),{c(){e=R("div"),i&&i.c(),l=B(),F(r.$$.fragment),E(e,"bx--modal-footer",!0),E(e,"bx--modal-footer--three-button",t[16].length===2)},m(f,c){y(f,e,c),~n&&a[n].m(e,null),T(e,l),H(r,e,null),s=!0},p(f,c){let d=n;n=u(f),n===d?~n&&a[n].p(f,c):(i&&(fe(),k(a[d],1,1,()=>{a[d]=null}),ce()),~n?(i=a[n],i?i.p(f,c):(i=a[n]=o[n](f),i.c()),b(i,1),i.m(e,l)):i=null);const h={};c[0]&8&&(h.kind=f[3]?"danger":"primary"),c[0]&4096&&(h.disabled=f[12]),c[0]&8192&&(h.icon=f[13]),c[0]&2048|c[1]&524288&&(h.$$scope={dirty:c,ctx:f}),r.$set(h),(!s||c[0]&65536)&&E(e,"bx--modal-footer--three-button",f[16].length===2)},i(f){s||(b(i),b(r.$$.fragment,f),s=!0)},o(f){k(i),k(r.$$.fragment,f),s=!1},d(f){f&&w(e),~n&&a[n].d(),U(r)}}}function oH(t){let e,n;return e=new Rt({props:{kind:"secondary",$$slots:{default:[uH]},$$scope:{ctx:t}}}),e.$on("click",t[42]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&32768|l[1]&524288&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function aH(t){let e,n,i=ct(t[16]),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{M=null}),ce()),X[7]?L?(L.p(X,de),de[0]&128&&b(L,1)):(L=n2(X),L.c(),b(L,1),L.m(i,r)):L&&(fe(),k(L,1,1,()=>{L=null}),ce()),z?z.p&&(!A||de[1]&524288)&&Ke(z,N,X,X[50],A?Xe(N,X[50],de,iH):$e(X[50]),xb):W&&W.p&&(!A||de[0]&64)&&W.p(X,A?de:[-1,-1]),(!A||de[0]&16777216)&&P(s,"id",X[24]),X[5]?D&&(fe(),k(D,1,1,()=>{D=null}),ce()):D?(D.p(X,de),de[0]&32&&b(D,1)):(D=i2(X),D.c(),b(D,1),D.m(i,null)),$&&$.p&&(!A||de[1]&524288)&&Ke($,G,X,X[50],A?Xe(G,X[50],de,null):$e(X[50]),null),(!A||de[0]&8388608)&&P(u,"id",X[23]),(!A||de[0]&1024&&f!==(f=X[10]?"0":void 0))&&P(u,"tabindex",f),(!A||de[0]&1024&&c!==(c=X[10]?"region":void 0))&&P(u,"role",c),(!A||de[0]&4195328&&d!==(d=X[10]?X[22]:void 0))&&P(u,"aria-label",d),(!A||de[0]&50331776&&h!==(h=X[7]?X[25]:X[24]))&&P(u,"aria-labelledby",h),(!A||de[0]&512)&&E(u,"bx--modal-content--with-form",X[9]),(!A||de[0]&1024)&&E(u,"bx--modal-scroll-content",X[10]),X[10]?j||(j=l2(),j.c(),j.m(n,_)):j&&(j.d(1),j=null),X[5]?Q&&(fe(),k(Q,1,1,()=>{Q=null}),ce()):Q?(Q.p(X,de),de[0]&32&&b(Q,1)):(Q=r2(X),Q.c(),b(Q,1),Q.m(n,null)),(!A||de[0]&48&&v!==(v=X[4]?X[5]?"alert":"alertdialog":"dialog"))&&P(n,"role",v),(!A||de[0]&8388656&&S!==(S=X[4]&&!X[5]?X[23]:void 0))&&P(n,"aria-describedby",S),(!A||de[0]&4194304)&&P(n,"aria-label",X[22]),(!A||de[0]&4)&&E(n,"bx--modal-container--xs",X[2]==="xs"),(!A||de[0]&4)&&E(n,"bx--modal-container--sm",X[2]==="sm"),(!A||de[0]&4)&&E(n,"bx--modal-container--lg",X[2]==="lg"),Ae(e,oe=Ue(le,[{role:"presentation"},(!A||de[0]&262144)&&{id:X[18]},de[0]&268435456&&X[28]])),E(e,"bx--modal",!0),E(e,"bx--modal-tall",!X[5]),E(e,"is-visible",X[0]),E(e,"bx--modal--danger",X[3])},i(X){A||(b(M),b(L),b(W,X),b(D),b($,X),b(Q),A=!0)},o(X){k(M),k(L),k(W,X),k(D),k($,X),k(Q),A=!1},d(X){X&&w(e),M&&M.d(),L&&L.d(),W&&W.d(X),D&&D.d(),$&&$.d(X),j&&j.d(),Q&&Q.d(),t[44](null),t[46](null),C=!1,vt(I)}}}function hH(t,e,n){let i,l,r,s;const o=["size","open","danger","alert","passiveModal","modalHeading","modalLabel","modalAriaLabel","iconDescription","hasForm","hasScrollingContent","primaryButtonText","primaryButtonDisabled","primaryButtonIcon","shouldSubmitOnEnter","secondaryButtonText","secondaryButtons","selectorPrimaryFocus","preventCloseOnClickOutside","id","ref"];let a=ae(e,o),u,{$$slots:f={},$$scope:c}=e,{size:d=void 0}=e,{open:h=!1}=e,{danger:g=!1}=e,{alert:_=!1}=e,{passiveModal:v=!1}=e,{modalHeading:S=void 0}=e,{modalLabel:A=void 0}=e,{modalAriaLabel:C=void 0}=e,{iconDescription:I="Close the modal"}=e,{hasForm:M=!1}=e,{hasScrollingContent:L=!1}=e,{primaryButtonText:N=""}=e,{primaryButtonDisabled:z=!1}=e,{primaryButtonIcon:W=void 0}=e,{shouldSubmitOnEnter:D=!0}=e,{secondaryButtonText:G=""}=e,{secondaryButtons:$=[]}=e,{selectorPrimaryFocus:j="[data-modal-primary-focus]"}=e,{preventCloseOnClickOutside:Q=!1}=e,{id:le="ccs-"+Math.random().toString(36)}=e,{ref:oe=null}=e;const X=yn();let de=null,re=null,x=!1,me=!1;function ee(we){((we||re).querySelector(j)||de).focus()}const ke=un(h);Mt(t,ke,we=>n(52,u=we)),OT(ke),Cl(()=>{x?h||(x=!1,X("close")):h&&(x=!0,ee(),X("open"))});function pe(we){te.call(this,t,we)}function Fe(we){te.call(this,t,we)}function Ve(we){te.call(this,t,we)}function Ee(we){te.call(this,t,we)}function We(we){te.call(this,t,we)}function ge(we){ft[we?"unshift":"push"](()=>{de=we,n(19,de)})}const ve=()=>{n(0,h=!1)};function be(we){ft[we?"unshift":"push"](()=>{de=we,n(19,de)})}const ue=()=>{n(0,h=!1)},nt=we=>{X("click:button--secondary",{text:we.text})},Oe=()=>{X("click:button--secondary",{text:G})},dt=()=>{X("submit"),X("click:button--primary")};function yt(we){ft[we?"unshift":"push"](()=>{re=we,n(20,re)})}const at=()=>{n(21,me=!0)};function ut(we){ft[we?"unshift":"push"](()=>{oe=we,n(1,oe)})}const At=we=>{if(h)if(we.key==="Escape")n(0,h=!1);else if(we.key==="Tab"){const gt=` + `+(f[31].length>0&&"bx--multi-select--selected")),c[0]&2100165111|c[1]&139|c[2]&64&&(d.$$scope={dirty:c,ctx:f}),i.$set(d),!f[33]&&!f[19]&&!f[21]&&f[23]?u?u.p(f,c):(u=Jb(f),u.c(),u.m(e,null)):u&&(u.d(1),u=null),(!r||c[1]&4)&&E(e,"bx--multi-select__wrapper--inline",f[33]),(!r||c[1]&4)&&E(e,"bx--list-box__wrapper--inline",f[33]),(!r||c[0]&524288|c[1]&4)&&E(e,"bx--multi-select__wrapper--inline--invalid",f[33]&&f[19])},i(f){r||(b(a),b(i.$$.fragment,f),r=!0)},o(f){k(a),k(i.$$.fragment,f),r=!1},d(f){f&&w(e),a&&a.d(),U(i),u&&u.d(),t[67](null),s=!1,o()}}}function tH(t,e,n){let i,l,r,s,o,a,u;const f=["items","itemToString","itemToInput","selectedIds","value","size","type","direction","selectionFeedback","disabled","filterable","filterItem","open","light","locale","placeholder","sortItem","translateWithId","translateWithIdSelection","titleText","useTitleInItem","invalid","invalidText","warn","warnText","helperText","label","hideLabel","id","name","inputRef","multiSelectRef","fieldRef","selectionRef","highlightedId"];let c=ae(e,f),{$$slots:d={},$$scope:h}=e;const g=Yi(d);let{items:_=[]}=e,{itemToString:v=He=>He.text||He.id}=e,{itemToInput:S=He=>{}}=e,{selectedIds:A=[]}=e,{value:C=""}=e,{size:I=void 0}=e,{type:M="default"}=e,{direction:L="bottom"}=e,{selectionFeedback:N="top-after-reopen"}=e,{disabled:z=!1}=e,{filterable:W=!1}=e,{filterItem:D=(He,Tt)=>He.text.toLowerCase().includes(Tt.trim().toLowerCase())}=e,{open:G=!1}=e,{light:$=!1}=e,{locale:j="en"}=e,{placeholder:Q=""}=e,{sortItem:le=(He,Tt)=>He.text.localeCompare(Tt.text,j,{numeric:!0})}=e,{translateWithId:oe=void 0}=e,{translateWithIdSelection:X=void 0}=e,{titleText:de=""}=e,{useTitleInItem:re=!1}=e,{invalid:x=!1}=e,{invalidText:me=""}=e,{warn:ee=!1}=e,{warnText:ke=""}=e,{helperText:pe=""}=e,{label:Fe=""}=e,{hideLabel:Ve=!1}=e,{id:Ee="ccs-"+Math.random().toString(36)}=e,{name:We=void 0}=e,{inputRef:ge=null}=e,{multiSelectRef:ve=null}=e,{fieldRef:be=null}=e,{selectionRef:ue=null}=e,{highlightedId:nt=null}=e;const Oe=yn();let dt=!1,yt=-1,at=[];Wi("MultiSelect",{declareRef:({key:He,ref:Tt})=>{switch(He){case"field":n(4,be=Tt);break;case"selection":n(5,ue=Tt);break}}});function ut(He){let Tt=yt+He;const Bt=W?u.length:_.length;if(Bt===0)return;Tt<0?Tt=Bt-1:Tt>=Bt&&(Tt=0);let qn=_[Tt].disabled;for(;qn;)Tt=Tt+He,Tt<0?Tt=_.length-1:Tt>=_.length&&(Tt=0),qn=_[Tt].disabled;n(28,yt=Tt)}function At(){return[...o.length>1?o.sort(le):o,...a.sort(le)]}Cl(()=>{o.length!==at.length&&(N==="top"&&n(29,s=At()),at=o,n(40,A=o.map(({id:He})=>He)),Oe("select",{selectedIds:A,selected:o,unselected:a})),G||((!dt||N!=="fixed")&&(n(29,s=At()),dt=!0),n(28,yt=-1),n(0,C="")),n(39,_=s)});function xe(He){te.call(this,t,He)}function mt(He){te.call(this,t,He)}function we(He){te.call(this,t,He)}function gt(He){te.call(this,t,He)}function It(He){te.call(this,t,He)}const Ht=({target:He})=>{G&&ve&&!ve.contains(He)&&n(1,G=!1)};function Wt(He){te.call(this,t,He)}const qt=()=>{n(29,s=s.map(He=>({...He,checked:!1}))),be&&be.blur()};function Xt(He){ft[He?"unshift":"push"](()=>{ge=He,n(2,ge)})}function Ce(){C=this.value,n(0,C)}const se=({key:He})=>{if(He==="Enter"){if(nt){const Tt=s.findIndex(Bt=>Bt.id===nt);n(29,s=s.map((Bt,qn)=>qn!==Tt?Bt:{...Bt,checked:!Bt.checked}))}}else He==="Tab"?(n(1,G=!1),ge.blur()):He==="ArrowDown"?ut(1):He==="ArrowUp"?ut(-1):He==="Escape"?n(1,G=!1):He===" "&&(G||n(1,G=!0))},Le=()=>{n(0,C=""),n(1,G=!1)},_t=He=>{He.stopPropagation(),n(1,G=!G)},zt=()=>{z||(W?(n(1,G=!0),ge.focus()):n(1,G=!G))},Be=He=>{if(W)return;const Tt=He.key;[" ","ArrowUp","ArrowDown"].includes(Tt)&&He.preventDefault(),Tt===" "?n(1,G=!G):Tt==="Tab"?ue&&o.length>0?ue.focus():(n(1,G=!1),be.blur()):Tt==="ArrowDown"?ut(1):Tt==="ArrowUp"?ut(-1):Tt==="Enter"?yt>-1&&n(29,s=s.map((Bt,qn)=>qn!==yt?Bt:{...Bt,checked:!Bt.checked})):Tt==="Escape"&&n(1,G=!1)},Ot=()=>{W&&(n(1,G=!0),ge&&ge.focus())},kt=He=>{W||Oe("blur",He)},Pt=He=>{He===u.length-1&&n(1,G=!1)},Ye=(He,Tt)=>{if(He.disabled){Tt.stopPropagation();return}n(29,s=s.map(Bt=>Bt.id===He.id?{...Bt,checked:!Bt.checked}:Bt)),be.focus()},ze=(He,Tt)=>{He.disabled||n(28,yt=Tt)};function Qe(He){ft[He?"unshift":"push"](()=>{ve=He,n(3,ve)})}return t.$$set=He=>{n(73,e=Y(Y({},e),Se(He))),n(38,c=ae(e,f)),"items"in He&&n(39,_=He.items),"itemToString"in He&&n(7,v=He.itemToString),"itemToInput"in He&&n(8,S=He.itemToInput),"selectedIds"in He&&n(40,A=He.selectedIds),"value"in He&&n(0,C=He.value),"size"in He&&n(9,I=He.size),"type"in He&&n(41,M=He.type),"direction"in He&&n(10,L=He.direction),"selectionFeedback"in He&&n(42,N=He.selectionFeedback),"disabled"in He&&n(11,z=He.disabled),"filterable"in He&&n(12,W=He.filterable),"filterItem"in He&&n(43,D=He.filterItem),"open"in He&&n(1,G=He.open),"light"in He&&n(13,$=He.light),"locale"in He&&n(44,j=He.locale),"placeholder"in He&&n(14,Q=He.placeholder),"sortItem"in He&&n(45,le=He.sortItem),"translateWithId"in He&&n(15,oe=He.translateWithId),"translateWithIdSelection"in He&&n(16,X=He.translateWithIdSelection),"titleText"in He&&n(17,de=He.titleText),"useTitleInItem"in He&&n(18,re=He.useTitleInItem),"invalid"in He&&n(19,x=He.invalid),"invalidText"in He&&n(20,me=He.invalidText),"warn"in He&&n(21,ee=He.warn),"warnText"in He&&n(22,ke=He.warnText),"helperText"in He&&n(23,pe=He.helperText),"label"in He&&n(24,Fe=He.label),"hideLabel"in He&&n(25,Ve=He.hideLabel),"id"in He&&n(26,Ee=He.id),"name"in He&&n(27,We=He.name),"inputRef"in He&&n(2,ge=He.inputRef),"multiSelectRef"in He&&n(3,ve=He.multiSelectRef),"fieldRef"in He&&n(4,be=He.fieldRef),"selectionRef"in He&&n(5,ue=He.selectionRef),"highlightedId"in He&&n(6,nt=He.highlightedId),"$$scope"in He&&n(68,h=He.$$scope)},t.$$.update=()=>{var He;t.$$.dirty[0]&67108864&&n(34,i=`menu-${Ee}`),t.$$.dirty[1]&1024&&n(33,l=M==="inline"),n(32,r=e["aria-label"]||"Choose an item"),t.$$.dirty[1]&768&&n(29,s=_.map(Tt=>({...Tt,checked:A.includes(Tt.id)}))),t.$$.dirty[0]&536870912&&n(31,o=s.filter(({checked:Tt})=>Tt)),t.$$.dirty[0]&536870912&&(a=s.filter(({checked:Tt})=>!Tt)),t.$$.dirty[0]&536870913|t.$$.dirty[1]&4096&&n(30,u=s.filter(Tt=>D(Tt,C))),t.$$.dirty[0]&1879052288&&n(6,nt=yt>-1?((He=(W?u:s)[yt])==null?void 0:He.id)??null:null)},e=Se(e),[C,G,ge,ve,be,ue,nt,v,S,I,L,z,W,$,Q,oe,X,de,re,x,me,ee,ke,pe,Fe,Ve,Ee,We,yt,s,u,o,r,l,i,Oe,ut,g,c,_,A,M,N,D,j,le,d,xe,mt,we,gt,It,Ht,Wt,qt,Xt,Ce,se,Le,_t,zt,Be,Ot,kt,Pt,Ye,ze,Qe,h]}class nH extends De{constructor(e){super(),Re(this,e,tH,eH,Ie,{items:39,itemToString:7,itemToInput:8,selectedIds:40,value:0,size:9,type:41,direction:10,selectionFeedback:42,disabled:11,filterable:12,filterItem:43,open:1,light:13,locale:44,placeholder:14,sortItem:45,translateWithId:15,translateWithIdSelection:16,titleText:17,useTitleInItem:18,invalid:19,invalidText:20,warn:21,warnText:22,helperText:23,label:24,hideLabel:25,id:26,name:27,inputRef:2,multiSelectRef:3,fieldRef:4,selectionRef:5,highlightedId:6},null,[-1,-1,-1])}}const cd=nH;function Qb(t,e,n){const i=t.slice();return i[55]=e[n],i}const iH=t=>({}),xb=t=>({}),lH=t=>({}),e2=t=>({});function t2(t){let e,n,i,l,r;return n=new ql({props:{size:20,class:"bx--modal-close__icon","aria-hidden":"true"}}),{c(){e=R("button"),F(n.$$.fragment),P(e,"type","button"),P(e,"aria-label",t[8]),E(e,"bx--modal-close",!0)},m(s,o){y(s,e,o),H(n,e,null),t[37](e),i=!0,l||(r=J(e,"click",t[38]),l=!0)},p(s,o){(!i||o[0]&256)&&P(e,"aria-label",s[8])},i(s){i||(b(n.$$.fragment,s),i=!0)},o(s){k(n.$$.fragment,s),i=!1},d(s){s&&w(e),U(n),t[37](null),l=!1,r()}}}function n2(t){let e,n;const i=t[31].label,l=Ze(i,t,t[50],e2),r=l||rH(t);return{c(){e=R("h2"),r&&r.c(),P(e,"id",t[25]),E(e,"bx--modal-header__label",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[1]&524288)&&Ke(l,i,s,s[50],n?Xe(i,s[50],o,lH):$e(s[50]),e2):r&&r.p&&(!n||o[0]&128)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&33554432)&&P(e,"id",s[25])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function rH(t){let e;return{c(){e=q(t[7])},m(n,i){y(n,e,i)},p(n,i){i[0]&128&&Z(e,n[7])},d(n){n&&w(e)}}}function sH(t){let e;return{c(){e=q(t[6])},m(n,i){y(n,e,i)},p(n,i){i[0]&64&&Z(e,n[6])},d(n){n&&w(e)}}}function i2(t){let e,n,i,l,r;return n=new ql({props:{size:20,class:"bx--modal-close__icon","aria-hidden":"true"}}),{c(){e=R("button"),F(n.$$.fragment),P(e,"type","button"),P(e,"aria-label",t[8]),E(e,"bx--modal-close",!0)},m(s,o){y(s,e,o),H(n,e,null),t[39](e),i=!0,l||(r=J(e,"click",t[40]),l=!0)},p(s,o){(!i||o[0]&256)&&P(e,"aria-label",s[8])},i(s){i||(b(n.$$.fragment,s),i=!0)},o(s){k(n.$$.fragment,s),i=!1},d(s){s&&w(e),U(n),t[39](null),l=!1,r()}}}function l2(t){let e;return{c(){e=R("div"),E(e,"bx--modal-content--overflow-indicator",!0)},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function r2(t){let e,n,i,l,r,s;const o=[aH,oH],a=[];function u(f,c){return f[16].length>0?0:f[15]?1:-1}return~(n=u(t))&&(i=a[n]=o[n](t)),r=new Rt({props:{kind:t[3]?"danger":"primary",disabled:t[12],icon:t[13],$$slots:{default:[cH]},$$scope:{ctx:t}}}),r.$on("click",t[43]),{c(){e=R("div"),i&&i.c(),l=B(),F(r.$$.fragment),E(e,"bx--modal-footer",!0),E(e,"bx--modal-footer--three-button",t[16].length===2)},m(f,c){y(f,e,c),~n&&a[n].m(e,null),T(e,l),H(r,e,null),s=!0},p(f,c){let d=n;n=u(f),n===d?~n&&a[n].p(f,c):(i&&(fe(),k(a[d],1,1,()=>{a[d]=null}),ce()),~n?(i=a[n],i?i.p(f,c):(i=a[n]=o[n](f),i.c()),b(i,1),i.m(e,l)):i=null);const h={};c[0]&8&&(h.kind=f[3]?"danger":"primary"),c[0]&4096&&(h.disabled=f[12]),c[0]&8192&&(h.icon=f[13]),c[0]&2048|c[1]&524288&&(h.$$scope={dirty:c,ctx:f}),r.$set(h),(!s||c[0]&65536)&&E(e,"bx--modal-footer--three-button",f[16].length===2)},i(f){s||(b(i),b(r.$$.fragment,f),s=!0)},o(f){k(i),k(r.$$.fragment,f),s=!1},d(f){f&&w(e),~n&&a[n].d(),U(r)}}}function oH(t){let e,n;return e=new Rt({props:{kind:"secondary",$$slots:{default:[uH]},$$scope:{ctx:t}}}),e.$on("click",t[42]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&32768|l[1]&524288&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function aH(t){let e,n,i=ct(t[16]),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{M=null}),ce()),X[7]?L?(L.p(X,de),de[0]&128&&b(L,1)):(L=n2(X),L.c(),b(L,1),L.m(i,r)):L&&(fe(),k(L,1,1,()=>{L=null}),ce()),z?z.p&&(!A||de[1]&524288)&&Ke(z,N,X,X[50],A?Xe(N,X[50],de,iH):$e(X[50]),xb):W&&W.p&&(!A||de[0]&64)&&W.p(X,A?de:[-1,-1]),(!A||de[0]&16777216)&&P(s,"id",X[24]),X[5]?D&&(fe(),k(D,1,1,()=>{D=null}),ce()):D?(D.p(X,de),de[0]&32&&b(D,1)):(D=i2(X),D.c(),b(D,1),D.m(i,null)),$&&$.p&&(!A||de[1]&524288)&&Ke($,G,X,X[50],A?Xe(G,X[50],de,null):$e(X[50]),null),(!A||de[0]&8388608)&&P(u,"id",X[23]),(!A||de[0]&1024&&f!==(f=X[10]?"0":void 0))&&P(u,"tabindex",f),(!A||de[0]&1024&&c!==(c=X[10]?"region":void 0))&&P(u,"role",c),(!A||de[0]&4195328&&d!==(d=X[10]?X[22]:void 0))&&P(u,"aria-label",d),(!A||de[0]&50331776&&h!==(h=X[7]?X[25]:X[24]))&&P(u,"aria-labelledby",h),(!A||de[0]&512)&&E(u,"bx--modal-content--with-form",X[9]),(!A||de[0]&1024)&&E(u,"bx--modal-scroll-content",X[10]),X[10]?j||(j=l2(),j.c(),j.m(n,_)):j&&(j.d(1),j=null),X[5]?Q&&(fe(),k(Q,1,1,()=>{Q=null}),ce()):Q?(Q.p(X,de),de[0]&32&&b(Q,1)):(Q=r2(X),Q.c(),b(Q,1),Q.m(n,null)),(!A||de[0]&48&&v!==(v=X[4]?X[5]?"alert":"alertdialog":"dialog"))&&P(n,"role",v),(!A||de[0]&8388656&&S!==(S=X[4]&&!X[5]?X[23]:void 0))&&P(n,"aria-describedby",S),(!A||de[0]&4194304)&&P(n,"aria-label",X[22]),(!A||de[0]&4)&&E(n,"bx--modal-container--xs",X[2]==="xs"),(!A||de[0]&4)&&E(n,"bx--modal-container--sm",X[2]==="sm"),(!A||de[0]&4)&&E(n,"bx--modal-container--lg",X[2]==="lg"),Ae(e,oe=Ue(le,[{role:"presentation"},(!A||de[0]&262144)&&{id:X[18]},de[0]&268435456&&X[28]])),E(e,"bx--modal",!0),E(e,"bx--modal-tall",!X[5]),E(e,"is-visible",X[0]),E(e,"bx--modal--danger",X[3])},i(X){A||(b(M),b(L),b(W,X),b(D),b($,X),b(Q),A=!0)},o(X){k(M),k(L),k(W,X),k(D),k($,X),k(Q),A=!1},d(X){X&&w(e),M&&M.d(),L&&L.d(),W&&W.d(X),D&&D.d(),$&&$.d(X),j&&j.d(),Q&&Q.d(),t[44](null),t[46](null),C=!1,vt(I)}}}function hH(t,e,n){let i,l,r,s;const o=["size","open","danger","alert","passiveModal","modalHeading","modalLabel","modalAriaLabel","iconDescription","hasForm","hasScrollingContent","primaryButtonText","primaryButtonDisabled","primaryButtonIcon","shouldSubmitOnEnter","secondaryButtonText","secondaryButtons","selectorPrimaryFocus","preventCloseOnClickOutside","id","ref"];let a=ae(e,o),u,{$$slots:f={},$$scope:c}=e,{size:d=void 0}=e,{open:h=!1}=e,{danger:g=!1}=e,{alert:_=!1}=e,{passiveModal:v=!1}=e,{modalHeading:S=void 0}=e,{modalLabel:A=void 0}=e,{modalAriaLabel:C=void 0}=e,{iconDescription:I="Close the modal"}=e,{hasForm:M=!1}=e,{hasScrollingContent:L=!1}=e,{primaryButtonText:N=""}=e,{primaryButtonDisabled:z=!1}=e,{primaryButtonIcon:W=void 0}=e,{shouldSubmitOnEnter:D=!0}=e,{secondaryButtonText:G=""}=e,{secondaryButtons:$=[]}=e,{selectorPrimaryFocus:j="[data-modal-primary-focus]"}=e,{preventCloseOnClickOutside:Q=!1}=e,{id:le="ccs-"+Math.random().toString(36)}=e,{ref:oe=null}=e;const X=yn();let de=null,re=null,x=!1,me=!1;function ee(we){((we||re).querySelector(j)||de).focus()}const ke=un(h);Mt(t,ke,we=>n(52,u=we)),AT(ke),Cl(()=>{x?h||(x=!1,X("close")):h&&(x=!0,ee(),X("open"))});function pe(we){te.call(this,t,we)}function Fe(we){te.call(this,t,we)}function Ve(we){te.call(this,t,we)}function Ee(we){te.call(this,t,we)}function We(we){te.call(this,t,we)}function ge(we){ft[we?"unshift":"push"](()=>{de=we,n(19,de)})}const ve=()=>{n(0,h=!1)};function be(we){ft[we?"unshift":"push"](()=>{de=we,n(19,de)})}const ue=()=>{n(0,h=!1)},nt=we=>{X("click:button--secondary",{text:we.text})},Oe=()=>{X("click:button--secondary",{text:G})},dt=()=>{X("submit"),X("click:button--primary")};function yt(we){ft[we?"unshift":"push"](()=>{re=we,n(20,re)})}const at=()=>{n(21,me=!0)};function ut(we){ft[we?"unshift":"push"](()=>{oe=we,n(1,oe)})}const At=we=>{if(h)if(we.key==="Escape")n(0,h=!1);else if(we.key==="Tab"){const gt=` a[href], area[href], input:not([disabled]):not([tabindex='-1']), button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']), textarea:not([disabled]):not([tabindex='-1']), iframe, object, embed, *[tabindex]:not([tabindex='-1']):not([disabled]), *[contenteditable=true] -`,It=Array.from(oe.querySelectorAll(gt));let Ht=It.indexOf(document.activeElement);Ht===-1&&we.shiftKey&&(Ht=0),Ht+=It.length+(we.shiftKey?-1:1),Ht%=It.length,It[Ht].focus(),we.preventDefault()}else D&&we.key==="Enter"&&!z&&(X("submit"),X("click:button--primary"))},xe=()=>{!me&&!Q&&n(0,h=!1),n(21,me=!1)},mt=we=>{we.propertyName==="transform"&&X("transitionend",{open:h})};return t.$$set=we=>{n(54,e=Y(Y({},e),Se(we))),n(28,a=ae(e,o)),"size"in we&&n(2,d=we.size),"open"in we&&n(0,h=we.open),"danger"in we&&n(3,g=we.danger),"alert"in we&&n(4,_=we.alert),"passiveModal"in we&&n(5,v=we.passiveModal),"modalHeading"in we&&n(6,S=we.modalHeading),"modalLabel"in we&&n(7,A=we.modalLabel),"modalAriaLabel"in we&&n(29,C=we.modalAriaLabel),"iconDescription"in we&&n(8,I=we.iconDescription),"hasForm"in we&&n(9,M=we.hasForm),"hasScrollingContent"in we&&n(10,L=we.hasScrollingContent),"primaryButtonText"in we&&n(11,N=we.primaryButtonText),"primaryButtonDisabled"in we&&n(12,z=we.primaryButtonDisabled),"primaryButtonIcon"in we&&n(13,W=we.primaryButtonIcon),"shouldSubmitOnEnter"in we&&n(14,D=we.shouldSubmitOnEnter),"secondaryButtonText"in we&&n(15,G=we.secondaryButtonText),"secondaryButtons"in we&&n(16,$=we.secondaryButtons),"selectorPrimaryFocus"in we&&n(30,j=we.selectorPrimaryFocus),"preventCloseOnClickOutside"in we&&n(17,Q=we.preventCloseOnClickOutside),"id"in we&&n(18,le=we.id),"ref"in we&&n(1,oe=we.ref),"$$scope"in we&&n(50,c=we.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&1&&Js(ke,u=h,u),t.$$.dirty[0]&262144&&n(25,i=`bx--modal-header__label--modal-${le}`),t.$$.dirty[0]&262144&&n(24,l=`bx--modal-header__heading--modal-${le}`),t.$$.dirty[0]&262144&&n(23,r=`bx--modal-body--${le}`),n(22,s=A||e["aria-label"]||C||S)},e=Se(e),[h,oe,d,g,_,v,S,A,I,M,L,N,z,W,D,G,$,Q,le,de,re,me,s,r,l,i,X,ke,a,C,j,f,pe,Fe,Ve,Ee,We,ge,ve,be,ue,nt,Oe,dt,yt,at,ut,At,xe,mt,c]}class mH extends De{constructor(e){super(),Re(this,e,hH,dH,Ie,{size:2,open:0,danger:3,alert:4,passiveModal:5,modalHeading:6,modalLabel:7,modalAriaLabel:29,iconDescription:8,hasForm:9,hasScrollingContent:10,primaryButtonText:11,primaryButtonDisabled:12,primaryButtonIcon:13,shouldSubmitOnEnter:14,secondaryButtonText:15,secondaryButtons:16,selectorPrimaryFocus:30,preventCloseOnClickOutside:17,id:18,ref:1},null,[-1,-1])}}const gH=mH;function _H(t){let e,n,i,l,r;var s=t[1];function o(f,c){return{props:{size:20,title:f[2],class:(f[0]==="toast"&&"bx--toast-notification__close-icon")+" "+(f[0]==="inline"&&"bx--inline-notification__close-icon")}}}s&&(n=cn(s,o(t)));let a=[{type:"button"},{"aria-label":t[3]},{title:t[3]},t[4]],u={};for(let f=0;f{U(d,1)}),ce()}s?(n=cn(s,o(f)),F(n.$$.fragment),b(n.$$.fragment,1),H(n,e,null)):n=null}else if(s){const d={};c&4&&(d.title=f[2]),c&1&&(d.class=(f[0]==="toast"&&"bx--toast-notification__close-icon")+" "+(f[0]==="inline"&&"bx--inline-notification__close-icon")),n.$set(d)}Ae(e,u=Ue(a,[{type:"button"},(!i||c&8)&&{"aria-label":f[3]},(!i||c&8)&&{title:f[3]},c&16&&f[4]])),E(e,"bx--toast-notification__close-button",f[0]==="toast"),E(e,"bx--inline-notification__close-button",f[0]==="inline")},i(f){i||(n&&b(n.$$.fragment,f),i=!0)},o(f){n&&k(n.$$.fragment,f),i=!1},d(f){f&&w(e),n&&U(n),l=!1,vt(r)}}}function pH(t,e,n){const i=["notificationType","icon","title","iconDescription"];let l=ae(e,i),{notificationType:r="toast"}=e,{icon:s=ql}=e,{title:o=void 0}=e,{iconDescription:a="Close icon"}=e;function u(h){te.call(this,t,h)}function f(h){te.call(this,t,h)}function c(h){te.call(this,t,h)}function d(h){te.call(this,t,h)}return t.$$set=h=>{e=Y(Y({},e),Se(h)),n(4,l=ae(e,i)),"notificationType"in h&&n(0,r=h.notificationType),"icon"in h&&n(1,s=h.icon),"title"in h&&n(2,o=h.title),"iconDescription"in h&&n(3,a=h.iconDescription)},[r,s,o,a,l,u,f,c,d]}class bH extends De{constructor(e){super(),Re(this,e,pH,_H,Ie,{notificationType:0,icon:1,title:2,iconDescription:3})}}const BT=bH;function o2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function vH(t){let e,n,i,l=t[1]&&o2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class wH extends De{constructor(e){super(),Re(this,e,kH,vH,Ie,{size:0,title:1})}}const yH=wH;function a2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function TH(t){let e,n,i,l=t[1]&&a2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class EH extends De{constructor(e){super(),Re(this,e,SH,TH,Ie,{size:0,title:1})}}const MH=EH;function OH(t){let e,n,i;var l=t[3][t[0]];function r(s,o){return{props:{size:20,title:s[2],class:(s[1]==="toast"&&"bx--toast-notification__icon")+" "+(s[1]==="inline"&&"bx--inline-notification__icon")}}}return l&&(e=cn(l,r(t))),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,[o]){if(o&1&&l!==(l=s[3][s[0]])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r(s)),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}else if(l){const a={};o&4&&(a.title=s[2]),o&2&&(a.class=(s[1]==="toast"&&"bx--toast-notification__icon")+" "+(s[1]==="inline"&&"bx--inline-notification__icon")),e.$set(a)}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function AH(t,e,n){let{kind:i="error"}=e,{notificationType:l="toast"}=e,{iconDescription:r}=e;const s={error:NT,"info-square":MH,info:yH,success:IT,warning:Os,"warning-alt":Lu};return t.$$set=o=>{"kind"in o&&n(0,i=o.kind),"notificationType"in o&&n(1,l=o.notificationType),"iconDescription"in o&&n(2,r=o.iconDescription)},[i,l,r,s]}class CH extends De{constructor(e){super(),Re(this,e,AH,OH,Ie,{kind:0,notificationType:1,iconDescription:2})}}const zT=CH,LH=t=>({}),u2=t=>({}),IH=t=>({}),f2=t=>({}),RH=t=>({}),c2=t=>({});function d2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g;n=new zT({props:{kind:t[0],iconDescription:t[6]}});const _=t[15].title,v=Ze(_,t,t[14],c2),S=v||DH(t),A=t[15].subtitle,C=Ze(A,t,t[14],f2),I=C||PH(t),M=t[15].caption,L=Ze(M,t,t[14],u2),N=L||NH(t),z=t[15].default,W=Ze(z,t,t[14],null);let D=!t[8]&&h2(t),G=[{role:t[2]},{kind:t[0]},t[12]],$={};for(let j=0;j{D=null}),ce()):D?(D.p(j,Q),Q&256&&b(D,1)):(D=h2(j),D.c(),b(D,1),D.m(e,null)),Ae(e,$=Ue(G,[(!d||Q&4)&&{role:j[2]},(!d||Q&1)&&{kind:j[0]},Q&4096&&j[12]])),E(e,"bx--toast-notification",!0),E(e,"bx--toast-notification--low-contrast",j[1]),E(e,"bx--toast-notification--error",j[0]==="error"),E(e,"bx--toast-notification--info",j[0]==="info"),E(e,"bx--toast-notification--info-square",j[0]==="info-square"),E(e,"bx--toast-notification--success",j[0]==="success"),E(e,"bx--toast-notification--warning",j[0]==="warning"),E(e,"bx--toast-notification--warning-alt",j[0]==="warning-alt"),wt(e,"width",j[9]?"100%":void 0)},i(j){d||(b(n.$$.fragment,j),b(S,j),b(I,j),b(N,j),b(W,j),b(D),d=!0)},o(j){k(n.$$.fragment,j),k(S,j),k(I,j),k(N,j),k(W,j),k(D),d=!1},d(j){j&&w(e),U(n),S&&S.d(j),I&&I.d(j),N&&N.d(j),W&&W.d(j),D&&D.d(),h=!1,vt(g)}}}function DH(t){let e;return{c(){e=q(t[3])},m(n,i){y(n,e,i)},p(n,i){i&8&&Z(e,n[3])},d(n){n&&w(e)}}}function PH(t){let e;return{c(){e=q(t[4])},m(n,i){y(n,e,i)},p(n,i){i&16&&Z(e,n[4])},d(n){n&&w(e)}}}function NH(t){let e;return{c(){e=q(t[5])},m(n,i){y(n,e,i)},p(n,i){i&32&&Z(e,n[5])},d(n){n&&w(e)}}}function h2(t){let e,n;return e=new BT({props:{iconDescription:t[7]}}),e.$on("click",t[11]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&128&&(r.iconDescription=i[7]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function BH(t){let e,n,i=t[10]&&d2(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,[r]){l[10]?i?(i.p(l,r),r&1024&&b(i,1)):(i=d2(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function zH(t,e,n){const i=["kind","lowContrast","timeout","role","title","subtitle","caption","statusIconDescription","closeButtonDescription","hideCloseButton","fullWidth"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{kind:o="error"}=e,{lowContrast:a=!1}=e,{timeout:u=0}=e,{role:f="alert"}=e,{title:c=""}=e,{subtitle:d=""}=e,{caption:h=""}=e,{statusIconDescription:g=o+" icon"}=e,{closeButtonDescription:_="Close notification"}=e,{hideCloseButton:v=!1}=e,{fullWidth:S=!1}=e;const A=yn();let C=!0,I;function M(D){A("close",{timeout:D===!0},{cancelable:!0})&&n(10,C=!1)}_n(()=>(u&&(I=setTimeout(()=>M(!0),u)),()=>{clearTimeout(I)}));function L(D){te.call(this,t,D)}function N(D){te.call(this,t,D)}function z(D){te.call(this,t,D)}function W(D){te.call(this,t,D)}return t.$$set=D=>{e=Y(Y({},e),Se(D)),n(12,l=ae(e,i)),"kind"in D&&n(0,o=D.kind),"lowContrast"in D&&n(1,a=D.lowContrast),"timeout"in D&&n(13,u=D.timeout),"role"in D&&n(2,f=D.role),"title"in D&&n(3,c=D.title),"subtitle"in D&&n(4,d=D.subtitle),"caption"in D&&n(5,h=D.caption),"statusIconDescription"in D&&n(6,g=D.statusIconDescription),"closeButtonDescription"in D&&n(7,_=D.closeButtonDescription),"hideCloseButton"in D&&n(8,v=D.hideCloseButton),"fullWidth"in D&&n(9,S=D.fullWidth),"$$scope"in D&&n(14,s=D.$$scope)},[o,a,f,c,d,h,g,_,v,S,C,M,l,u,s,r,L,N,z,W]}class HH extends De{constructor(e){super(),Re(this,e,zH,BH,Ie,{kind:0,lowContrast:1,timeout:13,role:2,title:3,subtitle:4,caption:5,statusIconDescription:6,closeButtonDescription:7,hideCloseButton:8,fullWidth:9})}}const UH=HH,FH=t=>({}),m2=t=>({}),GH=t=>({}),g2=t=>({}),VH=t=>({}),_2=t=>({});function p2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g;i=new zT({props:{notificationType:"inline",kind:t[0],iconDescription:t[6]}});const _=t[13].title,v=Ze(_,t,t[12],_2),S=v||WH(t),A=t[13].subtitle,C=Ze(A,t,t[12],g2),I=C||qH(t),M=t[13].default,L=Ze(M,t,t[12],null),N=t[13].actions,z=Ze(N,t,t[12],m2);let W=!t[5]&&b2(t),D=[{role:t[2]},{kind:t[0]},t[10]],G={};for(let $=0;${W=null}),ce()):W?(W.p($,j),j&32&&b(W,1)):(W=b2($),W.c(),b(W,1),W.m(e,null)),Ae(e,G=Ue(D,[(!d||j&4)&&{role:$[2]},(!d||j&1)&&{kind:$[0]},j&1024&&$[10]])),E(e,"bx--inline-notification",!0),E(e,"bx--inline-notification--low-contrast",$[1]),E(e,"bx--inline-notification--hide-close-button",$[5]),E(e,"bx--inline-notification--error",$[0]==="error"),E(e,"bx--inline-notification--info",$[0]==="info"),E(e,"bx--inline-notification--info-square",$[0]==="info-square"),E(e,"bx--inline-notification--success",$[0]==="success"),E(e,"bx--inline-notification--warning",$[0]==="warning"),E(e,"bx--inline-notification--warning-alt",$[0]==="warning-alt")},i($){d||(b(i.$$.fragment,$),b(S,$),b(I,$),b(L,$),b(z,$),b(W),d=!0)},o($){k(i.$$.fragment,$),k(S,$),k(I,$),k(L,$),k(z,$),k(W),d=!1},d($){$&&w(e),U(i),S&&S.d($),I&&I.d($),L&&L.d($),z&&z.d($),W&&W.d(),h=!1,vt(g)}}}function WH(t){let e;return{c(){e=q(t[3])},m(n,i){y(n,e,i)},p(n,i){i&8&&Z(e,n[3])},d(n){n&&w(e)}}}function qH(t){let e;return{c(){e=q(t[4])},m(n,i){y(n,e,i)},p(n,i){i&16&&Z(e,n[4])},d(n){n&&w(e)}}}function b2(t){let e,n;return e=new BT({props:{iconDescription:t[7],notificationType:"inline"}}),e.$on("click",t[9]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&128&&(r.iconDescription=i[7]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function jH(t){let e,n,i=t[8]&&p2(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,[r]){l[8]?i?(i.p(l,r),r&256&&b(i,1)):(i=p2(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function YH(t,e,n){const i=["kind","lowContrast","timeout","role","title","subtitle","hideCloseButton","statusIconDescription","closeButtonDescription"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{kind:o="error"}=e,{lowContrast:a=!1}=e,{timeout:u=0}=e,{role:f="alert"}=e,{title:c=""}=e,{subtitle:d=""}=e,{hideCloseButton:h=!1}=e,{statusIconDescription:g=o+" icon"}=e,{closeButtonDescription:_="Close notification"}=e;const v=yn();let S=!0,A;function C(z){v("close",{timeout:z===!0},{cancelable:!0})&&n(8,S=!1)}_n(()=>(u&&(A=setTimeout(()=>C(!0),u)),()=>{clearTimeout(A)}));function I(z){te.call(this,t,z)}function M(z){te.call(this,t,z)}function L(z){te.call(this,t,z)}function N(z){te.call(this,t,z)}return t.$$set=z=>{e=Y(Y({},e),Se(z)),n(10,l=ae(e,i)),"kind"in z&&n(0,o=z.kind),"lowContrast"in z&&n(1,a=z.lowContrast),"timeout"in z&&n(11,u=z.timeout),"role"in z&&n(2,f=z.role),"title"in z&&n(3,c=z.title),"subtitle"in z&&n(4,d=z.subtitle),"hideCloseButton"in z&&n(5,h=z.hideCloseButton),"statusIconDescription"in z&&n(6,g=z.statusIconDescription),"closeButtonDescription"in z&&n(7,_=z.closeButtonDescription),"$$scope"in z&&n(12,s=z.$$scope)},[o,a,f,c,d,h,g,_,S,C,l,u,s,r,I,M,L,N]}class ZH extends De{constructor(e){super(),Re(this,e,YH,jH,Ie,{kind:0,lowContrast:1,timeout:11,role:2,title:3,subtitle:4,hideCloseButton:5,statusIconDescription:6,closeButtonDescription:7})}}const xi=ZH;function v2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function XH(t){let e,n,i=t[1]&&v2(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class $H extends De{constructor(e){super(),Re(this,e,KH,XH,Ie,{size:0,title:1})}}const JH=$H,QH=t=>({}),k2=t=>({});function w2(t){let e,n;const i=t[26].labelText,l=Ze(i,t,t[25],k2),r=l||xH(t);return{c(){e=R("label"),r&&r.c(),P(e,"for",t[5]),E(e,"bx--label",!0),E(e,"bx--visually-hidden",t[14]),E(e,"bx--label--disabled",t[4])},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&33554432)&&Ke(l,i,s,s[25],n?Xe(i,s[25],o,QH):$e(s[25]),k2):r&&r.p&&(!n||o[0]&8192)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&32)&&P(e,"for",s[5]),(!n||o[0]&16384)&&E(e,"bx--visually-hidden",s[14]),(!n||o[0]&16)&&E(e,"bx--label--disabled",s[4])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function xH(t){let e;return{c(){e=q(t[13])},m(n,i){y(n,e,i)},p(n,i){i[0]&8192&&Z(e,n[13])},d(n){n&&w(e)}}}function y2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S;const A=t[26].default,C=Ze(A,t,t[25],null);u=new ga({props:{class:"bx--select__arrow"}});let I=t[7]&&T2(),M=t[7]&&S2(t),L=!t[7]&&!t[9]&&t[11]&&E2(t);return{c(){e=R("div"),n=R("div"),i=R("select"),C&&C.c(),a=B(),F(u.$$.fragment),f=B(),I&&I.c(),d=B(),M&&M.c(),h=B(),L&&L.c(),g=qe(),P(i,"aria-describedby",l=t[7]?t[16]:void 0),P(i,"aria-invalid",r=t[7]||void 0),i.disabled=s=t[4]||void 0,i.required=o=t[15]||void 0,P(i,"id",t[5]),P(i,"name",t[6]),E(i,"bx--select-input",!0),E(i,"bx--select-input--sm",t[1]==="sm"),E(i,"bx--select-input--xl",t[1]==="xl"),P(n,"data-invalid",c=t[7]||void 0),E(n,"bx--select-input__wrapper",!0),E(e,"bx--select-input--inline__wrapper",!0)},m(N,z){y(N,e,z),T(e,n),T(n,i),C&&C.m(i,null),t[35](i),T(n,a),H(u,n,null),T(n,f),I&&I.m(n,null),T(e,d),M&&M.m(e,null),y(N,h,z),L&&L.m(N,z),y(N,g,z),_=!0,v||(S=[J(i,"change",t[21]),J(i,"change",t[31]),J(i,"input",t[32]),J(i,"focus",t[33]),J(i,"blur",t[34])],v=!0)},p(N,z){C&&C.p&&(!_||z[0]&33554432)&&Ke(C,A,N,N[25],_?Xe(A,N[25],z,null):$e(N[25]),null),(!_||z[0]&65664&&l!==(l=N[7]?N[16]:void 0))&&P(i,"aria-describedby",l),(!_||z[0]&128&&r!==(r=N[7]||void 0))&&P(i,"aria-invalid",r),(!_||z[0]&16&&s!==(s=N[4]||void 0))&&(i.disabled=s),(!_||z[0]&32768&&o!==(o=N[15]||void 0))&&(i.required=o),(!_||z[0]&32)&&P(i,"id",N[5]),(!_||z[0]&64)&&P(i,"name",N[6]),(!_||z[0]&2)&&E(i,"bx--select-input--sm",N[1]==="sm"),(!_||z[0]&2)&&E(i,"bx--select-input--xl",N[1]==="xl"),N[7]?I?z[0]&128&&b(I,1):(I=T2(),I.c(),b(I,1),I.m(n,null)):I&&(fe(),k(I,1,1,()=>{I=null}),ce()),(!_||z[0]&128&&c!==(c=N[7]||void 0))&&P(n,"data-invalid",c),N[7]?M?M.p(N,z):(M=S2(N),M.c(),M.m(e,null)):M&&(M.d(1),M=null),!N[7]&&!N[9]&&N[11]?L?L.p(N,z):(L=E2(N),L.c(),L.m(g.parentNode,g)):L&&(L.d(1),L=null)},i(N){_||(b(C,N),b(u.$$.fragment,N),b(I),_=!0)},o(N){k(C,N),k(u.$$.fragment,N),k(I),_=!1},d(N){N&&(w(e),w(h),w(g)),C&&C.d(N),t[35](null),U(u),I&&I.d(),M&&M.d(),L&&L.d(N),v=!1,vt(S)}}}function T2(t){let e,n;return e=new Os({props:{class:"bx--select__invalid-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function S2(t){let e,n;return{c(){e=R("div"),n=q(t[8]),P(e,"id",t[16]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&256&&Z(n,i[8]),l[0]&65536&&P(e,"id",i[16])},d(i){i&&w(e)}}}function E2(t){let e,n;return{c(){e=R("div"),n=q(t[11]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[4])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&2048&&Z(n,i[11]),l[0]&16&&E(e,"bx--form__helper-text--disabled",i[4])},d(i){i&&w(e)}}}function M2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A;const C=t[26].default,I=Ze(C,t,t[25],null);a=new ga({props:{class:"bx--select__arrow"}});let M=t[7]&&O2(),L=!t[7]&&t[9]&&A2(),N=!t[7]&&t[11]&&C2(t),z=t[7]&&L2(t),W=!t[7]&&t[9]&&I2(t);return{c(){e=R("div"),n=R("select"),I&&I.c(),o=B(),F(a.$$.fragment),u=B(),M&&M.c(),f=B(),L&&L.c(),d=B(),N&&N.c(),h=B(),z&&z.c(),g=B(),W&&W.c(),_=qe(),P(n,"id",t[5]),P(n,"name",t[6]),P(n,"aria-describedby",i=t[7]?t[16]:void 0),n.disabled=l=t[4]||void 0,n.required=r=t[15]||void 0,P(n,"aria-invalid",s=t[7]||void 0),E(n,"bx--select-input",!0),E(n,"bx--select-input--sm",t[1]==="sm"),E(n,"bx--select-input--xl",t[1]==="xl"),P(e,"data-invalid",c=t[7]||void 0),E(e,"bx--select-input__wrapper",!0)},m(D,G){y(D,e,G),T(e,n),I&&I.m(n,null),t[36](n),T(e,o),H(a,e,null),T(e,u),M&&M.m(e,null),T(e,f),L&&L.m(e,null),y(D,d,G),N&&N.m(D,G),y(D,h,G),z&&z.m(D,G),y(D,g,G),W&&W.m(D,G),y(D,_,G),v=!0,S||(A=[J(n,"change",t[21]),J(n,"change",t[27]),J(n,"input",t[28]),J(n,"focus",t[29]),J(n,"blur",t[30])],S=!0)},p(D,G){I&&I.p&&(!v||G[0]&33554432)&&Ke(I,C,D,D[25],v?Xe(C,D[25],G,null):$e(D[25]),null),(!v||G[0]&32)&&P(n,"id",D[5]),(!v||G[0]&64)&&P(n,"name",D[6]),(!v||G[0]&65664&&i!==(i=D[7]?D[16]:void 0))&&P(n,"aria-describedby",i),(!v||G[0]&16&&l!==(l=D[4]||void 0))&&(n.disabled=l),(!v||G[0]&32768&&r!==(r=D[15]||void 0))&&(n.required=r),(!v||G[0]&128&&s!==(s=D[7]||void 0))&&P(n,"aria-invalid",s),(!v||G[0]&2)&&E(n,"bx--select-input--sm",D[1]==="sm"),(!v||G[0]&2)&&E(n,"bx--select-input--xl",D[1]==="xl"),D[7]?M?G[0]&128&&b(M,1):(M=O2(),M.c(),b(M,1),M.m(e,f)):M&&(fe(),k(M,1,1,()=>{M=null}),ce()),!D[7]&&D[9]?L?G[0]&640&&b(L,1):(L=A2(),L.c(),b(L,1),L.m(e,null)):L&&(fe(),k(L,1,1,()=>{L=null}),ce()),(!v||G[0]&128&&c!==(c=D[7]||void 0))&&P(e,"data-invalid",c),!D[7]&&D[11]?N?N.p(D,G):(N=C2(D),N.c(),N.m(h.parentNode,h)):N&&(N.d(1),N=null),D[7]?z?z.p(D,G):(z=L2(D),z.c(),z.m(g.parentNode,g)):z&&(z.d(1),z=null),!D[7]&&D[9]?W?W.p(D,G):(W=I2(D),W.c(),W.m(_.parentNode,_)):W&&(W.d(1),W=null)},i(D){v||(b(I,D),b(a.$$.fragment,D),b(M),b(L),v=!0)},o(D){k(I,D),k(a.$$.fragment,D),k(M),k(L),v=!1},d(D){D&&(w(e),w(d),w(h),w(g),w(_)),I&&I.d(D),t[36](null),U(a),M&&M.d(),L&&L.d(),N&&N.d(D),z&&z.d(D),W&&W.d(D),S=!1,vt(A)}}}function O2(t){let e,n;return e=new Os({props:{class:"bx--select__invalid-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function A2(t){let e,n;return e=new Lu({props:{class:"bx--select__invalid-icon bx--select__invalid-icon--warning"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function C2(t){let e,n;return{c(){e=R("div"),n=q(t[11]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[4])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&2048&&Z(n,i[11]),l[0]&16&&E(e,"bx--form__helper-text--disabled",i[4])},d(i){i&&w(e)}}}function L2(t){let e,n;return{c(){e=R("div"),n=q(t[8]),P(e,"id",t[16]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&256&&Z(n,i[8]),l[0]&65536&&P(e,"id",i[16])},d(i){i&&w(e)}}}function I2(t){let e,n;return{c(){e=R("div"),n=q(t[10]),P(e,"id",t[16]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&1024&&Z(n,i[10]),l[0]&65536&&P(e,"id",i[16])},d(i){i&&w(e)}}}function eU(t){let e,n,i,l,r,s=!t[12]&&w2(t),o=t[2]&&y2(t),a=!t[2]&&M2(t),u=[t[22]],f={};for(let c=0;c{s=null}),ce()):s?(s.p(c,d),d[0]&4096&&b(s,1)):(s=w2(c),s.c(),b(s,1),s.m(n,i)),c[2]?o?(o.p(c,d),d[0]&4&&b(o,1)):(o=y2(c),o.c(),b(o,1),o.m(n,l)):o&&(fe(),k(o,1,1,()=>{o=null}),ce()),c[2]?a&&(fe(),k(a,1,1,()=>{a=null}),ce()):a?(a.p(c,d),d[0]&4&&b(a,1)):(a=M2(c),a.c(),b(a,1),a.m(n,null)),(!r||d[0]&4)&&E(n,"bx--select--inline",c[2]),(!r||d[0]&8)&&E(n,"bx--select--light",c[3]),(!r||d[0]&128)&&E(n,"bx--select--invalid",c[7]),(!r||d[0]&16)&&E(n,"bx--select--disabled",c[4]),(!r||d[0]&512)&&E(n,"bx--select--warning",c[9]),Ae(e,f=Ue(u,[d[0]&4194304&&c[22]])),E(e,"bx--form-item",!0)},i(c){r||(b(s),b(o),b(a),r=!0)},o(c){k(s),k(o),k(a),r=!1},d(c){c&&w(e),s&&s.d(),o&&o.d(),a&&a.d()}}}function tU(t,e,n){let i;const l=["selected","size","inline","light","disabled","id","name","invalid","invalidText","warn","warnText","helperText","noLabel","labelText","hideLabel","ref","required"];let r=ae(e,l),s,o,a,u,{$$slots:f={},$$scope:c}=e,{selected:d=void 0}=e,{size:h=void 0}=e,{inline:g=!1}=e,{light:_=!1}=e,{disabled:v=!1}=e,{id:S="ccs-"+Math.random().toString(36)}=e,{name:A=void 0}=e,{invalid:C=!1}=e,{invalidText:I=""}=e,{warn:M=!1}=e,{warnText:L=""}=e,{helperText:N=""}=e,{noLabel:z=!1}=e,{labelText:W=""}=e,{hideLabel:D=!1}=e,{ref:G=null}=e,{required:$=!1}=e;const j=yn(),Q=un(d);Mt(t,Q,ve=>n(38,o=ve));const le=un(null);Mt(t,le,ve=>n(40,u=ve));const oe=un(null);Mt(t,oe,ve=>n(24,s=ve));const X=un({});Mt(t,X,ve=>n(39,a=ve)),Wi("Select",{selectedValue:Q,setDefaultValue:(ve,be)=>{s===null?(le.set(ve),oe.set(be)):u===ve&&Q.set(be),X.update(ue=>({...ue,[be]:typeof be}))}});const de=({target:ve})=>{let be=ve.value;a[be]==="number"&&(be=Number(be)),Q.set(be)};let re;Cl(()=>{n(23,d=o),re!==void 0&&d!==re&&j("update",o),re=d});function x(ve){te.call(this,t,ve)}function me(ve){te.call(this,t,ve)}function ee(ve){te.call(this,t,ve)}function ke(ve){te.call(this,t,ve)}function pe(ve){te.call(this,t,ve)}function Fe(ve){te.call(this,t,ve)}function Ve(ve){te.call(this,t,ve)}function Ee(ve){te.call(this,t,ve)}function We(ve){ft[ve?"unshift":"push"](()=>{G=ve,n(0,G)})}function ge(ve){ft[ve?"unshift":"push"](()=>{G=ve,n(0,G)})}return t.$$set=ve=>{e=Y(Y({},e),Se(ve)),n(22,r=ae(e,l)),"selected"in ve&&n(23,d=ve.selected),"size"in ve&&n(1,h=ve.size),"inline"in ve&&n(2,g=ve.inline),"light"in ve&&n(3,_=ve.light),"disabled"in ve&&n(4,v=ve.disabled),"id"in ve&&n(5,S=ve.id),"name"in ve&&n(6,A=ve.name),"invalid"in ve&&n(7,C=ve.invalid),"invalidText"in ve&&n(8,I=ve.invalidText),"warn"in ve&&n(9,M=ve.warn),"warnText"in ve&&n(10,L=ve.warnText),"helperText"in ve&&n(11,N=ve.helperText),"noLabel"in ve&&n(12,z=ve.noLabel),"labelText"in ve&&n(13,W=ve.labelText),"hideLabel"in ve&&n(14,D=ve.hideLabel),"ref"in ve&&n(0,G=ve.ref),"required"in ve&&n(15,$=ve.required),"$$scope"in ve&&n(25,c=ve.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&32&&n(16,i=`error-${S}`),t.$$.dirty[0]&25165824&&Q.set(d??s)},[G,h,g,_,v,S,A,C,I,M,L,N,z,W,D,$,i,Q,le,oe,X,de,r,d,s,c,f,x,me,ee,ke,pe,Fe,Ve,Ee,We,ge]}class nU extends De{constructor(e){super(),Re(this,e,tU,eU,Ie,{selected:23,size:1,inline:2,light:3,disabled:4,id:5,name:6,invalid:7,invalidText:8,warn:9,warnText:10,helperText:11,noLabel:12,labelText:13,hideLabel:14,ref:0,required:15},null,[-1,-1])}}const wr=nU;function iU(t){let e,n=(t[1]||t[0])+"",i,l,r;return{c(){e=R("option"),i=q(n),e.__value=t[0],Wl(e,e.__value),e.disabled=t[3],e.hidden=t[2],e.selected=t[4],P(e,"class",l=t[5].class),P(e,"style",r=t[5].style),E(e,"bx--select-option",!0)},m(s,o){y(s,e,o),T(e,i)},p(s,[o]){o&3&&n!==(n=(s[1]||s[0])+"")&&Z(i,n),o&1&&(e.__value=s[0],Wl(e,e.__value)),o&8&&(e.disabled=s[3]),o&4&&(e.hidden=s[2]),o&16&&(e.selected=s[4]),o&32&&l!==(l=s[5].class)&&P(e,"class",l),o&32&&r!==(r=s[5].style)&&P(e,"style",r),o&32&&E(e,"bx--select-option",!0)},i:he,o:he,d(s){s&&w(e)}}}function lU(t,e,n){const i=["value","text","hidden","disabled"];let l=ae(e,i),{value:r=""}=e,{text:s=""}=e,{hidden:o=!1}=e,{disabled:a=!1}=e;const u="ccs-"+Math.random().toString(36),f=bi("Select")||bi("TimePickerSelect");let c=!1;const d=f.selectedValue.subscribe(h=>{n(4,c=h===r)});return _n(()=>()=>d()),t.$$set=h=>{e=Y(Y({},e),Se(h)),n(5,l=ae(e,i)),"value"in h&&n(0,r=h.value),"text"in h&&n(1,s=h.text),"hidden"in h&&n(2,o=h.hidden),"disabled"in h&&n(3,a=h.disabled)},t.$$.update=()=>{var h;t.$$.dirty&1&&((h=f==null?void 0:f.setDefaultValue)==null||h.call(f,u,r))},[r,s,o,a,c,l]}class rU extends De{constructor(e){super(),Re(this,e,lU,iU,Ie,{value:0,text:1,hidden:2,disabled:3})}}const Ln=rU;function sU(t){let e,n,i,l;const r=t[7].default,s=Ze(r,t,t[6],null);let o=[t[3]],a={};for(let u=0;uI.reduce((M,L)=>({...M,[L.id]:L}),{}));Mt(t,g,I=>n(12,r=I));const _=un(c);Wi("ProgressIndicator",{steps:h,stepsById:g,preventChangeOnClick:{subscribe:_.subscribe},add:I=>{h.update(M=>I.id in r?M.map(L=>L.id===I.id?{...L,...I}:L):[...M,{...I,index:M.length,current:M.length===a,complete:I.complete}])},change:I=>{c||(n(4,a=I),d("change",I))}});function v(I){te.call(this,t,I)}function S(I){te.call(this,t,I)}function A(I){te.call(this,t,I)}function C(I){te.call(this,t,I)}return t.$$set=I=>{e=Y(Y({},e),Se(I)),n(3,l=ae(e,i)),"currentIndex"in I&&n(4,a=I.currentIndex),"vertical"in I&&n(0,u=I.vertical),"spaceEqually"in I&&n(1,f=I.spaceEqually),"preventChangeOnClick"in I&&n(5,c=I.preventChangeOnClick),"$$scope"in I&&n(6,o=I.$$scope)},t.$$.update=()=>{t.$$.dirty&16&&h.update(I=>I.map((M,L)=>({...M,current:L===a}))),t.$$.dirty&32&&_.set(c)},[u,f,g,l,a,c,o,s,v,S,A,C]}class aU extends De{constructor(e){super(),Re(this,e,oU,sU,Ie,{currentIndex:4,vertical:0,spaceEqually:1,preventChangeOnClick:5})}}const uU=aU;function R2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function fU(t){let e,n,i,l=t[1]&&R2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class dU extends De{constructor(e){super(),Re(this,e,cU,fU,Ie,{size:0,title:1})}}const hU=dU;function D2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function mU(t){let e,n,i,l=t[1]&&D2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class _U extends De{constructor(e){super(),Re(this,e,gU,mU,Ie,{size:0,title:1})}}const pU=_U;function P2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function bU(t){let e,n,i=t[1]&&P2(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class kU extends De{constructor(e){super(),Re(this,e,vU,bU,Ie,{size:0,title:1})}}const wU=kU;function N2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function yU(t){let e,n,i=t[1]&&N2(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class SU extends De{constructor(e){super(),Re(this,e,TU,yU,Ie,{size:0,title:1})}}const EU=SU,MU=t=>({}),B2=t=>({props:{class:"bx--progress-label"}});function OU(t){let e,n;return e=new wU({props:{title:t[4]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function AU(t){let e,n;return e=new hU({props:{title:t[4]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function CU(t){let e,n;return e=new EU({props:{title:t[4]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function LU(t){let e,n;return e=new pU({props:{class:"bx--progress__warning",title:t[4]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function IU(t){let e,n;return{c(){e=R("p"),n=q(t[5]),E(e,"bx--progress-label",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&32&&Z(n,i[5])},d(i){i&&w(e)}}}function z2(t){let e,n;return{c(){e=R("p"),n=q(t[6]),E(e,"bx--progress-optional",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&64&&Z(n,i[6])},d(i){i&&w(e)}}}function RU(t){let e,n,i,l,r,s,o,a,u,f,c,d,h;const g=[LU,CU,AU,OU],_=[];function v(N,z){return N[3]?0:N[1]?1:N[0]?2:3}i=v(t),l=_[i]=g[i](t);const S=t[14].default,A=Ze(S,t,t[13],B2),C=A||IU(t);let I=t[6]&&z2(t),M=[{id:t[7]},t[12]],L={};for(let N=0;N{_[W]=null}),ce(),l=_[i],l?l.p(N,z):(l=_[i]=g[i](N),l.c()),b(l,1),l.m(n,r)),A?A.p&&(!c||z&8192)&&Ke(A,S,N,N[13],c?Xe(S,N[13],z,MU):$e(N[13]),B2):C&&C.p&&(!c||z&32)&&C.p(N,c?z:-1),N[6]?I?I.p(N,z):(I=z2(N),I.c(),I.m(s,null)):I&&(I.d(1),I=null),(!c||z&4)&&(n.disabled=N[2]),(!c||z&4)&&P(n,"aria-disabled",N[2]),(!c||z&6&&f!==(f=!N[1]&&!N[2]?"0":"-1"))&&P(n,"tabindex",f),(!c||z&514)&&E(n,"bx--progress-step-button--unclickable",N[1]||N[9]),Ae(e,L=Ue(M,[(!c||z&128)&&{id:N[7]},z&4096&&N[12]])),E(e,"bx--progress-step",!0),E(e,"bx--progress-step--current",N[1]),E(e,"bx--progress-step--complete",N[0]),E(e,"bx--progress-step--incomplete",!N[0]&&!N[1]),E(e,"bx--progress-step--disabled",N[2])},i(N){c||(b(l),b(C,N),c=!0)},o(N){k(l),k(C,N),c=!1},d(N){N&&w(e),_[i].d(),C&&C.d(N),I&&I.d(),d=!1,vt(h)}}}function DU(t,e,n){const i=["complete","current","disabled","invalid","description","label","secondaryLabel","id"];let l=ae(e,i),r,{$$slots:s={},$$scope:o}=e,{complete:a=!1}=e,{current:u=!1}=e,{disabled:f=!1}=e,{invalid:c=!1}=e,{description:d=""}=e,{label:h=""}=e,{secondaryLabel:g=""}=e,{id:_="ccs-"+Math.random().toString(36)}=e,v={};const{stepsById:S,add:A,change:C,preventChangeOnClick:I}=bi("ProgressIndicator");Mt(t,I,j=>n(9,r=j));const M=S.subscribe(j=>{j[_]&&(n(8,v=j[_]),n(1,u=v.current),n(0,a=v.complete))});_n(()=>()=>{M()});function L(j){te.call(this,t,j)}function N(j){te.call(this,t,j)}function z(j){te.call(this,t,j)}function W(j){te.call(this,t,j)}function D(j){te.call(this,t,j)}const G=()=>{v.complete&&C(v.index)},$=j=>{v.complete&&(j.key===" "||j.key==="Enter")&&C(v.index)};return t.$$set=j=>{e=Y(Y({},e),Se(j)),n(12,l=ae(e,i)),"complete"in j&&n(0,a=j.complete),"current"in j&&n(1,u=j.current),"disabled"in j&&n(2,f=j.disabled),"invalid"in j&&n(3,c=j.invalid),"description"in j&&n(4,d=j.description),"label"in j&&n(5,h=j.label),"secondaryLabel"in j&&n(6,g=j.secondaryLabel),"id"in j&&n(7,_=j.id),"$$scope"in j&&n(13,o=j.$$scope)},t.$$.update=()=>{t.$$.dirty&133&&A({id:_,complete:a,disabled:f})},[a,u,f,c,d,h,g,_,v,r,C,I,l,o,s,L,N,z,W,D,G,$]}class PU extends De{constructor(e){super(),Re(this,e,DU,RU,Ie,{complete:0,current:1,disabled:2,invalid:3,description:4,label:5,secondaryLabel:6,id:7})}}const NU=PU,BU=t=>({}),H2=t=>({});function U2(t){let e,n;const i=t[11].legendText,l=Ze(i,t,t[10],H2),r=l||zU(t);return{c(){e=R("legend"),r&&r.c(),E(e,"bx--label",!0),E(e,"bx--visually-hidden",t[2])},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&1024)&&Ke(l,i,s,s[10],n?Xe(i,s[10],o,BU):$e(s[10]),H2):r&&r.p&&(!n||o&2)&&r.p(s,n?o:-1),(!n||o&4)&&E(e,"bx--visually-hidden",s[2])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function zU(t){let e;return{c(){e=q(t[1])},m(n,i){y(n,e,i)},p(n,i){i&2&&Z(e,n[1])},d(n){n&&w(e)}}}function HU(t){let e,n,i,l,r,s,o=(t[1]||t[8].legendText)&&U2(t);const a=t[11].default,u=Ze(a,t,t[10],null);let f=[{id:t[5]},t[7]],c={};for(let d=0;d{o=null}),ce()),u&&u.p&&(!l||h&1024)&&Ke(u,a,d,d[10],l?Xe(a,d[10],h,null):$e(d[10]),null),(!l||h&1)&&(n.disabled=d[0]),(!l||h&16)&&E(n,"bx--radio-button-group--vertical",d[4]==="vertical"),(!l||h&8)&&E(n,"bx--radio-button-group--label-left",d[3]==="left"),(!l||h&8)&&E(n,"bx--radio-button-group--label-right",d[3]==="right"),Ae(e,c=Ue(f,[(!l||h&32)&&{id:d[5]},h&128&&d[7]])),E(e,"bx--form-item",!0)},i(d){l||(b(o),b(u,d),l=!0)},o(d){k(o),k(u,d),l=!1},d(d){d&&w(e),o&&o.d(),u&&u.d(d),r=!1,vt(s)}}}function UU(t,e,n){const i=["selected","disabled","legendText","hideLegend","labelPosition","orientation","id"];let l=ae(e,i),r,{$$slots:s={},$$scope:o}=e;const a=Yi(s);let{selected:u=void 0}=e,{disabled:f=!1}=e,{legendText:c=""}=e,{hideLegend:d=!1}=e,{labelPosition:h="right"}=e,{orientation:g="horizontal"}=e,{id:_=void 0}=e;const v=yn(),S=un(u);Mt(t,S,L=>n(16,r=L)),Wi("RadioButtonGroup",{selectedValue:S,add:({checked:L,value:N})=>{L&&S.set(N)},update:L=>{n(9,u=L)}}),_n(()=>{Js(S,r=u,r)}),VI(()=>{Js(S,r=u,r)}),S.subscribe(L=>{n(9,u=L),v("change",L)});function A(L){te.call(this,t,L)}function C(L){te.call(this,t,L)}function I(L){te.call(this,t,L)}function M(L){te.call(this,t,L)}return t.$$set=L=>{e=Y(Y({},e),Se(L)),n(7,l=ae(e,i)),"selected"in L&&n(9,u=L.selected),"disabled"in L&&n(0,f=L.disabled),"legendText"in L&&n(1,c=L.legendText),"hideLegend"in L&&n(2,d=L.hideLegend),"labelPosition"in L&&n(3,h=L.labelPosition),"orientation"in L&&n(4,g=L.orientation),"id"in L&&n(5,_=L.id),"$$scope"in L&&n(10,o=L.$$scope)},[f,c,d,h,g,_,S,l,a,u,o,s,A,C,I,M]}class FU extends De{constructor(e){super(),Re(this,e,UU,HU,Ie,{selected:9,disabled:0,legendText:1,hideLegend:2,labelPosition:3,orientation:4,id:5})}}const HT=FU;function GU(t){let e,n,i,l;const r=t[8].default,s=Ze(r,t,t[7],null);let o=[{role:"table"},t[4]],a={};for(let u=0;un(6,r=A)),Wi("StructuredListWrapper",{selectedValue:h,update:A=>{h.set(A)}});function g(A){te.call(this,t,A)}function _(A){te.call(this,t,A)}function v(A){te.call(this,t,A)}function S(A){te.call(this,t,A)}return t.$$set=A=>{e=Y(Y({},e),Se(A)),n(4,l=ae(e,i)),"selected"in A&&n(5,a=A.selected),"condensed"in A&&n(0,u=A.condensed),"flush"in A&&n(1,f=A.flush),"selection"in A&&n(2,c=A.selection),"$$scope"in A&&n(7,o=A.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&n(5,a=r),t.$$.dirty&64&&d("change",r)},[u,f,c,h,l,a,r,o,s,g,_,v,S]}class WU extends De{constructor(e){super(),Re(this,e,VU,GU,Ie,{selected:5,condensed:0,flush:1,selection:2})}}const gu=WU;function qU(t){let e,n,i,l;const r=t[2].default,s=Ze(r,t,t[1],null);let o=[{role:"rowgroup"},t[0]],a={};for(let u=0;u{e=Y(Y({},e),Se(c)),n(0,l=ae(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class YU extends De{constructor(e){super(),Re(this,e,jU,qU,Ie,{})}}const Nu=YU;function ZU(t){let e,n,i,l;const r=t[2].default,s=Ze(r,t,t[1],null);let o=[{role:"rowgroup"},t[0]],a={};for(let u=0;u{e=Y(Y({},e),Se(c)),n(0,l=ae(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class KU extends De{constructor(e){super(),Re(this,e,XU,ZU,Ie,{})}}const UT=KU;function $U(t){let e,n,i,l,r;const s=t[4].default,o=Ze(s,t,t[3],null);let a=[{role:n=t[0]?"columnheader":"cell"},t[2]],u={};for(let f=0;f{e=Y(Y({},e),Se(h)),n(2,l=ae(e,i)),"head"in h&&n(0,o=h.head),"noWrap"in h&&n(1,a=h.noWrap),"$$scope"in h&&n(3,s=h.$$scope)},[o,a,l,s,r,u,f,c,d]}class QU extends De{constructor(e){super(),Re(this,e,JU,$U,Ie,{head:0,noWrap:1})}}const Zt=QU;function xU(t){let e,n,i,l;const r=t[5].default,s=Ze(r,t,t[4],null);let o=[{role:"row"},t[3]],a={};for(let u=0;u{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function nF(t,e,n){const i=["head","label","tabindex"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{head:o=!1}=e,{label:a=!1}=e,{tabindex:u="0"}=e;function f(C){te.call(this,t,C)}function c(C){te.call(this,t,C)}function d(C){te.call(this,t,C)}function h(C){te.call(this,t,C)}function g(C){te.call(this,t,C)}function _(C){te.call(this,t,C)}function v(C){te.call(this,t,C)}function S(C){te.call(this,t,C)}function A(C){te.call(this,t,C)}return t.$$set=C=>{e=Y(Y({},e),Se(C)),n(3,l=ae(e,i)),"head"in C&&n(0,o=C.head),"label"in C&&n(1,a=C.label),"tabindex"in C&&n(2,u=C.tabindex),"$$scope"in C&&n(4,s=C.$$scope)},[o,a,u,l,s,r,f,c,d,h,g,_,v,S,A]}class iF extends De{constructor(e){super(),Re(this,e,nF,tF,Ie,{head:0,label:1,tabindex:2})}}const Zn=iF;function lF(t){let e,n,i,l=[t[1]],r={};for(let s=0;s{e=Y(Y({},e),Se(f)),n(1,l=ae(e,i)),"size"in f&&n(0,r=f.size)},[r,l,s,o,a,u]}class sF extends De{constructor(e){super(),Re(this,e,rF,lF,Ie,{size:0})}}const oF=sF,aF=t=>({}),F2=t=>({}),uF=t=>({}),G2=t=>({}),fF=t=>({}),V2=t=>({props:{class:"bx--tag__label"}});function cF(t){let e,n,i,l,r,s,o=(t[11].icon||t[7])&&W2(t);const a=t[13].default,u=Ze(a,t,t[12],null);let f=[{id:t[8]},t[10]],c={};for(let d=0;d{o=null}),ce()),u&&u.p&&(!l||h&4096)&&Ke(u,a,d,d[12],l?Xe(a,d[12],h,null):$e(d[12]),null),Ae(e,c=Ue(f,[(!l||h&256)&&{id:d[8]},h&1024&&d[10]])),E(e,"bx--tag",!0),E(e,"bx--tag--disabled",d[3]),E(e,"bx--tag--sm",d[1]==="sm"),E(e,"bx--tag--red",d[0]==="red"),E(e,"bx--tag--magenta",d[0]==="magenta"),E(e,"bx--tag--purple",d[0]==="purple"),E(e,"bx--tag--blue",d[0]==="blue"),E(e,"bx--tag--cyan",d[0]==="cyan"),E(e,"bx--tag--teal",d[0]==="teal"),E(e,"bx--tag--green",d[0]==="green"),E(e,"bx--tag--gray",d[0]==="gray"),E(e,"bx--tag--cool-gray",d[0]==="cool-gray"),E(e,"bx--tag--warm-gray",d[0]==="warm-gray"),E(e,"bx--tag--high-contrast",d[0]==="high-contrast"),E(e,"bx--tag--outline",d[0]==="outline")},i(d){l||(b(o),b(u,d),l=!0)},o(d){k(o),k(u,d),l=!1},d(d){d&&w(e),o&&o.d(),u&&u.d(d),r=!1,vt(s)}}}function dF(t){let e,n,i,l,r,s,o,a=(t[11].icon||t[7])&&q2(t);const u=t[13].default,f=Ze(u,t,t[12],null);let c=[{type:"button"},{id:t[8]},{disabled:t[3]},{"aria-disabled":t[3]},{tabindex:l=t[3]?"-1":void 0},t[10]],d={};for(let h=0;h{a=null}),ce()),f&&f.p&&(!r||g&4096)&&Ke(f,u,h,h[12],r?Xe(u,h[12],g,null):$e(h[12]),null),Ae(e,d=Ue(c,[{type:"button"},(!r||g&256)&&{id:h[8]},(!r||g&8)&&{disabled:h[3]},(!r||g&8)&&{"aria-disabled":h[3]},(!r||g&8&&l!==(l=h[3]?"-1":void 0))&&{tabindex:l},g&1024&&h[10]])),E(e,"bx--tag",!0),E(e,"bx--tag--interactive",!0),E(e,"bx--tag--disabled",h[3]),E(e,"bx--tag--sm",h[1]==="sm"),E(e,"bx--tag--red",h[0]==="red"),E(e,"bx--tag--magenta",h[0]==="magenta"),E(e,"bx--tag--purple",h[0]==="purple"),E(e,"bx--tag--blue",h[0]==="blue"),E(e,"bx--tag--cyan",h[0]==="cyan"),E(e,"bx--tag--teal",h[0]==="teal"),E(e,"bx--tag--green",h[0]==="green"),E(e,"bx--tag--gray",h[0]==="gray"),E(e,"bx--tag--cool-gray",h[0]==="cool-gray"),E(e,"bx--tag--warm-gray",h[0]==="warm-gray"),E(e,"bx--tag--high-contrast",h[0]==="high-contrast"),E(e,"bx--tag--outline",h[0]==="outline")},i(h){r||(b(a),b(f,h),r=!0)},o(h){k(a),k(f,h),r=!1},d(h){h&&w(e),a&&a.d(),f&&f.d(h),s=!1,vt(o)}}}function hF(t){let e,n,i,l,r,s,o;const a=t[13].default,u=Ze(a,t,t[12],V2),f=u||pF(t);l=new ql({});let c=[{"aria-label":t[6]},{id:t[8]},t[10]],d={};for(let h=0;h{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function q2(t){let e,n;const i=t[13].icon,l=Ze(i,t,t[12],G2),r=l||_F(t);return{c(){e=R("div"),r&&r.c(),E(e,"bx--tag__custom-icon",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&4096)&&Ke(l,i,s,s[12],n?Xe(i,s[12],o,uF):$e(s[12]),G2):r&&r.p&&(!n||o&128)&&r.p(s,n?o:-1)},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function _F(t){let e,n,i;var l=t[7];function r(s,o){return{}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&128&&l!==(l=s[7])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function pF(t){let e,n;return{c(){e=R("span"),n=q(t[0]),E(e,"bx--tag__label",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&1&&Z(n,i[0])},d(i){i&&w(e)}}}function bF(t){let e,n,i,l;const r=[mF,hF,dF,cF],s=[];function o(a,u){return a[5]?0:a[2]?1:a[4]?2:3}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,[u]){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function vF(t,e,n){const i=["type","size","filter","disabled","interactive","skeleton","title","icon","id"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e;const o=Yi(r);let{type:a=void 0}=e,{size:u="default"}=e,{filter:f=!1}=e,{disabled:c=!1}=e,{interactive:d=!1}=e,{skeleton:h=!1}=e,{title:g="Clear filter"}=e,{icon:_=void 0}=e,{id:v="ccs-"+Math.random().toString(36)}=e;const S=yn();function A(re){te.call(this,t,re)}function C(re){te.call(this,t,re)}function I(re){te.call(this,t,re)}function M(re){te.call(this,t,re)}function L(re){te.call(this,t,re)}function N(re){te.call(this,t,re)}function z(re){te.call(this,t,re)}function W(re){te.call(this,t,re)}function D(re){te.call(this,t,re)}function G(re){te.call(this,t,re)}function $(re){te.call(this,t,re)}function j(re){te.call(this,t,re)}function Q(re){te.call(this,t,re)}function le(re){te.call(this,t,re)}function oe(re){te.call(this,t,re)}function X(re){te.call(this,t,re)}const de=()=>{S("close")};return t.$$set=re=>{e=Y(Y({},e),Se(re)),n(10,l=ae(e,i)),"type"in re&&n(0,a=re.type),"size"in re&&n(1,u=re.size),"filter"in re&&n(2,f=re.filter),"disabled"in re&&n(3,c=re.disabled),"interactive"in re&&n(4,d=re.interactive),"skeleton"in re&&n(5,h=re.skeleton),"title"in re&&n(6,g=re.title),"icon"in re&&n(7,_=re.icon),"id"in re&&n(8,v=re.id),"$$scope"in re&&n(12,s=re.$$scope)},[a,u,f,c,d,h,g,_,v,S,l,o,s,r,A,C,I,M,L,N,z,W,D,G,$,j,Q,le,oe,X,de]}class kF extends De{constructor(e){super(),Re(this,e,vF,bF,Ie,{type:0,size:1,filter:2,disabled:3,interactive:4,skeleton:5,title:6,icon:7,id:8})}}const Vt=kF,wF=t=>({}),j2=t=>({});function Y2(t){let e,n,i,l;const r=t[20].labelText,s=Ze(r,t,t[19],j2),o=s||yF(t);let a=t[5]&&Z2(t);return{c(){e=R("div"),n=R("label"),o&&o.c(),i=B(),a&&a.c(),P(n,"for",t[14]),E(n,"bx--label",!0),E(n,"bx--visually-hidden",t[11]),E(n,"bx--label--disabled",t[7]),E(e,"bx--text-area__label-wrapper",!0)},m(u,f){y(u,e,f),T(e,n),o&&o.m(n,null),T(e,i),a&&a.m(e,null),l=!0},p(u,f){s?s.p&&(!l||f[0]&524288)&&Ke(s,r,u,u[19],l?Xe(r,u[19],f,wF):$e(u[19]),j2):o&&o.p&&(!l||f[0]&1024)&&o.p(u,l?f:[-1,-1]),(!l||f[0]&16384)&&P(n,"for",u[14]),(!l||f[0]&2048)&&E(n,"bx--visually-hidden",u[11]),(!l||f[0]&128)&&E(n,"bx--label--disabled",u[7]),u[5]?a?a.p(u,f):(a=Z2(u),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i(u){l||(b(o,u),l=!0)},o(u){k(o,u),l=!1},d(u){u&&w(e),o&&o.d(u),a&&a.d()}}}function yF(t){let e;return{c(){e=q(t[10])},m(n,i){y(n,e,i)},p(n,i){i[0]&1024&&Z(e,n[10])},d(n){n&&w(e)}}}function Z2(t){let e,n=t[0].length+"",i,l,r;return{c(){e=R("div"),i=q(n),l=q("/"),r=q(t[5]),E(e,"bx--label",!0),E(e,"bx--label--disabled",t[7])},m(s,o){y(s,e,o),T(e,i),T(e,l),T(e,r)},p(s,o){o[0]&1&&n!==(n=s[0].length+"")&&Z(i,n),o[0]&32&&Z(r,s[5]),o[0]&128&&E(e,"bx--label--disabled",s[7])},d(s){s&&w(e)}}}function X2(t){let e,n;return e=new Os({props:{class:"bx--text-area__invalid-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function K2(t){let e,n;return{c(){e=R("div"),n=q(t[9]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[7])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&512&&Z(n,i[9]),l[0]&128&&E(e,"bx--form__helper-text--disabled",i[7])},d(i){i&&w(e)}}}function $2(t){let e,n;return{c(){e=R("div"),n=q(t[13]),P(e,"id",t[16]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&8192&&Z(n,i[13]),l[0]&65536&&P(e,"id",i[16])},d(i){i&&w(e)}}}function TF(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_=(t[10]||t[17].labelText)&&!t[11]&&Y2(t),v=t[12]&&X2(),S=[{"aria-invalid":s=t[12]||void 0},{"aria-describedby":o=t[12]?t[16]:void 0},{disabled:t[7]},{id:t[14]},{name:t[15]},{cols:t[3]},{rows:t[4]},{placeholder:t[2]},{readOnly:t[8]},{maxlength:a=t[5]??void 0},t[18]],A={};for(let M=0;M{_=null}),ce()),M[12]?v?L[0]&4096&&b(v,1):(v=X2(),v.c(),b(v,1),v.m(i,l)):v&&(fe(),k(v,1,1,()=>{v=null}),ce()),Ae(r,A=Ue(S,[(!d||L[0]&4096&&s!==(s=M[12]||void 0))&&{"aria-invalid":s},(!d||L[0]&69632&&o!==(o=M[12]?M[16]:void 0))&&{"aria-describedby":o},(!d||L[0]&128)&&{disabled:M[7]},(!d||L[0]&16384)&&{id:M[14]},(!d||L[0]&32768)&&{name:M[15]},(!d||L[0]&8)&&{cols:M[3]},(!d||L[0]&16)&&{rows:M[4]},(!d||L[0]&4)&&{placeholder:M[2]},(!d||L[0]&256)&&{readOnly:M[8]},(!d||L[0]&32&&a!==(a=M[5]??void 0))&&{maxlength:a},L[0]&262144&&M[18]])),L[0]&1&&Wl(r,M[0]),E(r,"bx--text-area",!0),E(r,"bx--text-area--light",M[6]),E(r,"bx--text-area--invalid",M[12]),(!d||L[0]&4096&&u!==(u=M[12]||void 0))&&P(i,"data-invalid",u),!M[12]&&M[9]?C?C.p(M,L):(C=K2(M),C.c(),C.m(e,c)):C&&(C.d(1),C=null),M[12]?I?I.p(M,L):(I=$2(M),I.c(),I.m(e,null)):I&&(I.d(1),I=null)},i(M){d||(b(_),b(v),d=!0)},o(M){k(_),k(v),d=!1},d(M){M&&w(e),_&&_.d(),v&&v.d(),t[32](null),C&&C.d(),I&&I.d(),h=!1,vt(g)}}}function SF(t,e,n){let i;const l=["value","placeholder","cols","rows","maxCount","light","disabled","readonly","helperText","labelText","hideLabel","invalid","invalidText","id","name","ref"];let r=ae(e,l),{$$slots:s={},$$scope:o}=e;const a=Yi(s);let{value:u=""}=e,{placeholder:f=""}=e,{cols:c=50}=e,{rows:d=4}=e,{maxCount:h=void 0}=e,{light:g=!1}=e,{disabled:_=!1}=e,{readonly:v=!1}=e,{helperText:S=""}=e,{labelText:A=""}=e,{hideLabel:C=!1}=e,{invalid:I=!1}=e,{invalidText:M=""}=e,{id:L="ccs-"+Math.random().toString(36)}=e,{name:N=void 0}=e,{ref:z=null}=e;function W(ee){te.call(this,t,ee)}function D(ee){te.call(this,t,ee)}function G(ee){te.call(this,t,ee)}function $(ee){te.call(this,t,ee)}function j(ee){te.call(this,t,ee)}function Q(ee){te.call(this,t,ee)}function le(ee){te.call(this,t,ee)}function oe(ee){te.call(this,t,ee)}function X(ee){te.call(this,t,ee)}function de(ee){te.call(this,t,ee)}function re(ee){te.call(this,t,ee)}function x(ee){ft[ee?"unshift":"push"](()=>{z=ee,n(1,z)})}function me(){u=this.value,n(0,u)}return t.$$set=ee=>{e=Y(Y({},e),Se(ee)),n(18,r=ae(e,l)),"value"in ee&&n(0,u=ee.value),"placeholder"in ee&&n(2,f=ee.placeholder),"cols"in ee&&n(3,c=ee.cols),"rows"in ee&&n(4,d=ee.rows),"maxCount"in ee&&n(5,h=ee.maxCount),"light"in ee&&n(6,g=ee.light),"disabled"in ee&&n(7,_=ee.disabled),"readonly"in ee&&n(8,v=ee.readonly),"helperText"in ee&&n(9,S=ee.helperText),"labelText"in ee&&n(10,A=ee.labelText),"hideLabel"in ee&&n(11,C=ee.hideLabel),"invalid"in ee&&n(12,I=ee.invalid),"invalidText"in ee&&n(13,M=ee.invalidText),"id"in ee&&n(14,L=ee.id),"name"in ee&&n(15,N=ee.name),"ref"in ee&&n(1,z=ee.ref),"$$scope"in ee&&n(19,o=ee.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&16384&&n(16,i=`error-${L}`)},[u,z,f,c,d,h,g,_,v,S,A,C,I,M,L,N,i,a,r,o,s,W,D,G,$,j,Q,le,oe,X,de,re,x,me]}class EF extends De{constructor(e){super(),Re(this,e,SF,TF,Ie,{value:0,placeholder:2,cols:3,rows:4,maxCount:5,light:6,disabled:7,readonly:8,helperText:9,labelText:10,hideLabel:11,invalid:12,invalidText:13,id:14,name:15,ref:1},null,[-1,-1])}}const FT=EF,MF=t=>({}),J2=t=>({}),OF=t=>({}),Q2=t=>({});function x2(t){let e,n,i,l=t[9]&&ev(t),r=!t[22]&&t[6]&&tv(t);return{c(){e=R("div"),l&&l.c(),n=B(),r&&r.c(),E(e,"bx--text-input__label-helper-wrapper",!0)},m(s,o){y(s,e,o),l&&l.m(e,null),T(e,n),r&&r.m(e,null),i=!0},p(s,o){s[9]?l?(l.p(s,o),o[0]&512&&b(l,1)):(l=ev(s),l.c(),b(l,1),l.m(e,n)):l&&(fe(),k(l,1,1,()=>{l=null}),ce()),!s[22]&&s[6]?r?r.p(s,o):(r=tv(s),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},i(s){i||(b(l),i=!0)},o(s){k(l),i=!1},d(s){s&&w(e),l&&l.d(),r&&r.d()}}}function ev(t){let e,n;const i=t[28].labelText,l=Ze(i,t,t[27],Q2),r=l||AF(t);return{c(){e=R("label"),r&&r.c(),P(e,"for",t[7]),E(e,"bx--label",!0),E(e,"bx--visually-hidden",t[10]),E(e,"bx--label--disabled",t[5]),E(e,"bx--label--inline",t[16]),E(e,"bx--label--inline--sm",t[2]==="sm"),E(e,"bx--label--inline--xl",t[2]==="xl")},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&134217728)&&Ke(l,i,s,s[27],n?Xe(i,s[27],o,OF):$e(s[27]),Q2):r&&r.p&&(!n||o[0]&512)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&128)&&P(e,"for",s[7]),(!n||o[0]&1024)&&E(e,"bx--visually-hidden",s[10]),(!n||o[0]&32)&&E(e,"bx--label--disabled",s[5]),(!n||o[0]&65536)&&E(e,"bx--label--inline",s[16]),(!n||o[0]&4)&&E(e,"bx--label--inline--sm",s[2]==="sm"),(!n||o[0]&4)&&E(e,"bx--label--inline--xl",s[2]==="xl")},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function AF(t){let e;return{c(){e=q(t[9])},m(n,i){y(n,e,i)},p(n,i){i[0]&512&&Z(e,n[9])},d(n){n&&w(e)}}}function tv(t){let e,n;return{c(){e=R("div"),n=q(t[6]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[5]),E(e,"bx--form__helper-text--inline",t[16])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&64&&Z(n,i[6]),l[0]&32&&E(e,"bx--form__helper-text--disabled",i[5]),l[0]&65536&&E(e,"bx--form__helper-text--inline",i[16])},d(i){i&&w(e)}}}function nv(t){let e,n;const i=t[28].labelText,l=Ze(i,t,t[27],J2),r=l||CF(t);return{c(){e=R("label"),r&&r.c(),P(e,"for",t[7]),E(e,"bx--label",!0),E(e,"bx--visually-hidden",t[10]),E(e,"bx--label--disabled",t[5]),E(e,"bx--label--inline",t[16]),E(e,"bx--label--inline-sm",t[16]&&t[2]==="sm"),E(e,"bx--label--inline-xl",t[16]&&t[2]==="xl")},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&134217728)&&Ke(l,i,s,s[27],n?Xe(i,s[27],o,MF):$e(s[27]),J2):r&&r.p&&(!n||o[0]&512)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&128)&&P(e,"for",s[7]),(!n||o[0]&1024)&&E(e,"bx--visually-hidden",s[10]),(!n||o[0]&32)&&E(e,"bx--label--disabled",s[5]),(!n||o[0]&65536)&&E(e,"bx--label--inline",s[16]),(!n||o[0]&65540)&&E(e,"bx--label--inline-sm",s[16]&&s[2]==="sm"),(!n||o[0]&65540)&&E(e,"bx--label--inline-xl",s[16]&&s[2]==="xl")},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function CF(t){let e;return{c(){e=q(t[9])},m(n,i){y(n,e,i)},p(n,i){i[0]&512&&Z(e,n[9])},d(n){n&&w(e)}}}function LF(t){let e,n,i,l=t[11]&&iv(),r=!t[11]&&t[13]&&lv();return{c(){l&&l.c(),e=B(),r&&r.c(),n=qe()},m(s,o){l&&l.m(s,o),y(s,e,o),r&&r.m(s,o),y(s,n,o),i=!0},p(s,o){s[11]?l?o[0]&2048&&b(l,1):(l=iv(),l.c(),b(l,1),l.m(e.parentNode,e)):l&&(fe(),k(l,1,1,()=>{l=null}),ce()),!s[11]&&s[13]?r?o[0]&10240&&b(r,1):(r=lv(),r.c(),b(r,1),r.m(n.parentNode,n)):r&&(fe(),k(r,1,1,()=>{r=null}),ce())},i(s){i||(b(l),b(r),i=!0)},o(s){k(l),k(r),i=!1},d(s){s&&(w(e),w(n)),l&&l.d(s),r&&r.d(s)}}}function IF(t){let e,n;return e=new JH({props:{class:"bx--text-input__readonly-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function iv(t){let e,n;return e=new Os({props:{class:"bx--text-input__invalid-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function lv(t){let e,n;return e=new Lu({props:{class:`bx--text-input__invalid-icon +`,It=Array.from(oe.querySelectorAll(gt));let Ht=It.indexOf(document.activeElement);Ht===-1&&we.shiftKey&&(Ht=0),Ht+=It.length+(we.shiftKey?-1:1),Ht%=It.length,It[Ht].focus(),we.preventDefault()}else D&&we.key==="Enter"&&!z&&(X("submit"),X("click:button--primary"))},xe=()=>{!me&&!Q&&n(0,h=!1),n(21,me=!1)},mt=we=>{we.propertyName==="transform"&&X("transitionend",{open:h})};return t.$$set=we=>{n(54,e=Y(Y({},e),Se(we))),n(28,a=ae(e,o)),"size"in we&&n(2,d=we.size),"open"in we&&n(0,h=we.open),"danger"in we&&n(3,g=we.danger),"alert"in we&&n(4,_=we.alert),"passiveModal"in we&&n(5,v=we.passiveModal),"modalHeading"in we&&n(6,S=we.modalHeading),"modalLabel"in we&&n(7,A=we.modalLabel),"modalAriaLabel"in we&&n(29,C=we.modalAriaLabel),"iconDescription"in we&&n(8,I=we.iconDescription),"hasForm"in we&&n(9,M=we.hasForm),"hasScrollingContent"in we&&n(10,L=we.hasScrollingContent),"primaryButtonText"in we&&n(11,N=we.primaryButtonText),"primaryButtonDisabled"in we&&n(12,z=we.primaryButtonDisabled),"primaryButtonIcon"in we&&n(13,W=we.primaryButtonIcon),"shouldSubmitOnEnter"in we&&n(14,D=we.shouldSubmitOnEnter),"secondaryButtonText"in we&&n(15,G=we.secondaryButtonText),"secondaryButtons"in we&&n(16,$=we.secondaryButtons),"selectorPrimaryFocus"in we&&n(30,j=we.selectorPrimaryFocus),"preventCloseOnClickOutside"in we&&n(17,Q=we.preventCloseOnClickOutside),"id"in we&&n(18,le=we.id),"ref"in we&&n(1,oe=we.ref),"$$scope"in we&&n(50,c=we.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&1&&Js(ke,u=h,u),t.$$.dirty[0]&262144&&n(25,i=`bx--modal-header__label--modal-${le}`),t.$$.dirty[0]&262144&&n(24,l=`bx--modal-header__heading--modal-${le}`),t.$$.dirty[0]&262144&&n(23,r=`bx--modal-body--${le}`),n(22,s=A||e["aria-label"]||C||S)},e=Se(e),[h,oe,d,g,_,v,S,A,I,M,L,N,z,W,D,G,$,Q,le,de,re,me,s,r,l,i,X,ke,a,C,j,f,pe,Fe,Ve,Ee,We,ge,ve,be,ue,nt,Oe,dt,yt,at,ut,At,xe,mt,c]}class mH extends De{constructor(e){super(),Re(this,e,hH,dH,Ie,{size:2,open:0,danger:3,alert:4,passiveModal:5,modalHeading:6,modalLabel:7,modalAriaLabel:29,iconDescription:8,hasForm:9,hasScrollingContent:10,primaryButtonText:11,primaryButtonDisabled:12,primaryButtonIcon:13,shouldSubmitOnEnter:14,secondaryButtonText:15,secondaryButtons:16,selectorPrimaryFocus:30,preventCloseOnClickOutside:17,id:18,ref:1},null,[-1,-1])}}const gH=mH;function _H(t){let e,n,i,l,r;var s=t[1];function o(f,c){return{props:{size:20,title:f[2],class:(f[0]==="toast"&&"bx--toast-notification__close-icon")+" "+(f[0]==="inline"&&"bx--inline-notification__close-icon")}}}s&&(n=cn(s,o(t)));let a=[{type:"button"},{"aria-label":t[3]},{title:t[3]},t[4]],u={};for(let f=0;f{U(d,1)}),ce()}s?(n=cn(s,o(f)),F(n.$$.fragment),b(n.$$.fragment,1),H(n,e,null)):n=null}else if(s){const d={};c&4&&(d.title=f[2]),c&1&&(d.class=(f[0]==="toast"&&"bx--toast-notification__close-icon")+" "+(f[0]==="inline"&&"bx--inline-notification__close-icon")),n.$set(d)}Ae(e,u=Ue(a,[{type:"button"},(!i||c&8)&&{"aria-label":f[3]},(!i||c&8)&&{title:f[3]},c&16&&f[4]])),E(e,"bx--toast-notification__close-button",f[0]==="toast"),E(e,"bx--inline-notification__close-button",f[0]==="inline")},i(f){i||(n&&b(n.$$.fragment,f),i=!0)},o(f){n&&k(n.$$.fragment,f),i=!1},d(f){f&&w(e),n&&U(n),l=!1,vt(r)}}}function pH(t,e,n){const i=["notificationType","icon","title","iconDescription"];let l=ae(e,i),{notificationType:r="toast"}=e,{icon:s=ql}=e,{title:o=void 0}=e,{iconDescription:a="Close icon"}=e;function u(h){te.call(this,t,h)}function f(h){te.call(this,t,h)}function c(h){te.call(this,t,h)}function d(h){te.call(this,t,h)}return t.$$set=h=>{e=Y(Y({},e),Se(h)),n(4,l=ae(e,i)),"notificationType"in h&&n(0,r=h.notificationType),"icon"in h&&n(1,s=h.icon),"title"in h&&n(2,o=h.title),"iconDescription"in h&&n(3,a=h.iconDescription)},[r,s,o,a,l,u,f,c,d]}class bH extends De{constructor(e){super(),Re(this,e,pH,_H,Ie,{notificationType:0,icon:1,title:2,iconDescription:3})}}const zT=bH;function o2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function vH(t){let e,n,i,l=t[1]&&o2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class wH extends De{constructor(e){super(),Re(this,e,kH,vH,Ie,{size:0,title:1})}}const yH=wH;function a2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function TH(t){let e,n,i,l=t[1]&&a2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class EH extends De{constructor(e){super(),Re(this,e,SH,TH,Ie,{size:0,title:1})}}const MH=EH;function OH(t){let e,n,i;var l=t[3][t[0]];function r(s,o){return{props:{size:20,title:s[2],class:(s[1]==="toast"&&"bx--toast-notification__icon")+" "+(s[1]==="inline"&&"bx--inline-notification__icon")}}}return l&&(e=cn(l,r(t))),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,[o]){if(o&1&&l!==(l=s[3][s[0]])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r(s)),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}else if(l){const a={};o&4&&(a.title=s[2]),o&2&&(a.class=(s[1]==="toast"&&"bx--toast-notification__icon")+" "+(s[1]==="inline"&&"bx--inline-notification__icon")),e.$set(a)}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function AH(t,e,n){let{kind:i="error"}=e,{notificationType:l="toast"}=e,{iconDescription:r}=e;const s={error:BT,"info-square":MH,info:yH,success:RT,warning:Os,"warning-alt":Lu};return t.$$set=o=>{"kind"in o&&n(0,i=o.kind),"notificationType"in o&&n(1,l=o.notificationType),"iconDescription"in o&&n(2,r=o.iconDescription)},[i,l,r,s]}class CH extends De{constructor(e){super(),Re(this,e,AH,OH,Ie,{kind:0,notificationType:1,iconDescription:2})}}const HT=CH,LH=t=>({}),u2=t=>({}),IH=t=>({}),f2=t=>({}),RH=t=>({}),c2=t=>({});function d2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g;n=new HT({props:{kind:t[0],iconDescription:t[6]}});const _=t[15].title,v=Ze(_,t,t[14],c2),S=v||DH(t),A=t[15].subtitle,C=Ze(A,t,t[14],f2),I=C||PH(t),M=t[15].caption,L=Ze(M,t,t[14],u2),N=L||NH(t),z=t[15].default,W=Ze(z,t,t[14],null);let D=!t[8]&&h2(t),G=[{role:t[2]},{kind:t[0]},t[12]],$={};for(let j=0;j{D=null}),ce()):D?(D.p(j,Q),Q&256&&b(D,1)):(D=h2(j),D.c(),b(D,1),D.m(e,null)),Ae(e,$=Ue(G,[(!d||Q&4)&&{role:j[2]},(!d||Q&1)&&{kind:j[0]},Q&4096&&j[12]])),E(e,"bx--toast-notification",!0),E(e,"bx--toast-notification--low-contrast",j[1]),E(e,"bx--toast-notification--error",j[0]==="error"),E(e,"bx--toast-notification--info",j[0]==="info"),E(e,"bx--toast-notification--info-square",j[0]==="info-square"),E(e,"bx--toast-notification--success",j[0]==="success"),E(e,"bx--toast-notification--warning",j[0]==="warning"),E(e,"bx--toast-notification--warning-alt",j[0]==="warning-alt"),wt(e,"width",j[9]?"100%":void 0)},i(j){d||(b(n.$$.fragment,j),b(S,j),b(I,j),b(N,j),b(W,j),b(D),d=!0)},o(j){k(n.$$.fragment,j),k(S,j),k(I,j),k(N,j),k(W,j),k(D),d=!1},d(j){j&&w(e),U(n),S&&S.d(j),I&&I.d(j),N&&N.d(j),W&&W.d(j),D&&D.d(),h=!1,vt(g)}}}function DH(t){let e;return{c(){e=q(t[3])},m(n,i){y(n,e,i)},p(n,i){i&8&&Z(e,n[3])},d(n){n&&w(e)}}}function PH(t){let e;return{c(){e=q(t[4])},m(n,i){y(n,e,i)},p(n,i){i&16&&Z(e,n[4])},d(n){n&&w(e)}}}function NH(t){let e;return{c(){e=q(t[5])},m(n,i){y(n,e,i)},p(n,i){i&32&&Z(e,n[5])},d(n){n&&w(e)}}}function h2(t){let e,n;return e=new zT({props:{iconDescription:t[7]}}),e.$on("click",t[11]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&128&&(r.iconDescription=i[7]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function BH(t){let e,n,i=t[10]&&d2(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,[r]){l[10]?i?(i.p(l,r),r&1024&&b(i,1)):(i=d2(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function zH(t,e,n){const i=["kind","lowContrast","timeout","role","title","subtitle","caption","statusIconDescription","closeButtonDescription","hideCloseButton","fullWidth"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{kind:o="error"}=e,{lowContrast:a=!1}=e,{timeout:u=0}=e,{role:f="alert"}=e,{title:c=""}=e,{subtitle:d=""}=e,{caption:h=""}=e,{statusIconDescription:g=o+" icon"}=e,{closeButtonDescription:_="Close notification"}=e,{hideCloseButton:v=!1}=e,{fullWidth:S=!1}=e;const A=yn();let C=!0,I;function M(D){A("close",{timeout:D===!0},{cancelable:!0})&&n(10,C=!1)}_n(()=>(u&&(I=setTimeout(()=>M(!0),u)),()=>{clearTimeout(I)}));function L(D){te.call(this,t,D)}function N(D){te.call(this,t,D)}function z(D){te.call(this,t,D)}function W(D){te.call(this,t,D)}return t.$$set=D=>{e=Y(Y({},e),Se(D)),n(12,l=ae(e,i)),"kind"in D&&n(0,o=D.kind),"lowContrast"in D&&n(1,a=D.lowContrast),"timeout"in D&&n(13,u=D.timeout),"role"in D&&n(2,f=D.role),"title"in D&&n(3,c=D.title),"subtitle"in D&&n(4,d=D.subtitle),"caption"in D&&n(5,h=D.caption),"statusIconDescription"in D&&n(6,g=D.statusIconDescription),"closeButtonDescription"in D&&n(7,_=D.closeButtonDescription),"hideCloseButton"in D&&n(8,v=D.hideCloseButton),"fullWidth"in D&&n(9,S=D.fullWidth),"$$scope"in D&&n(14,s=D.$$scope)},[o,a,f,c,d,h,g,_,v,S,C,M,l,u,s,r,L,N,z,W]}class HH extends De{constructor(e){super(),Re(this,e,zH,BH,Ie,{kind:0,lowContrast:1,timeout:13,role:2,title:3,subtitle:4,caption:5,statusIconDescription:6,closeButtonDescription:7,hideCloseButton:8,fullWidth:9})}}const UH=HH,FH=t=>({}),m2=t=>({}),GH=t=>({}),g2=t=>({}),VH=t=>({}),_2=t=>({});function p2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g;i=new HT({props:{notificationType:"inline",kind:t[0],iconDescription:t[6]}});const _=t[13].title,v=Ze(_,t,t[12],_2),S=v||WH(t),A=t[13].subtitle,C=Ze(A,t,t[12],g2),I=C||qH(t),M=t[13].default,L=Ze(M,t,t[12],null),N=t[13].actions,z=Ze(N,t,t[12],m2);let W=!t[5]&&b2(t),D=[{role:t[2]},{kind:t[0]},t[10]],G={};for(let $=0;${W=null}),ce()):W?(W.p($,j),j&32&&b(W,1)):(W=b2($),W.c(),b(W,1),W.m(e,null)),Ae(e,G=Ue(D,[(!d||j&4)&&{role:$[2]},(!d||j&1)&&{kind:$[0]},j&1024&&$[10]])),E(e,"bx--inline-notification",!0),E(e,"bx--inline-notification--low-contrast",$[1]),E(e,"bx--inline-notification--hide-close-button",$[5]),E(e,"bx--inline-notification--error",$[0]==="error"),E(e,"bx--inline-notification--info",$[0]==="info"),E(e,"bx--inline-notification--info-square",$[0]==="info-square"),E(e,"bx--inline-notification--success",$[0]==="success"),E(e,"bx--inline-notification--warning",$[0]==="warning"),E(e,"bx--inline-notification--warning-alt",$[0]==="warning-alt")},i($){d||(b(i.$$.fragment,$),b(S,$),b(I,$),b(L,$),b(z,$),b(W),d=!0)},o($){k(i.$$.fragment,$),k(S,$),k(I,$),k(L,$),k(z,$),k(W),d=!1},d($){$&&w(e),U(i),S&&S.d($),I&&I.d($),L&&L.d($),z&&z.d($),W&&W.d(),h=!1,vt(g)}}}function WH(t){let e;return{c(){e=q(t[3])},m(n,i){y(n,e,i)},p(n,i){i&8&&Z(e,n[3])},d(n){n&&w(e)}}}function qH(t){let e;return{c(){e=q(t[4])},m(n,i){y(n,e,i)},p(n,i){i&16&&Z(e,n[4])},d(n){n&&w(e)}}}function b2(t){let e,n;return e=new zT({props:{iconDescription:t[7],notificationType:"inline"}}),e.$on("click",t[9]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&128&&(r.iconDescription=i[7]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function jH(t){let e,n,i=t[8]&&p2(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,[r]){l[8]?i?(i.p(l,r),r&256&&b(i,1)):(i=p2(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function YH(t,e,n){const i=["kind","lowContrast","timeout","role","title","subtitle","hideCloseButton","statusIconDescription","closeButtonDescription"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{kind:o="error"}=e,{lowContrast:a=!1}=e,{timeout:u=0}=e,{role:f="alert"}=e,{title:c=""}=e,{subtitle:d=""}=e,{hideCloseButton:h=!1}=e,{statusIconDescription:g=o+" icon"}=e,{closeButtonDescription:_="Close notification"}=e;const v=yn();let S=!0,A;function C(z){v("close",{timeout:z===!0},{cancelable:!0})&&n(8,S=!1)}_n(()=>(u&&(A=setTimeout(()=>C(!0),u)),()=>{clearTimeout(A)}));function I(z){te.call(this,t,z)}function M(z){te.call(this,t,z)}function L(z){te.call(this,t,z)}function N(z){te.call(this,t,z)}return t.$$set=z=>{e=Y(Y({},e),Se(z)),n(10,l=ae(e,i)),"kind"in z&&n(0,o=z.kind),"lowContrast"in z&&n(1,a=z.lowContrast),"timeout"in z&&n(11,u=z.timeout),"role"in z&&n(2,f=z.role),"title"in z&&n(3,c=z.title),"subtitle"in z&&n(4,d=z.subtitle),"hideCloseButton"in z&&n(5,h=z.hideCloseButton),"statusIconDescription"in z&&n(6,g=z.statusIconDescription),"closeButtonDescription"in z&&n(7,_=z.closeButtonDescription),"$$scope"in z&&n(12,s=z.$$scope)},[o,a,f,c,d,h,g,_,S,C,l,u,s,r,I,M,L,N]}class ZH extends De{constructor(e){super(),Re(this,e,YH,jH,Ie,{kind:0,lowContrast:1,timeout:11,role:2,title:3,subtitle:4,hideCloseButton:5,statusIconDescription:6,closeButtonDescription:7})}}const xi=ZH;function v2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function XH(t){let e,n,i=t[1]&&v2(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class $H extends De{constructor(e){super(),Re(this,e,KH,XH,Ie,{size:0,title:1})}}const JH=$H,QH=t=>({}),k2=t=>({});function w2(t){let e,n;const i=t[26].labelText,l=Ze(i,t,t[25],k2),r=l||xH(t);return{c(){e=R("label"),r&&r.c(),P(e,"for",t[5]),E(e,"bx--label",!0),E(e,"bx--visually-hidden",t[14]),E(e,"bx--label--disabled",t[4])},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&33554432)&&Ke(l,i,s,s[25],n?Xe(i,s[25],o,QH):$e(s[25]),k2):r&&r.p&&(!n||o[0]&8192)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&32)&&P(e,"for",s[5]),(!n||o[0]&16384)&&E(e,"bx--visually-hidden",s[14]),(!n||o[0]&16)&&E(e,"bx--label--disabled",s[4])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function xH(t){let e;return{c(){e=q(t[13])},m(n,i){y(n,e,i)},p(n,i){i[0]&8192&&Z(e,n[13])},d(n){n&&w(e)}}}function y2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S;const A=t[26].default,C=Ze(A,t,t[25],null);u=new ga({props:{class:"bx--select__arrow"}});let I=t[7]&&T2(),M=t[7]&&S2(t),L=!t[7]&&!t[9]&&t[11]&&E2(t);return{c(){e=R("div"),n=R("div"),i=R("select"),C&&C.c(),a=B(),F(u.$$.fragment),f=B(),I&&I.c(),d=B(),M&&M.c(),h=B(),L&&L.c(),g=qe(),P(i,"aria-describedby",l=t[7]?t[16]:void 0),P(i,"aria-invalid",r=t[7]||void 0),i.disabled=s=t[4]||void 0,i.required=o=t[15]||void 0,P(i,"id",t[5]),P(i,"name",t[6]),E(i,"bx--select-input",!0),E(i,"bx--select-input--sm",t[1]==="sm"),E(i,"bx--select-input--xl",t[1]==="xl"),P(n,"data-invalid",c=t[7]||void 0),E(n,"bx--select-input__wrapper",!0),E(e,"bx--select-input--inline__wrapper",!0)},m(N,z){y(N,e,z),T(e,n),T(n,i),C&&C.m(i,null),t[35](i),T(n,a),H(u,n,null),T(n,f),I&&I.m(n,null),T(e,d),M&&M.m(e,null),y(N,h,z),L&&L.m(N,z),y(N,g,z),_=!0,v||(S=[J(i,"change",t[21]),J(i,"change",t[31]),J(i,"input",t[32]),J(i,"focus",t[33]),J(i,"blur",t[34])],v=!0)},p(N,z){C&&C.p&&(!_||z[0]&33554432)&&Ke(C,A,N,N[25],_?Xe(A,N[25],z,null):$e(N[25]),null),(!_||z[0]&65664&&l!==(l=N[7]?N[16]:void 0))&&P(i,"aria-describedby",l),(!_||z[0]&128&&r!==(r=N[7]||void 0))&&P(i,"aria-invalid",r),(!_||z[0]&16&&s!==(s=N[4]||void 0))&&(i.disabled=s),(!_||z[0]&32768&&o!==(o=N[15]||void 0))&&(i.required=o),(!_||z[0]&32)&&P(i,"id",N[5]),(!_||z[0]&64)&&P(i,"name",N[6]),(!_||z[0]&2)&&E(i,"bx--select-input--sm",N[1]==="sm"),(!_||z[0]&2)&&E(i,"bx--select-input--xl",N[1]==="xl"),N[7]?I?z[0]&128&&b(I,1):(I=T2(),I.c(),b(I,1),I.m(n,null)):I&&(fe(),k(I,1,1,()=>{I=null}),ce()),(!_||z[0]&128&&c!==(c=N[7]||void 0))&&P(n,"data-invalid",c),N[7]?M?M.p(N,z):(M=S2(N),M.c(),M.m(e,null)):M&&(M.d(1),M=null),!N[7]&&!N[9]&&N[11]?L?L.p(N,z):(L=E2(N),L.c(),L.m(g.parentNode,g)):L&&(L.d(1),L=null)},i(N){_||(b(C,N),b(u.$$.fragment,N),b(I),_=!0)},o(N){k(C,N),k(u.$$.fragment,N),k(I),_=!1},d(N){N&&(w(e),w(h),w(g)),C&&C.d(N),t[35](null),U(u),I&&I.d(),M&&M.d(),L&&L.d(N),v=!1,vt(S)}}}function T2(t){let e,n;return e=new Os({props:{class:"bx--select__invalid-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function S2(t){let e,n;return{c(){e=R("div"),n=q(t[8]),P(e,"id",t[16]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&256&&Z(n,i[8]),l[0]&65536&&P(e,"id",i[16])},d(i){i&&w(e)}}}function E2(t){let e,n;return{c(){e=R("div"),n=q(t[11]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[4])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&2048&&Z(n,i[11]),l[0]&16&&E(e,"bx--form__helper-text--disabled",i[4])},d(i){i&&w(e)}}}function M2(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A;const C=t[26].default,I=Ze(C,t,t[25],null);a=new ga({props:{class:"bx--select__arrow"}});let M=t[7]&&O2(),L=!t[7]&&t[9]&&A2(),N=!t[7]&&t[11]&&C2(t),z=t[7]&&L2(t),W=!t[7]&&t[9]&&I2(t);return{c(){e=R("div"),n=R("select"),I&&I.c(),o=B(),F(a.$$.fragment),u=B(),M&&M.c(),f=B(),L&&L.c(),d=B(),N&&N.c(),h=B(),z&&z.c(),g=B(),W&&W.c(),_=qe(),P(n,"id",t[5]),P(n,"name",t[6]),P(n,"aria-describedby",i=t[7]?t[16]:void 0),n.disabled=l=t[4]||void 0,n.required=r=t[15]||void 0,P(n,"aria-invalid",s=t[7]||void 0),E(n,"bx--select-input",!0),E(n,"bx--select-input--sm",t[1]==="sm"),E(n,"bx--select-input--xl",t[1]==="xl"),P(e,"data-invalid",c=t[7]||void 0),E(e,"bx--select-input__wrapper",!0)},m(D,G){y(D,e,G),T(e,n),I&&I.m(n,null),t[36](n),T(e,o),H(a,e,null),T(e,u),M&&M.m(e,null),T(e,f),L&&L.m(e,null),y(D,d,G),N&&N.m(D,G),y(D,h,G),z&&z.m(D,G),y(D,g,G),W&&W.m(D,G),y(D,_,G),v=!0,S||(A=[J(n,"change",t[21]),J(n,"change",t[27]),J(n,"input",t[28]),J(n,"focus",t[29]),J(n,"blur",t[30])],S=!0)},p(D,G){I&&I.p&&(!v||G[0]&33554432)&&Ke(I,C,D,D[25],v?Xe(C,D[25],G,null):$e(D[25]),null),(!v||G[0]&32)&&P(n,"id",D[5]),(!v||G[0]&64)&&P(n,"name",D[6]),(!v||G[0]&65664&&i!==(i=D[7]?D[16]:void 0))&&P(n,"aria-describedby",i),(!v||G[0]&16&&l!==(l=D[4]||void 0))&&(n.disabled=l),(!v||G[0]&32768&&r!==(r=D[15]||void 0))&&(n.required=r),(!v||G[0]&128&&s!==(s=D[7]||void 0))&&P(n,"aria-invalid",s),(!v||G[0]&2)&&E(n,"bx--select-input--sm",D[1]==="sm"),(!v||G[0]&2)&&E(n,"bx--select-input--xl",D[1]==="xl"),D[7]?M?G[0]&128&&b(M,1):(M=O2(),M.c(),b(M,1),M.m(e,f)):M&&(fe(),k(M,1,1,()=>{M=null}),ce()),!D[7]&&D[9]?L?G[0]&640&&b(L,1):(L=A2(),L.c(),b(L,1),L.m(e,null)):L&&(fe(),k(L,1,1,()=>{L=null}),ce()),(!v||G[0]&128&&c!==(c=D[7]||void 0))&&P(e,"data-invalid",c),!D[7]&&D[11]?N?N.p(D,G):(N=C2(D),N.c(),N.m(h.parentNode,h)):N&&(N.d(1),N=null),D[7]?z?z.p(D,G):(z=L2(D),z.c(),z.m(g.parentNode,g)):z&&(z.d(1),z=null),!D[7]&&D[9]?W?W.p(D,G):(W=I2(D),W.c(),W.m(_.parentNode,_)):W&&(W.d(1),W=null)},i(D){v||(b(I,D),b(a.$$.fragment,D),b(M),b(L),v=!0)},o(D){k(I,D),k(a.$$.fragment,D),k(M),k(L),v=!1},d(D){D&&(w(e),w(d),w(h),w(g),w(_)),I&&I.d(D),t[36](null),U(a),M&&M.d(),L&&L.d(),N&&N.d(D),z&&z.d(D),W&&W.d(D),S=!1,vt(A)}}}function O2(t){let e,n;return e=new Os({props:{class:"bx--select__invalid-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function A2(t){let e,n;return e=new Lu({props:{class:"bx--select__invalid-icon bx--select__invalid-icon--warning"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function C2(t){let e,n;return{c(){e=R("div"),n=q(t[11]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[4])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&2048&&Z(n,i[11]),l[0]&16&&E(e,"bx--form__helper-text--disabled",i[4])},d(i){i&&w(e)}}}function L2(t){let e,n;return{c(){e=R("div"),n=q(t[8]),P(e,"id",t[16]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&256&&Z(n,i[8]),l[0]&65536&&P(e,"id",i[16])},d(i){i&&w(e)}}}function I2(t){let e,n;return{c(){e=R("div"),n=q(t[10]),P(e,"id",t[16]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&1024&&Z(n,i[10]),l[0]&65536&&P(e,"id",i[16])},d(i){i&&w(e)}}}function eU(t){let e,n,i,l,r,s=!t[12]&&w2(t),o=t[2]&&y2(t),a=!t[2]&&M2(t),u=[t[22]],f={};for(let c=0;c{s=null}),ce()):s?(s.p(c,d),d[0]&4096&&b(s,1)):(s=w2(c),s.c(),b(s,1),s.m(n,i)),c[2]?o?(o.p(c,d),d[0]&4&&b(o,1)):(o=y2(c),o.c(),b(o,1),o.m(n,l)):o&&(fe(),k(o,1,1,()=>{o=null}),ce()),c[2]?a&&(fe(),k(a,1,1,()=>{a=null}),ce()):a?(a.p(c,d),d[0]&4&&b(a,1)):(a=M2(c),a.c(),b(a,1),a.m(n,null)),(!r||d[0]&4)&&E(n,"bx--select--inline",c[2]),(!r||d[0]&8)&&E(n,"bx--select--light",c[3]),(!r||d[0]&128)&&E(n,"bx--select--invalid",c[7]),(!r||d[0]&16)&&E(n,"bx--select--disabled",c[4]),(!r||d[0]&512)&&E(n,"bx--select--warning",c[9]),Ae(e,f=Ue(u,[d[0]&4194304&&c[22]])),E(e,"bx--form-item",!0)},i(c){r||(b(s),b(o),b(a),r=!0)},o(c){k(s),k(o),k(a),r=!1},d(c){c&&w(e),s&&s.d(),o&&o.d(),a&&a.d()}}}function tU(t,e,n){let i;const l=["selected","size","inline","light","disabled","id","name","invalid","invalidText","warn","warnText","helperText","noLabel","labelText","hideLabel","ref","required"];let r=ae(e,l),s,o,a,u,{$$slots:f={},$$scope:c}=e,{selected:d=void 0}=e,{size:h=void 0}=e,{inline:g=!1}=e,{light:_=!1}=e,{disabled:v=!1}=e,{id:S="ccs-"+Math.random().toString(36)}=e,{name:A=void 0}=e,{invalid:C=!1}=e,{invalidText:I=""}=e,{warn:M=!1}=e,{warnText:L=""}=e,{helperText:N=""}=e,{noLabel:z=!1}=e,{labelText:W=""}=e,{hideLabel:D=!1}=e,{ref:G=null}=e,{required:$=!1}=e;const j=yn(),Q=un(d);Mt(t,Q,ve=>n(38,o=ve));const le=un(null);Mt(t,le,ve=>n(40,u=ve));const oe=un(null);Mt(t,oe,ve=>n(24,s=ve));const X=un({});Mt(t,X,ve=>n(39,a=ve)),Wi("Select",{selectedValue:Q,setDefaultValue:(ve,be)=>{s===null?(le.set(ve),oe.set(be)):u===ve&&Q.set(be),X.update(ue=>({...ue,[be]:typeof be}))}});const de=({target:ve})=>{let be=ve.value;a[be]==="number"&&(be=Number(be)),Q.set(be)};let re;Cl(()=>{n(23,d=o),re!==void 0&&d!==re&&j("update",o),re=d});function x(ve){te.call(this,t,ve)}function me(ve){te.call(this,t,ve)}function ee(ve){te.call(this,t,ve)}function ke(ve){te.call(this,t,ve)}function pe(ve){te.call(this,t,ve)}function Fe(ve){te.call(this,t,ve)}function Ve(ve){te.call(this,t,ve)}function Ee(ve){te.call(this,t,ve)}function We(ve){ft[ve?"unshift":"push"](()=>{G=ve,n(0,G)})}function ge(ve){ft[ve?"unshift":"push"](()=>{G=ve,n(0,G)})}return t.$$set=ve=>{e=Y(Y({},e),Se(ve)),n(22,r=ae(e,l)),"selected"in ve&&n(23,d=ve.selected),"size"in ve&&n(1,h=ve.size),"inline"in ve&&n(2,g=ve.inline),"light"in ve&&n(3,_=ve.light),"disabled"in ve&&n(4,v=ve.disabled),"id"in ve&&n(5,S=ve.id),"name"in ve&&n(6,A=ve.name),"invalid"in ve&&n(7,C=ve.invalid),"invalidText"in ve&&n(8,I=ve.invalidText),"warn"in ve&&n(9,M=ve.warn),"warnText"in ve&&n(10,L=ve.warnText),"helperText"in ve&&n(11,N=ve.helperText),"noLabel"in ve&&n(12,z=ve.noLabel),"labelText"in ve&&n(13,W=ve.labelText),"hideLabel"in ve&&n(14,D=ve.hideLabel),"ref"in ve&&n(0,G=ve.ref),"required"in ve&&n(15,$=ve.required),"$$scope"in ve&&n(25,c=ve.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&32&&n(16,i=`error-${S}`),t.$$.dirty[0]&25165824&&Q.set(d??s)},[G,h,g,_,v,S,A,C,I,M,L,N,z,W,D,$,i,Q,le,oe,X,de,r,d,s,c,f,x,me,ee,ke,pe,Fe,Ve,Ee,We,ge]}class nU extends De{constructor(e){super(),Re(this,e,tU,eU,Ie,{selected:23,size:1,inline:2,light:3,disabled:4,id:5,name:6,invalid:7,invalidText:8,warn:9,warnText:10,helperText:11,noLabel:12,labelText:13,hideLabel:14,ref:0,required:15},null,[-1,-1])}}const wr=nU;function iU(t){let e,n=(t[1]||t[0])+"",i,l,r;return{c(){e=R("option"),i=q(n),e.__value=t[0],Wl(e,e.__value),e.disabled=t[3],e.hidden=t[2],e.selected=t[4],P(e,"class",l=t[5].class),P(e,"style",r=t[5].style),E(e,"bx--select-option",!0)},m(s,o){y(s,e,o),T(e,i)},p(s,[o]){o&3&&n!==(n=(s[1]||s[0])+"")&&Z(i,n),o&1&&(e.__value=s[0],Wl(e,e.__value)),o&8&&(e.disabled=s[3]),o&4&&(e.hidden=s[2]),o&16&&(e.selected=s[4]),o&32&&l!==(l=s[5].class)&&P(e,"class",l),o&32&&r!==(r=s[5].style)&&P(e,"style",r),o&32&&E(e,"bx--select-option",!0)},i:he,o:he,d(s){s&&w(e)}}}function lU(t,e,n){const i=["value","text","hidden","disabled"];let l=ae(e,i),{value:r=""}=e,{text:s=""}=e,{hidden:o=!1}=e,{disabled:a=!1}=e;const u="ccs-"+Math.random().toString(36),f=bi("Select")||bi("TimePickerSelect");let c=!1;const d=f.selectedValue.subscribe(h=>{n(4,c=h===r)});return _n(()=>()=>d()),t.$$set=h=>{e=Y(Y({},e),Se(h)),n(5,l=ae(e,i)),"value"in h&&n(0,r=h.value),"text"in h&&n(1,s=h.text),"hidden"in h&&n(2,o=h.hidden),"disabled"in h&&n(3,a=h.disabled)},t.$$.update=()=>{var h;t.$$.dirty&1&&((h=f==null?void 0:f.setDefaultValue)==null||h.call(f,u,r))},[r,s,o,a,c,l]}class rU extends De{constructor(e){super(),Re(this,e,lU,iU,Ie,{value:0,text:1,hidden:2,disabled:3})}}const Ln=rU;function sU(t){let e,n,i,l;const r=t[7].default,s=Ze(r,t,t[6],null);let o=[t[3]],a={};for(let u=0;uI.reduce((M,L)=>({...M,[L.id]:L}),{}));Mt(t,g,I=>n(12,r=I));const _=un(c);Wi("ProgressIndicator",{steps:h,stepsById:g,preventChangeOnClick:{subscribe:_.subscribe},add:I=>{h.update(M=>I.id in r?M.map(L=>L.id===I.id?{...L,...I}:L):[...M,{...I,index:M.length,current:M.length===a,complete:I.complete}])},change:I=>{c||(n(4,a=I),d("change",I))}});function v(I){te.call(this,t,I)}function S(I){te.call(this,t,I)}function A(I){te.call(this,t,I)}function C(I){te.call(this,t,I)}return t.$$set=I=>{e=Y(Y({},e),Se(I)),n(3,l=ae(e,i)),"currentIndex"in I&&n(4,a=I.currentIndex),"vertical"in I&&n(0,u=I.vertical),"spaceEqually"in I&&n(1,f=I.spaceEqually),"preventChangeOnClick"in I&&n(5,c=I.preventChangeOnClick),"$$scope"in I&&n(6,o=I.$$scope)},t.$$.update=()=>{t.$$.dirty&16&&h.update(I=>I.map((M,L)=>({...M,current:L===a}))),t.$$.dirty&32&&_.set(c)},[u,f,g,l,a,c,o,s,v,S,A,C]}class aU extends De{constructor(e){super(),Re(this,e,oU,sU,Ie,{currentIndex:4,vertical:0,spaceEqually:1,preventChangeOnClick:5})}}const uU=aU;function R2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function fU(t){let e,n,i,l=t[1]&&R2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class dU extends De{constructor(e){super(),Re(this,e,cU,fU,Ie,{size:0,title:1})}}const hU=dU;function D2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function mU(t){let e,n,i,l=t[1]&&D2(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class _U extends De{constructor(e){super(),Re(this,e,gU,mU,Ie,{size:0,title:1})}}const pU=_U;function P2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function bU(t){let e,n,i=t[1]&&P2(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class kU extends De{constructor(e){super(),Re(this,e,vU,bU,Ie,{size:0,title:1})}}const wU=kU;function N2(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function yU(t){let e,n,i=t[1]&&N2(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class SU extends De{constructor(e){super(),Re(this,e,TU,yU,Ie,{size:0,title:1})}}const EU=SU,MU=t=>({}),B2=t=>({props:{class:"bx--progress-label"}});function OU(t){let e,n;return e=new wU({props:{title:t[4]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function AU(t){let e,n;return e=new hU({props:{title:t[4]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function CU(t){let e,n;return e=new EU({props:{title:t[4]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function LU(t){let e,n;return e=new pU({props:{class:"bx--progress__warning",title:t[4]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.title=i[4]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function IU(t){let e,n;return{c(){e=R("p"),n=q(t[5]),E(e,"bx--progress-label",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&32&&Z(n,i[5])},d(i){i&&w(e)}}}function z2(t){let e,n;return{c(){e=R("p"),n=q(t[6]),E(e,"bx--progress-optional",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&64&&Z(n,i[6])},d(i){i&&w(e)}}}function RU(t){let e,n,i,l,r,s,o,a,u,f,c,d,h;const g=[LU,CU,AU,OU],_=[];function v(N,z){return N[3]?0:N[1]?1:N[0]?2:3}i=v(t),l=_[i]=g[i](t);const S=t[14].default,A=Ze(S,t,t[13],B2),C=A||IU(t);let I=t[6]&&z2(t),M=[{id:t[7]},t[12]],L={};for(let N=0;N{_[W]=null}),ce(),l=_[i],l?l.p(N,z):(l=_[i]=g[i](N),l.c()),b(l,1),l.m(n,r)),A?A.p&&(!c||z&8192)&&Ke(A,S,N,N[13],c?Xe(S,N[13],z,MU):$e(N[13]),B2):C&&C.p&&(!c||z&32)&&C.p(N,c?z:-1),N[6]?I?I.p(N,z):(I=z2(N),I.c(),I.m(s,null)):I&&(I.d(1),I=null),(!c||z&4)&&(n.disabled=N[2]),(!c||z&4)&&P(n,"aria-disabled",N[2]),(!c||z&6&&f!==(f=!N[1]&&!N[2]?"0":"-1"))&&P(n,"tabindex",f),(!c||z&514)&&E(n,"bx--progress-step-button--unclickable",N[1]||N[9]),Ae(e,L=Ue(M,[(!c||z&128)&&{id:N[7]},z&4096&&N[12]])),E(e,"bx--progress-step",!0),E(e,"bx--progress-step--current",N[1]),E(e,"bx--progress-step--complete",N[0]),E(e,"bx--progress-step--incomplete",!N[0]&&!N[1]),E(e,"bx--progress-step--disabled",N[2])},i(N){c||(b(l),b(C,N),c=!0)},o(N){k(l),k(C,N),c=!1},d(N){N&&w(e),_[i].d(),C&&C.d(N),I&&I.d(),d=!1,vt(h)}}}function DU(t,e,n){const i=["complete","current","disabled","invalid","description","label","secondaryLabel","id"];let l=ae(e,i),r,{$$slots:s={},$$scope:o}=e,{complete:a=!1}=e,{current:u=!1}=e,{disabled:f=!1}=e,{invalid:c=!1}=e,{description:d=""}=e,{label:h=""}=e,{secondaryLabel:g=""}=e,{id:_="ccs-"+Math.random().toString(36)}=e,v={};const{stepsById:S,add:A,change:C,preventChangeOnClick:I}=bi("ProgressIndicator");Mt(t,I,j=>n(9,r=j));const M=S.subscribe(j=>{j[_]&&(n(8,v=j[_]),n(1,u=v.current),n(0,a=v.complete))});_n(()=>()=>{M()});function L(j){te.call(this,t,j)}function N(j){te.call(this,t,j)}function z(j){te.call(this,t,j)}function W(j){te.call(this,t,j)}function D(j){te.call(this,t,j)}const G=()=>{v.complete&&C(v.index)},$=j=>{v.complete&&(j.key===" "||j.key==="Enter")&&C(v.index)};return t.$$set=j=>{e=Y(Y({},e),Se(j)),n(12,l=ae(e,i)),"complete"in j&&n(0,a=j.complete),"current"in j&&n(1,u=j.current),"disabled"in j&&n(2,f=j.disabled),"invalid"in j&&n(3,c=j.invalid),"description"in j&&n(4,d=j.description),"label"in j&&n(5,h=j.label),"secondaryLabel"in j&&n(6,g=j.secondaryLabel),"id"in j&&n(7,_=j.id),"$$scope"in j&&n(13,o=j.$$scope)},t.$$.update=()=>{t.$$.dirty&133&&A({id:_,complete:a,disabled:f})},[a,u,f,c,d,h,g,_,v,r,C,I,l,o,s,L,N,z,W,D,G,$]}class PU extends De{constructor(e){super(),Re(this,e,DU,RU,Ie,{complete:0,current:1,disabled:2,invalid:3,description:4,label:5,secondaryLabel:6,id:7})}}const NU=PU,BU=t=>({}),H2=t=>({});function U2(t){let e,n;const i=t[11].legendText,l=Ze(i,t,t[10],H2),r=l||zU(t);return{c(){e=R("legend"),r&&r.c(),E(e,"bx--label",!0),E(e,"bx--visually-hidden",t[2])},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&1024)&&Ke(l,i,s,s[10],n?Xe(i,s[10],o,BU):$e(s[10]),H2):r&&r.p&&(!n||o&2)&&r.p(s,n?o:-1),(!n||o&4)&&E(e,"bx--visually-hidden",s[2])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function zU(t){let e;return{c(){e=q(t[1])},m(n,i){y(n,e,i)},p(n,i){i&2&&Z(e,n[1])},d(n){n&&w(e)}}}function HU(t){let e,n,i,l,r,s,o=(t[1]||t[8].legendText)&&U2(t);const a=t[11].default,u=Ze(a,t,t[10],null);let f=[{id:t[5]},t[7]],c={};for(let d=0;d{o=null}),ce()),u&&u.p&&(!l||h&1024)&&Ke(u,a,d,d[10],l?Xe(a,d[10],h,null):$e(d[10]),null),(!l||h&1)&&(n.disabled=d[0]),(!l||h&16)&&E(n,"bx--radio-button-group--vertical",d[4]==="vertical"),(!l||h&8)&&E(n,"bx--radio-button-group--label-left",d[3]==="left"),(!l||h&8)&&E(n,"bx--radio-button-group--label-right",d[3]==="right"),Ae(e,c=Ue(f,[(!l||h&32)&&{id:d[5]},h&128&&d[7]])),E(e,"bx--form-item",!0)},i(d){l||(b(o),b(u,d),l=!0)},o(d){k(o),k(u,d),l=!1},d(d){d&&w(e),o&&o.d(),u&&u.d(d),r=!1,vt(s)}}}function UU(t,e,n){const i=["selected","disabled","legendText","hideLegend","labelPosition","orientation","id"];let l=ae(e,i),r,{$$slots:s={},$$scope:o}=e;const a=Yi(s);let{selected:u=void 0}=e,{disabled:f=!1}=e,{legendText:c=""}=e,{hideLegend:d=!1}=e,{labelPosition:h="right"}=e,{orientation:g="horizontal"}=e,{id:_=void 0}=e;const v=yn(),S=un(u);Mt(t,S,L=>n(16,r=L)),Wi("RadioButtonGroup",{selectedValue:S,add:({checked:L,value:N})=>{L&&S.set(N)},update:L=>{n(9,u=L)}}),_n(()=>{Js(S,r=u,r)}),VI(()=>{Js(S,r=u,r)}),S.subscribe(L=>{n(9,u=L),v("change",L)});function A(L){te.call(this,t,L)}function C(L){te.call(this,t,L)}function I(L){te.call(this,t,L)}function M(L){te.call(this,t,L)}return t.$$set=L=>{e=Y(Y({},e),Se(L)),n(7,l=ae(e,i)),"selected"in L&&n(9,u=L.selected),"disabled"in L&&n(0,f=L.disabled),"legendText"in L&&n(1,c=L.legendText),"hideLegend"in L&&n(2,d=L.hideLegend),"labelPosition"in L&&n(3,h=L.labelPosition),"orientation"in L&&n(4,g=L.orientation),"id"in L&&n(5,_=L.id),"$$scope"in L&&n(10,o=L.$$scope)},[f,c,d,h,g,_,S,l,a,u,o,s,A,C,I,M]}class FU extends De{constructor(e){super(),Re(this,e,UU,HU,Ie,{selected:9,disabled:0,legendText:1,hideLegend:2,labelPosition:3,orientation:4,id:5})}}const UT=FU;function GU(t){let e,n,i,l;const r=t[8].default,s=Ze(r,t,t[7],null);let o=[{role:"table"},t[4]],a={};for(let u=0;un(6,r=A)),Wi("StructuredListWrapper",{selectedValue:h,update:A=>{h.set(A)}});function g(A){te.call(this,t,A)}function _(A){te.call(this,t,A)}function v(A){te.call(this,t,A)}function S(A){te.call(this,t,A)}return t.$$set=A=>{e=Y(Y({},e),Se(A)),n(4,l=ae(e,i)),"selected"in A&&n(5,a=A.selected),"condensed"in A&&n(0,u=A.condensed),"flush"in A&&n(1,f=A.flush),"selection"in A&&n(2,c=A.selection),"$$scope"in A&&n(7,o=A.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&n(5,a=r),t.$$.dirty&64&&d("change",r)},[u,f,c,h,l,a,r,o,s,g,_,v,S]}class WU extends De{constructor(e){super(),Re(this,e,VU,GU,Ie,{selected:5,condensed:0,flush:1,selection:2})}}const gu=WU;function qU(t){let e,n,i,l;const r=t[2].default,s=Ze(r,t,t[1],null);let o=[{role:"rowgroup"},t[0]],a={};for(let u=0;u{e=Y(Y({},e),Se(c)),n(0,l=ae(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class YU extends De{constructor(e){super(),Re(this,e,jU,qU,Ie,{})}}const Nu=YU;function ZU(t){let e,n,i,l;const r=t[2].default,s=Ze(r,t,t[1],null);let o=[{role:"rowgroup"},t[0]],a={};for(let u=0;u{e=Y(Y({},e),Se(c)),n(0,l=ae(e,i)),"$$scope"in c&&n(1,s=c.$$scope)},[l,s,r,o,a,u,f]}class KU extends De{constructor(e){super(),Re(this,e,XU,ZU,Ie,{})}}const FT=KU;function $U(t){let e,n,i,l,r;const s=t[4].default,o=Ze(s,t,t[3],null);let a=[{role:n=t[0]?"columnheader":"cell"},t[2]],u={};for(let f=0;f{e=Y(Y({},e),Se(h)),n(2,l=ae(e,i)),"head"in h&&n(0,o=h.head),"noWrap"in h&&n(1,a=h.noWrap),"$$scope"in h&&n(3,s=h.$$scope)},[o,a,l,s,r,u,f,c,d]}class QU extends De{constructor(e){super(),Re(this,e,JU,$U,Ie,{head:0,noWrap:1})}}const Zt=QU;function xU(t){let e,n,i,l;const r=t[5].default,s=Ze(r,t,t[4],null);let o=[{role:"row"},t[3]],a={};for(let u=0;u{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function nF(t,e,n){const i=["head","label","tabindex"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{head:o=!1}=e,{label:a=!1}=e,{tabindex:u="0"}=e;function f(C){te.call(this,t,C)}function c(C){te.call(this,t,C)}function d(C){te.call(this,t,C)}function h(C){te.call(this,t,C)}function g(C){te.call(this,t,C)}function _(C){te.call(this,t,C)}function v(C){te.call(this,t,C)}function S(C){te.call(this,t,C)}function A(C){te.call(this,t,C)}return t.$$set=C=>{e=Y(Y({},e),Se(C)),n(3,l=ae(e,i)),"head"in C&&n(0,o=C.head),"label"in C&&n(1,a=C.label),"tabindex"in C&&n(2,u=C.tabindex),"$$scope"in C&&n(4,s=C.$$scope)},[o,a,u,l,s,r,f,c,d,h,g,_,v,S,A]}class iF extends De{constructor(e){super(),Re(this,e,nF,tF,Ie,{head:0,label:1,tabindex:2})}}const Zn=iF;function lF(t){let e,n,i,l=[t[1]],r={};for(let s=0;s{e=Y(Y({},e),Se(f)),n(1,l=ae(e,i)),"size"in f&&n(0,r=f.size)},[r,l,s,o,a,u]}class sF extends De{constructor(e){super(),Re(this,e,rF,lF,Ie,{size:0})}}const oF=sF,aF=t=>({}),F2=t=>({}),uF=t=>({}),G2=t=>({}),fF=t=>({}),V2=t=>({props:{class:"bx--tag__label"}});function cF(t){let e,n,i,l,r,s,o=(t[11].icon||t[7])&&W2(t);const a=t[13].default,u=Ze(a,t,t[12],null);let f=[{id:t[8]},t[10]],c={};for(let d=0;d{o=null}),ce()),u&&u.p&&(!l||h&4096)&&Ke(u,a,d,d[12],l?Xe(a,d[12],h,null):$e(d[12]),null),Ae(e,c=Ue(f,[(!l||h&256)&&{id:d[8]},h&1024&&d[10]])),E(e,"bx--tag",!0),E(e,"bx--tag--disabled",d[3]),E(e,"bx--tag--sm",d[1]==="sm"),E(e,"bx--tag--red",d[0]==="red"),E(e,"bx--tag--magenta",d[0]==="magenta"),E(e,"bx--tag--purple",d[0]==="purple"),E(e,"bx--tag--blue",d[0]==="blue"),E(e,"bx--tag--cyan",d[0]==="cyan"),E(e,"bx--tag--teal",d[0]==="teal"),E(e,"bx--tag--green",d[0]==="green"),E(e,"bx--tag--gray",d[0]==="gray"),E(e,"bx--tag--cool-gray",d[0]==="cool-gray"),E(e,"bx--tag--warm-gray",d[0]==="warm-gray"),E(e,"bx--tag--high-contrast",d[0]==="high-contrast"),E(e,"bx--tag--outline",d[0]==="outline")},i(d){l||(b(o),b(u,d),l=!0)},o(d){k(o),k(u,d),l=!1},d(d){d&&w(e),o&&o.d(),u&&u.d(d),r=!1,vt(s)}}}function dF(t){let e,n,i,l,r,s,o,a=(t[11].icon||t[7])&&q2(t);const u=t[13].default,f=Ze(u,t,t[12],null);let c=[{type:"button"},{id:t[8]},{disabled:t[3]},{"aria-disabled":t[3]},{tabindex:l=t[3]?"-1":void 0},t[10]],d={};for(let h=0;h{a=null}),ce()),f&&f.p&&(!r||g&4096)&&Ke(f,u,h,h[12],r?Xe(u,h[12],g,null):$e(h[12]),null),Ae(e,d=Ue(c,[{type:"button"},(!r||g&256)&&{id:h[8]},(!r||g&8)&&{disabled:h[3]},(!r||g&8)&&{"aria-disabled":h[3]},(!r||g&8&&l!==(l=h[3]?"-1":void 0))&&{tabindex:l},g&1024&&h[10]])),E(e,"bx--tag",!0),E(e,"bx--tag--interactive",!0),E(e,"bx--tag--disabled",h[3]),E(e,"bx--tag--sm",h[1]==="sm"),E(e,"bx--tag--red",h[0]==="red"),E(e,"bx--tag--magenta",h[0]==="magenta"),E(e,"bx--tag--purple",h[0]==="purple"),E(e,"bx--tag--blue",h[0]==="blue"),E(e,"bx--tag--cyan",h[0]==="cyan"),E(e,"bx--tag--teal",h[0]==="teal"),E(e,"bx--tag--green",h[0]==="green"),E(e,"bx--tag--gray",h[0]==="gray"),E(e,"bx--tag--cool-gray",h[0]==="cool-gray"),E(e,"bx--tag--warm-gray",h[0]==="warm-gray"),E(e,"bx--tag--high-contrast",h[0]==="high-contrast"),E(e,"bx--tag--outline",h[0]==="outline")},i(h){r||(b(a),b(f,h),r=!0)},o(h){k(a),k(f,h),r=!1},d(h){h&&w(e),a&&a.d(),f&&f.d(h),s=!1,vt(o)}}}function hF(t){let e,n,i,l,r,s,o;const a=t[13].default,u=Ze(a,t,t[12],V2),f=u||pF(t);l=new ql({});let c=[{"aria-label":t[6]},{id:t[8]},t[10]],d={};for(let h=0;h{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function q2(t){let e,n;const i=t[13].icon,l=Ze(i,t,t[12],G2),r=l||_F(t);return{c(){e=R("div"),r&&r.c(),E(e,"bx--tag__custom-icon",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&4096)&&Ke(l,i,s,s[12],n?Xe(i,s[12],o,uF):$e(s[12]),G2):r&&r.p&&(!n||o&128)&&r.p(s,n?o:-1)},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function _F(t){let e,n,i;var l=t[7];function r(s,o){return{}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&128&&l!==(l=s[7])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function pF(t){let e,n;return{c(){e=R("span"),n=q(t[0]),E(e,"bx--tag__label",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&1&&Z(n,i[0])},d(i){i&&w(e)}}}function bF(t){let e,n,i,l;const r=[mF,hF,dF,cF],s=[];function o(a,u){return a[5]?0:a[2]?1:a[4]?2:3}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,[u]){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function vF(t,e,n){const i=["type","size","filter","disabled","interactive","skeleton","title","icon","id"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e;const o=Yi(r);let{type:a=void 0}=e,{size:u="default"}=e,{filter:f=!1}=e,{disabled:c=!1}=e,{interactive:d=!1}=e,{skeleton:h=!1}=e,{title:g="Clear filter"}=e,{icon:_=void 0}=e,{id:v="ccs-"+Math.random().toString(36)}=e;const S=yn();function A(re){te.call(this,t,re)}function C(re){te.call(this,t,re)}function I(re){te.call(this,t,re)}function M(re){te.call(this,t,re)}function L(re){te.call(this,t,re)}function N(re){te.call(this,t,re)}function z(re){te.call(this,t,re)}function W(re){te.call(this,t,re)}function D(re){te.call(this,t,re)}function G(re){te.call(this,t,re)}function $(re){te.call(this,t,re)}function j(re){te.call(this,t,re)}function Q(re){te.call(this,t,re)}function le(re){te.call(this,t,re)}function oe(re){te.call(this,t,re)}function X(re){te.call(this,t,re)}const de=()=>{S("close")};return t.$$set=re=>{e=Y(Y({},e),Se(re)),n(10,l=ae(e,i)),"type"in re&&n(0,a=re.type),"size"in re&&n(1,u=re.size),"filter"in re&&n(2,f=re.filter),"disabled"in re&&n(3,c=re.disabled),"interactive"in re&&n(4,d=re.interactive),"skeleton"in re&&n(5,h=re.skeleton),"title"in re&&n(6,g=re.title),"icon"in re&&n(7,_=re.icon),"id"in re&&n(8,v=re.id),"$$scope"in re&&n(12,s=re.$$scope)},[a,u,f,c,d,h,g,_,v,S,l,o,s,r,A,C,I,M,L,N,z,W,D,G,$,j,Q,le,oe,X,de]}class kF extends De{constructor(e){super(),Re(this,e,vF,bF,Ie,{type:0,size:1,filter:2,disabled:3,interactive:4,skeleton:5,title:6,icon:7,id:8})}}const Vt=kF,wF=t=>({}),j2=t=>({});function Y2(t){let e,n,i,l;const r=t[20].labelText,s=Ze(r,t,t[19],j2),o=s||yF(t);let a=t[5]&&Z2(t);return{c(){e=R("div"),n=R("label"),o&&o.c(),i=B(),a&&a.c(),P(n,"for",t[14]),E(n,"bx--label",!0),E(n,"bx--visually-hidden",t[11]),E(n,"bx--label--disabled",t[7]),E(e,"bx--text-area__label-wrapper",!0)},m(u,f){y(u,e,f),T(e,n),o&&o.m(n,null),T(e,i),a&&a.m(e,null),l=!0},p(u,f){s?s.p&&(!l||f[0]&524288)&&Ke(s,r,u,u[19],l?Xe(r,u[19],f,wF):$e(u[19]),j2):o&&o.p&&(!l||f[0]&1024)&&o.p(u,l?f:[-1,-1]),(!l||f[0]&16384)&&P(n,"for",u[14]),(!l||f[0]&2048)&&E(n,"bx--visually-hidden",u[11]),(!l||f[0]&128)&&E(n,"bx--label--disabled",u[7]),u[5]?a?a.p(u,f):(a=Z2(u),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i(u){l||(b(o,u),l=!0)},o(u){k(o,u),l=!1},d(u){u&&w(e),o&&o.d(u),a&&a.d()}}}function yF(t){let e;return{c(){e=q(t[10])},m(n,i){y(n,e,i)},p(n,i){i[0]&1024&&Z(e,n[10])},d(n){n&&w(e)}}}function Z2(t){let e,n=t[0].length+"",i,l,r;return{c(){e=R("div"),i=q(n),l=q("/"),r=q(t[5]),E(e,"bx--label",!0),E(e,"bx--label--disabled",t[7])},m(s,o){y(s,e,o),T(e,i),T(e,l),T(e,r)},p(s,o){o[0]&1&&n!==(n=s[0].length+"")&&Z(i,n),o[0]&32&&Z(r,s[5]),o[0]&128&&E(e,"bx--label--disabled",s[7])},d(s){s&&w(e)}}}function X2(t){let e,n;return e=new Os({props:{class:"bx--text-area__invalid-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function K2(t){let e,n;return{c(){e=R("div"),n=q(t[9]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[7])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&512&&Z(n,i[9]),l[0]&128&&E(e,"bx--form__helper-text--disabled",i[7])},d(i){i&&w(e)}}}function $2(t){let e,n;return{c(){e=R("div"),n=q(t[13]),P(e,"id",t[16]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&8192&&Z(n,i[13]),l[0]&65536&&P(e,"id",i[16])},d(i){i&&w(e)}}}function TF(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_=(t[10]||t[17].labelText)&&!t[11]&&Y2(t),v=t[12]&&X2(),S=[{"aria-invalid":s=t[12]||void 0},{"aria-describedby":o=t[12]?t[16]:void 0},{disabled:t[7]},{id:t[14]},{name:t[15]},{cols:t[3]},{rows:t[4]},{placeholder:t[2]},{readOnly:t[8]},{maxlength:a=t[5]??void 0},t[18]],A={};for(let M=0;M{_=null}),ce()),M[12]?v?L[0]&4096&&b(v,1):(v=X2(),v.c(),b(v,1),v.m(i,l)):v&&(fe(),k(v,1,1,()=>{v=null}),ce()),Ae(r,A=Ue(S,[(!d||L[0]&4096&&s!==(s=M[12]||void 0))&&{"aria-invalid":s},(!d||L[0]&69632&&o!==(o=M[12]?M[16]:void 0))&&{"aria-describedby":o},(!d||L[0]&128)&&{disabled:M[7]},(!d||L[0]&16384)&&{id:M[14]},(!d||L[0]&32768)&&{name:M[15]},(!d||L[0]&8)&&{cols:M[3]},(!d||L[0]&16)&&{rows:M[4]},(!d||L[0]&4)&&{placeholder:M[2]},(!d||L[0]&256)&&{readOnly:M[8]},(!d||L[0]&32&&a!==(a=M[5]??void 0))&&{maxlength:a},L[0]&262144&&M[18]])),L[0]&1&&Wl(r,M[0]),E(r,"bx--text-area",!0),E(r,"bx--text-area--light",M[6]),E(r,"bx--text-area--invalid",M[12]),(!d||L[0]&4096&&u!==(u=M[12]||void 0))&&P(i,"data-invalid",u),!M[12]&&M[9]?C?C.p(M,L):(C=K2(M),C.c(),C.m(e,c)):C&&(C.d(1),C=null),M[12]?I?I.p(M,L):(I=$2(M),I.c(),I.m(e,null)):I&&(I.d(1),I=null)},i(M){d||(b(_),b(v),d=!0)},o(M){k(_),k(v),d=!1},d(M){M&&w(e),_&&_.d(),v&&v.d(),t[32](null),C&&C.d(),I&&I.d(),h=!1,vt(g)}}}function SF(t,e,n){let i;const l=["value","placeholder","cols","rows","maxCount","light","disabled","readonly","helperText","labelText","hideLabel","invalid","invalidText","id","name","ref"];let r=ae(e,l),{$$slots:s={},$$scope:o}=e;const a=Yi(s);let{value:u=""}=e,{placeholder:f=""}=e,{cols:c=50}=e,{rows:d=4}=e,{maxCount:h=void 0}=e,{light:g=!1}=e,{disabled:_=!1}=e,{readonly:v=!1}=e,{helperText:S=""}=e,{labelText:A=""}=e,{hideLabel:C=!1}=e,{invalid:I=!1}=e,{invalidText:M=""}=e,{id:L="ccs-"+Math.random().toString(36)}=e,{name:N=void 0}=e,{ref:z=null}=e;function W(ee){te.call(this,t,ee)}function D(ee){te.call(this,t,ee)}function G(ee){te.call(this,t,ee)}function $(ee){te.call(this,t,ee)}function j(ee){te.call(this,t,ee)}function Q(ee){te.call(this,t,ee)}function le(ee){te.call(this,t,ee)}function oe(ee){te.call(this,t,ee)}function X(ee){te.call(this,t,ee)}function de(ee){te.call(this,t,ee)}function re(ee){te.call(this,t,ee)}function x(ee){ft[ee?"unshift":"push"](()=>{z=ee,n(1,z)})}function me(){u=this.value,n(0,u)}return t.$$set=ee=>{e=Y(Y({},e),Se(ee)),n(18,r=ae(e,l)),"value"in ee&&n(0,u=ee.value),"placeholder"in ee&&n(2,f=ee.placeholder),"cols"in ee&&n(3,c=ee.cols),"rows"in ee&&n(4,d=ee.rows),"maxCount"in ee&&n(5,h=ee.maxCount),"light"in ee&&n(6,g=ee.light),"disabled"in ee&&n(7,_=ee.disabled),"readonly"in ee&&n(8,v=ee.readonly),"helperText"in ee&&n(9,S=ee.helperText),"labelText"in ee&&n(10,A=ee.labelText),"hideLabel"in ee&&n(11,C=ee.hideLabel),"invalid"in ee&&n(12,I=ee.invalid),"invalidText"in ee&&n(13,M=ee.invalidText),"id"in ee&&n(14,L=ee.id),"name"in ee&&n(15,N=ee.name),"ref"in ee&&n(1,z=ee.ref),"$$scope"in ee&&n(19,o=ee.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&16384&&n(16,i=`error-${L}`)},[u,z,f,c,d,h,g,_,v,S,A,C,I,M,L,N,i,a,r,o,s,W,D,G,$,j,Q,le,oe,X,de,re,x,me]}class EF extends De{constructor(e){super(),Re(this,e,SF,TF,Ie,{value:0,placeholder:2,cols:3,rows:4,maxCount:5,light:6,disabled:7,readonly:8,helperText:9,labelText:10,hideLabel:11,invalid:12,invalidText:13,id:14,name:15,ref:1},null,[-1,-1])}}const GT=EF,MF=t=>({}),J2=t=>({}),OF=t=>({}),Q2=t=>({});function x2(t){let e,n,i,l=t[9]&&ev(t),r=!t[22]&&t[6]&&tv(t);return{c(){e=R("div"),l&&l.c(),n=B(),r&&r.c(),E(e,"bx--text-input__label-helper-wrapper",!0)},m(s,o){y(s,e,o),l&&l.m(e,null),T(e,n),r&&r.m(e,null),i=!0},p(s,o){s[9]?l?(l.p(s,o),o[0]&512&&b(l,1)):(l=ev(s),l.c(),b(l,1),l.m(e,n)):l&&(fe(),k(l,1,1,()=>{l=null}),ce()),!s[22]&&s[6]?r?r.p(s,o):(r=tv(s),r.c(),r.m(e,null)):r&&(r.d(1),r=null)},i(s){i||(b(l),i=!0)},o(s){k(l),i=!1},d(s){s&&w(e),l&&l.d(),r&&r.d()}}}function ev(t){let e,n;const i=t[28].labelText,l=Ze(i,t,t[27],Q2),r=l||AF(t);return{c(){e=R("label"),r&&r.c(),P(e,"for",t[7]),E(e,"bx--label",!0),E(e,"bx--visually-hidden",t[10]),E(e,"bx--label--disabled",t[5]),E(e,"bx--label--inline",t[16]),E(e,"bx--label--inline--sm",t[2]==="sm"),E(e,"bx--label--inline--xl",t[2]==="xl")},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&134217728)&&Ke(l,i,s,s[27],n?Xe(i,s[27],o,OF):$e(s[27]),Q2):r&&r.p&&(!n||o[0]&512)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&128)&&P(e,"for",s[7]),(!n||o[0]&1024)&&E(e,"bx--visually-hidden",s[10]),(!n||o[0]&32)&&E(e,"bx--label--disabled",s[5]),(!n||o[0]&65536)&&E(e,"bx--label--inline",s[16]),(!n||o[0]&4)&&E(e,"bx--label--inline--sm",s[2]==="sm"),(!n||o[0]&4)&&E(e,"bx--label--inline--xl",s[2]==="xl")},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function AF(t){let e;return{c(){e=q(t[9])},m(n,i){y(n,e,i)},p(n,i){i[0]&512&&Z(e,n[9])},d(n){n&&w(e)}}}function tv(t){let e,n;return{c(){e=R("div"),n=q(t[6]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[5]),E(e,"bx--form__helper-text--inline",t[16])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&64&&Z(n,i[6]),l[0]&32&&E(e,"bx--form__helper-text--disabled",i[5]),l[0]&65536&&E(e,"bx--form__helper-text--inline",i[16])},d(i){i&&w(e)}}}function nv(t){let e,n;const i=t[28].labelText,l=Ze(i,t,t[27],J2),r=l||CF(t);return{c(){e=R("label"),r&&r.c(),P(e,"for",t[7]),E(e,"bx--label",!0),E(e,"bx--visually-hidden",t[10]),E(e,"bx--label--disabled",t[5]),E(e,"bx--label--inline",t[16]),E(e,"bx--label--inline-sm",t[16]&&t[2]==="sm"),E(e,"bx--label--inline-xl",t[16]&&t[2]==="xl")},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&134217728)&&Ke(l,i,s,s[27],n?Xe(i,s[27],o,MF):$e(s[27]),J2):r&&r.p&&(!n||o[0]&512)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&128)&&P(e,"for",s[7]),(!n||o[0]&1024)&&E(e,"bx--visually-hidden",s[10]),(!n||o[0]&32)&&E(e,"bx--label--disabled",s[5]),(!n||o[0]&65536)&&E(e,"bx--label--inline",s[16]),(!n||o[0]&65540)&&E(e,"bx--label--inline-sm",s[16]&&s[2]==="sm"),(!n||o[0]&65540)&&E(e,"bx--label--inline-xl",s[16]&&s[2]==="xl")},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function CF(t){let e;return{c(){e=q(t[9])},m(n,i){y(n,e,i)},p(n,i){i[0]&512&&Z(e,n[9])},d(n){n&&w(e)}}}function LF(t){let e,n,i,l=t[11]&&iv(),r=!t[11]&&t[13]&&lv();return{c(){l&&l.c(),e=B(),r&&r.c(),n=qe()},m(s,o){l&&l.m(s,o),y(s,e,o),r&&r.m(s,o),y(s,n,o),i=!0},p(s,o){s[11]?l?o[0]&2048&&b(l,1):(l=iv(),l.c(),b(l,1),l.m(e.parentNode,e)):l&&(fe(),k(l,1,1,()=>{l=null}),ce()),!s[11]&&s[13]?r?o[0]&10240&&b(r,1):(r=lv(),r.c(),b(r,1),r.m(n.parentNode,n)):r&&(fe(),k(r,1,1,()=>{r=null}),ce())},i(s){i||(b(l),b(r),i=!0)},o(s){k(l),k(r),i=!1},d(s){s&&(w(e),w(n)),l&&l.d(s),r&&r.d(s)}}}function IF(t){let e,n;return e=new JH({props:{class:"bx--text-input__readonly-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function iv(t){let e,n;return e=new Os({props:{class:"bx--text-input__invalid-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function lv(t){let e,n;return e=new Lu({props:{class:`bx--text-input__invalid-icon bx--text-input__invalid-icon--warning`}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function rv(t){let e;return{c(){e=R("hr"),E(e,"bx--text-input__divider",!0)},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function sv(t){let e,n;return{c(){e=R("div"),n=q(t[12]),P(e,"id",t[19]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&4096&&Z(n,i[12]),l[0]&524288&&P(e,"id",i[19])},d(i){i&&w(e)}}}function ov(t){let e,n;return{c(){e=R("div"),n=q(t[14]),P(e,"id",t[18]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&16384&&Z(n,i[14]),l[0]&262144&&P(e,"id",i[18])},d(i){i&&w(e)}}}function av(t){let e,n;return{c(){e=R("div"),n=q(t[6]),P(e,"id",t[20]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[5]),E(e,"bx--form__helper-text--inline",t[16])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&64&&Z(n,i[6]),l[0]&1048576&&P(e,"id",i[20]),l[0]&32&&E(e,"bx--form__helper-text--disabled",i[5]),l[0]&65536&&E(e,"bx--form__helper-text--inline",i[16])},d(i){i&&w(e)}}}function uv(t){let e,n;return{c(){e=R("div"),n=q(t[12]),P(e,"id",t[19]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&4096&&Z(n,i[12]),l[0]&524288&&P(e,"id",i[19])},d(i){i&&w(e)}}}function fv(t){let e,n;return{c(){e=R("div"),n=q(t[14]),P(e,"id",t[18]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&16384&&Z(n,i[14]),l[0]&262144&&P(e,"id",i[18])},d(i){i&&w(e)}}}function RF(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,L,N,z,W=t[16]&&x2(t),D=!t[16]&&(t[9]||t[26].labelText)&&nv(t);const G=[IF,LF],$=[];function j(ee,ke){return ee[17]?0:1}s=j(t),o=$[s]=G[s](t);let Q=[{"data-invalid":f=t[21]||void 0},{"aria-invalid":c=t[21]||void 0},{"data-warn":d=t[13]||void 0},{"aria-describedby":h=t[21]?t[19]:t[13]?t[18]:t[6]?t[20]:void 0},{disabled:t[5]},{id:t[7]},{name:t[8]},{placeholder:t[3]},{required:t[15]},{readOnly:t[17]},t[25]],le={};for(let ee=0;ee{W=null}),ce()),!ee[16]&&(ee[9]||ee[26].labelText)?D?(D.p(ee,ke),ke[0]&67174912&&b(D,1)):(D=nv(ee),D.c(),b(D,1),D.m(e,i)):D&&(fe(),k(D,1,1,()=>{D=null}),ce());let pe=s;s=j(ee),s===pe?$[s].p(ee,ke):(fe(),k($[pe],1,1,()=>{$[pe]=null}),ce(),o=$[s],o?o.p(ee,ke):(o=$[s]=G[s](ee),o.c()),b(o,1),o.m(r,a)),Ae(u,le=Ue(Q,[(!L||ke[0]&2097152&&f!==(f=ee[21]||void 0))&&{"data-invalid":f},(!L||ke[0]&2097152&&c!==(c=ee[21]||void 0))&&{"aria-invalid":c},(!L||ke[0]&8192&&d!==(d=ee[13]||void 0))&&{"data-warn":d},(!L||ke[0]&3940416&&h!==(h=ee[21]?ee[19]:ee[13]?ee[18]:ee[6]?ee[20]:void 0))&&{"aria-describedby":h},(!L||ke[0]&32)&&{disabled:ee[5]},(!L||ke[0]&128)&&{id:ee[7]},(!L||ke[0]&256)&&{name:ee[8]},(!L||ke[0]&8)&&{placeholder:ee[3]},(!L||ke[0]&32768)&&{required:ee[15]},(!L||ke[0]&131072)&&{readOnly:ee[17]},ke[0]&33554432&&ee[25]])),ke[0]&1&&u.value!==ee[0]&&Wl(u,ee[0]),E(u,"bx--text-input",!0),E(u,"bx--text-input--light",ee[4]),E(u,"bx--text-input--invalid",ee[21]),E(u,"bx--text-input--warning",ee[13]),E(u,"bx--text-input--sm",ee[2]==="sm"),E(u,"bx--text-input--xl",ee[2]==="xl"),ee[22]?oe||(oe=rv(),oe.c(),oe.m(r,_)):oe&&(oe.d(1),oe=null),ee[22]&&!ee[16]&&ee[11]?X?X.p(ee,ke):(X=sv(ee),X.c(),X.m(r,v)):X&&(X.d(1),X=null),ee[22]&&!ee[16]&&ee[13]?de?de.p(ee,ke):(de=ov(ee),de.c(),de.m(r,null)):de&&(de.d(1),de=null),(!L||ke[0]&2097152&&S!==(S=ee[21]||void 0))&&P(r,"data-invalid",S),(!L||ke[0]&8192&&A!==(A=ee[13]||void 0))&&P(r,"data-warn",A),(!L||ke[0]&10240)&&E(r,"bx--text-input__field-wrapper--warning",!ee[11]&&ee[13]),!ee[11]&&!ee[13]&&!ee[22]&&!ee[16]&&ee[6]?re?re.p(ee,ke):(re=av(ee),re.c(),re.m(l,I)):re&&(re.d(1),re=null),!ee[22]&&ee[11]?x?x.p(ee,ke):(x=uv(ee),x.c(),x.m(l,M)):x&&(x.d(1),x=null),!ee[22]&&!ee[11]&&ee[13]?me?me.p(ee,ke):(me=fv(ee),me.c(),me.m(l,null)):me&&(me.d(1),me=null),(!L||ke[0]&65536)&&E(l,"bx--text-input__field-outer-wrapper--inline",ee[16]),(!L||ke[0]&65536)&&E(e,"bx--text-input-wrapper--inline",ee[16]),(!L||ke[0]&16)&&E(e,"bx--text-input-wrapper--light",ee[4]),(!L||ke[0]&131072)&&E(e,"bx--text-input-wrapper--readonly",ee[17])},i(ee){L||(b(W),b(D),b(o),L=!0)},o(ee){k(W),k(D),k(o),L=!1},d(ee){ee&&w(e),W&&W.d(),D&&D.d(),$[s].d(),t[38](null),oe&&oe.d(),X&&X.d(),de&&de.d(),re&&re.d(),x&&x.d(),me&&me.d(),N=!1,vt(z)}}}function DF(t,e,n){let i,l,r,s,o;const a=["size","value","placeholder","light","disabled","helperText","id","name","labelText","hideLabel","invalid","invalidText","warn","warnText","ref","required","inline","readonly"];let u=ae(e,a),{$$slots:f={},$$scope:c}=e;const d=Yi(f);let{size:h=void 0}=e,{value:g=""}=e,{placeholder:_=""}=e,{light:v=!1}=e,{disabled:S=!1}=e,{helperText:A=""}=e,{id:C="ccs-"+Math.random().toString(36)}=e,{name:I=void 0}=e,{labelText:M=""}=e,{hideLabel:L=!1}=e,{invalid:N=!1}=e,{invalidText:z=""}=e,{warn:W=!1}=e,{warnText:D=""}=e,{ref:G=null}=e,{required:$=!1}=e,{inline:j=!1}=e,{readonly:Q=!1}=e;const le=bi("Form"),oe=yn();function X(be){return u.type!=="number"?be:be!=""?Number(be):null}const de=be=>{n(0,g=X(be.target.value)),oe("input",g)},re=be=>{oe("change",X(be.target.value))};function x(be){te.call(this,t,be)}function me(be){te.call(this,t,be)}function ee(be){te.call(this,t,be)}function ke(be){te.call(this,t,be)}function pe(be){te.call(this,t,be)}function Fe(be){te.call(this,t,be)}function Ve(be){te.call(this,t,be)}function Ee(be){te.call(this,t,be)}function We(be){te.call(this,t,be)}function ge(be){ft[be?"unshift":"push"](()=>{G=be,n(1,G)})}function ve(){g=this.value,n(0,g)}return t.$$set=be=>{e=Y(Y({},e),Se(be)),n(25,u=ae(e,a)),"size"in be&&n(2,h=be.size),"value"in be&&n(0,g=be.value),"placeholder"in be&&n(3,_=be.placeholder),"light"in be&&n(4,v=be.light),"disabled"in be&&n(5,S=be.disabled),"helperText"in be&&n(6,A=be.helperText),"id"in be&&n(7,C=be.id),"name"in be&&n(8,I=be.name),"labelText"in be&&n(9,M=be.labelText),"hideLabel"in be&&n(10,L=be.hideLabel),"invalid"in be&&n(11,N=be.invalid),"invalidText"in be&&n(12,z=be.invalidText),"warn"in be&&n(13,W=be.warn),"warnText"in be&&n(14,D=be.warnText),"ref"in be&&n(1,G=be.ref),"required"in be&&n(15,$=be.required),"inline"in be&&n(16,j=be.inline),"readonly"in be&&n(17,Q=be.readonly),"$$scope"in be&&n(27,c=be.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&133120&&n(21,l=N&&!Q),t.$$.dirty[0]&128&&n(20,r=`helper-${C}`),t.$$.dirty[0]&128&&n(19,s=`error-${C}`),t.$$.dirty[0]&128&&n(18,o=`warn-${C}`)},n(22,i=!!le&&le.isFluid),[g,G,h,_,v,S,A,C,I,M,L,N,z,W,D,$,j,Q,o,s,r,l,i,de,re,u,d,c,f,x,me,ee,ke,pe,Fe,Ve,Ee,We,ge,ve]}class PF extends De{constructor(e){super(),Re(this,e,DF,RF,Ie,{size:2,value:0,placeholder:3,light:4,disabled:5,helperText:6,id:7,name:8,labelText:9,hideLabel:10,invalid:11,invalidText:12,warn:13,warnText:14,ref:1,required:15,inline:16,readonly:17},null,[-1,-1])}}const Jn=PF;function cv(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function NF(t){let e,n,i,l=t[1]&&cv(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class zF extends De{constructor(e){super(),Re(this,e,BF,NF,Ie,{size:0,title:1})}}const HF=zF;function dv(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function UF(t){let e,n,i,l=t[1]&&dv(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class GF extends De{constructor(e){super(),Re(this,e,FF,UF,Ie,{size:0,title:1})}}const VF=GF,WF=t=>({}),hv=t=>({}),qF=t=>({}),mv=t=>({});function gv(t){let e,n,i,l;const r=t[28].labelText,s=Ze(r,t,t[27],mv),o=s||jF(t);let a=!t[24]&&t[11]&&_v(t);return{c(){e=R("label"),o&&o.c(),n=B(),a&&a.c(),i=qe(),P(e,"for",t[19]),E(e,"bx--label",!0),E(e,"bx--visually-hidden",t[13]),E(e,"bx--label--disabled",t[10]),E(e,"bx--label--inline",t[18]),E(e,"bx--label--inline--sm",t[18]&&t[3]==="sm"),E(e,"bx--label--inline--xl",t[18]&&t[3]==="xl")},m(u,f){y(u,e,f),o&&o.m(e,null),y(u,n,f),a&&a.m(u,f),y(u,i,f),l=!0},p(u,f){s?s.p&&(!l||f[0]&134217728)&&Ke(s,r,u,u[27],l?Xe(r,u[27],f,qF):$e(u[27]),mv):o&&o.p&&(!l||f[0]&4096)&&o.p(u,l?f:[-1,-1]),(!l||f[0]&524288)&&P(e,"for",u[19]),(!l||f[0]&8192)&&E(e,"bx--visually-hidden",u[13]),(!l||f[0]&1024)&&E(e,"bx--label--disabled",u[10]),(!l||f[0]&262144)&&E(e,"bx--label--inline",u[18]),(!l||f[0]&262152)&&E(e,"bx--label--inline--sm",u[18]&&u[3]==="sm"),(!l||f[0]&262152)&&E(e,"bx--label--inline--xl",u[18]&&u[3]==="xl"),!u[24]&&u[11]?a?a.p(u,f):(a=_v(u),a.c(),a.m(i.parentNode,i)):a&&(a.d(1),a=null)},i(u){l||(b(o,u),l=!0)},o(u){k(o,u),l=!1},d(u){u&&(w(e),w(n),w(i)),o&&o.d(u),a&&a.d(u)}}}function jF(t){let e;return{c(){e=q(t[12])},m(n,i){y(n,e,i)},p(n,i){i[0]&4096&&Z(e,n[12])},d(n){n&&w(e)}}}function _v(t){let e,n;return{c(){e=R("div"),n=q(t[11]),P(e,"id",t[23]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[10]),E(e,"bx--form__helper-text--inline",t[18])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&2048&&Z(n,i[11]),l[0]&8388608&&P(e,"id",i[23]),l[0]&1024&&E(e,"bx--form__helper-text--disabled",i[10]),l[0]&262144&&E(e,"bx--form__helper-text--inline",i[18])},d(i){i&&w(e)}}}function pv(t){let e,n;const i=t[28].labelText,l=Ze(i,t,t[27],hv),r=l||YF(t);return{c(){e=R("label"),r&&r.c(),P(e,"for",t[19]),E(e,"bx--label",!0),E(e,"bx--visually-hidden",t[13]),E(e,"bx--label--disabled",t[10]),E(e,"bx--label--inline",t[18]),E(e,"bx--label--inline--sm",t[18]&&t[3]==="sm"),E(e,"bx--label--inline--xl",t[18]&&t[3]==="xl")},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o[0]&134217728)&&Ke(l,i,s,s[27],n?Xe(i,s[27],o,WF):$e(s[27]),hv):r&&r.p&&(!n||o[0]&4096)&&r.p(s,n?o:[-1,-1]),(!n||o[0]&524288)&&P(e,"for",s[19]),(!n||o[0]&8192)&&E(e,"bx--visually-hidden",s[13]),(!n||o[0]&1024)&&E(e,"bx--label--disabled",s[10]),(!n||o[0]&262144)&&E(e,"bx--label--inline",s[18]),(!n||o[0]&262152)&&E(e,"bx--label--inline--sm",s[18]&&s[3]==="sm"),(!n||o[0]&262152)&&E(e,"bx--label--inline--xl",s[18]&&s[3]==="xl")},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function YF(t){let e;return{c(){e=q(t[12])},m(n,i){y(n,e,i)},p(n,i){i[0]&4096&&Z(e,n[12])},d(n){n&&w(e)}}}function bv(t){let e,n;return e=new Os({props:{class:"bx--text-input__invalid-icon"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function vv(t){let e,n;return e=new Lu({props:{class:`bx--text-input__invalid-icon - bx--text-input__invalid-icon--warning`}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function kv(t){let e,n,i,l;return{c(){e=R("hr"),n=B(),i=R("div"),l=q(t[15]),P(e,"class","bx--text-input__divider"),P(i,"class","bx--form-requirement"),P(i,"id",t[22])},m(r,s){y(r,e,s),y(r,n,s),y(r,i,s),T(i,l)},p(r,s){s[0]&32768&&Z(l,r[15]),s[0]&4194304&&P(i,"id",r[22])},d(r){r&&(w(e),w(n),w(i))}}}function wv(t){let e,n,i,l,r,s,o,a=!t[10]&&yv(t);const u=[$F,KF],f=[];function c(d,h){return d[1]==="text"?0:1}return i=c(t),l=f[i]=u[i](t),{c(){e=R("button"),a&&a.c(),n=B(),l.c(),P(e,"type","button"),e.disabled=t[10],E(e,"bx--text-input--password__visibility__toggle",!0),E(e,"bx--btn",!0),E(e,"bx--btn--icon-only",!0),E(e,"bx--btn--disabled",t[10]),E(e,"bx--tooltip__trigger",!0),E(e,"bx--tooltip--a11y",!0),E(e,"bx--tooltip--top",t[8]==="top"),E(e,"bx--tooltip--right",t[8]==="right"),E(e,"bx--tooltip--bottom",t[8]==="bottom"),E(e,"bx--tooltip--left",t[8]==="left"),E(e,"bx--tooltip--align-start",t[7]==="start"),E(e,"bx--tooltip--align-center",t[7]==="center"),E(e,"bx--tooltip--align-end",t[7]==="end")},m(d,h){y(d,e,h),a&&a.m(e,null),T(e,n),f[i].m(e,null),r=!0,s||(o=J(e,"click",t[42]),s=!0)},p(d,h){d[10]?a&&(a.d(1),a=null):a?a.p(d,h):(a=yv(d),a.c(),a.m(e,n));let g=i;i=c(d),i!==g&&(fe(),k(f[g],1,1,()=>{f[g]=null}),ce(),l=f[i],l||(l=f[i]=u[i](d),l.c()),b(l,1),l.m(e,null)),(!r||h[0]&1024)&&(e.disabled=d[10]),(!r||h[0]&1024)&&E(e,"bx--btn--disabled",d[10]),(!r||h[0]&256)&&E(e,"bx--tooltip--top",d[8]==="top"),(!r||h[0]&256)&&E(e,"bx--tooltip--right",d[8]==="right"),(!r||h[0]&256)&&E(e,"bx--tooltip--bottom",d[8]==="bottom"),(!r||h[0]&256)&&E(e,"bx--tooltip--left",d[8]==="left"),(!r||h[0]&128)&&E(e,"bx--tooltip--align-start",d[7]==="start"),(!r||h[0]&128)&&E(e,"bx--tooltip--align-center",d[7]==="center"),(!r||h[0]&128)&&E(e,"bx--tooltip--align-end",d[7]==="end")},i(d){r||(b(l),r=!0)},o(d){k(l),r=!1},d(d){d&&w(e),a&&a.d(),f[i].d(),s=!1,o()}}}function yv(t){let e;function n(r,s){return r[1]==="text"?XF:ZF}let i=n(t),l=i(t);return{c(){e=R("span"),l.c(),E(e,"bx--assistive-text",!0)},m(r,s){y(r,e,s),l.m(e,null)},p(r,s){i===(i=n(r))&&l?l.p(r,s):(l.d(1),l=i(r),l&&(l.c(),l.m(e,null)))},d(r){r&&w(e),l.d()}}}function ZF(t){let e;return{c(){e=q(t[6])},m(n,i){y(n,e,i)},p(n,i){i[0]&64&&Z(e,n[6])},d(n){n&&w(e)}}}function XF(t){let e;return{c(){e=q(t[5])},m(n,i){y(n,e,i)},p(n,i){i[0]&32&&Z(e,n[5])},d(n){n&&w(e)}}}function KF(t){let e,n;return e=new HF({props:{class:"bx--icon-visibility-on"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function $F(t){let e,n;return e=new VF({props:{class:"bx--icon-visibility-off"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Tv(t){let e,n;return{c(){e=R("div"),n=q(t[15]),P(e,"id",t[22]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&32768&&Z(n,i[15]),l[0]&4194304&&P(e,"id",i[22])},d(i){i&&w(e)}}}function Sv(t){let e,n;return{c(){e=R("div"),n=q(t[11]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[10]),E(e,"bx--form__helper-text--inline",t[18])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&2048&&Z(n,i[11]),l[0]&1024&&E(e,"bx--form__helper-text--disabled",i[10]),l[0]&262144&&E(e,"bx--form__helper-text--inline",i[18])},d(i){i&&w(e)}}}function Ev(t){let e,n;return{c(){e=R("div"),n=q(t[17]),P(e,"id",t[21]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&131072&&Z(n,i[17]),l[0]&2097152&&P(e,"id",i[21])},d(i){i&&w(e)}}}function JF(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,L=t[18]&&gv(t),N=!t[18]&&(t[12]||t[25].labelText)&&pv(t),z=t[14]&&bv(),W=!t[14]&&t[16]&&vv(),D=[{"data-invalid":u=t[14]||void 0},{"aria-invalid":f=t[14]||void 0},{"aria-describedby":c=t[14]?t[22]:t[16]?t[21]:t[11]?t[23]:void 0},{id:t[19]},{name:t[20]},{placeholder:t[4]},{type:t[1]},{value:d=t[0]??""},{disabled:t[10]},t[26]],G={};for(let X=0;X{L=null}),ce()),!X[18]&&(X[12]||X[25].labelText)?N?(N.p(X,de),de[0]&33820672&&b(N,1)):(N=pv(X),N.c(),b(N,1),N.m(e,i)):N&&(fe(),k(N,1,1,()=>{N=null}),ce()),X[14]?z?de[0]&16384&&b(z,1):(z=bv(),z.c(),b(z,1),z.m(r,s)):z&&(fe(),k(z,1,1,()=>{z=null}),ce()),!X[14]&&X[16]?W?de[0]&81920&&b(W,1):(W=vv(),W.c(),b(W,1),W.m(r,o)):W&&(fe(),k(W,1,1,()=>{W=null}),ce()),Ae(a,G=Ue(D,[(!C||de[0]&16384&&u!==(u=X[14]||void 0))&&{"data-invalid":u},(!C||de[0]&16384&&f!==(f=X[14]||void 0))&&{"aria-invalid":f},(!C||de[0]&14764032&&c!==(c=X[14]?X[22]:X[16]?X[21]:X[11]?X[23]:void 0))&&{"aria-describedby":c},(!C||de[0]&524288)&&{id:X[19]},(!C||de[0]&1048576)&&{name:X[20]},(!C||de[0]&16)&&{placeholder:X[4]},(!C||de[0]&2)&&{type:X[1]},(!C||de[0]&1&&d!==(d=X[0]??"")&&a.value!==d)&&{value:d},(!C||de[0]&1024)&&{disabled:X[10]},de[0]&67108864&&X[26]])),"value"in G&&(a.value=G.value),E(a,"bx--text-input",!0),E(a,"bx--password-input",!0),E(a,"bx--text-input--light",X[9]),E(a,"bx--text-input--invalid",X[14]),E(a,"bx--text-input--warning",X[16]),E(a,"bx--text-input--sm",X[3]==="sm"),E(a,"bx--text-input--xl",X[3]==="xl"),X[24]&&X[14]?$?$.p(X,de):($=kv(X),$.c(),$.m(r,g)):$&&($.d(1),$=null),X[24]&&X[14]?j&&(fe(),k(j,1,1,()=>{j=null}),ce()):j?(j.p(X,de),de[0]&16793600&&b(j,1)):(j=wv(X),j.c(),b(j,1),j.m(r,null)),(!C||de[0]&16384&&_!==(_=X[14]||void 0))&&P(r,"data-invalid",_),(!C||de[0]&65536)&&E(r,"bx--text-input__field-wrapper--warning",X[16]),!X[24]&&X[14]?Q?Q.p(X,de):(Q=Tv(X),Q.c(),Q.m(l,S)):Q&&(Q.d(1),Q=null),!X[14]&&!X[16]&&!X[24]&&!X[18]&&X[11]?le?le.p(X,de):(le=Sv(X),le.c(),le.m(l,A)):le&&(le.d(1),le=null),!X[24]&&!X[14]&&X[16]?oe?oe.p(X,de):(oe=Ev(X),oe.c(),oe.m(l,null)):oe&&(oe.d(1),oe=null),(!C||de[0]&262144)&&E(l,"bx--text-input__field-outer-wrapper--inline",X[18]),(!C||de[0]&16777216)&&E(e,"bx--password-input-wrapper",!X[24]),(!C||de[0]&512)&&E(e,"bx--text-input-wrapper--light",X[9]),(!C||de[0]&262144)&&E(e,"bx--text-input-wrapper--inline",X[18])},i(X){C||(b(L),b(N),b(z),b(W),b(j),C=!0)},o(X){k(L),k(N),k(z),k(W),k(j),C=!1},d(X){X&&w(e),L&&L.d(),N&&N.d(),z&&z.d(),W&&W.d(),t[40](null),$&&$.d(),j&&j.d(),Q&&Q.d(),le&&le.d(),oe&&oe.d(),I=!1,vt(M)}}}function QF(t,e,n){let i,l,r,s;const o=["size","value","type","placeholder","hidePasswordLabel","showPasswordLabel","tooltipAlignment","tooltipPosition","light","disabled","helperText","labelText","hideLabel","invalid","invalidText","warn","warnText","inline","id","name","ref"];let a=ae(e,o),{$$slots:u={},$$scope:f}=e;const c=Yi(u);let{size:d=void 0}=e,{value:h=""}=e,{type:g="password"}=e,{placeholder:_=""}=e,{hidePasswordLabel:v="Hide password"}=e,{showPasswordLabel:S="Show password"}=e,{tooltipAlignment:A="center"}=e,{tooltipPosition:C="bottom"}=e,{light:I=!1}=e,{disabled:M=!1}=e,{helperText:L=""}=e,{labelText:N=""}=e,{hideLabel:z=!1}=e,{invalid:W=!1}=e,{invalidText:D=""}=e,{warn:G=!1}=e,{warnText:$=""}=e,{inline:j=!1}=e,{id:Q="ccs-"+Math.random().toString(36)}=e,{name:le=void 0}=e,{ref:oe=null}=e;const X=bi("Form");function de(ue){te.call(this,t,ue)}function re(ue){te.call(this,t,ue)}function x(ue){te.call(this,t,ue)}function me(ue){te.call(this,t,ue)}function ee(ue){te.call(this,t,ue)}function ke(ue){te.call(this,t,ue)}function pe(ue){te.call(this,t,ue)}function Fe(ue){te.call(this,t,ue)}function Ve(ue){te.call(this,t,ue)}function Ee(ue){te.call(this,t,ue)}function We(ue){te.call(this,t,ue)}function ge(ue){ft[ue?"unshift":"push"](()=>{oe=ue,n(2,oe)})}const ve=({target:ue})=>{n(0,h=ue.value)},be=()=>{n(1,g=g==="password"?"text":"password")};return t.$$set=ue=>{e=Y(Y({},e),Se(ue)),n(26,a=ae(e,o)),"size"in ue&&n(3,d=ue.size),"value"in ue&&n(0,h=ue.value),"type"in ue&&n(1,g=ue.type),"placeholder"in ue&&n(4,_=ue.placeholder),"hidePasswordLabel"in ue&&n(5,v=ue.hidePasswordLabel),"showPasswordLabel"in ue&&n(6,S=ue.showPasswordLabel),"tooltipAlignment"in ue&&n(7,A=ue.tooltipAlignment),"tooltipPosition"in ue&&n(8,C=ue.tooltipPosition),"light"in ue&&n(9,I=ue.light),"disabled"in ue&&n(10,M=ue.disabled),"helperText"in ue&&n(11,L=ue.helperText),"labelText"in ue&&n(12,N=ue.labelText),"hideLabel"in ue&&n(13,z=ue.hideLabel),"invalid"in ue&&n(14,W=ue.invalid),"invalidText"in ue&&n(15,D=ue.invalidText),"warn"in ue&&n(16,G=ue.warn),"warnText"in ue&&n(17,$=ue.warnText),"inline"in ue&&n(18,j=ue.inline),"id"in ue&&n(19,Q=ue.id),"name"in ue&&n(20,le=ue.name),"ref"in ue&&n(2,oe=ue.ref),"$$scope"in ue&&n(27,f=ue.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&524288&&n(23,l=`helper-${Q}`),t.$$.dirty[0]&524288&&n(22,r=`error-${Q}`),t.$$.dirty[0]&524288&&n(21,s=`warn-${Q}`)},n(24,i=!!X&&X.isFluid),[h,g,oe,d,_,v,S,A,C,I,M,L,N,z,W,D,G,$,j,Q,le,s,r,l,i,c,a,f,u,de,re,x,me,ee,ke,pe,Fe,Ve,Ee,We,ge,ve,be]}class xF extends De{constructor(e){super(),Re(this,e,QF,JF,Ie,{size:3,value:0,type:1,placeholder:4,hidePasswordLabel:5,showPasswordLabel:6,tooltipAlignment:7,tooltipPosition:8,light:9,disabled:10,helperText:11,labelText:12,hideLabel:13,invalid:14,invalidText:15,warn:16,warnText:17,inline:18,id:19,name:20,ref:2},null,[-1,-1])}}const zm=xF,eG=t=>({}),Mv=t=>({}),tG=t=>({}),Ov=t=>({}),nG=t=>({}),Av=t=>({});function iG(t){let e;return{c(){e=q(t[5])},m(n,i){y(n,e,i)},p(n,i){i&32&&Z(e,n[5])},d(n){n&&w(e)}}}function lG(t){let e;return{c(){e=q(t[3])},m(n,i){y(n,e,i)},p(n,i){i&8&&Z(e,n[3])},d(n){n&&w(e)}}}function rG(t){let e;return{c(){e=q(t[4])},m(n,i){y(n,e,i)},p(n,i){i&16&&Z(e,n[4])},d(n){n&&w(e)}}}function sG(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g;const _=t[12].labelText,v=Ze(_,t,t[11],Av),S=v||iG(t),A=t[12].labelA,C=Ze(A,t,t[11],Ov),I=C||lG(t),M=t[12].labelB,L=Ze(M,t,t[11],Mv),N=L||rG(t);let z=[t[9]],W={};for(let D=0;D{n(0,a=!a)},D=G=>{(G.key===" "||G.key==="Enter")&&(G.preventDefault(),n(0,a=!a))};return t.$$set=G=>{n(10,e=Y(Y({},e),Se(G))),n(9,l=ae(e,i)),"size"in G&&n(1,o=G.size),"toggled"in G&&n(0,a=G.toggled),"disabled"in G&&n(2,u=G.disabled),"labelA"in G&&n(3,f=G.labelA),"labelB"in G&&n(4,c=G.labelB),"labelText"in G&&n(5,d=G.labelText),"hideLabel"in G&&n(6,h=G.hideLabel),"id"in G&&n(7,g=G.id),"name"in G&&n(8,_=G.name),"$$scope"in G&&n(11,s=G.$$scope)},t.$$.update=()=>{t.$$.dirty&1&&v("toggle",{toggled:a})},e=Se(e),[a,o,u,f,c,d,h,g,_,l,e,s,r,S,A,C,I,M,L,N,z,W,D]}class aG extends De{constructor(e){super(),Re(this,e,oG,sG,Ie,{size:1,toggled:0,disabled:2,labelA:3,labelB:4,labelText:5,hideLabel:6,id:7,name:8})}}const bc=aG;function uG(t){let e,n,i,l;const r=t[3].default,s=Ze(r,t,t[2],null);let o=[t[1]],a={};for(let u=0;u{e=Y(Y({},e),Se(d)),n(1,l=ae(e,i)),"light"in d&&n(0,o=d.light),"$$scope"in d&&n(2,s=d.$$scope)},[o,l,s,r,a,u,f,c]}class cG extends De{constructor(e){super(),Re(this,e,fG,uG,Ie,{light:0})}}const Bu=cG,dG=t=>({}),Cv=t=>({});function Lv(t){let e,n;const i=t[17].labelText,l=Ze(i,t,t[16],Cv),r=l||hG(t);return{c(){e=R("label"),r&&r.c(),P(e,"for",t[12]),E(e,"bx--label",!0),E(e,"bx--visually-hidden",t[9]),E(e,"bx--label--disabled",t[7])},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&65536)&&Ke(l,i,s,s[16],n?Xe(i,s[16],o,dG):$e(s[16]),Cv):r&&r.p&&(!n||o&256)&&r.p(s,n?o:-1),(!n||o&4096)&&P(e,"for",s[12]),(!n||o&512)&&E(e,"bx--visually-hidden",s[9]),(!n||o&128)&&E(e,"bx--label--disabled",s[7])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function hG(t){let e;return{c(){e=q(t[8])},m(n,i){y(n,e,i)},p(n,i){i&256&&Z(e,n[8])},d(n){n&&w(e)}}}function Iv(t){let e,n;return{c(){e=R("div"),n=q(t[11]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2048&&Z(n,i[11])},d(i){i&&w(e)}}}function mG(t){let e,n,i,l,r,s,o,a,u,f,c,d=(t[8]||t[14].labelText)&&Lv(t),h=[{type:"text"},{"data-invalid":s=t[10]||void 0},{pattern:t[4]},{placeholder:t[3]},{maxlength:t[5]},{id:t[12]},{name:t[13]},{disabled:t[7]},t[15]],g={};for(let A=0;A{d=null}),ce()),Ae(r,g=Ue(h,[{type:"text"},(!u||C&1024&&s!==(s=A[10]||void 0))&&{"data-invalid":s},(!u||C&16)&&{pattern:A[4]},(!u||C&8)&&{placeholder:A[3]},(!u||C&32)&&{maxlength:A[5]},(!u||C&4096)&&{id:A[12]},(!u||C&8192)&&{name:A[13]},(!u||C&128)&&{disabled:A[7]},C&32768&&A[15]])),C&1&&r.value!==A[0]&&Wl(r,A[0]),E(r,"bx--time-picker__input-field",!0),E(r,"bx--text-input",!0),E(r,"bx--text-input--light",A[6]),E(r,"bx--text-input--invalid",A[10]),v&&v.p&&(!u||C&65536)&&Ke(v,_,A,A[16],u?Xe(_,A[16],C,null):$e(A[16]),null),(!u||C&64)&&E(n,"bx--time-picker--light",A[6]),(!u||C&1024)&&E(n,"bx--time-picker--invalid",A[10]),(!u||C&4)&&E(n,"bx--time-picker--sm",A[2]==="sm"),(!u||C&4)&&E(n,"bx--time-picker--xl",A[2]==="xl"),(!u||C&64)&&E(n,"bx--select--light",A[6]),A[10]?S?S.p(A,C):(S=Iv(A),S.c(),S.m(e,null)):S&&(S.d(1),S=null)},i(A){u||(b(d),b(v,A),u=!0)},o(A){k(d),k(v,A),u=!1},d(A){A&&w(e),d&&d.d(),t[29](null),v&&v.d(A),S&&S.d(),f=!1,vt(c)}}}function gG(t,e,n){const i=["size","value","placeholder","pattern","maxlength","light","disabled","labelText","hideLabel","invalid","invalidText","id","name","ref"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e;const o=Yi(r);let{size:a=void 0}=e,{value:u=""}=e,{placeholder:f="hh:mm"}=e,{pattern:c="(1[012]|[1-9]):[0-5][0-9](\\s)?"}=e,{maxlength:d=5}=e,{light:h=!1}=e,{disabled:g=!1}=e,{labelText:_=""}=e,{hideLabel:v=!1}=e,{invalid:S=!1}=e,{invalidText:A=""}=e,{id:C="ccs-"+Math.random().toString(36)}=e,{name:I=void 0}=e,{ref:M=null}=e;function L(re){te.call(this,t,re)}function N(re){te.call(this,t,re)}function z(re){te.call(this,t,re)}function W(re){te.call(this,t,re)}function D(re){te.call(this,t,re)}function G(re){te.call(this,t,re)}function $(re){te.call(this,t,re)}function j(re){te.call(this,t,re)}function Q(re){te.call(this,t,re)}function le(re){te.call(this,t,re)}function oe(re){te.call(this,t,re)}function X(re){ft[re?"unshift":"push"](()=>{M=re,n(1,M)})}function de(){u=this.value,n(0,u)}return t.$$set=re=>{e=Y(Y({},e),Se(re)),n(15,l=ae(e,i)),"size"in re&&n(2,a=re.size),"value"in re&&n(0,u=re.value),"placeholder"in re&&n(3,f=re.placeholder),"pattern"in re&&n(4,c=re.pattern),"maxlength"in re&&n(5,d=re.maxlength),"light"in re&&n(6,h=re.light),"disabled"in re&&n(7,g=re.disabled),"labelText"in re&&n(8,_=re.labelText),"hideLabel"in re&&n(9,v=re.hideLabel),"invalid"in re&&n(10,S=re.invalid),"invalidText"in re&&n(11,A=re.invalidText),"id"in re&&n(12,C=re.id),"name"in re&&n(13,I=re.name),"ref"in re&&n(1,M=re.ref),"$$scope"in re&&n(16,s=re.$$scope)},[u,M,a,f,c,d,h,g,_,v,S,A,C,I,o,l,s,r,L,N,z,W,D,G,$,j,Q,le,oe,X,de]}class _G extends De{constructor(e){super(),Re(this,e,gG,mG,Ie,{size:2,value:0,placeholder:3,pattern:4,maxlength:5,light:6,disabled:7,labelText:8,hideLabel:9,invalid:10,invalidText:11,id:12,name:13,ref:1})}}const vc=_G;function Rv(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function pG(t){let e,n,i=t[1]&&Rv(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class vG extends De{constructor(e){super(),Re(this,e,bG,pG,Ie,{size:0,title:1})}}const GT=vG,Hm=un(!1),Um=un(!1),Fm=un(!1);function kG(t){let e,n,i,l,r;var s=t[0]?t[4]:t[3];function o(f,c){return{props:{size:20}}}s&&(n=cn(s,o()));let a=[{type:"button"},{title:t[2]},{"aria-label":t[2]},t[5]],u={};for(let f=0;f{U(d,1)}),ce()}s?(n=cn(s,o()),F(n.$$.fragment),b(n.$$.fragment,1),H(n,e,null)):n=null}Ae(e,u=Ue(a,[{type:"button"},(!i||c&4)&&{title:f[2]},(!i||c&4)&&{"aria-label":f[2]},c&32&&f[5]])),E(e,"bx--header__action",!0),E(e,"bx--header__menu-trigger",!0),E(e,"bx--header__menu-toggle",!0)},i(f){i||(n&&b(n.$$.fragment,f),i=!0)},o(f){n&&k(n.$$.fragment,f),i=!1},d(f){f&&w(e),n&&U(n),t[7](null),l=!1,vt(r)}}}function wG(t,e,n){const i=["ariaLabel","isOpen","iconMenu","iconClose","ref"];let l=ae(e,i),{ariaLabel:r=void 0}=e,{isOpen:s=!1}=e,{iconMenu:o=GT}=e,{iconClose:a=ql}=e,{ref:u=null}=e;function f(h){te.call(this,t,h)}function c(h){ft[h?"unshift":"push"](()=>{u=h,n(1,u)})}const d=()=>n(0,s=!s);return t.$$set=h=>{e=Y(Y({},e),Se(h)),n(5,l=ae(e,i)),"ariaLabel"in h&&n(2,r=h.ariaLabel),"isOpen"in h&&n(0,s=h.isOpen),"iconMenu"in h&&n(3,o=h.iconMenu),"iconClose"in h&&n(4,a=h.iconClose),"ref"in h&&n(1,u=h.ref)},[s,u,r,o,a,l,f,c,d]}class yG extends De{constructor(e){super(),Re(this,e,wG,kG,Ie,{ariaLabel:2,isOpen:0,iconMenu:3,iconClose:4,ref:1})}}const TG=yG,SG=t=>({}),Dv=t=>({}),EG=t=>({}),Pv=t=>({}),MG=t=>({}),Nv=t=>({});function Bv(t){let e,n,i;function l(s){t[20](s)}let r={iconClose:t[8],iconMenu:t[7]};return t[0]!==void 0&&(r.isOpen=t[0]),e=new TG({props:r}),ft.push(()=>Yt(e,"isOpen",l)),{c(){F(e.$$.fragment)},m(s,o){H(e,s,o),i=!0},p(s,o){const a={};o&256&&(a.iconClose=s[8]),o&128&&(a.iconMenu=s[7]),!n&&o&1&&(n=!0,a.isOpen=s[0],jt(()=>n=!1)),e.$set(a)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){U(e,s)}}}function zv(t){let e,n;const i=t[17].company,l=Ze(i,t,t[16],Pv),r=l||OG(t);return{c(){e=R("span"),r&&r.c(),E(e,"bx--header__name--prefix",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&65536)&&Ke(l,i,s,s[16],n?Xe(i,s[16],o,EG):$e(s[16]),Pv):r&&r.p&&(!n||o&8)&&r.p(s,n?o:-1)},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function OG(t){let e,n;return{c(){e=q(t[3]),n=q(" ")},m(i,l){y(i,e,l),y(i,n,l)},p(i,l){l&8&&Z(e,i[3])},d(i){i&&(w(e),w(n))}}}function AG(t){let e;return{c(){e=q(t[4])},m(n,i){y(n,e,i)},p(n,i){i&16&&Z(e,n[4])},d(n){n&&w(e)}}}function CG(t){let e,n,i,l,r,s,o,a,u;Qs(t[19]);const f=t[17]["skip-to-content"],c=Ze(f,t,t[16],Nv);let d=(t[11]&&t[9]{d=null}),ce()),M[3]||M[13].company?h?(h.p(M,L),L&8200&&b(h,1)):(h=zv(M),h.c(),b(h,1),h.m(l,r)):h&&(fe(),k(h,1,1,()=>{h=null}),ce()),_?_.p&&(!o||L&65536)&&Ke(_,g,M,M[16],o?Xe(g,M[16],L,SG):$e(M[16]),Dv):v&&v.p&&(!o||L&16)&&v.p(M,o?L:-1),Ae(l,A=Ue(S,[(!o||L&4)&&{href:M[2]},L&4096&&M[12]])),E(l,"bx--header__name",!0),I&&I.p&&(!o||L&65536)&&Ke(I,C,M,M[16],o?Xe(C,M[16],L,null):$e(M[16]),null),(!o||L&1024)&&P(e,"aria-label",M[10])},i(M){o||(b(c,M),b(d),b(h),b(v,M),b(I,M),o=!0)},o(M){k(c,M),k(d),k(h),k(v,M),k(I,M),o=!1},d(M){M&&w(e),c&&c.d(M),d&&d.d(),h&&h.d(),v&&v.d(M),t[21](null),I&&I.d(M),a=!1,vt(u)}}}function LG(t,e,n){let i;const l=["expandedByDefault","isSideNavOpen","uiShellAriaLabel","href","company","platformName","persistentHamburgerMenu","expansionBreakpoint","ref","iconMenu","iconClose"];let r=ae(e,l),s;Mt(t,Hm,D=>n(11,s=D));let{$$slots:o={},$$scope:a}=e;const u=Yi(o);let{expandedByDefault:f=!0}=e,{isSideNavOpen:c=!1}=e,{uiShellAriaLabel:d=void 0}=e,{href:h=void 0}=e,{company:g=void 0}=e,{platformName:_=""}=e,{persistentHamburgerMenu:v=!1}=e,{expansionBreakpoint:S=1056}=e,{ref:A=null}=e,{iconMenu:C=GT}=e,{iconClose:I=ql}=e,M;function L(D){te.call(this,t,D)}function N(){n(9,M=window.innerWidth)}function z(D){c=D,n(0,c),n(14,f),n(9,M),n(6,S),n(5,v)}function W(D){ft[D?"unshift":"push"](()=>{A=D,n(1,A)})}return t.$$set=D=>{n(22,e=Y(Y({},e),Se(D))),n(12,r=ae(e,l)),"expandedByDefault"in D&&n(14,f=D.expandedByDefault),"isSideNavOpen"in D&&n(0,c=D.isSideNavOpen),"uiShellAriaLabel"in D&&n(15,d=D.uiShellAriaLabel),"href"in D&&n(2,h=D.href),"company"in D&&n(3,g=D.company),"platformName"in D&&n(4,_=D.platformName),"persistentHamburgerMenu"in D&&n(5,v=D.persistentHamburgerMenu),"expansionBreakpoint"in D&&n(6,S=D.expansionBreakpoint),"ref"in D&&n(1,A=D.ref),"iconMenu"in D&&n(7,C=D.iconMenu),"iconClose"in D&&n(8,I=D.iconClose),"$$scope"in D&&n(16,a=D.$$scope)},t.$$.update=()=>{t.$$.dirty&16992&&n(0,c=f&&M>=S&&!v),n(10,i=g?`${g} `:""+(d||e["aria-label"]||_))},e=Se(e),[c,A,h,g,_,v,S,C,I,M,i,s,r,u,f,d,a,o,L,N,z,W]}class IG extends De{constructor(e){super(),Re(this,e,LG,CG,Ie,{expandedByDefault:14,isSideNavOpen:0,uiShellAriaLabel:15,href:2,company:3,platformName:4,persistentHamburgerMenu:5,expansionBreakpoint:6,ref:1,iconMenu:7,iconClose:8})}}const RG=IG;function Hv(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function DG(t){let e,n,i=t[1]&&Hv(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class NG extends De{constructor(e){super(),Re(this,e,PG,DG,Ie,{size:0,title:1})}}const BG=NG,zG=t=>({}),Uv=t=>({}),HG=t=>({}),Fv=t=>({}),UG=t=>({}),Gv=t=>({});function FG(t){let e;const n=t[11].icon,i=Ze(n,t,t[10],Fv),l=i||VG(t);return{c(){l&&l.c()},m(r,s){l&&l.m(r,s),e=!0},p(r,s){i?i.p&&(!e||s&1024)&&Ke(i,n,r,r[10],e?Xe(n,r[10],s,HG):$e(r[10]),Fv):l&&l.p&&(!e||s&4)&&l.p(r,e?s:-1)},i(r){e||(b(l,r),e=!0)},o(r){k(l,r),e=!1},d(r){l&&l.d(r)}}}function GG(t){let e;const n=t[11].closeIcon,i=Ze(n,t,t[10],Gv),l=i||WG(t);return{c(){l&&l.c()},m(r,s){l&&l.m(r,s),e=!0},p(r,s){i?i.p&&(!e||s&1024)&&Ke(i,n,r,r[10],e?Xe(n,r[10],s,UG):$e(r[10]),Gv):l&&l.p&&(!e||s&8)&&l.p(r,e?s:-1)},i(r){e||(b(l,r),e=!0)},o(r){k(l,r),e=!1},d(r){l&&l.d(r)}}}function VG(t){let e,n,i;var l=t[2];function r(s,o){return{props:{size:20}}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&4&&l!==(l=s[2])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function WG(t){let e,n,i;var l=t[3];function r(s,o){return{props:{size:20}}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&8&&l!==(l=s[3])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function Vv(t){let e,n;return{c(){e=R("span"),n=q(t[4]),P(e,"class","svelte-187bdaq")},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&16&&Z(n,i[4])},d(i){i&&w(e)}}}function qG(t){let e,n=t[4]&&Vv(t);return{c(){n&&n.c(),e=qe()},m(i,l){n&&n.m(i,l),y(i,e,l)},p(i,l){i[4]?n?n.p(i,l):(n=Vv(i),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(i){i&&w(e),n&&n.d(i)}}}function Wv(t){let e,n,i;const l=t[11].default,r=Ze(l,t,t[10],null);return{c(){e=R("div"),r&&r.c(),E(e,"bx--header-panel",!0),E(e,"bx--header-panel--expanded",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),t[16](e),i=!0},p(s,o){t=s,r&&r.p&&(!i||o&1024)&&Ke(r,l,t,t[10],i?Xe(l,t[10],o,null):$e(t[10]),null)},i(s){i||(b(r,s),s&&Qs(()=>{i&&(n||(n=hp(e,Nb,{...t[5],duration:t[5]===!1?0:t[5].duration},!0)),n.run(1))}),i=!0)},o(s){k(r,s),s&&(n||(n=hp(e,Nb,{...t[5],duration:t[5]===!1?0:t[5].duration},!1)),n.run(0)),i=!1},d(s){s&&w(e),r&&r.d(s),t[16](null),s&&n&&n.end()}}}function jG(t){let e,n,i,l,r,s,o,a,u;const f=[GG,FG],c=[];function d(C,I){return C[0]?0:1}n=d(t),i=c[n]=f[n](t);const h=t[11].text,g=Ze(h,t,t[10],Uv),_=g||qG(t);let v=[{type:"button"},t[9]],S={};for(let C=0;C{c[M]=null}),ce(),i=c[n],i?i.p(C,I):(i=c[n]=f[n](C),i.c()),b(i,1),i.m(e,l)),g?g.p&&(!o||I&1024)&&Ke(g,h,C,C[10],o?Xe(h,C[10],I,zG):$e(C[10]),Uv):_&&_.p&&(!o||I&16)&&_.p(C,o?I:-1),Ae(e,S=Ue(v,[{type:"button"},I&512&&C[9]])),E(e,"bx--header__action",!0),E(e,"bx--header__action--active",C[0]),E(e,"action-text",C[4]),E(e,"svelte-187bdaq",!0),C[0]?A?(A.p(C,I),I&1&&b(A,1)):(A=Wv(C),A.c(),b(A,1),A.m(s.parentNode,s)):A&&(fe(),k(A,1,1,()=>{A=null}),ce())},i(C){o||(b(i),b(_,C),b(A),o=!0)},o(C){k(i),k(_,C),k(A),o=!1},d(C){C&&(w(e),w(r),w(s)),c[n].d(),_&&_.d(C),t[14](null),A&&A.d(C),a=!1,vt(u)}}}function YG(t,e,n){const i=["isOpen","icon","closeIcon","text","ref","transition","preventCloseOnClickOutside"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{isOpen:o=!1}=e,{icon:a=BG}=e,{closeIcon:u=ql}=e,{text:f=void 0}=e,{ref:c=null}=e,{transition:d={duration:200}}=e,{preventCloseOnClickOutside:h=!1}=e;const g=yn();let _=null;function v(M){te.call(this,t,M)}const S=({target:M})=>{o&&!c.contains(M)&&!_.contains(M)&&!h&&(n(0,o=!1),g("close"))};function A(M){ft[M?"unshift":"push"](()=>{c=M,n(1,c)})}const C=()=>{n(0,o=!o),g(o?"open":"close")};function I(M){ft[M?"unshift":"push"](()=>{_=M,n(7,_)})}return t.$$set=M=>{e=Y(Y({},e),Se(M)),n(9,l=ae(e,i)),"isOpen"in M&&n(0,o=M.isOpen),"icon"in M&&n(2,a=M.icon),"closeIcon"in M&&n(3,u=M.closeIcon),"text"in M&&n(4,f=M.text),"ref"in M&&n(1,c=M.ref),"transition"in M&&n(5,d=M.transition),"preventCloseOnClickOutside"in M&&n(6,h=M.preventCloseOnClickOutside),"$$scope"in M&&n(10,s=M.$$scope)},[o,c,a,u,f,d,h,_,g,l,s,r,v,S,A,C,I]}class ZG extends De{constructor(e){super(),Re(this,e,YG,jG,Ie,{isOpen:0,icon:2,closeIcon:3,text:4,ref:1,transition:5,preventCloseOnClickOutside:6})}}const XG=ZG;function KG(t){let e,n,i;const l=t[3].default,r=Ze(l,t,t[2],null);let s=[t[0],{role:"menubar"}],o={};for(let f=0;f{n(4,e=Y(Y({},e),Se(a))),n(1,r=ae(e,l)),"$$scope"in a&&n(2,o=a.$$scope)},t.$$.update=()=>{n(0,i={"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"]})},e=Se(e),[i,r,o,s]}class JG extends De{constructor(e){super(),Re(this,e,$G,KG,Ie,{})}}const QG=JG;function xG(t){let e;return{c(){e=q(t[2])},m(n,i){y(n,e,i)},p(n,i){i&4&&Z(e,n[2])},d(n){n&&w(e)}}}function eV(t){let e,n,i,l,r,s,o,a;const u=t[9].default,f=Ze(u,t,t[8],null),c=f||xG(t);let d=[{role:"menuitem"},{tabindex:"0"},{href:t[1]},{rel:l=t[7].target==="_blank"?"noopener noreferrer":void 0},{"aria-current":r=t[3]?"page":void 0},t[7]],h={};for(let g=0;g{n(4,h=Object.keys(W))});_n(()=>()=>{g&&g()});function _(W){te.call(this,t,W)}function v(W){te.call(this,t,W)}function S(W){te.call(this,t,W)}function A(W){te.call(this,t,W)}function C(W){te.call(this,t,W)}function I(W){te.call(this,t,W)}function M(W){te.call(this,t,W)}function L(W){te.call(this,t,W)}function N(W){ft[W?"unshift":"push"](()=>{f=W,n(0,f)})}const z=()=>{h.indexOf(c)===h.length-1&&(d==null||d.closeMenu())};return t.$$set=W=>{e=Y(Y({},e),Se(W)),n(7,l=ae(e,i)),"href"in W&&n(1,o=W.href),"text"in W&&n(2,a=W.text),"isSelected"in W&&n(3,u=W.isSelected),"ref"in W&&n(0,f=W.ref),"$$scope"in W&&n(8,s=W.$$scope)},t.$$.update=()=>{t.$$.dirty&8&&(d==null||d.updateSelectedItems({id:c,isSelected:u}))},[f,o,a,u,h,c,d,l,s,r,_,v,S,A,C,I,M,L,N,z]}class nV extends De{constructor(e){super(),Re(this,e,tV,eV,Ie,{href:1,text:2,isSelected:3,ref:0})}}const VT=nV;function iV(t){let e,n,i,l,r,s,o,a,u,f;r=new ga({props:{class:"bx--header__menu-arrow"}});let c=[{role:"menuitem"},{tabindex:"0"},{"aria-haspopup":"menu"},{"aria-expanded":t[0]},{"aria-label":t[3]},{href:t[2]},t[7]],d={};for(let _=0;_n(8,s=j));let g=null;Wi("HeaderNavMenu",{selectedItems:h,updateSelectedItems(j){h.update(Q=>({...Q,[j.id]:j.isSelected}))},closeMenu(){n(0,u=!1)}});function _(j){te.call(this,t,j)}function v(j){te.call(this,t,j)}function S(j){te.call(this,t,j)}function A(j){te.call(this,t,j)}function C(j){te.call(this,t,j)}function I(j){te.call(this,t,j)}function M(j){te.call(this,t,j)}function L(j){te.call(this,t,j)}const N=({target:j})=>{d.contains(j)||n(0,u=!1)};function z(j){ft[j?"unshift":"push"](()=>{d=j,n(1,d)})}const W=j=>{j.key===" "&&j.preventDefault(),(j.key==="Enter"||j.key===" ")&&n(0,u=!u)};function D(j){ft[j?"unshift":"push"](()=>{g=j,n(4,g)})}const G=j=>{g.contains(j.target)||j.preventDefault(),n(0,u=!u)},$=j=>{j.key==="Enter"&&(j.stopPropagation(),n(0,u=!u))};return t.$$set=j=>{e=Y(Y({},e),Se(j)),n(7,r=ae(e,l)),"expanded"in j&&n(0,u=j.expanded),"href"in j&&n(2,f=j.href),"text"in j&&n(3,c=j.text),"ref"in j&&n(1,d=j.ref),"$$scope"in j&&n(9,a=j.$$scope)},t.$$.update=()=>{t.$$.dirty&256&&n(5,i=Object.values(s).filter(Boolean).length>0)},[u,d,f,c,g,i,h,r,s,a,o,_,v,S,A,C,I,M,L,N,z,W,D,G,$]}class rV extends De{constructor(e){super(),Re(this,e,lV,iV,Ie,{expanded:0,href:2,text:3,ref:1})}}const sV=rV;function qv(t){let e,n,i;const l=t[2].default,r=Ze(l,t,t[1],null);return{c(){e=R("li"),n=R("span"),r&&r.c(),P(n,"class","svelte-1tbdbmc"),P(e,"class","svelte-1tbdbmc")},m(s,o){y(s,e,o),T(e,n),r&&r.m(n,null),i=!0},p(s,o){r&&r.p&&(!i||o&2)&&Ke(r,l,s,s[1],i?Xe(l,s[1],o,null):$e(s[1]),null)},i(s){i||(b(r,s),i=!0)},o(s){k(r,s),i=!1},d(s){s&&w(e),r&&r.d(s)}}}function oV(t){let e,n,i,l=t[0].default&&qv(t);return{c(){l&&l.c(),e=B(),n=R("hr"),E(n,"bx--switcher__item--divider",!0)},m(r,s){l&&l.m(r,s),y(r,e,s),y(r,n,s),i=!0},p(r,[s]){r[0].default?l?(l.p(r,s),s&1&&b(l,1)):(l=qv(r),l.c(),b(l,1),l.m(e.parentNode,e)):l&&(fe(),k(l,1,1,()=>{l=null}),ce())},i(r){i||(b(l),i=!0)},o(r){k(l),i=!1},d(r){r&&(w(e),w(n)),l&&l.d(r)}}}function aV(t,e,n){let{$$slots:i={},$$scope:l}=e;const r=Yi(i);return t.$$set=s=>{"$$scope"in s&&n(1,l=s.$$scope)},[r,l,i]}class uV extends De{constructor(e){super(),Re(this,e,aV,oV,Ie,{})}}const fV=uV;function cV(t){let e,n,i,l,r,s;const o=t[4].default,a=Ze(o,t,t[3],null);let u=[{href:t[1]},{rel:i=t[2].target==="_blank"?"noopener noreferrer":void 0},t[2]],f={};for(let c=0;c{a=c,n(0,a)})}return t.$$set=c=>{e=Y(Y({},e),Se(c)),n(2,l=ae(e,i)),"href"in c&&n(1,o=c.href),"ref"in c&&n(0,a=c.ref),"$$scope"in c&&n(3,s=c.$$scope)},[a,o,l,s,r,u,f]}class hV extends De{constructor(e){super(),Re(this,e,dV,cV,Ie,{href:1,ref:0})}}const jv=hV;function mV(t){let e,n;const i=t[1].default,l=Ze(i,t,t[0],null);return{c(){e=R("ul"),l&&l.c(),E(e,"bx--switcher__item",!0)},m(r,s){y(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Ke(l,i,r,r[0],n?Xe(i,r[0],s,null):$e(r[0]),null)},i(r){n||(b(l,r),n=!0)},o(r){k(l,r),n=!1},d(r){r&&w(e),l&&l.d(r)}}}function gV(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class _V extends De{constructor(e){super(),Re(this,e,gV,mV,Ie,{})}}const pV=_V;function bV(t){let e,n;const i=t[1].default,l=Ze(i,t,t[0],null);return{c(){e=R("div"),l&&l.c(),E(e,"bx--header__global",!0)},m(r,s){y(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Ke(l,i,r,r[0],n?Xe(i,r[0],s,null):$e(r[0]),null)},i(r){n||(b(l,r),n=!0)},o(r){k(l,r),n=!1},d(r){r&&w(e),l&&l.d(r)}}}function vV(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class kV extends De{constructor(e){super(),Re(this,e,vV,bV,Ie,{})}}const wV=kV;function Yv(t){let e,n,i;return{c(){e=R("div"),E(e,"bx--side-nav__overlay",!0),E(e,"bx--side-nav__overlay-active",t[0]),wt(e,"z-index",t[0]?6e3:void 0)},m(l,r){y(l,e,r),n||(i=J(e,"click",t[11]),n=!0)},p(l,r){r&1&&E(e,"bx--side-nav__overlay-active",l[0]),r&1&&wt(e,"z-index",l[0]?6e3:void 0)},d(l){l&&w(e),n=!1,i()}}}function yV(t){let e,n,i,l,r,s;Qs(t[10]);let o=!t[1]&&Yv(t);const a=t[9].default,u=Ze(a,t,t[8],null);let f=[{"aria-hidden":i=!t[0]},{"aria-label":t[3]},t[7]],c={};for(let d=0;d=t[4]?!1:t[0]),E(n,"bx--side-nav--collapsed",!t[0]&&!t[2]),E(n,"bx--side-nav--rail",t[2])},m(d,h){o&&o.m(d,h),y(d,e,h),y(d,n,h),u&&u.m(n,null),l=!0,r||(s=J(window,"resize",t[10]),r=!0)},p(d,[h]){d[1]?o&&(o.d(1),o=null):o?o.p(d,h):(o=Yv(d),o.c(),o.m(e.parentNode,e)),u&&u.p&&(!l||h&256)&&Ke(u,a,d,d[8],l?Xe(a,d[8],h,null):$e(d[8]),null),Ae(n,c=Ue(f,[(!l||h&1&&i!==(i=!d[0]))&&{"aria-hidden":i},(!l||h&8)&&{"aria-label":d[3]},h&128&&d[7]])),E(n,"bx--side-nav__navigation",!0),E(n,"bx--side-nav",!0),E(n,"bx--side-nav--ux",!0),E(n,"bx--side-nav--expanded",d[2]&&d[5]>=d[4]?!1:d[0]),E(n,"bx--side-nav--collapsed",!d[0]&&!d[2]),E(n,"bx--side-nav--rail",d[2])},i(d){l||(b(u,d),l=!0)},o(d){k(u,d),l=!1},d(d){d&&(w(e),w(n)),o&&o.d(d),u&&u.d(d),r=!1,s()}}}function TV(t,e,n){const i=["fixed","rail","ariaLabel","isOpen","expansionBreakpoint"];let l=ae(e,i),r,s;Mt(t,Fm,A=>n(12,r=A)),Mt(t,Um,A=>n(13,s=A));let{$$slots:o={},$$scope:a}=e,{fixed:u=!1}=e,{rail:f=!1}=e,{ariaLabel:c=void 0}=e,{isOpen:d=!1}=e,{expansionBreakpoint:h=1056}=e;const g=yn();let _;_n(()=>(Hm.set(!0),()=>Hm.set(!1)));function v(){n(5,_=window.innerWidth)}const S=()=>{g("click:overlay"),n(0,d=!1)};return t.$$set=A=>{e=Y(Y({},e),Se(A)),n(7,l=ae(e,i)),"fixed"in A&&n(1,u=A.fixed),"rail"in A&&n(2,f=A.rail),"ariaLabel"in A&&n(3,c=A.ariaLabel),"isOpen"in A&&n(0,d=A.isOpen),"expansionBreakpoint"in A&&n(4,h=A.expansionBreakpoint),"$$scope"in A&&n(8,a=A.$$scope)},t.$$.update=()=>{t.$$.dirty&1&&g(d?"open":"close"),t.$$.dirty&1&&Js(Um,s=!d,s),t.$$.dirty&4&&Js(Fm,r=f,r)},[d,u,f,c,h,_,g,l,a,o,v,S]}class SV extends De{constructor(e){super(),Re(this,e,TV,yV,Ie,{fixed:1,rail:2,ariaLabel:3,isOpen:0,expansionBreakpoint:4})}}const EV=SV;function MV(t){let e,n;const i=t[1].default,l=Ze(i,t,t[0],null);return{c(){e=R("ul"),l&&l.c(),E(e,"bx--side-nav__items",!0)},m(r,s){y(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Ke(l,i,r,r[0],n?Xe(i,r[0],s,null):$e(r[0]),null)},i(r){n||(b(l,r),n=!0)},o(r){k(l,r),n=!1},d(r){r&&w(e),l&&l.d(r)}}}function OV(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class AV extends De{constructor(e){super(),Re(this,e,OV,MV,Ie,{})}}const CV=AV,LV=t=>({}),Zv=t=>({});function Xv(t){let e,n;const i=t[8].icon,l=Ze(i,t,t[7],Zv),r=l||IV(t);return{c(){e=R("div"),r&&r.c(),E(e,"bx--side-nav__icon",!0),E(e,"bx--side-nav__icon--small",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&128)&&Ke(l,i,s,s[7],n?Xe(i,s[7],o,LV):$e(s[7]),Zv):r&&r.p&&(!n||o&16)&&r.p(s,n?o:-1)},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function IV(t){let e,n,i;var l=t[4];function r(s,o){return{}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&16&&l!==(l=s[4])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function RV(t){let e;return{c(){e=q(t[3])},m(n,i){y(n,e,i)},p(n,i){i&8&&Z(e,n[3])},d(n){n&&w(e)}}}function DV(t){let e,n,i,l,r,s,o,a,u,f=(t[6].icon||t[4])&&Xv(t);const c=t[8].default,d=Ze(c,t,t[7],null),h=d||RV(t);let g=[{"aria-current":r=t[1]?"page":void 0},{href:t[2]},{rel:s=t[5].target==="_blank"?"noopener noreferrer":void 0},t[5]],_={};for(let v=0;v{f=null}),ce()),d?d.p&&(!o||S&128)&&Ke(d,c,v,v[7],o?Xe(c,v[7],S,null):$e(v[7]),null):h&&h.p&&(!o||S&8)&&h.p(v,o?S:-1),Ae(n,_=Ue(g,[(!o||S&2&&r!==(r=v[1]?"page":void 0))&&{"aria-current":r},(!o||S&4)&&{href:v[2]},(!o||S&32&&s!==(s=v[5].target==="_blank"?"noopener noreferrer":void 0))&&{rel:s},S&32&&v[5]])),E(n,"bx--side-nav__link",!0),E(n,"bx--side-nav__link--current",v[1])},i(v){o||(b(f),b(h,v),o=!0)},o(v){k(f),k(h,v),o=!1},d(v){v&&w(e),f&&f.d(),h&&h.d(v),t[10](null),a=!1,u()}}}function PV(t,e,n){const i=["isSelected","href","text","icon","ref"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e;const o=Yi(r);let{isSelected:a=!1}=e,{href:u=void 0}=e,{text:f=void 0}=e,{icon:c=void 0}=e,{ref:d=null}=e;function h(_){te.call(this,t,_)}function g(_){ft[_?"unshift":"push"](()=>{d=_,n(0,d)})}return t.$$set=_=>{e=Y(Y({},e),Se(_)),n(5,l=ae(e,i)),"isSelected"in _&&n(1,a=_.isSelected),"href"in _&&n(2,u=_.href),"text"in _&&n(3,f=_.text),"icon"in _&&n(4,c=_.icon),"ref"in _&&n(0,d=_.ref),"$$scope"in _&&n(7,s=_.$$scope)},[d,a,u,f,c,l,o,s,r,h,g]}class NV extends De{constructor(e){super(),Re(this,e,PV,DV,Ie,{isSelected:1,href:2,text:3,icon:4,ref:0})}}const WT=NV,BV=t=>({}),Kv=t=>({});function $v(t){let e,n;const i=t[7].icon,l=Ze(i,t,t[6],Kv),r=l||zV(t);return{c(){e=R("div"),r&&r.c(),E(e,"bx--side-nav__icon",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&64)&&Ke(l,i,s,s[6],n?Xe(i,s[6],o,BV):$e(s[6]),Kv):r&&r.p&&(!n||o&8)&&r.p(s,n?o:-1)},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function zV(t){let e,n,i;var l=t[3];function r(s,o){return{}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&8&&l!==(l=s[3])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function HV(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g=(t[5].icon||t[3])&&$v(t);a=new ga({});let _=[{type:"button"},{"aria-expanded":t[0]},t[4]],v={};for(let C=0;C<_.length;C+=1)v=Y(v,_[C]);const S=t[7].default,A=Ze(S,t,t[6],null);return{c(){e=R("li"),n=R("button"),g&&g.c(),i=B(),l=R("span"),r=q(t[2]),s=B(),o=R("div"),F(a.$$.fragment),u=B(),f=R("ul"),A&&A.c(),E(l,"bx--side-nav__submenu-title",!0),E(o,"bx--side-nav__icon",!0),E(o,"bx--side-nav__icon--small",!0),E(o,"bx--side-nav__submenu-chevron",!0),Ae(n,v),E(n,"bx--side-nav__submenu",!0),P(f,"role","menu"),E(f,"bx--side-nav__menu",!0),wt(f,"max-height",t[0]?"none":void 0),E(e,"bx--side-nav__item",!0),E(e,"bx--side-nav__item--icon",t[3])},m(C,I){y(C,e,I),T(e,n),g&&g.m(n,null),T(n,i),T(n,l),T(l,r),T(n,s),T(n,o),H(a,o,null),n.autofocus&&n.focus(),t[9](n),T(e,u),T(e,f),A&&A.m(f,null),c=!0,d||(h=[J(n,"click",t[8]),J(n,"click",t[10])],d=!0)},p(C,[I]){C[5].icon||C[3]?g?(g.p(C,I),I&40&&b(g,1)):(g=$v(C),g.c(),b(g,1),g.m(n,i)):g&&(fe(),k(g,1,1,()=>{g=null}),ce()),(!c||I&4)&&Z(r,C[2]),Ae(n,v=Ue(_,[{type:"button"},(!c||I&1)&&{"aria-expanded":C[0]},I&16&&C[4]])),E(n,"bx--side-nav__submenu",!0),A&&A.p&&(!c||I&64)&&Ke(A,S,C,C[6],c?Xe(S,C[6],I,null):$e(C[6]),null),I&1&&wt(f,"max-height",C[0]?"none":void 0),(!c||I&8)&&E(e,"bx--side-nav__item--icon",C[3])},i(C){c||(b(g),b(a.$$.fragment,C),b(A,C),c=!0)},o(C){k(g),k(a.$$.fragment,C),k(A,C),c=!1},d(C){C&&w(e),g&&g.d(),U(a),t[9](null),A&&A.d(C),d=!1,vt(h)}}}function UV(t,e,n){const i=["expanded","text","icon","ref"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e;const o=Yi(r);let{expanded:a=!1}=e,{text:u=void 0}=e,{icon:f=void 0}=e,{ref:c=null}=e;function d(_){te.call(this,t,_)}function h(_){ft[_?"unshift":"push"](()=>{c=_,n(1,c)})}const g=()=>{n(0,a=!a)};return t.$$set=_=>{e=Y(Y({},e),Se(_)),n(4,l=ae(e,i)),"expanded"in _&&n(0,a=_.expanded),"text"in _&&n(2,u=_.text),"icon"in _&&n(3,f=_.icon),"ref"in _&&n(1,c=_.ref),"$$scope"in _&&n(6,s=_.$$scope)},[a,c,u,f,l,o,s,r,d,h,g]}class FV extends De{constructor(e){super(),Re(this,e,UV,HV,Ie,{expanded:0,text:2,icon:3,ref:1})}}const GV=FV;function VV(t){let e,n;const i=t[6].default,l=Ze(i,t,t[5],null);let r=[{id:t[0]},t[2]],s={};for(let o=0;on(3,s=c)),Mt(t,Um,c=>n(4,o=c));let{$$slots:a={},$$scope:u}=e,{id:f="main-content"}=e;return t.$$set=c=>{e=Y(Y({},e),Se(c)),n(2,r=ae(e,l)),"id"in c&&n(0,f=c.id),"$$scope"in c&&n(5,u=c.$$scope)},t.$$.update=()=>{t.$$.dirty&24&&n(1,i=o&&!s)},[f,i,r,s,o,u,a]}class qV extends De{constructor(e){super(),Re(this,e,WV,VV,Ie,{id:0})}}const jV=qV;function YV(t){let e;return{c(){e=q("Skip to main content")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function ZV(t){let e,n,i,l;const r=t[4].default,s=Ze(r,t,t[3],null),o=s||YV();let a=[{href:t[0]},{tabindex:t[1]},t[2]],u={};for(let f=0;f{e=Y(Y({},e),Se(f)),n(2,l=ae(e,i)),"href"in f&&n(0,o=f.href),"tabindex"in f&&n(1,a=f.tabindex),"$$scope"in f&&n(3,s=f.$$scope)},[o,a,l,s,r,u]}class KV extends De{constructor(e){super(),Re(this,e,XV,ZV,Ie,{href:0,tabindex:1})}}const $V=KV;function JV(t){let e,n=[{role:"separator"},t[0]],i={};for(let l=0;l{e=Y(Y({},e),Se(r)),n(0,l=ae(e,i))},[l]}class xV extends De{constructor(e){super(),Re(this,e,QV,JV,Ie,{})}}const eW=xV,Jv={},Gm={},tW={},qT=/^:(.+)/,Qv=4,nW=3,iW=2,lW=1,rW=1,Vm=t=>t.replace(/(^\/+|\/+$)/g,"").split("/"),Kh=t=>t.replace(/(^\/+|\/+$)/g,""),sW=(t,e)=>{const n=t.default?0:Vm(t.path).reduce((i,l)=>(i+=Qv,l===""?i+=rW:qT.test(l)?i+=iW:l[0]==="*"?i-=Qv+lW:i+=nW,i),0);return{route:t,score:n,index:e}},oW=t=>t.map(sW).sort((e,n)=>e.scoren.score?-1:e.index-n.index),xv=(t,e)=>{let n,i;const[l]=e.split("?"),r=Vm(l),s=r[0]==="",o=oW(t);for(let a=0,u=o.length;a"u"){c=!0;break}const A=qT.exec(v);if(A&&!s){const C=decodeURIComponent(S);h[A[1]]=C}else if(v!==S){c=!0;break}}if(!c){n={route:f,params:h,uri:"/"+r.slice(0,_).join("/")};break}}return n||i||null},ek=(t,e)=>`${Kh(e==="/"?t:`${Kh(t)}/${Kh(e)}`)}/`,jT=()=>typeof window<"u"&&"document"in window&&"location"in window,aW=t=>({params:t&4}),tk=t=>({params:t[2]});function nk(t){let e,n,i,l;const r=[fW,uW],s=[];function o(a,u){return a[0]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function uW(t){let e;const n=t[8].default,i=Ze(n,t,t[7],tk);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&132)&&Ke(i,n,l,l[7],e?Xe(n,l[7],r,aW):$e(l[7]),tk)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function fW(t){let e,n,i,l={ctx:t,current:null,token:null,hasCatch:!1,pending:hW,then:dW,catch:cW,value:12,blocks:[,,,]};return Nm(n=t[0],l),{c(){e=qe(),l.block.c()},m(r,s){y(r,e,s),l.block.m(r,l.anchor=s),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(r,s){t=r,l.ctx=t,s&1&&n!==(n=t[0])&&Nm(n,l)||vT(l,t,s)},i(r){i||(b(l.block),i=!0)},o(r){for(let s=0;s<3;s+=1){const o=l.blocks[s];k(o)}i=!1},d(r){r&&w(e),l.block.d(r),l.token=null,l=null}}}function cW(t){return{c:he,m:he,p:he,i:he,o:he,d:he}}function dW(t){var o;let e,n,i;const l=[t[2],t[3]];var r=((o=t[12])==null?void 0:o.default)||t[12];function s(a,u){let f={};if(u!==void 0&&u&12)f=Ue(l,[u&4&&ul(a[2]),u&8&&ul(a[3])]);else for(let c=0;c{U(c,1)}),ce()}r?(e=cn(r,s(a,u)),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}else if(r){const c=u&12?Ue(l,[u&4&&ul(a[2]),u&8&&ul(a[3])]):{};e.$set(c)}},i(a){i||(e&&b(e.$$.fragment,a),i=!0)},o(a){e&&k(e.$$.fragment,a),i=!1},d(a){a&&w(n),e&&U(e,a)}}}function hW(t){return{c:he,m:he,p:he,i:he,o:he,d:he}}function mW(t){let e,n,i=t[1]&&t[1].route===t[5]&&nk(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,[r]){l[1]&&l[1].route===l[5]?i?(i.p(l,r),r&2&&b(i,1)):(i=nk(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function gW(t,e,n){let i,{$$slots:l={},$$scope:r}=e,{path:s=""}=e,{component:o=null}=e,a={},u={};const{registerRoute:f,unregisterRoute:c,activeRoute:d}=bi(Gm);Mt(t,d,g=>n(1,i=g));const h={path:s,default:s===""};return f(h),Es(()=>{c(h)}),t.$$set=g=>{n(11,e=Y(Y({},e),Se(g))),"path"in g&&n(6,s=g.path),"component"in g&&n(0,o=g.component),"$$scope"in g&&n(7,r=g.$$scope)},t.$$.update=()=>{if(i&&i.route===h){n(2,a=i.params);const{component:g,path:_,...v}=e;n(3,u=v),g&&(g.toString().startsWith("class ")?n(0,o=g):n(0,o=g())),jT()&&(window==null||window.scrollTo(0,0))}},e=Se(e),[o,i,a,u,d,h,s,r,l]}class zi extends De{constructor(e){super(),Re(this,e,gW,mW,Ie,{path:6,component:0})}}const $h=t=>({...t.location,state:t.history.state,key:t.history.state&&t.history.state.key||"initial"}),_W=t=>{const e=[];let n=$h(t);return{get location(){return n},listen(i){e.push(i);const l=()=>{n=$h(t),i({location:n,action:"POP"})};return t.addEventListener("popstate",l),()=>{t.removeEventListener("popstate",l);const r=e.indexOf(i);e.splice(r,1)}},navigate(i,{state:l,replace:r=!1}={}){l={...l,key:Date.now()+""};try{r?t.history.replaceState(l,"",i):t.history.pushState(l,"",i)}catch{t.location[r?"replace":"assign"](i)}n=$h(t),e.forEach(s=>s({location:n,action:"PUSH"})),document.activeElement.blur()}}},pW=(t="/")=>{let e=0;const n=[{pathname:t,search:""}],i=[];return{get location(){return n[e]},addEventListener(l,r){},removeEventListener(l,r){},history:{get entries(){return n},get index(){return e},get state(){return i[e]},pushState(l,r,s){const[o,a=""]=s.split("?");e++,n.push({pathname:o,search:a}),i.push(l)},replaceState(l,r,s){const[o,a=""]=s.split("?");n[e]={pathname:o,search:a},i[e]=l}}}},YT=_W(jT()?window:pW()),{navigate:bW}=YT,vW=t=>({route:t&2,location:t&1}),ik=t=>({route:t[1]&&t[1].uri,location:t[0]});function kW(t){let e;const n=t[12].default,i=Ze(n,t,t[11],ik);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,[r]){i&&i.p&&(!e||r&2051)&&Ke(i,n,l,l[11],e?Xe(n,l[11],r,vW):$e(l[11]),ik)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function wW(t,e,n){let i,l,r,s,{$$slots:o={},$$scope:a}=e,{basepath:u="/"}=e,{url:f=null}=e,{history:c=YT}=e;Wi(tW,c);const d=bi(Jv),h=bi(Gm),g=un([]);Mt(t,g,L=>n(9,l=L));const _=un(null);Mt(t,_,L=>n(1,s=L));let v=!1;const S=d||un(f?{pathname:f}:c.location);Mt(t,S,L=>n(0,i=L));const A=h?h.routerBase:un({path:u,uri:u});Mt(t,A,L=>n(10,r=L));const C=Ms([A,_],([L,N])=>{if(!N)return L;const{path:z}=L,{route:W,uri:D}=N;return{path:W.default?z:W.path.replace(/\*.*$/,""),uri:D}}),I=L=>{const{path:N}=r;let{path:z}=L;if(L._path=z,L.path=ek(N,z),typeof window>"u"){if(v)return;const W=xv([L],i.pathname);W&&(_.set(W),v=!0)}else g.update(W=>[...W,L])},M=L=>{g.update(N=>N.filter(z=>z!==L))};return d||(_n(()=>c.listen(N=>{S.set(N.location)})),Wi(Jv,S)),Wi(Gm,{activeRoute:_,base:A,routerBase:C,registerRoute:I,unregisterRoute:M}),t.$$set=L=>{"basepath"in L&&n(6,u=L.basepath),"url"in L&&n(7,f=L.url),"history"in L&&n(8,c=L.history),"$$scope"in L&&n(11,a=L.$$scope)},t.$$.update=()=>{if(t.$$.dirty&1024){const{path:L}=r;g.update(N=>N.map(z=>Object.assign(z,{path:ek(L,z._path)})))}if(t.$$.dirty&513){const L=xv(l,i.pathname);_.set(L)}},[i,s,g,_,S,A,u,f,c,l,r,a,o]}class yW extends De{constructor(e){super(),Re(this,e,wW,kW,Ie,{basepath:6,url:7,history:8})}}function lk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function TW(t){let e,n,i,l=t[1]&&lk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class zu extends De{constructor(e){super(),Re(this,e,SW,TW,Ie,{size:0,title:1})}}function rk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function EW(t){let e,n,i=t[1]&&rk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class OW extends De{constructor(e){super(),Re(this,e,MW,EW,Ie,{size:0,title:1})}}function sk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function AW(t){let e,n,i,l=t[1]&&sk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class LW extends De{constructor(e){super(),Re(this,e,CW,AW,Ie,{size:0,title:1})}}function ok(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function IW(t){let e,n,i=t[1]&&ok(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class DW extends De{constructor(e){super(),Re(this,e,RW,IW,Ie,{size:0,title:1})}}function ak(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function PW(t){let e,n,i=t[1]&&ak(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class BW extends De{constructor(e){super(),Re(this,e,NW,PW,Ie,{size:0,title:1})}}function uk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function zW(t){let e,n,i=t[1]&&uk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class UW extends De{constructor(e){super(),Re(this,e,HW,zW,Ie,{size:0,title:1})}}function fk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function FW(t){let e,n,i=t[1]&&fk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class VW extends De{constructor(e){super(),Re(this,e,GW,FW,Ie,{size:0,title:1})}}function ck(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function WW(t){let e,n,i,l=t[1]&&ck(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let jW=class extends De{constructor(e){super(),Re(this,e,qW,WW,Ie,{size:0,title:1})}};function dk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function YW(t){let e,n,i=t[1]&&dk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class XW extends De{constructor(e){super(),Re(this,e,ZW,YW,Ie,{size:0,title:1})}}function hk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function KW(t){let e,n,i=t[1]&&hk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class xs extends De{constructor(e){super(),Re(this,e,$W,KW,Ie,{size:0,title:1})}}function mk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function JW(t){let e,n,i=t[1]&&mk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let Jh=class extends De{constructor(e){super(),Re(this,e,QW,JW,Ie,{size:0,title:1})}};function gk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function xW(t){let e,n,i=t[1]&&gk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class tq extends De{constructor(e){super(),Re(this,e,eq,xW,Ie,{size:0,title:1})}}function _k(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function nq(t){let e,n,i=t[1]&&_k(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let lq=class extends De{constructor(e){super(),Re(this,e,iq,nq,Ie,{size:0,title:1})}};function pk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function rq(t){let e,n,i=t[1]&&pk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class oq extends De{constructor(e){super(),Re(this,e,sq,rq,Ie,{size:0,title:1})}}function bk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function aq(t){let e,n,i,l=t[1]&&bk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class fq extends De{constructor(e){super(),Re(this,e,uq,aq,Ie,{size:0,title:1})}}function vk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function cq(t){let e,n,i,l,r,s=t[1]&&vk(t),o=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],a={};for(let u=0;u{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class hq extends De{constructor(e){super(),Re(this,e,dq,cq,Ie,{size:0,title:1})}}function kk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function mq(t){let e,n,i=t[1]&&kk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class _q extends De{constructor(e){super(),Re(this,e,gq,mq,Ie,{size:0,title:1})}}function wk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function pq(t){let e,n,i=t[1]&&wk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class $1 extends De{constructor(e){super(),Re(this,e,bq,pq,Ie,{size:0,title:1})}}function yk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function vq(t){let e,n,i,l=t[1]&&yk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class dd extends De{constructor(e){super(),Re(this,e,kq,vq,Ie,{size:0,title:1})}}function Tk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function wq(t){let e,n,i,l=t[1]&&Tk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Tq extends De{constructor(e){super(),Re(this,e,yq,wq,Ie,{size:0,title:1})}}function Sk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Sq(t){let e,n,i=t[1]&&Sk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class ws extends De{constructor(e){super(),Re(this,e,Eq,Sq,Ie,{size:0,title:1})}}function Ek(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Mq(t){let e,n,i,l=t[1]&&Ek(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Aq extends De{constructor(e){super(),Re(this,e,Oq,Mq,Ie,{size:0,title:1})}}function Mk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Cq(t){let e,n,i,l=t[1]&&Mk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let Iq=class extends De{constructor(e){super(),Re(this,e,Lq,Cq,Ie,{size:0,title:1})}};function Ok(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Rq(t){let e,n,i=t[1]&&Ok(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Pq extends De{constructor(e){super(),Re(this,e,Dq,Rq,Ie,{size:0,title:1})}}function Ak(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Nq(t){let e,n,i=t[1]&&Ak(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class zq extends De{constructor(e){super(),Re(this,e,Bq,Nq,Ie,{size:0,title:1})}}function Ck(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Hq(t){let e,n,i,l=t[1]&&Ck(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Fq extends De{constructor(e){super(),Re(this,e,Uq,Hq,Ie,{size:0,title:1})}}function Lk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Gq(t){let e,n,i,l=t[1]&&Lk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Wq extends De{constructor(e){super(),Re(this,e,Vq,Gq,Ie,{size:0,title:1})}}function Ik(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function qq(t){let e,n,i=t[1]&&Ik(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Yq extends De{constructor(e){super(),Re(this,e,jq,qq,Ie,{size:0,title:1})}}function Rk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Zq(t){let e,n,i,l=t[1]&&Rk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Dk extends De{constructor(e){super(),Re(this,e,Xq,Zq,Ie,{size:0,title:1})}}function Kq(){const t=window.__GS_BASE_PATH__||"";return t==="/"?"":t}class $q{constructor(){sl(this,"baseURL");sl(this,"headers");sl(this,"onUnauthorizedcallMe");sl(this,"loggedIn");sl(this,"jwtToken");sl(this,"username");const e=localStorage.getItem("jwt"),n=Kq();this.baseURL=n+"/api",this.username="",this.headers={Authorization:`Bearer ${e}`},this.onUnauthorizedcallMe=()=>{}}verifyToken(){return this.doCallRaw("/auth/verify").then(async e=>{if(e.status===200){const n=await e.json();return this.jwtToken=localStorage.getItem("jwt")||"",this.setLoggedIn(this.jwtToken,n.Username||""),!0}else return this.setLoggedOut(),!1})}setLoggedIn(e,n){this.jwtToken=e,this.username=n,this.loggedIn=!0}setLoggedOut(){localStorage.removeItem("jwt"),this.username="",this.loggedIn=!1}onUnauthorized(e){this.onUnauthorizedcallMe=e}setHeaders(e){this.headers=e}getHeaders(){const e=localStorage.getItem("jwt");return this.headers.Authorization=`Bearer ${e}`,this.headers}getSetting(e){return new Promise(async(n,i)=>{const l="/settings/"+e;this.doCall(l).then(function(r){n(r)}).catch(function(r){i(r)})})}deleteUser(e){return new Promise(async(n,i)=>{const l="/users/"+e;this.doCall(l,"delete").then(function(r){n(r)}).catch(function(r){i(r)})})}getUsers(){return new Promise(async(e,n)=>{const i="/users";this.doCall(i).then(function(l){e(l)}).catch(function(l){n(l)})})}createUser(e){return new Promise(async(n,i)=>{const l="/users";this.doCall(l,"post",e).then(function(r){n(r)}).catch(function(r){i(r)})})}updateUser(e){return new Promise(async(n,i)=>{const l="/users";this.doCall(l,"put",e).then(function(r){n(r)}).catch(function(r){i(r)})})}setSetting(e,n,i){return new Promise(async(l,r)=>{const s="/settings/"+e;var o=i?i(n):{key:e,value:n};this.doCall(s,"post",o).then(function(a){if(a===void 0)throw new Error("Setting update failed");l(!0)}).catch(function(a){r(a)})})}doCallRaw(e="/",n="get",i={}){const l=this,r={method:n,headers:this.getHeaders()};return n==="post"&&(r.body=JSON.stringify(i)),new Promise((o,a)=>{fetch(l.baseURL+e,r).then(u=>{o(u)}).catch(u=>{a(u)})})}async doCall(e="/",n="get",i={},l={}){const r=this,s={method:n,headers:this.getHeaders(),...l};(n==="post"||n==="put")&&(s.body=JSON.stringify(i));try{const o=await fetch(r.baseURL+e,s);if(o.status===401)throw r.onUnauthorizedcallMe(),new Error("Authentication required");if(!o.ok)throw new Error("GateSentry request failed with status "+o.status);return await o.json()}catch(o){throw console.error("Gatesentry API error : [Path "+e+"] [Method "+n+"]",o),o}}}const ZT=new $q,{subscribe:Jq,update:Qh}=un({api:ZT}),An={subscribe:Jq,loginSuccesful:(t,e)=>Qh(n=>(n.api.setLoggedIn(t,e),n)),logout:()=>Qh(t=>(t.api.setLoggedOut(),t)),refresh:()=>Qh(t=>t)};ZT.onUnauthorized(()=>{An.logout()});function ni(){const t=window.__GS_BASE_PATH__||"";return t==="/"?"":t}function Vi(t,e){const n=ni();bW(n+t,e)}const{subscribe:Qq,update:xh}=un([]),ci={subscribe:Qq,add:({title:t,subtitle:e,kind:n,timeout:i=1e3})=>xh(l=>[...l,{id:l.length+1,title:t,subtitle:e,kind:n,timeout:i}]),remove:t=>xh(e=>e.filter(n=>n.id!==t.id)),refresh:()=>xh(t=>t)},XT=(t,e)=>({kind:t.kind??"error",title:t.title??e("Error"),subtitle:t.subtitle??e("Unable to perform action"),timeout:t.timeout??3e4}),Hu=(t,e)=>XT({...t,kind:"success",timeout:2e3,title:e("Success")},e),ao=(t,e)=>XT({...t,kind:"error",timeout:3e4},e),Pk=t=>{const e=["Bytes","KB","MB","GB","TB"];if(t===0)return"0 B";const n=Math.floor(Math.log(t)/Math.log(1024));return Math.round(t/Math.pow(1024,n))+" "+e[n]};var Wa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function KT(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function xq(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,l.get?l:{enumerable:!0,get:function(){return t[i]}})}),n}var ej=function(e){return tj(e)&&!nj(e)};function tj(t){return!!t&&typeof t=="object"}function nj(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||rj(t)}var ij=typeof Symbol=="function"&&Symbol.for,lj=ij?Symbol.for("react.element"):60103;function rj(t){return t.$$typeof===lj}function sj(t){return Array.isArray(t)?[]:{}}function _u(t,e){return e.clone!==!1&&e.isMergeableObject(t)?Jo(sj(t),t,e):t}function oj(t,e,n){return t.concat(e).map(function(i){return _u(i,n)})}function aj(t,e){if(!e.customMerge)return Jo;var n=e.customMerge(t);return typeof n=="function"?n:Jo}function uj(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function Nk(t){return Object.keys(t).concat(uj(t))}function $T(t,e){try{return e in t}catch{return!1}}function fj(t,e){return $T(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function cj(t,e,n){var i={};return n.isMergeableObject(t)&&Nk(t).forEach(function(l){i[l]=_u(t[l],n)}),Nk(e).forEach(function(l){fj(t,l)||($T(t,l)&&n.isMergeableObject(e[l])?i[l]=aj(l,n)(t[l],e[l],n):i[l]=_u(e[l],n))}),i}function Jo(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||oj,n.isMergeableObject=n.isMergeableObject||ej,n.cloneUnlessOtherwiseSpecified=_u;var i=Array.isArray(e),l=Array.isArray(t),r=i===l;return r?i?n.arrayMerge(t,e,n):cj(t,e,n):_u(e,n)}Jo.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(i,l){return Jo(i,l,n)},{})};var dj=Jo,hj=dj;const mj=KT(hj);var Wm=function(t,e){return Wm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(n[l]=i[l])},Wm(t,e)};function hd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Wm(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var vn=function(){return vn=Object.assign||function(e){for(var n,i=1,l=arguments.length;i0}),n=[],i=0,l=e;i1)throw new RangeError("integer-width stems only accept a single optional option");l.options[0].replace(yj,function(a,u,f,c,d,h){if(u)e.minimumIntegerDigits=f.length;else{if(c&&d)throw new Error("We currently do not support maximum integer digits");if(h)throw new Error("We currently do not support exact integer digits")}return""});continue}if(s8.test(l.stem)){e.minimumIntegerDigits=l.stem.length;continue}if(zk.test(l.stem)){if(l.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");l.stem.replace(zk,function(a,u,f,c,d,h){return f==="*"?e.minimumFractionDigits=u.length:c&&c[0]==="#"?e.maximumFractionDigits=c.length:d&&h?(e.minimumFractionDigits=d.length,e.maximumFractionDigits=d.length+h.length):(e.minimumFractionDigits=u.length,e.maximumFractionDigits=u.length),""});var r=l.options[0];r==="w"?e=vn(vn({},e),{trailingZeroDisplay:"stripIfInteger"}):r&&(e=vn(vn({},e),Hk(r)));continue}if(r8.test(l.stem)){e=vn(vn({},e),Hk(l.stem));continue}var s=o8(l.stem);s&&(e=vn(vn({},e),s));var o=Tj(l.stem);o&&(e=vn(vn({},e),o))}return e}var Wf={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function Ej(t,e){for(var n="",i=0;i>1),a="a",u=Mj(e);for((u=="H"||u=="k")&&(o=0);o-- >0;)n+=a;for(;s-- >0;)n=u+n}else l==="J"?n+="H":n+=l}return n}function Mj(t){var e=t.hourCycle;if(e===void 0&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=t.language,i;n!=="root"&&(i=t.maximize().region);var l=Wf[i||""]||Wf[n||""]||Wf["".concat(n,"-001")]||Wf["001"];return l[0]}var tm,Oj=new RegExp("^".concat(l8.source,"*")),Aj=new RegExp("".concat(l8.source,"*$"));function fn(t,e){return{start:t,end:e}}var Cj=!!String.prototype.startsWith,Lj=!!String.fromCodePoint,Ij=!!Object.fromEntries,Rj=!!String.prototype.codePointAt,Dj=!!String.prototype.trimStart,Pj=!!String.prototype.trimEnd,Nj=!!Number.isSafeInteger,Bj=Nj?Number.isSafeInteger:function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},jm=!0;try{var zj=u8("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");jm=((tm=zj.exec("a"))===null||tm===void 0?void 0:tm[0])==="a"}catch{jm=!1}var Fk=Cj?function(e,n,i){return e.startsWith(n,i)}:function(e,n,i){return e.slice(i,i+n.length)===n},Ym=Lj?String.fromCodePoint:function(){for(var e=[],n=0;nr;){if(s=e[r++],s>1114111)throw RangeError(s+" is not a valid code point");i+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return i},Gk=Ij?Object.fromEntries:function(e){for(var n={},i=0,l=e;i=i)){var l=e.charCodeAt(n),r;return l<55296||l>56319||n+1===i||(r=e.charCodeAt(n+1))<56320||r>57343?l:(l-55296<<10)+(r-56320)+65536}},Hj=Dj?function(e){return e.trimStart()}:function(e){return e.replace(Oj,"")},Uj=Pj?function(e){return e.trimEnd()}:function(e){return e.replace(Aj,"")};function u8(t,e){return new RegExp(t,e)}var Zm;if(jm){var Vk=u8("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Zm=function(e,n){var i;Vk.lastIndex=n;var l=Vk.exec(e);return(i=l[1])!==null&&i!==void 0?i:""}}else Zm=function(e,n){for(var i=[];;){var l=a8(e,n);if(l===void 0||f8(l)||Wj(l))break;i.push(l),n+=l>=65536?2:1}return Ym.apply(void 0,i)};var Fj=function(){function t(e,n){n===void 0&&(n={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return t.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(e,n,i){for(var l=[];!this.isEOF();){var r=this.char();if(r===123){var s=this.parseArgument(e,i);if(s.err)return s;l.push(s.val)}else{if(r===125&&e>0)break;if(r===35&&(n==="plural"||n==="selectordinal")){var o=this.clonePosition();this.bump(),l.push({type:Gn.pound,location:fn(o,this.clonePosition())})}else if(r===60&&!this.ignoreTag&&this.peek()===47){if(i)break;return this.error(an.UNMATCHED_CLOSING_TAG,fn(this.clonePosition(),this.clonePosition()))}else if(r===60&&!this.ignoreTag&&Xm(this.peek()||0)){var s=this.parseTag(e,n);if(s.err)return s;l.push(s.val)}else{var s=this.parseLiteral(e,n);if(s.err)return s;l.push(s.val)}}}return{val:l,err:null}},t.prototype.parseTag=function(e,n){var i=this.clonePosition();this.bump();var l=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Gn.literal,value:"<".concat(l,"/>"),location:fn(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var r=this.parseMessage(e+1,n,!0);if(r.err)return r;var s=r.val,o=this.clonePosition();if(this.bumpIf("")?{val:{type:Gn.tag,value:l,children:s,location:fn(i,this.clonePosition())},err:null}:this.error(an.INVALID_TAG,fn(o,this.clonePosition())))}else return this.error(an.UNCLOSED_TAG,fn(i,this.clonePosition()))}else return this.error(an.INVALID_TAG,fn(i,this.clonePosition()))},t.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&Vj(this.char());)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(e,n){for(var i=this.clonePosition(),l="";;){var r=this.tryParseQuote(n);if(r){l+=r;continue}var s=this.tryParseUnquoted(e,n);if(s){l+=s;continue}var o=this.tryParseLeftAngleBracket();if(o){l+=o;continue}break}var a=fn(i,this.clonePosition());return{val:{type:Gn.literal,value:l,location:a},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Gj(this.peek()||0))?(this.bump(),"<"):null},t.prototype.tryParseQuote=function(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(e==="plural"||e==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(i===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(i);this.bump()}return Ym.apply(void 0,n)},t.prototype.tryParseUnquoted=function(e,n){if(this.isEOF())return null;var i=this.char();return i===60||i===123||i===35&&(n==="plural"||n==="selectordinal")||i===125&&e>0?null:(this.bump(),Ym(i))},t.prototype.parseArgument=function(e,n){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(an.EXPECT_ARGUMENT_CLOSING_BRACE,fn(i,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(an.EMPTY_ARGUMENT,fn(i,this.clonePosition()));var l=this.parseIdentifierIfPossible().value;if(!l)return this.error(an.MALFORMED_ARGUMENT,fn(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(an.EXPECT_ARGUMENT_CLOSING_BRACE,fn(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Gn.argument,value:l,location:fn(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(an.EXPECT_ARGUMENT_CLOSING_BRACE,fn(i,this.clonePosition())):this.parseArgumentOptions(e,n,l,i);default:return this.error(an.MALFORMED_ARGUMENT,fn(i,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),n=this.offset(),i=Zm(this.message,n),l=n+i.length;this.bumpTo(l);var r=this.clonePosition(),s=fn(e,r);return{value:i,location:s}},t.prototype.parseArgumentOptions=function(e,n,i,l){var r,s=this.clonePosition(),o=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(o){case"":return this.error(an.EXPECT_ARGUMENT_TYPE,fn(s,a));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var f=this.clonePosition(),c=this.parseSimpleArgStyleIfPossible();if(c.err)return c;var d=Uj(c.val);if(d.length===0)return this.error(an.EXPECT_ARGUMENT_STYLE,fn(this.clonePosition(),this.clonePosition()));var h=fn(f,this.clonePosition());u={style:d,styleLocation:h}}var g=this.tryParseArgumentClose(l);if(g.err)return g;var _=fn(l,this.clonePosition());if(u&&Fk(u==null?void 0:u.style,"::",0)){var v=Hj(u.style.slice(2));if(o==="number"){var c=this.parseNumberSkeletonFromString(v,u.styleLocation);return c.err?c:{val:{type:Gn.number,value:i,location:_,style:c.val},err:null}}else{if(v.length===0)return this.error(an.EXPECT_DATE_TIME_SKELETON,_);var S=v;this.locale&&(S=Ej(v,this.locale));var d={type:Qo.dateTime,pattern:S,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?bj(S):{}},A=o==="date"?Gn.date:Gn.time;return{val:{type:A,value:i,location:_,style:d},err:null}}}return{val:{type:o==="number"?Gn.number:o==="date"?Gn.date:Gn.time,value:i,location:_,style:(r=u==null?void 0:u.style)!==null&&r!==void 0?r:null},err:null}}case"plural":case"selectordinal":case"select":{var C=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(an.EXPECT_SELECT_ARGUMENT_OPTIONS,fn(C,vn({},C)));this.bumpSpace();var I=this.parseIdentifierIfPossible(),M=0;if(o!=="select"&&I.value==="offset"){if(!this.bumpIf(":"))return this.error(an.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,fn(this.clonePosition(),this.clonePosition()));this.bumpSpace();var c=this.tryParseDecimalInteger(an.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,an.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(c.err)return c;this.bumpSpace(),I=this.parseIdentifierIfPossible(),M=c.val}var L=this.tryParsePluralOrSelectOptions(e,o,n,I);if(L.err)return L;var g=this.tryParseArgumentClose(l);if(g.err)return g;var N=fn(l,this.clonePosition());return o==="select"?{val:{type:Gn.select,value:i,options:Gk(L.val),location:N},err:null}:{val:{type:Gn.plural,value:i,options:Gk(L.val),offset:M,pluralType:o==="plural"?"cardinal":"ordinal",location:N},err:null}}default:return this.error(an.INVALID_ARGUMENT_TYPE,fn(s,a))}},t.prototype.tryParseArgumentClose=function(e){return this.isEOF()||this.char()!==125?this.error(an.EXPECT_ARGUMENT_CLOSING_BRACE,fn(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,n=this.clonePosition();!this.isEOF();){var i=this.char();switch(i){case 39:{this.bump();var l=this.clonePosition();if(!this.bumpUntil("'"))return this.error(an.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,fn(l,this.clonePosition()));this.bump();break}case 123:{e+=1,this.bump();break}case 125:{if(e>0)e-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(e,n){var i=[];try{i=kj(e)}catch{return this.error(an.INVALID_NUMBER_SKELETON,n)}return{val:{type:Qo.number,tokens:i,location:n,parsedOptions:this.shouldParseSkeletons?Sj(i):{}},err:null}},t.prototype.tryParsePluralOrSelectOptions=function(e,n,i,l){for(var r,s=!1,o=[],a=new Set,u=l.value,f=l.location;;){if(u.length===0){var c=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var d=this.tryParseDecimalInteger(an.EXPECT_PLURAL_ARGUMENT_SELECTOR,an.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;f=fn(c,this.clonePosition()),u=this.message.slice(c.offset,this.offset())}else break}if(a.has(u))return this.error(n==="select"?an.DUPLICATE_SELECT_ARGUMENT_SELECTOR:an.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,f);u==="other"&&(s=!0),this.bumpSpace();var h=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?an.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:an.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,fn(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(e+1,n,i);if(g.err)return g;var _=this.tryParseArgumentClose(h);if(_.err)return _;o.push([u,{value:g.val,location:fn(h,this.clonePosition())}]),a.add(u),this.bumpSpace(),r=this.parseIdentifierIfPossible(),u=r.value,f=r.location}return o.length===0?this.error(n==="select"?an.EXPECT_SELECT_ARGUMENT_SELECTOR:an.EXPECT_PLURAL_ARGUMENT_SELECTOR,fn(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(an.MISSING_OTHER_CLAUSE,fn(this.clonePosition(),this.clonePosition())):{val:o,err:null}},t.prototype.tryParseDecimalInteger=function(e,n){var i=1,l=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var r=!1,s=0;!this.isEOF();){var o=this.char();if(o>=48&&o<=57)r=!0,s=s*10+(o-48),this.bump();else break}var a=fn(l,this.clonePosition());return r?(s*=i,Bj(s)?{val:s,err:null}:this.error(n,a)):this.error(e,a)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var n=a8(this.message,e);if(n===void 0)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return n},t.prototype.error=function(e,n){return{val:null,err:{kind:e,message:this.message,location:n}}},t.prototype.bump=function(){if(!this.isEOF()){var e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},t.prototype.bumpIf=function(e){if(Fk(this.message,e,this.offset())){for(var n=0;n=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var n=this.offset();if(n===e)break;if(n>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&f8(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),n=this.offset(),i=this.message.charCodeAt(n+(e>=65536?2:1));return i??null},t}();function Xm(t){return t>=97&&t<=122||t>=65&&t<=90}function Gj(t){return Xm(t)||t===47}function Vj(t){return t===45||t===46||t>=48&&t<=57||t===95||t>=97&&t<=122||t>=65&&t<=90||t==183||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}function f8(t){return t>=9&&t<=13||t===32||t===133||t>=8206&&t<=8207||t===8232||t===8233}function Wj(t){return t>=33&&t<=35||t===36||t>=37&&t<=39||t===40||t===41||t===42||t===43||t===44||t===45||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||t===91||t===92||t===93||t===94||t===96||t===123||t===124||t===125||t===126||t===161||t>=162&&t<=165||t===166||t===167||t===169||t===171||t===172||t===174||t===176||t===177||t===182||t===187||t===191||t===215||t===247||t>=8208&&t<=8213||t>=8214&&t<=8215||t===8216||t===8217||t===8218||t>=8219&&t<=8220||t===8221||t===8222||t===8223||t>=8224&&t<=8231||t>=8240&&t<=8248||t===8249||t===8250||t>=8251&&t<=8254||t>=8257&&t<=8259||t===8260||t===8261||t===8262||t>=8263&&t<=8273||t===8274||t===8275||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||t===8608||t>=8609&&t<=8610||t===8611||t>=8612&&t<=8613||t===8614||t>=8615&&t<=8621||t===8622||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||t===8658||t===8659||t===8660||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||t===8968||t===8969||t===8970||t===8971||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||t===9001||t===9002||t>=9003&&t<=9083||t===9084||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||t===9655||t>=9656&&t<=9664||t===9665||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||t===9839||t>=9840&&t<=10087||t===10088||t===10089||t===10090||t===10091||t===10092||t===10093||t===10094||t===10095||t===10096||t===10097||t===10098||t===10099||t===10100||t===10101||t>=10132&&t<=10175||t>=10176&&t<=10180||t===10181||t===10182||t>=10183&&t<=10213||t===10214||t===10215||t===10216||t===10217||t===10218||t===10219||t===10220||t===10221||t===10222||t===10223||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||t===10627||t===10628||t===10629||t===10630||t===10631||t===10632||t===10633||t===10634||t===10635||t===10636||t===10637||t===10638||t===10639||t===10640||t===10641||t===10642||t===10643||t===10644||t===10645||t===10646||t===10647||t===10648||t>=10649&&t<=10711||t===10712||t===10713||t===10714||t===10715||t>=10716&&t<=10747||t===10748||t===10749||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||t===11158||t>=11159&&t<=11263||t>=11776&&t<=11777||t===11778||t===11779||t===11780||t===11781||t>=11782&&t<=11784||t===11785||t===11786||t===11787||t===11788||t===11789||t>=11790&&t<=11798||t===11799||t>=11800&&t<=11801||t===11802||t===11803||t===11804||t===11805||t>=11806&&t<=11807||t===11808||t===11809||t===11810||t===11811||t===11812||t===11813||t===11814||t===11815||t===11816||t===11817||t>=11818&&t<=11822||t===11823||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||t===11840||t===11841||t===11842||t>=11843&&t<=11855||t>=11856&&t<=11857||t===11858||t>=11859&&t<=11903||t>=12289&&t<=12291||t===12296||t===12297||t===12298||t===12299||t===12300||t===12301||t===12302||t===12303||t===12304||t===12305||t>=12306&&t<=12307||t===12308||t===12309||t===12310||t===12311||t===12312||t===12313||t===12314||t===12315||t===12316||t===12317||t>=12318&&t<=12319||t===12320||t===12336||t===64830||t===64831||t>=65093&&t<=65094}function Km(t){t.forEach(function(e){if(delete e.location,e8(e)||t8(e))for(var n in e.options)delete e.options[n].location,Km(e.options[n].value);else JT(e)&&i8(e.style)||(QT(e)||xT(e))&&qm(e.style)?delete e.style.location:n8(e)&&Km(e.children)})}function qj(t,e){e===void 0&&(e={}),e=vn({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var n=new Fj(t,e).parse();if(n.err){var i=SyntaxError(an[n.err.kind]);throw i.location=n.err.location,i.originalMessage=n.err.message,i}return e!=null&&e.captureLocation||Km(n.val),n.val}function nm(t,e){var n=e&&e.cache?e.cache:$j,i=e&&e.serializer?e.serializer:Kj,l=e&&e.strategy?e.strategy:Yj;return l(t,{cache:n,serializer:i})}function jj(t){return t==null||typeof t=="number"||typeof t=="boolean"}function c8(t,e,n,i){var l=jj(i)?i:n(i),r=e.get(l);return typeof r>"u"&&(r=t.call(this,i),e.set(l,r)),r}function d8(t,e,n){var i=Array.prototype.slice.call(arguments,3),l=n(i),r=e.get(l);return typeof r>"u"&&(r=t.apply(this,i),e.set(l,r)),r}function J1(t,e,n,i,l){return n.bind(e,t,i,l)}function Yj(t,e){var n=t.length===1?c8:d8;return J1(t,this,n,e.cache.create(),e.serializer)}function Zj(t,e){return J1(t,this,d8,e.cache.create(),e.serializer)}function Xj(t,e){return J1(t,this,c8,e.cache.create(),e.serializer)}var Kj=function(){return JSON.stringify(arguments)};function Q1(){this.cache=Object.create(null)}Q1.prototype.get=function(t){return this.cache[t]};Q1.prototype.set=function(t,e){this.cache[t]=e};var $j={create:function(){return new Q1}},im={variadic:Zj,monadic:Xj},xo;(function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"})(xo||(xo={}));var md=function(t){hd(e,t);function e(n,i,l){var r=t.call(this,n)||this;return r.code=i,r.originalMessage=l,r}return e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),Wk=function(t){hd(e,t);function e(n,i,l,r){return t.call(this,'Invalid values for "'.concat(n,'": "').concat(i,'". Options are "').concat(Object.keys(l).join('", "'),'"'),xo.INVALID_VALUE,r)||this}return e}(md),Jj=function(t){hd(e,t);function e(n,i,l){return t.call(this,'Value for "'.concat(n,'" must be of type ').concat(i),xo.INVALID_VALUE,l)||this}return e}(md),Qj=function(t){hd(e,t);function e(n,i){return t.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(i,'"'),xo.MISSING_VALUE,i)||this}return e}(md),Qi;(function(t){t[t.literal=0]="literal",t[t.object=1]="object"})(Qi||(Qi={}));function xj(t){return t.length<2?t:t.reduce(function(e,n){var i=e[e.length-1];return!i||i.type!==Qi.literal||n.type!==Qi.literal?e.push(n):i.value+=n.value,e},[])}function eY(t){return typeof t=="function"}function tc(t,e,n,i,l,r,s){if(t.length===1&&Bk(t[0]))return[{type:Qi.literal,value:t[0].value}];for(var o=[],a=0,u=t;a{f[g]=null}),ce(),l=f[i],l||(l=f[i]=u[i](d),l.c()),b(l,1),l.m(e,null)),(!r||h[0]&1024)&&(e.disabled=d[10]),(!r||h[0]&1024)&&E(e,"bx--btn--disabled",d[10]),(!r||h[0]&256)&&E(e,"bx--tooltip--top",d[8]==="top"),(!r||h[0]&256)&&E(e,"bx--tooltip--right",d[8]==="right"),(!r||h[0]&256)&&E(e,"bx--tooltip--bottom",d[8]==="bottom"),(!r||h[0]&256)&&E(e,"bx--tooltip--left",d[8]==="left"),(!r||h[0]&128)&&E(e,"bx--tooltip--align-start",d[7]==="start"),(!r||h[0]&128)&&E(e,"bx--tooltip--align-center",d[7]==="center"),(!r||h[0]&128)&&E(e,"bx--tooltip--align-end",d[7]==="end")},i(d){r||(b(l),r=!0)},o(d){k(l),r=!1},d(d){d&&w(e),a&&a.d(),f[i].d(),s=!1,o()}}}function yv(t){let e;function n(r,s){return r[1]==="text"?XF:ZF}let i=n(t),l=i(t);return{c(){e=R("span"),l.c(),E(e,"bx--assistive-text",!0)},m(r,s){y(r,e,s),l.m(e,null)},p(r,s){i===(i=n(r))&&l?l.p(r,s):(l.d(1),l=i(r),l&&(l.c(),l.m(e,null)))},d(r){r&&w(e),l.d()}}}function ZF(t){let e;return{c(){e=q(t[6])},m(n,i){y(n,e,i)},p(n,i){i[0]&64&&Z(e,n[6])},d(n){n&&w(e)}}}function XF(t){let e;return{c(){e=q(t[5])},m(n,i){y(n,e,i)},p(n,i){i[0]&32&&Z(e,n[5])},d(n){n&&w(e)}}}function KF(t){let e,n;return e=new HF({props:{class:"bx--icon-visibility-on"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function $F(t){let e,n;return e=new VF({props:{class:"bx--icon-visibility-off"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Tv(t){let e,n;return{c(){e=R("div"),n=q(t[15]),P(e,"id",t[22]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&32768&&Z(n,i[15]),l[0]&4194304&&P(e,"id",i[22])},d(i){i&&w(e)}}}function Sv(t){let e,n;return{c(){e=R("div"),n=q(t[11]),E(e,"bx--form__helper-text",!0),E(e,"bx--form__helper-text--disabled",t[10]),E(e,"bx--form__helper-text--inline",t[18])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&2048&&Z(n,i[11]),l[0]&1024&&E(e,"bx--form__helper-text--disabled",i[10]),l[0]&262144&&E(e,"bx--form__helper-text--inline",i[18])},d(i){i&&w(e)}}}function Ev(t){let e,n;return{c(){e=R("div"),n=q(t[17]),P(e,"id",t[21]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&131072&&Z(n,i[17]),l[0]&2097152&&P(e,"id",i[21])},d(i){i&&w(e)}}}function JF(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,L=t[18]&&gv(t),N=!t[18]&&(t[12]||t[25].labelText)&&pv(t),z=t[14]&&bv(),W=!t[14]&&t[16]&&vv(),D=[{"data-invalid":u=t[14]||void 0},{"aria-invalid":f=t[14]||void 0},{"aria-describedby":c=t[14]?t[22]:t[16]?t[21]:t[11]?t[23]:void 0},{id:t[19]},{name:t[20]},{placeholder:t[4]},{type:t[1]},{value:d=t[0]??""},{disabled:t[10]},t[26]],G={};for(let X=0;X{L=null}),ce()),!X[18]&&(X[12]||X[25].labelText)?N?(N.p(X,de),de[0]&33820672&&b(N,1)):(N=pv(X),N.c(),b(N,1),N.m(e,i)):N&&(fe(),k(N,1,1,()=>{N=null}),ce()),X[14]?z?de[0]&16384&&b(z,1):(z=bv(),z.c(),b(z,1),z.m(r,s)):z&&(fe(),k(z,1,1,()=>{z=null}),ce()),!X[14]&&X[16]?W?de[0]&81920&&b(W,1):(W=vv(),W.c(),b(W,1),W.m(r,o)):W&&(fe(),k(W,1,1,()=>{W=null}),ce()),Ae(a,G=Ue(D,[(!C||de[0]&16384&&u!==(u=X[14]||void 0))&&{"data-invalid":u},(!C||de[0]&16384&&f!==(f=X[14]||void 0))&&{"aria-invalid":f},(!C||de[0]&14764032&&c!==(c=X[14]?X[22]:X[16]?X[21]:X[11]?X[23]:void 0))&&{"aria-describedby":c},(!C||de[0]&524288)&&{id:X[19]},(!C||de[0]&1048576)&&{name:X[20]},(!C||de[0]&16)&&{placeholder:X[4]},(!C||de[0]&2)&&{type:X[1]},(!C||de[0]&1&&d!==(d=X[0]??"")&&a.value!==d)&&{value:d},(!C||de[0]&1024)&&{disabled:X[10]},de[0]&67108864&&X[26]])),"value"in G&&(a.value=G.value),E(a,"bx--text-input",!0),E(a,"bx--password-input",!0),E(a,"bx--text-input--light",X[9]),E(a,"bx--text-input--invalid",X[14]),E(a,"bx--text-input--warning",X[16]),E(a,"bx--text-input--sm",X[3]==="sm"),E(a,"bx--text-input--xl",X[3]==="xl"),X[24]&&X[14]?$?$.p(X,de):($=kv(X),$.c(),$.m(r,g)):$&&($.d(1),$=null),X[24]&&X[14]?j&&(fe(),k(j,1,1,()=>{j=null}),ce()):j?(j.p(X,de),de[0]&16793600&&b(j,1)):(j=wv(X),j.c(),b(j,1),j.m(r,null)),(!C||de[0]&16384&&_!==(_=X[14]||void 0))&&P(r,"data-invalid",_),(!C||de[0]&65536)&&E(r,"bx--text-input__field-wrapper--warning",X[16]),!X[24]&&X[14]?Q?Q.p(X,de):(Q=Tv(X),Q.c(),Q.m(l,S)):Q&&(Q.d(1),Q=null),!X[14]&&!X[16]&&!X[24]&&!X[18]&&X[11]?le?le.p(X,de):(le=Sv(X),le.c(),le.m(l,A)):le&&(le.d(1),le=null),!X[24]&&!X[14]&&X[16]?oe?oe.p(X,de):(oe=Ev(X),oe.c(),oe.m(l,null)):oe&&(oe.d(1),oe=null),(!C||de[0]&262144)&&E(l,"bx--text-input__field-outer-wrapper--inline",X[18]),(!C||de[0]&16777216)&&E(e,"bx--password-input-wrapper",!X[24]),(!C||de[0]&512)&&E(e,"bx--text-input-wrapper--light",X[9]),(!C||de[0]&262144)&&E(e,"bx--text-input-wrapper--inline",X[18])},i(X){C||(b(L),b(N),b(z),b(W),b(j),C=!0)},o(X){k(L),k(N),k(z),k(W),k(j),C=!1},d(X){X&&w(e),L&&L.d(),N&&N.d(),z&&z.d(),W&&W.d(),t[40](null),$&&$.d(),j&&j.d(),Q&&Q.d(),le&&le.d(),oe&&oe.d(),I=!1,vt(M)}}}function QF(t,e,n){let i,l,r,s;const o=["size","value","type","placeholder","hidePasswordLabel","showPasswordLabel","tooltipAlignment","tooltipPosition","light","disabled","helperText","labelText","hideLabel","invalid","invalidText","warn","warnText","inline","id","name","ref"];let a=ae(e,o),{$$slots:u={},$$scope:f}=e;const c=Yi(u);let{size:d=void 0}=e,{value:h=""}=e,{type:g="password"}=e,{placeholder:_=""}=e,{hidePasswordLabel:v="Hide password"}=e,{showPasswordLabel:S="Show password"}=e,{tooltipAlignment:A="center"}=e,{tooltipPosition:C="bottom"}=e,{light:I=!1}=e,{disabled:M=!1}=e,{helperText:L=""}=e,{labelText:N=""}=e,{hideLabel:z=!1}=e,{invalid:W=!1}=e,{invalidText:D=""}=e,{warn:G=!1}=e,{warnText:$=""}=e,{inline:j=!1}=e,{id:Q="ccs-"+Math.random().toString(36)}=e,{name:le=void 0}=e,{ref:oe=null}=e;const X=bi("Form");function de(ue){te.call(this,t,ue)}function re(ue){te.call(this,t,ue)}function x(ue){te.call(this,t,ue)}function me(ue){te.call(this,t,ue)}function ee(ue){te.call(this,t,ue)}function ke(ue){te.call(this,t,ue)}function pe(ue){te.call(this,t,ue)}function Fe(ue){te.call(this,t,ue)}function Ve(ue){te.call(this,t,ue)}function Ee(ue){te.call(this,t,ue)}function We(ue){te.call(this,t,ue)}function ge(ue){ft[ue?"unshift":"push"](()=>{oe=ue,n(2,oe)})}const ve=({target:ue})=>{n(0,h=ue.value)},be=()=>{n(1,g=g==="password"?"text":"password")};return t.$$set=ue=>{e=Y(Y({},e),Se(ue)),n(26,a=ae(e,o)),"size"in ue&&n(3,d=ue.size),"value"in ue&&n(0,h=ue.value),"type"in ue&&n(1,g=ue.type),"placeholder"in ue&&n(4,_=ue.placeholder),"hidePasswordLabel"in ue&&n(5,v=ue.hidePasswordLabel),"showPasswordLabel"in ue&&n(6,S=ue.showPasswordLabel),"tooltipAlignment"in ue&&n(7,A=ue.tooltipAlignment),"tooltipPosition"in ue&&n(8,C=ue.tooltipPosition),"light"in ue&&n(9,I=ue.light),"disabled"in ue&&n(10,M=ue.disabled),"helperText"in ue&&n(11,L=ue.helperText),"labelText"in ue&&n(12,N=ue.labelText),"hideLabel"in ue&&n(13,z=ue.hideLabel),"invalid"in ue&&n(14,W=ue.invalid),"invalidText"in ue&&n(15,D=ue.invalidText),"warn"in ue&&n(16,G=ue.warn),"warnText"in ue&&n(17,$=ue.warnText),"inline"in ue&&n(18,j=ue.inline),"id"in ue&&n(19,Q=ue.id),"name"in ue&&n(20,le=ue.name),"ref"in ue&&n(2,oe=ue.ref),"$$scope"in ue&&n(27,f=ue.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&524288&&n(23,l=`helper-${Q}`),t.$$.dirty[0]&524288&&n(22,r=`error-${Q}`),t.$$.dirty[0]&524288&&n(21,s=`warn-${Q}`)},n(24,i=!!X&&X.isFluid),[h,g,oe,d,_,v,S,A,C,I,M,L,N,z,W,D,G,$,j,Q,le,s,r,l,i,c,a,f,u,de,re,x,me,ee,ke,pe,Fe,Ve,Ee,We,ge,ve,be]}class xF extends De{constructor(e){super(),Re(this,e,QF,JF,Ie,{size:3,value:0,type:1,placeholder:4,hidePasswordLabel:5,showPasswordLabel:6,tooltipAlignment:7,tooltipPosition:8,light:9,disabled:10,helperText:11,labelText:12,hideLabel:13,invalid:14,invalidText:15,warn:16,warnText:17,inline:18,id:19,name:20,ref:2},null,[-1,-1])}}const zm=xF,eG=t=>({}),Mv=t=>({}),tG=t=>({}),Ov=t=>({}),nG=t=>({}),Av=t=>({});function iG(t){let e;return{c(){e=q(t[5])},m(n,i){y(n,e,i)},p(n,i){i&32&&Z(e,n[5])},d(n){n&&w(e)}}}function lG(t){let e;return{c(){e=q(t[3])},m(n,i){y(n,e,i)},p(n,i){i&8&&Z(e,n[3])},d(n){n&&w(e)}}}function rG(t){let e;return{c(){e=q(t[4])},m(n,i){y(n,e,i)},p(n,i){i&16&&Z(e,n[4])},d(n){n&&w(e)}}}function sG(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g;const _=t[12].labelText,v=Ze(_,t,t[11],Av),S=v||iG(t),A=t[12].labelA,C=Ze(A,t,t[11],Ov),I=C||lG(t),M=t[12].labelB,L=Ze(M,t,t[11],Mv),N=L||rG(t);let z=[t[9]],W={};for(let D=0;D{n(0,a=!a)},D=G=>{(G.key===" "||G.key==="Enter")&&(G.preventDefault(),n(0,a=!a))};return t.$$set=G=>{n(10,e=Y(Y({},e),Se(G))),n(9,l=ae(e,i)),"size"in G&&n(1,o=G.size),"toggled"in G&&n(0,a=G.toggled),"disabled"in G&&n(2,u=G.disabled),"labelA"in G&&n(3,f=G.labelA),"labelB"in G&&n(4,c=G.labelB),"labelText"in G&&n(5,d=G.labelText),"hideLabel"in G&&n(6,h=G.hideLabel),"id"in G&&n(7,g=G.id),"name"in G&&n(8,_=G.name),"$$scope"in G&&n(11,s=G.$$scope)},t.$$.update=()=>{t.$$.dirty&1&&v("toggle",{toggled:a})},e=Se(e),[a,o,u,f,c,d,h,g,_,l,e,s,r,S,A,C,I,M,L,N,z,W,D]}class aG extends De{constructor(e){super(),Re(this,e,oG,sG,Ie,{size:1,toggled:0,disabled:2,labelA:3,labelB:4,labelText:5,hideLabel:6,id:7,name:8})}}const bc=aG;function uG(t){let e,n,i,l;const r=t[3].default,s=Ze(r,t,t[2],null);let o=[t[1]],a={};for(let u=0;u{e=Y(Y({},e),Se(d)),n(1,l=ae(e,i)),"light"in d&&n(0,o=d.light),"$$scope"in d&&n(2,s=d.$$scope)},[o,l,s,r,a,u,f,c]}class cG extends De{constructor(e){super(),Re(this,e,fG,uG,Ie,{light:0})}}const Bu=cG,dG=t=>({}),Cv=t=>({});function Lv(t){let e,n;const i=t[17].labelText,l=Ze(i,t,t[16],Cv),r=l||hG(t);return{c(){e=R("label"),r&&r.c(),P(e,"for",t[12]),E(e,"bx--label",!0),E(e,"bx--visually-hidden",t[9]),E(e,"bx--label--disabled",t[7])},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&65536)&&Ke(l,i,s,s[16],n?Xe(i,s[16],o,dG):$e(s[16]),Cv):r&&r.p&&(!n||o&256)&&r.p(s,n?o:-1),(!n||o&4096)&&P(e,"for",s[12]),(!n||o&512)&&E(e,"bx--visually-hidden",s[9]),(!n||o&128)&&E(e,"bx--label--disabled",s[7])},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function hG(t){let e;return{c(){e=q(t[8])},m(n,i){y(n,e,i)},p(n,i){i&256&&Z(e,n[8])},d(n){n&&w(e)}}}function Iv(t){let e,n;return{c(){e=R("div"),n=q(t[11]),E(e,"bx--form-requirement",!0)},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2048&&Z(n,i[11])},d(i){i&&w(e)}}}function mG(t){let e,n,i,l,r,s,o,a,u,f,c,d=(t[8]||t[14].labelText)&&Lv(t),h=[{type:"text"},{"data-invalid":s=t[10]||void 0},{pattern:t[4]},{placeholder:t[3]},{maxlength:t[5]},{id:t[12]},{name:t[13]},{disabled:t[7]},t[15]],g={};for(let A=0;A{d=null}),ce()),Ae(r,g=Ue(h,[{type:"text"},(!u||C&1024&&s!==(s=A[10]||void 0))&&{"data-invalid":s},(!u||C&16)&&{pattern:A[4]},(!u||C&8)&&{placeholder:A[3]},(!u||C&32)&&{maxlength:A[5]},(!u||C&4096)&&{id:A[12]},(!u||C&8192)&&{name:A[13]},(!u||C&128)&&{disabled:A[7]},C&32768&&A[15]])),C&1&&r.value!==A[0]&&Wl(r,A[0]),E(r,"bx--time-picker__input-field",!0),E(r,"bx--text-input",!0),E(r,"bx--text-input--light",A[6]),E(r,"bx--text-input--invalid",A[10]),v&&v.p&&(!u||C&65536)&&Ke(v,_,A,A[16],u?Xe(_,A[16],C,null):$e(A[16]),null),(!u||C&64)&&E(n,"bx--time-picker--light",A[6]),(!u||C&1024)&&E(n,"bx--time-picker--invalid",A[10]),(!u||C&4)&&E(n,"bx--time-picker--sm",A[2]==="sm"),(!u||C&4)&&E(n,"bx--time-picker--xl",A[2]==="xl"),(!u||C&64)&&E(n,"bx--select--light",A[6]),A[10]?S?S.p(A,C):(S=Iv(A),S.c(),S.m(e,null)):S&&(S.d(1),S=null)},i(A){u||(b(d),b(v,A),u=!0)},o(A){k(d),k(v,A),u=!1},d(A){A&&w(e),d&&d.d(),t[29](null),v&&v.d(A),S&&S.d(),f=!1,vt(c)}}}function gG(t,e,n){const i=["size","value","placeholder","pattern","maxlength","light","disabled","labelText","hideLabel","invalid","invalidText","id","name","ref"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e;const o=Yi(r);let{size:a=void 0}=e,{value:u=""}=e,{placeholder:f="hh:mm"}=e,{pattern:c="(1[012]|[1-9]):[0-5][0-9](\\s)?"}=e,{maxlength:d=5}=e,{light:h=!1}=e,{disabled:g=!1}=e,{labelText:_=""}=e,{hideLabel:v=!1}=e,{invalid:S=!1}=e,{invalidText:A=""}=e,{id:C="ccs-"+Math.random().toString(36)}=e,{name:I=void 0}=e,{ref:M=null}=e;function L(re){te.call(this,t,re)}function N(re){te.call(this,t,re)}function z(re){te.call(this,t,re)}function W(re){te.call(this,t,re)}function D(re){te.call(this,t,re)}function G(re){te.call(this,t,re)}function $(re){te.call(this,t,re)}function j(re){te.call(this,t,re)}function Q(re){te.call(this,t,re)}function le(re){te.call(this,t,re)}function oe(re){te.call(this,t,re)}function X(re){ft[re?"unshift":"push"](()=>{M=re,n(1,M)})}function de(){u=this.value,n(0,u)}return t.$$set=re=>{e=Y(Y({},e),Se(re)),n(15,l=ae(e,i)),"size"in re&&n(2,a=re.size),"value"in re&&n(0,u=re.value),"placeholder"in re&&n(3,f=re.placeholder),"pattern"in re&&n(4,c=re.pattern),"maxlength"in re&&n(5,d=re.maxlength),"light"in re&&n(6,h=re.light),"disabled"in re&&n(7,g=re.disabled),"labelText"in re&&n(8,_=re.labelText),"hideLabel"in re&&n(9,v=re.hideLabel),"invalid"in re&&n(10,S=re.invalid),"invalidText"in re&&n(11,A=re.invalidText),"id"in re&&n(12,C=re.id),"name"in re&&n(13,I=re.name),"ref"in re&&n(1,M=re.ref),"$$scope"in re&&n(16,s=re.$$scope)},[u,M,a,f,c,d,h,g,_,v,S,A,C,I,o,l,s,r,L,N,z,W,D,G,$,j,Q,le,oe,X,de]}class _G extends De{constructor(e){super(),Re(this,e,gG,mG,Ie,{size:2,value:0,placeholder:3,pattern:4,maxlength:5,light:6,disabled:7,labelText:8,hideLabel:9,invalid:10,invalidText:11,id:12,name:13,ref:1})}}const vc=_G;function Rv(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function pG(t){let e,n,i=t[1]&&Rv(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class vG extends De{constructor(e){super(),Re(this,e,bG,pG,Ie,{size:0,title:1})}}const VT=vG,Hm=un(!1),Um=un(!1),Fm=un(!1);function kG(t){let e,n,i,l,r;var s=t[0]?t[4]:t[3];function o(f,c){return{props:{size:20}}}s&&(n=cn(s,o()));let a=[{type:"button"},{title:t[2]},{"aria-label":t[2]},t[5]],u={};for(let f=0;f{U(d,1)}),ce()}s?(n=cn(s,o()),F(n.$$.fragment),b(n.$$.fragment,1),H(n,e,null)):n=null}Ae(e,u=Ue(a,[{type:"button"},(!i||c&4)&&{title:f[2]},(!i||c&4)&&{"aria-label":f[2]},c&32&&f[5]])),E(e,"bx--header__action",!0),E(e,"bx--header__menu-trigger",!0),E(e,"bx--header__menu-toggle",!0)},i(f){i||(n&&b(n.$$.fragment,f),i=!0)},o(f){n&&k(n.$$.fragment,f),i=!1},d(f){f&&w(e),n&&U(n),t[7](null),l=!1,vt(r)}}}function wG(t,e,n){const i=["ariaLabel","isOpen","iconMenu","iconClose","ref"];let l=ae(e,i),{ariaLabel:r=void 0}=e,{isOpen:s=!1}=e,{iconMenu:o=VT}=e,{iconClose:a=ql}=e,{ref:u=null}=e;function f(h){te.call(this,t,h)}function c(h){ft[h?"unshift":"push"](()=>{u=h,n(1,u)})}const d=()=>n(0,s=!s);return t.$$set=h=>{e=Y(Y({},e),Se(h)),n(5,l=ae(e,i)),"ariaLabel"in h&&n(2,r=h.ariaLabel),"isOpen"in h&&n(0,s=h.isOpen),"iconMenu"in h&&n(3,o=h.iconMenu),"iconClose"in h&&n(4,a=h.iconClose),"ref"in h&&n(1,u=h.ref)},[s,u,r,o,a,l,f,c,d]}class yG extends De{constructor(e){super(),Re(this,e,wG,kG,Ie,{ariaLabel:2,isOpen:0,iconMenu:3,iconClose:4,ref:1})}}const TG=yG,SG=t=>({}),Dv=t=>({}),EG=t=>({}),Pv=t=>({}),MG=t=>({}),Nv=t=>({});function Bv(t){let e,n,i;function l(s){t[20](s)}let r={iconClose:t[8],iconMenu:t[7]};return t[0]!==void 0&&(r.isOpen=t[0]),e=new TG({props:r}),ft.push(()=>Yt(e,"isOpen",l)),{c(){F(e.$$.fragment)},m(s,o){H(e,s,o),i=!0},p(s,o){const a={};o&256&&(a.iconClose=s[8]),o&128&&(a.iconMenu=s[7]),!n&&o&1&&(n=!0,a.isOpen=s[0],jt(()=>n=!1)),e.$set(a)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){U(e,s)}}}function zv(t){let e,n;const i=t[17].company,l=Ze(i,t,t[16],Pv),r=l||OG(t);return{c(){e=R("span"),r&&r.c(),E(e,"bx--header__name--prefix",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&65536)&&Ke(l,i,s,s[16],n?Xe(i,s[16],o,EG):$e(s[16]),Pv):r&&r.p&&(!n||o&8)&&r.p(s,n?o:-1)},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function OG(t){let e,n;return{c(){e=q(t[3]),n=q(" ")},m(i,l){y(i,e,l),y(i,n,l)},p(i,l){l&8&&Z(e,i[3])},d(i){i&&(w(e),w(n))}}}function AG(t){let e;return{c(){e=q(t[4])},m(n,i){y(n,e,i)},p(n,i){i&16&&Z(e,n[4])},d(n){n&&w(e)}}}function CG(t){let e,n,i,l,r,s,o,a,u;Qs(t[19]);const f=t[17]["skip-to-content"],c=Ze(f,t,t[16],Nv);let d=(t[11]&&t[9]{d=null}),ce()),M[3]||M[13].company?h?(h.p(M,L),L&8200&&b(h,1)):(h=zv(M),h.c(),b(h,1),h.m(l,r)):h&&(fe(),k(h,1,1,()=>{h=null}),ce()),_?_.p&&(!o||L&65536)&&Ke(_,g,M,M[16],o?Xe(g,M[16],L,SG):$e(M[16]),Dv):v&&v.p&&(!o||L&16)&&v.p(M,o?L:-1),Ae(l,A=Ue(S,[(!o||L&4)&&{href:M[2]},L&4096&&M[12]])),E(l,"bx--header__name",!0),I&&I.p&&(!o||L&65536)&&Ke(I,C,M,M[16],o?Xe(C,M[16],L,null):$e(M[16]),null),(!o||L&1024)&&P(e,"aria-label",M[10])},i(M){o||(b(c,M),b(d),b(h),b(v,M),b(I,M),o=!0)},o(M){k(c,M),k(d),k(h),k(v,M),k(I,M),o=!1},d(M){M&&w(e),c&&c.d(M),d&&d.d(),h&&h.d(),v&&v.d(M),t[21](null),I&&I.d(M),a=!1,vt(u)}}}function LG(t,e,n){let i;const l=["expandedByDefault","isSideNavOpen","uiShellAriaLabel","href","company","platformName","persistentHamburgerMenu","expansionBreakpoint","ref","iconMenu","iconClose"];let r=ae(e,l),s;Mt(t,Hm,D=>n(11,s=D));let{$$slots:o={},$$scope:a}=e;const u=Yi(o);let{expandedByDefault:f=!0}=e,{isSideNavOpen:c=!1}=e,{uiShellAriaLabel:d=void 0}=e,{href:h=void 0}=e,{company:g=void 0}=e,{platformName:_=""}=e,{persistentHamburgerMenu:v=!1}=e,{expansionBreakpoint:S=1056}=e,{ref:A=null}=e,{iconMenu:C=VT}=e,{iconClose:I=ql}=e,M;function L(D){te.call(this,t,D)}function N(){n(9,M=window.innerWidth)}function z(D){c=D,n(0,c),n(14,f),n(9,M),n(6,S),n(5,v)}function W(D){ft[D?"unshift":"push"](()=>{A=D,n(1,A)})}return t.$$set=D=>{n(22,e=Y(Y({},e),Se(D))),n(12,r=ae(e,l)),"expandedByDefault"in D&&n(14,f=D.expandedByDefault),"isSideNavOpen"in D&&n(0,c=D.isSideNavOpen),"uiShellAriaLabel"in D&&n(15,d=D.uiShellAriaLabel),"href"in D&&n(2,h=D.href),"company"in D&&n(3,g=D.company),"platformName"in D&&n(4,_=D.platformName),"persistentHamburgerMenu"in D&&n(5,v=D.persistentHamburgerMenu),"expansionBreakpoint"in D&&n(6,S=D.expansionBreakpoint),"ref"in D&&n(1,A=D.ref),"iconMenu"in D&&n(7,C=D.iconMenu),"iconClose"in D&&n(8,I=D.iconClose),"$$scope"in D&&n(16,a=D.$$scope)},t.$$.update=()=>{t.$$.dirty&16992&&n(0,c=f&&M>=S&&!v),n(10,i=g?`${g} `:""+(d||e["aria-label"]||_))},e=Se(e),[c,A,h,g,_,v,S,C,I,M,i,s,r,u,f,d,a,o,L,N,z,W]}class IG extends De{constructor(e){super(),Re(this,e,LG,CG,Ie,{expandedByDefault:14,isSideNavOpen:0,uiShellAriaLabel:15,href:2,company:3,platformName:4,persistentHamburgerMenu:5,expansionBreakpoint:6,ref:1,iconMenu:7,iconClose:8})}}const RG=IG;function Hv(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function DG(t){let e,n,i=t[1]&&Hv(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class NG extends De{constructor(e){super(),Re(this,e,PG,DG,Ie,{size:0,title:1})}}const BG=NG,zG=t=>({}),Uv=t=>({}),HG=t=>({}),Fv=t=>({}),UG=t=>({}),Gv=t=>({});function FG(t){let e;const n=t[11].icon,i=Ze(n,t,t[10],Fv),l=i||VG(t);return{c(){l&&l.c()},m(r,s){l&&l.m(r,s),e=!0},p(r,s){i?i.p&&(!e||s&1024)&&Ke(i,n,r,r[10],e?Xe(n,r[10],s,HG):$e(r[10]),Fv):l&&l.p&&(!e||s&4)&&l.p(r,e?s:-1)},i(r){e||(b(l,r),e=!0)},o(r){k(l,r),e=!1},d(r){l&&l.d(r)}}}function GG(t){let e;const n=t[11].closeIcon,i=Ze(n,t,t[10],Gv),l=i||WG(t);return{c(){l&&l.c()},m(r,s){l&&l.m(r,s),e=!0},p(r,s){i?i.p&&(!e||s&1024)&&Ke(i,n,r,r[10],e?Xe(n,r[10],s,UG):$e(r[10]),Gv):l&&l.p&&(!e||s&8)&&l.p(r,e?s:-1)},i(r){e||(b(l,r),e=!0)},o(r){k(l,r),e=!1},d(r){l&&l.d(r)}}}function VG(t){let e,n,i;var l=t[2];function r(s,o){return{props:{size:20}}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&4&&l!==(l=s[2])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function WG(t){let e,n,i;var l=t[3];function r(s,o){return{props:{size:20}}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&8&&l!==(l=s[3])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function Vv(t){let e,n;return{c(){e=R("span"),n=q(t[4]),P(e,"class","svelte-187bdaq")},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&16&&Z(n,i[4])},d(i){i&&w(e)}}}function qG(t){let e,n=t[4]&&Vv(t);return{c(){n&&n.c(),e=qe()},m(i,l){n&&n.m(i,l),y(i,e,l)},p(i,l){i[4]?n?n.p(i,l):(n=Vv(i),n.c(),n.m(e.parentNode,e)):n&&(n.d(1),n=null)},d(i){i&&w(e),n&&n.d(i)}}}function Wv(t){let e,n,i;const l=t[11].default,r=Ze(l,t,t[10],null);return{c(){e=R("div"),r&&r.c(),E(e,"bx--header-panel",!0),E(e,"bx--header-panel--expanded",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),t[16](e),i=!0},p(s,o){t=s,r&&r.p&&(!i||o&1024)&&Ke(r,l,t,t[10],i?Xe(l,t[10],o,null):$e(t[10]),null)},i(s){i||(b(r,s),s&&Qs(()=>{i&&(n||(n=hp(e,Nb,{...t[5],duration:t[5]===!1?0:t[5].duration},!0)),n.run(1))}),i=!0)},o(s){k(r,s),s&&(n||(n=hp(e,Nb,{...t[5],duration:t[5]===!1?0:t[5].duration},!1)),n.run(0)),i=!1},d(s){s&&w(e),r&&r.d(s),t[16](null),s&&n&&n.end()}}}function jG(t){let e,n,i,l,r,s,o,a,u;const f=[GG,FG],c=[];function d(C,I){return C[0]?0:1}n=d(t),i=c[n]=f[n](t);const h=t[11].text,g=Ze(h,t,t[10],Uv),_=g||qG(t);let v=[{type:"button"},t[9]],S={};for(let C=0;C{c[M]=null}),ce(),i=c[n],i?i.p(C,I):(i=c[n]=f[n](C),i.c()),b(i,1),i.m(e,l)),g?g.p&&(!o||I&1024)&&Ke(g,h,C,C[10],o?Xe(h,C[10],I,zG):$e(C[10]),Uv):_&&_.p&&(!o||I&16)&&_.p(C,o?I:-1),Ae(e,S=Ue(v,[{type:"button"},I&512&&C[9]])),E(e,"bx--header__action",!0),E(e,"bx--header__action--active",C[0]),E(e,"action-text",C[4]),E(e,"svelte-187bdaq",!0),C[0]?A?(A.p(C,I),I&1&&b(A,1)):(A=Wv(C),A.c(),b(A,1),A.m(s.parentNode,s)):A&&(fe(),k(A,1,1,()=>{A=null}),ce())},i(C){o||(b(i),b(_,C),b(A),o=!0)},o(C){k(i),k(_,C),k(A),o=!1},d(C){C&&(w(e),w(r),w(s)),c[n].d(),_&&_.d(C),t[14](null),A&&A.d(C),a=!1,vt(u)}}}function YG(t,e,n){const i=["isOpen","icon","closeIcon","text","ref","transition","preventCloseOnClickOutside"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e,{isOpen:o=!1}=e,{icon:a=BG}=e,{closeIcon:u=ql}=e,{text:f=void 0}=e,{ref:c=null}=e,{transition:d={duration:200}}=e,{preventCloseOnClickOutside:h=!1}=e;const g=yn();let _=null;function v(M){te.call(this,t,M)}const S=({target:M})=>{o&&!c.contains(M)&&!_.contains(M)&&!h&&(n(0,o=!1),g("close"))};function A(M){ft[M?"unshift":"push"](()=>{c=M,n(1,c)})}const C=()=>{n(0,o=!o),g(o?"open":"close")};function I(M){ft[M?"unshift":"push"](()=>{_=M,n(7,_)})}return t.$$set=M=>{e=Y(Y({},e),Se(M)),n(9,l=ae(e,i)),"isOpen"in M&&n(0,o=M.isOpen),"icon"in M&&n(2,a=M.icon),"closeIcon"in M&&n(3,u=M.closeIcon),"text"in M&&n(4,f=M.text),"ref"in M&&n(1,c=M.ref),"transition"in M&&n(5,d=M.transition),"preventCloseOnClickOutside"in M&&n(6,h=M.preventCloseOnClickOutside),"$$scope"in M&&n(10,s=M.$$scope)},[o,c,a,u,f,d,h,_,g,l,s,r,v,S,A,C,I]}class ZG extends De{constructor(e){super(),Re(this,e,YG,jG,Ie,{isOpen:0,icon:2,closeIcon:3,text:4,ref:1,transition:5,preventCloseOnClickOutside:6})}}const XG=ZG;function KG(t){let e,n,i;const l=t[3].default,r=Ze(l,t,t[2],null);let s=[t[0],{role:"menubar"}],o={};for(let f=0;f{n(4,e=Y(Y({},e),Se(a))),n(1,r=ae(e,l)),"$$scope"in a&&n(2,o=a.$$scope)},t.$$.update=()=>{n(0,i={"aria-label":e["aria-label"],"aria-labelledby":e["aria-labelledby"]})},e=Se(e),[i,r,o,s]}class JG extends De{constructor(e){super(),Re(this,e,$G,KG,Ie,{})}}const QG=JG;function xG(t){let e;return{c(){e=q(t[2])},m(n,i){y(n,e,i)},p(n,i){i&4&&Z(e,n[2])},d(n){n&&w(e)}}}function eV(t){let e,n,i,l,r,s,o,a;const u=t[9].default,f=Ze(u,t,t[8],null),c=f||xG(t);let d=[{role:"menuitem"},{tabindex:"0"},{href:t[1]},{rel:l=t[7].target==="_blank"?"noopener noreferrer":void 0},{"aria-current":r=t[3]?"page":void 0},t[7]],h={};for(let g=0;g{n(4,h=Object.keys(W))});_n(()=>()=>{g&&g()});function _(W){te.call(this,t,W)}function v(W){te.call(this,t,W)}function S(W){te.call(this,t,W)}function A(W){te.call(this,t,W)}function C(W){te.call(this,t,W)}function I(W){te.call(this,t,W)}function M(W){te.call(this,t,W)}function L(W){te.call(this,t,W)}function N(W){ft[W?"unshift":"push"](()=>{f=W,n(0,f)})}const z=()=>{h.indexOf(c)===h.length-1&&(d==null||d.closeMenu())};return t.$$set=W=>{e=Y(Y({},e),Se(W)),n(7,l=ae(e,i)),"href"in W&&n(1,o=W.href),"text"in W&&n(2,a=W.text),"isSelected"in W&&n(3,u=W.isSelected),"ref"in W&&n(0,f=W.ref),"$$scope"in W&&n(8,s=W.$$scope)},t.$$.update=()=>{t.$$.dirty&8&&(d==null||d.updateSelectedItems({id:c,isSelected:u}))},[f,o,a,u,h,c,d,l,s,r,_,v,S,A,C,I,M,L,N,z]}class nV extends De{constructor(e){super(),Re(this,e,tV,eV,Ie,{href:1,text:2,isSelected:3,ref:0})}}const WT=nV;function iV(t){let e,n,i,l,r,s,o,a,u,f;r=new ga({props:{class:"bx--header__menu-arrow"}});let c=[{role:"menuitem"},{tabindex:"0"},{"aria-haspopup":"menu"},{"aria-expanded":t[0]},{"aria-label":t[3]},{href:t[2]},t[7]],d={};for(let _=0;_n(8,s=j));let g=null;Wi("HeaderNavMenu",{selectedItems:h,updateSelectedItems(j){h.update(Q=>({...Q,[j.id]:j.isSelected}))},closeMenu(){n(0,u=!1)}});function _(j){te.call(this,t,j)}function v(j){te.call(this,t,j)}function S(j){te.call(this,t,j)}function A(j){te.call(this,t,j)}function C(j){te.call(this,t,j)}function I(j){te.call(this,t,j)}function M(j){te.call(this,t,j)}function L(j){te.call(this,t,j)}const N=({target:j})=>{d.contains(j)||n(0,u=!1)};function z(j){ft[j?"unshift":"push"](()=>{d=j,n(1,d)})}const W=j=>{j.key===" "&&j.preventDefault(),(j.key==="Enter"||j.key===" ")&&n(0,u=!u)};function D(j){ft[j?"unshift":"push"](()=>{g=j,n(4,g)})}const G=j=>{g.contains(j.target)||j.preventDefault(),n(0,u=!u)},$=j=>{j.key==="Enter"&&(j.stopPropagation(),n(0,u=!u))};return t.$$set=j=>{e=Y(Y({},e),Se(j)),n(7,r=ae(e,l)),"expanded"in j&&n(0,u=j.expanded),"href"in j&&n(2,f=j.href),"text"in j&&n(3,c=j.text),"ref"in j&&n(1,d=j.ref),"$$scope"in j&&n(9,a=j.$$scope)},t.$$.update=()=>{t.$$.dirty&256&&n(5,i=Object.values(s).filter(Boolean).length>0)},[u,d,f,c,g,i,h,r,s,a,o,_,v,S,A,C,I,M,L,N,z,W,D,G,$]}class rV extends De{constructor(e){super(),Re(this,e,lV,iV,Ie,{expanded:0,href:2,text:3,ref:1})}}const sV=rV;function qv(t){let e,n,i;const l=t[2].default,r=Ze(l,t,t[1],null);return{c(){e=R("li"),n=R("span"),r&&r.c(),P(n,"class","svelte-1tbdbmc"),P(e,"class","svelte-1tbdbmc")},m(s,o){y(s,e,o),T(e,n),r&&r.m(n,null),i=!0},p(s,o){r&&r.p&&(!i||o&2)&&Ke(r,l,s,s[1],i?Xe(l,s[1],o,null):$e(s[1]),null)},i(s){i||(b(r,s),i=!0)},o(s){k(r,s),i=!1},d(s){s&&w(e),r&&r.d(s)}}}function oV(t){let e,n,i,l=t[0].default&&qv(t);return{c(){l&&l.c(),e=B(),n=R("hr"),E(n,"bx--switcher__item--divider",!0)},m(r,s){l&&l.m(r,s),y(r,e,s),y(r,n,s),i=!0},p(r,[s]){r[0].default?l?(l.p(r,s),s&1&&b(l,1)):(l=qv(r),l.c(),b(l,1),l.m(e.parentNode,e)):l&&(fe(),k(l,1,1,()=>{l=null}),ce())},i(r){i||(b(l),i=!0)},o(r){k(l),i=!1},d(r){r&&(w(e),w(n)),l&&l.d(r)}}}function aV(t,e,n){let{$$slots:i={},$$scope:l}=e;const r=Yi(i);return t.$$set=s=>{"$$scope"in s&&n(1,l=s.$$scope)},[r,l,i]}class uV extends De{constructor(e){super(),Re(this,e,aV,oV,Ie,{})}}const fV=uV;function cV(t){let e,n,i,l,r,s;const o=t[4].default,a=Ze(o,t,t[3],null);let u=[{href:t[1]},{rel:i=t[2].target==="_blank"?"noopener noreferrer":void 0},t[2]],f={};for(let c=0;c{a=c,n(0,a)})}return t.$$set=c=>{e=Y(Y({},e),Se(c)),n(2,l=ae(e,i)),"href"in c&&n(1,o=c.href),"ref"in c&&n(0,a=c.ref),"$$scope"in c&&n(3,s=c.$$scope)},[a,o,l,s,r,u,f]}class hV extends De{constructor(e){super(),Re(this,e,dV,cV,Ie,{href:1,ref:0})}}const jv=hV;function mV(t){let e,n;const i=t[1].default,l=Ze(i,t,t[0],null);return{c(){e=R("ul"),l&&l.c(),E(e,"bx--switcher__item",!0)},m(r,s){y(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Ke(l,i,r,r[0],n?Xe(i,r[0],s,null):$e(r[0]),null)},i(r){n||(b(l,r),n=!0)},o(r){k(l,r),n=!1},d(r){r&&w(e),l&&l.d(r)}}}function gV(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class _V extends De{constructor(e){super(),Re(this,e,gV,mV,Ie,{})}}const pV=_V;function bV(t){let e,n;const i=t[1].default,l=Ze(i,t,t[0],null);return{c(){e=R("div"),l&&l.c(),E(e,"bx--header__global",!0)},m(r,s){y(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Ke(l,i,r,r[0],n?Xe(i,r[0],s,null):$e(r[0]),null)},i(r){n||(b(l,r),n=!0)},o(r){k(l,r),n=!1},d(r){r&&w(e),l&&l.d(r)}}}function vV(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class kV extends De{constructor(e){super(),Re(this,e,vV,bV,Ie,{})}}const wV=kV;function Yv(t){let e,n,i;return{c(){e=R("div"),E(e,"bx--side-nav__overlay",!0),E(e,"bx--side-nav__overlay-active",t[0]),wt(e,"z-index",t[0]?6e3:void 0)},m(l,r){y(l,e,r),n||(i=J(e,"click",t[11]),n=!0)},p(l,r){r&1&&E(e,"bx--side-nav__overlay-active",l[0]),r&1&&wt(e,"z-index",l[0]?6e3:void 0)},d(l){l&&w(e),n=!1,i()}}}function yV(t){let e,n,i,l,r,s;Qs(t[10]);let o=!t[1]&&Yv(t);const a=t[9].default,u=Ze(a,t,t[8],null);let f=[{"aria-hidden":i=!t[0]},{"aria-label":t[3]},t[7]],c={};for(let d=0;d=t[4]?!1:t[0]),E(n,"bx--side-nav--collapsed",!t[0]&&!t[2]),E(n,"bx--side-nav--rail",t[2])},m(d,h){o&&o.m(d,h),y(d,e,h),y(d,n,h),u&&u.m(n,null),l=!0,r||(s=J(window,"resize",t[10]),r=!0)},p(d,[h]){d[1]?o&&(o.d(1),o=null):o?o.p(d,h):(o=Yv(d),o.c(),o.m(e.parentNode,e)),u&&u.p&&(!l||h&256)&&Ke(u,a,d,d[8],l?Xe(a,d[8],h,null):$e(d[8]),null),Ae(n,c=Ue(f,[(!l||h&1&&i!==(i=!d[0]))&&{"aria-hidden":i},(!l||h&8)&&{"aria-label":d[3]},h&128&&d[7]])),E(n,"bx--side-nav__navigation",!0),E(n,"bx--side-nav",!0),E(n,"bx--side-nav--ux",!0),E(n,"bx--side-nav--expanded",d[2]&&d[5]>=d[4]?!1:d[0]),E(n,"bx--side-nav--collapsed",!d[0]&&!d[2]),E(n,"bx--side-nav--rail",d[2])},i(d){l||(b(u,d),l=!0)},o(d){k(u,d),l=!1},d(d){d&&(w(e),w(n)),o&&o.d(d),u&&u.d(d),r=!1,s()}}}function TV(t,e,n){const i=["fixed","rail","ariaLabel","isOpen","expansionBreakpoint"];let l=ae(e,i),r,s;Mt(t,Fm,A=>n(12,r=A)),Mt(t,Um,A=>n(13,s=A));let{$$slots:o={},$$scope:a}=e,{fixed:u=!1}=e,{rail:f=!1}=e,{ariaLabel:c=void 0}=e,{isOpen:d=!1}=e,{expansionBreakpoint:h=1056}=e;const g=yn();let _;_n(()=>(Hm.set(!0),()=>Hm.set(!1)));function v(){n(5,_=window.innerWidth)}const S=()=>{g("click:overlay"),n(0,d=!1)};return t.$$set=A=>{e=Y(Y({},e),Se(A)),n(7,l=ae(e,i)),"fixed"in A&&n(1,u=A.fixed),"rail"in A&&n(2,f=A.rail),"ariaLabel"in A&&n(3,c=A.ariaLabel),"isOpen"in A&&n(0,d=A.isOpen),"expansionBreakpoint"in A&&n(4,h=A.expansionBreakpoint),"$$scope"in A&&n(8,a=A.$$scope)},t.$$.update=()=>{t.$$.dirty&1&&g(d?"open":"close"),t.$$.dirty&1&&Js(Um,s=!d,s),t.$$.dirty&4&&Js(Fm,r=f,r)},[d,u,f,c,h,_,g,l,a,o,v,S]}class SV extends De{constructor(e){super(),Re(this,e,TV,yV,Ie,{fixed:1,rail:2,ariaLabel:3,isOpen:0,expansionBreakpoint:4})}}const EV=SV;function MV(t){let e,n;const i=t[1].default,l=Ze(i,t,t[0],null);return{c(){e=R("ul"),l&&l.c(),E(e,"bx--side-nav__items",!0)},m(r,s){y(r,e,s),l&&l.m(e,null),n=!0},p(r,[s]){l&&l.p&&(!n||s&1)&&Ke(l,i,r,r[0],n?Xe(i,r[0],s,null):$e(r[0]),null)},i(r){n||(b(l,r),n=!0)},o(r){k(l,r),n=!1},d(r){r&&w(e),l&&l.d(r)}}}function OV(t,e,n){let{$$slots:i={},$$scope:l}=e;return t.$$set=r=>{"$$scope"in r&&n(0,l=r.$$scope)},[l,i]}class AV extends De{constructor(e){super(),Re(this,e,OV,MV,Ie,{})}}const CV=AV,LV=t=>({}),Zv=t=>({});function Xv(t){let e,n;const i=t[8].icon,l=Ze(i,t,t[7],Zv),r=l||IV(t);return{c(){e=R("div"),r&&r.c(),E(e,"bx--side-nav__icon",!0),E(e,"bx--side-nav__icon--small",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&128)&&Ke(l,i,s,s[7],n?Xe(i,s[7],o,LV):$e(s[7]),Zv):r&&r.p&&(!n||o&16)&&r.p(s,n?o:-1)},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function IV(t){let e,n,i;var l=t[4];function r(s,o){return{}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&16&&l!==(l=s[4])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function RV(t){let e;return{c(){e=q(t[3])},m(n,i){y(n,e,i)},p(n,i){i&8&&Z(e,n[3])},d(n){n&&w(e)}}}function DV(t){let e,n,i,l,r,s,o,a,u,f=(t[6].icon||t[4])&&Xv(t);const c=t[8].default,d=Ze(c,t,t[7],null),h=d||RV(t);let g=[{"aria-current":r=t[1]?"page":void 0},{href:t[2]},{rel:s=t[5].target==="_blank"?"noopener noreferrer":void 0},t[5]],_={};for(let v=0;v{f=null}),ce()),d?d.p&&(!o||S&128)&&Ke(d,c,v,v[7],o?Xe(c,v[7],S,null):$e(v[7]),null):h&&h.p&&(!o||S&8)&&h.p(v,o?S:-1),Ae(n,_=Ue(g,[(!o||S&2&&r!==(r=v[1]?"page":void 0))&&{"aria-current":r},(!o||S&4)&&{href:v[2]},(!o||S&32&&s!==(s=v[5].target==="_blank"?"noopener noreferrer":void 0))&&{rel:s},S&32&&v[5]])),E(n,"bx--side-nav__link",!0),E(n,"bx--side-nav__link--current",v[1])},i(v){o||(b(f),b(h,v),o=!0)},o(v){k(f),k(h,v),o=!1},d(v){v&&w(e),f&&f.d(),h&&h.d(v),t[10](null),a=!1,u()}}}function PV(t,e,n){const i=["isSelected","href","text","icon","ref"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e;const o=Yi(r);let{isSelected:a=!1}=e,{href:u=void 0}=e,{text:f=void 0}=e,{icon:c=void 0}=e,{ref:d=null}=e;function h(_){te.call(this,t,_)}function g(_){ft[_?"unshift":"push"](()=>{d=_,n(0,d)})}return t.$$set=_=>{e=Y(Y({},e),Se(_)),n(5,l=ae(e,i)),"isSelected"in _&&n(1,a=_.isSelected),"href"in _&&n(2,u=_.href),"text"in _&&n(3,f=_.text),"icon"in _&&n(4,c=_.icon),"ref"in _&&n(0,d=_.ref),"$$scope"in _&&n(7,s=_.$$scope)},[d,a,u,f,c,l,o,s,r,h,g]}class NV extends De{constructor(e){super(),Re(this,e,PV,DV,Ie,{isSelected:1,href:2,text:3,icon:4,ref:0})}}const qT=NV,BV=t=>({}),Kv=t=>({});function $v(t){let e,n;const i=t[7].icon,l=Ze(i,t,t[6],Kv),r=l||zV(t);return{c(){e=R("div"),r&&r.c(),E(e,"bx--side-nav__icon",!0)},m(s,o){y(s,e,o),r&&r.m(e,null),n=!0},p(s,o){l?l.p&&(!n||o&64)&&Ke(l,i,s,s[6],n?Xe(i,s[6],o,BV):$e(s[6]),Kv):r&&r.p&&(!n||o&8)&&r.p(s,n?o:-1)},i(s){n||(b(r,s),n=!0)},o(s){k(r,s),n=!1},d(s){s&&w(e),r&&r.d(s)}}}function zV(t){let e,n,i;var l=t[3];function r(s,o){return{}}return l&&(e=cn(l,r())),{c(){e&&F(e.$$.fragment),n=qe()},m(s,o){e&&H(e,s,o),y(s,n,o),i=!0},p(s,o){if(o&8&&l!==(l=s[3])){if(e){fe();const a=e;k(a.$$.fragment,1,0,()=>{U(a,1)}),ce()}l?(e=cn(l,r()),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(s){i||(e&&b(e.$$.fragment,s),i=!0)},o(s){e&&k(e.$$.fragment,s),i=!1},d(s){s&&w(n),e&&U(e,s)}}}function HV(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g=(t[5].icon||t[3])&&$v(t);a=new ga({});let _=[{type:"button"},{"aria-expanded":t[0]},t[4]],v={};for(let C=0;C<_.length;C+=1)v=Y(v,_[C]);const S=t[7].default,A=Ze(S,t,t[6],null);return{c(){e=R("li"),n=R("button"),g&&g.c(),i=B(),l=R("span"),r=q(t[2]),s=B(),o=R("div"),F(a.$$.fragment),u=B(),f=R("ul"),A&&A.c(),E(l,"bx--side-nav__submenu-title",!0),E(o,"bx--side-nav__icon",!0),E(o,"bx--side-nav__icon--small",!0),E(o,"bx--side-nav__submenu-chevron",!0),Ae(n,v),E(n,"bx--side-nav__submenu",!0),P(f,"role","menu"),E(f,"bx--side-nav__menu",!0),wt(f,"max-height",t[0]?"none":void 0),E(e,"bx--side-nav__item",!0),E(e,"bx--side-nav__item--icon",t[3])},m(C,I){y(C,e,I),T(e,n),g&&g.m(n,null),T(n,i),T(n,l),T(l,r),T(n,s),T(n,o),H(a,o,null),n.autofocus&&n.focus(),t[9](n),T(e,u),T(e,f),A&&A.m(f,null),c=!0,d||(h=[J(n,"click",t[8]),J(n,"click",t[10])],d=!0)},p(C,[I]){C[5].icon||C[3]?g?(g.p(C,I),I&40&&b(g,1)):(g=$v(C),g.c(),b(g,1),g.m(n,i)):g&&(fe(),k(g,1,1,()=>{g=null}),ce()),(!c||I&4)&&Z(r,C[2]),Ae(n,v=Ue(_,[{type:"button"},(!c||I&1)&&{"aria-expanded":C[0]},I&16&&C[4]])),E(n,"bx--side-nav__submenu",!0),A&&A.p&&(!c||I&64)&&Ke(A,S,C,C[6],c?Xe(S,C[6],I,null):$e(C[6]),null),I&1&&wt(f,"max-height",C[0]?"none":void 0),(!c||I&8)&&E(e,"bx--side-nav__item--icon",C[3])},i(C){c||(b(g),b(a.$$.fragment,C),b(A,C),c=!0)},o(C){k(g),k(a.$$.fragment,C),k(A,C),c=!1},d(C){C&&w(e),g&&g.d(),U(a),t[9](null),A&&A.d(C),d=!1,vt(h)}}}function UV(t,e,n){const i=["expanded","text","icon","ref"];let l=ae(e,i),{$$slots:r={},$$scope:s}=e;const o=Yi(r);let{expanded:a=!1}=e,{text:u=void 0}=e,{icon:f=void 0}=e,{ref:c=null}=e;function d(_){te.call(this,t,_)}function h(_){ft[_?"unshift":"push"](()=>{c=_,n(1,c)})}const g=()=>{n(0,a=!a)};return t.$$set=_=>{e=Y(Y({},e),Se(_)),n(4,l=ae(e,i)),"expanded"in _&&n(0,a=_.expanded),"text"in _&&n(2,u=_.text),"icon"in _&&n(3,f=_.icon),"ref"in _&&n(1,c=_.ref),"$$scope"in _&&n(6,s=_.$$scope)},[a,c,u,f,l,o,s,r,d,h,g]}class FV extends De{constructor(e){super(),Re(this,e,UV,HV,Ie,{expanded:0,text:2,icon:3,ref:1})}}const GV=FV;function VV(t){let e,n;const i=t[6].default,l=Ze(i,t,t[5],null);let r=[{id:t[0]},t[2]],s={};for(let o=0;on(3,s=c)),Mt(t,Um,c=>n(4,o=c));let{$$slots:a={},$$scope:u}=e,{id:f="main-content"}=e;return t.$$set=c=>{e=Y(Y({},e),Se(c)),n(2,r=ae(e,l)),"id"in c&&n(0,f=c.id),"$$scope"in c&&n(5,u=c.$$scope)},t.$$.update=()=>{t.$$.dirty&24&&n(1,i=o&&!s)},[f,i,r,s,o,u,a]}class qV extends De{constructor(e){super(),Re(this,e,WV,VV,Ie,{id:0})}}const jV=qV;function YV(t){let e;return{c(){e=q("Skip to main content")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function ZV(t){let e,n,i,l;const r=t[4].default,s=Ze(r,t,t[3],null),o=s||YV();let a=[{href:t[0]},{tabindex:t[1]},t[2]],u={};for(let f=0;f{e=Y(Y({},e),Se(f)),n(2,l=ae(e,i)),"href"in f&&n(0,o=f.href),"tabindex"in f&&n(1,a=f.tabindex),"$$scope"in f&&n(3,s=f.$$scope)},[o,a,l,s,r,u]}class KV extends De{constructor(e){super(),Re(this,e,XV,ZV,Ie,{href:0,tabindex:1})}}const $V=KV;function JV(t){let e,n=[{role:"separator"},t[0]],i={};for(let l=0;l{e=Y(Y({},e),Se(r)),n(0,l=ae(e,i))},[l]}class xV extends De{constructor(e){super(),Re(this,e,QV,JV,Ie,{})}}const eW=xV,Jv={},Gm={},tW={},jT=/^:(.+)/,Qv=4,nW=3,iW=2,lW=1,rW=1,Vm=t=>t.replace(/(^\/+|\/+$)/g,"").split("/"),Kh=t=>t.replace(/(^\/+|\/+$)/g,""),sW=(t,e)=>{const n=t.default?0:Vm(t.path).reduce((i,l)=>(i+=Qv,l===""?i+=rW:jT.test(l)?i+=iW:l[0]==="*"?i-=Qv+lW:i+=nW,i),0);return{route:t,score:n,index:e}},oW=t=>t.map(sW).sort((e,n)=>e.scoren.score?-1:e.index-n.index),xv=(t,e)=>{let n,i;const[l]=e.split("?"),r=Vm(l),s=r[0]==="",o=oW(t);for(let a=0,u=o.length;a"u"){c=!0;break}const A=jT.exec(v);if(A&&!s){const C=decodeURIComponent(S);h[A[1]]=C}else if(v!==S){c=!0;break}}if(!c){n={route:f,params:h,uri:"/"+r.slice(0,_).join("/")};break}}return n||i||null},ek=(t,e)=>`${Kh(e==="/"?t:`${Kh(t)}/${Kh(e)}`)}/`,YT=()=>typeof window<"u"&&"document"in window&&"location"in window,aW=t=>({params:t&4}),tk=t=>({params:t[2]});function nk(t){let e,n,i,l;const r=[fW,uW],s=[];function o(a,u){return a[0]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function uW(t){let e;const n=t[8].default,i=Ze(n,t,t[7],tk);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&132)&&Ke(i,n,l,l[7],e?Xe(n,l[7],r,aW):$e(l[7]),tk)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function fW(t){let e,n,i,l={ctx:t,current:null,token:null,hasCatch:!1,pending:hW,then:dW,catch:cW,value:12,blocks:[,,,]};return Nm(n=t[0],l),{c(){e=qe(),l.block.c()},m(r,s){y(r,e,s),l.block.m(r,l.anchor=s),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(r,s){t=r,l.ctx=t,s&1&&n!==(n=t[0])&&Nm(n,l)||kT(l,t,s)},i(r){i||(b(l.block),i=!0)},o(r){for(let s=0;s<3;s+=1){const o=l.blocks[s];k(o)}i=!1},d(r){r&&w(e),l.block.d(r),l.token=null,l=null}}}function cW(t){return{c:he,m:he,p:he,i:he,o:he,d:he}}function dW(t){var o;let e,n,i;const l=[t[2],t[3]];var r=((o=t[12])==null?void 0:o.default)||t[12];function s(a,u){let f={};if(u!==void 0&&u&12)f=Ue(l,[u&4&&ul(a[2]),u&8&&ul(a[3])]);else for(let c=0;c{U(c,1)}),ce()}r?(e=cn(r,s(a,u)),F(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}else if(r){const c=u&12?Ue(l,[u&4&&ul(a[2]),u&8&&ul(a[3])]):{};e.$set(c)}},i(a){i||(e&&b(e.$$.fragment,a),i=!0)},o(a){e&&k(e.$$.fragment,a),i=!1},d(a){a&&w(n),e&&U(e,a)}}}function hW(t){return{c:he,m:he,p:he,i:he,o:he,d:he}}function mW(t){let e,n,i=t[1]&&t[1].route===t[5]&&nk(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,[r]){l[1]&&l[1].route===l[5]?i?(i.p(l,r),r&2&&b(i,1)):(i=nk(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function gW(t,e,n){let i,{$$slots:l={},$$scope:r}=e,{path:s=""}=e,{component:o=null}=e,a={},u={};const{registerRoute:f,unregisterRoute:c,activeRoute:d}=bi(Gm);Mt(t,d,g=>n(1,i=g));const h={path:s,default:s===""};return f(h),Es(()=>{c(h)}),t.$$set=g=>{n(11,e=Y(Y({},e),Se(g))),"path"in g&&n(6,s=g.path),"component"in g&&n(0,o=g.component),"$$scope"in g&&n(7,r=g.$$scope)},t.$$.update=()=>{if(i&&i.route===h){n(2,a=i.params);const{component:g,path:_,...v}=e;n(3,u=v),g&&(g.toString().startsWith("class ")?n(0,o=g):n(0,o=g())),YT()&&(window==null||window.scrollTo(0,0))}},e=Se(e),[o,i,a,u,d,h,s,r,l]}class zi extends De{constructor(e){super(),Re(this,e,gW,mW,Ie,{path:6,component:0})}}const $h=t=>({...t.location,state:t.history.state,key:t.history.state&&t.history.state.key||"initial"}),_W=t=>{const e=[];let n=$h(t);return{get location(){return n},listen(i){e.push(i);const l=()=>{n=$h(t),i({location:n,action:"POP"})};return t.addEventListener("popstate",l),()=>{t.removeEventListener("popstate",l);const r=e.indexOf(i);e.splice(r,1)}},navigate(i,{state:l,replace:r=!1}={}){l={...l,key:Date.now()+""};try{r?t.history.replaceState(l,"",i):t.history.pushState(l,"",i)}catch{t.location[r?"replace":"assign"](i)}n=$h(t),e.forEach(s=>s({location:n,action:"PUSH"})),document.activeElement.blur()}}},pW=(t="/")=>{let e=0;const n=[{pathname:t,search:""}],i=[];return{get location(){return n[e]},addEventListener(l,r){},removeEventListener(l,r){},history:{get entries(){return n},get index(){return e},get state(){return i[e]},pushState(l,r,s){const[o,a=""]=s.split("?");e++,n.push({pathname:o,search:a}),i.push(l)},replaceState(l,r,s){const[o,a=""]=s.split("?");n[e]={pathname:o,search:a},i[e]=l}}}},ZT=_W(YT()?window:pW()),{navigate:bW}=ZT,vW=t=>({route:t&2,location:t&1}),ik=t=>({route:t[1]&&t[1].uri,location:t[0]});function kW(t){let e;const n=t[12].default,i=Ze(n,t,t[11],ik);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,[r]){i&&i.p&&(!e||r&2051)&&Ke(i,n,l,l[11],e?Xe(n,l[11],r,vW):$e(l[11]),ik)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function wW(t,e,n){let i,l,r,s,{$$slots:o={},$$scope:a}=e,{basepath:u="/"}=e,{url:f=null}=e,{history:c=ZT}=e;Wi(tW,c);const d=bi(Jv),h=bi(Gm),g=un([]);Mt(t,g,L=>n(9,l=L));const _=un(null);Mt(t,_,L=>n(1,s=L));let v=!1;const S=d||un(f?{pathname:f}:c.location);Mt(t,S,L=>n(0,i=L));const A=h?h.routerBase:un({path:u,uri:u});Mt(t,A,L=>n(10,r=L));const C=Ms([A,_],([L,N])=>{if(!N)return L;const{path:z}=L,{route:W,uri:D}=N;return{path:W.default?z:W.path.replace(/\*.*$/,""),uri:D}}),I=L=>{const{path:N}=r;let{path:z}=L;if(L._path=z,L.path=ek(N,z),typeof window>"u"){if(v)return;const W=xv([L],i.pathname);W&&(_.set(W),v=!0)}else g.update(W=>[...W,L])},M=L=>{g.update(N=>N.filter(z=>z!==L))};return d||(_n(()=>c.listen(N=>{S.set(N.location)})),Wi(Jv,S)),Wi(Gm,{activeRoute:_,base:A,routerBase:C,registerRoute:I,unregisterRoute:M}),t.$$set=L=>{"basepath"in L&&n(6,u=L.basepath),"url"in L&&n(7,f=L.url),"history"in L&&n(8,c=L.history),"$$scope"in L&&n(11,a=L.$$scope)},t.$$.update=()=>{if(t.$$.dirty&1024){const{path:L}=r;g.update(N=>N.map(z=>Object.assign(z,{path:ek(L,z._path)})))}if(t.$$.dirty&513){const L=xv(l,i.pathname);_.set(L)}},[i,s,g,_,S,A,u,f,c,l,r,a,o]}class yW extends De{constructor(e){super(),Re(this,e,wW,kW,Ie,{basepath:6,url:7,history:8})}}function lk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function TW(t){let e,n,i,l=t[1]&&lk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class zu extends De{constructor(e){super(),Re(this,e,SW,TW,Ie,{size:0,title:1})}}function rk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function EW(t){let e,n,i=t[1]&&rk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class OW extends De{constructor(e){super(),Re(this,e,MW,EW,Ie,{size:0,title:1})}}function sk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function AW(t){let e,n,i,l=t[1]&&sk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class LW extends De{constructor(e){super(),Re(this,e,CW,AW,Ie,{size:0,title:1})}}function ok(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function IW(t){let e,n,i=t[1]&&ok(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class DW extends De{constructor(e){super(),Re(this,e,RW,IW,Ie,{size:0,title:1})}}function ak(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function PW(t){let e,n,i=t[1]&&ak(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class BW extends De{constructor(e){super(),Re(this,e,NW,PW,Ie,{size:0,title:1})}}function uk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function zW(t){let e,n,i=t[1]&&uk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class UW extends De{constructor(e){super(),Re(this,e,HW,zW,Ie,{size:0,title:1})}}function fk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function FW(t){let e,n,i=t[1]&&fk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class VW extends De{constructor(e){super(),Re(this,e,GW,FW,Ie,{size:0,title:1})}}function ck(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function WW(t){let e,n,i,l=t[1]&&ck(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let jW=class extends De{constructor(e){super(),Re(this,e,qW,WW,Ie,{size:0,title:1})}};function dk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function YW(t){let e,n,i=t[1]&&dk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class XW extends De{constructor(e){super(),Re(this,e,ZW,YW,Ie,{size:0,title:1})}}function hk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function KW(t){let e,n,i=t[1]&&hk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class xs extends De{constructor(e){super(),Re(this,e,$W,KW,Ie,{size:0,title:1})}}function mk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function JW(t){let e,n,i=t[1]&&mk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let Jh=class extends De{constructor(e){super(),Re(this,e,QW,JW,Ie,{size:0,title:1})}};function gk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function xW(t){let e,n,i=t[1]&&gk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class tq extends De{constructor(e){super(),Re(this,e,eq,xW,Ie,{size:0,title:1})}}function _k(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function nq(t){let e,n,i=t[1]&&_k(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let lq=class extends De{constructor(e){super(),Re(this,e,iq,nq,Ie,{size:0,title:1})}};function pk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function rq(t){let e,n,i=t[1]&&pk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class oq extends De{constructor(e){super(),Re(this,e,sq,rq,Ie,{size:0,title:1})}}function bk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function aq(t){let e,n,i,l=t[1]&&bk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class fq extends De{constructor(e){super(),Re(this,e,uq,aq,Ie,{size:0,title:1})}}function vk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function cq(t){let e,n,i,l,r,s=t[1]&&vk(t),o=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],a={};for(let u=0;u{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class hq extends De{constructor(e){super(),Re(this,e,dq,cq,Ie,{size:0,title:1})}}function kk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function mq(t){let e,n,i=t[1]&&kk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class _q extends De{constructor(e){super(),Re(this,e,gq,mq,Ie,{size:0,title:1})}}function wk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function pq(t){let e,n,i=t[1]&&wk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class $1 extends De{constructor(e){super(),Re(this,e,bq,pq,Ie,{size:0,title:1})}}function yk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function vq(t){let e,n,i,l=t[1]&&yk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class dd extends De{constructor(e){super(),Re(this,e,kq,vq,Ie,{size:0,title:1})}}function Tk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function wq(t){let e,n,i,l=t[1]&&Tk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Tq extends De{constructor(e){super(),Re(this,e,yq,wq,Ie,{size:0,title:1})}}function Sk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Sq(t){let e,n,i=t[1]&&Sk(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class ws extends De{constructor(e){super(),Re(this,e,Eq,Sq,Ie,{size:0,title:1})}}function Ek(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Mq(t){let e,n,i,l=t[1]&&Ek(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Aq extends De{constructor(e){super(),Re(this,e,Oq,Mq,Ie,{size:0,title:1})}}function Mk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Cq(t){let e,n,i,l=t[1]&&Mk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}let Iq=class extends De{constructor(e){super(),Re(this,e,Lq,Cq,Ie,{size:0,title:1})}};function Ok(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Rq(t){let e,n,i=t[1]&&Ok(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Pq extends De{constructor(e){super(),Re(this,e,Dq,Rq,Ie,{size:0,title:1})}}function Ak(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Nq(t){let e,n,i=t[1]&&Ak(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class zq extends De{constructor(e){super(),Re(this,e,Bq,Nq,Ie,{size:0,title:1})}}function Ck(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Hq(t){let e,n,i,l=t[1]&&Ck(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Fq extends De{constructor(e){super(),Re(this,e,Uq,Hq,Ie,{size:0,title:1})}}function Lk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Gq(t){let e,n,i,l=t[1]&&Lk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Wq extends De{constructor(e){super(),Re(this,e,Vq,Gq,Ie,{size:0,title:1})}}function Ik(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function qq(t){let e,n,i=t[1]&&Ik(t),l=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],r={};for(let s=0;s{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Yq extends De{constructor(e){super(),Re(this,e,jq,qq,Ie,{size:0,title:1})}}function Rk(t){let e,n;return{c(){e=Me("title"),n=q(t[1])},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&2&&Z(n,i[1])},d(i){i&&w(e)}}}function Zq(t){let e,n,i,l=t[1]&&Rk(t),r=[{xmlns:"http://www.w3.org/2000/svg"},{viewBox:"0 0 32 32"},{fill:"currentColor"},{preserveAspectRatio:"xMidYMid meet"},{width:t[0]},{height:t[0]},t[2],t[3]],s={};for(let o=0;o{n(5,e=Y(Y({},e),Se(u))),n(3,s=ae(e,r)),"size"in u&&n(0,o=u.size),"title"in u&&n(1,a=u.title)},t.$$.update=()=>{n(4,i=e["aria-label"]||e["aria-labelledby"]||a),n(2,l={"aria-hidden":i?void 0:!0,role:i?"img":void 0,focusable:Number(e.tabindex)===0?!0:void 0})},e=Se(e),[o,a,l,s,i]}class Dk extends De{constructor(e){super(),Re(this,e,Xq,Zq,Ie,{size:0,title:1})}}function Kq(){const t=window.__GS_BASE_PATH__||"";return t==="/"?"":t}class $q{constructor(){sl(this,"baseURL");sl(this,"headers");sl(this,"onUnauthorizedcallMe");sl(this,"loggedIn");sl(this,"jwtToken");sl(this,"username");const e=localStorage.getItem("jwt"),n=Kq();this.baseURL=n+"/api",this.username="",this.headers={Authorization:`Bearer ${e}`},this.onUnauthorizedcallMe=()=>{}}verifyToken(){return this.doCallRaw("/auth/verify").then(async e=>{if(e.status===200){const n=await e.json();return this.jwtToken=localStorage.getItem("jwt")||"",this.setLoggedIn(this.jwtToken,n.Username||""),!0}else return this.setLoggedOut(),!1})}setLoggedIn(e,n){this.jwtToken=e,this.username=n,this.loggedIn=!0}setLoggedOut(){localStorage.removeItem("jwt"),this.username="",this.loggedIn=!1}onUnauthorized(e){this.onUnauthorizedcallMe=e}setHeaders(e){this.headers=e}getHeaders(){const e=localStorage.getItem("jwt");return this.headers.Authorization=`Bearer ${e}`,this.headers}getSetting(e){return new Promise(async(n,i)=>{const l="/settings/"+e;this.doCall(l).then(function(r){n(r)}).catch(function(r){i(r)})})}deleteUser(e){return new Promise(async(n,i)=>{const l="/users/"+e;this.doCall(l,"delete").then(function(r){n(r)}).catch(function(r){i(r)})})}getUsers(){return new Promise(async(e,n)=>{const i="/users";this.doCall(i).then(function(l){e(l)}).catch(function(l){n(l)})})}createUser(e){return new Promise(async(n,i)=>{const l="/users";this.doCall(l,"post",e).then(function(r){n(r)}).catch(function(r){i(r)})})}updateUser(e){return new Promise(async(n,i)=>{const l="/users";this.doCall(l,"put",e).then(function(r){n(r)}).catch(function(r){i(r)})})}setSetting(e,n,i){return new Promise(async(l,r)=>{const s="/settings/"+e;var o=i?i(n):{key:e,value:n};this.doCall(s,"post",o).then(function(a){if(a===void 0)throw new Error("Setting update failed");l(!0)}).catch(function(a){r(a)})})}doCallRaw(e="/",n="get",i={}){const l=this,r={method:n,headers:this.getHeaders()};return n==="post"&&(r.body=JSON.stringify(i)),new Promise((o,a)=>{fetch(l.baseURL+e,r).then(u=>{o(u)}).catch(u=>{a(u)})})}async doCall(e="/",n="get",i={},l={}){const r=this,s={method:n,headers:this.getHeaders(),...l};(n==="post"||n==="put")&&(s.body=JSON.stringify(i));try{const o=await fetch(r.baseURL+e,s);if(o.status===401)throw r.onUnauthorizedcallMe(),new Error("Authentication required");if(!o.ok)throw new Error("GateSentry request failed with status "+o.status);return await o.json()}catch(o){throw console.error("Gatesentry API error : [Path "+e+"] [Method "+n+"]",o),o}}}const XT=new $q,{subscribe:Jq,update:Qh}=un({api:XT}),An={subscribe:Jq,loginSuccesful:(t,e)=>Qh(n=>(n.api.setLoggedIn(t,e),n)),logout:()=>Qh(t=>(t.api.setLoggedOut(),t)),refresh:()=>Qh(t=>t)};XT.onUnauthorized(()=>{An.logout()});function ni(){const t=window.__GS_BASE_PATH__||"";return t==="/"?"":t}function Vi(t,e){const n=ni();bW(n+t,e)}const{subscribe:Qq,update:xh}=un([]),ci={subscribe:Qq,add:({title:t,subtitle:e,kind:n,timeout:i=1e3})=>xh(l=>[...l,{id:l.length+1,title:t,subtitle:e,kind:n,timeout:i}]),remove:t=>xh(e=>e.filter(n=>n.id!==t.id)),refresh:()=>xh(t=>t)},KT=(t,e)=>({kind:t.kind??"error",title:t.title??e("Error"),subtitle:t.subtitle??e("Unable to perform action"),timeout:t.timeout??3e4}),Hu=(t,e)=>KT({...t,kind:"success",timeout:2e3,title:e("Success")},e),ao=(t,e)=>KT({...t,kind:"error",timeout:3e4},e),Pk=t=>{const e=["Bytes","KB","MB","GB","TB"];if(t===0)return"0 B";const n=Math.floor(Math.log(t)/Math.log(1024));return Math.round(t/Math.pow(1024,n))+" "+e[n]};var Wa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $T(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function xq(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var l=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,l.get?l:{enumerable:!0,get:function(){return t[i]}})}),n}var ej=function(e){return tj(e)&&!nj(e)};function tj(t){return!!t&&typeof t=="object"}function nj(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||rj(t)}var ij=typeof Symbol=="function"&&Symbol.for,lj=ij?Symbol.for("react.element"):60103;function rj(t){return t.$$typeof===lj}function sj(t){return Array.isArray(t)?[]:{}}function _u(t,e){return e.clone!==!1&&e.isMergeableObject(t)?Jo(sj(t),t,e):t}function oj(t,e,n){return t.concat(e).map(function(i){return _u(i,n)})}function aj(t,e){if(!e.customMerge)return Jo;var n=e.customMerge(t);return typeof n=="function"?n:Jo}function uj(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function Nk(t){return Object.keys(t).concat(uj(t))}function JT(t,e){try{return e in t}catch{return!1}}function fj(t,e){return JT(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function cj(t,e,n){var i={};return n.isMergeableObject(t)&&Nk(t).forEach(function(l){i[l]=_u(t[l],n)}),Nk(e).forEach(function(l){fj(t,l)||(JT(t,l)&&n.isMergeableObject(e[l])?i[l]=aj(l,n)(t[l],e[l],n):i[l]=_u(e[l],n))}),i}function Jo(t,e,n){n=n||{},n.arrayMerge=n.arrayMerge||oj,n.isMergeableObject=n.isMergeableObject||ej,n.cloneUnlessOtherwiseSpecified=_u;var i=Array.isArray(e),l=Array.isArray(t),r=i===l;return r?i?n.arrayMerge(t,e,n):cj(t,e,n):_u(e,n)}Jo.all=function(e,n){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(i,l){return Jo(i,l,n)},{})};var dj=Jo,hj=dj;const mj=$T(hj);var Wm=function(t,e){return Wm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var l in i)Object.prototype.hasOwnProperty.call(i,l)&&(n[l]=i[l])},Wm(t,e)};function hd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Wm(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var vn=function(){return vn=Object.assign||function(e){for(var n,i=1,l=arguments.length;i0}),n=[],i=0,l=e;i1)throw new RangeError("integer-width stems only accept a single optional option");l.options[0].replace(yj,function(a,u,f,c,d,h){if(u)e.minimumIntegerDigits=f.length;else{if(c&&d)throw new Error("We currently do not support maximum integer digits");if(h)throw new Error("We currently do not support exact integer digits")}return""});continue}if(o8.test(l.stem)){e.minimumIntegerDigits=l.stem.length;continue}if(zk.test(l.stem)){if(l.options.length>1)throw new RangeError("Fraction-precision stems only accept a single optional option");l.stem.replace(zk,function(a,u,f,c,d,h){return f==="*"?e.minimumFractionDigits=u.length:c&&c[0]==="#"?e.maximumFractionDigits=c.length:d&&h?(e.minimumFractionDigits=d.length,e.maximumFractionDigits=d.length+h.length):(e.minimumFractionDigits=u.length,e.maximumFractionDigits=u.length),""});var r=l.options[0];r==="w"?e=vn(vn({},e),{trailingZeroDisplay:"stripIfInteger"}):r&&(e=vn(vn({},e),Hk(r)));continue}if(s8.test(l.stem)){e=vn(vn({},e),Hk(l.stem));continue}var s=a8(l.stem);s&&(e=vn(vn({},e),s));var o=Tj(l.stem);o&&(e=vn(vn({},e),o))}return e}var Wf={AX:["H"],BQ:["H"],CP:["H"],CZ:["H"],DK:["H"],FI:["H"],ID:["H"],IS:["H"],ML:["H"],NE:["H"],RU:["H"],SE:["H"],SJ:["H"],SK:["H"],AS:["h","H"],BT:["h","H"],DJ:["h","H"],ER:["h","H"],GH:["h","H"],IN:["h","H"],LS:["h","H"],PG:["h","H"],PW:["h","H"],SO:["h","H"],TO:["h","H"],VU:["h","H"],WS:["h","H"],"001":["H","h"],AL:["h","H","hB"],TD:["h","H","hB"],"ca-ES":["H","h","hB"],CF:["H","h","hB"],CM:["H","h","hB"],"fr-CA":["H","h","hB"],"gl-ES":["H","h","hB"],"it-CH":["H","h","hB"],"it-IT":["H","h","hB"],LU:["H","h","hB"],NP:["H","h","hB"],PF:["H","h","hB"],SC:["H","h","hB"],SM:["H","h","hB"],SN:["H","h","hB"],TF:["H","h","hB"],VA:["H","h","hB"],CY:["h","H","hb","hB"],GR:["h","H","hb","hB"],CO:["h","H","hB","hb"],DO:["h","H","hB","hb"],KP:["h","H","hB","hb"],KR:["h","H","hB","hb"],NA:["h","H","hB","hb"],PA:["h","H","hB","hb"],PR:["h","H","hB","hb"],VE:["h","H","hB","hb"],AC:["H","h","hb","hB"],AI:["H","h","hb","hB"],BW:["H","h","hb","hB"],BZ:["H","h","hb","hB"],CC:["H","h","hb","hB"],CK:["H","h","hb","hB"],CX:["H","h","hb","hB"],DG:["H","h","hb","hB"],FK:["H","h","hb","hB"],GB:["H","h","hb","hB"],GG:["H","h","hb","hB"],GI:["H","h","hb","hB"],IE:["H","h","hb","hB"],IM:["H","h","hb","hB"],IO:["H","h","hb","hB"],JE:["H","h","hb","hB"],LT:["H","h","hb","hB"],MK:["H","h","hb","hB"],MN:["H","h","hb","hB"],MS:["H","h","hb","hB"],NF:["H","h","hb","hB"],NG:["H","h","hb","hB"],NR:["H","h","hb","hB"],NU:["H","h","hb","hB"],PN:["H","h","hb","hB"],SH:["H","h","hb","hB"],SX:["H","h","hb","hB"],TA:["H","h","hb","hB"],ZA:["H","h","hb","hB"],"af-ZA":["H","h","hB","hb"],AR:["H","h","hB","hb"],CL:["H","h","hB","hb"],CR:["H","h","hB","hb"],CU:["H","h","hB","hb"],EA:["H","h","hB","hb"],"es-BO":["H","h","hB","hb"],"es-BR":["H","h","hB","hb"],"es-EC":["H","h","hB","hb"],"es-ES":["H","h","hB","hb"],"es-GQ":["H","h","hB","hb"],"es-PE":["H","h","hB","hb"],GT:["H","h","hB","hb"],HN:["H","h","hB","hb"],IC:["H","h","hB","hb"],KG:["H","h","hB","hb"],KM:["H","h","hB","hb"],LK:["H","h","hB","hb"],MA:["H","h","hB","hb"],MX:["H","h","hB","hb"],NI:["H","h","hB","hb"],PY:["H","h","hB","hb"],SV:["H","h","hB","hb"],UY:["H","h","hB","hb"],JP:["H","h","K"],AD:["H","hB"],AM:["H","hB"],AO:["H","hB"],AT:["H","hB"],AW:["H","hB"],BE:["H","hB"],BF:["H","hB"],BJ:["H","hB"],BL:["H","hB"],BR:["H","hB"],CG:["H","hB"],CI:["H","hB"],CV:["H","hB"],DE:["H","hB"],EE:["H","hB"],FR:["H","hB"],GA:["H","hB"],GF:["H","hB"],GN:["H","hB"],GP:["H","hB"],GW:["H","hB"],HR:["H","hB"],IL:["H","hB"],IT:["H","hB"],KZ:["H","hB"],MC:["H","hB"],MD:["H","hB"],MF:["H","hB"],MQ:["H","hB"],MZ:["H","hB"],NC:["H","hB"],NL:["H","hB"],PM:["H","hB"],PT:["H","hB"],RE:["H","hB"],RO:["H","hB"],SI:["H","hB"],SR:["H","hB"],ST:["H","hB"],TG:["H","hB"],TR:["H","hB"],WF:["H","hB"],YT:["H","hB"],BD:["h","hB","H"],PK:["h","hB","H"],AZ:["H","hB","h"],BA:["H","hB","h"],BG:["H","hB","h"],CH:["H","hB","h"],GE:["H","hB","h"],LI:["H","hB","h"],ME:["H","hB","h"],RS:["H","hB","h"],UA:["H","hB","h"],UZ:["H","hB","h"],XK:["H","hB","h"],AG:["h","hb","H","hB"],AU:["h","hb","H","hB"],BB:["h","hb","H","hB"],BM:["h","hb","H","hB"],BS:["h","hb","H","hB"],CA:["h","hb","H","hB"],DM:["h","hb","H","hB"],"en-001":["h","hb","H","hB"],FJ:["h","hb","H","hB"],FM:["h","hb","H","hB"],GD:["h","hb","H","hB"],GM:["h","hb","H","hB"],GU:["h","hb","H","hB"],GY:["h","hb","H","hB"],JM:["h","hb","H","hB"],KI:["h","hb","H","hB"],KN:["h","hb","H","hB"],KY:["h","hb","H","hB"],LC:["h","hb","H","hB"],LR:["h","hb","H","hB"],MH:["h","hb","H","hB"],MP:["h","hb","H","hB"],MW:["h","hb","H","hB"],NZ:["h","hb","H","hB"],SB:["h","hb","H","hB"],SG:["h","hb","H","hB"],SL:["h","hb","H","hB"],SS:["h","hb","H","hB"],SZ:["h","hb","H","hB"],TC:["h","hb","H","hB"],TT:["h","hb","H","hB"],UM:["h","hb","H","hB"],US:["h","hb","H","hB"],VC:["h","hb","H","hB"],VG:["h","hb","H","hB"],VI:["h","hb","H","hB"],ZM:["h","hb","H","hB"],BO:["H","hB","h","hb"],EC:["H","hB","h","hb"],ES:["H","hB","h","hb"],GQ:["H","hB","h","hb"],PE:["H","hB","h","hb"],AE:["h","hB","hb","H"],"ar-001":["h","hB","hb","H"],BH:["h","hB","hb","H"],DZ:["h","hB","hb","H"],EG:["h","hB","hb","H"],EH:["h","hB","hb","H"],HK:["h","hB","hb","H"],IQ:["h","hB","hb","H"],JO:["h","hB","hb","H"],KW:["h","hB","hb","H"],LB:["h","hB","hb","H"],LY:["h","hB","hb","H"],MO:["h","hB","hb","H"],MR:["h","hB","hb","H"],OM:["h","hB","hb","H"],PH:["h","hB","hb","H"],PS:["h","hB","hb","H"],QA:["h","hB","hb","H"],SA:["h","hB","hb","H"],SD:["h","hB","hb","H"],SY:["h","hB","hb","H"],TN:["h","hB","hb","H"],YE:["h","hB","hb","H"],AF:["H","hb","hB","h"],LA:["H","hb","hB","h"],CN:["H","hB","hb","h"],LV:["H","hB","hb","h"],TL:["H","hB","hb","h"],"zu-ZA":["H","hB","hb","h"],CD:["hB","H"],IR:["hB","H"],"hi-IN":["hB","h","H"],"kn-IN":["hB","h","H"],"ml-IN":["hB","h","H"],"te-IN":["hB","h","H"],KH:["hB","h","H","hb"],"ta-IN":["hB","h","hb","H"],BN:["hb","hB","h","H"],MY:["hb","hB","h","H"],ET:["hB","hb","h","H"],"gu-IN":["hB","hb","h","H"],"mr-IN":["hB","hb","h","H"],"pa-IN":["hB","hb","h","H"],TW:["hB","hb","h","H"],KE:["hB","hb","H","h"],MM:["hB","hb","H","h"],TZ:["hB","hb","H","h"],UG:["hB","hb","H","h"]};function Ej(t,e){for(var n="",i=0;i>1),a="a",u=Mj(e);for((u=="H"||u=="k")&&(o=0);o-- >0;)n+=a;for(;s-- >0;)n=u+n}else l==="J"?n+="H":n+=l}return n}function Mj(t){var e=t.hourCycle;if(e===void 0&&t.hourCycles&&t.hourCycles.length&&(e=t.hourCycles[0]),e)switch(e){case"h24":return"k";case"h23":return"H";case"h12":return"h";case"h11":return"K";default:throw new Error("Invalid hourCycle")}var n=t.language,i;n!=="root"&&(i=t.maximize().region);var l=Wf[i||""]||Wf[n||""]||Wf["".concat(n,"-001")]||Wf["001"];return l[0]}var tm,Oj=new RegExp("^".concat(r8.source,"*")),Aj=new RegExp("".concat(r8.source,"*$"));function fn(t,e){return{start:t,end:e}}var Cj=!!String.prototype.startsWith,Lj=!!String.fromCodePoint,Ij=!!Object.fromEntries,Rj=!!String.prototype.codePointAt,Dj=!!String.prototype.trimStart,Pj=!!String.prototype.trimEnd,Nj=!!Number.isSafeInteger,Bj=Nj?Number.isSafeInteger:function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t&&Math.abs(t)<=9007199254740991},jm=!0;try{var zj=f8("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");jm=((tm=zj.exec("a"))===null||tm===void 0?void 0:tm[0])==="a"}catch{jm=!1}var Fk=Cj?function(e,n,i){return e.startsWith(n,i)}:function(e,n,i){return e.slice(i,i+n.length)===n},Ym=Lj?String.fromCodePoint:function(){for(var e=[],n=0;nr;){if(s=e[r++],s>1114111)throw RangeError(s+" is not a valid code point");i+=s<65536?String.fromCharCode(s):String.fromCharCode(((s-=65536)>>10)+55296,s%1024+56320)}return i},Gk=Ij?Object.fromEntries:function(e){for(var n={},i=0,l=e;i=i)){var l=e.charCodeAt(n),r;return l<55296||l>56319||n+1===i||(r=e.charCodeAt(n+1))<56320||r>57343?l:(l-55296<<10)+(r-56320)+65536}},Hj=Dj?function(e){return e.trimStart()}:function(e){return e.replace(Oj,"")},Uj=Pj?function(e){return e.trimEnd()}:function(e){return e.replace(Aj,"")};function f8(t,e){return new RegExp(t,e)}var Zm;if(jm){var Vk=f8("([^\\p{White_Space}\\p{Pattern_Syntax}]*)","yu");Zm=function(e,n){var i;Vk.lastIndex=n;var l=Vk.exec(e);return(i=l[1])!==null&&i!==void 0?i:""}}else Zm=function(e,n){for(var i=[];;){var l=u8(e,n);if(l===void 0||c8(l)||Wj(l))break;i.push(l),n+=l>=65536?2:1}return Ym.apply(void 0,i)};var Fj=function(){function t(e,n){n===void 0&&(n={}),this.message=e,this.position={offset:0,line:1,column:1},this.ignoreTag=!!n.ignoreTag,this.locale=n.locale,this.requiresOtherClause=!!n.requiresOtherClause,this.shouldParseSkeletons=!!n.shouldParseSkeletons}return t.prototype.parse=function(){if(this.offset()!==0)throw Error("parser can only be used once");return this.parseMessage(0,"",!1)},t.prototype.parseMessage=function(e,n,i){for(var l=[];!this.isEOF();){var r=this.char();if(r===123){var s=this.parseArgument(e,i);if(s.err)return s;l.push(s.val)}else{if(r===125&&e>0)break;if(r===35&&(n==="plural"||n==="selectordinal")){var o=this.clonePosition();this.bump(),l.push({type:Gn.pound,location:fn(o,this.clonePosition())})}else if(r===60&&!this.ignoreTag&&this.peek()===47){if(i)break;return this.error(an.UNMATCHED_CLOSING_TAG,fn(this.clonePosition(),this.clonePosition()))}else if(r===60&&!this.ignoreTag&&Xm(this.peek()||0)){var s=this.parseTag(e,n);if(s.err)return s;l.push(s.val)}else{var s=this.parseLiteral(e,n);if(s.err)return s;l.push(s.val)}}}return{val:l,err:null}},t.prototype.parseTag=function(e,n){var i=this.clonePosition();this.bump();var l=this.parseTagName();if(this.bumpSpace(),this.bumpIf("/>"))return{val:{type:Gn.literal,value:"<".concat(l,"/>"),location:fn(i,this.clonePosition())},err:null};if(this.bumpIf(">")){var r=this.parseMessage(e+1,n,!0);if(r.err)return r;var s=r.val,o=this.clonePosition();if(this.bumpIf("")?{val:{type:Gn.tag,value:l,children:s,location:fn(i,this.clonePosition())},err:null}:this.error(an.INVALID_TAG,fn(o,this.clonePosition())))}else return this.error(an.UNCLOSED_TAG,fn(i,this.clonePosition()))}else return this.error(an.INVALID_TAG,fn(i,this.clonePosition()))},t.prototype.parseTagName=function(){var e=this.offset();for(this.bump();!this.isEOF()&&Vj(this.char());)this.bump();return this.message.slice(e,this.offset())},t.prototype.parseLiteral=function(e,n){for(var i=this.clonePosition(),l="";;){var r=this.tryParseQuote(n);if(r){l+=r;continue}var s=this.tryParseUnquoted(e,n);if(s){l+=s;continue}var o=this.tryParseLeftAngleBracket();if(o){l+=o;continue}break}var a=fn(i,this.clonePosition());return{val:{type:Gn.literal,value:l,location:a},err:null}},t.prototype.tryParseLeftAngleBracket=function(){return!this.isEOF()&&this.char()===60&&(this.ignoreTag||!Gj(this.peek()||0))?(this.bump(),"<"):null},t.prototype.tryParseQuote=function(e){if(this.isEOF()||this.char()!==39)return null;switch(this.peek()){case 39:return this.bump(),this.bump(),"'";case 123:case 60:case 62:case 125:break;case 35:if(e==="plural"||e==="selectordinal")break;return null;default:return null}this.bump();var n=[this.char()];for(this.bump();!this.isEOF();){var i=this.char();if(i===39)if(this.peek()===39)n.push(39),this.bump();else{this.bump();break}else n.push(i);this.bump()}return Ym.apply(void 0,n)},t.prototype.tryParseUnquoted=function(e,n){if(this.isEOF())return null;var i=this.char();return i===60||i===123||i===35&&(n==="plural"||n==="selectordinal")||i===125&&e>0?null:(this.bump(),Ym(i))},t.prototype.parseArgument=function(e,n){var i=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(an.EXPECT_ARGUMENT_CLOSING_BRACE,fn(i,this.clonePosition()));if(this.char()===125)return this.bump(),this.error(an.EMPTY_ARGUMENT,fn(i,this.clonePosition()));var l=this.parseIdentifierIfPossible().value;if(!l)return this.error(an.MALFORMED_ARGUMENT,fn(i,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(an.EXPECT_ARGUMENT_CLOSING_BRACE,fn(i,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:Gn.argument,value:l,location:fn(i,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(an.EXPECT_ARGUMENT_CLOSING_BRACE,fn(i,this.clonePosition())):this.parseArgumentOptions(e,n,l,i);default:return this.error(an.MALFORMED_ARGUMENT,fn(i,this.clonePosition()))}},t.prototype.parseIdentifierIfPossible=function(){var e=this.clonePosition(),n=this.offset(),i=Zm(this.message,n),l=n+i.length;this.bumpTo(l);var r=this.clonePosition(),s=fn(e,r);return{value:i,location:s}},t.prototype.parseArgumentOptions=function(e,n,i,l){var r,s=this.clonePosition(),o=this.parseIdentifierIfPossible().value,a=this.clonePosition();switch(o){case"":return this.error(an.EXPECT_ARGUMENT_TYPE,fn(s,a));case"number":case"date":case"time":{this.bumpSpace();var u=null;if(this.bumpIf(",")){this.bumpSpace();var f=this.clonePosition(),c=this.parseSimpleArgStyleIfPossible();if(c.err)return c;var d=Uj(c.val);if(d.length===0)return this.error(an.EXPECT_ARGUMENT_STYLE,fn(this.clonePosition(),this.clonePosition()));var h=fn(f,this.clonePosition());u={style:d,styleLocation:h}}var g=this.tryParseArgumentClose(l);if(g.err)return g;var _=fn(l,this.clonePosition());if(u&&Fk(u==null?void 0:u.style,"::",0)){var v=Hj(u.style.slice(2));if(o==="number"){var c=this.parseNumberSkeletonFromString(v,u.styleLocation);return c.err?c:{val:{type:Gn.number,value:i,location:_,style:c.val},err:null}}else{if(v.length===0)return this.error(an.EXPECT_DATE_TIME_SKELETON,_);var S=v;this.locale&&(S=Ej(v,this.locale));var d={type:Qo.dateTime,pattern:S,location:u.styleLocation,parsedOptions:this.shouldParseSkeletons?bj(S):{}},A=o==="date"?Gn.date:Gn.time;return{val:{type:A,value:i,location:_,style:d},err:null}}}return{val:{type:o==="number"?Gn.number:o==="date"?Gn.date:Gn.time,value:i,location:_,style:(r=u==null?void 0:u.style)!==null&&r!==void 0?r:null},err:null}}case"plural":case"selectordinal":case"select":{var C=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(","))return this.error(an.EXPECT_SELECT_ARGUMENT_OPTIONS,fn(C,vn({},C)));this.bumpSpace();var I=this.parseIdentifierIfPossible(),M=0;if(o!=="select"&&I.value==="offset"){if(!this.bumpIf(":"))return this.error(an.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,fn(this.clonePosition(),this.clonePosition()));this.bumpSpace();var c=this.tryParseDecimalInteger(an.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,an.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(c.err)return c;this.bumpSpace(),I=this.parseIdentifierIfPossible(),M=c.val}var L=this.tryParsePluralOrSelectOptions(e,o,n,I);if(L.err)return L;var g=this.tryParseArgumentClose(l);if(g.err)return g;var N=fn(l,this.clonePosition());return o==="select"?{val:{type:Gn.select,value:i,options:Gk(L.val),location:N},err:null}:{val:{type:Gn.plural,value:i,options:Gk(L.val),offset:M,pluralType:o==="plural"?"cardinal":"ordinal",location:N},err:null}}default:return this.error(an.INVALID_ARGUMENT_TYPE,fn(s,a))}},t.prototype.tryParseArgumentClose=function(e){return this.isEOF()||this.char()!==125?this.error(an.EXPECT_ARGUMENT_CLOSING_BRACE,fn(e,this.clonePosition())):(this.bump(),{val:!0,err:null})},t.prototype.parseSimpleArgStyleIfPossible=function(){for(var e=0,n=this.clonePosition();!this.isEOF();){var i=this.char();switch(i){case 39:{this.bump();var l=this.clonePosition();if(!this.bumpUntil("'"))return this.error(an.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,fn(l,this.clonePosition()));this.bump();break}case 123:{e+=1,this.bump();break}case 125:{if(e>0)e-=1;else return{val:this.message.slice(n.offset,this.offset()),err:null};break}default:this.bump();break}}return{val:this.message.slice(n.offset,this.offset()),err:null}},t.prototype.parseNumberSkeletonFromString=function(e,n){var i=[];try{i=kj(e)}catch{return this.error(an.INVALID_NUMBER_SKELETON,n)}return{val:{type:Qo.number,tokens:i,location:n,parsedOptions:this.shouldParseSkeletons?Sj(i):{}},err:null}},t.prototype.tryParsePluralOrSelectOptions=function(e,n,i,l){for(var r,s=!1,o=[],a=new Set,u=l.value,f=l.location;;){if(u.length===0){var c=this.clonePosition();if(n!=="select"&&this.bumpIf("=")){var d=this.tryParseDecimalInteger(an.EXPECT_PLURAL_ARGUMENT_SELECTOR,an.INVALID_PLURAL_ARGUMENT_SELECTOR);if(d.err)return d;f=fn(c,this.clonePosition()),u=this.message.slice(c.offset,this.offset())}else break}if(a.has(u))return this.error(n==="select"?an.DUPLICATE_SELECT_ARGUMENT_SELECTOR:an.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,f);u==="other"&&(s=!0),this.bumpSpace();var h=this.clonePosition();if(!this.bumpIf("{"))return this.error(n==="select"?an.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:an.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,fn(this.clonePosition(),this.clonePosition()));var g=this.parseMessage(e+1,n,i);if(g.err)return g;var _=this.tryParseArgumentClose(h);if(_.err)return _;o.push([u,{value:g.val,location:fn(h,this.clonePosition())}]),a.add(u),this.bumpSpace(),r=this.parseIdentifierIfPossible(),u=r.value,f=r.location}return o.length===0?this.error(n==="select"?an.EXPECT_SELECT_ARGUMENT_SELECTOR:an.EXPECT_PLURAL_ARGUMENT_SELECTOR,fn(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!s?this.error(an.MISSING_OTHER_CLAUSE,fn(this.clonePosition(),this.clonePosition())):{val:o,err:null}},t.prototype.tryParseDecimalInteger=function(e,n){var i=1,l=this.clonePosition();this.bumpIf("+")||this.bumpIf("-")&&(i=-1);for(var r=!1,s=0;!this.isEOF();){var o=this.char();if(o>=48&&o<=57)r=!0,s=s*10+(o-48),this.bump();else break}var a=fn(l,this.clonePosition());return r?(s*=i,Bj(s)?{val:s,err:null}:this.error(n,a)):this.error(e,a)},t.prototype.offset=function(){return this.position.offset},t.prototype.isEOF=function(){return this.offset()===this.message.length},t.prototype.clonePosition=function(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}},t.prototype.char=function(){var e=this.position.offset;if(e>=this.message.length)throw Error("out of bound");var n=u8(this.message,e);if(n===void 0)throw Error("Offset ".concat(e," is at invalid UTF-16 code unit boundary"));return n},t.prototype.error=function(e,n){return{val:null,err:{kind:e,message:this.message,location:n}}},t.prototype.bump=function(){if(!this.isEOF()){var e=this.char();e===10?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}},t.prototype.bumpIf=function(e){if(Fk(this.message,e,this.offset())){for(var n=0;n=0?(this.bumpTo(i),!0):(this.bumpTo(this.message.length),!1)},t.prototype.bumpTo=function(e){if(this.offset()>e)throw Error("targetOffset ".concat(e," must be greater than or equal to the current offset ").concat(this.offset()));for(e=Math.min(e,this.message.length);;){var n=this.offset();if(n===e)break;if(n>e)throw Error("targetOffset ".concat(e," is at invalid UTF-16 code unit boundary"));if(this.bump(),this.isEOF())break}},t.prototype.bumpSpace=function(){for(;!this.isEOF()&&c8(this.char());)this.bump()},t.prototype.peek=function(){if(this.isEOF())return null;var e=this.char(),n=this.offset(),i=this.message.charCodeAt(n+(e>=65536?2:1));return i??null},t}();function Xm(t){return t>=97&&t<=122||t>=65&&t<=90}function Gj(t){return Xm(t)||t===47}function Vj(t){return t===45||t===46||t>=48&&t<=57||t===95||t>=97&&t<=122||t>=65&&t<=90||t==183||t>=192&&t<=214||t>=216&&t<=246||t>=248&&t<=893||t>=895&&t<=8191||t>=8204&&t<=8205||t>=8255&&t<=8256||t>=8304&&t<=8591||t>=11264&&t<=12271||t>=12289&&t<=55295||t>=63744&&t<=64975||t>=65008&&t<=65533||t>=65536&&t<=983039}function c8(t){return t>=9&&t<=13||t===32||t===133||t>=8206&&t<=8207||t===8232||t===8233}function Wj(t){return t>=33&&t<=35||t===36||t>=37&&t<=39||t===40||t===41||t===42||t===43||t===44||t===45||t>=46&&t<=47||t>=58&&t<=59||t>=60&&t<=62||t>=63&&t<=64||t===91||t===92||t===93||t===94||t===96||t===123||t===124||t===125||t===126||t===161||t>=162&&t<=165||t===166||t===167||t===169||t===171||t===172||t===174||t===176||t===177||t===182||t===187||t===191||t===215||t===247||t>=8208&&t<=8213||t>=8214&&t<=8215||t===8216||t===8217||t===8218||t>=8219&&t<=8220||t===8221||t===8222||t===8223||t>=8224&&t<=8231||t>=8240&&t<=8248||t===8249||t===8250||t>=8251&&t<=8254||t>=8257&&t<=8259||t===8260||t===8261||t===8262||t>=8263&&t<=8273||t===8274||t===8275||t>=8277&&t<=8286||t>=8592&&t<=8596||t>=8597&&t<=8601||t>=8602&&t<=8603||t>=8604&&t<=8607||t===8608||t>=8609&&t<=8610||t===8611||t>=8612&&t<=8613||t===8614||t>=8615&&t<=8621||t===8622||t>=8623&&t<=8653||t>=8654&&t<=8655||t>=8656&&t<=8657||t===8658||t===8659||t===8660||t>=8661&&t<=8691||t>=8692&&t<=8959||t>=8960&&t<=8967||t===8968||t===8969||t===8970||t===8971||t>=8972&&t<=8991||t>=8992&&t<=8993||t>=8994&&t<=9e3||t===9001||t===9002||t>=9003&&t<=9083||t===9084||t>=9085&&t<=9114||t>=9115&&t<=9139||t>=9140&&t<=9179||t>=9180&&t<=9185||t>=9186&&t<=9254||t>=9255&&t<=9279||t>=9280&&t<=9290||t>=9291&&t<=9311||t>=9472&&t<=9654||t===9655||t>=9656&&t<=9664||t===9665||t>=9666&&t<=9719||t>=9720&&t<=9727||t>=9728&&t<=9838||t===9839||t>=9840&&t<=10087||t===10088||t===10089||t===10090||t===10091||t===10092||t===10093||t===10094||t===10095||t===10096||t===10097||t===10098||t===10099||t===10100||t===10101||t>=10132&&t<=10175||t>=10176&&t<=10180||t===10181||t===10182||t>=10183&&t<=10213||t===10214||t===10215||t===10216||t===10217||t===10218||t===10219||t===10220||t===10221||t===10222||t===10223||t>=10224&&t<=10239||t>=10240&&t<=10495||t>=10496&&t<=10626||t===10627||t===10628||t===10629||t===10630||t===10631||t===10632||t===10633||t===10634||t===10635||t===10636||t===10637||t===10638||t===10639||t===10640||t===10641||t===10642||t===10643||t===10644||t===10645||t===10646||t===10647||t===10648||t>=10649&&t<=10711||t===10712||t===10713||t===10714||t===10715||t>=10716&&t<=10747||t===10748||t===10749||t>=10750&&t<=11007||t>=11008&&t<=11055||t>=11056&&t<=11076||t>=11077&&t<=11078||t>=11079&&t<=11084||t>=11085&&t<=11123||t>=11124&&t<=11125||t>=11126&&t<=11157||t===11158||t>=11159&&t<=11263||t>=11776&&t<=11777||t===11778||t===11779||t===11780||t===11781||t>=11782&&t<=11784||t===11785||t===11786||t===11787||t===11788||t===11789||t>=11790&&t<=11798||t===11799||t>=11800&&t<=11801||t===11802||t===11803||t===11804||t===11805||t>=11806&&t<=11807||t===11808||t===11809||t===11810||t===11811||t===11812||t===11813||t===11814||t===11815||t===11816||t===11817||t>=11818&&t<=11822||t===11823||t>=11824&&t<=11833||t>=11834&&t<=11835||t>=11836&&t<=11839||t===11840||t===11841||t===11842||t>=11843&&t<=11855||t>=11856&&t<=11857||t===11858||t>=11859&&t<=11903||t>=12289&&t<=12291||t===12296||t===12297||t===12298||t===12299||t===12300||t===12301||t===12302||t===12303||t===12304||t===12305||t>=12306&&t<=12307||t===12308||t===12309||t===12310||t===12311||t===12312||t===12313||t===12314||t===12315||t===12316||t===12317||t>=12318&&t<=12319||t===12320||t===12336||t===64830||t===64831||t>=65093&&t<=65094}function Km(t){t.forEach(function(e){if(delete e.location,t8(e)||n8(e))for(var n in e.options)delete e.options[n].location,Km(e.options[n].value);else QT(e)&&l8(e.style)||(xT(e)||e8(e))&&qm(e.style)?delete e.style.location:i8(e)&&Km(e.children)})}function qj(t,e){e===void 0&&(e={}),e=vn({shouldParseSkeletons:!0,requiresOtherClause:!0},e);var n=new Fj(t,e).parse();if(n.err){var i=SyntaxError(an[n.err.kind]);throw i.location=n.err.location,i.originalMessage=n.err.message,i}return e!=null&&e.captureLocation||Km(n.val),n.val}function nm(t,e){var n=e&&e.cache?e.cache:$j,i=e&&e.serializer?e.serializer:Kj,l=e&&e.strategy?e.strategy:Yj;return l(t,{cache:n,serializer:i})}function jj(t){return t==null||typeof t=="number"||typeof t=="boolean"}function d8(t,e,n,i){var l=jj(i)?i:n(i),r=e.get(l);return typeof r>"u"&&(r=t.call(this,i),e.set(l,r)),r}function h8(t,e,n){var i=Array.prototype.slice.call(arguments,3),l=n(i),r=e.get(l);return typeof r>"u"&&(r=t.apply(this,i),e.set(l,r)),r}function J1(t,e,n,i,l){return n.bind(e,t,i,l)}function Yj(t,e){var n=t.length===1?d8:h8;return J1(t,this,n,e.cache.create(),e.serializer)}function Zj(t,e){return J1(t,this,h8,e.cache.create(),e.serializer)}function Xj(t,e){return J1(t,this,d8,e.cache.create(),e.serializer)}var Kj=function(){return JSON.stringify(arguments)};function Q1(){this.cache=Object.create(null)}Q1.prototype.get=function(t){return this.cache[t]};Q1.prototype.set=function(t,e){this.cache[t]=e};var $j={create:function(){return new Q1}},im={variadic:Zj,monadic:Xj},xo;(function(t){t.MISSING_VALUE="MISSING_VALUE",t.INVALID_VALUE="INVALID_VALUE",t.MISSING_INTL_API="MISSING_INTL_API"})(xo||(xo={}));var md=function(t){hd(e,t);function e(n,i,l){var r=t.call(this,n)||this;return r.code=i,r.originalMessage=l,r}return e.prototype.toString=function(){return"[formatjs Error: ".concat(this.code,"] ").concat(this.message)},e}(Error),Wk=function(t){hd(e,t);function e(n,i,l,r){return t.call(this,'Invalid values for "'.concat(n,'": "').concat(i,'". Options are "').concat(Object.keys(l).join('", "'),'"'),xo.INVALID_VALUE,r)||this}return e}(md),Jj=function(t){hd(e,t);function e(n,i,l){return t.call(this,'Value for "'.concat(n,'" must be of type ').concat(i),xo.INVALID_VALUE,l)||this}return e}(md),Qj=function(t){hd(e,t);function e(n,i){return t.call(this,'The intl string context variable "'.concat(n,'" was not provided to the string "').concat(i,'"'),xo.MISSING_VALUE,i)||this}return e}(md),Qi;(function(t){t[t.literal=0]="literal",t[t.object=1]="object"})(Qi||(Qi={}));function xj(t){return t.length<2?t:t.reduce(function(e,n){var i=e[e.length-1];return!i||i.type!==Qi.literal||n.type!==Qi.literal?e.push(n):i.value+=n.value,e},[])}function eY(t){return typeof t=="function"}function tc(t,e,n,i,l,r,s){if(t.length===1&&Bk(t[0]))return[{type:Qi.literal,value:t[0].value}];for(var o=[],a=0,u=t;a0?new Intl.Locale(n[0]):new Intl.Locale(typeof e=="string"?e:e[0])},t.__parse=qj,t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}();function lY(t,e){if(e==null)return;if(e in t)return t[e];const n=e.split(".");let i=t;for(let l=0;l0){const r=n.slice(l,n.length).join(".");if(r in i){i=i[r];break}}i=i[n[l]]}else i=void 0;return i}const bs={},rY=(t,e,n)=>n&&(e in bs||(bs[e]={}),t in bs[e]||(bs[e][t]=n),n),m8=(t,e)=>{if(e==null)return;if(e in bs&&t in bs[e])return bs[e][t];const n=Uu(e);for(let i=0;i(n[t]=mj.all([n[t]||{},...e]),n))}Ms([_a],([t])=>Object.keys(t));_a.subscribe(t=>x1=t);const su={};function fY(t){su[t]=new Set}function cY(t,e){su[t].delete(e),su[t].size===0&&delete su[t]}function ou(t){return su[t]}function dY(t){return Uu(t).map(e=>{const n=ou(e);return[e,n?[...n]:[]]}).filter(([,e])=>e.length>0)}function kc(t){return t==null?!1:Uu(t).some(e=>{var n;return(n=ou(e))==null?void 0:n.size})}function hY(t,e){return Promise.all(e.map(i=>(cY(t,i),i().then(l=>l.default||l)))).then(i=>uY(t,...i))}const qa={};function g8(t){if(!kc(t))return t in qa?qa[t]:Promise.resolve();const e=dY(t);return qa[t]=Promise.all(e.map(([n,i])=>hY(n,i))).then(()=>{if(kc(t))return g8(t);delete qa[t]}),qa[t]}function mY(t,e){ou(t)||fY(t);const n=ou(t);ou(t).has(e)||(e0(t)||_a.update(i=>(i[t]={},i)),n.add(e))}var qk=Object.getOwnPropertySymbols,gY=Object.prototype.hasOwnProperty,_Y=Object.prototype.propertyIsEnumerable,pY=(t,e)=>{var n={};for(var i in t)gY.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&qk)for(var i of qk(t))e.indexOf(i)<0&&_Y.call(t,i)&&(n[i]=t[i]);return n};const bY={number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}};function vY({locale:t,id:e}){console.warn(`[svelte-i18n] The message "${e}" was not found in "${Uu(t).join('", "')}".${kc(As())?` +`,xo.MISSING_INTL_API,s);var I=n.getPluralRules(e,{type:f.pluralType}).select(d-(f.offset||0));C=f.options[I]||f.options.other}if(!C)throw new Wk(f.value,d,Object.keys(f.options),s);o.push.apply(o,tc(C.value,e,n,i,l,d-(f.offset||0)));continue}}return xj(o)}function tY(t,e){return e?vn(vn(vn({},t||{}),e||{}),Object.keys(t).reduce(function(n,i){return n[i]=vn(vn({},t[i]),e[i]||{}),n},{})):t}function nY(t,e){return e?Object.keys(t).reduce(function(n,i){return n[i]=tY(t[i],e[i]),n},vn({},t)):t}function lm(t){return{create:function(){return{get:function(e){return t[e]},set:function(e,n){t[e]=n}}}}}function iY(t){return t===void 0&&(t={number:{},dateTime:{},pluralRules:{}}),{getNumberFormat:nm(function(){for(var e,n=[],i=0;i0?new Intl.Locale(n[0]):new Intl.Locale(typeof e=="string"?e:e[0])},t.__parse=qj,t.formats={number:{integer:{maximumFractionDigits:0},currency:{style:"currency"},percent:{style:"percent"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}},t}();function lY(t,e){if(e==null)return;if(e in t)return t[e];const n=e.split(".");let i=t;for(let l=0;l0){const r=n.slice(l,n.length).join(".");if(r in i){i=i[r];break}}i=i[n[l]]}else i=void 0;return i}const bs={},rY=(t,e,n)=>n&&(e in bs||(bs[e]={}),t in bs[e]||(bs[e][t]=n),n),g8=(t,e)=>{if(e==null)return;if(e in bs&&t in bs[e])return bs[e][t];const n=Uu(e);for(let i=0;i(n[t]=mj.all([n[t]||{},...e]),n))}Ms([_a],([t])=>Object.keys(t));_a.subscribe(t=>x1=t);const su={};function fY(t){su[t]=new Set}function cY(t,e){su[t].delete(e),su[t].size===0&&delete su[t]}function ou(t){return su[t]}function dY(t){return Uu(t).map(e=>{const n=ou(e);return[e,n?[...n]:[]]}).filter(([,e])=>e.length>0)}function kc(t){return t==null?!1:Uu(t).some(e=>{var n;return(n=ou(e))==null?void 0:n.size})}function hY(t,e){return Promise.all(e.map(i=>(cY(t,i),i().then(l=>l.default||l)))).then(i=>uY(t,...i))}const qa={};function _8(t){if(!kc(t))return t in qa?qa[t]:Promise.resolve();const e=dY(t);return qa[t]=Promise.all(e.map(([n,i])=>hY(n,i))).then(()=>{if(kc(t))return _8(t);delete qa[t]}),qa[t]}function mY(t,e){ou(t)||fY(t);const n=ou(t);ou(t).has(e)||(e0(t)||_a.update(i=>(i[t]={},i)),n.add(e))}var qk=Object.getOwnPropertySymbols,gY=Object.prototype.hasOwnProperty,_Y=Object.prototype.propertyIsEnumerable,pY=(t,e)=>{var n={};for(var i in t)gY.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&qk)for(var i of qk(t))e.indexOf(i)<0&&_Y.call(t,i)&&(n[i]=t[i]);return n};const bY={number:{scientific:{notation:"scientific"},engineering:{notation:"engineering"},compactLong:{notation:"compact",compactDisplay:"long"},compactShort:{notation:"compact",compactDisplay:"short"}},date:{short:{month:"numeric",day:"numeric",year:"2-digit"},medium:{month:"short",day:"numeric",year:"numeric"},long:{month:"long",day:"numeric",year:"numeric"},full:{weekday:"long",month:"long",day:"numeric",year:"numeric"}},time:{short:{hour:"numeric",minute:"numeric"},medium:{hour:"numeric",minute:"numeric",second:"numeric"},long:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"},full:{hour:"numeric",minute:"numeric",second:"numeric",timeZoneName:"short"}}};function vY({locale:t,id:e}){console.warn(`[svelte-i18n] The message "${e}" was not found in "${Uu(t).join('", "')}".${kc(As())?` -Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const kY={fallbackLocale:null,loadingDelay:200,formats:bY,warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0},eu=kY;function ea(){return eu}function wY(t){const e=t,{formats:n}=e,i=pY(e,["formats"]);let l=t.fallbackLocale;if(t.initialLocale)try{h8.resolveLocale(t.initialLocale)&&(l=t.initialLocale)}catch{console.warn(`[svelte-i18n] The initial locale "${t.initialLocale}" is not a valid locale.`)}return i.warnOnMissingMessages&&(delete i.warnOnMissingMessages,i.handleMissingMessage==null?i.handleMissingMessage=vY:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(eu,i,{initialLocale:l}),n&&("number"in n&&Object.assign(eu.formats.number,n.number),"date"in n&&Object.assign(eu.formats.date,n.date),"time"in n&&Object.assign(eu.formats.time,n.time)),pa.set(l)}const rm=un(!1);var yY=Object.defineProperty,TY=Object.defineProperties,SY=Object.getOwnPropertyDescriptors,jk=Object.getOwnPropertySymbols,EY=Object.prototype.hasOwnProperty,MY=Object.prototype.propertyIsEnumerable,Yk=(t,e,n)=>e in t?yY(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,OY=(t,e)=>{for(var n in e||(e={}))EY.call(e,n)&&Yk(t,n,e[n]);if(jk)for(var n of jk(e))MY.call(e,n)&&Yk(t,n,e[n]);return t},AY=(t,e)=>TY(t,SY(e));let $m;const wc=un(null);function Zk(t){return t.split("-").map((e,n,i)=>i.slice(0,n+1).join("-")).reverse()}function Uu(t,e=ea().fallbackLocale){const n=Zk(t);return e?[...new Set([...n,...Zk(e)])]:n}function As(){return $m??void 0}wc.subscribe(t=>{$m=t??void 0,typeof window<"u"&&t!=null&&document.documentElement.setAttribute("lang",t)});const CY=t=>{if(t&&aY(t)&&kc(t)){const{loadingDelay:e}=ea();let n;return typeof window<"u"&&As()!=null&&e?n=window.setTimeout(()=>rm.set(!0),e):rm.set(!0),g8(t).then(()=>{wc.set(t)}).finally(()=>{clearTimeout(n),rm.set(!1)})}return wc.set(t)},pa=AY(OY({},wc),{set:CY}),gd=t=>{const e=Object.create(null);return i=>{const l=JSON.stringify(i);return l in e?e[l]:e[l]=t(i)}};var LY=Object.defineProperty,yc=Object.getOwnPropertySymbols,_8=Object.prototype.hasOwnProperty,p8=Object.prototype.propertyIsEnumerable,Xk=(t,e,n)=>e in t?LY(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,t0=(t,e)=>{for(var n in e||(e={}))_8.call(e,n)&&Xk(t,n,e[n]);if(yc)for(var n of yc(e))p8.call(e,n)&&Xk(t,n,e[n]);return t},ba=(t,e)=>{var n={};for(var i in t)_8.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&yc)for(var i of yc(t))e.indexOf(i)<0&&p8.call(t,i)&&(n[i]=t[i]);return n};const pu=(t,e)=>{const{formats:n}=ea();if(t in n&&e in n[t])return n[t][e];throw new Error(`[svelte-i18n] Unknown "${e}" ${t} format.`)},IY=gd(t=>{var e=t,{locale:n,format:i}=e,l=ba(e,["locale","format"]);if(n==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return i&&(l=pu("number",i)),new Intl.NumberFormat(n,l)}),RY=gd(t=>{var e=t,{locale:n,format:i}=e,l=ba(e,["locale","format"]);if(n==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return i?l=pu("date",i):Object.keys(l).length===0&&(l=pu("date","short")),new Intl.DateTimeFormat(n,l)}),DY=gd(t=>{var e=t,{locale:n,format:i}=e,l=ba(e,["locale","format"]);if(n==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return i?l=pu("time",i):Object.keys(l).length===0&&(l=pu("time","short")),new Intl.DateTimeFormat(n,l)}),PY=(t={})=>{var e=t,{locale:n=As()}=e,i=ba(e,["locale"]);return IY(t0({locale:n},i))},NY=(t={})=>{var e=t,{locale:n=As()}=e,i=ba(e,["locale"]);return RY(t0({locale:n},i))},BY=(t={})=>{var e=t,{locale:n=As()}=e,i=ba(e,["locale"]);return DY(t0({locale:n},i))},zY=gd((t,e=As())=>new h8(t,e,ea().formats,{ignoreTag:ea().ignoreTag})),HY=(t,e={})=>{var n,i,l,r;let s=e;typeof t=="object"&&(s=t,t=s.id);const{values:o,locale:a=As(),default:u}=s;if(a==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let f=m8(t,a);if(!f)f=(r=(l=(i=(n=ea()).handleMissingMessage)==null?void 0:i.call(n,{locale:a,id:t,defaultValue:u}))!=null?l:u)!=null?r:t;else if(typeof f!="string")return console.warn(`[svelte-i18n] Message with id "${t}" must be of type "string", found: "${typeof f}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),f;if(!o)return f;let c=f;try{c=zY(f,a).format(o)}catch(d){d instanceof Error&&console.warn(`[svelte-i18n] Message "${t}" has syntax error:`,d.message)}return c},UY=(t,e)=>BY(e).format(t),FY=(t,e)=>NY(e).format(t),GY=(t,e)=>PY(e).format(t),VY=(t,e=As())=>m8(t,e),ii=Ms([pa,_a],()=>HY);Ms([pa],()=>UY);Ms([pa],()=>FY);Ms([pa],()=>GY);Ms([pa,_a],()=>VY);function WY(t){let e,n,i=t[0]("Download Certificate")+"",l,r;return n=new XW({props:{style:"position:relative;top:3px"}}),{c(){e=R("a"),F(n.$$.fragment),l=q(i),P(e,"href",t[1]),P(e,"target","_blank")},m(s,o){y(s,e,o),H(n,e,null),T(e,l),r=!0},p(s,[o]){(!r||o&1)&&i!==(i=s[0]("Download Certificate")+"")&&Z(l,i)},i(s){r||(b(n.$$.fragment,s),r=!0)},o(s){k(n.$$.fragment,s),r=!1},d(s){s&&w(e),U(n)}}}function qY(t,e,n){let i;return Mt(t,ii,r=>n(0,i=r)),[i,"/api/files/certificate"]}class b8 extends De{constructor(e){super(),Re(this,e,qY,WY,Ie,{})}}function jY(t){let e,n,i,l,r,s,o,a;return n=new DT({props:{$$slots:{default:[JY]},$$scope:{ctx:t}}}),n.$on("submit",t[6]),o=new b8({}),{c(){e=R("div"),F(n.$$.fragment),i=B(),l=R("div"),r=R("br"),s=B(),F(o.$$.fragment),wt(e,"border","1px solid"),wt(e,"max-width","25rem"),wt(e,"background","white"),wt(e,"margin","0 auto"),wt(e,"margin-top","25vh"),P(l,"class","text-center")},m(u,f){y(u,e,f),H(n,e,null),y(u,i,f),y(u,l,f),T(l,r),T(l,s),H(o,l,null),a=!0},p(u,f){const c={};f&4155&&(c.$$scope={dirty:f,ctx:u}),n.$set(c)},i(u){a||(b(n.$$.fragment,u),b(o.$$.fragment,u),a=!0)},o(u){k(n.$$.fragment,u),k(o.$$.fragment,u),a=!1},d(u){u&&(w(e),w(i),w(l)),U(n),U(o)}}}function YY(t){let e;return{c(){e=q("Redirecting")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function ZY(t){let e;return{c(){e=q("Cancel")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function XY(t){let e;return{c(){e=q("Submit")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function KY(t){let e,n,i,l,r,s;return e=new Rt({props:{size:"lg",kind:"secondary",icon:VW,style:"width:100%",disabled:!t[3],$$slots:{default:[ZY]},$$scope:{ctx:t}}}),e.$on("click",t[7]),i=new zn({}),r=new Rt({props:{size:"lg",type:"submit",icon:BW,style:"width:100%",$$slots:{default:[XY]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){H(e,o,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,a){const u={};a&8&&(u.disabled=!o[3]),a&4096&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a&4096&&(f.$$scope={dirty:a,ctx:o}),r.$set(f)},i(o){s||(b(e.$$.fragment,o),b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(e.$$.fragment,o),k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(n),w(l)),U(e,o),U(i,o),U(r,o)}}}function $Y(t){let e,n,i,l,r,s,o,a,u,f;function c(_){t[8](_)}let d={invalid:t[5],labelText:"User name",placeholder:"Enter user name...",required:!0,invalidText:t[4]};t[0]!==void 0&&(d.value=t[0]),i=new Jn({props:d}),ft.push(()=>Yt(i,"value",c));function h(_){t[9](_)}let g={invalid:t[5],required:!0,type:"password",labelText:"Password",placeholder:"Enter password...",invalidText:t[4]};return t[1]!==void 0&&(g.value=t[1]),s=new zm({props:g}),ft.push(()=>Yt(s,"value",h)),u=new VR({props:{style:"align-items:right ",$$slots:{default:[KY]},$$scope:{ctx:t}}}),{c(){e=R("h2"),e.textContent="Login",n=B(),F(i.$$.fragment),r=B(),F(s.$$.fragment),a=B(),F(u.$$.fragment),wt(e,"margin-bottom","20px"),wt(e,"margin-left","15px"),wt(e,"margin-top","25px")},m(_,v){y(_,e,v),y(_,n,v),H(i,_,v),y(_,r,v),H(s,_,v),y(_,a,v),H(u,_,v),f=!0},p(_,v){const S={};v&32&&(S.invalid=_[5]),v&16&&(S.invalidText=_[4]),!l&&v&1&&(l=!0,S.value=_[0],jt(()=>l=!1)),i.$set(S);const A={};v&32&&(A.invalid=_[5]),v&16&&(A.invalidText=_[4]),!o&&v&2&&(o=!0,A.value=_[1],jt(()=>o=!1)),s.$set(A);const C={};v&4104&&(C.$$scope={dirty:v,ctx:_}),u.$set(C)},i(_){f||(b(i.$$.fragment,_),b(s.$$.fragment,_),b(u.$$.fragment,_),f=!0)},o(_){k(i.$$.fragment,_),k(s.$$.fragment,_),k(u.$$.fragment,_),f=!1},d(_){_&&(w(e),w(n),w(r),w(a)),U(i,_),U(s,_),U(u,_)}}}function JY(t){let e,n;return e=new zn({props:{style:"text-align:left;",$$slots:{default:[$Y]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4155&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function QY(t){let e,n,i,l;const r=[YY,jY],s=[];function o(a,u){return a[2].api.loggedIn?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function xY(t){let e,n;return e=new zn({props:{$$slots:{default:[QY]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4159&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function eZ(t){let e,n;return e=new dl({props:{noGutter:!0,style:"",$$slots:{default:[xY]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4159&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function tZ(t){let e,n;return e=new PT({props:{noGutter:!0,style:"",$$slots:{default:[eZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&4159&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function nZ(t,e,n){let i,l;Mt(t,An,_=>n(2,i=_)),Mt(t,ii,_=>n(11,l=_));let r="",s="",o=!0,a=!1,u="",f=!1;_n(async()=>{localStorage.removeItem("password"),localStorage.removeItem("rememberMe");try{const _=await fetch(ni()+"/api/setup/status");if(!_.ok)return;(await _.json()).complete||Vi("/setup")}catch{}});let c=_=>{_.preventDefault();var v={username:r,pass:s};i.api.doCall("/auth/token","post",v).then(function(S){if(S==null||S==null){ci.add(ao({subtitle:l("Unable to get a correct response from the api")},l));return}else(S==null?void 0:S.Validated)===!0||(S==null?void 0:S.Validated)==="true"?(localStorage.removeItem("jwt"),localStorage.setItem("jwt",S.Jwtoken),An.loginSuccesful(S.Jwtoken,S.Username||"")):(n(4,u=l("Invalid username or password")),n(5,f=!0))})};const d=()=>{n(0,r=""),n(1,s="")};Cl(()=>{a&&Vi("/")});function h(_){r=_,n(0,r)}function g(_){s=_,n(1,s)}return t.$$.update=()=>{t.$$.dirty&7&&(n(3,o=r.length>0||s.length>0),a=i.api.loggedIn)},[r,s,i,o,u,f,c,d,h,g]}class iZ extends De{constructor(e){super(),Re(this,e,nZ,tZ,Ie,{})}}const Tc=12,Sc=72;function v8(t){return new TextEncoder().encode(t).length}function lZ(t){const e=v8(t);return e>=Tc&&e<=Sc}function Kk(t){let e,n;return{c(){e=R("p"),n=q(t[6]),P(e,"class","error svelte-iacvtb"),P(e,"role","alert")},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&64&&Z(n,i[6])},d(i){i&&w(e)}}}function $k(t){let e,n;return e=new Rt({props:{type:"button",kind:"secondary",$$slots:{default:[rZ]},$$scope:{ctx:t}}}),e.$on("click",t[12]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1048576&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function rZ(t){let e;return{c(){e=q("Retry status check")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Jk(t){let e,n;return{c(){e=R("p"),n=q(t[10]),P(e,"class","hint svelte-iacvtb"),P(e,"aria-live","polite")},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&1024&&Z(n,i[10])},d(i){i&&w(e)}}}function sZ(t){let e;return{c(){e=q("Complete setup")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function oZ(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M=t[6]&&Kk(t),L=t[9]&&$k(t);function N(Q){t[17](Q)}let z={required:!0,autocomplete:"username",labelText:"Administrator username"};t[0]!==void 0&&(z.value=t[0]),o=new Jn({props:z}),ft.push(()=>Yt(o,"value",N));function W(Q){t[18](Q)}let D={required:!0,autocomplete:"new-password",labelText:"Password",helperText:`Use ${Tc} to ${Sc} UTF-8 bytes.`,invalid:t[5],invalidText:t[4]};t[1]!==void 0&&(D.value=t[1]),f=new zm({props:D}),ft.push(()=>Yt(f,"value",W));function G(Q){t[19](Q)}let $={required:!0,autocomplete:"new-password",labelText:"Confirm password",invalid:t[3],invalidText:"Passwords do not match."};t[2]!==void 0&&($.value=t[2]),h=new zm({props:$}),ft.push(()=>Yt(h,"value",G));let j=t[8]&&t[10]&&Jk(t);return C=new Rt({props:{type:"submit",disabled:!t[8]||t[7]||t[11]!=="",$$slots:{default:[sZ]},$$scope:{ctx:t}}}),{c(){e=R("h2"),e.textContent="Set up GateSentry",n=B(),i=R("p"),i.textContent="Create the administrator account for this installation.",l=B(),M&&M.c(),r=B(),L&&L.c(),s=B(),F(o.$$.fragment),u=B(),F(f.$$.fragment),d=B(),F(h.$$.fragment),_=B(),v=R("br"),S=B(),j&&j.c(),A=B(),F(C.$$.fragment),P(e,"class","svelte-iacvtb"),P(i,"class","svelte-iacvtb")},m(Q,le){y(Q,e,le),y(Q,n,le),y(Q,i,le),y(Q,l,le),M&&M.m(Q,le),y(Q,r,le),L&&L.m(Q,le),y(Q,s,le),H(o,Q,le),y(Q,u,le),H(f,Q,le),y(Q,d,le),H(h,Q,le),y(Q,_,le),y(Q,v,le),y(Q,S,le),j&&j.m(Q,le),y(Q,A,le),H(C,Q,le),I=!0},p(Q,le){Q[6]?M?M.p(Q,le):(M=Kk(Q),M.c(),M.m(r.parentNode,r)):M&&(M.d(1),M=null),Q[9]?L?(L.p(Q,le),le&512&&b(L,1)):(L=$k(Q),L.c(),b(L,1),L.m(s.parentNode,s)):L&&(fe(),k(L,1,1,()=>{L=null}),ce());const oe={};!a&&le&1&&(a=!0,oe.value=Q[0],jt(()=>a=!1)),o.$set(oe);const X={};le&32&&(X.invalid=Q[5]),le&16&&(X.invalidText=Q[4]),!c&&le&2&&(c=!0,X.value=Q[1],jt(()=>c=!1)),f.$set(X);const de={};le&8&&(de.invalid=Q[3]),!g&&le&4&&(g=!0,de.value=Q[2],jt(()=>g=!1)),h.$set(de),Q[8]&&Q[10]?j?j.p(Q,le):(j=Jk(Q),j.c(),j.m(A.parentNode,A)):j&&(j.d(1),j=null);const re={};le&2432&&(re.disabled=!Q[8]||Q[7]||Q[11]!==""),le&1048576&&(re.$$scope={dirty:le,ctx:Q}),C.$set(re)},i(Q){I||(b(L),b(o.$$.fragment,Q),b(f.$$.fragment,Q),b(h.$$.fragment,Q),b(C.$$.fragment,Q),I=!0)},o(Q){k(L),k(o.$$.fragment,Q),k(f.$$.fragment,Q),k(h.$$.fragment,Q),k(C.$$.fragment,Q),I=!1},d(Q){Q&&(w(e),w(n),w(i),w(l),w(r),w(s),w(u),w(d),w(_),w(v),w(S),w(A)),M&&M.d(Q),L&&L.d(Q),U(o,Q),U(f,Q),U(h,Q),j&&j.d(Q),U(C,Q)}}}function aZ(t){let e,n;return e=new zn({props:{$$slots:{default:[oZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1052671&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function uZ(t){let e,n,i;return n=new DT({props:{$$slots:{default:[aZ]},$$scope:{ctx:t}}}),n.$on("submit",t[13]),{c(){e=R("div"),F(n.$$.fragment),P(e,"class","setup-card svelte-iacvtb")},m(l,r){y(l,e,r),H(n,e,null),i=!0},p(l,r){const s={};r&1052671&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(b(n.$$.fragment,l),i=!0)},o(l){k(n.$$.fragment,l),i=!1},d(l){l&&w(e),U(n)}}}function fZ(t){let e,n;return e=new zn({props:{$$slots:{default:[uZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1052671&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function cZ(t){let e,n;return e=new dl({props:{noGutter:!0,$$slots:{default:[fZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1052671&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function dZ(t){let e,n;return e=new PT({props:{noGutter:!0,$$slots:{default:[cZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&1052671&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function hZ(t,e,n){let i,l,r,s,o,a,u,f,c="",d="",h="",g="",_=!1,v=!1,S=!1;async function A(){n(9,S=!1),n(6,g="");try{const N=await fetch(ni()+"/api/setup/status");if(!N.ok)throw new Error("setup status failed");if((await N.json()).complete){Vi("/login");return}n(8,v=!0)}catch{n(9,S=!0),n(6,g="Unable to read setup status.")}}A();async function C(N){if(N.preventDefault(),n(6,g=""),!l){n(6,g=`Password must contain between ${Tc} and ${Sc} UTF-8 bytes.`);return}if(d!==h){n(6,g="Passwords do not match.");return}n(7,_=!0);try{const z=await fetch(ni()+"/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:c,password:d})});if(!z.ok){n(6,g=z.status===409?"Setup was already completed. Sign in instead.":"Setup could not be completed.");return}n(1,d=""),n(2,h=""),window.location.assign(ni()+"/login")}catch{n(6,g="Unable to contact GateSentry.")}finally{n(7,_=!1)}}function I(N){c=N,n(0,c)}function M(N){d=N,n(1,d)}function L(N){h=N,n(2,h)}return t.$$.update=()=>{t.$$.dirty&2&&n(16,i=v8(d)),t.$$.dirty&2&&n(14,l=lZ(d)),t.$$.dirty&16386&&n(5,r=d.length>0&&!l),t.$$.dirty&65536&&n(4,s=`Password must contain between ${Tc} and ${Sc} UTF-8 bytes (currently ${i}).`),t.$$.dirty&6&&n(3,o=h.length>0&&d!==h),t.$$.dirty&63&&n(15,a=c?d.length===0?{message:"Enter a password.",field:""}:r?{message:s,field:"password"}:h.length===0?{message:"Re-enter the password to confirm it.",field:""}:o?{message:"Passwords do not match.",field:"confirmation"}:{message:"",field:""}:{message:"Enter an administrator username.",field:""}),t.$$.dirty&32768&&n(11,u=a.message),t.$$.dirty&32768&&n(10,f=a.field===""?a.message:"")},[c,d,h,o,s,r,g,_,v,S,f,u,A,C,l,a,i,I,M,L]}class mZ extends De{constructor(e){super(),Re(this,e,hZ,dZ,Ie,{})}}var gZ=["second","minute","hour","day","week","month","year"];function _Z(t,e){if(e===0)return["just now","right now"];var n=gZ[Math.floor(e/2)];return t>1&&(n+="s"),[t+" "+n+" ago","in "+t+" "+n]}var pZ=["秒","分钟","小时","天","周","个月","年"];function bZ(t,e){if(e===0)return["刚刚","片刻后"];var n=pZ[~~(e/2)];return[t+" "+n+"前",t+" "+n+"后"]}var Jm={},k8=function(t,e){Jm[t]=e},vZ=function(t){return Jm[t]||Jm.en_US},sm=[60,60,24,7,365/7/12,12];function Qk(t){return t instanceof Date?t:!isNaN(t)||/^\d+$/.test(t)?new Date(parseInt(t)):(t=(t||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(t))}function kZ(t,e){var n=t<0?1:0;t=Math.abs(t);for(var i=t,l=0;t>=sm[l]&&l(l===0?9:1)&&(l+=1),e(t,l,i)[n].replace("%s",t.toString())}function wZ(t,e){var n=e?Qk(e):new Date;return(+n-+Qk(t))/1e3}var yZ=function(t,e,n){var i=wZ(t,n&&n.relativeDate);return kZ(i,vZ(e))};k8("en_US",_Z);k8("zh_CN",bZ);function TZ(t){var i;const e=new Map,n=new Map;for(const l of t||[])for(const r of new Set([l.ipv4,l.ipv6].filter(Boolean)))n.set(r,(n.get(r)||0)+1);for(const l of t||[]){const r=(i=l.manual_name)==null?void 0:i.trim();if(r)for(const s of new Set([l.ipv4,l.ipv6].filter(Boolean)))n.get(s)===1&&e.set(s,r)}return e}function SZ(t,e){const n=t.get(e);return n?`${n} (${e})`:e}var Ec={exports:{}};/** +Note: there are at least one loader still registered to this locale that wasn't executed.`:""}`)}const kY={fallbackLocale:null,loadingDelay:200,formats:bY,warnOnMissingMessages:!0,handleMissingMessage:void 0,ignoreTag:!0},eu=kY;function ea(){return eu}function wY(t){const e=t,{formats:n}=e,i=pY(e,["formats"]);let l=t.fallbackLocale;if(t.initialLocale)try{m8.resolveLocale(t.initialLocale)&&(l=t.initialLocale)}catch{console.warn(`[svelte-i18n] The initial locale "${t.initialLocale}" is not a valid locale.`)}return i.warnOnMissingMessages&&(delete i.warnOnMissingMessages,i.handleMissingMessage==null?i.handleMissingMessage=vY:console.warn('[svelte-i18n] The "warnOnMissingMessages" option is deprecated. Please use the "handleMissingMessage" option instead.')),Object.assign(eu,i,{initialLocale:l}),n&&("number"in n&&Object.assign(eu.formats.number,n.number),"date"in n&&Object.assign(eu.formats.date,n.date),"time"in n&&Object.assign(eu.formats.time,n.time)),pa.set(l)}const rm=un(!1);var yY=Object.defineProperty,TY=Object.defineProperties,SY=Object.getOwnPropertyDescriptors,jk=Object.getOwnPropertySymbols,EY=Object.prototype.hasOwnProperty,MY=Object.prototype.propertyIsEnumerable,Yk=(t,e,n)=>e in t?yY(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,OY=(t,e)=>{for(var n in e||(e={}))EY.call(e,n)&&Yk(t,n,e[n]);if(jk)for(var n of jk(e))MY.call(e,n)&&Yk(t,n,e[n]);return t},AY=(t,e)=>TY(t,SY(e));let $m;const wc=un(null);function Zk(t){return t.split("-").map((e,n,i)=>i.slice(0,n+1).join("-")).reverse()}function Uu(t,e=ea().fallbackLocale){const n=Zk(t);return e?[...new Set([...n,...Zk(e)])]:n}function As(){return $m??void 0}wc.subscribe(t=>{$m=t??void 0,typeof window<"u"&&t!=null&&document.documentElement.setAttribute("lang",t)});const CY=t=>{if(t&&aY(t)&&kc(t)){const{loadingDelay:e}=ea();let n;return typeof window<"u"&&As()!=null&&e?n=window.setTimeout(()=>rm.set(!0),e):rm.set(!0),_8(t).then(()=>{wc.set(t)}).finally(()=>{clearTimeout(n),rm.set(!1)})}return wc.set(t)},pa=AY(OY({},wc),{set:CY}),gd=t=>{const e=Object.create(null);return i=>{const l=JSON.stringify(i);return l in e?e[l]:e[l]=t(i)}};var LY=Object.defineProperty,yc=Object.getOwnPropertySymbols,p8=Object.prototype.hasOwnProperty,b8=Object.prototype.propertyIsEnumerable,Xk=(t,e,n)=>e in t?LY(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,t0=(t,e)=>{for(var n in e||(e={}))p8.call(e,n)&&Xk(t,n,e[n]);if(yc)for(var n of yc(e))b8.call(e,n)&&Xk(t,n,e[n]);return t},ba=(t,e)=>{var n={};for(var i in t)p8.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(t!=null&&yc)for(var i of yc(t))e.indexOf(i)<0&&b8.call(t,i)&&(n[i]=t[i]);return n};const pu=(t,e)=>{const{formats:n}=ea();if(t in n&&e in n[t])return n[t][e];throw new Error(`[svelte-i18n] Unknown "${e}" ${t} format.`)},IY=gd(t=>{var e=t,{locale:n,format:i}=e,l=ba(e,["locale","format"]);if(n==null)throw new Error('[svelte-i18n] A "locale" must be set to format numbers');return i&&(l=pu("number",i)),new Intl.NumberFormat(n,l)}),RY=gd(t=>{var e=t,{locale:n,format:i}=e,l=ba(e,["locale","format"]);if(n==null)throw new Error('[svelte-i18n] A "locale" must be set to format dates');return i?l=pu("date",i):Object.keys(l).length===0&&(l=pu("date","short")),new Intl.DateTimeFormat(n,l)}),DY=gd(t=>{var e=t,{locale:n,format:i}=e,l=ba(e,["locale","format"]);if(n==null)throw new Error('[svelte-i18n] A "locale" must be set to format time values');return i?l=pu("time",i):Object.keys(l).length===0&&(l=pu("time","short")),new Intl.DateTimeFormat(n,l)}),PY=(t={})=>{var e=t,{locale:n=As()}=e,i=ba(e,["locale"]);return IY(t0({locale:n},i))},NY=(t={})=>{var e=t,{locale:n=As()}=e,i=ba(e,["locale"]);return RY(t0({locale:n},i))},BY=(t={})=>{var e=t,{locale:n=As()}=e,i=ba(e,["locale"]);return DY(t0({locale:n},i))},zY=gd((t,e=As())=>new m8(t,e,ea().formats,{ignoreTag:ea().ignoreTag})),HY=(t,e={})=>{var n,i,l,r;let s=e;typeof t=="object"&&(s=t,t=s.id);const{values:o,locale:a=As(),default:u}=s;if(a==null)throw new Error("[svelte-i18n] Cannot format a message without first setting the initial locale.");let f=g8(t,a);if(!f)f=(r=(l=(i=(n=ea()).handleMissingMessage)==null?void 0:i.call(n,{locale:a,id:t,defaultValue:u}))!=null?l:u)!=null?r:t;else if(typeof f!="string")return console.warn(`[svelte-i18n] Message with id "${t}" must be of type "string", found: "${typeof f}". Gettin its value through the "$format" method is deprecated; use the "json" method instead.`),f;if(!o)return f;let c=f;try{c=zY(f,a).format(o)}catch(d){d instanceof Error&&console.warn(`[svelte-i18n] Message "${t}" has syntax error:`,d.message)}return c},UY=(t,e)=>BY(e).format(t),FY=(t,e)=>NY(e).format(t),GY=(t,e)=>PY(e).format(t),VY=(t,e=As())=>g8(t,e),ii=Ms([pa,_a],()=>HY);Ms([pa],()=>UY);Ms([pa],()=>FY);Ms([pa],()=>GY);Ms([pa,_a],()=>VY);function WY(t){let e,n,i=t[0]("Download Certificate")+"",l,r;return n=new XW({props:{style:"position:relative;top:3px"}}),{c(){e=R("a"),F(n.$$.fragment),l=q(i),P(e,"href",t[1]),P(e,"target","_blank")},m(s,o){y(s,e,o),H(n,e,null),T(e,l),r=!0},p(s,[o]){(!r||o&1)&&i!==(i=s[0]("Download Certificate")+"")&&Z(l,i)},i(s){r||(b(n.$$.fragment,s),r=!0)},o(s){k(n.$$.fragment,s),r=!1},d(s){s&&w(e),U(n)}}}function qY(t,e,n){let i;return Mt(t,ii,r=>n(0,i=r)),[i,"/api/files/certificate"]}class v8 extends De{constructor(e){super(),Re(this,e,qY,WY,Ie,{})}}function jY(t){let e,n,i,l,r,s,o,a;return n=new PT({props:{$$slots:{default:[JY]},$$scope:{ctx:t}}}),n.$on("submit",t[6]),o=new v8({}),{c(){e=R("div"),F(n.$$.fragment),i=B(),l=R("div"),r=R("br"),s=B(),F(o.$$.fragment),wt(e,"border","1px solid"),wt(e,"max-width","25rem"),wt(e,"background","white"),wt(e,"margin","0 auto"),wt(e,"margin-top","25vh"),P(l,"class","text-center")},m(u,f){y(u,e,f),H(n,e,null),y(u,i,f),y(u,l,f),T(l,r),T(l,s),H(o,l,null),a=!0},p(u,f){const c={};f&4155&&(c.$$scope={dirty:f,ctx:u}),n.$set(c)},i(u){a||(b(n.$$.fragment,u),b(o.$$.fragment,u),a=!0)},o(u){k(n.$$.fragment,u),k(o.$$.fragment,u),a=!1},d(u){u&&(w(e),w(i),w(l)),U(n),U(o)}}}function YY(t){let e;return{c(){e=q("Redirecting")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function ZY(t){let e;return{c(){e=q("Cancel")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function XY(t){let e;return{c(){e=q("Submit")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function KY(t){let e,n,i,l,r,s;return e=new Rt({props:{size:"lg",kind:"secondary",icon:VW,style:"width:100%",disabled:!t[3],$$slots:{default:[ZY]},$$scope:{ctx:t}}}),e.$on("click",t[7]),i=new zn({}),r=new Rt({props:{size:"lg",type:"submit",icon:BW,style:"width:100%",$$slots:{default:[XY]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){H(e,o,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,a){const u={};a&8&&(u.disabled=!o[3]),a&4096&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a&4096&&(f.$$scope={dirty:a,ctx:o}),r.$set(f)},i(o){s||(b(e.$$.fragment,o),b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(e.$$.fragment,o),k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(n),w(l)),U(e,o),U(i,o),U(r,o)}}}function $Y(t){let e,n,i,l,r,s,o,a,u,f;function c(_){t[8](_)}let d={invalid:t[5],labelText:"User name",placeholder:"Enter user name...",required:!0,invalidText:t[4]};t[0]!==void 0&&(d.value=t[0]),i=new Jn({props:d}),ft.push(()=>Yt(i,"value",c));function h(_){t[9](_)}let g={invalid:t[5],required:!0,type:"password",labelText:"Password",placeholder:"Enter password...",invalidText:t[4]};return t[1]!==void 0&&(g.value=t[1]),s=new zm({props:g}),ft.push(()=>Yt(s,"value",h)),u=new VR({props:{style:"align-items:right ",$$slots:{default:[KY]},$$scope:{ctx:t}}}),{c(){e=R("h2"),e.textContent="Login",n=B(),F(i.$$.fragment),r=B(),F(s.$$.fragment),a=B(),F(u.$$.fragment),wt(e,"margin-bottom","20px"),wt(e,"margin-left","15px"),wt(e,"margin-top","25px")},m(_,v){y(_,e,v),y(_,n,v),H(i,_,v),y(_,r,v),H(s,_,v),y(_,a,v),H(u,_,v),f=!0},p(_,v){const S={};v&32&&(S.invalid=_[5]),v&16&&(S.invalidText=_[4]),!l&&v&1&&(l=!0,S.value=_[0],jt(()=>l=!1)),i.$set(S);const A={};v&32&&(A.invalid=_[5]),v&16&&(A.invalidText=_[4]),!o&&v&2&&(o=!0,A.value=_[1],jt(()=>o=!1)),s.$set(A);const C={};v&4104&&(C.$$scope={dirty:v,ctx:_}),u.$set(C)},i(_){f||(b(i.$$.fragment,_),b(s.$$.fragment,_),b(u.$$.fragment,_),f=!0)},o(_){k(i.$$.fragment,_),k(s.$$.fragment,_),k(u.$$.fragment,_),f=!1},d(_){_&&(w(e),w(n),w(r),w(a)),U(i,_),U(s,_),U(u,_)}}}function JY(t){let e,n;return e=new zn({props:{style:"text-align:left;",$$slots:{default:[$Y]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4155&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function QY(t){let e,n,i,l;const r=[YY,jY],s=[];function o(a,u){return a[2].api.loggedIn?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function xY(t){let e,n;return e=new zn({props:{$$slots:{default:[QY]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4159&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function eZ(t){let e,n;return e=new dl({props:{noGutter:!0,style:"",$$slots:{default:[xY]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4159&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function tZ(t){let e,n;return e=new NT({props:{noGutter:!0,style:"",$$slots:{default:[eZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&4159&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function nZ(t,e,n){let i,l;Mt(t,An,_=>n(2,i=_)),Mt(t,ii,_=>n(11,l=_));let r="",s="",o=!0,a=!1,u="",f=!1;_n(async()=>{localStorage.removeItem("password"),localStorage.removeItem("rememberMe");try{const _=await fetch(ni()+"/api/setup/status");if(!_.ok)return;(await _.json()).complete||Vi("/setup")}catch{}});let c=_=>{_.preventDefault();var v={username:r,pass:s};i.api.doCall("/auth/token","post",v).then(function(S){if(S==null||S==null){ci.add(ao({subtitle:l("Unable to get a correct response from the api")},l));return}else(S==null?void 0:S.Validated)===!0||(S==null?void 0:S.Validated)==="true"?(localStorage.removeItem("jwt"),localStorage.setItem("jwt",S.Jwtoken),An.loginSuccesful(S.Jwtoken,S.Username||"")):(n(4,u=l("Invalid username or password")),n(5,f=!0))})};const d=()=>{n(0,r=""),n(1,s="")};Cl(()=>{a&&Vi("/")});function h(_){r=_,n(0,r)}function g(_){s=_,n(1,s)}return t.$$.update=()=>{t.$$.dirty&7&&(n(3,o=r.length>0||s.length>0),a=i.api.loggedIn)},[r,s,i,o,u,f,c,d,h,g]}class iZ extends De{constructor(e){super(),Re(this,e,nZ,tZ,Ie,{})}}const Tc=12,Sc=72;function k8(t){return new TextEncoder().encode(t).length}function lZ(t){const e=k8(t);return e>=Tc&&e<=Sc}function Kk(t){let e,n;return{c(){e=R("p"),n=q(t[6]),P(e,"class","error svelte-iacvtb"),P(e,"role","alert")},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&64&&Z(n,i[6])},d(i){i&&w(e)}}}function $k(t){let e,n;return e=new Rt({props:{type:"button",kind:"secondary",$$slots:{default:[rZ]},$$scope:{ctx:t}}}),e.$on("click",t[12]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1048576&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function rZ(t){let e;return{c(){e=q("Retry status check")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Jk(t){let e,n;return{c(){e=R("p"),n=q(t[10]),P(e,"class","hint svelte-iacvtb"),P(e,"aria-live","polite")},m(i,l){y(i,e,l),T(e,n)},p(i,l){l&1024&&Z(n,i[10])},d(i){i&&w(e)}}}function sZ(t){let e;return{c(){e=q("Complete setup")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function oZ(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M=t[6]&&Kk(t),L=t[9]&&$k(t);function N(Q){t[17](Q)}let z={required:!0,autocomplete:"username",labelText:"Administrator username"};t[0]!==void 0&&(z.value=t[0]),o=new Jn({props:z}),ft.push(()=>Yt(o,"value",N));function W(Q){t[18](Q)}let D={required:!0,autocomplete:"new-password",labelText:"Password",helperText:`Use ${Tc} to ${Sc} UTF-8 bytes.`,invalid:t[5],invalidText:t[4]};t[1]!==void 0&&(D.value=t[1]),f=new zm({props:D}),ft.push(()=>Yt(f,"value",W));function G(Q){t[19](Q)}let $={required:!0,autocomplete:"new-password",labelText:"Confirm password",invalid:t[3],invalidText:"Passwords do not match."};t[2]!==void 0&&($.value=t[2]),h=new zm({props:$}),ft.push(()=>Yt(h,"value",G));let j=t[8]&&t[10]&&Jk(t);return C=new Rt({props:{type:"submit",disabled:!t[8]||t[7]||t[11]!=="",$$slots:{default:[sZ]},$$scope:{ctx:t}}}),{c(){e=R("h2"),e.textContent="Set up GateSentry",n=B(),i=R("p"),i.textContent="Create the administrator account for this installation.",l=B(),M&&M.c(),r=B(),L&&L.c(),s=B(),F(o.$$.fragment),u=B(),F(f.$$.fragment),d=B(),F(h.$$.fragment),_=B(),v=R("br"),S=B(),j&&j.c(),A=B(),F(C.$$.fragment),P(e,"class","svelte-iacvtb"),P(i,"class","svelte-iacvtb")},m(Q,le){y(Q,e,le),y(Q,n,le),y(Q,i,le),y(Q,l,le),M&&M.m(Q,le),y(Q,r,le),L&&L.m(Q,le),y(Q,s,le),H(o,Q,le),y(Q,u,le),H(f,Q,le),y(Q,d,le),H(h,Q,le),y(Q,_,le),y(Q,v,le),y(Q,S,le),j&&j.m(Q,le),y(Q,A,le),H(C,Q,le),I=!0},p(Q,le){Q[6]?M?M.p(Q,le):(M=Kk(Q),M.c(),M.m(r.parentNode,r)):M&&(M.d(1),M=null),Q[9]?L?(L.p(Q,le),le&512&&b(L,1)):(L=$k(Q),L.c(),b(L,1),L.m(s.parentNode,s)):L&&(fe(),k(L,1,1,()=>{L=null}),ce());const oe={};!a&&le&1&&(a=!0,oe.value=Q[0],jt(()=>a=!1)),o.$set(oe);const X={};le&32&&(X.invalid=Q[5]),le&16&&(X.invalidText=Q[4]),!c&&le&2&&(c=!0,X.value=Q[1],jt(()=>c=!1)),f.$set(X);const de={};le&8&&(de.invalid=Q[3]),!g&&le&4&&(g=!0,de.value=Q[2],jt(()=>g=!1)),h.$set(de),Q[8]&&Q[10]?j?j.p(Q,le):(j=Jk(Q),j.c(),j.m(A.parentNode,A)):j&&(j.d(1),j=null);const re={};le&2432&&(re.disabled=!Q[8]||Q[7]||Q[11]!==""),le&1048576&&(re.$$scope={dirty:le,ctx:Q}),C.$set(re)},i(Q){I||(b(L),b(o.$$.fragment,Q),b(f.$$.fragment,Q),b(h.$$.fragment,Q),b(C.$$.fragment,Q),I=!0)},o(Q){k(L),k(o.$$.fragment,Q),k(f.$$.fragment,Q),k(h.$$.fragment,Q),k(C.$$.fragment,Q),I=!1},d(Q){Q&&(w(e),w(n),w(i),w(l),w(r),w(s),w(u),w(d),w(_),w(v),w(S),w(A)),M&&M.d(Q),L&&L.d(Q),U(o,Q),U(f,Q),U(h,Q),j&&j.d(Q),U(C,Q)}}}function aZ(t){let e,n;return e=new zn({props:{$$slots:{default:[oZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1052671&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function uZ(t){let e,n,i;return n=new PT({props:{$$slots:{default:[aZ]},$$scope:{ctx:t}}}),n.$on("submit",t[13]),{c(){e=R("div"),F(n.$$.fragment),P(e,"class","setup-card svelte-iacvtb")},m(l,r){y(l,e,r),H(n,e,null),i=!0},p(l,r){const s={};r&1052671&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(b(n.$$.fragment,l),i=!0)},o(l){k(n.$$.fragment,l),i=!1},d(l){l&&w(e),U(n)}}}function fZ(t){let e,n;return e=new zn({props:{$$slots:{default:[uZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1052671&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function cZ(t){let e,n;return e=new dl({props:{noGutter:!0,$$slots:{default:[fZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1052671&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function dZ(t){let e,n;return e=new NT({props:{noGutter:!0,$$slots:{default:[cZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&1052671&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function hZ(t,e,n){let i,l,r,s,o,a,u,f,c="",d="",h="",g="",_=!1,v=!1,S=!1;async function A(){n(9,S=!1),n(6,g="");try{const N=await fetch(ni()+"/api/setup/status");if(!N.ok)throw new Error("setup status failed");if((await N.json()).complete){Vi("/login");return}n(8,v=!0)}catch{n(9,S=!0),n(6,g="Unable to read setup status.")}}A();async function C(N){if(N.preventDefault(),n(6,g=""),!l){n(6,g=`Password must contain between ${Tc} and ${Sc} UTF-8 bytes.`);return}if(d!==h){n(6,g="Passwords do not match.");return}n(7,_=!0);try{const z=await fetch(ni()+"/api/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:c,password:d})});if(!z.ok){n(6,g=z.status===409?"Setup was already completed. Sign in instead.":"Setup could not be completed.");return}n(1,d=""),n(2,h=""),window.location.assign(ni()+"/login")}catch{n(6,g="Unable to contact GateSentry.")}finally{n(7,_=!1)}}function I(N){c=N,n(0,c)}function M(N){d=N,n(1,d)}function L(N){h=N,n(2,h)}return t.$$.update=()=>{t.$$.dirty&2&&n(16,i=k8(d)),t.$$.dirty&2&&n(14,l=lZ(d)),t.$$.dirty&16386&&n(5,r=d.length>0&&!l),t.$$.dirty&65536&&n(4,s=`Password must contain between ${Tc} and ${Sc} UTF-8 bytes (currently ${i}).`),t.$$.dirty&6&&n(3,o=h.length>0&&d!==h),t.$$.dirty&63&&n(15,a=c?d.length===0?{message:"Enter a password.",field:""}:r?{message:s,field:"password"}:h.length===0?{message:"Re-enter the password to confirm it.",field:""}:o?{message:"Passwords do not match.",field:"confirmation"}:{message:"",field:""}:{message:"Enter an administrator username.",field:""}),t.$$.dirty&32768&&n(11,u=a.message),t.$$.dirty&32768&&n(10,f=a.field===""?a.message:"")},[c,d,h,o,s,r,g,_,v,S,f,u,A,C,l,a,i,I,M,L]}class mZ extends De{constructor(e){super(),Re(this,e,hZ,dZ,Ie,{})}}var gZ=["second","minute","hour","day","week","month","year"];function _Z(t,e){if(e===0)return["just now","right now"];var n=gZ[Math.floor(e/2)];return t>1&&(n+="s"),[t+" "+n+" ago","in "+t+" "+n]}var pZ=["秒","分钟","小时","天","周","个月","年"];function bZ(t,e){if(e===0)return["刚刚","片刻后"];var n=pZ[~~(e/2)];return[t+" "+n+"前",t+" "+n+"后"]}var Jm={},w8=function(t,e){Jm[t]=e},vZ=function(t){return Jm[t]||Jm.en_US},sm=[60,60,24,7,365/7/12,12];function Qk(t){return t instanceof Date?t:!isNaN(t)||/^\d+$/.test(t)?new Date(parseInt(t)):(t=(t||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(t))}function kZ(t,e){var n=t<0?1:0;t=Math.abs(t);for(var i=t,l=0;t>=sm[l]&&l(l===0?9:1)&&(l+=1),e(t,l,i)[n].replace("%s",t.toString())}function wZ(t,e){var n=e?Qk(e):new Date;return(+n-+Qk(t))/1e3}var yZ=function(t,e,n){var i=wZ(t,n&&n.relativeDate);return kZ(i,vZ(e))};w8("en_US",_Z);w8("zh_CN",bZ);function TZ(t){var i;const e=new Map,n=new Map;for(const l of t||[])for(const r of new Set([l.ipv4,l.ipv6].filter(Boolean)))n.set(r,(n.get(r)||0)+1);for(const l of t||[]){const r=(i=l.manual_name)==null?void 0:i.trim();if(r)for(const s of new Set([l.ipv4,l.ipv6].filter(Boolean)))n.get(s)===1&&e.set(s,r)}return e}function SZ(t,e){const n=t.get(e);return n?`${n} (${e})`:e}var Ec={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */Ec.exports;(function(t,e){(function(){var n,i="4.17.21",l=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",o="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",c=1,d=2,h=4,g=1,_=2,v=1,S=2,A=4,C=8,I=16,M=32,L=64,N=128,z=256,W=512,D=30,G="...",$=800,j=16,Q=1,le=2,oe=3,X=1/0,de=9007199254740991,re=17976931348623157e292,x=0/0,me=4294967295,ee=me-1,ke=me>>>1,pe=[["ary",N],["bind",v],["bindKey",S],["curry",C],["curryRight",I],["flip",W],["partial",M],["partialRight",L],["rearg",z]],Fe="[object Arguments]",Ve="[object Array]",Ee="[object AsyncFunction]",We="[object Boolean]",ge="[object Date]",ve="[object DOMException]",be="[object Error]",ue="[object Function]",nt="[object GeneratorFunction]",Oe="[object Map]",dt="[object Number]",yt="[object Null]",at="[object Object]",ut="[object Promise]",At="[object Proxy]",xe="[object RegExp]",mt="[object Set]",we="[object String]",gt="[object Symbol]",It="[object Undefined]",Ht="[object WeakMap]",Wt="[object WeakSet]",qt="[object ArrayBuffer]",Xt="[object DataView]",Ce="[object Float32Array]",se="[object Float64Array]",Le="[object Int8Array]",_t="[object Int16Array]",zt="[object Int32Array]",Be="[object Uint8Array]",Ot="[object Uint8ClampedArray]",kt="[object Uint16Array]",Pt="[object Uint32Array]",Ye=/\b__p \+= '';/g,ze=/\b(__p \+=) '' \+/g,Qe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,He=/&(?:amp|lt|gt|quot|#39);/g,Tt=/[&<>"']/g,Bt=RegExp(He.source),qn=RegExp(Tt.source),li=/<%-([\s\S]+?)%>/g,di=/<%([\s\S]+?)%>/g,hi=/<%=([\s\S]+?)%>/g,Mi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wi=/^\w*$/,Ri=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zi=/[\\^$.*+?()[\]{}|]/g,ur=RegExp(Zi.source),Kn=/^\s+/,Rn=/\s/,lt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,St=/\{\n\/\* \[wrapped with (.+)\] \*/,Dn=/,? & /,Hn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ll=/[()=,{}\[\]\/\s]/,mi=/\\(\\)?/g,Un=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tn=/\w*$/,Tn=/^[-+]0x[0-9a-f]+$/i,pn=/^0b[01]+$/i,ml=/^\[object .+?Constructor\]$/,gl=/^0o[0-7]+$/i,ri=/^(?:0|[1-9]\d*)$/,Sn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Di=/($^)/,el=/['\n\r\u2028\u2029\\]/g,Xl="\\ud800-\\udfff",Cs="\\u0300-\\u036f",_l="\\ufe20-\\ufe2f",Ls="\\u20d0-\\u20ff",xr=Cs+_l+Ls,si="\\u2700-\\u27bf",Lt="a-z\\xdf-\\xf6\\xf8-\\xff",Kt="\\xac\\xb1\\xd7\\xf7",Kl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",es="\\u2000-\\u206f",Sr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fr="A-Z\\xc0-\\xd6\\xd8-\\xde",Er="\\ufe0e\\ufe0f",ts=Kt+Kl+es+Sr,tl="['’]",Is="["+Xl+"]",cr="["+ts+"]",Il="["+xr+"]",go="\\d+",$u="["+si+"]",Mr="["+Lt+"]",ka="[^"+Xl+ts+go+si+Lt+fr+"]",Rl="\\ud83c[\\udffb-\\udfff]",dr="(?:"+Il+"|"+Rl+")",wa="[^"+Xl+"]",Dl="(?:\\ud83c[\\udde6-\\uddff]){2}",_o="[\\ud800-\\udbff][\\udc00-\\udfff]",Xi="["+fr+"]",hn="\\u200d",ns="(?:"+Mr+"|"+ka+")",Ju="(?:"+Xi+"|"+ka+")",ya="(?:"+tl+"(?:d|ll|m|re|s|t|ve))?",$l="(?:"+tl+"(?:D|LL|M|RE|S|T|VE))?",Ta=dr+"?",xn="["+Er+"]?",oi="(?:"+hn+"(?:"+[wa,Dl,_o].join("|")+")"+xn+Ta+")*",ai="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Qu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Sa=xn+Ta+oi,st="(?:"+[$u,Dl,_o].join("|")+")"+Sa,pt="(?:"+[wa+Il+"?",Il,Dl,_o,Is].join("|")+")",Pi=RegExp(tl,"g"),is=RegExp(Il,"g"),po=RegExp(Rl+"(?="+Rl+")|"+pt+Sa,"g"),Ea=RegExp([Xi+"?"+Mr+"+"+ya+"(?="+[cr,Xi,"$"].join("|")+")",Ju+"+"+$l+"(?="+[cr,Xi+ns,"$"].join("|")+")",Xi+"?"+ns+"+"+ya,Xi+"+"+$l,Qu,ai,go,st].join("|"),"g"),Ma=RegExp("["+hn+Xl+xr+Er+"]"),xu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ef=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tf=-1,Cn={};Cn[Ce]=Cn[se]=Cn[Le]=Cn[_t]=Cn[zt]=Cn[Be]=Cn[Ot]=Cn[kt]=Cn[Pt]=!0,Cn[Fe]=Cn[Ve]=Cn[qt]=Cn[We]=Cn[Xt]=Cn[ge]=Cn[be]=Cn[ue]=Cn[Oe]=Cn[dt]=Cn[at]=Cn[xe]=Cn[mt]=Cn[we]=Cn[Ht]=!1;var En={};En[Fe]=En[Ve]=En[qt]=En[Xt]=En[We]=En[ge]=En[Ce]=En[se]=En[Le]=En[_t]=En[zt]=En[Oe]=En[dt]=En[at]=En[xe]=En[mt]=En[we]=En[gt]=En[Be]=En[Ot]=En[kt]=En[Pt]=!0,En[be]=En[ue]=En[Ht]=!1;var nf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},PM={"&":"&","<":"<",">":">",'"':""","'":"'"},NM={"&":"&","<":"<",">":">",""":'"',"'":"'"},BM={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zM=parseFloat,HM=parseInt,ig=typeof Wa=="object"&&Wa&&Wa.Object===Object&&Wa,UM=typeof self=="object"&&self&&self.Object===Object&&self,Oi=ig||UM||Function("return this")(),Gd=e&&!e.nodeType&&e,Rs=Gd&&!0&&t&&!t.nodeType&&t,lg=Rs&&Rs.exports===Gd,Vd=lg&&ig.process,Pl=function(){try{var Pe=Rs&&Rs.require&&Rs.require("util").types;return Pe||Vd&&Vd.binding&&Vd.binding("util")}catch{}}(),rg=Pl&&Pl.isArrayBuffer,sg=Pl&&Pl.isDate,og=Pl&&Pl.isMap,ag=Pl&&Pl.isRegExp,ug=Pl&&Pl.isSet,fg=Pl&&Pl.isTypedArray;function pl(Pe,Je,Ge){switch(Ge.length){case 0:return Pe.call(Je);case 1:return Pe.call(Je,Ge[0]);case 2:return Pe.call(Je,Ge[0],Ge[1]);case 3:return Pe.call(Je,Ge[0],Ge[1],Ge[2])}return Pe.apply(Je,Ge)}function FM(Pe,Je,Ge,Ct){for(var $t=-1,mn=Pe==null?0:Pe.length;++$t-1}function Wd(Pe,Je,Ge){for(var Ct=-1,$t=Pe==null?0:Pe.length;++Ct<$t;)if(Ge(Je,Pe[Ct]))return!0;return!1}function Fn(Pe,Je){for(var Ge=-1,Ct=Pe==null?0:Pe.length,$t=Array(Ct);++Ge-1;);return Ge}function bg(Pe,Je){for(var Ge=Pe.length;Ge--&&bo(Je,Pe[Ge],0)>-1;);return Ge}function KM(Pe,Je){for(var Ge=Pe.length,Ct=0;Ge--;)Pe[Ge]===Je&&++Ct;return Ct}var $M=Zd(nf),JM=Zd(PM);function QM(Pe){return"\\"+BM[Pe]}function xM(Pe,Je){return Pe==null?n:Pe[Je]}function vo(Pe){return Ma.test(Pe)}function eO(Pe){return xu.test(Pe)}function tO(Pe){for(var Je,Ge=[];!(Je=Pe.next()).done;)Ge.push(Je.value);return Ge}function Jd(Pe){var Je=-1,Ge=Array(Pe.size);return Pe.forEach(function(Ct,$t){Ge[++Je]=[$t,Ct]}),Ge}function vg(Pe,Je){return function(Ge){return Pe(Je(Ge))}}function ss(Pe,Je){for(var Ge=-1,Ct=Pe.length,$t=0,mn=[];++Ge-1}function VO(m,p){var O=this.__data__,V=wf(O,m);return V<0?(++this.size,O.push([m,p])):O[V][1]=p,this}Or.prototype.clear=HO,Or.prototype.delete=UO,Or.prototype.get=FO,Or.prototype.has=GO,Or.prototype.set=VO;function Ar(m){var p=-1,O=m==null?0:m.length;for(this.clear();++p=p?m:p)),m}function Hl(m,p,O,V,K,ie){var _e,ye=p&c,Ne=p&d,et=p&h;if(O&&(_e=K?O(m,V,K,ie):O(m)),_e!==n)return _e;if(!jn(m))return m;var tt=Jt(m);if(tt){if(_e=Y7(m),!ye)return nl(m,_e)}else{var ot=Bi(m),Et=ot==ue||ot==nt;if(ds(m))return t_(m,ye);if(ot==at||ot==Fe||Et&&!K){if(_e=Ne||Et?{}:k_(m),!ye)return Ne?N7(m,l7(_e,m)):P7(m,Ig(_e,m))}else{if(!En[ot])return K?m:{};_e=Z7(m,ot,ye)}}ie||(ie=new Ql);var Dt=ie.get(m);if(Dt)return Dt;ie.set(m,_e),K_(m)?m.forEach(function(Gt){_e.add(Hl(Gt,p,O,Gt,m,ie))}):Z_(m)&&m.forEach(function(Gt,rn){_e.set(rn,Hl(Gt,p,O,rn,m,ie))});var Ft=et?Ne?Th:yh:Ne?ll:yi,nn=tt?n:Ft(m);return Nl(nn||m,function(Gt,rn){nn&&(rn=Gt,Gt=m[rn]),Da(_e,rn,Hl(Gt,p,O,rn,m,ie))}),_e}function r7(m){var p=yi(m);return function(O){return Rg(O,m,p)}}function Rg(m,p,O){var V=O.length;if(m==null)return!V;for(m=In(m);V--;){var K=O[V],ie=p[K],_e=m[K];if(_e===n&&!(K in m)||!ie(_e))return!1}return!0}function Dg(m,p,O){if(typeof m!="function")throw new Bl(s);return Fa(function(){m.apply(n,O)},p)}function Pa(m,p,O,V){var K=-1,ie=lf,_e=!0,ye=m.length,Ne=[],et=p.length;if(!ye)return Ne;O&&(p=Fn(p,bl(O))),V?(ie=Wd,_e=!1):p.length>=l&&(ie=Oa,_e=!1,p=new Ns(p));e:for(;++KK?0:K+O),V=V===n||V>K?K:xt(V),V<0&&(V+=K),V=O>V?0:J_(V);O0&&O(ye)?p>1?Ai(ye,p-1,O,V,K):rs(K,ye):V||(K[K.length]=ye)}return K}var lh=o_(),Bg=o_(!0);function hr(m,p){return m&&lh(m,p,yi)}function rh(m,p){return m&&Bg(m,p,yi)}function Tf(m,p){return ls(p,function(O){return Dr(m[O])})}function zs(m,p){p=fs(p,m);for(var O=0,V=p.length;m!=null&&Op}function a7(m,p){return m!=null&&Mn.call(m,p)}function u7(m,p){return m!=null&&p in In(m)}function f7(m,p,O){return m>=Ni(p,O)&&m<_i(p,O)}function oh(m,p,O){for(var V=O?Wd:lf,K=m[0].length,ie=m.length,_e=ie,ye=Ge(ie),Ne=1/0,et=[];_e--;){var tt=m[_e];_e&&p&&(tt=Fn(tt,bl(p))),Ne=Ni(tt.length,Ne),ye[_e]=!O&&(p||K>=120&&tt.length>=120)?new Ns(_e&&tt):n}tt=m[0];var ot=-1,Et=ye[0];e:for(;++ot-1;)ye!==m&&mf.call(ye,Ne,1),mf.call(m,Ne,1);return m}function Zg(m,p){for(var O=m?p.length:0,V=O-1;O--;){var K=p[O];if(O==V||K!==ie){var ie=K;Rr(K)?mf.call(m,K,1):gh(m,K)}}return m}function dh(m,p){return m+pf(Og()*(p-m+1))}function T7(m,p,O,V){for(var K=-1,ie=_i(_f((p-m)/(O||1)),0),_e=Ge(ie);ie--;)_e[V?ie:++K]=m,m+=O;return _e}function hh(m,p){var O="";if(!m||p<1||p>de)return O;do p%2&&(O+=m),p=pf(p/2),p&&(m+=m);while(p);return O}function ln(m,p){return Lh(T_(m,p,rl),m+"")}function S7(m){return Lg(Lo(m))}function E7(m,p){var O=Lo(m);return Pf(O,Bs(p,0,O.length))}function za(m,p,O,V){if(!jn(m))return m;p=fs(p,m);for(var K=-1,ie=p.length,_e=ie-1,ye=m;ye!=null&&++KK?0:K+p),O=O>K?K:O,O<0&&(O+=K),K=p>O?0:O-p>>>0,p>>>=0;for(var ie=Ge(K);++V>>1,_e=m[ie];_e!==null&&!kl(_e)&&(O?_e<=p:_e=l){var et=p?null:U7(m);if(et)return sf(et);_e=!1,K=Oa,Ne=new Ns}else Ne=p?[]:ye;e:for(;++V=V?m:Ul(m,p,O)}var e_=_O||function(m){return Oi.clearTimeout(m)};function t_(m,p){if(p)return m.slice();var O=m.length,V=yg?yg(O):new m.constructor(O);return m.copy(V),V}function vh(m){var p=new m.constructor(m.byteLength);return new df(p).set(new df(m)),p}function L7(m,p){var O=p?vh(m.buffer):m.buffer;return new m.constructor(O,m.byteOffset,m.byteLength)}function I7(m){var p=new m.constructor(m.source,tn.exec(m));return p.lastIndex=m.lastIndex,p}function R7(m){return Ra?In(Ra.call(m)):{}}function n_(m,p){var O=p?vh(m.buffer):m.buffer;return new m.constructor(O,m.byteOffset,m.length)}function i_(m,p){if(m!==p){var O=m!==n,V=m===null,K=m===m,ie=kl(m),_e=p!==n,ye=p===null,Ne=p===p,et=kl(p);if(!ye&&!et&&!ie&&m>p||ie&&_e&&Ne&&!ye&&!et||V&&_e&&Ne||!O&&Ne||!K)return 1;if(!V&&!ie&&!et&&m=ye)return Ne;var et=O[V];return Ne*(et=="desc"?-1:1)}}return m.index-p.index}function l_(m,p,O,V){for(var K=-1,ie=m.length,_e=O.length,ye=-1,Ne=p.length,et=_i(ie-_e,0),tt=Ge(Ne+et),ot=!V;++ye1?O[K-1]:n,_e=K>2?O[2]:n;for(ie=m.length>3&&typeof ie=="function"?(K--,ie):n,_e&&$i(O[0],O[1],_e)&&(ie=K<3?n:ie,K=1),p=In(p);++V-1?K[ie?p[_e]:_e]:n}}function f_(m){return Ir(function(p){var O=p.length,V=O,K=zl.prototype.thru;for(m&&p.reverse();V--;){var ie=p[V];if(typeof ie!="function")throw new Bl(s);if(K&&!_e&&Rf(ie)=="wrapper")var _e=new zl([],!0)}for(V=_e?V:O;++V1&&on.reverse(),tt&&Neye))return!1;var et=ie.get(m),tt=ie.get(p);if(et&&tt)return et==p&&tt==m;var ot=-1,Et=!0,Dt=O&_?new Ns:n;for(ie.set(m,p),ie.set(p,m);++ot1?"& ":"")+p[V],p=p.join(O>2?", ":" "),m.replace(lt,`{ + */Ec.exports;(function(t,e){(function(){var n,i="4.17.21",l=200,r="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",o="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",u=500,f="__lodash_placeholder__",c=1,d=2,h=4,g=1,_=2,v=1,S=2,A=4,C=8,I=16,M=32,L=64,N=128,z=256,W=512,D=30,G="...",$=800,j=16,Q=1,le=2,oe=3,X=1/0,de=9007199254740991,re=17976931348623157e292,x=0/0,me=4294967295,ee=me-1,ke=me>>>1,pe=[["ary",N],["bind",v],["bindKey",S],["curry",C],["curryRight",I],["flip",W],["partial",M],["partialRight",L],["rearg",z]],Fe="[object Arguments]",Ve="[object Array]",Ee="[object AsyncFunction]",We="[object Boolean]",ge="[object Date]",ve="[object DOMException]",be="[object Error]",ue="[object Function]",nt="[object GeneratorFunction]",Oe="[object Map]",dt="[object Number]",yt="[object Null]",at="[object Object]",ut="[object Promise]",At="[object Proxy]",xe="[object RegExp]",mt="[object Set]",we="[object String]",gt="[object Symbol]",It="[object Undefined]",Ht="[object WeakMap]",Wt="[object WeakSet]",qt="[object ArrayBuffer]",Xt="[object DataView]",Ce="[object Float32Array]",se="[object Float64Array]",Le="[object Int8Array]",_t="[object Int16Array]",zt="[object Int32Array]",Be="[object Uint8Array]",Ot="[object Uint8ClampedArray]",kt="[object Uint16Array]",Pt="[object Uint32Array]",Ye=/\b__p \+= '';/g,ze=/\b(__p \+=) '' \+/g,Qe=/(__e\(.*?\)|\b__t\)) \+\n'';/g,He=/&(?:amp|lt|gt|quot|#39);/g,Tt=/[&<>"']/g,Bt=RegExp(He.source),qn=RegExp(Tt.source),li=/<%-([\s\S]+?)%>/g,di=/<%([\s\S]+?)%>/g,hi=/<%=([\s\S]+?)%>/g,Mi=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wi=/^\w*$/,Ri=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zi=/[\\^$.*+?()[\]{}|]/g,ur=RegExp(Zi.source),Kn=/^\s+/,Rn=/\s/,lt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,St=/\{\n\/\* \[wrapped with (.+)\] \*/,Dn=/,? & /,Hn=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Ll=/[()=,{}\[\]\/\s]/,mi=/\\(\\)?/g,Un=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,tn=/\w*$/,Tn=/^[-+]0x[0-9a-f]+$/i,pn=/^0b[01]+$/i,ml=/^\[object .+?Constructor\]$/,gl=/^0o[0-7]+$/i,ri=/^(?:0|[1-9]\d*)$/,Sn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Di=/($^)/,el=/['\n\r\u2028\u2029\\]/g,Xl="\\ud800-\\udfff",Cs="\\u0300-\\u036f",_l="\\ufe20-\\ufe2f",Ls="\\u20d0-\\u20ff",xr=Cs+_l+Ls,si="\\u2700-\\u27bf",Lt="a-z\\xdf-\\xf6\\xf8-\\xff",Kt="\\xac\\xb1\\xd7\\xf7",Kl="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",es="\\u2000-\\u206f",Sr=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fr="A-Z\\xc0-\\xd6\\xd8-\\xde",Er="\\ufe0e\\ufe0f",ts=Kt+Kl+es+Sr,tl="['’]",Is="["+Xl+"]",cr="["+ts+"]",Il="["+xr+"]",go="\\d+",$u="["+si+"]",Mr="["+Lt+"]",ka="[^"+Xl+ts+go+si+Lt+fr+"]",Rl="\\ud83c[\\udffb-\\udfff]",dr="(?:"+Il+"|"+Rl+")",wa="[^"+Xl+"]",Dl="(?:\\ud83c[\\udde6-\\uddff]){2}",_o="[\\ud800-\\udbff][\\udc00-\\udfff]",Xi="["+fr+"]",hn="\\u200d",ns="(?:"+Mr+"|"+ka+")",Ju="(?:"+Xi+"|"+ka+")",ya="(?:"+tl+"(?:d|ll|m|re|s|t|ve))?",$l="(?:"+tl+"(?:D|LL|M|RE|S|T|VE))?",Ta=dr+"?",xn="["+Er+"]?",oi="(?:"+hn+"(?:"+[wa,Dl,_o].join("|")+")"+xn+Ta+")*",ai="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Qu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Sa=xn+Ta+oi,st="(?:"+[$u,Dl,_o].join("|")+")"+Sa,pt="(?:"+[wa+Il+"?",Il,Dl,_o,Is].join("|")+")",Pi=RegExp(tl,"g"),is=RegExp(Il,"g"),po=RegExp(Rl+"(?="+Rl+")|"+pt+Sa,"g"),Ea=RegExp([Xi+"?"+Mr+"+"+ya+"(?="+[cr,Xi,"$"].join("|")+")",Ju+"+"+$l+"(?="+[cr,Xi+ns,"$"].join("|")+")",Xi+"?"+ns+"+"+ya,Xi+"+"+$l,Qu,ai,go,st].join("|"),"g"),Ma=RegExp("["+hn+Xl+xr+Er+"]"),xu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ef=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],tf=-1,Cn={};Cn[Ce]=Cn[se]=Cn[Le]=Cn[_t]=Cn[zt]=Cn[Be]=Cn[Ot]=Cn[kt]=Cn[Pt]=!0,Cn[Fe]=Cn[Ve]=Cn[qt]=Cn[We]=Cn[Xt]=Cn[ge]=Cn[be]=Cn[ue]=Cn[Oe]=Cn[dt]=Cn[at]=Cn[xe]=Cn[mt]=Cn[we]=Cn[Ht]=!1;var En={};En[Fe]=En[Ve]=En[qt]=En[Xt]=En[We]=En[ge]=En[Ce]=En[se]=En[Le]=En[_t]=En[zt]=En[Oe]=En[dt]=En[at]=En[xe]=En[mt]=En[we]=En[gt]=En[Be]=En[Ot]=En[kt]=En[Pt]=!0,En[be]=En[ue]=En[Ht]=!1;var nf={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},NM={"&":"&","<":"<",">":">",'"':""","'":"'"},BM={"&":"&","<":"<",">":">",""":'"',"'":"'"},zM={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},HM=parseFloat,UM=parseInt,ig=typeof Wa=="object"&&Wa&&Wa.Object===Object&&Wa,FM=typeof self=="object"&&self&&self.Object===Object&&self,Oi=ig||FM||Function("return this")(),Gd=e&&!e.nodeType&&e,Rs=Gd&&!0&&t&&!t.nodeType&&t,lg=Rs&&Rs.exports===Gd,Vd=lg&&ig.process,Pl=function(){try{var Pe=Rs&&Rs.require&&Rs.require("util").types;return Pe||Vd&&Vd.binding&&Vd.binding("util")}catch{}}(),rg=Pl&&Pl.isArrayBuffer,sg=Pl&&Pl.isDate,og=Pl&&Pl.isMap,ag=Pl&&Pl.isRegExp,ug=Pl&&Pl.isSet,fg=Pl&&Pl.isTypedArray;function pl(Pe,Je,Ge){switch(Ge.length){case 0:return Pe.call(Je);case 1:return Pe.call(Je,Ge[0]);case 2:return Pe.call(Je,Ge[0],Ge[1]);case 3:return Pe.call(Je,Ge[0],Ge[1],Ge[2])}return Pe.apply(Je,Ge)}function GM(Pe,Je,Ge,Ct){for(var $t=-1,mn=Pe==null?0:Pe.length;++$t-1}function Wd(Pe,Je,Ge){for(var Ct=-1,$t=Pe==null?0:Pe.length;++Ct<$t;)if(Ge(Je,Pe[Ct]))return!0;return!1}function Fn(Pe,Je){for(var Ge=-1,Ct=Pe==null?0:Pe.length,$t=Array(Ct);++Ge-1;);return Ge}function bg(Pe,Je){for(var Ge=Pe.length;Ge--&&bo(Je,Pe[Ge],0)>-1;);return Ge}function $M(Pe,Je){for(var Ge=Pe.length,Ct=0;Ge--;)Pe[Ge]===Je&&++Ct;return Ct}var JM=Zd(nf),QM=Zd(NM);function xM(Pe){return"\\"+zM[Pe]}function eO(Pe,Je){return Pe==null?n:Pe[Je]}function vo(Pe){return Ma.test(Pe)}function tO(Pe){return xu.test(Pe)}function nO(Pe){for(var Je,Ge=[];!(Je=Pe.next()).done;)Ge.push(Je.value);return Ge}function Jd(Pe){var Je=-1,Ge=Array(Pe.size);return Pe.forEach(function(Ct,$t){Ge[++Je]=[$t,Ct]}),Ge}function vg(Pe,Je){return function(Ge){return Pe(Je(Ge))}}function ss(Pe,Je){for(var Ge=-1,Ct=Pe.length,$t=0,mn=[];++Ge-1}function WO(m,p){var O=this.__data__,V=wf(O,m);return V<0?(++this.size,O.push([m,p])):O[V][1]=p,this}Or.prototype.clear=UO,Or.prototype.delete=FO,Or.prototype.get=GO,Or.prototype.has=VO,Or.prototype.set=WO;function Ar(m){var p=-1,O=m==null?0:m.length;for(this.clear();++p=p?m:p)),m}function Hl(m,p,O,V,K,ie){var _e,ye=p&c,Ne=p&d,et=p&h;if(O&&(_e=K?O(m,V,K,ie):O(m)),_e!==n)return _e;if(!jn(m))return m;var tt=Jt(m);if(tt){if(_e=Z7(m),!ye)return nl(m,_e)}else{var ot=Bi(m),Et=ot==ue||ot==nt;if(ds(m))return t_(m,ye);if(ot==at||ot==Fe||Et&&!K){if(_e=Ne||Et?{}:k_(m),!ye)return Ne?B7(m,r7(_e,m)):N7(m,Ig(_e,m))}else{if(!En[ot])return K?m:{};_e=X7(m,ot,ye)}}ie||(ie=new Ql);var Dt=ie.get(m);if(Dt)return Dt;ie.set(m,_e),K_(m)?m.forEach(function(Gt){_e.add(Hl(Gt,p,O,Gt,m,ie))}):Z_(m)&&m.forEach(function(Gt,rn){_e.set(rn,Hl(Gt,p,O,rn,m,ie))});var Ft=et?Ne?Th:yh:Ne?ll:yi,nn=tt?n:Ft(m);return Nl(nn||m,function(Gt,rn){nn&&(rn=Gt,Gt=m[rn]),Da(_e,rn,Hl(Gt,p,O,rn,m,ie))}),_e}function s7(m){var p=yi(m);return function(O){return Rg(O,m,p)}}function Rg(m,p,O){var V=O.length;if(m==null)return!V;for(m=In(m);V--;){var K=O[V],ie=p[K],_e=m[K];if(_e===n&&!(K in m)||!ie(_e))return!1}return!0}function Dg(m,p,O){if(typeof m!="function")throw new Bl(s);return Fa(function(){m.apply(n,O)},p)}function Pa(m,p,O,V){var K=-1,ie=lf,_e=!0,ye=m.length,Ne=[],et=p.length;if(!ye)return Ne;O&&(p=Fn(p,bl(O))),V?(ie=Wd,_e=!1):p.length>=l&&(ie=Oa,_e=!1,p=new Ns(p));e:for(;++KK?0:K+O),V=V===n||V>K?K:xt(V),V<0&&(V+=K),V=O>V?0:J_(V);O0&&O(ye)?p>1?Ai(ye,p-1,O,V,K):rs(K,ye):V||(K[K.length]=ye)}return K}var lh=o_(),Bg=o_(!0);function hr(m,p){return m&&lh(m,p,yi)}function rh(m,p){return m&&Bg(m,p,yi)}function Tf(m,p){return ls(p,function(O){return Dr(m[O])})}function zs(m,p){p=fs(p,m);for(var O=0,V=p.length;m!=null&&Op}function u7(m,p){return m!=null&&Mn.call(m,p)}function f7(m,p){return m!=null&&p in In(m)}function c7(m,p,O){return m>=Ni(p,O)&&m<_i(p,O)}function oh(m,p,O){for(var V=O?Wd:lf,K=m[0].length,ie=m.length,_e=ie,ye=Ge(ie),Ne=1/0,et=[];_e--;){var tt=m[_e];_e&&p&&(tt=Fn(tt,bl(p))),Ne=Ni(tt.length,Ne),ye[_e]=!O&&(p||K>=120&&tt.length>=120)?new Ns(_e&&tt):n}tt=m[0];var ot=-1,Et=ye[0];e:for(;++ot-1;)ye!==m&&mf.call(ye,Ne,1),mf.call(m,Ne,1);return m}function Zg(m,p){for(var O=m?p.length:0,V=O-1;O--;){var K=p[O];if(O==V||K!==ie){var ie=K;Rr(K)?mf.call(m,K,1):gh(m,K)}}return m}function dh(m,p){return m+pf(Og()*(p-m+1))}function S7(m,p,O,V){for(var K=-1,ie=_i(_f((p-m)/(O||1)),0),_e=Ge(ie);ie--;)_e[V?ie:++K]=m,m+=O;return _e}function hh(m,p){var O="";if(!m||p<1||p>de)return O;do p%2&&(O+=m),p=pf(p/2),p&&(m+=m);while(p);return O}function ln(m,p){return Lh(T_(m,p,rl),m+"")}function E7(m){return Lg(Lo(m))}function M7(m,p){var O=Lo(m);return Pf(O,Bs(p,0,O.length))}function za(m,p,O,V){if(!jn(m))return m;p=fs(p,m);for(var K=-1,ie=p.length,_e=ie-1,ye=m;ye!=null&&++KK?0:K+p),O=O>K?K:O,O<0&&(O+=K),K=p>O?0:O-p>>>0,p>>>=0;for(var ie=Ge(K);++V>>1,_e=m[ie];_e!==null&&!kl(_e)&&(O?_e<=p:_e=l){var et=p?null:F7(m);if(et)return sf(et);_e=!1,K=Oa,Ne=new Ns}else Ne=p?[]:ye;e:for(;++V=V?m:Ul(m,p,O)}var e_=pO||function(m){return Oi.clearTimeout(m)};function t_(m,p){if(p)return m.slice();var O=m.length,V=yg?yg(O):new m.constructor(O);return m.copy(V),V}function vh(m){var p=new m.constructor(m.byteLength);return new df(p).set(new df(m)),p}function I7(m,p){var O=p?vh(m.buffer):m.buffer;return new m.constructor(O,m.byteOffset,m.byteLength)}function R7(m){var p=new m.constructor(m.source,tn.exec(m));return p.lastIndex=m.lastIndex,p}function D7(m){return Ra?In(Ra.call(m)):{}}function n_(m,p){var O=p?vh(m.buffer):m.buffer;return new m.constructor(O,m.byteOffset,m.length)}function i_(m,p){if(m!==p){var O=m!==n,V=m===null,K=m===m,ie=kl(m),_e=p!==n,ye=p===null,Ne=p===p,et=kl(p);if(!ye&&!et&&!ie&&m>p||ie&&_e&&Ne&&!ye&&!et||V&&_e&&Ne||!O&&Ne||!K)return 1;if(!V&&!ie&&!et&&m=ye)return Ne;var et=O[V];return Ne*(et=="desc"?-1:1)}}return m.index-p.index}function l_(m,p,O,V){for(var K=-1,ie=m.length,_e=O.length,ye=-1,Ne=p.length,et=_i(ie-_e,0),tt=Ge(Ne+et),ot=!V;++ye1?O[K-1]:n,_e=K>2?O[2]:n;for(ie=m.length>3&&typeof ie=="function"?(K--,ie):n,_e&&$i(O[0],O[1],_e)&&(ie=K<3?n:ie,K=1),p=In(p);++V-1?K[ie?p[_e]:_e]:n}}function f_(m){return Ir(function(p){var O=p.length,V=O,K=zl.prototype.thru;for(m&&p.reverse();V--;){var ie=p[V];if(typeof ie!="function")throw new Bl(s);if(K&&!_e&&Rf(ie)=="wrapper")var _e=new zl([],!0)}for(V=_e?V:O;++V1&&on.reverse(),tt&&Neye))return!1;var et=ie.get(m),tt=ie.get(p);if(et&&tt)return et==p&&tt==m;var ot=-1,Et=!0,Dt=O&_?new Ns:n;for(ie.set(m,p),ie.set(p,m);++ot1?"& ":"")+p[V],p=p.join(O>2?", ":" "),m.replace(lt,`{ /* [wrapped with `+p+`] */ -`)}function K7(m){return Jt(m)||Fs(m)||!!(Eg&&m&&m[Eg])}function Rr(m,p){var O=typeof m;return p=p??de,!!p&&(O=="number"||O!="symbol"&&ri.test(m))&&m>-1&&m%1==0&&m0){if(++p>=$)return arguments[0]}else p=0;return m.apply(n,arguments)}}function Pf(m,p){var O=-1,V=m.length,K=V-1;for(p=p===n?V:p;++O1?m[p-1]:n;return O=typeof O=="function"?(m.pop(),O):n,N_(m,O)});function B_(m){var p=ne(m);return p.__chain__=!0,p}function sC(m,p){return p(m),m}function Nf(m,p){return p(m)}var oC=Ir(function(m){var p=m.length,O=p?m[0]:0,V=this.__wrapped__,K=function(ie){return ih(ie,m)};return p>1||this.__actions__.length||!(V instanceof sn)||!Rr(O)?this.thru(K):(V=V.slice(O,+O+(p?1:0)),V.__actions__.push({func:Nf,args:[K],thisArg:n}),new zl(V,this.__chain__).thru(function(ie){return p&&!ie.length&&ie.push(n),ie}))});function aC(){return B_(this)}function uC(){return new zl(this.value(),this.__chain__)}function fC(){this.__values__===n&&(this.__values__=$_(this.value()));var m=this.__index__>=this.__values__.length,p=m?n:this.__values__[this.__index__++];return{done:m,value:p}}function cC(){return this}function dC(m){for(var p,O=this;O instanceof kf;){var V=C_(O);V.__index__=0,V.__values__=n,p?K.__wrapped__=V:p=V;var K=V;O=O.__wrapped__}return K.__wrapped__=m,p}function hC(){var m=this.__wrapped__;if(m instanceof sn){var p=m;return this.__actions__.length&&(p=new sn(this)),p=p.reverse(),p.__actions__.push({func:Nf,args:[Ih],thisArg:n}),new zl(p,this.__chain__)}return this.thru(Ih)}function mC(){return Qg(this.__wrapped__,this.__actions__)}var gC=Of(function(m,p,O){Mn.call(m,O)?++m[O]:Cr(m,O,1)});function _C(m,p,O){var V=Jt(m)?cg:s7;return O&&$i(m,p,O)&&(p=n),V(m,Ut(p,3))}function pC(m,p){var O=Jt(m)?ls:Ng;return O(m,Ut(p,3))}var bC=u_(L_),vC=u_(I_);function kC(m,p){return Ai(Bf(m,p),1)}function wC(m,p){return Ai(Bf(m,p),X)}function yC(m,p,O){return O=O===n?1:xt(O),Ai(Bf(m,p),O)}function z_(m,p){var O=Jt(m)?Nl:as;return O(m,Ut(p,3))}function H_(m,p){var O=Jt(m)?GM:Pg;return O(m,Ut(p,3))}var TC=Of(function(m,p,O){Mn.call(m,O)?m[O].push(p):Cr(m,O,[p])});function SC(m,p,O,V){m=il(m)?m:Lo(m),O=O&&!V?xt(O):0;var K=m.length;return O<0&&(O=_i(K+O,0)),Gf(m)?O<=K&&m.indexOf(p,O)>-1:!!K&&bo(m,p,O)>-1}var EC=ln(function(m,p,O){var V=-1,K=typeof p=="function",ie=il(m)?Ge(m.length):[];return as(m,function(_e){ie[++V]=K?pl(p,_e,O):Na(_e,p,O)}),ie}),MC=Of(function(m,p,O){Cr(m,O,p)});function Bf(m,p){var O=Jt(m)?Fn:Gg;return O(m,Ut(p,3))}function OC(m,p,O,V){return m==null?[]:(Jt(p)||(p=p==null?[]:[p]),O=V?n:O,Jt(O)||(O=O==null?[]:[O]),jg(m,p,O))}var AC=Of(function(m,p,O){m[O?0:1].push(p)},function(){return[[],[]]});function CC(m,p,O){var V=Jt(m)?qd:gg,K=arguments.length<3;return V(m,Ut(p,4),O,K,as)}function LC(m,p,O){var V=Jt(m)?VM:gg,K=arguments.length<3;return V(m,Ut(p,4),O,K,Pg)}function IC(m,p){var O=Jt(m)?ls:Ng;return O(m,Uf(Ut(p,3)))}function RC(m){var p=Jt(m)?Lg:S7;return p(m)}function DC(m,p,O){(O?$i(m,p,O):p===n)?p=1:p=xt(p);var V=Jt(m)?t7:E7;return V(m,p)}function PC(m){var p=Jt(m)?n7:O7;return p(m)}function NC(m){if(m==null)return 0;if(il(m))return Gf(m)?ko(m):m.length;var p=Bi(m);return p==Oe||p==mt?m.size:uh(m).length}function BC(m,p,O){var V=Jt(m)?jd:A7;return O&&$i(m,p,O)&&(p=n),V(m,Ut(p,3))}var zC=ln(function(m,p){if(m==null)return[];var O=p.length;return O>1&&$i(m,p[0],p[1])?p=[]:O>2&&$i(p[0],p[1],p[2])&&(p=[p[0]]),jg(m,Ai(p,1),[])}),zf=pO||function(){return Oi.Date.now()};function HC(m,p){if(typeof p!="function")throw new Bl(s);return m=xt(m),function(){if(--m<1)return p.apply(this,arguments)}}function U_(m,p,O){return p=O?n:p,p=m&&p==null?m.length:p,Lr(m,N,n,n,n,n,p)}function F_(m,p){var O;if(typeof p!="function")throw new Bl(s);return m=xt(m),function(){return--m>0&&(O=p.apply(this,arguments)),m<=1&&(p=n),O}}var Dh=ln(function(m,p,O){var V=v;if(O.length){var K=ss(O,Ao(Dh));V|=M}return Lr(m,V,p,O,K)}),G_=ln(function(m,p,O){var V=v|S;if(O.length){var K=ss(O,Ao(G_));V|=M}return Lr(p,V,m,O,K)});function V_(m,p,O){p=O?n:p;var V=Lr(m,C,n,n,n,n,n,p);return V.placeholder=V_.placeholder,V}function W_(m,p,O){p=O?n:p;var V=Lr(m,I,n,n,n,n,n,p);return V.placeholder=W_.placeholder,V}function q_(m,p,O){var V,K,ie,_e,ye,Ne,et=0,tt=!1,ot=!1,Et=!0;if(typeof m!="function")throw new Bl(s);p=Gl(p)||0,jn(O)&&(tt=!!O.leading,ot="maxWait"in O,ie=ot?_i(Gl(O.maxWait)||0,p):ie,Et="trailing"in O?!!O.trailing:Et);function Dt(ti){var er=V,Nr=K;return V=K=n,et=ti,_e=m.apply(Nr,er),_e}function Ft(ti){return et=ti,ye=Fa(rn,p),tt?Dt(ti):_e}function nn(ti){var er=ti-Ne,Nr=ti-et,up=p-er;return ot?Ni(up,ie-Nr):up}function Gt(ti){var er=ti-Ne,Nr=ti-et;return Ne===n||er>=p||er<0||ot&&Nr>=ie}function rn(){var ti=zf();if(Gt(ti))return on(ti);ye=Fa(rn,nn(ti))}function on(ti){return ye=n,Et&&V?Dt(ti):(V=K=n,_e)}function wl(){ye!==n&&e_(ye),et=0,V=Ne=K=ye=n}function Ji(){return ye===n?_e:on(zf())}function yl(){var ti=zf(),er=Gt(ti);if(V=arguments,K=this,Ne=ti,er){if(ye===n)return Ft(Ne);if(ot)return e_(ye),ye=Fa(rn,p),Dt(Ne)}return ye===n&&(ye=Fa(rn,p)),_e}return yl.cancel=wl,yl.flush=Ji,yl}var UC=ln(function(m,p){return Dg(m,1,p)}),FC=ln(function(m,p,O){return Dg(m,Gl(p)||0,O)});function GC(m){return Lr(m,W)}function Hf(m,p){if(typeof m!="function"||p!=null&&typeof p!="function")throw new Bl(s);var O=function(){var V=arguments,K=p?p.apply(this,V):V[0],ie=O.cache;if(ie.has(K))return ie.get(K);var _e=m.apply(this,V);return O.cache=ie.set(K,_e)||ie,_e};return O.cache=new(Hf.Cache||Ar),O}Hf.Cache=Ar;function Uf(m){if(typeof m!="function")throw new Bl(s);return function(){var p=arguments;switch(p.length){case 0:return!m.call(this);case 1:return!m.call(this,p[0]);case 2:return!m.call(this,p[0],p[1]);case 3:return!m.call(this,p[0],p[1],p[2])}return!m.apply(this,p)}}function VC(m){return F_(2,m)}var WC=C7(function(m,p){p=p.length==1&&Jt(p[0])?Fn(p[0],bl(Ut())):Fn(Ai(p,1),bl(Ut()));var O=p.length;return ln(function(V){for(var K=-1,ie=Ni(V.length,O);++K=p}),Fs=Hg(function(){return arguments}())?Hg:function(m){return $n(m)&&Mn.call(m,"callee")&&!Sg.call(m,"callee")},Jt=Ge.isArray,l9=rg?bl(rg):d7;function il(m){return m!=null&&Ff(m.length)&&!Dr(m)}function ei(m){return $n(m)&&il(m)}function r9(m){return m===!0||m===!1||$n(m)&&Ki(m)==We}var ds=vO||jh,s9=sg?bl(sg):h7;function o9(m){return $n(m)&&m.nodeType===1&&!Ga(m)}function a9(m){if(m==null)return!0;if(il(m)&&(Jt(m)||typeof m=="string"||typeof m.splice=="function"||ds(m)||Co(m)||Fs(m)))return!m.length;var p=Bi(m);if(p==Oe||p==mt)return!m.size;if(Ua(m))return!uh(m).length;for(var O in m)if(Mn.call(m,O))return!1;return!0}function u9(m,p){return Ba(m,p)}function f9(m,p,O){O=typeof O=="function"?O:n;var V=O?O(m,p):n;return V===n?Ba(m,p,n,O):!!V}function Nh(m){if(!$n(m))return!1;var p=Ki(m);return p==be||p==ve||typeof m.message=="string"&&typeof m.name=="string"&&!Ga(m)}function c9(m){return typeof m=="number"&&Mg(m)}function Dr(m){if(!jn(m))return!1;var p=Ki(m);return p==ue||p==nt||p==Ee||p==At}function Y_(m){return typeof m=="number"&&m==xt(m)}function Ff(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=de}function jn(m){var p=typeof m;return m!=null&&(p=="object"||p=="function")}function $n(m){return m!=null&&typeof m=="object"}var Z_=og?bl(og):g7;function d9(m,p){return m===p||ah(m,p,Eh(p))}function h9(m,p,O){return O=typeof O=="function"?O:n,ah(m,p,Eh(p),O)}function m9(m){return X_(m)&&m!=+m}function g9(m){if(Q7(m))throw new $t(r);return Ug(m)}function _9(m){return m===null}function p9(m){return m==null}function X_(m){return typeof m=="number"||$n(m)&&Ki(m)==dt}function Ga(m){if(!$n(m)||Ki(m)!=at)return!1;var p=hf(m);if(p===null)return!0;var O=Mn.call(p,"constructor")&&p.constructor;return typeof O=="function"&&O instanceof O&&uf.call(O)==hO}var Bh=ag?bl(ag):_7;function b9(m){return Y_(m)&&m>=-de&&m<=de}var K_=ug?bl(ug):p7;function Gf(m){return typeof m=="string"||!Jt(m)&&$n(m)&&Ki(m)==we}function kl(m){return typeof m=="symbol"||$n(m)&&Ki(m)==gt}var Co=fg?bl(fg):b7;function v9(m){return m===n}function k9(m){return $n(m)&&Bi(m)==Ht}function w9(m){return $n(m)&&Ki(m)==Wt}var y9=If(fh),T9=If(function(m,p){return m<=p});function $_(m){if(!m)return[];if(il(m))return Gf(m)?Jl(m):nl(m);if(Aa&&m[Aa])return tO(m[Aa]());var p=Bi(m),O=p==Oe?Jd:p==mt?sf:Lo;return O(m)}function Pr(m){if(!m)return m===0?m:0;if(m=Gl(m),m===X||m===-X){var p=m<0?-1:1;return p*re}return m===m?m:0}function xt(m){var p=Pr(m),O=p%1;return p===p?O?p-O:p:0}function J_(m){return m?Bs(xt(m),0,me):0}function Gl(m){if(typeof m=="number")return m;if(kl(m))return x;if(jn(m)){var p=typeof m.valueOf=="function"?m.valueOf():m;m=jn(p)?p+"":p}if(typeof m!="string")return m===0?m:+m;m=_g(m);var O=pn.test(m);return O||gl.test(m)?HM(m.slice(2),O?2:8):Tn.test(m)?x:+m}function Q_(m){return mr(m,ll(m))}function S9(m){return m?Bs(xt(m),-de,de):m===0?m:0}function bn(m){return m==null?"":vl(m)}var E9=Mo(function(m,p){if(Ua(p)||il(p)){mr(p,yi(p),m);return}for(var O in p)Mn.call(p,O)&&Da(m,O,p[O])}),x_=Mo(function(m,p){mr(p,ll(p),m)}),Vf=Mo(function(m,p,O,V){mr(p,ll(p),m,V)}),M9=Mo(function(m,p,O,V){mr(p,yi(p),m,V)}),O9=Ir(ih);function A9(m,p){var O=Eo(m);return p==null?O:Ig(O,p)}var C9=ln(function(m,p){m=In(m);var O=-1,V=p.length,K=V>2?p[2]:n;for(K&&$i(p[0],p[1],K)&&(V=1);++O1),ie}),mr(m,Th(m),O),V&&(O=Hl(O,c|d|h,F7));for(var K=p.length;K--;)gh(O,p[K]);return O});function Z9(m,p){return tp(m,Uf(Ut(p)))}var X9=Ir(function(m,p){return m==null?{}:w7(m,p)});function tp(m,p){if(m==null)return{};var O=Fn(Th(m),function(V){return[V]});return p=Ut(p),Yg(m,O,function(V,K){return p(V,K[0])})}function K9(m,p,O){p=fs(p,m);var V=-1,K=p.length;for(K||(K=1,m=n);++Vp){var V=m;m=p,p=V}if(O||m%1||p%1){var K=Og();return Ni(m+K*(p-m+zM("1e-"+((K+"").length-1))),p)}return dh(m,p)}var sL=Oo(function(m,p,O){return p=p.toLowerCase(),m+(O?lp(p):p)});function lp(m){return Uh(bn(m).toLowerCase())}function rp(m){return m=bn(m),m&&m.replace(Sn,$M).replace(is,"")}function oL(m,p,O){m=bn(m),p=vl(p);var V=m.length;O=O===n?V:Bs(xt(O),0,V);var K=O;return O-=p.length,O>=0&&m.slice(O,K)==p}function aL(m){return m=bn(m),m&&qn.test(m)?m.replace(Tt,JM):m}function uL(m){return m=bn(m),m&&ur.test(m)?m.replace(Zi,"\\$&"):m}var fL=Oo(function(m,p,O){return m+(O?"-":"")+p.toLowerCase()}),cL=Oo(function(m,p,O){return m+(O?" ":"")+p.toLowerCase()}),dL=a_("toLowerCase");function hL(m,p,O){m=bn(m),p=xt(p);var V=p?ko(m):0;if(!p||V>=p)return m;var K=(p-V)/2;return Lf(pf(K),O)+m+Lf(_f(K),O)}function mL(m,p,O){m=bn(m),p=xt(p);var V=p?ko(m):0;return p&&V>>0,O?(m=bn(m),m&&(typeof p=="string"||p!=null&&!Bh(p))&&(p=vl(p),!p&&vo(m))?cs(Jl(m),0,O):m.split(p,O)):[]}var wL=Oo(function(m,p,O){return m+(O?" ":"")+Uh(p)});function yL(m,p,O){return m=bn(m),O=O==null?0:Bs(xt(O),0,m.length),p=vl(p),m.slice(O,O+p.length)==p}function TL(m,p,O){var V=ne.templateSettings;O&&$i(m,p,O)&&(p=n),m=bn(m),p=Vf({},p,V,g_);var K=Vf({},p.imports,V.imports,g_),ie=yi(K),_e=$d(K,ie),ye,Ne,et=0,tt=p.interpolate||Di,ot="__p += '",Et=Qd((p.escape||Di).source+"|"+tt.source+"|"+(tt===hi?Un:Di).source+"|"+(p.evaluate||Di).source+"|$","g"),Dt="//# sourceURL="+(Mn.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tf+"]")+` -`;m.replace(Et,function(Gt,rn,on,wl,Ji,yl){return on||(on=wl),ot+=m.slice(et,yl).replace(el,QM),rn&&(ye=!0,ot+=`' + +`)}function $7(m){return Jt(m)||Fs(m)||!!(Eg&&m&&m[Eg])}function Rr(m,p){var O=typeof m;return p=p??de,!!p&&(O=="number"||O!="symbol"&&ri.test(m))&&m>-1&&m%1==0&&m0){if(++p>=$)return arguments[0]}else p=0;return m.apply(n,arguments)}}function Pf(m,p){var O=-1,V=m.length,K=V-1;for(p=p===n?V:p;++O1?m[p-1]:n;return O=typeof O=="function"?(m.pop(),O):n,N_(m,O)});function B_(m){var p=ne(m);return p.__chain__=!0,p}function oC(m,p){return p(m),m}function Nf(m,p){return p(m)}var aC=Ir(function(m){var p=m.length,O=p?m[0]:0,V=this.__wrapped__,K=function(ie){return ih(ie,m)};return p>1||this.__actions__.length||!(V instanceof sn)||!Rr(O)?this.thru(K):(V=V.slice(O,+O+(p?1:0)),V.__actions__.push({func:Nf,args:[K],thisArg:n}),new zl(V,this.__chain__).thru(function(ie){return p&&!ie.length&&ie.push(n),ie}))});function uC(){return B_(this)}function fC(){return new zl(this.value(),this.__chain__)}function cC(){this.__values__===n&&(this.__values__=$_(this.value()));var m=this.__index__>=this.__values__.length,p=m?n:this.__values__[this.__index__++];return{done:m,value:p}}function dC(){return this}function hC(m){for(var p,O=this;O instanceof kf;){var V=C_(O);V.__index__=0,V.__values__=n,p?K.__wrapped__=V:p=V;var K=V;O=O.__wrapped__}return K.__wrapped__=m,p}function mC(){var m=this.__wrapped__;if(m instanceof sn){var p=m;return this.__actions__.length&&(p=new sn(this)),p=p.reverse(),p.__actions__.push({func:Nf,args:[Ih],thisArg:n}),new zl(p,this.__chain__)}return this.thru(Ih)}function gC(){return Qg(this.__wrapped__,this.__actions__)}var _C=Of(function(m,p,O){Mn.call(m,O)?++m[O]:Cr(m,O,1)});function pC(m,p,O){var V=Jt(m)?cg:o7;return O&&$i(m,p,O)&&(p=n),V(m,Ut(p,3))}function bC(m,p){var O=Jt(m)?ls:Ng;return O(m,Ut(p,3))}var vC=u_(L_),kC=u_(I_);function wC(m,p){return Ai(Bf(m,p),1)}function yC(m,p){return Ai(Bf(m,p),X)}function TC(m,p,O){return O=O===n?1:xt(O),Ai(Bf(m,p),O)}function z_(m,p){var O=Jt(m)?Nl:as;return O(m,Ut(p,3))}function H_(m,p){var O=Jt(m)?VM:Pg;return O(m,Ut(p,3))}var SC=Of(function(m,p,O){Mn.call(m,O)?m[O].push(p):Cr(m,O,[p])});function EC(m,p,O,V){m=il(m)?m:Lo(m),O=O&&!V?xt(O):0;var K=m.length;return O<0&&(O=_i(K+O,0)),Gf(m)?O<=K&&m.indexOf(p,O)>-1:!!K&&bo(m,p,O)>-1}var MC=ln(function(m,p,O){var V=-1,K=typeof p=="function",ie=il(m)?Ge(m.length):[];return as(m,function(_e){ie[++V]=K?pl(p,_e,O):Na(_e,p,O)}),ie}),OC=Of(function(m,p,O){Cr(m,O,p)});function Bf(m,p){var O=Jt(m)?Fn:Gg;return O(m,Ut(p,3))}function AC(m,p,O,V){return m==null?[]:(Jt(p)||(p=p==null?[]:[p]),O=V?n:O,Jt(O)||(O=O==null?[]:[O]),jg(m,p,O))}var CC=Of(function(m,p,O){m[O?0:1].push(p)},function(){return[[],[]]});function LC(m,p,O){var V=Jt(m)?qd:gg,K=arguments.length<3;return V(m,Ut(p,4),O,K,as)}function IC(m,p,O){var V=Jt(m)?WM:gg,K=arguments.length<3;return V(m,Ut(p,4),O,K,Pg)}function RC(m,p){var O=Jt(m)?ls:Ng;return O(m,Uf(Ut(p,3)))}function DC(m){var p=Jt(m)?Lg:E7;return p(m)}function PC(m,p,O){(O?$i(m,p,O):p===n)?p=1:p=xt(p);var V=Jt(m)?n7:M7;return V(m,p)}function NC(m){var p=Jt(m)?i7:A7;return p(m)}function BC(m){if(m==null)return 0;if(il(m))return Gf(m)?ko(m):m.length;var p=Bi(m);return p==Oe||p==mt?m.size:uh(m).length}function zC(m,p,O){var V=Jt(m)?jd:C7;return O&&$i(m,p,O)&&(p=n),V(m,Ut(p,3))}var HC=ln(function(m,p){if(m==null)return[];var O=p.length;return O>1&&$i(m,p[0],p[1])?p=[]:O>2&&$i(p[0],p[1],p[2])&&(p=[p[0]]),jg(m,Ai(p,1),[])}),zf=bO||function(){return Oi.Date.now()};function UC(m,p){if(typeof p!="function")throw new Bl(s);return m=xt(m),function(){if(--m<1)return p.apply(this,arguments)}}function U_(m,p,O){return p=O?n:p,p=m&&p==null?m.length:p,Lr(m,N,n,n,n,n,p)}function F_(m,p){var O;if(typeof p!="function")throw new Bl(s);return m=xt(m),function(){return--m>0&&(O=p.apply(this,arguments)),m<=1&&(p=n),O}}var Dh=ln(function(m,p,O){var V=v;if(O.length){var K=ss(O,Ao(Dh));V|=M}return Lr(m,V,p,O,K)}),G_=ln(function(m,p,O){var V=v|S;if(O.length){var K=ss(O,Ao(G_));V|=M}return Lr(p,V,m,O,K)});function V_(m,p,O){p=O?n:p;var V=Lr(m,C,n,n,n,n,n,p);return V.placeholder=V_.placeholder,V}function W_(m,p,O){p=O?n:p;var V=Lr(m,I,n,n,n,n,n,p);return V.placeholder=W_.placeholder,V}function q_(m,p,O){var V,K,ie,_e,ye,Ne,et=0,tt=!1,ot=!1,Et=!0;if(typeof m!="function")throw new Bl(s);p=Gl(p)||0,jn(O)&&(tt=!!O.leading,ot="maxWait"in O,ie=ot?_i(Gl(O.maxWait)||0,p):ie,Et="trailing"in O?!!O.trailing:Et);function Dt(ti){var er=V,Nr=K;return V=K=n,et=ti,_e=m.apply(Nr,er),_e}function Ft(ti){return et=ti,ye=Fa(rn,p),tt?Dt(ti):_e}function nn(ti){var er=ti-Ne,Nr=ti-et,up=p-er;return ot?Ni(up,ie-Nr):up}function Gt(ti){var er=ti-Ne,Nr=ti-et;return Ne===n||er>=p||er<0||ot&&Nr>=ie}function rn(){var ti=zf();if(Gt(ti))return on(ti);ye=Fa(rn,nn(ti))}function on(ti){return ye=n,Et&&V?Dt(ti):(V=K=n,_e)}function wl(){ye!==n&&e_(ye),et=0,V=Ne=K=ye=n}function Ji(){return ye===n?_e:on(zf())}function yl(){var ti=zf(),er=Gt(ti);if(V=arguments,K=this,Ne=ti,er){if(ye===n)return Ft(Ne);if(ot)return e_(ye),ye=Fa(rn,p),Dt(Ne)}return ye===n&&(ye=Fa(rn,p)),_e}return yl.cancel=wl,yl.flush=Ji,yl}var FC=ln(function(m,p){return Dg(m,1,p)}),GC=ln(function(m,p,O){return Dg(m,Gl(p)||0,O)});function VC(m){return Lr(m,W)}function Hf(m,p){if(typeof m!="function"||p!=null&&typeof p!="function")throw new Bl(s);var O=function(){var V=arguments,K=p?p.apply(this,V):V[0],ie=O.cache;if(ie.has(K))return ie.get(K);var _e=m.apply(this,V);return O.cache=ie.set(K,_e)||ie,_e};return O.cache=new(Hf.Cache||Ar),O}Hf.Cache=Ar;function Uf(m){if(typeof m!="function")throw new Bl(s);return function(){var p=arguments;switch(p.length){case 0:return!m.call(this);case 1:return!m.call(this,p[0]);case 2:return!m.call(this,p[0],p[1]);case 3:return!m.call(this,p[0],p[1],p[2])}return!m.apply(this,p)}}function WC(m){return F_(2,m)}var qC=L7(function(m,p){p=p.length==1&&Jt(p[0])?Fn(p[0],bl(Ut())):Fn(Ai(p,1),bl(Ut()));var O=p.length;return ln(function(V){for(var K=-1,ie=Ni(V.length,O);++K=p}),Fs=Hg(function(){return arguments}())?Hg:function(m){return $n(m)&&Mn.call(m,"callee")&&!Sg.call(m,"callee")},Jt=Ge.isArray,r9=rg?bl(rg):h7;function il(m){return m!=null&&Ff(m.length)&&!Dr(m)}function ei(m){return $n(m)&&il(m)}function s9(m){return m===!0||m===!1||$n(m)&&Ki(m)==We}var ds=kO||jh,o9=sg?bl(sg):m7;function a9(m){return $n(m)&&m.nodeType===1&&!Ga(m)}function u9(m){if(m==null)return!0;if(il(m)&&(Jt(m)||typeof m=="string"||typeof m.splice=="function"||ds(m)||Co(m)||Fs(m)))return!m.length;var p=Bi(m);if(p==Oe||p==mt)return!m.size;if(Ua(m))return!uh(m).length;for(var O in m)if(Mn.call(m,O))return!1;return!0}function f9(m,p){return Ba(m,p)}function c9(m,p,O){O=typeof O=="function"?O:n;var V=O?O(m,p):n;return V===n?Ba(m,p,n,O):!!V}function Nh(m){if(!$n(m))return!1;var p=Ki(m);return p==be||p==ve||typeof m.message=="string"&&typeof m.name=="string"&&!Ga(m)}function d9(m){return typeof m=="number"&&Mg(m)}function Dr(m){if(!jn(m))return!1;var p=Ki(m);return p==ue||p==nt||p==Ee||p==At}function Y_(m){return typeof m=="number"&&m==xt(m)}function Ff(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=de}function jn(m){var p=typeof m;return m!=null&&(p=="object"||p=="function")}function $n(m){return m!=null&&typeof m=="object"}var Z_=og?bl(og):_7;function h9(m,p){return m===p||ah(m,p,Eh(p))}function m9(m,p,O){return O=typeof O=="function"?O:n,ah(m,p,Eh(p),O)}function g9(m){return X_(m)&&m!=+m}function _9(m){if(x7(m))throw new $t(r);return Ug(m)}function p9(m){return m===null}function b9(m){return m==null}function X_(m){return typeof m=="number"||$n(m)&&Ki(m)==dt}function Ga(m){if(!$n(m)||Ki(m)!=at)return!1;var p=hf(m);if(p===null)return!0;var O=Mn.call(p,"constructor")&&p.constructor;return typeof O=="function"&&O instanceof O&&uf.call(O)==mO}var Bh=ag?bl(ag):p7;function v9(m){return Y_(m)&&m>=-de&&m<=de}var K_=ug?bl(ug):b7;function Gf(m){return typeof m=="string"||!Jt(m)&&$n(m)&&Ki(m)==we}function kl(m){return typeof m=="symbol"||$n(m)&&Ki(m)==gt}var Co=fg?bl(fg):v7;function k9(m){return m===n}function w9(m){return $n(m)&&Bi(m)==Ht}function y9(m){return $n(m)&&Ki(m)==Wt}var T9=If(fh),S9=If(function(m,p){return m<=p});function $_(m){if(!m)return[];if(il(m))return Gf(m)?Jl(m):nl(m);if(Aa&&m[Aa])return nO(m[Aa]());var p=Bi(m),O=p==Oe?Jd:p==mt?sf:Lo;return O(m)}function Pr(m){if(!m)return m===0?m:0;if(m=Gl(m),m===X||m===-X){var p=m<0?-1:1;return p*re}return m===m?m:0}function xt(m){var p=Pr(m),O=p%1;return p===p?O?p-O:p:0}function J_(m){return m?Bs(xt(m),0,me):0}function Gl(m){if(typeof m=="number")return m;if(kl(m))return x;if(jn(m)){var p=typeof m.valueOf=="function"?m.valueOf():m;m=jn(p)?p+"":p}if(typeof m!="string")return m===0?m:+m;m=_g(m);var O=pn.test(m);return O||gl.test(m)?UM(m.slice(2),O?2:8):Tn.test(m)?x:+m}function Q_(m){return mr(m,ll(m))}function E9(m){return m?Bs(xt(m),-de,de):m===0?m:0}function bn(m){return m==null?"":vl(m)}var M9=Mo(function(m,p){if(Ua(p)||il(p)){mr(p,yi(p),m);return}for(var O in p)Mn.call(p,O)&&Da(m,O,p[O])}),x_=Mo(function(m,p){mr(p,ll(p),m)}),Vf=Mo(function(m,p,O,V){mr(p,ll(p),m,V)}),O9=Mo(function(m,p,O,V){mr(p,yi(p),m,V)}),A9=Ir(ih);function C9(m,p){var O=Eo(m);return p==null?O:Ig(O,p)}var L9=ln(function(m,p){m=In(m);var O=-1,V=p.length,K=V>2?p[2]:n;for(K&&$i(p[0],p[1],K)&&(V=1);++O1),ie}),mr(m,Th(m),O),V&&(O=Hl(O,c|d|h,G7));for(var K=p.length;K--;)gh(O,p[K]);return O});function X9(m,p){return tp(m,Uf(Ut(p)))}var K9=Ir(function(m,p){return m==null?{}:y7(m,p)});function tp(m,p){if(m==null)return{};var O=Fn(Th(m),function(V){return[V]});return p=Ut(p),Yg(m,O,function(V,K){return p(V,K[0])})}function $9(m,p,O){p=fs(p,m);var V=-1,K=p.length;for(K||(K=1,m=n);++Vp){var V=m;m=p,p=V}if(O||m%1||p%1){var K=Og();return Ni(m+K*(p-m+HM("1e-"+((K+"").length-1))),p)}return dh(m,p)}var oL=Oo(function(m,p,O){return p=p.toLowerCase(),m+(O?lp(p):p)});function lp(m){return Uh(bn(m).toLowerCase())}function rp(m){return m=bn(m),m&&m.replace(Sn,JM).replace(is,"")}function aL(m,p,O){m=bn(m),p=vl(p);var V=m.length;O=O===n?V:Bs(xt(O),0,V);var K=O;return O-=p.length,O>=0&&m.slice(O,K)==p}function uL(m){return m=bn(m),m&&qn.test(m)?m.replace(Tt,QM):m}function fL(m){return m=bn(m),m&&ur.test(m)?m.replace(Zi,"\\$&"):m}var cL=Oo(function(m,p,O){return m+(O?"-":"")+p.toLowerCase()}),dL=Oo(function(m,p,O){return m+(O?" ":"")+p.toLowerCase()}),hL=a_("toLowerCase");function mL(m,p,O){m=bn(m),p=xt(p);var V=p?ko(m):0;if(!p||V>=p)return m;var K=(p-V)/2;return Lf(pf(K),O)+m+Lf(_f(K),O)}function gL(m,p,O){m=bn(m),p=xt(p);var V=p?ko(m):0;return p&&V>>0,O?(m=bn(m),m&&(typeof p=="string"||p!=null&&!Bh(p))&&(p=vl(p),!p&&vo(m))?cs(Jl(m),0,O):m.split(p,O)):[]}var yL=Oo(function(m,p,O){return m+(O?" ":"")+Uh(p)});function TL(m,p,O){return m=bn(m),O=O==null?0:Bs(xt(O),0,m.length),p=vl(p),m.slice(O,O+p.length)==p}function SL(m,p,O){var V=ne.templateSettings;O&&$i(m,p,O)&&(p=n),m=bn(m),p=Vf({},p,V,g_);var K=Vf({},p.imports,V.imports,g_),ie=yi(K),_e=$d(K,ie),ye,Ne,et=0,tt=p.interpolate||Di,ot="__p += '",Et=Qd((p.escape||Di).source+"|"+tt.source+"|"+(tt===hi?Un:Di).source+"|"+(p.evaluate||Di).source+"|$","g"),Dt="//# sourceURL="+(Mn.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++tf+"]")+` +`;m.replace(Et,function(Gt,rn,on,wl,Ji,yl){return on||(on=wl),ot+=m.slice(et,yl).replace(el,xM),rn&&(ye=!0,ot+=`' + __e(`+rn+`) + '`),Ji&&(Ne=!0,ot+=`'; `+Ji+`; @@ -55,9 +55,9 @@ __p += '`),on&&(ot+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+ot+`return __p -}`;var nn=op(function(){return mn(ie,Dt+"return "+ot).apply(n,_e)});if(nn.source=ot,Nh(nn))throw nn;return nn}function SL(m){return bn(m).toLowerCase()}function EL(m){return bn(m).toUpperCase()}function ML(m,p,O){if(m=bn(m),m&&(O||p===n))return _g(m);if(!m||!(p=vl(p)))return m;var V=Jl(m),K=Jl(p),ie=pg(V,K),_e=bg(V,K)+1;return cs(V,ie,_e).join("")}function OL(m,p,O){if(m=bn(m),m&&(O||p===n))return m.slice(0,kg(m)+1);if(!m||!(p=vl(p)))return m;var V=Jl(m),K=bg(V,Jl(p))+1;return cs(V,0,K).join("")}function AL(m,p,O){if(m=bn(m),m&&(O||p===n))return m.replace(Kn,"");if(!m||!(p=vl(p)))return m;var V=Jl(m),K=pg(V,Jl(p));return cs(V,K).join("")}function CL(m,p){var O=D,V=G;if(jn(p)){var K="separator"in p?p.separator:K;O="length"in p?xt(p.length):O,V="omission"in p?vl(p.omission):V}m=bn(m);var ie=m.length;if(vo(m)){var _e=Jl(m);ie=_e.length}if(O>=ie)return m;var ye=O-ko(V);if(ye<1)return V;var Ne=_e?cs(_e,0,ye).join(""):m.slice(0,ye);if(K===n)return Ne+V;if(_e&&(ye+=Ne.length-ye),Bh(K)){if(m.slice(ye).search(K)){var et,tt=Ne;for(K.global||(K=Qd(K.source,bn(tn.exec(K))+"g")),K.lastIndex=0;et=K.exec(tt);)var ot=et.index;Ne=Ne.slice(0,ot===n?ye:ot)}}else if(m.indexOf(vl(K),ye)!=ye){var Et=Ne.lastIndexOf(K);Et>-1&&(Ne=Ne.slice(0,Et))}return Ne+V}function LL(m){return m=bn(m),m&&Bt.test(m)?m.replace(He,rO):m}var IL=Oo(function(m,p,O){return m+(O?" ":"")+p.toUpperCase()}),Uh=a_("toUpperCase");function sp(m,p,O){return m=bn(m),p=O?n:p,p===n?eO(m)?aO(m):jM(m):m.match(p)||[]}var op=ln(function(m,p){try{return pl(m,n,p)}catch(O){return Nh(O)?O:new $t(O)}}),RL=Ir(function(m,p){return Nl(p,function(O){O=gr(O),Cr(m,O,Dh(m[O],m))}),m});function DL(m){var p=m==null?0:m.length,O=Ut();return m=p?Fn(m,function(V){if(typeof V[1]!="function")throw new Bl(s);return[O(V[0]),V[1]]}):[],ln(function(V){for(var K=-1;++Kde)return[];var O=me,V=Ni(m,me);p=Ut(p),m-=me;for(var K=Kd(V,p);++O0||p<0)?new sn(O):(m<0?O=O.takeRight(-m):m&&(O=O.drop(m)),p!==n&&(p=xt(p),O=p<0?O.dropRight(-p):O.take(p-m)),O)},sn.prototype.takeRightWhile=function(m){return this.reverse().takeWhile(m).reverse()},sn.prototype.toArray=function(){return this.take(me)},hr(sn.prototype,function(m,p){var O=/^(?:filter|find|map|reject)|While$/.test(p),V=/^(?:head|last)$/.test(p),K=ne[V?"take"+(p=="last"?"Right":""):p],ie=V||/^find/.test(p);K&&(ne.prototype[p]=function(){var _e=this.__wrapped__,ye=V?[1]:arguments,Ne=_e instanceof sn,et=ye[0],tt=Ne||Jt(_e),ot=function(rn){var on=K.apply(ne,rs([rn],ye));return V&&Et?on[0]:on};tt&&O&&typeof et=="function"&&et.length!=1&&(Ne=tt=!1);var Et=this.__chain__,Dt=!!this.__actions__.length,Ft=ie&&!Et,nn=Ne&&!Dt;if(!ie&&tt){_e=nn?_e:new sn(this);var Gt=m.apply(_e,ye);return Gt.__actions__.push({func:Nf,args:[ot],thisArg:n}),new zl(Gt,Et)}return Ft&&nn?m.apply(this,ye):(Gt=this.thru(ot),Ft?V?Gt.value()[0]:Gt.value():Gt)})}),Nl(["pop","push","shift","sort","splice","unshift"],function(m){var p=of[m],O=/^(?:push|sort|unshift)$/.test(m)?"tap":"thru",V=/^(?:pop|shift)$/.test(m);ne.prototype[m]=function(){var K=arguments;if(V&&!this.__chain__){var ie=this.value();return p.apply(Jt(ie)?ie:[],K)}return this[O](function(_e){return p.apply(Jt(_e)?_e:[],K)})}}),hr(sn.prototype,function(m,p){var O=ne[p];if(O){var V=O.name+"";Mn.call(So,V)||(So[V]=[]),So[V].push({name:p,func:O})}}),So[Af(n,S).name]=[{name:"wrapper",func:n}],sn.prototype.clone=LO,sn.prototype.reverse=IO,sn.prototype.value=RO,ne.prototype.at=oC,ne.prototype.chain=aC,ne.prototype.commit=uC,ne.prototype.next=fC,ne.prototype.plant=dC,ne.prototype.reverse=hC,ne.prototype.toJSON=ne.prototype.valueOf=ne.prototype.value=mC,ne.prototype.first=ne.prototype.head,Aa&&(ne.prototype[Aa]=cC),ne},wo=uO();Rs?((Rs.exports=wo)._=wo,Gd._=wo):Oi._=wo}).call(Wa)})(Ec,Ec.exports);var EZ=Ec.exports;const xk=KT(EZ);function MZ(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function OZ(t){let e;return{c(){e=q("Logs")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function AZ(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[MZ]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[OZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&8388608&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&8388608&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function CZ(t){let e,n,i,l;return e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[AZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),i=R("h2"),i.textContent="Decision log"},m(r,s){H(e,r,s),y(r,n,s),y(r,i,s),l=!0},p(r,s){const o={};s&8388608&&(o.$$scope={dirty:s,ctx:r}),e.$set(o)},i(r){l||(b(e.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),l=!1},d(r){r&&(w(n),w(i)),U(e,r)}}}function LZ(t){let e,n;return e=new zn({props:{$$slots:{default:[CZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8388608&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function IZ(t){let e;return{c(){e=q(`IMPORTANT: If you are using GateSentry on a Raspberry Pi please make +}`;var nn=op(function(){return mn(ie,Dt+"return "+ot).apply(n,_e)});if(nn.source=ot,Nh(nn))throw nn;return nn}function EL(m){return bn(m).toLowerCase()}function ML(m){return bn(m).toUpperCase()}function OL(m,p,O){if(m=bn(m),m&&(O||p===n))return _g(m);if(!m||!(p=vl(p)))return m;var V=Jl(m),K=Jl(p),ie=pg(V,K),_e=bg(V,K)+1;return cs(V,ie,_e).join("")}function AL(m,p,O){if(m=bn(m),m&&(O||p===n))return m.slice(0,kg(m)+1);if(!m||!(p=vl(p)))return m;var V=Jl(m),K=bg(V,Jl(p))+1;return cs(V,0,K).join("")}function CL(m,p,O){if(m=bn(m),m&&(O||p===n))return m.replace(Kn,"");if(!m||!(p=vl(p)))return m;var V=Jl(m),K=pg(V,Jl(p));return cs(V,K).join("")}function LL(m,p){var O=D,V=G;if(jn(p)){var K="separator"in p?p.separator:K;O="length"in p?xt(p.length):O,V="omission"in p?vl(p.omission):V}m=bn(m);var ie=m.length;if(vo(m)){var _e=Jl(m);ie=_e.length}if(O>=ie)return m;var ye=O-ko(V);if(ye<1)return V;var Ne=_e?cs(_e,0,ye).join(""):m.slice(0,ye);if(K===n)return Ne+V;if(_e&&(ye+=Ne.length-ye),Bh(K)){if(m.slice(ye).search(K)){var et,tt=Ne;for(K.global||(K=Qd(K.source,bn(tn.exec(K))+"g")),K.lastIndex=0;et=K.exec(tt);)var ot=et.index;Ne=Ne.slice(0,ot===n?ye:ot)}}else if(m.indexOf(vl(K),ye)!=ye){var Et=Ne.lastIndexOf(K);Et>-1&&(Ne=Ne.slice(0,Et))}return Ne+V}function IL(m){return m=bn(m),m&&Bt.test(m)?m.replace(He,sO):m}var RL=Oo(function(m,p,O){return m+(O?" ":"")+p.toUpperCase()}),Uh=a_("toUpperCase");function sp(m,p,O){return m=bn(m),p=O?n:p,p===n?tO(m)?uO(m):YM(m):m.match(p)||[]}var op=ln(function(m,p){try{return pl(m,n,p)}catch(O){return Nh(O)?O:new $t(O)}}),DL=Ir(function(m,p){return Nl(p,function(O){O=gr(O),Cr(m,O,Dh(m[O],m))}),m});function PL(m){var p=m==null?0:m.length,O=Ut();return m=p?Fn(m,function(V){if(typeof V[1]!="function")throw new Bl(s);return[O(V[0]),V[1]]}):[],ln(function(V){for(var K=-1;++Kde)return[];var O=me,V=Ni(m,me);p=Ut(p),m-=me;for(var K=Kd(V,p);++O0||p<0)?new sn(O):(m<0?O=O.takeRight(-m):m&&(O=O.drop(m)),p!==n&&(p=xt(p),O=p<0?O.dropRight(-p):O.take(p-m)),O)},sn.prototype.takeRightWhile=function(m){return this.reverse().takeWhile(m).reverse()},sn.prototype.toArray=function(){return this.take(me)},hr(sn.prototype,function(m,p){var O=/^(?:filter|find|map|reject)|While$/.test(p),V=/^(?:head|last)$/.test(p),K=ne[V?"take"+(p=="last"?"Right":""):p],ie=V||/^find/.test(p);K&&(ne.prototype[p]=function(){var _e=this.__wrapped__,ye=V?[1]:arguments,Ne=_e instanceof sn,et=ye[0],tt=Ne||Jt(_e),ot=function(rn){var on=K.apply(ne,rs([rn],ye));return V&&Et?on[0]:on};tt&&O&&typeof et=="function"&&et.length!=1&&(Ne=tt=!1);var Et=this.__chain__,Dt=!!this.__actions__.length,Ft=ie&&!Et,nn=Ne&&!Dt;if(!ie&&tt){_e=nn?_e:new sn(this);var Gt=m.apply(_e,ye);return Gt.__actions__.push({func:Nf,args:[ot],thisArg:n}),new zl(Gt,Et)}return Ft&&nn?m.apply(this,ye):(Gt=this.thru(ot),Ft?V?Gt.value()[0]:Gt.value():Gt)})}),Nl(["pop","push","shift","sort","splice","unshift"],function(m){var p=of[m],O=/^(?:push|sort|unshift)$/.test(m)?"tap":"thru",V=/^(?:pop|shift)$/.test(m);ne.prototype[m]=function(){var K=arguments;if(V&&!this.__chain__){var ie=this.value();return p.apply(Jt(ie)?ie:[],K)}return this[O](function(_e){return p.apply(Jt(_e)?_e:[],K)})}}),hr(sn.prototype,function(m,p){var O=ne[p];if(O){var V=O.name+"";Mn.call(So,V)||(So[V]=[]),So[V].push({name:p,func:O})}}),So[Af(n,S).name]=[{name:"wrapper",func:n}],sn.prototype.clone=IO,sn.prototype.reverse=RO,sn.prototype.value=DO,ne.prototype.at=aC,ne.prototype.chain=uC,ne.prototype.commit=fC,ne.prototype.next=cC,ne.prototype.plant=hC,ne.prototype.reverse=mC,ne.prototype.toJSON=ne.prototype.valueOf=ne.prototype.value=gC,ne.prototype.first=ne.prototype.head,Aa&&(ne.prototype[Aa]=dC),ne},wo=fO();Rs?((Rs.exports=wo)._=wo,Gd._=wo):Oi._=wo}).call(Wa)})(Ec,Ec.exports);var EZ=Ec.exports;const xk=$T(EZ);function MZ(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function OZ(t){let e;return{c(){e=q("Logs")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function AZ(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[MZ]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[OZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&8388608&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&8388608&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function CZ(t){let e,n,i,l;return e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[AZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),i=R("h2"),i.textContent="Decision log"},m(r,s){H(e,r,s),y(r,n,s),y(r,i,s),l=!0},p(r,s){const o={};s&8388608&&(o.$$scope={dirty:s,ctx:r}),e.$set(o)},i(r){l||(b(e.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),l=!1},d(r){r&&(w(n),w(i)),U(e,r)}}}function LZ(t){let e,n;return e=new zn({props:{$$slots:{default:[CZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8388608&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function IZ(t){let e;return{c(){e=q(`IMPORTANT: If you are using GateSentry on a Raspberry Pi please make sure to change GateSentry's log file location to RAM. You can do that by - going to Settings and changing the log file location to "/tmp/log.db".`)},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function RZ(t){let e,n,i,l,r,s,o,a,u,f,c,d;return e=new Ln({props:{value:"",text:"All actions"}}),i=new Ln({props:{value:"block",text:"Block"}}),r=new Ln({props:{value:"allow",text:"Allow"}}),o=new Ln({props:{value:"bypass",text:"Bypass"}}),u=new Ln({props:{value:"inspect",text:"Inspect"}}),c=new Ln({props:{value:"error",text:"Error"}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment),s=B(),F(o.$$.fragment),a=B(),F(u.$$.fragment),f=B(),F(c.$$.fragment)},m(h,g){H(e,h,g),y(h,n,g),H(i,h,g),y(h,l,g),H(r,h,g),y(h,s,g),H(o,h,g),y(h,a,g),H(u,h,g),y(h,f,g),H(c,h,g),d=!0},p:he,i(h){d||(b(e.$$.fragment,h),b(i.$$.fragment,h),b(r.$$.fragment,h),b(o.$$.fragment,h),b(u.$$.fragment,h),b(c.$$.fragment,h),d=!0)},o(h){k(e.$$.fragment,h),k(i.$$.fragment,h),k(r.$$.fragment,h),k(o.$$.fragment,h),k(u.$$.fragment,h),k(c.$$.fragment,h),d=!1},d(h){h&&(w(n),w(l),w(s),w(a),w(f)),U(e,h),U(i,h),U(r,h),U(o,h),U(u,h),U(c,h)}}}function DZ(t){let e,n,i,l,r,s,o,a,u,f;return e=new Ln({props:{value:"",text:"All layers"}}),i=new Ln({props:{value:"dns",text:"DNS"}}),r=new Ln({props:{value:"explicit_proxy",text:"Explicit proxy"}}),o=new Ln({props:{value:"transparent_proxy",text:"Transparent proxy"}}),u=new Ln({props:{value:"content",text:"Content"}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment),s=B(),F(o.$$.fragment),a=B(),F(u.$$.fragment)},m(c,d){H(e,c,d),y(c,n,d),H(i,c,d),y(c,l,d),H(r,c,d),y(c,s,d),H(o,c,d),y(c,a,d),H(u,c,d),f=!0},p:he,i(c){f||(b(e.$$.fragment,c),b(i.$$.fragment,c),b(r.$$.fragment,c),b(o.$$.fragment,c),b(u.$$.fragment,c),f=!0)},o(c){k(e.$$.fragment,c),k(i.$$.fragment,c),k(r.$$.fragment,c),k(o.$$.fragment,c),k(u.$$.fragment,c),f=!1},d(c){c&&(w(n),w(l),w(s),w(a)),U(e,c),U(i,c),U(r,c),U(o,c),U(u,c)}}}function PZ(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I;l=new Vt({props:{$$slots:{default:[IZ]},$$scope:{ctx:t}}});function M(G){t[9](G)}let L={placeholder:"Search by domain..."};t[2]!==void 0&&(L.value=t[2]),a=new CT({props:L}),ft.push(()=>Yt(a,"value",M)),a.$on("clear",t[4]);function N(G){t[10](G)}let z={labelText:"Action",$$slots:{default:[RZ]},$$scope:{ctx:t}};t[0]!==void 0&&(z.selected=t[0]),d=new wr({props:z}),ft.push(()=>Yt(d,"selected",N));function W(G){t[11](G)}let D={labelText:"Layer",$$slots:{default:[DZ]},$$scope:{ctx:t}};return t[1]!==void 0&&(D.selected=t[1]),v=new wr({props:D}),ft.push(()=>Yt(v,"selected",W)),C=new Ol({props:{sortable:!0,size:"medium",style:"width:100%; min-height: 600px;",headers:[{key:"time",value:"Time"},{key:"client",value:"Client"},{key:"url",value:"URL"},{key:"action",value:"Action"},{key:"layer",value:"Layer"},{key:"reason",value:"Reason"}],rows:t[3]}}),{c(){e=R("div"),e.textContent="Structured filtering decisions from DNS and proxy layers.",n=B(),i=R("div"),F(l.$$.fragment),r=B(),s=R("div"),o=R("div"),F(a.$$.fragment),f=B(),c=R("div"),F(d.$$.fragment),g=B(),_=R("div"),F(v.$$.fragment),A=B(),F(C.$$.fragment),wt(e,"margin","20px 0px"),wt(i,"margin-bottom","15px"),wt(o,"flex","1"),wt(o,"min-width","200px"),wt(c,"min-width","160px"),wt(_,"min-width","160px"),wt(s,"display","flex"),wt(s,"gap","16px"),wt(s,"align-items","flex-end"),wt(s,"flex-wrap","wrap"),wt(s,"margin-bottom","15px")},m(G,$){y(G,e,$),y(G,n,$),y(G,i,$),H(l,i,null),y(G,r,$),y(G,s,$),T(s,o),H(a,o,null),T(s,f),T(s,c),H(d,c,null),T(s,g),T(s,_),H(v,_,null),y(G,A,$),H(C,G,$),I=!0},p(G,$){const j={};$&8388608&&(j.$$scope={dirty:$,ctx:G}),l.$set(j);const Q={};!u&&$&4&&(u=!0,Q.value=G[2],jt(()=>u=!1)),a.$set(Q);const le={};$&8388608&&(le.$$scope={dirty:$,ctx:G}),!h&&$&1&&(h=!0,le.selected=G[0],jt(()=>h=!1)),d.$set(le);const oe={};$&8388608&&(oe.$$scope={dirty:$,ctx:G}),!S&&$&2&&(S=!0,oe.selected=G[1],jt(()=>S=!1)),v.$set(oe);const X={};$&8&&(X.rows=G[3]),C.$set(X)},i(G){I||(b(l.$$.fragment,G),b(a.$$.fragment,G),b(d.$$.fragment,G),b(v.$$.fragment,G),b(C.$$.fragment,G),I=!0)},o(G){k(l.$$.fragment,G),k(a.$$.fragment,G),k(d.$$.fragment,G),k(v.$$.fragment,G),k(C.$$.fragment,G),I=!1},d(G){G&&(w(e),w(n),w(i),w(r),w(s),w(A)),U(l),U(a),U(d),U(v),U(C,G)}}}function NZ(t){let e,n;return e=new zn({props:{$$slots:{default:[PZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8388623&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function BZ(t){let e,n,i,l;return e=new dl({props:{$$slots:{default:[LZ]},$$scope:{ctx:t}}}),i=new dl({props:{$$slots:{default:[NZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,[s]){const o={};s&8388608&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&8388623&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function zZ(t,e,n){let i,l;Mt(t,An,D=>n(18,l=D));let r="",s="",o="",a=[],u=new Map,f=null,c=null,d=!1,h=!1,g=!1,_=!1,v=!1,S="";const A=()=>{const D=[];return r.length>0&&D.push("domain="+encodeURIComponent(r)),s&&D.push("action="+s),o&&D.push("layer="+o),D.length>0?"?"+D.join("&"):""},C=async()=>{if(d||v)return;d=!0;const D=A();try{const G=await l.api.doCall("/decisions"+D);!v&&D===A()&&n(5,a=(G==null?void 0:G.items)||[])}catch{}finally{if(d=!1,v)return;h?(h=!1,C()):f=setTimeout(C,5e3)}},I=async()=>{if(!(g||v)){g=!0;try{const D=await l.api.doCall("/devices");v||n(6,u=TZ(D==null?void 0:D.devices))}catch{}finally{g=!1,v||(c=setTimeout(I,6e4))}}},M=()=>{if(f&&clearTimeout(f),f=null,d){h=!0;return}C()},L=()=>{n(2,r=""),M()};_n(()=>{n(7,_=!0),n(8,S=s+"\0"+o),C(),I()}),Es(()=>{v=!0,f&&clearTimeout(f),c&&clearTimeout(c)});function N(D){r=D,n(2,r)}function z(D){s=D,n(0,s)}function W(D){o=D,n(1,o)}return t.$$.update=()=>{if(t.$$.dirty&96&&n(3,i=a.map((D,G)=>({id:D.ip+D.time+G+D.url,time:yZ(D.time*1e3),client:SZ(u,D.ip),url:xk.truncate(D.url,{length:50}),action:D.action||"",layer:D.layer||"",reason:xk.truncate(D.reason||D.matched_rule||"",{length:40})}))),t.$$.dirty&387){const D=s+"\0"+o;_&&D!==S&&(n(8,S=D),M())}},[s,o,r,i,L,a,u,_,S,N,z,W]}class HZ extends De{constructor(e){super(),Re(this,e,zZ,BZ,Ie,{})}}let Mc=[{type:"link",text:"Home",href:"/",icon:lq},{type:"link",text:"Logs",href:"/logs",icon:LW},{type:"link",text:"Settings",href:"/settings",icon:Iq},{type:"link",text:"DNS",href:"/dns",icon:Aq},{type:"link",text:"Devices",href:"/devices",icon:jW},{type:"link",text:"Policies",href:"/rules",icon:Tq},{type:"link",text:"Services",href:"/services",icon:zq},{type:"menu",text:"HTTPS inspection",icon:oq,children:[{type:"link",text:"Blocked keywords",href:"/blockedkeywords",icon:Jh},{type:"link",text:"Blocked content types",href:"/blockedfiletypes",icon:Jh},{type:"link",text:"Sites not inspected",href:"/excludehosts",icon:Jh}]},{type:"link",text:"Stats",href:"/stats",icon:tq},{type:"link",text:"AI",href:"/ai",icon:hq},{type:"link",text:"Users",href:"/users",icon:Yq}];function e3(t,e,n){const i=t.slice();return i[5]=e[n],i}function t3(t,e,n){const i=t.slice();return i[8]=e[n],i}function UZ(t){let e,n;return e=new sV({props:{text:t[5].text,$$slots:{default:[GZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.text=i[5].text),l&2049&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function FZ(t){let e,n;function i(){return t[2](t[5])}return e=new VT({props:{text:t[5].text}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.text=t[5].text),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function n3(t){let e,n;function i(){return t[3](t[8])}return e=new VT({props:{text:t[8].text}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.text=t[8].text),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function GZ(t){let e,n,i=ct(t[5].children),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),ce()),~e?(n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i)):n=null)},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),~e&&s[e].d(a)}}}function VZ(t){let e,n,i=ct(t[0]),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;sn(1,l=a));let r=[...Mc];Cl(()=>{i?n(0,r=[...Mc]):n(0,r=[])});const s=a=>{Vi(a.href)},o=a=>{Vi(a.href)};return t.$$.update=()=>{t.$$.dirty&2&&(i=l.api.loggedIn)},[r,l,s,o]}class jZ extends De{constructor(e){super(),Re(this,e,qZ,WZ,Ie,{})}}function l3(t,e,n){const i=t.slice();return i[5]=e[n],i}function r3(t,e,n){const i=t.slice();return i[8]=e[n],i}function YZ(t){let e,n;return e=new GV({props:{icon:t[5].icon,text:t[5].text,$$slots:{default:[XZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.icon=i[5].icon),l&1&&(r.text=i[5].text),l&2049&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function ZZ(t){let e,n;function i(){return t[2](t[5])}return e=new WT({props:{icon:t[5].icon,text:t[5].text,isSelected:t[5].isSelected}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.icon=t[5].icon),r&1&&(s.text=t[5].text),r&1&&(s.isSelected=t[5].isSelected),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function s3(t){let e,n;function i(){return t[3](t[8])}return e=new WT({props:{icon:t[8].icon,text:t[8].text}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.icon=t[8].icon),r&1&&(s.text=t[8].text),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function XZ(t){let e,n,i=ct(t[5].children),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),ce()),~e?(n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i)):n=null)},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),~e&&s[e].d(a)}}}function KZ(t){let e,n,i,l=ct(t[0]),r=[];for(let o=0;ok(r[o],1,1,()=>{r[o]=null});return n=new eW({}),{c(){for(let o=0;on(1,l=a));let r=[...Mc];Cl(()=>{i?n(0,r=[...Mc]):n(0,r=[])});const s=a=>{Vi(a.href)},o=a=>{Vi(a.href)};return t.$$.update=()=>{t.$$.dirty&2&&(i=l.api.loggedIn)},[r,l,s,o]}class QZ extends De{constructor(e){super(),Re(this,e,JZ,$Z,Ie,{})}}function xZ(t){let e,n;return e=new Jn({props:{title:t[2],labelText:t[1],helperText:t[3],type:t[4],disabled:t[5],value:(t[6]&&t[6][t[0]])??""}}),e.$on("blur",t[7]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&4&&(r.title=i[2]),l&2&&(r.labelText=i[1]),l&8&&(r.helperText=i[3]),l&16&&(r.type=i[4]),l&32&&(r.disabled=i[5]),l&65&&(r.value=(i[6]&&i[6][i[0]])??""),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}const a3="general_settings";function eX(t,e,n){let i,l;Mt(t,ii,A=>n(11,i=A)),Mt(t,An,A=>n(12,l=A));let{keyName:r}=e,{labelText:s}=e,{title:o}=e,{helperText:a}=e,{type:u}=e,{disabled:f=!1}=e,{disableOnblur:c=!1}=e,d=null,h=null;const g=()=>{v(h)},_=async()=>{try{const A=await l.api.getSetting(a3);n(6,d=JSON.parse(A.Value))}catch{console.error("[GatesentryUI] Unable to load settings (possibly due to logout)")}},v=async A=>{const C=await l.api.setSetting(a3,JSON.stringify(A));if(console.log("response",C),C===!1?ci.add(ao({subtitle:i("Unable to save setting")},i)):ci.add(Hu({subtitle:i("Setting updated")},i)),r==="admin_password"||r==="admin_username"){An.logout(),Vi("/login");return}await _()},S=async A=>{const C=A.target.value;if(C==d[r])return;const I={...d,[r]:C};h=I,!c&&v(I)};return _n(()=>{_()}),t.$$set=A=>{"keyName"in A&&n(0,r=A.keyName),"labelText"in A&&n(1,s=A.labelText),"title"in A&&n(2,o=A.title),"helperText"in A&&n(3,a=A.helperText),"type"in A&&n(4,u=A.type),"disabled"in A&&n(5,f=A.disabled),"disableOnblur"in A&&n(8,c=A.disableOnblur)},[r,s,o,a,u,f,d,S,c,g]}class w8 extends De{constructor(e){super(),Re(this,e,eX,xZ,Ie,{keyName:0,labelText:1,title:2,helperText:3,type:4,disabled:5,disableOnblur:8,updateDataOnBackend:9})}get updateDataOnBackend(){return this.$$.ctx[9]}}function u3(t){let e,n,i,l,r;function s(a){t[8](a)}let o={icon:Dk,closeIcon:Dk,$$slots:{default:[rX]},$$scope:{ctx:t}};return t[0]!==void 0&&(o.isOpen=t[0]),e=new XG({props:o}),ft.push(()=>Yt(e,"isOpen",s)),l=new Iu({props:{open:t[3],$$slots:{default:[oX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),i=B(),F(l.$$.fragment)},m(a,u){H(e,a,u),y(a,i,u),H(l,a,u),r=!0},p(a,u){const f={};u&2090&&(f.$$scope={dirty:u,ctx:a}),!n&&u&1&&(n=!0,f.isOpen=a[0],jt(()=>n=!1)),e.$set(f);const c={};u&8&&(c.open=a[3]),u&2108&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){r||(b(e.$$.fragment,a),b(l.$$.fragment,a),r=!0)},o(a){k(e.$$.fragment,a),k(l.$$.fragment,a),r=!1},d(a){a&&w(i),U(e,a),U(l,a)}}}function tX(t){let e=t[1].api.username?`Logged in as ${t[1].api.username}`:"Logged in",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&2&&e!==(e=i[1].api.username?`Logged in as ${i[1].api.username}`:"Logged in")&&Z(n,e)},d(i){i&&w(n)}}}function nX(t){let e=t[5]("Change password")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&32&&e!==(e=i[5]("Change password")+"")&&Z(n,e)},d(i){i&&w(n)}}}function iX(t){let e;return{c(){e=q("Logout")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function lX(t){let e,n,i,l,r,s;return e=new fV({props:{$$slots:{default:[tX]},$$scope:{ctx:t}}}),i=new jv({props:{$$slots:{default:[nX]},$$scope:{ctx:t}}}),i.$on("click",t[7]),r=new jv({props:{$$slots:{default:[iX]},$$scope:{ctx:t}}}),r.$on("click",t[6]),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){H(e,o,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,a){const u={};a&2050&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a&2080&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a&2048&&(c.$$scope={dirty:a,ctx:o}),r.$set(c)},i(o){s||(b(e.$$.fragment,o),b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(e.$$.fragment,o),k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(n),w(l)),U(e,o),U(i,o),U(r,o)}}}function rX(t){let e,n;return e=new pV({props:{$$slots:{default:[lX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&2090&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function f3(t){let e,n,i;function l(s){t[9](s)}let r={keyName:"admin_password",helperText:t[5]("Leave blank to keep the current password"),type:"password",title:t[5]("Password"),labelText:t[5]("Password"),disableOnblur:!0};return t[2]!==void 0&&(r.updateDataOnBackend=t[2]),e=new w8({props:r}),ft.push(()=>Yt(e,"updateDataOnBackend",l)),{c(){F(e.$$.fragment)},m(s,o){H(e,s,o),i=!0},p(s,o){const a={};o&32&&(a.helperText=s[5]("Leave blank to keep the current password")),o&32&&(a.title=s[5]("Password")),o&32&&(a.labelText=s[5]("Password")),!n&&o&4&&(n=!0,a.updateDataOnBackend=s[2],jt(()=>n=!1)),e.$set(a)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){U(e,s)}}}function sX(t){let e,n,i=t[4]&&f3(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,r){l[4]?i?(i.p(l,r),r&16&&b(i,1)):(i=f3(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function oX(t){let e,n,i,l,r,s;return e=new Ru({props:{title:t[5]("Update password")}}),i=new Du({props:{hasForm:!0,$$slots:{default:[sX]},$$scope:{ctx:t}}}),r=new Pu({props:{secondaryButtonText:"Proceed",primaryButtonDisabled:!0,secondaryClass:"button--primary"}}),r.$on("click:button--secondary",t[10]),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){H(e,o,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,a){const u={};a&32&&(u.title=o[5]("Update password")),e.$set(u);const f={};a&2100&&(f.$$scope={dirty:a,ctx:o}),i.$set(f)},i(o){s||(b(e.$$.fragment,o),b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(e.$$.fragment,o),k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(n),w(l)),U(e,o),U(i,o),U(r,o)}}}function aX(t){let e,n,i=t[4]&&u3(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,r){l[4]?i?(i.p(l,r),r&16&&b(i,1)):(i=u3(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function uX(t){let e,n;return e=new wV({props:{$$slots:{default:[aX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&2111&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function fX(t,e,n){let i,l,r;Mt(t,An,g=>n(1,l=g)),Mt(t,ii,g=>n(5,r=g));let{userProfilePanelOpen:s}=e,o,a,u=()=>{An.logout(),n(0,s=!1),n(3,a=!1),Vi("/login")};const f=()=>{n(3,a=!0)};function c(g){s=g,n(0,s)}function d(g){o=g,n(2,o)}const h=()=>{n(3,a=!1),o()};return t.$$set=g=>{"userProfilePanelOpen"in g&&n(0,s=g.userProfilePanelOpen)},t.$$.update=()=>{t.$$.dirty&2&&n(4,i=l.api.loggedIn)},[s,l,o,a,i,r,u,f,c,d,h]}class cX extends De{constructor(e){super(),Re(this,e,fX,uX,Ie,{userProfilePanelOpen:0})}}function dX(t){let e=t[4]("Insert")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Insert")+"")&&Z(n,e)},d(i){i&&w(n)}}}function hX(t){let e,n,i,l,r;function s(a){t[15](a)}let o={value:"",shouldFilterRows:!0};return t[3]!==void 0&&(o.filteredRowIds=t[3]),e=new LT({props:o}),ft.push(()=>Yt(e,"filteredRowIds",s)),l=new Rt({props:{icon:zu,$$slots:{default:[dX]},$$scope:{ctx:t}}}),l.$on("click",t[9]),{c(){F(e.$$.fragment),i=B(),F(l.$$.fragment)},m(a,u){H(e,a,u),y(a,i,u),H(l,a,u),r=!0},p(a,u){const f={};!n&&u&8&&(n=!0,f.filteredRowIds=a[3],jt(()=>n=!1)),e.$set(f);const c={};u&8388624&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){r||(b(e.$$.fragment,a),b(l.$$.fragment,a),r=!0)},o(a){k(e.$$.fragment,a),k(l.$$.fragment,a),r=!1},d(a){a&&w(i),U(e,a),U(l,a)}}}function mX(t){let e,n;return e=new X1({props:{$$slots:{default:[hX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8388632&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function gX(t){let e,n;return e=new Z1({props:{size:"sm",$$slots:{default:[mX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8388632&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function _X(t){let e=t[22].value+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&4194304&&e!==(e=i[22].value+"")&&Z(n,e)},i:he,o:he,d(i){i&&w(n)}}}function pX(t){let e,n,i,l;const r=[kX,vX],s=[];function o(a,u){return a[22].key==="score"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function bX(t){let e,n,i,l,r;function s(){return t[11](t[21])}n=new Rt({props:{icon:t[2]!=null&&t[21].id===t[2]?ws:xs,iconDescription:t[4]("Edit")}}),n.$on("click",s);function o(){return t[12](t[21])}return l=new Rt({props:{icon:dd,iconDescription:t[4]("Delete")}}),l.$on("click",o),{c(){e=R("div"),F(n.$$.fragment),i=B(),F(l.$$.fragment),wt(e,"float","right")},m(a,u){y(a,e,u),H(n,e,null),T(e,i),H(l,e,null),r=!0},p(a,u){t=a;const f={};u&2097156&&(f.icon=t[2]!=null&&t[21].id===t[2]?ws:xs),u&16&&(f.iconDescription=t[4]("Edit")),n.$set(f);const c={};u&16&&(c.iconDescription=t[4]("Delete")),l.$set(c)},i(a){r||(b(n.$$.fragment,a),b(l.$$.fragment,a),r=!0)},o(a){k(n.$$.fragment,a),k(l.$$.fragment,a),r=!1},d(a){a&&w(e),U(n),U(l)}}}function vX(t){let e,n;function i(...l){return t[14](t[21],...l)}return e=new Jn({props:{value:t[22].value}}),e.$on("input",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&4194304&&(s.value=t[22].value),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function kX(t){let e,n;function i(...l){return t[13](t[21],...l)}return e=new Jn({props:{type:"number",value:t[22].value}}),e.$on("input",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&4194304&&(s.value=t[22].value),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function wX(t){let e,n,i,l;const r=[bX,pX,_X],s=[];function o(a,u){return a[22].key==="actions"?0:a[2]&&a[2]===a[21].id?1:2}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function c3(t){let e,n,i;return n=new Bu({props:{class:"text-center",$$slots:{default:[TX]},$$scope:{ctx:t}}}),{c(){e=R("div"),F(n.$$.fragment)},m(l,r){y(l,e,r),H(n,e,null),i=!0},p(l,r){const s={};r&8388624&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(b(n.$$.fragment,l),i=!0)},o(l){k(n.$$.fragment,l),i=!1},d(l){l&&w(e),U(n)}}}function yX(t){let e=t[4]("Create Item")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Create Item")+"")&&Z(n,e)},d(i){i&&w(n)}}}function TX(t){let e,n=t[4]("No items")+"",i,l,r,s=t[4]("No items yet. Click the add button below to create one. ")+"",o,a,u,f,c,d,h,g,_;return f=new Wq({props:{size:"200"}}),d=new Rt({props:{icon:zu,$$slots:{default:[yX]},$$scope:{ctx:t}}}),d.$on("click",t[9]),{c(){e=R("h3"),i=q(n),l=B(),r=R("div"),o=q(s),a=B(),u=R("div"),F(f.$$.fragment),c=B(),F(d.$$.fragment),P(r,"class","add-row-empty-state svelte-16y4tup"),P(u,"class","add-icon svelte-16y4tup")},m(v,S){y(v,e,S),T(e,i),y(v,l,S),y(v,r,S),T(r,o),y(v,a,S),y(v,u,S),H(f,u,null),y(v,c,S),H(d,v,S),h=!0,g||(_=J(r,"click",t[9]),g=!0)},p(v,S){(!h||S&16)&&n!==(n=v[4]("No items")+"")&&Z(i,n),(!h||S&16)&&s!==(s=v[4]("No items yet. Click the add button below to create one. ")+"")&&Z(o,s);const A={};S&8388624&&(A.$$scope={dirty:S,ctx:v}),d.$set(A)},i(v){h||(b(f.$$.fragment,v),b(d.$$.fragment,v),h=!0)},o(v){k(f.$$.fragment,v),k(d.$$.fragment,v),h=!1},d(v){v&&(w(e),w(l),w(r),w(a),w(u),w(c)),U(f),U(d,v),g=!1,_()}}}function SX(t){let e,n,i,l;e=new Ol({props:{sortable:!0,size:"medium",style:"width:100%;",headers:[{key:"content",value:t[4]("Content")},{key:"score",value:t[4]("Score"),width:"15%"},{key:"actions",value:t[4]("Actions"),width:"25%"}].filter(t[16]),rows:t[1].map(d3).sort(h3),$$slots:{cell:[wX,({row:s,cell:o})=>({21:s,22:o}),({row:s,cell:o})=>(s?2097152:0)|(o?4194304:0)],default:[gX]},$$scope:{ctx:t}}});let r=t[1].length==0&&c3(t);return{c(){F(e.$$.fragment),n=B(),r&&r.c(),i=qe()},m(s,o){H(e,s,o),y(s,n,o),r&&r.m(s,o),y(s,i,o),l=!0},p(s,o){const a={};o&17&&(a.headers=[{key:"content",value:s[4]("Content")},{key:"score",value:s[4]("Score"),width:"15%"},{key:"actions",value:s[4]("Actions"),width:"25%"}].filter(s[16])),o&2&&(a.rows=s[1].map(d3).sort(h3)),o&14680092&&(a.$$scope={dirty:o,ctx:s}),e.$set(a),s[1].length==0?r?(r.p(s,o),o&2&&b(r,1)):(r=c3(s),r.c(),b(r,1),r.m(i.parentNode,i)):r&&(fe(),k(r,1,1,()=>{r=null}),ce())},i(s){l||(b(e.$$.fragment,s),b(r),l=!0)},o(s){k(e.$$.fragment,s),k(r),l=!1},d(s){s&&(w(n),w(i)),U(e,s),r&&r.d(s)}}}function EX(t){let e,n;return e=new zn({props:{$$slots:{default:[SX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8388639&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function MX(t){let e,n;return e=new dl({props:{$$slots:{default:[EX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&8388639&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}const d3=t=>({id:t.id,content:t.content,score:t.score,actions:""}),h3=(t,e)=>e.id-t.id;function OX(t,e,n){let i,l;Mt(t,ii,z=>n(4,i=z)),Mt(t,An,z=>n(17,l=z));let{filterId:r}=e,{showColumns:s=["content","score","actions"]}=e,o=[],a=null,u=`/filters/${r}`;const f=()=>{l.api.doCall(u).then(function(z){try{var W=z[0];n(1,o=W.Entries.map((D,G)=>({id:G+1,content:D.Content,score:D.Score})))}catch(D){ci.add({kind:"error",title:"Error:",subtitle:D.message,timeout:3e4})}}).catch(function(z){ci.add({kind:"error",title:i("Error:"),subtitle:i("Unable to load data from the api : ")+z.message,timeout:3e4})})};function c(z,W){const D=W.detail;n(1,o=o.map(G=>G.id===z?{...G,content:D}:G))}function d(z,W){const D=parseInt(W.detail);isNaN(D)?ci.add({kind:"error",title:"Error:",subtitle:"Score must be a number",timeout:3e4}):n(1,o=o.map(G=>G.id===z?{...G,score:D}:G))}const h=()=>{let z=o.map(W=>({Content:W.content,Score:W.score}));l.api.doCall(u,"post",z).then(function(W){W.Response.includes("Ok")&&(ci.add({kind:"success",title:"Success:",subtitle:"Filter saved successfully",timeout:3e3}),f())})},g=z=>{a==z?(n(2,a=null),h()):n(2,a=z)},_=z=>{n(1,o=o.filter(W=>W.id!==z)),h()},v=()=>{const z=o.length+1;n(1,o=[...o,{id:z,content:i("New item"),score:0}]),g(z)};f();let S=[];const A=z=>g(z.id),C=z=>_(z.id),I=(z,W)=>d(z.id,W),M=(z,W)=>c(z.id,W);function L(z){S=z,n(3,S)}const N=z=>s.includes(z.key);return t.$$set=z=>{"filterId"in z&&n(10,r=z.filterId),"showColumns"in z&&n(0,s=z.showColumns)},[s,o,a,S,i,c,d,g,_,v,r,A,C,I,M,L,N]}class _d extends De{constructor(e){super(),Re(this,e,OX,MX,Ie,{filterId:10,showColumns:0})}}function m3(t){let e,n,i,l;const r=[CX,AX],s=[];function o(a,u){return a[3]=="radio"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function AX(t){let e,n;return e=new Jn({props:{title:t[1],labelText:t[0],helperText:t[2],type:t[3],disabled:t[4],value:t[5]??""}}),e.$on("blur",t[8]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&2&&(r.title=i[1]),l&1&&(r.labelText=i[0]),l&4&&(r.helperText=i[2]),l&8&&(r.type=i[3]),l&16&&(r.disabled=i[4]),l&32&&(r.value=i[5]??""),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function CX(t){let e,n,i;function l(s){t[13](s)}let r={legendText:t[0],$$slots:{default:[LX]},$$scope:{ctx:t}};return t[5]!==void 0&&(r.selected=t[5]),e=new HT({props:r}),ft.push(()=>Yt(e,"selected",l)),e.$on("change",t[9]),{c(){F(e.$$.fragment)},m(s,o){H(e,s,o),i=!0},p(s,o){const a={};o&1&&(a.legendText=s[0]),o&262272&&(a.$$scope={dirty:o,ctx:s}),!n&&o&32&&(n=!0,a.selected=s[5],jt(()=>n=!1)),e.$set(a)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){U(e,s)}}}function LX(t){let e,n,i,l;return e=new mu({props:{value:"true",labelText:t[7]("True")}}),i=new mu({props:{value:"false",labelText:t[7]("False")}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&128&&(o.labelText=r[7]("True")),e.$set(o);const a={};s&128&&(a.labelText=r[7]("False")),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function IX(t){let e,n,i=t[6]&&m3(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,[r]){l[6]?i?(i.p(l,r),r&64&&b(i,1)):(i=m3(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function RX(t,e,n){let i,l;Mt(t,ii,M=>n(7,i=M)),Mt(t,An,M=>n(15,l=M));let{keyName:r}=e,{labelText:s}=e,{title:o}=e,{helperText:a}=e,{type:u}=e,{disabled:f=!1}=e,{disableOnblur:c=!1}=e,d=null,h=null,g=!1;const _=()=>{S(h)},v=async()=>{try{const M=await l.api.getSetting(r);n(5,d=M.Value)}catch{console.error("[GatesentryUI] Unable to load settings (possibly due to logout)")}},S=async M=>{await l.api.setSetting(r,M)===!1?ci.add(ao({subtitle:i("Unable to save setting")},i)):ci.add(Hu({subtitle:i("Setting updated")},i))},A=async M=>{const L=M.target.value;L!=d&&(h=L,!c&&S(h))},C=async M=>{h=d,!c&&S(h)};_n(async()=>{await v(),n(6,g=!0)}),Es(()=>{n(5,d=null),h=null,n(6,g=!1)});function I(M){d=M,n(5,d)}return t.$$set=M=>{"keyName"in M&&n(10,r=M.keyName),"labelText"in M&&n(0,s=M.labelText),"title"in M&&n(1,o=M.title),"helperText"in M&&n(2,a=M.helperText),"type"in M&&n(3,u=M.type),"disabled"in M&&n(4,f=M.disabled),"disableOnblur"in M&&n(11,c=M.disableOnblur)},[s,o,a,u,f,d,g,i,A,C,r,c,_,I]}class tr extends De{constructor(e){super(),Re(this,e,RX,IX,Ie,{keyName:10,labelText:0,title:1,helperText:2,type:3,disabled:4,disableOnblur:11,updateDataOnBackend:12})}get updateDataOnBackend(){return this.$$.ctx[12]}}function DX(t){let e=t[2]("Dashboard")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&4&&e!==(e=i[2]("Dashboard")+"")&&Z(n,e)},d(i){i&&w(n)}}}function PX(t){let e=t[2]("HTTPS inspection")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&4&&e!==(e=i[2]("HTTPS inspection")+"")&&Z(n,e)},d(i){i&&w(n)}}}function NX(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[DX]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[PX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&20&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&20&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function BX(t){let e,n;return e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[NX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&20&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function zX(t){let e,n;return e=new zn({props:{$$slots:{default:[BX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&20&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function g3(t){let e,n;return e=new xi({props:{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:"HTTPS inspection is off.",subtitle:"This list only applies to plain HTTP traffic until you turn on HTTPS filtering in Settings and install the GateSentry certificate on each device. To block whole sites, use Policies."}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function HX(t){let e,n=t[2]("Sites not inspected")+"",i,l,r,s=t[2]("HTTPS traffic to these hosts is passed through without decryption. Add apps and sites that break when inspected, such as banking apps or apps that pin their certificates. Policies still block these sites by domain.")+"",o,a,u,f;return u=new _d({props:{filterId:"CeBqssmRbqXzbHR",showColumns:["content","actions"]}}),{c(){e=R("h2"),i=q(n),l=B(),r=R("div"),o=q(s),a=B(),F(u.$$.fragment),P(r,"class","description svelte-70qiq6")},m(c,d){y(c,e,d),T(e,i),y(c,l,d),y(c,r,d),T(r,o),y(c,a,d),H(u,c,d),f=!0},p(c,d){(!f||d&4)&&n!==(n=c[2]("Sites not inspected")+"")&&Z(i,n),(!f||d&4)&&s!==(s=c[2]("HTTPS traffic to these hosts is passed through without decryption. Add apps and sites that break when inspected, such as banking apps or apps that pin their certificates. Policies still block these sites by domain.")+"")&&Z(o,s)},i(c){f||(b(u.$$.fragment,c),f=!0)},o(c){k(u.$$.fragment,c),f=!1},d(c){c&&(w(e),w(l),w(r),w(a)),U(u,c)}}}function UX(t){let e,n=t[2]("Excluded URLs")+"",i,l,r,s=t[2]("Add URLs to exclude from filtering here.")+"",o,a,u,f;return u=new _d({props:{filterId:"JHGJiwjkGOeglsd",showColumns:["content","actions"]}}),{c(){e=R("h2"),i=q(n),l=B(),r=R("div"),o=q(s),a=B(),F(u.$$.fragment),P(r,"class","description svelte-70qiq6")},m(c,d){y(c,e,d),T(e,i),y(c,l,d),y(c,r,d),T(r,o),y(c,a,d),H(u,c,d),f=!0},p(c,d){(!f||d&4)&&n!==(n=c[2]("Excluded URLs")+"")&&Z(i,n),(!f||d&4)&&s!==(s=c[2]("Add URLs to exclude from filtering here.")+"")&&Z(o,s)},i(c){f||(b(u.$$.fragment,c),f=!0)},o(c){k(u.$$.fragment,c),f=!1},d(c){c&&(w(e),w(l),w(r),w(a)),U(u,c)}}}function FX(t){let e,n=t[2]("Blocked keywords")+"",i,l,r,s=t[2]("Add/Update keywords to block here. The score is used to determine how bad the keyword is. The higher the score, the worse the keyword.")+"",o,a,u,f,c;return f=new dl({props:{$$slots:{default:[qX]},$$scope:{ctx:t}}}),{c(){e=R("h2"),i=q(n),l=B(),r=R("div"),o=q(s),a=B(),u=R("div"),F(f.$$.fragment),P(r,"class","description svelte-70qiq6")},m(d,h){y(d,e,h),T(e,i),y(d,l,h),y(d,r,h),T(r,o),y(d,a,h),y(d,u,h),H(f,u,null),c=!0},p(d,h){(!c||h&4)&&n!==(n=d[2]("Blocked keywords")+"")&&Z(i,n),(!c||h&4)&&s!==(s=d[2]("Add/Update keywords to block here. The score is used to determine how bad the keyword is. The higher the score, the worse the keyword.")+"")&&Z(o,s);const g={};h&20&&(g.$$scope={dirty:h,ctx:d}),f.$set(g)},i(d){c||(b(f.$$.fragment,d),c=!0)},o(d){k(f.$$.fragment,d),c=!1},d(d){d&&(w(e),w(l),w(r),w(a),w(u)),U(f)}}}function GX(t){let e,n=t[2]("Blocked content types")+"",i,l,r,s=t[2]("Responses of these types are blocked on every device that uses the proxy. For example image/jpeg blocks .jpg files and video/ blocks all video. To block a type for one policy only, add it to a rule in Policies.")+"",o,a,u,f;return u=new _d({props:{filterId:"JHGJiwjkGOeglsk",showColumns:["content","actions"]}}),{c(){e=R("h2"),i=q(n),l=B(),r=R("div"),o=q(s),a=B(),F(u.$$.fragment),P(r,"class","description svelte-70qiq6")},m(c,d){y(c,e,d),T(e,i),y(c,l,d),y(c,r,d),T(r,o),y(c,a,d),H(u,c,d),f=!0},p(c,d){(!f||d&4)&&n!==(n=c[2]("Blocked content types")+"")&&Z(i,n),(!f||d&4)&&s!==(s=c[2]("Responses of these types are blocked on every device that uses the proxy. For example image/jpeg blocks .jpg files and video/ blocks all video. To block a type for one policy only, add it to a rule in Policies.")+"")&&Z(o,s)},i(c){f||(b(u.$$.fragment,c),f=!0)},o(c){k(u.$$.fragment,c),f=!1},d(c){c&&(w(e),w(l),w(r),w(a)),U(u,c)}}}function VX(t){let e,n,i,l=t[2]("Filtering strictness is the threshold beyond which you want the page to be blocked")+"",r,s,o,a=t[2]("Example for a value of 2000, if 2 keywords with a score of 1000 are found, the page will be blocked. If 4 keywords with a score of 500 are found, the page will be blocked. If 1 keyword with a score of 2000 is found, the page will be blocked.")+"",u,f,c,d;return e=new tr({props:{keyName:"strictness",title:t[2]("Filtering strictness"),labelText:t[2]("Filtering strictness"),type:"number",helperText:""}}),{c(){F(e.$$.fragment),n=B(),i=R("label"),r=q(l),s=B(),o=R("label"),u=q(a),f=B(),c=R("br"),P(i,"class","bx--label"),P(o,"class","bx--label")},m(h,g){H(e,h,g),y(h,n,g),y(h,i,g),T(i,r),y(h,s,g),y(h,o,g),T(o,u),y(h,f,g),y(h,c,g),d=!0},p(h,g){const _={};g&4&&(_.title=h[2]("Filtering strictness")),g&4&&(_.labelText=h[2]("Filtering strictness")),e.$set(_),(!d||g&4)&&l!==(l=h[2]("Filtering strictness is the threshold beyond which you want the page to be blocked")+"")&&Z(r,l),(!d||g&4)&&a!==(a=h[2]("Example for a value of 2000, if 2 keywords with a score of 1000 are found, the page will be blocked. If 4 keywords with a score of 500 are found, the page will be blocked. If 1 keyword with a score of 2000 is found, the page will be blocked.")+"")&&Z(u,a)},i(h){d||(b(e.$$.fragment,h),d=!0)},o(h){k(e.$$.fragment,h),d=!1},d(h){h&&(w(n),w(i),w(s),w(o),w(f),w(c)),U(e,h)}}}function WX(t){let e,n;return e=new _d({props:{filterId:"bVxTPTOXiqGRbhF"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function qX(t){let e,n,i,l;return e=new zn({props:{md:4,lg:4,$$slots:{default:[VX]},$$scope:{ctx:t}}}),i=new zn({props:{md:12,lg:12,$$slots:{default:[WX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&20&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&16&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function jX(t){let e,n,i,l,r,s,o;e=new dl({props:{$$slots:{default:[zX]},$$scope:{ctx:t}}});let a=t[0]!=="excludehosts"&&t[1]===!1&&g3();const u=[GX,FX,UX,HX],f=[];function c(d,h){return d[0]=="blockedfiletypes"?0:d[0]=="blockedkeywords"?1:d[0]=="excludeurls"?2:d[0]=="excludehosts"?3:-1}return~(l=c(t))&&(r=f[l]=u[l](t)),{c(){F(e.$$.fragment),n=B(),a&&a.c(),i=B(),r&&r.c(),s=qe()},m(d,h){H(e,d,h),y(d,n,h),a&&a.m(d,h),y(d,i,h),~l&&f[l].m(d,h),y(d,s,h),o=!0},p(d,[h]){const g={};h&20&&(g.$$scope={dirty:h,ctx:d}),e.$set(g),d[0]!=="excludehosts"&&d[1]===!1?a?h&3&&b(a,1):(a=g3(),a.c(),b(a,1),a.m(i.parentNode,i)):a&&(fe(),k(a,1,1,()=>{a=null}),ce());let _=l;l=c(d),l===_?~l&&f[l].p(d,h):(r&&(fe(),k(f[_],1,1,()=>{f[_]=null}),ce()),~l?(r=f[l],r?r.p(d,h):(r=f[l]=u[l](d),r.c()),b(r,1),r.m(s.parentNode,s)):r=null)},i(d){o||(b(e.$$.fragment,d),b(a),b(r),o=!0)},o(d){k(e.$$.fragment,d),k(a),k(r),o=!1},d(d){d&&(w(n),w(i),w(s)),U(e,d),a&&a.d(d),~l&&f[l].d(d)}}}function YX(t,e,n){let i,l;Mt(t,An,o=>n(3,i=o)),Mt(t,ii,o=>n(2,l=o));let{type:r}=e,s=null;return _n(async()=>{try{const o=await i.api.doCall("/settings/enable_https_filtering");n(1,s=(o==null?void 0:o.Value)==="true")}catch{n(1,s=null)}}),t.$$set=o=>{"type"in o&&n(0,r=o.type)},[r,s,l]}class pd extends De{constructor(e){super(),Re(this,e,YX,jX,Ie,{type:0})}}function _3(t,e,n){const i=t.slice();return i[3]=e[n],i}function p3(t){let e,n,i=ct(t[0]),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s0&&p3(t);return{c(){e=R("div"),i&&i.c(),wt(e,"position","absolute"),wt(e,"right","0"),wt(e,"bottom","0"),wt(e,"text-align","left"),wt(e,"z-index","10000")},m(l,r){y(l,e,r),i&&i.m(e,null),n=!0},p(l,[r]){l[0].length>0?i?(i.p(l,r),r&1&&b(i,1)):(i=p3(l),i.c(),b(i,1),i.m(e,null)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d()}}}function XX(t,e,n){let i;Mt(t,ci,s=>n(2,i=s));let l=[];return Cl(()=>{n(0,l=i)}),[l,(s,o)=>{ci.remove(s)}]}class KX extends De{constructor(e){super(),Re(this,e,XX,ZX,Ie,{})}}function $X(t){let e,n;return e=new bc({props:{labelText:t[1],labelA:t[2],labelB:t[3],toggled:t[0]=="true"}}),e.$on("change",t[5]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&2&&(r.labelText=i[1]),l&4&&(r.labelA=i[2]),l&8&&(r.labelB=i[3]),l&1&&(r.toggled=i[0]=="true"),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function JX(t){let e,n;return e=new K1({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function QX(t){return{c:he,m:he,p:he,i:he,o:he,d:he}}function xX(t){let e,n,i,l;const r=[QX,JX,$X],s=[];function o(a,u){return a[4]==!0?0:a[0]==""?1:2}return n=o(t),i=s[n]=r[n](t),{c(){e=R("span"),i.c()},m(a,u){y(a,e,u),s[n].m(e,null),l=!0},p(a,[u]){let f=n;n=o(a),n===f?s[n].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),i=s[n],i?i.p(a,u):(i=s[n]=r[n](a),i.c()),b(i,1),i.m(e,null))},i(a){l||(b(i),l=!0)},o(a){k(i),l=!1},d(a){a&&w(e),s[n].d()}}}function eK(t,e,n){let i,l;Mt(t,ii,_=>n(9,i=_)),Mt(t,An,_=>n(10,l=_));let{settingName:r="enable_https_filtering"}=e,{label:s="Label"}=e,{labelA:o="On"}=e,{labelB:a="Off"}=e,{settingValue:u=""}=e,{preClickEvent:f=null}=e,{hide:c=!1}=e,{noNotification:d=!1}=e;const h=()=>{l.api.doCall("/settings/"+r).then(_=>{n(0,u=_.Value)})},g=async()=>{f&&await f();const _="/settings/"+r;var v={key:r,value:u=="true"?"false":"true"};l.api.doCall(_,"post",v).then(function(S){h(),!d&&ci.add(Hu({title:i("Success"),subtitle:i("Setting updated")},i))})};return _n(()=>{h()}),t.$$set=_=>{"settingName"in _&&n(6,r=_.settingName),"label"in _&&n(1,s=_.label),"labelA"in _&&n(2,o=_.labelA),"labelB"in _&&n(3,a=_.labelB),"settingValue"in _&&n(0,u=_.settingValue),"preClickEvent"in _&&n(7,f=_.preClickEvent),"hide"in _&&n(4,c=_.hide),"noNotification"in _&&n(8,d=_.noNotification)},h(),[u,s,o,a,c,g,r,f,d]}class y8 extends De{constructor(e){super(),Re(this,e,eK,xX,Ie,{settingName:6,label:1,labelA:2,labelB:3,settingValue:0,preClickEvent:7,hide:4,noNotification:8})}}function tK(t){let e,n,i,l=t[0]("Privacy Notice for Enabling MITM Filtering")+"",r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,L,N,z,W;return{c(){e=R("div"),n=R("div"),i=R("h3"),r=q(l),s=B(),o=R("h4"),o.textContent="Attention System Administrators:",a=B(),u=R("p"),u.textContent=`Before enabling the Man-In-The-Middle (MITM) filtering on this proxy + going to Settings and changing the log file location to "/tmp/log.db".`)},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function RZ(t){let e,n,i,l,r,s,o,a,u,f,c,d;return e=new Ln({props:{value:"",text:"All actions"}}),i=new Ln({props:{value:"block",text:"Block"}}),r=new Ln({props:{value:"allow",text:"Allow"}}),o=new Ln({props:{value:"bypass",text:"Bypass"}}),u=new Ln({props:{value:"inspect",text:"Inspect"}}),c=new Ln({props:{value:"error",text:"Error"}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment),s=B(),F(o.$$.fragment),a=B(),F(u.$$.fragment),f=B(),F(c.$$.fragment)},m(h,g){H(e,h,g),y(h,n,g),H(i,h,g),y(h,l,g),H(r,h,g),y(h,s,g),H(o,h,g),y(h,a,g),H(u,h,g),y(h,f,g),H(c,h,g),d=!0},p:he,i(h){d||(b(e.$$.fragment,h),b(i.$$.fragment,h),b(r.$$.fragment,h),b(o.$$.fragment,h),b(u.$$.fragment,h),b(c.$$.fragment,h),d=!0)},o(h){k(e.$$.fragment,h),k(i.$$.fragment,h),k(r.$$.fragment,h),k(o.$$.fragment,h),k(u.$$.fragment,h),k(c.$$.fragment,h),d=!1},d(h){h&&(w(n),w(l),w(s),w(a),w(f)),U(e,h),U(i,h),U(r,h),U(o,h),U(u,h),U(c,h)}}}function DZ(t){let e,n,i,l,r,s,o,a,u,f;return e=new Ln({props:{value:"",text:"All layers"}}),i=new Ln({props:{value:"dns",text:"DNS"}}),r=new Ln({props:{value:"explicit_proxy",text:"Explicit proxy"}}),o=new Ln({props:{value:"transparent_proxy",text:"Transparent proxy"}}),u=new Ln({props:{value:"content",text:"Content"}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment),s=B(),F(o.$$.fragment),a=B(),F(u.$$.fragment)},m(c,d){H(e,c,d),y(c,n,d),H(i,c,d),y(c,l,d),H(r,c,d),y(c,s,d),H(o,c,d),y(c,a,d),H(u,c,d),f=!0},p:he,i(c){f||(b(e.$$.fragment,c),b(i.$$.fragment,c),b(r.$$.fragment,c),b(o.$$.fragment,c),b(u.$$.fragment,c),f=!0)},o(c){k(e.$$.fragment,c),k(i.$$.fragment,c),k(r.$$.fragment,c),k(o.$$.fragment,c),k(u.$$.fragment,c),f=!1},d(c){c&&(w(n),w(l),w(s),w(a)),U(e,c),U(i,c),U(r,c),U(o,c),U(u,c)}}}function PZ(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I;l=new Vt({props:{$$slots:{default:[IZ]},$$scope:{ctx:t}}});function M(G){t[9](G)}let L={placeholder:"Search by domain..."};t[2]!==void 0&&(L.value=t[2]),a=new LT({props:L}),ft.push(()=>Yt(a,"value",M)),a.$on("clear",t[4]);function N(G){t[10](G)}let z={labelText:"Action",$$slots:{default:[RZ]},$$scope:{ctx:t}};t[0]!==void 0&&(z.selected=t[0]),d=new wr({props:z}),ft.push(()=>Yt(d,"selected",N));function W(G){t[11](G)}let D={labelText:"Layer",$$slots:{default:[DZ]},$$scope:{ctx:t}};return t[1]!==void 0&&(D.selected=t[1]),v=new wr({props:D}),ft.push(()=>Yt(v,"selected",W)),C=new Ol({props:{sortable:!0,size:"medium",style:"width:100%; min-height: 600px;",headers:[{key:"time",value:"Time"},{key:"client",value:"Client"},{key:"url",value:"URL"},{key:"action",value:"Action"},{key:"layer",value:"Layer"},{key:"reason",value:"Reason"}],rows:t[3]}}),{c(){e=R("div"),e.textContent="Structured filtering decisions from DNS and proxy layers.",n=B(),i=R("div"),F(l.$$.fragment),r=B(),s=R("div"),o=R("div"),F(a.$$.fragment),f=B(),c=R("div"),F(d.$$.fragment),g=B(),_=R("div"),F(v.$$.fragment),A=B(),F(C.$$.fragment),wt(e,"margin","20px 0px"),wt(i,"margin-bottom","15px"),wt(o,"flex","1"),wt(o,"min-width","200px"),wt(c,"min-width","160px"),wt(_,"min-width","160px"),wt(s,"display","flex"),wt(s,"gap","16px"),wt(s,"align-items","flex-end"),wt(s,"flex-wrap","wrap"),wt(s,"margin-bottom","15px")},m(G,$){y(G,e,$),y(G,n,$),y(G,i,$),H(l,i,null),y(G,r,$),y(G,s,$),T(s,o),H(a,o,null),T(s,f),T(s,c),H(d,c,null),T(s,g),T(s,_),H(v,_,null),y(G,A,$),H(C,G,$),I=!0},p(G,$){const j={};$&8388608&&(j.$$scope={dirty:$,ctx:G}),l.$set(j);const Q={};!u&&$&4&&(u=!0,Q.value=G[2],jt(()=>u=!1)),a.$set(Q);const le={};$&8388608&&(le.$$scope={dirty:$,ctx:G}),!h&&$&1&&(h=!0,le.selected=G[0],jt(()=>h=!1)),d.$set(le);const oe={};$&8388608&&(oe.$$scope={dirty:$,ctx:G}),!S&&$&2&&(S=!0,oe.selected=G[1],jt(()=>S=!1)),v.$set(oe);const X={};$&8&&(X.rows=G[3]),C.$set(X)},i(G){I||(b(l.$$.fragment,G),b(a.$$.fragment,G),b(d.$$.fragment,G),b(v.$$.fragment,G),b(C.$$.fragment,G),I=!0)},o(G){k(l.$$.fragment,G),k(a.$$.fragment,G),k(d.$$.fragment,G),k(v.$$.fragment,G),k(C.$$.fragment,G),I=!1},d(G){G&&(w(e),w(n),w(i),w(r),w(s),w(A)),U(l),U(a),U(d),U(v),U(C,G)}}}function NZ(t){let e,n;return e=new zn({props:{$$slots:{default:[PZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8388623&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function BZ(t){let e,n,i,l;return e=new dl({props:{$$slots:{default:[LZ]},$$scope:{ctx:t}}}),i=new dl({props:{$$slots:{default:[NZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,[s]){const o={};s&8388608&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&8388623&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function zZ(t,e,n){let i,l;Mt(t,An,D=>n(18,l=D));let r="",s="",o="",a=[],u=new Map,f=null,c=null,d=!1,h=!1,g=!1,_=!1,v=!1,S="";const A=()=>{const D=[];return r.length>0&&D.push("domain="+encodeURIComponent(r)),s&&D.push("action="+s),o&&D.push("layer="+o),D.length>0?"?"+D.join("&"):""},C=async()=>{if(d||v)return;d=!0;const D=A();try{const G=await l.api.doCall("/decisions"+D);!v&&D===A()&&n(5,a=(G==null?void 0:G.items)||[])}catch{}finally{if(d=!1,v)return;h?(h=!1,C()):f=setTimeout(C,5e3)}},I=async()=>{if(!(g||v)){g=!0;try{const D=await l.api.doCall("/devices");v||n(6,u=TZ(D==null?void 0:D.devices))}catch{}finally{g=!1,v||(c=setTimeout(I,6e4))}}},M=()=>{if(f&&clearTimeout(f),f=null,d){h=!0;return}C()},L=()=>{n(2,r=""),M()};_n(()=>{n(7,_=!0),n(8,S=s+"\0"+o),C(),I()}),Es(()=>{v=!0,f&&clearTimeout(f),c&&clearTimeout(c)});function N(D){r=D,n(2,r)}function z(D){s=D,n(0,s)}function W(D){o=D,n(1,o)}return t.$$.update=()=>{if(t.$$.dirty&96&&n(3,i=a.map((D,G)=>({id:D.ip+D.time+G+D.url,time:yZ(D.time*1e3),client:SZ(u,D.ip),url:xk.truncate(D.url,{length:50}),action:D.action||"",layer:D.layer||"",reason:xk.truncate(D.reason||D.matched_rule||"",{length:40})}))),t.$$.dirty&387){const D=s+"\0"+o;_&&D!==S&&(n(8,S=D),M())}},[s,o,r,i,L,a,u,_,S,N,z,W]}class HZ extends De{constructor(e){super(),Re(this,e,zZ,BZ,Ie,{})}}let Mc=[{type:"link",text:"Home",href:"/",icon:lq},{type:"link",text:"Logs",href:"/logs",icon:LW},{type:"link",text:"Settings",href:"/settings",icon:Iq},{type:"link",text:"DNS",href:"/dns",icon:Aq},{type:"link",text:"Devices",href:"/devices",icon:jW},{type:"link",text:"Policies",href:"/rules",icon:Tq},{type:"link",text:"Services",href:"/services",icon:zq},{type:"menu",text:"HTTPS inspection",icon:oq,children:[{type:"link",text:"Blocked keywords",href:"/blockedkeywords",icon:Jh},{type:"link",text:"Blocked content types",href:"/blockedfiletypes",icon:Jh},{type:"link",text:"Sites not inspected",href:"/excludehosts",icon:Jh}]},{type:"link",text:"Stats",href:"/stats",icon:tq},{type:"link",text:"AI",href:"/ai",icon:hq},{type:"link",text:"Users",href:"/users",icon:Yq}];function e3(t,e,n){const i=t.slice();return i[5]=e[n],i}function t3(t,e,n){const i=t.slice();return i[8]=e[n],i}function UZ(t){let e,n;return e=new sV({props:{text:t[5].text,$$slots:{default:[GZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.text=i[5].text),l&2049&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function FZ(t){let e,n;function i(){return t[2](t[5])}return e=new WT({props:{text:t[5].text}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.text=t[5].text),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function n3(t){let e,n;function i(){return t[3](t[8])}return e=new WT({props:{text:t[8].text}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.text=t[8].text),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function GZ(t){let e,n,i=ct(t[5].children),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),ce()),~e?(n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i)):n=null)},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),~e&&s[e].d(a)}}}function VZ(t){let e,n,i=ct(t[0]),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;sn(1,l=a));let r=[...Mc];Cl(()=>{i?n(0,r=[...Mc]):n(0,r=[])});const s=a=>{Vi(a.href)},o=a=>{Vi(a.href)};return t.$$.update=()=>{t.$$.dirty&2&&(i=l.api.loggedIn)},[r,l,s,o]}class jZ extends De{constructor(e){super(),Re(this,e,qZ,WZ,Ie,{})}}function l3(t,e,n){const i=t.slice();return i[5]=e[n],i}function r3(t,e,n){const i=t.slice();return i[8]=e[n],i}function YZ(t){let e,n;return e=new GV({props:{icon:t[5].icon,text:t[5].text,$$slots:{default:[XZ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.icon=i[5].icon),l&1&&(r.text=i[5].text),l&2049&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function ZZ(t){let e,n;function i(){return t[2](t[5])}return e=new qT({props:{icon:t[5].icon,text:t[5].text,isSelected:t[5].isSelected}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.icon=t[5].icon),r&1&&(s.text=t[5].text),r&1&&(s.isSelected=t[5].isSelected),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function s3(t){let e,n;function i(){return t[3](t[8])}return e=new qT({props:{icon:t[8].icon,text:t[8].text}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&1&&(s.icon=t[8].icon),r&1&&(s.text=t[8].text),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function XZ(t){let e,n,i=ct(t[5].children),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),ce()),~e?(n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i)):n=null)},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),~e&&s[e].d(a)}}}function KZ(t){let e,n,i,l=ct(t[0]),r=[];for(let o=0;ok(r[o],1,1,()=>{r[o]=null});return n=new eW({}),{c(){for(let o=0;on(1,l=a));let r=[...Mc];Cl(()=>{i?n(0,r=[...Mc]):n(0,r=[])});const s=a=>{Vi(a.href)},o=a=>{Vi(a.href)};return t.$$.update=()=>{t.$$.dirty&2&&(i=l.api.loggedIn)},[r,l,s,o]}class QZ extends De{constructor(e){super(),Re(this,e,JZ,$Z,Ie,{})}}function xZ(t){let e,n;return e=new Jn({props:{title:t[2],labelText:t[1],helperText:t[3],type:t[4],disabled:t[5],value:(t[6]&&t[6][t[0]])??""}}),e.$on("blur",t[7]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&4&&(r.title=i[2]),l&2&&(r.labelText=i[1]),l&8&&(r.helperText=i[3]),l&16&&(r.type=i[4]),l&32&&(r.disabled=i[5]),l&65&&(r.value=(i[6]&&i[6][i[0]])??""),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}const a3="general_settings";function eX(t,e,n){let i,l;Mt(t,ii,A=>n(11,i=A)),Mt(t,An,A=>n(12,l=A));let{keyName:r}=e,{labelText:s}=e,{title:o}=e,{helperText:a}=e,{type:u}=e,{disabled:f=!1}=e,{disableOnblur:c=!1}=e,d=null,h=null;const g=()=>{v(h)},_=async()=>{try{const A=await l.api.getSetting(a3);n(6,d=JSON.parse(A.Value))}catch{console.error("[GatesentryUI] Unable to load settings (possibly due to logout)")}},v=async A=>{const C=await l.api.setSetting(a3,JSON.stringify(A));if(console.log("response",C),C===!1?ci.add(ao({subtitle:i("Unable to save setting")},i)):ci.add(Hu({subtitle:i("Setting updated")},i)),r==="admin_password"||r==="admin_username"){An.logout(),Vi("/login");return}await _()},S=async A=>{const C=A.target.value;if(C==d[r])return;const I={...d,[r]:C};h=I,!c&&v(I)};return _n(()=>{_()}),t.$$set=A=>{"keyName"in A&&n(0,r=A.keyName),"labelText"in A&&n(1,s=A.labelText),"title"in A&&n(2,o=A.title),"helperText"in A&&n(3,a=A.helperText),"type"in A&&n(4,u=A.type),"disabled"in A&&n(5,f=A.disabled),"disableOnblur"in A&&n(8,c=A.disableOnblur)},[r,s,o,a,u,f,d,S,c,g]}class y8 extends De{constructor(e){super(),Re(this,e,eX,xZ,Ie,{keyName:0,labelText:1,title:2,helperText:3,type:4,disabled:5,disableOnblur:8,updateDataOnBackend:9})}get updateDataOnBackend(){return this.$$.ctx[9]}}function u3(t){let e,n,i,l,r;function s(a){t[8](a)}let o={icon:Dk,closeIcon:Dk,$$slots:{default:[rX]},$$scope:{ctx:t}};return t[0]!==void 0&&(o.isOpen=t[0]),e=new XG({props:o}),ft.push(()=>Yt(e,"isOpen",s)),l=new Iu({props:{open:t[3],$$slots:{default:[oX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),i=B(),F(l.$$.fragment)},m(a,u){H(e,a,u),y(a,i,u),H(l,a,u),r=!0},p(a,u){const f={};u&2090&&(f.$$scope={dirty:u,ctx:a}),!n&&u&1&&(n=!0,f.isOpen=a[0],jt(()=>n=!1)),e.$set(f);const c={};u&8&&(c.open=a[3]),u&2108&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){r||(b(e.$$.fragment,a),b(l.$$.fragment,a),r=!0)},o(a){k(e.$$.fragment,a),k(l.$$.fragment,a),r=!1},d(a){a&&w(i),U(e,a),U(l,a)}}}function tX(t){let e=t[1].api.username?`Logged in as ${t[1].api.username}`:"Logged in",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&2&&e!==(e=i[1].api.username?`Logged in as ${i[1].api.username}`:"Logged in")&&Z(n,e)},d(i){i&&w(n)}}}function nX(t){let e=t[5]("Change password")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&32&&e!==(e=i[5]("Change password")+"")&&Z(n,e)},d(i){i&&w(n)}}}function iX(t){let e;return{c(){e=q("Logout")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function lX(t){let e,n,i,l,r,s;return e=new fV({props:{$$slots:{default:[tX]},$$scope:{ctx:t}}}),i=new jv({props:{$$slots:{default:[nX]},$$scope:{ctx:t}}}),i.$on("click",t[7]),r=new jv({props:{$$slots:{default:[iX]},$$scope:{ctx:t}}}),r.$on("click",t[6]),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){H(e,o,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,a){const u={};a&2050&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a&2080&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a&2048&&(c.$$scope={dirty:a,ctx:o}),r.$set(c)},i(o){s||(b(e.$$.fragment,o),b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(e.$$.fragment,o),k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(n),w(l)),U(e,o),U(i,o),U(r,o)}}}function rX(t){let e,n;return e=new pV({props:{$$slots:{default:[lX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&2090&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function f3(t){let e,n,i;function l(s){t[9](s)}let r={keyName:"admin_password",helperText:t[5]("Leave blank to keep the current password"),type:"password",title:t[5]("Password"),labelText:t[5]("Password"),disableOnblur:!0};return t[2]!==void 0&&(r.updateDataOnBackend=t[2]),e=new y8({props:r}),ft.push(()=>Yt(e,"updateDataOnBackend",l)),{c(){F(e.$$.fragment)},m(s,o){H(e,s,o),i=!0},p(s,o){const a={};o&32&&(a.helperText=s[5]("Leave blank to keep the current password")),o&32&&(a.title=s[5]("Password")),o&32&&(a.labelText=s[5]("Password")),!n&&o&4&&(n=!0,a.updateDataOnBackend=s[2],jt(()=>n=!1)),e.$set(a)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){U(e,s)}}}function sX(t){let e,n,i=t[4]&&f3(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,r){l[4]?i?(i.p(l,r),r&16&&b(i,1)):(i=f3(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function oX(t){let e,n,i,l,r,s;return e=new Ru({props:{title:t[5]("Update password")}}),i=new Du({props:{hasForm:!0,$$slots:{default:[sX]},$$scope:{ctx:t}}}),r=new Pu({props:{secondaryButtonText:"Proceed",primaryButtonDisabled:!0,secondaryClass:"button--primary"}}),r.$on("click:button--secondary",t[10]),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){H(e,o,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,a){const u={};a&32&&(u.title=o[5]("Update password")),e.$set(u);const f={};a&2100&&(f.$$scope={dirty:a,ctx:o}),i.$set(f)},i(o){s||(b(e.$$.fragment,o),b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(e.$$.fragment,o),k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(n),w(l)),U(e,o),U(i,o),U(r,o)}}}function aX(t){let e,n,i=t[4]&&u3(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,r){l[4]?i?(i.p(l,r),r&16&&b(i,1)):(i=u3(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function uX(t){let e,n;return e=new wV({props:{$$slots:{default:[aX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&2111&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function fX(t,e,n){let i,l,r;Mt(t,An,g=>n(1,l=g)),Mt(t,ii,g=>n(5,r=g));let{userProfilePanelOpen:s}=e,o,a,u=()=>{An.logout(),n(0,s=!1),n(3,a=!1),Vi("/login")};const f=()=>{n(3,a=!0)};function c(g){s=g,n(0,s)}function d(g){o=g,n(2,o)}const h=()=>{n(3,a=!1),o()};return t.$$set=g=>{"userProfilePanelOpen"in g&&n(0,s=g.userProfilePanelOpen)},t.$$.update=()=>{t.$$.dirty&2&&n(4,i=l.api.loggedIn)},[s,l,o,a,i,r,u,f,c,d,h]}class cX extends De{constructor(e){super(),Re(this,e,fX,uX,Ie,{userProfilePanelOpen:0})}}function dX(t){let e=t[4]("Insert")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Insert")+"")&&Z(n,e)},d(i){i&&w(n)}}}function hX(t){let e,n,i,l,r;function s(a){t[15](a)}let o={value:"",shouldFilterRows:!0};return t[3]!==void 0&&(o.filteredRowIds=t[3]),e=new IT({props:o}),ft.push(()=>Yt(e,"filteredRowIds",s)),l=new Rt({props:{icon:zu,$$slots:{default:[dX]},$$scope:{ctx:t}}}),l.$on("click",t[9]),{c(){F(e.$$.fragment),i=B(),F(l.$$.fragment)},m(a,u){H(e,a,u),y(a,i,u),H(l,a,u),r=!0},p(a,u){const f={};!n&&u&8&&(n=!0,f.filteredRowIds=a[3],jt(()=>n=!1)),e.$set(f);const c={};u&8388624&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){r||(b(e.$$.fragment,a),b(l.$$.fragment,a),r=!0)},o(a){k(e.$$.fragment,a),k(l.$$.fragment,a),r=!1},d(a){a&&w(i),U(e,a),U(l,a)}}}function mX(t){let e,n;return e=new X1({props:{$$slots:{default:[hX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8388632&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function gX(t){let e,n;return e=new Z1({props:{size:"sm",$$slots:{default:[mX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8388632&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function _X(t){let e=t[22].value+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&4194304&&e!==(e=i[22].value+"")&&Z(n,e)},i:he,o:he,d(i){i&&w(n)}}}function pX(t){let e,n,i,l;const r=[kX,vX],s=[];function o(a,u){return a[22].key==="score"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function bX(t){let e,n,i,l,r;function s(){return t[11](t[21])}n=new Rt({props:{icon:t[2]!=null&&t[21].id===t[2]?ws:xs,iconDescription:t[4]("Edit")}}),n.$on("click",s);function o(){return t[12](t[21])}return l=new Rt({props:{icon:dd,iconDescription:t[4]("Delete")}}),l.$on("click",o),{c(){e=R("div"),F(n.$$.fragment),i=B(),F(l.$$.fragment),wt(e,"float","right")},m(a,u){y(a,e,u),H(n,e,null),T(e,i),H(l,e,null),r=!0},p(a,u){t=a;const f={};u&2097156&&(f.icon=t[2]!=null&&t[21].id===t[2]?ws:xs),u&16&&(f.iconDescription=t[4]("Edit")),n.$set(f);const c={};u&16&&(c.iconDescription=t[4]("Delete")),l.$set(c)},i(a){r||(b(n.$$.fragment,a),b(l.$$.fragment,a),r=!0)},o(a){k(n.$$.fragment,a),k(l.$$.fragment,a),r=!1},d(a){a&&w(e),U(n),U(l)}}}function vX(t){let e,n;function i(...l){return t[14](t[21],...l)}return e=new Jn({props:{value:t[22].value}}),e.$on("input",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&4194304&&(s.value=t[22].value),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function kX(t){let e,n;function i(...l){return t[13](t[21],...l)}return e=new Jn({props:{type:"number",value:t[22].value}}),e.$on("input",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&4194304&&(s.value=t[22].value),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function wX(t){let e,n,i,l;const r=[bX,pX,_X],s=[];function o(a,u){return a[22].key==="actions"?0:a[2]&&a[2]===a[21].id?1:2}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function c3(t){let e,n,i;return n=new Bu({props:{class:"text-center",$$slots:{default:[TX]},$$scope:{ctx:t}}}),{c(){e=R("div"),F(n.$$.fragment)},m(l,r){y(l,e,r),H(n,e,null),i=!0},p(l,r){const s={};r&8388624&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(b(n.$$.fragment,l),i=!0)},o(l){k(n.$$.fragment,l),i=!1},d(l){l&&w(e),U(n)}}}function yX(t){let e=t[4]("Create Item")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Create Item")+"")&&Z(n,e)},d(i){i&&w(n)}}}function TX(t){let e,n=t[4]("No items")+"",i,l,r,s=t[4]("No items yet. Click the add button below to create one. ")+"",o,a,u,f,c,d,h,g,_;return f=new Wq({props:{size:"200"}}),d=new Rt({props:{icon:zu,$$slots:{default:[yX]},$$scope:{ctx:t}}}),d.$on("click",t[9]),{c(){e=R("h3"),i=q(n),l=B(),r=R("div"),o=q(s),a=B(),u=R("div"),F(f.$$.fragment),c=B(),F(d.$$.fragment),P(r,"class","add-row-empty-state svelte-16y4tup"),P(u,"class","add-icon svelte-16y4tup")},m(v,S){y(v,e,S),T(e,i),y(v,l,S),y(v,r,S),T(r,o),y(v,a,S),y(v,u,S),H(f,u,null),y(v,c,S),H(d,v,S),h=!0,g||(_=J(r,"click",t[9]),g=!0)},p(v,S){(!h||S&16)&&n!==(n=v[4]("No items")+"")&&Z(i,n),(!h||S&16)&&s!==(s=v[4]("No items yet. Click the add button below to create one. ")+"")&&Z(o,s);const A={};S&8388624&&(A.$$scope={dirty:S,ctx:v}),d.$set(A)},i(v){h||(b(f.$$.fragment,v),b(d.$$.fragment,v),h=!0)},o(v){k(f.$$.fragment,v),k(d.$$.fragment,v),h=!1},d(v){v&&(w(e),w(l),w(r),w(a),w(u),w(c)),U(f),U(d,v),g=!1,_()}}}function SX(t){let e,n,i,l;e=new Ol({props:{sortable:!0,size:"medium",style:"width:100%;",headers:[{key:"content",value:t[4]("Content")},{key:"score",value:t[4]("Score"),width:"15%"},{key:"actions",value:t[4]("Actions"),width:"25%"}].filter(t[16]),rows:t[1].map(d3).sort(h3),$$slots:{cell:[wX,({row:s,cell:o})=>({21:s,22:o}),({row:s,cell:o})=>(s?2097152:0)|(o?4194304:0)],default:[gX]},$$scope:{ctx:t}}});let r=t[1].length==0&&c3(t);return{c(){F(e.$$.fragment),n=B(),r&&r.c(),i=qe()},m(s,o){H(e,s,o),y(s,n,o),r&&r.m(s,o),y(s,i,o),l=!0},p(s,o){const a={};o&17&&(a.headers=[{key:"content",value:s[4]("Content")},{key:"score",value:s[4]("Score"),width:"15%"},{key:"actions",value:s[4]("Actions"),width:"25%"}].filter(s[16])),o&2&&(a.rows=s[1].map(d3).sort(h3)),o&14680092&&(a.$$scope={dirty:o,ctx:s}),e.$set(a),s[1].length==0?r?(r.p(s,o),o&2&&b(r,1)):(r=c3(s),r.c(),b(r,1),r.m(i.parentNode,i)):r&&(fe(),k(r,1,1,()=>{r=null}),ce())},i(s){l||(b(e.$$.fragment,s),b(r),l=!0)},o(s){k(e.$$.fragment,s),k(r),l=!1},d(s){s&&(w(n),w(i)),U(e,s),r&&r.d(s)}}}function EX(t){let e,n;return e=new zn({props:{$$slots:{default:[SX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8388639&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function MX(t){let e,n;return e=new dl({props:{$$slots:{default:[EX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&8388639&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}const d3=t=>({id:t.id,content:t.content,score:t.score,actions:""}),h3=(t,e)=>e.id-t.id;function OX(t,e,n){let i,l;Mt(t,ii,z=>n(4,i=z)),Mt(t,An,z=>n(17,l=z));let{filterId:r}=e,{showColumns:s=["content","score","actions"]}=e,o=[],a=null,u=`/filters/${r}`;const f=()=>{l.api.doCall(u).then(function(z){try{var W=z[0];n(1,o=W.Entries.map((D,G)=>({id:G+1,content:D.Content,score:D.Score})))}catch(D){ci.add({kind:"error",title:"Error:",subtitle:D.message,timeout:3e4})}}).catch(function(z){ci.add({kind:"error",title:i("Error:"),subtitle:i("Unable to load data from the api : ")+z.message,timeout:3e4})})};function c(z,W){const D=W.detail;n(1,o=o.map(G=>G.id===z?{...G,content:D}:G))}function d(z,W){const D=parseInt(W.detail);isNaN(D)?ci.add({kind:"error",title:"Error:",subtitle:"Score must be a number",timeout:3e4}):n(1,o=o.map(G=>G.id===z?{...G,score:D}:G))}const h=()=>{let z=o.map(W=>({Content:W.content,Score:W.score}));l.api.doCall(u,"post",z).then(function(W){W.Response.includes("Ok")&&(ci.add({kind:"success",title:"Success:",subtitle:"Filter saved successfully",timeout:3e3}),f())})},g=z=>{a==z?(n(2,a=null),h()):n(2,a=z)},_=z=>{n(1,o=o.filter(W=>W.id!==z)),h()},v=()=>{const z=o.length+1;n(1,o=[...o,{id:z,content:i("New item"),score:0}]),g(z)};f();let S=[];const A=z=>g(z.id),C=z=>_(z.id),I=(z,W)=>d(z.id,W),M=(z,W)=>c(z.id,W);function L(z){S=z,n(3,S)}const N=z=>s.includes(z.key);return t.$$set=z=>{"filterId"in z&&n(10,r=z.filterId),"showColumns"in z&&n(0,s=z.showColumns)},[s,o,a,S,i,c,d,g,_,v,r,A,C,I,M,L,N]}class _d extends De{constructor(e){super(),Re(this,e,OX,MX,Ie,{filterId:10,showColumns:0})}}function m3(t){let e,n,i,l;const r=[CX,AX],s=[];function o(a,u){return a[3]=="radio"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function AX(t){let e,n;return e=new Jn({props:{title:t[1],labelText:t[0],helperText:t[2],type:t[3],disabled:t[4],value:t[5]??""}}),e.$on("blur",t[8]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&2&&(r.title=i[1]),l&1&&(r.labelText=i[0]),l&4&&(r.helperText=i[2]),l&8&&(r.type=i[3]),l&16&&(r.disabled=i[4]),l&32&&(r.value=i[5]??""),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function CX(t){let e,n,i;function l(s){t[13](s)}let r={legendText:t[0],$$slots:{default:[LX]},$$scope:{ctx:t}};return t[5]!==void 0&&(r.selected=t[5]),e=new UT({props:r}),ft.push(()=>Yt(e,"selected",l)),e.$on("change",t[9]),{c(){F(e.$$.fragment)},m(s,o){H(e,s,o),i=!0},p(s,o){const a={};o&1&&(a.legendText=s[0]),o&262272&&(a.$$scope={dirty:o,ctx:s}),!n&&o&32&&(n=!0,a.selected=s[5],jt(()=>n=!1)),e.$set(a)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){U(e,s)}}}function LX(t){let e,n,i,l;return e=new mu({props:{value:"true",labelText:t[7]("True")}}),i=new mu({props:{value:"false",labelText:t[7]("False")}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&128&&(o.labelText=r[7]("True")),e.$set(o);const a={};s&128&&(a.labelText=r[7]("False")),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function IX(t){let e,n,i=t[6]&&m3(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,[r]){l[6]?i?(i.p(l,r),r&64&&b(i,1)):(i=m3(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function RX(t,e,n){let i,l;Mt(t,ii,M=>n(7,i=M)),Mt(t,An,M=>n(15,l=M));let{keyName:r}=e,{labelText:s}=e,{title:o}=e,{helperText:a}=e,{type:u}=e,{disabled:f=!1}=e,{disableOnblur:c=!1}=e,d=null,h=null,g=!1;const _=()=>{S(h)},v=async()=>{try{const M=await l.api.getSetting(r);n(5,d=M.Value)}catch{console.error("[GatesentryUI] Unable to load settings (possibly due to logout)")}},S=async M=>{await l.api.setSetting(r,M)===!1?ci.add(ao({subtitle:i("Unable to save setting")},i)):ci.add(Hu({subtitle:i("Setting updated")},i))},A=async M=>{const L=M.target.value;L!=d&&(h=L,!c&&S(h))},C=async M=>{h=d,!c&&S(h)};_n(async()=>{await v(),n(6,g=!0)}),Es(()=>{n(5,d=null),h=null,n(6,g=!1)});function I(M){d=M,n(5,d)}return t.$$set=M=>{"keyName"in M&&n(10,r=M.keyName),"labelText"in M&&n(0,s=M.labelText),"title"in M&&n(1,o=M.title),"helperText"in M&&n(2,a=M.helperText),"type"in M&&n(3,u=M.type),"disabled"in M&&n(4,f=M.disabled),"disableOnblur"in M&&n(11,c=M.disableOnblur)},[s,o,a,u,f,d,g,i,A,C,r,c,_,I]}class tr extends De{constructor(e){super(),Re(this,e,RX,IX,Ie,{keyName:10,labelText:0,title:1,helperText:2,type:3,disabled:4,disableOnblur:11,updateDataOnBackend:12})}get updateDataOnBackend(){return this.$$.ctx[12]}}function DX(t){let e=t[2]("Dashboard")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&4&&e!==(e=i[2]("Dashboard")+"")&&Z(n,e)},d(i){i&&w(n)}}}function PX(t){let e=t[2]("HTTPS inspection")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&4&&e!==(e=i[2]("HTTPS inspection")+"")&&Z(n,e)},d(i){i&&w(n)}}}function NX(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[DX]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[PX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&20&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&20&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function BX(t){let e,n;return e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[NX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&20&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function zX(t){let e,n;return e=new zn({props:{$$slots:{default:[BX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&20&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function g3(t){let e,n;return e=new xi({props:{kind:"warning",lowContrast:!0,hideCloseButton:!0,title:"HTTPS inspection is off.",subtitle:"This list only applies to plain HTTP traffic until you turn on HTTPS filtering in Settings and install the GateSentry certificate on each device. To block whole sites, use Policies."}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function HX(t){let e,n=t[2]("Sites not inspected")+"",i,l,r,s=t[2]("HTTPS traffic to these hosts is passed through without decryption. Add apps and sites that break when inspected, such as banking apps or apps that pin their certificates. Policies still block these sites by domain.")+"",o,a,u,f;return u=new _d({props:{filterId:"CeBqssmRbqXzbHR",showColumns:["content","actions"]}}),{c(){e=R("h2"),i=q(n),l=B(),r=R("div"),o=q(s),a=B(),F(u.$$.fragment),P(r,"class","description svelte-70qiq6")},m(c,d){y(c,e,d),T(e,i),y(c,l,d),y(c,r,d),T(r,o),y(c,a,d),H(u,c,d),f=!0},p(c,d){(!f||d&4)&&n!==(n=c[2]("Sites not inspected")+"")&&Z(i,n),(!f||d&4)&&s!==(s=c[2]("HTTPS traffic to these hosts is passed through without decryption. Add apps and sites that break when inspected, such as banking apps or apps that pin their certificates. Policies still block these sites by domain.")+"")&&Z(o,s)},i(c){f||(b(u.$$.fragment,c),f=!0)},o(c){k(u.$$.fragment,c),f=!1},d(c){c&&(w(e),w(l),w(r),w(a)),U(u,c)}}}function UX(t){let e,n=t[2]("Excluded URLs")+"",i,l,r,s=t[2]("Add URLs to exclude from filtering here.")+"",o,a,u,f;return u=new _d({props:{filterId:"JHGJiwjkGOeglsd",showColumns:["content","actions"]}}),{c(){e=R("h2"),i=q(n),l=B(),r=R("div"),o=q(s),a=B(),F(u.$$.fragment),P(r,"class","description svelte-70qiq6")},m(c,d){y(c,e,d),T(e,i),y(c,l,d),y(c,r,d),T(r,o),y(c,a,d),H(u,c,d),f=!0},p(c,d){(!f||d&4)&&n!==(n=c[2]("Excluded URLs")+"")&&Z(i,n),(!f||d&4)&&s!==(s=c[2]("Add URLs to exclude from filtering here.")+"")&&Z(o,s)},i(c){f||(b(u.$$.fragment,c),f=!0)},o(c){k(u.$$.fragment,c),f=!1},d(c){c&&(w(e),w(l),w(r),w(a)),U(u,c)}}}function FX(t){let e,n=t[2]("Blocked keywords")+"",i,l,r,s=t[2]("Add/Update keywords to block here. The score is used to determine how bad the keyword is. The higher the score, the worse the keyword.")+"",o,a,u,f,c;return f=new dl({props:{$$slots:{default:[qX]},$$scope:{ctx:t}}}),{c(){e=R("h2"),i=q(n),l=B(),r=R("div"),o=q(s),a=B(),u=R("div"),F(f.$$.fragment),P(r,"class","description svelte-70qiq6")},m(d,h){y(d,e,h),T(e,i),y(d,l,h),y(d,r,h),T(r,o),y(d,a,h),y(d,u,h),H(f,u,null),c=!0},p(d,h){(!c||h&4)&&n!==(n=d[2]("Blocked keywords")+"")&&Z(i,n),(!c||h&4)&&s!==(s=d[2]("Add/Update keywords to block here. The score is used to determine how bad the keyword is. The higher the score, the worse the keyword.")+"")&&Z(o,s);const g={};h&20&&(g.$$scope={dirty:h,ctx:d}),f.$set(g)},i(d){c||(b(f.$$.fragment,d),c=!0)},o(d){k(f.$$.fragment,d),c=!1},d(d){d&&(w(e),w(l),w(r),w(a),w(u)),U(f)}}}function GX(t){let e,n=t[2]("Blocked content types")+"",i,l,r,s=t[2]("Responses of these types are blocked on every device that uses the proxy. For example image/jpeg blocks .jpg files and video/ blocks all video. To block a type for one policy only, add it to a rule in Policies.")+"",o,a,u,f;return u=new _d({props:{filterId:"JHGJiwjkGOeglsk",showColumns:["content","actions"]}}),{c(){e=R("h2"),i=q(n),l=B(),r=R("div"),o=q(s),a=B(),F(u.$$.fragment),P(r,"class","description svelte-70qiq6")},m(c,d){y(c,e,d),T(e,i),y(c,l,d),y(c,r,d),T(r,o),y(c,a,d),H(u,c,d),f=!0},p(c,d){(!f||d&4)&&n!==(n=c[2]("Blocked content types")+"")&&Z(i,n),(!f||d&4)&&s!==(s=c[2]("Responses of these types are blocked on every device that uses the proxy. For example image/jpeg blocks .jpg files and video/ blocks all video. To block a type for one policy only, add it to a rule in Policies.")+"")&&Z(o,s)},i(c){f||(b(u.$$.fragment,c),f=!0)},o(c){k(u.$$.fragment,c),f=!1},d(c){c&&(w(e),w(l),w(r),w(a)),U(u,c)}}}function VX(t){let e,n,i,l=t[2]("Filtering strictness is the threshold beyond which you want the page to be blocked")+"",r,s,o,a=t[2]("Example for a value of 2000, if 2 keywords with a score of 1000 are found, the page will be blocked. If 4 keywords with a score of 500 are found, the page will be blocked. If 1 keyword with a score of 2000 is found, the page will be blocked.")+"",u,f,c,d;return e=new tr({props:{keyName:"strictness",title:t[2]("Filtering strictness"),labelText:t[2]("Filtering strictness"),type:"number",helperText:""}}),{c(){F(e.$$.fragment),n=B(),i=R("label"),r=q(l),s=B(),o=R("label"),u=q(a),f=B(),c=R("br"),P(i,"class","bx--label"),P(o,"class","bx--label")},m(h,g){H(e,h,g),y(h,n,g),y(h,i,g),T(i,r),y(h,s,g),y(h,o,g),T(o,u),y(h,f,g),y(h,c,g),d=!0},p(h,g){const _={};g&4&&(_.title=h[2]("Filtering strictness")),g&4&&(_.labelText=h[2]("Filtering strictness")),e.$set(_),(!d||g&4)&&l!==(l=h[2]("Filtering strictness is the threshold beyond which you want the page to be blocked")+"")&&Z(r,l),(!d||g&4)&&a!==(a=h[2]("Example for a value of 2000, if 2 keywords with a score of 1000 are found, the page will be blocked. If 4 keywords with a score of 500 are found, the page will be blocked. If 1 keyword with a score of 2000 is found, the page will be blocked.")+"")&&Z(u,a)},i(h){d||(b(e.$$.fragment,h),d=!0)},o(h){k(e.$$.fragment,h),d=!1},d(h){h&&(w(n),w(i),w(s),w(o),w(f),w(c)),U(e,h)}}}function WX(t){let e,n;return e=new _d({props:{filterId:"bVxTPTOXiqGRbhF"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function qX(t){let e,n,i,l;return e=new zn({props:{md:4,lg:4,$$slots:{default:[VX]},$$scope:{ctx:t}}}),i=new zn({props:{md:12,lg:12,$$slots:{default:[WX]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&20&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&16&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function jX(t){let e,n,i,l,r,s,o;e=new dl({props:{$$slots:{default:[zX]},$$scope:{ctx:t}}});let a=t[0]!=="excludehosts"&&t[1]===!1&&g3();const u=[GX,FX,UX,HX],f=[];function c(d,h){return d[0]=="blockedfiletypes"?0:d[0]=="blockedkeywords"?1:d[0]=="excludeurls"?2:d[0]=="excludehosts"?3:-1}return~(l=c(t))&&(r=f[l]=u[l](t)),{c(){F(e.$$.fragment),n=B(),a&&a.c(),i=B(),r&&r.c(),s=qe()},m(d,h){H(e,d,h),y(d,n,h),a&&a.m(d,h),y(d,i,h),~l&&f[l].m(d,h),y(d,s,h),o=!0},p(d,[h]){const g={};h&20&&(g.$$scope={dirty:h,ctx:d}),e.$set(g),d[0]!=="excludehosts"&&d[1]===!1?a?h&3&&b(a,1):(a=g3(),a.c(),b(a,1),a.m(i.parentNode,i)):a&&(fe(),k(a,1,1,()=>{a=null}),ce());let _=l;l=c(d),l===_?~l&&f[l].p(d,h):(r&&(fe(),k(f[_],1,1,()=>{f[_]=null}),ce()),~l?(r=f[l],r?r.p(d,h):(r=f[l]=u[l](d),r.c()),b(r,1),r.m(s.parentNode,s)):r=null)},i(d){o||(b(e.$$.fragment,d),b(a),b(r),o=!0)},o(d){k(e.$$.fragment,d),k(a),k(r),o=!1},d(d){d&&(w(n),w(i),w(s)),U(e,d),a&&a.d(d),~l&&f[l].d(d)}}}function YX(t,e,n){let i,l;Mt(t,An,o=>n(3,i=o)),Mt(t,ii,o=>n(2,l=o));let{type:r}=e,s=null;return _n(async()=>{try{const o=await i.api.doCall("/settings/enable_https_filtering");n(1,s=(o==null?void 0:o.Value)==="true")}catch{n(1,s=null)}}),t.$$set=o=>{"type"in o&&n(0,r=o.type)},[r,s,l]}class pd extends De{constructor(e){super(),Re(this,e,YX,jX,Ie,{type:0})}}function _3(t,e,n){const i=t.slice();return i[3]=e[n],i}function p3(t){let e,n,i=ct(t[0]),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s0&&p3(t);return{c(){e=R("div"),i&&i.c(),wt(e,"position","absolute"),wt(e,"right","0"),wt(e,"bottom","0"),wt(e,"text-align","left"),wt(e,"z-index","10000")},m(l,r){y(l,e,r),i&&i.m(e,null),n=!0},p(l,[r]){l[0].length>0?i?(i.p(l,r),r&1&&b(i,1)):(i=p3(l),i.c(),b(i,1),i.m(e,null)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d()}}}function XX(t,e,n){let i;Mt(t,ci,s=>n(2,i=s));let l=[];return Cl(()=>{n(0,l=i)}),[l,(s,o)=>{ci.remove(s)}]}class KX extends De{constructor(e){super(),Re(this,e,XX,ZX,Ie,{})}}function $X(t){let e,n;return e=new bc({props:{labelText:t[1],labelA:t[2],labelB:t[3],toggled:t[0]=="true"}}),e.$on("change",t[5]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&2&&(r.labelText=i[1]),l&4&&(r.labelA=i[2]),l&8&&(r.labelB=i[3]),l&1&&(r.toggled=i[0]=="true"),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function JX(t){let e,n;return e=new K1({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function QX(t){return{c:he,m:he,p:he,i:he,o:he,d:he}}function xX(t){let e,n,i,l;const r=[QX,JX,$X],s=[];function o(a,u){return a[4]==!0?0:a[0]==""?1:2}return n=o(t),i=s[n]=r[n](t),{c(){e=R("span"),i.c()},m(a,u){y(a,e,u),s[n].m(e,null),l=!0},p(a,[u]){let f=n;n=o(a),n===f?s[n].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),i=s[n],i?i.p(a,u):(i=s[n]=r[n](a),i.c()),b(i,1),i.m(e,null))},i(a){l||(b(i),l=!0)},o(a){k(i),l=!1},d(a){a&&w(e),s[n].d()}}}function eK(t,e,n){let i,l;Mt(t,ii,_=>n(9,i=_)),Mt(t,An,_=>n(10,l=_));let{settingName:r="enable_https_filtering"}=e,{label:s="Label"}=e,{labelA:o="On"}=e,{labelB:a="Off"}=e,{settingValue:u=""}=e,{preClickEvent:f=null}=e,{hide:c=!1}=e,{noNotification:d=!1}=e;const h=()=>{l.api.doCall("/settings/"+r).then(_=>{n(0,u=_.Value)})},g=async()=>{f&&await f();const _="/settings/"+r;var v={key:r,value:u=="true"?"false":"true"};l.api.doCall(_,"post",v).then(function(S){h(),!d&&ci.add(Hu({title:i("Success"),subtitle:i("Setting updated")},i))})};return _n(()=>{h()}),t.$$set=_=>{"settingName"in _&&n(6,r=_.settingName),"label"in _&&n(1,s=_.label),"labelA"in _&&n(2,o=_.labelA),"labelB"in _&&n(3,a=_.labelB),"settingValue"in _&&n(0,u=_.settingValue),"preClickEvent"in _&&n(7,f=_.preClickEvent),"hide"in _&&n(4,c=_.hide),"noNotification"in _&&n(8,d=_.noNotification)},h(),[u,s,o,a,c,g,r,f,d]}class T8 extends De{constructor(e){super(),Re(this,e,eK,xX,Ie,{settingName:6,label:1,labelA:2,labelB:3,settingValue:0,preClickEvent:7,hide:4,noNotification:8})}}function tK(t){let e,n,i,l=t[0]("Privacy Notice for Enabling MITM Filtering")+"",r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,L,N,z,W;return{c(){e=R("div"),n=R("div"),i=R("h3"),r=q(l),s=B(),o=R("h4"),o.textContent="Attention System Administrators:",a=B(),u=R("p"),u.textContent=`Before enabling the Man-In-The-Middle (MITM) filtering on this proxy server, it is crucial to understand the significant privacy implications this feature holds. Proceed with utmost caution and awareness of the responsibilities involved.`,f=B(),c=R("h4"),c.textContent="Privacy Implications:",d=B(),h=R("ol"),h.innerHTML=`
  • Inspection of Encrypted Traffic:

    Enabling MITM filtering allows the inspection and potential @@ -83,8 +83,8 @@ function print() { __p += __j.call(arguments, '') } considerations involved and affirm your commitment to upholding the highest standards of privacy and data protection in the use of this feature.`,z=B(),W=R("p"),W.innerHTML=`Note: Adjust the notice to align with your organization's policies and - ensure it adheres to the relevant legal standards in your jurisdiction.`,P(i,"class","notice-title"),P(o,"class","section"),P(c,"class","section"),P(_,"class","section"),P(C,"class","section"),P(n,"class","mitm-privacy-notice")},m(D,G){y(D,e,G),T(e,n),T(n,i),T(i,r),T(n,s),T(n,o),T(n,a),T(n,u),T(n,f),T(n,c),T(n,d),T(n,h),T(n,g),T(n,_),T(n,v),T(n,S),T(n,A),T(n,C),T(n,I),T(n,M),T(n,L),T(n,N),T(n,z),T(n,W)},p(D,[G]){G&1&&l!==(l=D[0]("Privacy Notice for Enabling MITM Filtering")+"")&&Z(r,l)},i:he,o:he,d(D){D&&w(e)}}}function nK(t,e,n){let i;return Mt(t,ii,l=>n(0,i=l)),[i]}class iK extends De{constructor(e){super(),Re(this,e,nK,tK,Ie,{})}}function lK(t){let e,n;return e=new iK({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function rK(t){let e,n,i,l,r,s;return e=new Ru({props:{label:"Privacy policy",title:""}}),i=new Du({props:{hasForm:!0,$$slots:{default:[lK]},$$scope:{ctx:t}}}),r=new Pu({props:{secondaryButtonText:t[2]("I have reviewed the policy"),secondaryClass:"bx--btn--primary"}}),r.$on("click:button--secondary",t[5]),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){H(e,o,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,a){const u={};a&64&&(u.$$scope={dirty:a,ctx:o}),i.$set(u);const f={};a&4&&(f.secondaryButtonText=o[2]("I have reviewed the policy")),r.$set(f)},i(o){s||(b(e.$$.fragment,o),b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(e.$$.fragment,o),k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(n),w(l)),U(e,o),U(i,o),U(r,o)}}}function sK(t){let e,n,i,l,r,s,o,a,u;function f(d){t[3](d)}let c={settingName:"enable_https_filtering",label:t[2]("HTTPS inspection (decrypts traffic; needs the GateSentry certificate on each device)"),labelA:t[2]("Disabled"),labelB:t[2]("Enabled"),noNotification:!0};return t[1]!==void 0&&(c.settingValue=t[1]),i=new y8({props:c}),ft.push(()=>Yt(i,"settingValue",f)),s=new Iu({props:{open:t[0],$$slots:{default:[rK]},$$scope:{ctx:t}}}),{c(){e=R("div"),n=R("div"),F(i.$$.fragment),r=B(),F(s.$$.fragment),wt(e,"margin-top","15px")},m(d,h){y(d,e,h),T(e,n),H(i,n,null),T(e,r),H(s,e,null),o=!0,a||(u=J(n,"click",t[4]),a=!0)},p(d,[h]){const g={};h&4&&(g.label=d[2]("HTTPS inspection (decrypts traffic; needs the GateSentry certificate on each device)")),h&4&&(g.labelA=d[2]("Disabled")),h&4&&(g.labelB=d[2]("Enabled")),!l&&h&2&&(l=!0,g.settingValue=d[1],jt(()=>l=!1)),i.$set(g);const _={};h&1&&(_.open=d[0]),h&69&&(_.$$scope={dirty:h,ctx:d}),s.$set(_)},i(d){o||(b(i.$$.fragment,d),b(s.$$.fragment,d),o=!0)},o(d){k(i.$$.fragment,d),k(s.$$.fragment,d),o=!1},d(d){d&&w(e),U(i),U(s),a=!1,u()}}}function oK(t,e,n){let i;Mt(t,ii,u=>n(2,i=u));let l=!1,r="";function s(u){r=u,n(1,r)}return[l,r,i,s,()=>{r=="false"&&n(0,l=!0)},()=>{n(0,l=!1)}]}class aK extends De{constructor(e){super(),Re(this,e,oK,sK,Ie,{})}}function uK(t){let e;return{c(){e=q(t[0])},m(n,i){y(n,e,i)},p(n,i){i&1&&Z(e,n[0])},d(n){n&&w(e)}}}function fK(t){let e,n,i,l,r,s;return i=new _z({props:{$$slots:{default:[uK]},$$scope:{ctx:t}}}),r=new FT({props:{value:t[1]}}),r.$on("blur",t[2]),{c(){e=R("br"),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){y(o,e,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,[a]){const u={};a&129&&(u.$$scope={dirty:a,ctx:o}),i.$set(u);const f={};a&2&&(f.value=o[1]),r.$set(f)},i(o){s||(b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(e),w(n),w(l)),U(i,o),U(r,o)}}}function cK(t,e,n){let i,l;Mt(t,ii,f=>n(4,i=f)),Mt(t,An,f=>n(5,l=f));let r="",{settingName:s}=e,{label:o}=e;const a=async()=>{if(s===void 0)return;const f=await l.api.getSetting(s);n(1,r=f.Value)};let u=async f=>{const c=f.target.value;await l.api.setSetting(s,c)===!1?ci.add(ao({subtitle:i("Unable to save certificate data")},i)):ci.add(Hu({subtitle:i("Certificate data saved")},i)),a()};return t.$$set=f=>{"settingName"in f&&n(3,s=f.settingName),"label"in f&&n(0,o=f.label)},a(),[o,r,u,s]}class v3 extends De{constructor(e){super(),Re(this,e,cK,fK,Ie,{settingName:3,label:0})}}function k3(t){let e,n,i=t[2]("Certificate Issuer Name: ")+"",l,r,s=t[0].name+"",o,a,u,f,c,d=t[2]("Certificate Expiry: ")+"",h,g,_=t[0].expiry+"",v,S,A;return{c(){e=R("div"),n=R("div"),l=q(i),r=B(),o=q(s),a=B(),u=R("br"),f=B(),c=R("div"),h=q(d),g=B(),v=q(_),S=B(),A=R("br"),P(e,"class","simple-border"),wt(e,"margin-top","3px")},m(C,I){y(C,e,I),T(e,n),T(n,l),T(n,r),T(n,o),T(e,a),T(e,u),T(e,f),T(e,c),T(c,h),T(c,g),T(c,v),y(C,S,I),y(C,A,I)},p(C,I){I&4&&i!==(i=C[2]("Certificate Issuer Name: ")+"")&&Z(l,i),I&1&&s!==(s=C[0].name+"")&&Z(o,s),I&4&&d!==(d=C[2]("Certificate Expiry: ")+"")&&Z(h,d),I&1&&_!==(_=C[0].expiry+"")&&Z(v,_)},d(C){C&&(w(e),w(S),w(A))}}}function w3(t){let e,n,i,l,r,s,o,a;return e=new v3({props:{settingName:"capem",label:t[2]("HTTPS Filtering - Certificate")}}),i=new v3({props:{settingName:"keypem",label:t[2]("HTTPS Filtering - Key")}}),o=new b8({}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),r=R("br"),s=B(),F(o.$$.fragment)},m(u,f){H(e,u,f),y(u,n,f),H(i,u,f),y(u,l,f),y(u,r,f),y(u,s,f),H(o,u,f),a=!0},p(u,f){const c={};f&4&&(c.label=u[2]("HTTPS Filtering - Certificate")),e.$set(c);const d={};f&4&&(d.label=u[2]("HTTPS Filtering - Key")),i.$set(d)},i(u){a||(b(e.$$.fragment,u),b(i.$$.fragment,u),b(o.$$.fragment,u),a=!0)},o(u){k(e.$$.fragment,u),k(i.$$.fragment,u),k(o.$$.fragment,u),a=!1},d(u){u&&(w(n),w(l),w(r),w(s)),U(e,u),U(i,u),U(o,u)}}}function dK(t){let e,n,i,l=t[2]("MITM Filtering Certificate")+"",r,s,o,a,u,f,c,d,h=(t[1]?t[2]("View"):t[2]("Edit"))+"",g,_,v,S,A,C,I;f=new Fq({props:{style:"position:relative; top:3px;"}});let M=t[0]!==null&&k3(t),L=t[1]&&w3(t);return{c(){e=R("br"),n=B(),i=R("label"),r=q(l),s=B(),o=R("br"),a=B(),u=R("div"),F(f.$$.fragment),c=B(),d=R("label"),g=q(h),_=B(),M&&M.c(),v=B(),L&&L.c(),S=qe(),P(i,"class","bx--label"),wt(d,"font-size","0.8em"),wt(d,"cursor","pointer"),wt(u,"margin-bottom","10px")},m(N,z){y(N,e,z),y(N,n,z),y(N,i,z),T(i,r),y(N,s,z),y(N,o,z),y(N,a,z),y(N,u,z),H(f,u,null),T(u,c),T(u,d),T(d,g),y(N,_,z),M&&M.m(N,z),y(N,v,z),L&&L.m(N,z),y(N,S,z),A=!0,C||(I=J(u,"click",t[3]),C=!0)},p(N,[z]){(!A||z&4)&&l!==(l=N[2]("MITM Filtering Certificate")+"")&&Z(r,l),(!A||z&6)&&h!==(h=(N[1]?N[2]("View"):N[2]("Edit"))+"")&&Z(g,h),N[0]!==null?M?M.p(N,z):(M=k3(N),M.c(),M.m(v.parentNode,v)):M&&(M.d(1),M=null),N[1]?L?(L.p(N,z),z&2&&b(L,1)):(L=w3(N),L.c(),b(L,1),L.m(S.parentNode,S)):L&&(fe(),k(L,1,1,()=>{L=null}),ce())},i(N){A||(b(f.$$.fragment,N),b(L),A=!0)},o(N){k(f.$$.fragment,N),k(L),A=!1},d(N){N&&(w(e),w(n),w(i),w(s),w(o),w(a),w(u),w(_),w(v),w(S)),U(f),M&&M.d(N),L&&L.d(N),C=!1,I()}}}function hK(t,e,n){let i,l;Mt(t,An,a=>n(4,i=a)),Mt(t,ii,a=>n(2,l=a));let r=null,s=!1;return _n(async()=>{n(0,r=await i.api.doCall("/certificate/info"))}),[r,s,l,()=>n(1,s=!s)]}class mK extends De{constructor(e){super(),Re(this,e,hK,dK,Ie,{})}}function y3(t,e,n){const i=t.slice();return i[20]=e[n],i}function gK(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function _K(t){let e;return{c(){e=q("Settings")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function pK(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[gK]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[_K]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&8388608&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&8388608&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function T3(t){let e,n;return e=new Vt({props:{type:t[4].enabled?"green":"gray",size:"sm",$$slots:{default:[bK]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.type=i[4].enabled?"green":"gray"),l&8389648&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function bK(t){let e=(t[4].enabled?t[10]("Enabled"):t[10]("Disabled"))+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1040&&e!==(e=(i[4].enabled?i[10]("Enabled"):i[10]("Disabled"))+"")&&Z(n,e)},d(i){i&&w(n)}}}function S3(t){let e,n;return e=new xi({props:{kind:"error",title:"Tailscale error",subtitle:t[7]}}),e.$on("close",t[16]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&128&&(r.subtitle=i[7]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function E3(t){let e,n;return e=new xi({props:{kind:"success",title:"Tailscale updated",subtitle:t[8]}}),e.$on("close",t[17]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&256&&(r.subtitle=i[8]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function vK(t){let e,n,i,l=t[10]("Client detected")+"",r,s,o,a,u,f,c,d=t[10]("State")+"",h,g,_,v,S,A,C,I=t[10]("Backend state")+"",M,L,N,z=(t[4].backend_state||t[10]("Unknown"))+"",W,D,G,$,j=t[10]("This node")+"",Q,le,oe,X=(t[4].self_name||"—")+"",de,re,x,me,ee=t[10]("Last refreshed")+"",ke,pe,Fe,Ve=P3(t[4].last_refresh)+"",Ee,We,ge,ve;a=new Vt({props:{type:t[4].detected?"green":"warm-gray",size:"sm",$$slots:{default:[wK]},$$scope:{ctx:t}}}),v=new Vt({props:{type:ta(t[4].state),size:"sm",$$slots:{default:[yK]},$$scope:{ctx:t}}});let be=t[4].message&&M3(t);return{c(){e=R("dl"),n=R("div"),i=R("dt"),r=q(l),s=B(),o=R("dd"),F(a.$$.fragment),u=B(),f=R("div"),c=R("dt"),h=q(d),g=B(),_=R("dd"),F(v.$$.fragment),S=B(),A=R("div"),C=R("dt"),M=q(I),L=B(),N=R("dd"),W=q(z),D=B(),G=R("div"),$=R("dt"),Q=q(j),le=B(),oe=R("dd"),de=q(X),re=B(),x=R("div"),me=R("dt"),ke=q(ee),pe=B(),Fe=R("dd"),Ee=q(Ve),We=B(),be&&be.c(),ge=qe(),P(i,"class","svelte-vjfosm"),P(o,"class","svelte-vjfosm"),P(n,"class","svelte-vjfosm"),P(c,"class","svelte-vjfosm"),P(_,"class","svelte-vjfosm"),P(f,"class","svelte-vjfosm"),P(C,"class","svelte-vjfosm"),P(N,"class","svelte-vjfosm"),P(A,"class","svelte-vjfosm"),P($,"class","svelte-vjfosm"),P(oe,"class","svelte-vjfosm"),P(G,"class","svelte-vjfosm"),P(me,"class","svelte-vjfosm"),P(Fe,"class","svelte-vjfosm"),P(x,"class","svelte-vjfosm"),P(e,"class","status-grid svelte-vjfosm")},m(ue,nt){y(ue,e,nt),T(e,n),T(n,i),T(i,r),T(n,s),T(n,o),H(a,o,null),T(n,u),T(e,f),T(f,c),T(c,h),T(f,g),T(f,_),H(v,_,null),T(f,S),T(e,A),T(A,C),T(C,M),T(A,L),T(A,N),T(N,W),T(A,D),T(e,G),T(G,$),T($,Q),T(G,le),T(G,oe),T(oe,de),T(G,re),T(e,x),T(x,me),T(me,ke),T(x,pe),T(x,Fe),T(Fe,Ee),y(ue,We,nt),be&&be.m(ue,nt),y(ue,ge,nt),ve=!0},p(ue,nt){(!ve||nt&1024)&&l!==(l=ue[10]("Client detected")+"")&&Z(r,l);const Oe={};nt&16&&(Oe.type=ue[4].detected?"green":"warm-gray"),nt&8389648&&(Oe.$$scope={dirty:nt,ctx:ue}),a.$set(Oe),(!ve||nt&1024)&&d!==(d=ue[10]("State")+"")&&Z(h,d);const dt={};nt&16&&(dt.type=ta(ue[4].state)),nt&8389648&&(dt.$$scope={dirty:nt,ctx:ue}),v.$set(dt),(!ve||nt&1024)&&I!==(I=ue[10]("Backend state")+"")&&Z(M,I),(!ve||nt&1040)&&z!==(z=(ue[4].backend_state||ue[10]("Unknown"))+"")&&Z(W,z),(!ve||nt&1024)&&j!==(j=ue[10]("This node")+"")&&Z(Q,j),(!ve||nt&16)&&X!==(X=(ue[4].self_name||"—")+"")&&Z(de,X),(!ve||nt&1024)&&ee!==(ee=ue[10]("Last refreshed")+"")&&Z(ke,ee),(!ve||nt&16)&&Ve!==(Ve=P3(ue[4].last_refresh)+"")&&Z(Ee,Ve),ue[4].message?be?(be.p(ue,nt),nt&16&&b(be,1)):(be=M3(ue),be.c(),b(be,1),be.m(ge.parentNode,ge)):be&&(fe(),k(be,1,1,()=>{be=null}),ce())},i(ue){ve||(b(a.$$.fragment,ue),b(v.$$.fragment,ue),b(be),ve=!0)},o(ue){k(a.$$.fragment,ue),k(v.$$.fragment,ue),k(be),ve=!1},d(ue){ue&&(w(e),w(We),w(ge)),U(a),U(v),be&&be.d(ue)}}}function kK(t){let e,n;return e=new oo({props:{description:"Checking Tailscale..."}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function wK(t){let e=(t[4].detected?t[10]("Detected"):t[10]("Not detected"))+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1040&&e!==(e=(i[4].detected?i[10]("Detected"):i[10]("Not detected"))+"")&&Z(n,e)},d(i){i&&w(n)}}}function yK(t){let e=(t[4].state||t[10]("Unknown"))+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1040&&e!==(e=(i[4].state||i[10]("Unknown"))+"")&&Z(n,e)},d(i){i&&w(n)}}}function M3(t){let e,n;return e=new xi({props:{lowContrast:!0,hideCloseButton:!0,kind:R3(t[4].state),title:D3(t[4].state),subtitle:t[4].message}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.kind=R3(i[4].state)),l&16&&(r.title=D3(i[4].state)),l&16&&(r.subtitle=i[4].message),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function TK(t){var i;let e=(t[6]?t[10]("Saving…"):(i=t[4])!=null&&i.enabled?t[10]("Disable Tailscale"):t[10]("Enable Tailscale"))+"",n;return{c(){n=q(e)},m(l,r){y(l,n,r)},p(l,r){var s;r&1104&&e!==(e=(l[6]?l[10]("Saving…"):(s=l[4])!=null&&s.enabled?l[10]("Disable Tailscale"):l[10]("Enable Tailscale"))+"")&&Z(n,e)},d(l){l&&w(n)}}}function SK(t){let e=(t[5]?t[10]("Refreshing…"):t[10]("Refresh status"))+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1056&&e!==(e=(i[5]?i[10]("Refreshing…"):i[10]("Refresh status"))+"")&&Z(n,e)},d(i){i&&w(n)}}}function O3(t){let e,n;return e=new xi({props:{kind:"error",title:"Diagnostics error",subtitle:t[3]}}),e.$on("close",t[19]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8&&(r.subtitle=i[3]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function EK(t){let e=(t[2]?t[10]("Checking…"):t[10]("Run diagnostics"))+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1028&&e!==(e=(i[2]?i[10]("Checking…"):i[10]("Run diagnostics"))+"")&&Z(n,e)},d(i){i&&w(n)}}}function MK(t){let e=t[10]("Preview support bundle")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1024&&e!==(e=i[10]("Preview support bundle")+"")&&Z(n,e)},d(i){i&&w(n)}}}function OK(t){let e=t[10]("Download preview")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1024&&e!==(e=i[10]("Download preview")+"")&&Z(n,e)},d(i){i&&w(n)}}}function A3(t){let e,n,i=t[10]("Overall status")+"",l,r,s,o,a,u,f;o=new Vt({props:{type:ta(t[0].overall),size:"sm",$$slots:{default:[AK]},$$scope:{ctx:t}}});let c=ct(t[0].checks||[]),d=[];for(let g=0;gk(d[g],1,1,()=>{d[g]=null});return{c(){e=R("p"),n=R("strong"),l=q(i),r=q(":"),s=B(),F(o.$$.fragment),a=B(),u=R("div");for(let g=0;g{se=null}),ce()),ze[7]?Le?(Le.p(ze,Qe),Qe&128&&b(Le,1)):(Le=S3(ze),Le.c(),b(Le,1),Le.m(S,j)):Le&&(fe(),k(Le,1,1,()=>{Le=null}),ce()),ze[8]?_t?(_t.p(ze,Qe),Qe&256&&b(_t,1)):(_t=E3(ze),_t.c(),b(_t,1),_t.m(S,Q)):_t&&(fe(),k(_t,1,1,()=>{_t=null}),ce());let qn=le;le=Ot(ze),le===qn?~le&&Be[le].p(ze,Qe):(oe&&(fe(),k(Be[qn],1,1,()=>{Be[qn]=null}),ce()),~le?(oe=Be[le],oe?oe.p(ze,Qe):(oe=Be[le]=zt[le](ze),oe.c()),b(oe,1),oe.m(S,X)):oe=null),(!Ce||Qe&1024)&&re!==(re=ze[10]("Peer suggestions are hints only. A peer is linked only after you choose it and confirm the link on a device.")+"")&&Z(x,re),(!Ce||Qe&1024)&&ke!==(ke=ze[10]("Tailscale normally does not supply a hardware MAC address. Wake-on-LAN MAC addresses, when available, are informational and are not used to match or link devices.")+"")&&Z(pe,ke);const li={};Qe&112&&(li.disabled=ze[5]||ze[6]||!ze[4]),Qe&8389712&&(li.$$scope={dirty:Qe,ctx:ze}),Ee.$set(li);const di={};Qe&96&&(di.disabled=ze[5]||ze[6]),Qe&8389664&&(di.$$scope={dirty:Qe,ctx:ze}),ge.$set(di),(!Ce||Qe&1024)&&nt!==(nt=ze[10]("Gateway diagnostics")+"")&&Z(Oe,nt),(!Ce||Qe&1024)&&at!==(at=ze[10]("Check gateway health and create a support bundle that excludes credentials, private keys, image data, device identities, and browsing history.")+"")&&Z(ut,at),ze[3]?kt?(kt.p(ze,Qe),Qe&8&&b(kt,1)):(kt=O3(ze),kt.c(),b(kt,1),kt.m(be,xe)):kt&&(fe(),k(kt,1,1,()=>{kt=null}),ce());const hi={};Qe&4&&(hi.disabled=ze[2]),Qe&8389636&&(hi.$$scope={dirty:Qe,ctx:ze}),we.$set(hi);const Mi={};Qe&8389632&&(Mi.$$scope={dirty:Qe,ctx:ze}),It.$set(Mi);const wi={};Qe&2&&(wi.disabled=!ze[1]),Qe&8389632&&(wi.$$scope={dirty:Qe,ctx:ze}),Wt.$set(wi),ze[0]?Pt?(Pt.p(ze,Qe),Qe&1&&b(Pt,1)):(Pt=A3(ze),Pt.c(),b(Pt,1),Pt.m(be,Xt)):Pt&&(fe(),k(Pt,1,1,()=>{Pt=null}),ce()),ze[1]?Ye?Ye.p(ze,Qe):(Ye=I3(ze),Ye.c(),Ye.m(be,null)):Ye&&(Ye.d(1),Ye=null)},i(ze){Ce||(b(e.$$.fragment,ze),b(o.$$.fragment,ze),b(c.$$.fragment,ze),b(h.$$.fragment,ze),b(_.$$.fragment,ze),b(se),b(Le),b(_t),b(oe),b(Ee.$$.fragment,ze),b(ge.$$.fragment,ze),b(kt),b(we.$$.fragment,ze),b(It.$$.fragment,ze),b(Wt.$$.fragment,ze),b(Pt),Ce=!0)},o(ze){k(e.$$.fragment,ze),k(o.$$.fragment,ze),k(c.$$.fragment,ze),k(h.$$.fragment,ze),k(_.$$.fragment,ze),k(se),k(Le),k(_t),k(oe),k(Ee.$$.fragment,ze),k(ge.$$.fragment,ze),k(kt),k(we.$$.fragment,ze),k(It.$$.fragment,ze),k(Wt.$$.fragment,ze),k(Pt),Ce=!1},d(ze){ze&&(w(n),w(i),w(l),w(r),w(s),w(a),w(u),w(f),w(d),w(g),w(v),w(S),w(ve),w(be)),U(e,ze),U(o,ze),U(c,ze),U(h,ze),U(_,ze),se&&se.d(),Le&&Le.d(),_t&&_t.d(),~le&&Be[le].d(),U(Ee),U(ge),kt&&kt.d(),U(we),U(It),U(Wt),Pt&&Pt.d(),Ye&&Ye.d()}}}function ta(t){return t==="ok"||t==="running"||t==="connected"?"green":t==="failed"||t==="stopped"||t==="unavailable"?"red":t==="degraded"||t==="connecting"?"warm-gray":"gray"}function R3(t){return t==="connected"?"success":t==="degraded"||t==="connecting"?"warning":t==="unavailable"||t==="stopped"?"error":"info"}function D3(t){return t==="connected"?"Tailscale connected":t==="degraded"?"Tailscale data degraded":t==="unavailable"?"Tailscale unavailable":t==="connecting"?"Tailscale connecting":t==="disabled"?"Tailscale disabled":"Tailscale status"}function P3(t){if(!t)return"Never";const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString()}function IK(t,e,n){let i,l;Mt(t,An,N=>n(9,i=N)),Mt(t,ii,N=>n(10,l=N));let r=null,s="",o=!1,a="",u=null,f=!1,c=!1,d="",h="";async function g(){n(2,o=!0),n(3,a="");try{n(0,r=await i.api.doCall("/diagnostics"))}catch(N){n(3,a=N instanceof Error?N.message:"Diagnostics failed")}finally{n(2,o=!1)}}async function _(){n(3,a="");try{const N=await i.api.doCall("/diagnostics/bundle");n(1,s=JSON.stringify(N,null,2))}catch(N){n(3,a=N instanceof Error?N.message:"Bundle preview failed")}}function v(){if(!s)return;const N=URL.createObjectURL(new Blob([s+` -`],{type:"application/json"})),z=document.createElement("a");z.href=N,z.download="gatesentry-support-bundle.json",z.click(),URL.revokeObjectURL(N)}async function S(){n(5,f=!0),n(7,d="");try{n(4,u=await i.api.doCall("/tailscale/status"))}catch(N){n(7,d=N instanceof Error?N.message:"Tailscale status failed")}finally{n(5,f=!1)}}async function A(N){n(6,c=!0),n(7,d=""),n(8,h="");try{await i.api.doCall("/tailscale/config","put",{enabled:N}),n(8,h=N?"Tailscale integration enabled.":"Tailscale integration disabled."),await S()}catch(z){n(7,d=z instanceof Error?z.message:"Tailscale update failed")}finally{n(6,c=!1)}}return _n(()=>{g(),S()}),[r,s,o,a,u,f,c,d,h,i,l,g,_,v,S,A,()=>n(7,d=""),()=>n(8,h=""),()=>A(!((u==null?void 0:u.enabled)??!1)),()=>n(3,a="")]}class RK extends De{constructor(e){super(),Re(this,e,IK,LK,Ie,{})}}function DK(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function PK(t){let e;return{c(){e=q("Toggle Services")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function NK(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[DK]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[PK]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function BK(t){let e,n,i,l,r,s,o,a;return e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[NK]},$$scope:{ctx:t}}}),o=new y8({props:{settingName:"enable_dns_server",label:"DNS Server",labelA:"Not Running",labelB:"Running"}}),{c(){F(e.$$.fragment),n=B(),i=R("h2"),i.textContent="Toggle Services",l=B(),r=R("br"),s=B(),F(o.$$.fragment)},m(u,f){H(e,u,f),y(u,n,f),y(u,i,f),y(u,l,f),y(u,r,f),y(u,s,f),H(o,u,f),a=!0},p(u,[f]){const c={};f&1&&(c.$$scope={dirty:f,ctx:u}),e.$set(c)},i(u){a||(b(e.$$.fragment,u),b(o.$$.fragment,u),a=!0)},o(u){k(e.$$.fragment,u),k(o.$$.fragment,u),a=!1},d(u){u&&(w(n),w(i),w(l),w(r),w(s)),U(e,u),U(o,u)}}}class zK extends De{constructor(e){super(),Re(this,e,null,BK,Ie,{})}}function N3(t,e,n){const i=t.slice();return i[36]=e[n],i}function B3(t,e,n){const i=t.slice();return i[39]=e[n],i}function z3(t,e,n){const i=t.slice();return i[42]=e[n],i}function HK(t){let e=t[16]("Refresh")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Refresh")+"")&&Z(n,e)},d(i){i&&w(n)}}}function H3(t){let e,n;return e=new xi({props:{kind:"error",title:t[16]("Status unavailable"),subtitle:t[6]}}),e.$on("close",t[23]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.title=i[16]("Status unavailable")),l[0]&64&&(r.subtitle=i[6]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function U3(t){var Qu,Sa;let e=[],n=new Map,i,l,r,s,o=t[16]("Protection")+"",a,u,f,c,d,h=(t[0].dns_running?t[16]("DNS server running"):t[16]("DNS server stopped"))+"",g,_,v,S,A=t[16]("Devices")+"",C,I,M,L=t[22](t[0].device_count)+"",N,z,W,D=t[16]("discovered on the network")+"",G,$,j,Q,le=t[16]("Blocklist")+"",oe,X,de,re=t[22](t[0].blocked_domains)+"",x,me,ee,ke=t[16]("domains loaded")+"",pe,Fe,Ve,Ee,We=t[16]("HTTPS inspection")+"",ge,ve,be,ue,nt,Oe=t[16]("optional; needs the certificate")+"",dt,yt,at,ut,At,xe,mt=t[16]("Last 24 hours")+"",we,gt,It,Ht,Wt,qt,Xt,Ce=t[22]((Qu=t[1])==null?void 0:Qu.total)+"",se,Le,_t,zt=t[16]("requests")+"",Be,Ot,kt,Pt,Ye=t[22](t[2])+"",ze,Qe,He,Tt=t[16]("blocked")+"",Bt,qn,li,di,hi,Mi,wi,Ri=t[22]((Sa=t[1])==null?void 0:Sa.unique_clients)+"",Zi,ur,Kn,Rn=t[16]("active clients")+"",lt,St,Dn,Hn,Ll,mi,Un,tn,Tn,pn=t[16]("Setup")+"",ml,gl,ri,Sn,Di,el=t[16]("The protection check asks the running DNS server to resolve a controlled test domain and records the decision it made.")+"",Xl,Cs,_l,Ls,xr,si,Lt,Kt=t[16]("Connect a device")+"",Kl,es,Sr,fr=t[16]("Set the DNS server on a device, or in your router's DHCP settings, to the GateSentry address. Devices that use another resolver are not filtered.")+"",Er,ts,tl,Is,cr,Il=t[16]("Test from a device:")+"",go,$u,Mr,ka,Rl,dr,wa,Dl,_o,Xi,hn,ns=ct(t[14]);const Ju=st=>st[42].key;for(let st=0;st0&&W3(t);_l=new Rt({props:{size:"small",disabled:t[11]||!t[0].dns_running,$$slots:{default:[JK]},$$scope:{ctx:t}}}),_l.$on("click",t[18]);let ai=t[8]&&j3(t);return tl=new gu({props:{condensed:!0,flush:!0,$$slots:{default:[k$]},$$scope:{ctx:t}}}),Mr=new zP({props:{type:"single",code:`dig @${t[21]()} example.com`}}),dr=new Rt({props:{kind:"tertiary",size:"small",$$slots:{default:[w$]},$$scope:{ctx:t}}}),dr.$on("click",t[25]),Dl=new Rt({props:{kind:"ghost",size:"small",$$slots:{default:[y$]},$$scope:{ctx:t}}}),Dl.$on("click",t[26]),Xi=new Rt({props:{kind:"ghost",size:"small",$$slots:{default:[T$]},$$scope:{ctx:t}}}),Xi.$on("click",t[27]),{c(){for(let st=0;st{$l[Ea]=null}),ce()),~Dn?(Hn=$l[Dn],Hn?Hn.p(st,pt):(Hn=$l[Dn]=ya[Dn](st),Hn.c()),b(Hn,1),Hn.m(ut,null)):Hn=null),(!hn||pt[0]&65536)&&pn!==(pn=st[16]("Setup")+"")&&Z(ml,pn),st[15]?xn?(xn.p(st,pt),pt[0]&32768&&b(xn,1)):(xn=V3(st),xn.c(),b(xn,1),xn.m(tn,null)):xn&&(fe(),k(xn,1,1,()=>{xn=null}),ce()),st[4].length>0?oi?(oi.p(st,pt),pt[0]&16&&b(oi,1)):(oi=W3(st),oi.c(),b(oi,1),oi.m(Un,Sn)):oi&&(fe(),k(oi,1,1,()=>{oi=null}),ce()),(!hn||pt[0]&65536)&&el!==(el=st[16]("The protection check asks the running DNS server to resolve a controlled test domain and records the decision it made.")+"")&&Z(Xl,el);const Ma={};pt[0]&2049&&(Ma.disabled=st[11]||!st[0].dns_running),pt[0]&67584|pt[1]&16384&&(Ma.$$scope={dirty:pt,ctx:st}),_l.$set(Ma),st[8]?ai?(ai.p(st,pt),pt[0]&256&&b(ai,1)):(ai=j3(st),ai.c(),b(ai,1),ai.m(Un,null)):ai&&(fe(),k(ai,1,1,()=>{ai=null}),ce()),(!hn||pt[0]&65536)&&Kt!==(Kt=st[16]("Connect a device")+"")&&Z(Kl,Kt),(!hn||pt[0]&65536)&&fr!==(fr=st[16]("Set the DNS server on a device, or in your router's DHCP settings, to the GateSentry address. Devices that use another resolver are not filtered.")+"")&&Z(Er,fr);const xu={};pt[0]&65537|pt[1]&16384&&(xu.$$scope={dirty:pt,ctx:st}),tl.$set(xu),(!hn||pt[0]&65536)&&Il!==(Il=st[16]("Test from a device:")+"")&&Z(go,Il);const ef={};pt[0]&65536|pt[1]&16384&&(ef.$$scope={dirty:pt,ctx:st}),dr.$set(ef);const tf={};pt[0]&65536|pt[1]&16384&&(tf.$$scope={dirty:pt,ctx:st}),Dl.$set(tf);const Cn={};pt[0]&65536|pt[1]&16384&&(Cn.$$scope={dirty:pt,ctx:st}),Xi.$set(Cn)},i(st){if(!hn){for(let pt=0;pto[39].key;for(let o=0;oo[36].name;for(let o=0;o{u=null}),ce()),c[10]?f?(f.p(c,d),d[0]&1024&&b(f,1)):(f=X3(c),f.c(),b(f,1),f.m(e,null)):f&&(fe(),k(f,1,1,()=>{f=null}),ce())},i(c){a||(b(n.$$.fragment,c),b(u),b(f),a=!0)},o(c){k(n.$$.fragment,c),k(u),k(f),a=!1},d(c){c&&w(e),U(n),u&&u.d(),f&&f.d()}}}function QK(t){let e=(t[8]==="ok"?t[16]("Protected"):t[16]("Not protected"))+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65792&&e!==(e=(i[8]==="ok"?i[16]("Protected"):i[16]("Not protected"))+"")&&Z(n,e)},d(i){i&&w(n)}}}function Y3(t){let e,n;return e=new gu({props:{condensed:!0,flush:!0,$$slots:{default:[d$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65664|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function xK(t){let e=t[16]("Test domain")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Test domain")+"")&&Z(n,e)},d(i){i&&w(n)}}}function e$(t){let e=t[7].domain+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].domain+"")&&Z(n,e)},d(i){i&&w(n)}}}function t$(t){let e,n,i,l;return e=new Zt({props:{noWrap:!0,$$slots:{default:[xK]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[e$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function n$(t){let e=t[16]("Answer")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Answer")+"")&&Z(n,e)},d(i){i&&w(n)}}}function i$(t){let e=t[7].rcode+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].rcode+"")&&Z(n,e)},d(i){i&&w(n)}}}function l$(t){let e,n,i,l;return e=new Zt({props:{noWrap:!0,$$slots:{default:[n$]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[i$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Z3(t){let e,n;return e=new Zn({props:{$$slots:{default:[o$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65664|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function r$(t){let e=t[16]("Explanation")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Explanation")+"")&&Z(n,e)},d(i){i&&w(n)}}}function s$(t){let e=t[7].cname+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].cname+"")&&Z(n,e)},d(i){i&&w(n)}}}function o$(t){let e,n,i,l;return e=new Zt({props:{noWrap:!0,$$slots:{default:[r$]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[s$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function a$(t){let e=t[16]("Upstream")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Upstream")+"")&&Z(n,e)},d(i){i&&w(n)}}}function u$(t){let e=t[7].upstream+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].upstream+"")&&Z(n,e)},d(i){i&&w(n)}}}function f$(t){let e,n,i,l;return e=new Zt({props:{noWrap:!0,$$slots:{default:[a$]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[u$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function c$(t){let e,n,i,l,r,s,o;e=new Zn({props:{$$slots:{default:[t$]},$$scope:{ctx:t}}}),i=new Zn({props:{$$slots:{default:[l$]},$$scope:{ctx:t}}});let a=t[7].cname&&Z3(t);return s=new Zn({props:{$$slots:{default:[f$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),a&&a.c(),r=B(),F(s.$$.fragment)},m(u,f){H(e,u,f),y(u,n,f),H(i,u,f),y(u,l,f),a&&a.m(u,f),y(u,r,f),H(s,u,f),o=!0},p(u,f){const c={};f[0]&65664|f[1]&16384&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};f[0]&65664|f[1]&16384&&(d.$$scope={dirty:f,ctx:u}),i.$set(d),u[7].cname?a?(a.p(u,f),f[0]&128&&b(a,1)):(a=Z3(u),a.c(),b(a,1),a.m(r.parentNode,r)):a&&(fe(),k(a,1,1,()=>{a=null}),ce());const h={};f[0]&65664|f[1]&16384&&(h.$$scope={dirty:f,ctx:u}),s.$set(h)},i(u){o||(b(e.$$.fragment,u),b(i.$$.fragment,u),b(a),b(s.$$.fragment,u),o=!0)},o(u){k(e.$$.fragment,u),k(i.$$.fragment,u),k(a),k(s.$$.fragment,u),o=!1},d(u){u&&(w(n),w(l),w(r)),U(e,u),U(i,u),a&&a.d(u),U(s,u)}}}function d$(t){let e,n;return e=new Nu({props:{$$slots:{default:[c$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65664|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function X3(t){let e,n;return e=new xi({props:{kind:"error",lowContrast:!0,hideCloseButton:!0,title:t[16]("Protection check failed"),subtitle:t[10]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.title=i[16]("Protection check failed")),l[0]&1024&&(r.subtitle=i[10]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function h$(t){let e=t[16]("DNS listener")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("DNS listener")+"")&&Z(n,e)},d(i){i&&w(n)}}}function m$(t){let e,n=t[0].listen_addr+"",i,l,r=t[0].listen_port+"",s;return{c(){e=R("code"),i=q(n),l=q(":"),s=q(r),P(e,"class","svelte-68lff4")},m(o,a){y(o,e,a),T(e,i),T(e,l),T(e,s)},p(o,a){a[0]&1&&n!==(n=o[0].listen_addr+"")&&Z(i,n),a[0]&1&&r!==(r=o[0].listen_port+"")&&Z(s,r)},d(o){o&&w(e)}}}function g$(t){let e,n,i,l;return e=new Zt({props:{noWrap:!0,$$slots:{default:[h$]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[m$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function _$(t){let e=t[16]("Upstream resolver")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Upstream resolver")+"")&&Z(n,e)},d(i){i&&w(n)}}}function p$(t){let e,n=t[0].upstream+"",i;return{c(){e=R("code"),i=q(n),P(e,"class","svelte-68lff4")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&1&&n!==(n=l[0].upstream+"")&&Z(i,n)},d(l){l&&w(e)}}}function b$(t){let e,n,i,l;return e=new Zt({props:{noWrap:!0,$$slots:{default:[_$]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[p$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function v$(t){let e,n,i,l;return e=new Zn({props:{$$slots:{default:[g$]},$$scope:{ctx:t}}}),i=new Zn({props:{$$slots:{default:[b$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65537|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&65537|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function k$(t){let e,n;return e=new Nu({props:{$$slots:{default:[v$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65537|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function w$(t){let e=t[16]("Policies")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Policies")+"")&&Z(n,e)},d(i){i&&w(n)}}}function y$(t){let e=t[16]("Devices")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Devices")+"")&&Z(n,e)},d(i){i&&w(n)}}}function T$(t){let e=t[16]("DNS settings")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("DNS settings")+"")&&Z(n,e)},d(i){i&&w(n)}}}function S$(t){let e,n,i,l,r=t[16]("Overview")+"",s,o,a,u=t[16]("GateSentry is a self-hosted internet safety gateway. Devices that use it for DNS, or send traffic through its proxy, are filtered by your policies.")+"",f,c,d,h,g,_;d=new Rt({props:{kind:"ghost",size:"small",icon:$1,$$slots:{default:[HK]},$$scope:{ctx:t}}}),d.$on("click",t[17]);let v=t[6]&&H3(t),S=t[0]&&U3(t);return{c(){e=R("div"),n=R("header"),i=R("div"),l=R("h2"),s=q(r),o=B(),a=R("p"),f=q(u),c=B(),F(d.$$.fragment),h=B(),v&&v.c(),g=B(),S&&S.c(),P(a,"class","lede svelte-68lff4"),P(n,"class","page-head svelte-68lff4"),P(e,"class","page svelte-68lff4")},m(A,C){y(A,e,C),T(e,n),T(n,i),T(i,l),T(l,s),T(i,o),T(i,a),T(a,f),T(n,c),H(d,n,null),T(e,h),v&&v.m(e,null),T(e,g),S&&S.m(e,null),_=!0},p(A,C){(!_||C[0]&65536)&&r!==(r=A[16]("Overview")+"")&&Z(s,r),(!_||C[0]&65536)&&u!==(u=A[16]("GateSentry is a self-hosted internet safety gateway. Devices that use it for DNS, or send traffic through its proxy, are filtered by your policies.")+"")&&Z(f,u);const I={};C[0]&65536|C[1]&16384&&(I.$$scope={dirty:C,ctx:A}),d.$set(I),A[6]?v?(v.p(A,C),C[0]&64&&b(v,1)):(v=H3(A),v.c(),b(v,1),v.m(e,g)):v&&(fe(),k(v,1,1,()=>{v=null}),ce()),A[0]?S?(S.p(A,C),C[0]&1&&b(S,1)):(S=U3(A),S.c(),b(S,1),S.m(e,null)):S&&(fe(),k(S,1,1,()=>{S=null}),ce())},i(A){_||(b(d.$$.fragment,A),b(v),b(S),_=!0)},o(A){k(d.$$.fragment,A),k(v),k(S),_=!1},d(A){A&&w(e),U(d),v&&v.d(),S&&S.d()}}}function E$(t,e,n){let i,l,r,s,o,a,u,f,c;Mt(t,ii,ke=>n(16,f=ke)),Mt(t,An,ke=>n(29,c=ke));const d=["resolver","blocklist","first_device","protection_check"];let h=null,g=null,_=null,v="",S=null,A="",C="",I="",M=!1,L=null;const N=async()=>{n(6,v="");try{n(0,h=await c.api.doCall("/onboarding/status"))}catch{n(6,v="Unable to load the gateway status.")}},z=async()=>{try{n(1,g=await c.api.doCall("/decisions/summary?days=1"))}catch{n(1,g=null)}},W=async()=>{try{const ke=await c.api.doCall("/settings/enable_https_filtering");n(5,_=(ke==null?void 0:ke.Value)==="true")}catch{n(5,_=null)}},D=()=>Promise.all([N(),z(),W()]),G=async()=>{n(11,M=!0),n(9,C=""),n(10,I=""),n(8,A="");try{const ke=await c.api.doCall("/onboarding/protection-check","post",{});n(7,S=ke.check),n(8,A=ke.state),n(9,C=ke.detail),n(10,I=ke.action||""),await N()}catch{n(8,A="failed"),n(9,C="The protection check did not complete."),n(10,I="Verify the DNS listener and upstream resolver, then retry the check.")}finally{n(11,M=!1)}},$=ke=>f(ke==="resolver"?"Resolver and listener":ke==="blocklist"?"Blocklists loaded":ke==="first_device"?"First device discovered":"Protection verified"),j=ke=>h?ke==="resolver"?h.resolver.detail||"":ke==="blocklist"?h.blocklist.detail||"":ke==="first_device"?`${h.device_count} ${f("devices discovered")}`:h.progress.first_explained_protection_at?`${f("Verified")} ${new Date(h.progress.first_explained_protection_at).toLocaleString()}`:f("Not verified yet"):"",Q=ke=>{const pe=[];return ke.bind.state!=="ok"&&pe.push({key:"bind",title:f("DNS listener is not ready"),subtitle:[ke.bind.detail,ke.bind.action].filter(Boolean).join(" ")}),ke.resolver.state!=="ok"&&ke.resolver.action&&pe.push({key:"resolver",title:f("Upstream resolver is not reachable"),subtitle:ke.resolver.action}),ke.blocklist.state!=="ok"&&ke.blocklist.action&&pe.push({key:"blocklist",title:f("Blocklist empty"),subtitle:ke.blocklist.action}),pe},le=["","0.0.0.0","::","[::]","127.0.0.1","::1"],oe=()=>{const ke=(h==null?void 0:h.listen_addr)||"";return le.includes(ke)?"":ke},X=ke=>typeof ke=="number"?ke.toLocaleString():"—";_n(()=>{D(),L=setInterval(z,3e4)}),Es(()=>{L&&clearInterval(L)});const de=()=>n(6,v=""),re=()=>Vi("/stats"),x=()=>Vi("/rules"),me=()=>Vi("/devices"),ee=()=>Vi("/dns");return t.$$.update=()=>{var ke;t.$$.dirty[0]&1&&n(4,i=((h==null?void 0:h.steps)||[]).filter(pe=>d.includes(pe.name))),t.$$.dirty[0]&16&&n(3,l=i.findIndex(pe=>pe.state!=="ok")),t.$$.dirty[0]&24&&n(15,r=i.length>0&&l===-1),t.$$.dirty[0]&1&&n(14,s=h?Q(h):[]),t.$$.dirty[0]&1&&n(13,o=!!(h!=null&&h.progress.first_explained_protection_at)),t.$$.dirty[0]&2&&n(2,a=((ke=g==null?void 0:g.by_action)==null?void 0:ke.block)||0),t.$$.dirty[0]&6&&n(12,u=g&&g.total>0?(a/g.total*100).toFixed(1)+"%":"—")},[h,g,a,l,i,_,v,S,A,C,I,M,u,o,s,r,f,D,G,$,j,oe,X,de,re,x,me,ee]}class M$ extends De{constructor(e){super(),Re(this,e,E$,S$,Ie,{},null,[-1,-1])}}function O$(t){let e;return{c(){e=R("pre"),e.innerHTML=` + ensure it adheres to the relevant legal standards in your jurisdiction.`,P(i,"class","notice-title"),P(o,"class","section"),P(c,"class","section"),P(_,"class","section"),P(C,"class","section"),P(n,"class","mitm-privacy-notice")},m(D,G){y(D,e,G),T(e,n),T(n,i),T(i,r),T(n,s),T(n,o),T(n,a),T(n,u),T(n,f),T(n,c),T(n,d),T(n,h),T(n,g),T(n,_),T(n,v),T(n,S),T(n,A),T(n,C),T(n,I),T(n,M),T(n,L),T(n,N),T(n,z),T(n,W)},p(D,[G]){G&1&&l!==(l=D[0]("Privacy Notice for Enabling MITM Filtering")+"")&&Z(r,l)},i:he,o:he,d(D){D&&w(e)}}}function nK(t,e,n){let i;return Mt(t,ii,l=>n(0,i=l)),[i]}class iK extends De{constructor(e){super(),Re(this,e,nK,tK,Ie,{})}}function lK(t){let e,n;return e=new iK({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function rK(t){let e,n,i,l,r,s;return e=new Ru({props:{label:"Privacy policy",title:""}}),i=new Du({props:{hasForm:!0,$$slots:{default:[lK]},$$scope:{ctx:t}}}),r=new Pu({props:{secondaryButtonText:t[2]("I have reviewed the policy"),secondaryClass:"bx--btn--primary"}}),r.$on("click:button--secondary",t[5]),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){H(e,o,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,a){const u={};a&64&&(u.$$scope={dirty:a,ctx:o}),i.$set(u);const f={};a&4&&(f.secondaryButtonText=o[2]("I have reviewed the policy")),r.$set(f)},i(o){s||(b(e.$$.fragment,o),b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(e.$$.fragment,o),k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(n),w(l)),U(e,o),U(i,o),U(r,o)}}}function sK(t){let e,n,i,l,r,s,o,a,u;function f(d){t[3](d)}let c={settingName:"enable_https_filtering",label:t[2]("HTTPS inspection (decrypts traffic; needs the GateSentry certificate on each device)"),labelA:t[2]("Disabled"),labelB:t[2]("Enabled"),noNotification:!0};return t[1]!==void 0&&(c.settingValue=t[1]),i=new T8({props:c}),ft.push(()=>Yt(i,"settingValue",f)),s=new Iu({props:{open:t[0],$$slots:{default:[rK]},$$scope:{ctx:t}}}),{c(){e=R("div"),n=R("div"),F(i.$$.fragment),r=B(),F(s.$$.fragment),wt(e,"margin-top","15px")},m(d,h){y(d,e,h),T(e,n),H(i,n,null),T(e,r),H(s,e,null),o=!0,a||(u=J(n,"click",t[4]),a=!0)},p(d,[h]){const g={};h&4&&(g.label=d[2]("HTTPS inspection (decrypts traffic; needs the GateSentry certificate on each device)")),h&4&&(g.labelA=d[2]("Disabled")),h&4&&(g.labelB=d[2]("Enabled")),!l&&h&2&&(l=!0,g.settingValue=d[1],jt(()=>l=!1)),i.$set(g);const _={};h&1&&(_.open=d[0]),h&69&&(_.$$scope={dirty:h,ctx:d}),s.$set(_)},i(d){o||(b(i.$$.fragment,d),b(s.$$.fragment,d),o=!0)},o(d){k(i.$$.fragment,d),k(s.$$.fragment,d),o=!1},d(d){d&&w(e),U(i),U(s),a=!1,u()}}}function oK(t,e,n){let i;Mt(t,ii,u=>n(2,i=u));let l=!1,r="";function s(u){r=u,n(1,r)}return[l,r,i,s,()=>{r=="false"&&n(0,l=!0)},()=>{n(0,l=!1)}]}class aK extends De{constructor(e){super(),Re(this,e,oK,sK,Ie,{})}}function uK(t){let e;return{c(){e=q(t[0])},m(n,i){y(n,e,i)},p(n,i){i&1&&Z(e,n[0])},d(n){n&&w(e)}}}function fK(t){let e,n,i,l,r,s;return i=new _z({props:{$$slots:{default:[uK]},$$scope:{ctx:t}}}),r=new GT({props:{value:t[1]}}),r.$on("blur",t[2]),{c(){e=R("br"),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){y(o,e,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,[a]){const u={};a&129&&(u.$$scope={dirty:a,ctx:o}),i.$set(u);const f={};a&2&&(f.value=o[1]),r.$set(f)},i(o){s||(b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(e),w(n),w(l)),U(i,o),U(r,o)}}}function cK(t,e,n){let i,l;Mt(t,ii,f=>n(4,i=f)),Mt(t,An,f=>n(5,l=f));let r="",{settingName:s}=e,{label:o}=e;const a=async()=>{if(s===void 0)return;const f=await l.api.getSetting(s);n(1,r=f.Value)};let u=async f=>{const c=f.target.value;await l.api.setSetting(s,c)===!1?ci.add(ao({subtitle:i("Unable to save certificate data")},i)):ci.add(Hu({subtitle:i("Certificate data saved")},i)),a()};return t.$$set=f=>{"settingName"in f&&n(3,s=f.settingName),"label"in f&&n(0,o=f.label)},a(),[o,r,u,s]}class v3 extends De{constructor(e){super(),Re(this,e,cK,fK,Ie,{settingName:3,label:0})}}function k3(t){let e,n,i=t[2]("Certificate Issuer Name: ")+"",l,r,s=t[0].name+"",o,a,u,f,c,d=t[2]("Certificate Expiry: ")+"",h,g,_=t[0].expiry+"",v,S,A;return{c(){e=R("div"),n=R("div"),l=q(i),r=B(),o=q(s),a=B(),u=R("br"),f=B(),c=R("div"),h=q(d),g=B(),v=q(_),S=B(),A=R("br"),P(e,"class","simple-border"),wt(e,"margin-top","3px")},m(C,I){y(C,e,I),T(e,n),T(n,l),T(n,r),T(n,o),T(e,a),T(e,u),T(e,f),T(e,c),T(c,h),T(c,g),T(c,v),y(C,S,I),y(C,A,I)},p(C,I){I&4&&i!==(i=C[2]("Certificate Issuer Name: ")+"")&&Z(l,i),I&1&&s!==(s=C[0].name+"")&&Z(o,s),I&4&&d!==(d=C[2]("Certificate Expiry: ")+"")&&Z(h,d),I&1&&_!==(_=C[0].expiry+"")&&Z(v,_)},d(C){C&&(w(e),w(S),w(A))}}}function w3(t){let e,n,i,l,r,s,o,a;return e=new v3({props:{settingName:"capem",label:t[2]("HTTPS Filtering - Certificate")}}),i=new v3({props:{settingName:"keypem",label:t[2]("HTTPS Filtering - Key")}}),o=new v8({}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),r=R("br"),s=B(),F(o.$$.fragment)},m(u,f){H(e,u,f),y(u,n,f),H(i,u,f),y(u,l,f),y(u,r,f),y(u,s,f),H(o,u,f),a=!0},p(u,f){const c={};f&4&&(c.label=u[2]("HTTPS Filtering - Certificate")),e.$set(c);const d={};f&4&&(d.label=u[2]("HTTPS Filtering - Key")),i.$set(d)},i(u){a||(b(e.$$.fragment,u),b(i.$$.fragment,u),b(o.$$.fragment,u),a=!0)},o(u){k(e.$$.fragment,u),k(i.$$.fragment,u),k(o.$$.fragment,u),a=!1},d(u){u&&(w(n),w(l),w(r),w(s)),U(e,u),U(i,u),U(o,u)}}}function dK(t){let e,n,i,l=t[2]("MITM Filtering Certificate")+"",r,s,o,a,u,f,c,d,h=(t[1]?t[2]("View"):t[2]("Edit"))+"",g,_,v,S,A,C,I;f=new Fq({props:{style:"position:relative; top:3px;"}});let M=t[0]!==null&&k3(t),L=t[1]&&w3(t);return{c(){e=R("br"),n=B(),i=R("label"),r=q(l),s=B(),o=R("br"),a=B(),u=R("div"),F(f.$$.fragment),c=B(),d=R("label"),g=q(h),_=B(),M&&M.c(),v=B(),L&&L.c(),S=qe(),P(i,"class","bx--label"),wt(d,"font-size","0.8em"),wt(d,"cursor","pointer"),wt(u,"margin-bottom","10px")},m(N,z){y(N,e,z),y(N,n,z),y(N,i,z),T(i,r),y(N,s,z),y(N,o,z),y(N,a,z),y(N,u,z),H(f,u,null),T(u,c),T(u,d),T(d,g),y(N,_,z),M&&M.m(N,z),y(N,v,z),L&&L.m(N,z),y(N,S,z),A=!0,C||(I=J(u,"click",t[3]),C=!0)},p(N,[z]){(!A||z&4)&&l!==(l=N[2]("MITM Filtering Certificate")+"")&&Z(r,l),(!A||z&6)&&h!==(h=(N[1]?N[2]("View"):N[2]("Edit"))+"")&&Z(g,h),N[0]!==null?M?M.p(N,z):(M=k3(N),M.c(),M.m(v.parentNode,v)):M&&(M.d(1),M=null),N[1]?L?(L.p(N,z),z&2&&b(L,1)):(L=w3(N),L.c(),b(L,1),L.m(S.parentNode,S)):L&&(fe(),k(L,1,1,()=>{L=null}),ce())},i(N){A||(b(f.$$.fragment,N),b(L),A=!0)},o(N){k(f.$$.fragment,N),k(L),A=!1},d(N){N&&(w(e),w(n),w(i),w(s),w(o),w(a),w(u),w(_),w(v),w(S)),U(f),M&&M.d(N),L&&L.d(N),C=!1,I()}}}function hK(t,e,n){let i,l;Mt(t,An,a=>n(4,i=a)),Mt(t,ii,a=>n(2,l=a));let r=null,s=!1;return _n(async()=>{n(0,r=await i.api.doCall("/certificate/info"))}),[r,s,l,()=>n(1,s=!s)]}class mK extends De{constructor(e){super(),Re(this,e,hK,dK,Ie,{})}}function y3(t,e,n){const i=t.slice();return i[20]=e[n],i}function gK(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function _K(t){let e;return{c(){e=q("Settings")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function pK(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[gK]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[_K]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&8388608&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&8388608&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function T3(t){let e,n;return e=new Vt({props:{type:t[4].enabled?"green":"gray",size:"sm",$$slots:{default:[bK]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.type=i[4].enabled?"green":"gray"),l&8389648&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function bK(t){let e=(t[4].enabled?t[10]("Enabled"):t[10]("Disabled"))+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1040&&e!==(e=(i[4].enabled?i[10]("Enabled"):i[10]("Disabled"))+"")&&Z(n,e)},d(i){i&&w(n)}}}function S3(t){let e,n;return e=new xi({props:{kind:"error",title:"Tailscale error",subtitle:t[7]}}),e.$on("close",t[16]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&128&&(r.subtitle=i[7]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function E3(t){let e,n;return e=new xi({props:{kind:"success",title:"Tailscale updated",subtitle:t[8]}}),e.$on("close",t[17]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&256&&(r.subtitle=i[8]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function vK(t){let e,n,i,l=t[10]("Client detected")+"",r,s,o,a,u,f,c,d=t[10]("State")+"",h,g,_,v,S,A,C,I=t[10]("Backend state")+"",M,L,N,z=(t[4].backend_state||t[10]("Unknown"))+"",W,D,G,$,j=t[10]("This node")+"",Q,le,oe,X=(t[4].self_name||"—")+"",de,re,x,me,ee=t[10]("Last refreshed")+"",ke,pe,Fe,Ve=P3(t[4].last_refresh)+"",Ee,We,ge,ve;a=new Vt({props:{type:t[4].detected?"green":"warm-gray",size:"sm",$$slots:{default:[wK]},$$scope:{ctx:t}}}),v=new Vt({props:{type:ta(t[4].state),size:"sm",$$slots:{default:[yK]},$$scope:{ctx:t}}});let be=t[4].message&&M3(t);return{c(){e=R("dl"),n=R("div"),i=R("dt"),r=q(l),s=B(),o=R("dd"),F(a.$$.fragment),u=B(),f=R("div"),c=R("dt"),h=q(d),g=B(),_=R("dd"),F(v.$$.fragment),S=B(),A=R("div"),C=R("dt"),M=q(I),L=B(),N=R("dd"),W=q(z),D=B(),G=R("div"),$=R("dt"),Q=q(j),le=B(),oe=R("dd"),de=q(X),re=B(),x=R("div"),me=R("dt"),ke=q(ee),pe=B(),Fe=R("dd"),Ee=q(Ve),We=B(),be&&be.c(),ge=qe(),P(i,"class","svelte-vjfosm"),P(o,"class","svelte-vjfosm"),P(n,"class","svelte-vjfosm"),P(c,"class","svelte-vjfosm"),P(_,"class","svelte-vjfosm"),P(f,"class","svelte-vjfosm"),P(C,"class","svelte-vjfosm"),P(N,"class","svelte-vjfosm"),P(A,"class","svelte-vjfosm"),P($,"class","svelte-vjfosm"),P(oe,"class","svelte-vjfosm"),P(G,"class","svelte-vjfosm"),P(me,"class","svelte-vjfosm"),P(Fe,"class","svelte-vjfosm"),P(x,"class","svelte-vjfosm"),P(e,"class","status-grid svelte-vjfosm")},m(ue,nt){y(ue,e,nt),T(e,n),T(n,i),T(i,r),T(n,s),T(n,o),H(a,o,null),T(n,u),T(e,f),T(f,c),T(c,h),T(f,g),T(f,_),H(v,_,null),T(f,S),T(e,A),T(A,C),T(C,M),T(A,L),T(A,N),T(N,W),T(A,D),T(e,G),T(G,$),T($,Q),T(G,le),T(G,oe),T(oe,de),T(G,re),T(e,x),T(x,me),T(me,ke),T(x,pe),T(x,Fe),T(Fe,Ee),y(ue,We,nt),be&&be.m(ue,nt),y(ue,ge,nt),ve=!0},p(ue,nt){(!ve||nt&1024)&&l!==(l=ue[10]("Client detected")+"")&&Z(r,l);const Oe={};nt&16&&(Oe.type=ue[4].detected?"green":"warm-gray"),nt&8389648&&(Oe.$$scope={dirty:nt,ctx:ue}),a.$set(Oe),(!ve||nt&1024)&&d!==(d=ue[10]("State")+"")&&Z(h,d);const dt={};nt&16&&(dt.type=ta(ue[4].state)),nt&8389648&&(dt.$$scope={dirty:nt,ctx:ue}),v.$set(dt),(!ve||nt&1024)&&I!==(I=ue[10]("Backend state")+"")&&Z(M,I),(!ve||nt&1040)&&z!==(z=(ue[4].backend_state||ue[10]("Unknown"))+"")&&Z(W,z),(!ve||nt&1024)&&j!==(j=ue[10]("This node")+"")&&Z(Q,j),(!ve||nt&16)&&X!==(X=(ue[4].self_name||"—")+"")&&Z(de,X),(!ve||nt&1024)&&ee!==(ee=ue[10]("Last refreshed")+"")&&Z(ke,ee),(!ve||nt&16)&&Ve!==(Ve=P3(ue[4].last_refresh)+"")&&Z(Ee,Ve),ue[4].message?be?(be.p(ue,nt),nt&16&&b(be,1)):(be=M3(ue),be.c(),b(be,1),be.m(ge.parentNode,ge)):be&&(fe(),k(be,1,1,()=>{be=null}),ce())},i(ue){ve||(b(a.$$.fragment,ue),b(v.$$.fragment,ue),b(be),ve=!0)},o(ue){k(a.$$.fragment,ue),k(v.$$.fragment,ue),k(be),ve=!1},d(ue){ue&&(w(e),w(We),w(ge)),U(a),U(v),be&&be.d(ue)}}}function kK(t){let e,n;return e=new oo({props:{description:"Checking Tailscale..."}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function wK(t){let e=(t[4].detected?t[10]("Detected"):t[10]("Not detected"))+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1040&&e!==(e=(i[4].detected?i[10]("Detected"):i[10]("Not detected"))+"")&&Z(n,e)},d(i){i&&w(n)}}}function yK(t){let e=(t[4].state||t[10]("Unknown"))+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1040&&e!==(e=(i[4].state||i[10]("Unknown"))+"")&&Z(n,e)},d(i){i&&w(n)}}}function M3(t){let e,n;return e=new xi({props:{lowContrast:!0,hideCloseButton:!0,kind:R3(t[4].state),title:D3(t[4].state),subtitle:t[4].message}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.kind=R3(i[4].state)),l&16&&(r.title=D3(i[4].state)),l&16&&(r.subtitle=i[4].message),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function TK(t){var i;let e=(t[6]?t[10]("Saving…"):(i=t[4])!=null&&i.enabled?t[10]("Disable Tailscale"):t[10]("Enable Tailscale"))+"",n;return{c(){n=q(e)},m(l,r){y(l,n,r)},p(l,r){var s;r&1104&&e!==(e=(l[6]?l[10]("Saving…"):(s=l[4])!=null&&s.enabled?l[10]("Disable Tailscale"):l[10]("Enable Tailscale"))+"")&&Z(n,e)},d(l){l&&w(n)}}}function SK(t){let e=(t[5]?t[10]("Refreshing…"):t[10]("Refresh status"))+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1056&&e!==(e=(i[5]?i[10]("Refreshing…"):i[10]("Refresh status"))+"")&&Z(n,e)},d(i){i&&w(n)}}}function O3(t){let e,n;return e=new xi({props:{kind:"error",title:"Diagnostics error",subtitle:t[3]}}),e.$on("close",t[19]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8&&(r.subtitle=i[3]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function EK(t){let e=(t[2]?t[10]("Checking…"):t[10]("Run diagnostics"))+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1028&&e!==(e=(i[2]?i[10]("Checking…"):i[10]("Run diagnostics"))+"")&&Z(n,e)},d(i){i&&w(n)}}}function MK(t){let e=t[10]("Preview support bundle")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1024&&e!==(e=i[10]("Preview support bundle")+"")&&Z(n,e)},d(i){i&&w(n)}}}function OK(t){let e=t[10]("Download preview")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1024&&e!==(e=i[10]("Download preview")+"")&&Z(n,e)},d(i){i&&w(n)}}}function A3(t){let e,n,i=t[10]("Overall status")+"",l,r,s,o,a,u,f;o=new Vt({props:{type:ta(t[0].overall),size:"sm",$$slots:{default:[AK]},$$scope:{ctx:t}}});let c=ct(t[0].checks||[]),d=[];for(let g=0;gk(d[g],1,1,()=>{d[g]=null});return{c(){e=R("p"),n=R("strong"),l=q(i),r=q(":"),s=B(),F(o.$$.fragment),a=B(),u=R("div");for(let g=0;g{se=null}),ce()),ze[7]?Le?(Le.p(ze,Qe),Qe&128&&b(Le,1)):(Le=S3(ze),Le.c(),b(Le,1),Le.m(S,j)):Le&&(fe(),k(Le,1,1,()=>{Le=null}),ce()),ze[8]?_t?(_t.p(ze,Qe),Qe&256&&b(_t,1)):(_t=E3(ze),_t.c(),b(_t,1),_t.m(S,Q)):_t&&(fe(),k(_t,1,1,()=>{_t=null}),ce());let qn=le;le=Ot(ze),le===qn?~le&&Be[le].p(ze,Qe):(oe&&(fe(),k(Be[qn],1,1,()=>{Be[qn]=null}),ce()),~le?(oe=Be[le],oe?oe.p(ze,Qe):(oe=Be[le]=zt[le](ze),oe.c()),b(oe,1),oe.m(S,X)):oe=null),(!Ce||Qe&1024)&&re!==(re=ze[10]("Peer suggestions are hints only. A peer is linked only after you choose it and confirm the link on a device.")+"")&&Z(x,re),(!Ce||Qe&1024)&&ke!==(ke=ze[10]("Tailscale normally does not supply a hardware MAC address. Wake-on-LAN MAC addresses, when available, are informational and are not used to match or link devices.")+"")&&Z(pe,ke);const li={};Qe&112&&(li.disabled=ze[5]||ze[6]||!ze[4]),Qe&8389712&&(li.$$scope={dirty:Qe,ctx:ze}),Ee.$set(li);const di={};Qe&96&&(di.disabled=ze[5]||ze[6]),Qe&8389664&&(di.$$scope={dirty:Qe,ctx:ze}),ge.$set(di),(!Ce||Qe&1024)&&nt!==(nt=ze[10]("Gateway diagnostics")+"")&&Z(Oe,nt),(!Ce||Qe&1024)&&at!==(at=ze[10]("Check gateway health and create a support bundle that excludes credentials, private keys, image data, device identities, and browsing history.")+"")&&Z(ut,at),ze[3]?kt?(kt.p(ze,Qe),Qe&8&&b(kt,1)):(kt=O3(ze),kt.c(),b(kt,1),kt.m(be,xe)):kt&&(fe(),k(kt,1,1,()=>{kt=null}),ce());const hi={};Qe&4&&(hi.disabled=ze[2]),Qe&8389636&&(hi.$$scope={dirty:Qe,ctx:ze}),we.$set(hi);const Mi={};Qe&8389632&&(Mi.$$scope={dirty:Qe,ctx:ze}),It.$set(Mi);const wi={};Qe&2&&(wi.disabled=!ze[1]),Qe&8389632&&(wi.$$scope={dirty:Qe,ctx:ze}),Wt.$set(wi),ze[0]?Pt?(Pt.p(ze,Qe),Qe&1&&b(Pt,1)):(Pt=A3(ze),Pt.c(),b(Pt,1),Pt.m(be,Xt)):Pt&&(fe(),k(Pt,1,1,()=>{Pt=null}),ce()),ze[1]?Ye?Ye.p(ze,Qe):(Ye=I3(ze),Ye.c(),Ye.m(be,null)):Ye&&(Ye.d(1),Ye=null)},i(ze){Ce||(b(e.$$.fragment,ze),b(o.$$.fragment,ze),b(c.$$.fragment,ze),b(h.$$.fragment,ze),b(_.$$.fragment,ze),b(se),b(Le),b(_t),b(oe),b(Ee.$$.fragment,ze),b(ge.$$.fragment,ze),b(kt),b(we.$$.fragment,ze),b(It.$$.fragment,ze),b(Wt.$$.fragment,ze),b(Pt),Ce=!0)},o(ze){k(e.$$.fragment,ze),k(o.$$.fragment,ze),k(c.$$.fragment,ze),k(h.$$.fragment,ze),k(_.$$.fragment,ze),k(se),k(Le),k(_t),k(oe),k(Ee.$$.fragment,ze),k(ge.$$.fragment,ze),k(kt),k(we.$$.fragment,ze),k(It.$$.fragment,ze),k(Wt.$$.fragment,ze),k(Pt),Ce=!1},d(ze){ze&&(w(n),w(i),w(l),w(r),w(s),w(a),w(u),w(f),w(d),w(g),w(v),w(S),w(ve),w(be)),U(e,ze),U(o,ze),U(c,ze),U(h,ze),U(_,ze),se&&se.d(),Le&&Le.d(),_t&&_t.d(),~le&&Be[le].d(),U(Ee),U(ge),kt&&kt.d(),U(we),U(It),U(Wt),Pt&&Pt.d(),Ye&&Ye.d()}}}function ta(t){return t==="ok"||t==="running"||t==="connected"?"green":t==="failed"||t==="stopped"||t==="unavailable"?"red":t==="degraded"||t==="connecting"?"warm-gray":"gray"}function R3(t){return t==="connected"?"success":t==="degraded"||t==="connecting"?"warning":t==="unavailable"||t==="stopped"?"error":"info"}function D3(t){return t==="connected"?"Tailscale connected":t==="degraded"?"Tailscale data degraded":t==="unavailable"?"Tailscale unavailable":t==="connecting"?"Tailscale connecting":t==="disabled"?"Tailscale disabled":"Tailscale status"}function P3(t){if(!t)return"Never";const e=new Date(t);return Number.isNaN(e.getTime())?t:e.toLocaleString()}function IK(t,e,n){let i,l;Mt(t,An,N=>n(9,i=N)),Mt(t,ii,N=>n(10,l=N));let r=null,s="",o=!1,a="",u=null,f=!1,c=!1,d="",h="";async function g(){n(2,o=!0),n(3,a="");try{n(0,r=await i.api.doCall("/diagnostics"))}catch(N){n(3,a=N instanceof Error?N.message:"Diagnostics failed")}finally{n(2,o=!1)}}async function _(){n(3,a="");try{const N=await i.api.doCall("/diagnostics/bundle");n(1,s=JSON.stringify(N,null,2))}catch(N){n(3,a=N instanceof Error?N.message:"Bundle preview failed")}}function v(){if(!s)return;const N=URL.createObjectURL(new Blob([s+` +`],{type:"application/json"})),z=document.createElement("a");z.href=N,z.download="gatesentry-support-bundle.json",z.click(),URL.revokeObjectURL(N)}async function S(){n(5,f=!0),n(7,d="");try{n(4,u=await i.api.doCall("/tailscale/status"))}catch(N){n(7,d=N instanceof Error?N.message:"Tailscale status failed")}finally{n(5,f=!1)}}async function A(N){n(6,c=!0),n(7,d=""),n(8,h="");try{await i.api.doCall("/tailscale/config","put",{enabled:N}),n(8,h=N?"Tailscale integration enabled.":"Tailscale integration disabled."),await S()}catch(z){n(7,d=z instanceof Error?z.message:"Tailscale update failed")}finally{n(6,c=!1)}}return _n(()=>{g(),S()}),[r,s,o,a,u,f,c,d,h,i,l,g,_,v,S,A,()=>n(7,d=""),()=>n(8,h=""),()=>A(!((u==null?void 0:u.enabled)??!1)),()=>n(3,a="")]}class RK extends De{constructor(e){super(),Re(this,e,IK,LK,Ie,{})}}function DK(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function PK(t){let e;return{c(){e=q("Toggle Services")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function NK(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[DK]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[PK]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function BK(t){let e,n,i,l,r,s,o,a;return e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[NK]},$$scope:{ctx:t}}}),o=new T8({props:{settingName:"enable_dns_server",label:"DNS Server",labelA:"Not Running",labelB:"Running"}}),{c(){F(e.$$.fragment),n=B(),i=R("h2"),i.textContent="Toggle Services",l=B(),r=R("br"),s=B(),F(o.$$.fragment)},m(u,f){H(e,u,f),y(u,n,f),y(u,i,f),y(u,l,f),y(u,r,f),y(u,s,f),H(o,u,f),a=!0},p(u,[f]){const c={};f&1&&(c.$$scope={dirty:f,ctx:u}),e.$set(c)},i(u){a||(b(e.$$.fragment,u),b(o.$$.fragment,u),a=!0)},o(u){k(e.$$.fragment,u),k(o.$$.fragment,u),a=!1},d(u){u&&(w(n),w(i),w(l),w(r),w(s)),U(e,u),U(o,u)}}}class zK extends De{constructor(e){super(),Re(this,e,null,BK,Ie,{})}}function N3(t,e,n){const i=t.slice();return i[36]=e[n],i}function B3(t,e,n){const i=t.slice();return i[39]=e[n],i}function z3(t,e,n){const i=t.slice();return i[42]=e[n],i}function HK(t){let e=t[16]("Refresh")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Refresh")+"")&&Z(n,e)},d(i){i&&w(n)}}}function H3(t){let e,n;return e=new xi({props:{kind:"error",title:t[16]("Status unavailable"),subtitle:t[6]}}),e.$on("close",t[23]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.title=i[16]("Status unavailable")),l[0]&64&&(r.subtitle=i[6]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function U3(t){var Qu,Sa;let e=[],n=new Map,i,l,r,s,o=t[16]("Protection")+"",a,u,f,c,d,h=(t[0].dns_running?t[16]("DNS server running"):t[16]("DNS server stopped"))+"",g,_,v,S,A=t[16]("Devices")+"",C,I,M,L=t[22](t[0].device_count)+"",N,z,W,D=t[16]("discovered on the network")+"",G,$,j,Q,le=t[16]("Blocklist")+"",oe,X,de,re=t[22](t[0].blocked_domains)+"",x,me,ee,ke=t[16]("domains loaded")+"",pe,Fe,Ve,Ee,We=t[16]("HTTPS inspection")+"",ge,ve,be,ue,nt,Oe=t[16]("optional; needs the certificate")+"",dt,yt,at,ut,At,xe,mt=t[16]("Last 24 hours")+"",we,gt,It,Ht,Wt,qt,Xt,Ce=t[22]((Qu=t[1])==null?void 0:Qu.total)+"",se,Le,_t,zt=t[16]("requests")+"",Be,Ot,kt,Pt,Ye=t[22](t[2])+"",ze,Qe,He,Tt=t[16]("blocked")+"",Bt,qn,li,di,hi,Mi,wi,Ri=t[22]((Sa=t[1])==null?void 0:Sa.unique_clients)+"",Zi,ur,Kn,Rn=t[16]("active clients")+"",lt,St,Dn,Hn,Ll,mi,Un,tn,Tn,pn=t[16]("Setup")+"",ml,gl,ri,Sn,Di,el=t[16]("The protection check asks the running DNS server to resolve a controlled test domain and records the decision it made.")+"",Xl,Cs,_l,Ls,xr,si,Lt,Kt=t[16]("Connect a device")+"",Kl,es,Sr,fr=t[16]("Set the DNS server on a device, or in your router's DHCP settings, to the GateSentry address. Devices that use another resolver are not filtered.")+"",Er,ts,tl,Is,cr,Il=t[16]("Test from a device:")+"",go,$u,Mr,ka,Rl,dr,wa,Dl,_o,Xi,hn,ns=ct(t[14]);const Ju=st=>st[42].key;for(let st=0;st0&&W3(t);_l=new Rt({props:{size:"small",disabled:t[11]||!t[0].dns_running,$$slots:{default:[JK]},$$scope:{ctx:t}}}),_l.$on("click",t[18]);let ai=t[8]&&j3(t);return tl=new gu({props:{condensed:!0,flush:!0,$$slots:{default:[k$]},$$scope:{ctx:t}}}),Mr=new zP({props:{type:"single",code:`dig @${t[21]()} example.com`}}),dr=new Rt({props:{kind:"tertiary",size:"small",$$slots:{default:[w$]},$$scope:{ctx:t}}}),dr.$on("click",t[25]),Dl=new Rt({props:{kind:"ghost",size:"small",$$slots:{default:[y$]},$$scope:{ctx:t}}}),Dl.$on("click",t[26]),Xi=new Rt({props:{kind:"ghost",size:"small",$$slots:{default:[T$]},$$scope:{ctx:t}}}),Xi.$on("click",t[27]),{c(){for(let st=0;st{$l[Ea]=null}),ce()),~Dn?(Hn=$l[Dn],Hn?Hn.p(st,pt):(Hn=$l[Dn]=ya[Dn](st),Hn.c()),b(Hn,1),Hn.m(ut,null)):Hn=null),(!hn||pt[0]&65536)&&pn!==(pn=st[16]("Setup")+"")&&Z(ml,pn),st[15]?xn?(xn.p(st,pt),pt[0]&32768&&b(xn,1)):(xn=V3(st),xn.c(),b(xn,1),xn.m(tn,null)):xn&&(fe(),k(xn,1,1,()=>{xn=null}),ce()),st[4].length>0?oi?(oi.p(st,pt),pt[0]&16&&b(oi,1)):(oi=W3(st),oi.c(),b(oi,1),oi.m(Un,Sn)):oi&&(fe(),k(oi,1,1,()=>{oi=null}),ce()),(!hn||pt[0]&65536)&&el!==(el=st[16]("The protection check asks the running DNS server to resolve a controlled test domain and records the decision it made.")+"")&&Z(Xl,el);const Ma={};pt[0]&2049&&(Ma.disabled=st[11]||!st[0].dns_running),pt[0]&67584|pt[1]&16384&&(Ma.$$scope={dirty:pt,ctx:st}),_l.$set(Ma),st[8]?ai?(ai.p(st,pt),pt[0]&256&&b(ai,1)):(ai=j3(st),ai.c(),b(ai,1),ai.m(Un,null)):ai&&(fe(),k(ai,1,1,()=>{ai=null}),ce()),(!hn||pt[0]&65536)&&Kt!==(Kt=st[16]("Connect a device")+"")&&Z(Kl,Kt),(!hn||pt[0]&65536)&&fr!==(fr=st[16]("Set the DNS server on a device, or in your router's DHCP settings, to the GateSentry address. Devices that use another resolver are not filtered.")+"")&&Z(Er,fr);const xu={};pt[0]&65537|pt[1]&16384&&(xu.$$scope={dirty:pt,ctx:st}),tl.$set(xu),(!hn||pt[0]&65536)&&Il!==(Il=st[16]("Test from a device:")+"")&&Z(go,Il);const ef={};pt[0]&65536|pt[1]&16384&&(ef.$$scope={dirty:pt,ctx:st}),dr.$set(ef);const tf={};pt[0]&65536|pt[1]&16384&&(tf.$$scope={dirty:pt,ctx:st}),Dl.$set(tf);const Cn={};pt[0]&65536|pt[1]&16384&&(Cn.$$scope={dirty:pt,ctx:st}),Xi.$set(Cn)},i(st){if(!hn){for(let pt=0;pto[39].key;for(let o=0;oo[36].name;for(let o=0;o{u=null}),ce()),c[10]?f?(f.p(c,d),d[0]&1024&&b(f,1)):(f=X3(c),f.c(),b(f,1),f.m(e,null)):f&&(fe(),k(f,1,1,()=>{f=null}),ce())},i(c){a||(b(n.$$.fragment,c),b(u),b(f),a=!0)},o(c){k(n.$$.fragment,c),k(u),k(f),a=!1},d(c){c&&w(e),U(n),u&&u.d(),f&&f.d()}}}function QK(t){let e=(t[8]==="ok"?t[16]("Protected"):t[16]("Not protected"))+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65792&&e!==(e=(i[8]==="ok"?i[16]("Protected"):i[16]("Not protected"))+"")&&Z(n,e)},d(i){i&&w(n)}}}function Y3(t){let e,n;return e=new gu({props:{condensed:!0,flush:!0,$$slots:{default:[d$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65664|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function xK(t){let e=t[16]("Test domain")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Test domain")+"")&&Z(n,e)},d(i){i&&w(n)}}}function e$(t){let e=t[7].domain+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].domain+"")&&Z(n,e)},d(i){i&&w(n)}}}function t$(t){let e,n,i,l;return e=new Zt({props:{noWrap:!0,$$slots:{default:[xK]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[e$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function n$(t){let e=t[16]("Answer")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Answer")+"")&&Z(n,e)},d(i){i&&w(n)}}}function i$(t){let e=t[7].rcode+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].rcode+"")&&Z(n,e)},d(i){i&&w(n)}}}function l$(t){let e,n,i,l;return e=new Zt({props:{noWrap:!0,$$slots:{default:[n$]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[i$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Z3(t){let e,n;return e=new Zn({props:{$$slots:{default:[o$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65664|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function r$(t){let e=t[16]("Explanation")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Explanation")+"")&&Z(n,e)},d(i){i&&w(n)}}}function s$(t){let e=t[7].cname+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].cname+"")&&Z(n,e)},d(i){i&&w(n)}}}function o$(t){let e,n,i,l;return e=new Zt({props:{noWrap:!0,$$slots:{default:[r$]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[s$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function a$(t){let e=t[16]("Upstream")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Upstream")+"")&&Z(n,e)},d(i){i&&w(n)}}}function u$(t){let e=t[7].upstream+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].upstream+"")&&Z(n,e)},d(i){i&&w(n)}}}function f$(t){let e,n,i,l;return e=new Zt({props:{noWrap:!0,$$slots:{default:[a$]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[u$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function c$(t){let e,n,i,l,r,s,o;e=new Zn({props:{$$slots:{default:[t$]},$$scope:{ctx:t}}}),i=new Zn({props:{$$slots:{default:[l$]},$$scope:{ctx:t}}});let a=t[7].cname&&Z3(t);return s=new Zn({props:{$$slots:{default:[f$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),a&&a.c(),r=B(),F(s.$$.fragment)},m(u,f){H(e,u,f),y(u,n,f),H(i,u,f),y(u,l,f),a&&a.m(u,f),y(u,r,f),H(s,u,f),o=!0},p(u,f){const c={};f[0]&65664|f[1]&16384&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};f[0]&65664|f[1]&16384&&(d.$$scope={dirty:f,ctx:u}),i.$set(d),u[7].cname?a?(a.p(u,f),f[0]&128&&b(a,1)):(a=Z3(u),a.c(),b(a,1),a.m(r.parentNode,r)):a&&(fe(),k(a,1,1,()=>{a=null}),ce());const h={};f[0]&65664|f[1]&16384&&(h.$$scope={dirty:f,ctx:u}),s.$set(h)},i(u){o||(b(e.$$.fragment,u),b(i.$$.fragment,u),b(a),b(s.$$.fragment,u),o=!0)},o(u){k(e.$$.fragment,u),k(i.$$.fragment,u),k(a),k(s.$$.fragment,u),o=!1},d(u){u&&(w(n),w(l),w(r)),U(e,u),U(i,u),a&&a.d(u),U(s,u)}}}function d$(t){let e,n;return e=new Nu({props:{$$slots:{default:[c$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65664|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function X3(t){let e,n;return e=new xi({props:{kind:"error",lowContrast:!0,hideCloseButton:!0,title:t[16]("Protection check failed"),subtitle:t[10]}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65536&&(r.title=i[16]("Protection check failed")),l[0]&1024&&(r.subtitle=i[10]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function h$(t){let e=t[16]("DNS listener")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("DNS listener")+"")&&Z(n,e)},d(i){i&&w(n)}}}function m$(t){let e,n=t[0].listen_addr+"",i,l,r=t[0].listen_port+"",s;return{c(){e=R("code"),i=q(n),l=q(":"),s=q(r),P(e,"class","svelte-68lff4")},m(o,a){y(o,e,a),T(e,i),T(e,l),T(e,s)},p(o,a){a[0]&1&&n!==(n=o[0].listen_addr+"")&&Z(i,n),a[0]&1&&r!==(r=o[0].listen_port+"")&&Z(s,r)},d(o){o&&w(e)}}}function g$(t){let e,n,i,l;return e=new Zt({props:{noWrap:!0,$$slots:{default:[h$]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[m$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function _$(t){let e=t[16]("Upstream resolver")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Upstream resolver")+"")&&Z(n,e)},d(i){i&&w(n)}}}function p$(t){let e,n=t[0].upstream+"",i;return{c(){e=R("code"),i=q(n),P(e,"class","svelte-68lff4")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&1&&n!==(n=l[0].upstream+"")&&Z(i,n)},d(l){l&&w(e)}}}function b$(t){let e,n,i,l;return e=new Zt({props:{noWrap:!0,$$slots:{default:[_$]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[p$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65536|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function v$(t){let e,n,i,l;return e=new Zn({props:{$$slots:{default:[g$]},$$scope:{ctx:t}}}),i=new Zn({props:{$$slots:{default:[b$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&65537|s[1]&16384&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&65537|s[1]&16384&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function k$(t){let e,n;return e=new Nu({props:{$$slots:{default:[v$]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&65537|l[1]&16384&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function w$(t){let e=t[16]("Policies")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Policies")+"")&&Z(n,e)},d(i){i&&w(n)}}}function y$(t){let e=t[16]("Devices")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("Devices")+"")&&Z(n,e)},d(i){i&&w(n)}}}function T$(t){let e=t[16]("DNS settings")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&65536&&e!==(e=i[16]("DNS settings")+"")&&Z(n,e)},d(i){i&&w(n)}}}function S$(t){let e,n,i,l,r=t[16]("Overview")+"",s,o,a,u=t[16]("GateSentry is a self-hosted internet safety gateway. Devices that use it for DNS, or send traffic through its proxy, are filtered by your policies.")+"",f,c,d,h,g,_;d=new Rt({props:{kind:"ghost",size:"small",icon:$1,$$slots:{default:[HK]},$$scope:{ctx:t}}}),d.$on("click",t[17]);let v=t[6]&&H3(t),S=t[0]&&U3(t);return{c(){e=R("div"),n=R("header"),i=R("div"),l=R("h2"),s=q(r),o=B(),a=R("p"),f=q(u),c=B(),F(d.$$.fragment),h=B(),v&&v.c(),g=B(),S&&S.c(),P(a,"class","lede svelte-68lff4"),P(n,"class","page-head svelte-68lff4"),P(e,"class","page svelte-68lff4")},m(A,C){y(A,e,C),T(e,n),T(n,i),T(i,l),T(l,s),T(i,o),T(i,a),T(a,f),T(n,c),H(d,n,null),T(e,h),v&&v.m(e,null),T(e,g),S&&S.m(e,null),_=!0},p(A,C){(!_||C[0]&65536)&&r!==(r=A[16]("Overview")+"")&&Z(s,r),(!_||C[0]&65536)&&u!==(u=A[16]("GateSentry is a self-hosted internet safety gateway. Devices that use it for DNS, or send traffic through its proxy, are filtered by your policies.")+"")&&Z(f,u);const I={};C[0]&65536|C[1]&16384&&(I.$$scope={dirty:C,ctx:A}),d.$set(I),A[6]?v?(v.p(A,C),C[0]&64&&b(v,1)):(v=H3(A),v.c(),b(v,1),v.m(e,g)):v&&(fe(),k(v,1,1,()=>{v=null}),ce()),A[0]?S?(S.p(A,C),C[0]&1&&b(S,1)):(S=U3(A),S.c(),b(S,1),S.m(e,null)):S&&(fe(),k(S,1,1,()=>{S=null}),ce())},i(A){_||(b(d.$$.fragment,A),b(v),b(S),_=!0)},o(A){k(d.$$.fragment,A),k(v),k(S),_=!1},d(A){A&&w(e),U(d),v&&v.d(),S&&S.d()}}}function E$(t,e,n){let i,l,r,s,o,a,u,f,c;Mt(t,ii,ke=>n(16,f=ke)),Mt(t,An,ke=>n(29,c=ke));const d=["resolver","blocklist","first_device","protection_check"];let h=null,g=null,_=null,v="",S=null,A="",C="",I="",M=!1,L=null;const N=async()=>{n(6,v="");try{n(0,h=await c.api.doCall("/onboarding/status"))}catch{n(6,v="Unable to load the gateway status.")}},z=async()=>{try{n(1,g=await c.api.doCall("/decisions/summary?days=1"))}catch{n(1,g=null)}},W=async()=>{try{const ke=await c.api.doCall("/settings/enable_https_filtering");n(5,_=(ke==null?void 0:ke.Value)==="true")}catch{n(5,_=null)}},D=()=>Promise.all([N(),z(),W()]),G=async()=>{n(11,M=!0),n(9,C=""),n(10,I=""),n(8,A="");try{const ke=await c.api.doCall("/onboarding/protection-check","post",{});n(7,S=ke.check),n(8,A=ke.state),n(9,C=ke.detail),n(10,I=ke.action||""),await N()}catch{n(8,A="failed"),n(9,C="The protection check did not complete."),n(10,I="Verify the DNS listener and upstream resolver, then retry the check.")}finally{n(11,M=!1)}},$=ke=>f(ke==="resolver"?"Resolver and listener":ke==="blocklist"?"Blocklists loaded":ke==="first_device"?"First device discovered":"Protection verified"),j=ke=>h?ke==="resolver"?h.resolver.detail||"":ke==="blocklist"?h.blocklist.detail||"":ke==="first_device"?`${h.device_count} ${f("devices discovered")}`:h.progress.first_explained_protection_at?`${f("Verified")} ${new Date(h.progress.first_explained_protection_at).toLocaleString()}`:f("Not verified yet"):"",Q=ke=>{const pe=[];return ke.bind.state!=="ok"&&pe.push({key:"bind",title:f("DNS listener is not ready"),subtitle:[ke.bind.detail,ke.bind.action].filter(Boolean).join(" ")}),ke.resolver.state!=="ok"&&ke.resolver.action&&pe.push({key:"resolver",title:f("Upstream resolver is not reachable"),subtitle:ke.resolver.action}),ke.blocklist.state!=="ok"&&ke.blocklist.action&&pe.push({key:"blocklist",title:f("Blocklist empty"),subtitle:ke.blocklist.action}),pe},le=["","0.0.0.0","::","[::]","127.0.0.1","::1"],oe=()=>{const ke=(h==null?void 0:h.listen_addr)||"";return le.includes(ke)?"":ke},X=ke=>typeof ke=="number"?ke.toLocaleString():"—";_n(()=>{D(),L=setInterval(z,3e4)}),Es(()=>{L&&clearInterval(L)});const de=()=>n(6,v=""),re=()=>Vi("/stats"),x=()=>Vi("/rules"),me=()=>Vi("/devices"),ee=()=>Vi("/dns");return t.$$.update=()=>{var ke;t.$$.dirty[0]&1&&n(4,i=((h==null?void 0:h.steps)||[]).filter(pe=>d.includes(pe.name))),t.$$.dirty[0]&16&&n(3,l=i.findIndex(pe=>pe.state!=="ok")),t.$$.dirty[0]&24&&n(15,r=i.length>0&&l===-1),t.$$.dirty[0]&1&&n(14,s=h?Q(h):[]),t.$$.dirty[0]&1&&n(13,o=!!(h!=null&&h.progress.first_explained_protection_at)),t.$$.dirty[0]&2&&n(2,a=((ke=g==null?void 0:g.by_action)==null?void 0:ke.block)||0),t.$$.dirty[0]&6&&n(12,u=g&&g.total>0?(a/g.total*100).toFixed(1)+"%":"—")},[h,g,a,l,i,_,v,S,A,C,I,M,u,o,s,r,f,D,G,$,j,oe,X,de,re,x,me,ee]}class M$ extends De{constructor(e){super(),Re(this,e,E$,S$,Ie,{},null,[-1,-1])}}function O$(t){let e;return{c(){e=R("pre"),e.innerHTML=` 0.0.0.0 domain.com `,P(e,"class","simple-border")},m(n,i){y(n,e,i)},p:he,d(n){n&&w(e)}}}function A$(t){let e;return{c(){e=R("pre"),e.innerHTML=` @@ -101,20 +101,20 @@ function print() { __p += __j.call(arguments, '') } (?:${ui}:){1}(?:(?::${ui}){0,4}:${nr}|(?::${ui}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4 (?::(?:(?::${ui}){0,5}:${nr}|(?::${ui}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4 )(?:%[0-9a-zA-Z]{1,})? // %eth0 %1 -`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),G$=new RegExp(`(?:^${nr}$)|(?:^${bd}$)`),V$=new RegExp(`^${nr}$`),W$=new RegExp(`^${bd}$`),n0=t=>t&&t.exact?G$:new RegExp(`(?:${vs(t)}${nr}${vs(t)})|(?:${vs(t)}${bd}${vs(t)})`,"g");n0.v4=t=>t&&t.exact?V$:new RegExp(`${vs(t)}${nr}${vs(t)}`,"g");n0.v6=t=>t&&t.exact?W$:new RegExp(`${vs(t)}${bd}${vs(t)}`,"g");function q$(t){const e=(...n)=>t(...n);return Object.defineProperty(e,"name",{value:`functionTimeout(${t.name||""})`,configurable:!0}),e}const{toString:j$}=Object.prototype;function Y$(t){return j$.call(t)==="[object RegExp]"}const e4={global:"g",ignoreCase:"i",multiline:"m",dotAll:"s",sticky:"y",unicode:"u"};function Z$(t,e={}){if(!Y$(t))throw new TypeError("Expected a RegExp instance");const n=Object.keys(e4).map(l=>(typeof e[l]=="boolean"?e[l]:t[l])?e4[l]:"").join(""),i=new RegExp(e.source||t.source,n);return i.lastIndex=typeof e.lastIndex=="number"?e.lastIndex:t.lastIndex,i}function X$(t,e,{timeout:n}={}){try{return q$(()=>Z$(t).test(e),{timeout:n})()}catch(i){throw i}}const K$=15,$$={timeout:400};function t4(t){return t.length>K$?!1:X$(n0.v4({exact:!0}),t,$$)}function J$(t){let e,n=t[5]("Custom A Records")+"",i,l,r,s=t[5]("Add all domains that you would like to resolve internally here.")+"",o,a,u,f,c,d,h,g=t[4]&&n4(t);return d=new Ol({props:{sortable:!0,size:"medium",style:"width:100%;",headers:[{key:"domain",value:"Domain"},{key:"ip",value:"IP"},{key:"actions",value:""}],rows:t[0].map(l4).sort(r4),$$slots:{cell:[uJ,({row:_,cell:v})=>({20:_,21:v}),({row:_,cell:v})=>(_?1048576:0)|(v?2097152:0)],default:[sJ]},$$scope:{ctx:t}}}),{c(){e=R("h5"),i=q(n),l=B(),r=R("p"),o=q(s),a=B(),u=R("br"),f=B(),g&&g.c(),c=B(),F(d.$$.fragment)},m(_,v){y(_,e,v),T(e,i),y(_,l,v),y(_,r,v),T(r,o),y(_,a,v),y(_,u,v),y(_,f,v),g&&g.m(_,v),y(_,c,v),H(d,_,v),h=!0},p(_,v){(!h||v&32)&&n!==(n=_[5]("Custom A Records")+"")&&Z(i,n),(!h||v&32)&&s!==(s=_[5]("Add all domains that you would like to resolve internally here.")+"")&&Z(o,s),_[4]?g?(g.p(_,v),v&16&&b(g,1)):(g=n4(_),g.c(),b(g,1),g.m(c.parentNode,c)):g&&(fe(),k(g,1,1,()=>{g=null}),ce());const S={};v&1&&(S.rows=_[0].map(l4).sort(r4)),v&7340088&&(S.$$scope={dirty:v,ctx:_}),d.$set(S)},i(_){h||(b(g),b(d.$$.fragment,_),h=!0)},o(_){k(g),k(d.$$.fragment,_),h=!1},d(_){_&&(w(e),w(l),w(r),w(a),w(u),w(f),w(c)),g&&g.d(_),U(d,_)}}}function Q$(t){let e;return{c(){e=R("p"),e.textContent="Loading..."},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function n4(t){let e,n;return e=new Iu({props:{open:!0,preventCloseOnClickOutside:!0,$$slots:{default:[eJ]},$$scope:{ctx:t}}}),e.$on("submit",t[11]),e.$on("close",t[12]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4194342&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function x$(t){let e,n,i,l,r,s,o,a;function u(h){t[9](h)}let f={labelText:t[5]("Domain"),type:"text",placeholder:"domain.com",size:"sm"};t[1]!==void 0&&(f.value=t[1]),e=new Jn({props:f}),ft.push(()=>Yt(e,"value",u));function c(h){t[10](h)}let d={type:"text",placeholder:"1.1.1.1",size:"sm",labelText:t[5]("IP Address")};return t[2]!==void 0&&(d.value=t[2]),s=new Jn({props:d}),ft.push(()=>Yt(s,"value",c)),{c(){F(e.$$.fragment),i=B(),l=R("br"),r=B(),F(s.$$.fragment)},m(h,g){H(e,h,g),y(h,i,g),y(h,l,g),y(h,r,g),H(s,h,g),a=!0},p(h,g){const _={};g&32&&(_.labelText=h[5]("Domain")),!n&&g&2&&(n=!0,_.value=h[1],jt(()=>n=!1)),e.$set(_);const v={};g&32&&(v.labelText=h[5]("IP Address")),!o&&g&4&&(o=!0,v.value=h[2],jt(()=>o=!1)),s.$set(v)},i(h){a||(b(e.$$.fragment,h),b(s.$$.fragment,h),a=!0)},o(h){k(e.$$.fragment,h),k(s.$$.fragment,h),a=!1},d(h){h&&(w(i),w(l),w(r)),U(e,h),U(s,h)}}}function eJ(t){let e,n,i,l,r,s;return e=new Ru({props:{title:t[5]("Add an entry")}}),i=new Du({props:{hasForm:!0,$$slots:{default:[x$]},$$scope:{ctx:t}}}),r=new Pu({props:{primaryButtonDisabled:!t4(t[2]),primaryButtonIcon:ws,primaryButtonText:t[5]("Save")}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){H(e,o,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,a){const u={};a&32&&(u.title=o[5]("Add an entry")),e.$set(u);const f={};a&4194342&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a&4&&(c.primaryButtonDisabled=!t4(o[2])),a&32&&(c.primaryButtonText=o[5]("Save")),r.$set(c)},i(o){s||(b(e.$$.fragment,o),b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(e.$$.fragment,o),k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(n),w(l)),U(e,o),U(i,o),U(r,o)}}}function tJ(t){let e,n;return e=new Rt({props:{icon:zu,$$slots:{default:[iJ]},$$scope:{ctx:t}}}),e.$on("click",t[15]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4194336&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function nJ(t){return{c:he,m:he,p:he,i:he,o:he,d:he}}function iJ(t){let e=t[5]("Insert")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&32&&e!==(e=i[5]("Insert")+"")&&Z(n,e)},d(i){i&&w(n)}}}function lJ(t){let e,n,i,l;const r=[nJ,tJ],s=[];function o(a,u){return a[4]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function rJ(t){let e,n;return e=new X1({props:{$$slots:{default:[lJ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4194352&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function sJ(t){let e,n;return e=new Z1({props:{size:"sm",$$slots:{default:[rJ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4194352&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function oJ(t){let e=t[21].value+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&2097152&&e!==(e=i[21].value+"")&&Z(n,e)},i:he,o:he,d(i){i&&w(n)}}}function aJ(t){let e,n,i,l,r;function s(){return t[13](t[20])}n=new Rt({props:{icon:t[3]!=null&&t[20].id===t[3]?ws:xs,iconDescription:t[5]("Edit"),disabled:t[20].id==t[3]}}),n.$on("click",s);function o(){return t[14](t[20])}return l=new Rt({props:{icon:dd,iconDescription:t[5]("Delete")}}),l.$on("click",o),{c(){e=R("div"),F(n.$$.fragment),i=B(),F(l.$$.fragment),wt(e,"float","right")},m(a,u){y(a,e,u),H(n,e,null),T(e,i),H(l,e,null),r=!0},p(a,u){t=a;const f={};u&1048584&&(f.icon=t[3]!=null&&t[20].id===t[3]?ws:xs),u&32&&(f.iconDescription=t[5]("Edit")),u&1048584&&(f.disabled=t[20].id==t[3]),n.$set(f);const c={};u&32&&(c.iconDescription=t[5]("Delete")),l.$set(c)},i(a){r||(b(n.$$.fragment,a),b(l.$$.fragment,a),r=!0)},o(a){k(n.$$.fragment,a),k(l.$$.fragment,a),r=!1},d(a){a&&w(e),U(n),U(l)}}}function uJ(t){let e,n,i,l;const r=[aJ,oJ],s=[];function o(a,u){return a[21].key==="actions"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function fJ(t){let e,n,i,l;const r=[Q$,J$],s=[];function o(a,u){return a[0]==null?0:1}return n=o(t),i=s[n]=r[n](t),{c(){e=R("div"),i.c()},m(a,u){y(a,e,u),s[n].m(e,null),l=!0},p(a,[u]){let f=n;n=o(a),n===f?s[n].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),i=s[n],i?i.p(a,u):(i=s[n]=r[n](a),i.c()),b(i,1),i.m(e,null))},i(a){l||(b(i),l=!0)},o(a){k(i),l=!1},d(a){a&&w(e),s[n].d()}}}const i4="/dns/custom_entries",l4=(t,e)=>({...t,actions:""}),r4=(t,e)=>e.id-t.id;function cJ(t,e,n){let i,l;Mt(t,ii,N=>n(5,i=N)),Mt(t,An,N=>n(16,l=N));const r=yn();let s=null,o="",a="",u=null,f=!1;const c=()=>{n(0,s=[]),l.api.doCall(i4).then(function(N){n(0,s=N.data.map((z,W)=>({...z,id:W+1})))})},d=()=>{const N=s.map(z=>({domain:z.domain,ip:z.ip}));l.api.doCall(i4,"post",N,{"Content-Type":"application/json"}).then(function(z){z.ok==!0?(c(),n(1,o=""),n(2,a=""),n(4,f=!1),r("updatednsinfo"),ci.add({kind:"success",title:i("Success:"),subtitle:i("Successfully saved data to the api")})):"error"in z&&(ci.add(ao({title:i("Error"),subtitle:z.error},i)),c())}).catch(function(z){ci.add({kind:"error",title:i("Error:"),subtitle:i("Unable to save data to the api : ")+z.message,timeout:3e4}),c()})};c();const h=()=>{u?(s.find(N=>N.id===u),n(0,s[u-1].domain=o,s),n(0,s[u-1].ip=a,s),n(3,u=null)):n(0,s=[...s,{id:s.length+1,domain:o,ip:a}]),d()},g=N=>{n(3,u=N);const z=s.find(W=>W.id===N);n(1,o=z.domain),n(2,a=z.ip),n(4,f=!0)},_=N=>{n(0,s=[...s.filter(z=>z.id!==N)]),d()};function v(N){o=N,n(1,o)}function S(N){a=N,n(2,a)}return[s,o,a,u,f,i,h,g,_,v,S,()=>{h()},()=>{n(4,f=!1),n(1,o=""),n(2,a="")},N=>g(N.id),N=>_(N.id),()=>n(4,f=!0)]}class dJ extends De{constructor(e){super(),Re(this,e,cJ,fJ,Ie,{})}}function hJ(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function mJ(t){let e;return{c(){e=q("DNS Server")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function gJ(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[hJ]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[mJ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&64&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&64&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function _J(t){var le,oe,X;let e,n,i,l,r,s=t[1]("Blocked domains")+"",o,a,u,f=((le=t[0])==null?void 0:le.number_domains_blocked)+"",c,d,h,g=t[1]("Last updated")+"",_,v,S,A=t[3]((oe=t[0])==null?void 0:oe.last_updated)+"",C,I,M,L=t[1]("Next update")+"",N,z,W,D=t[3]((X=t[0])==null?void 0:X.next_update)+"",G,$,j,Q;return i=new $1({}),{c(){e=R("div"),n=R("span"),F(i.$$.fragment),l=B(),r=R("div"),o=q(s),a=B(),u=R("label"),c=q(f),d=B(),h=R("div"),_=q(g),v=B(),S=R("label"),C=q(A),I=B(),M=R("div"),N=q(L),z=B(),W=R("label"),G=q(D),wt(n,"position","absolute"),wt(n,"right","5px"),wt(n,"top","5px"),wt(n,"cursor","pointer"),wt(n,"color","gray"),P(u,"class","bx--label svelte-u41t5x"),P(r,"class","info-item svelte-u41t5x"),P(S,"class","bx--label svelte-u41t5x"),P(h,"class","info-item svelte-u41t5x"),P(W,"class","bx--label svelte-u41t5x"),P(M,"class","info-item svelte-u41t5x"),P(e,"class","simple-border"),wt(e,"font-size","0.95em"),wt(e,"position","relative")},m(de,re){y(de,e,re),T(e,n),H(i,n,null),T(e,l),T(e,r),T(r,o),T(r,a),T(r,u),T(u,c),T(e,d),T(e,h),T(h,_),T(h,v),T(h,S),T(S,C),T(e,I),T(e,M),T(M,N),T(M,z),T(M,W),T(W,G),$=!0,j||(Q=J(n,"click",t[2]),j=!0)},p(de,re){var x,me,ee;(!$||re&2)&&s!==(s=de[1]("Blocked domains")+"")&&Z(o,s),(!$||re&1)&&f!==(f=((x=de[0])==null?void 0:x.number_domains_blocked)+"")&&Z(c,f),(!$||re&2)&&g!==(g=de[1]("Last updated")+"")&&Z(_,g),(!$||re&1)&&A!==(A=de[3]((me=de[0])==null?void 0:me.last_updated)+"")&&Z(C,A),(!$||re&2)&&L!==(L=de[1]("Next update")+"")&&Z(N,L),(!$||re&1)&&D!==(D=de[3]((ee=de[0])==null?void 0:ee.next_update)+"")&&Z(G,D)},i(de){$||(b(i.$$.fragment,de),$=!0)},o(de){k(i.$$.fragment,de),$=!1},d(de){de&&w(e),U(i),j=!1,Q()}}}function pJ(t){let e,n=t[1]("Loading...")+"",i;return{c(){e=R("div"),i=q(n),P(e,"class","simple-border")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r&2&&n!==(n=l[1]("Loading...")+"")&&Z(i,n)},i:he,o:he,d(l){l&&w(e)}}}function bJ(t){let e,n=t[1]("DNS Info")+"",i,l,r,s,o,a,u,f,c,d,h,g,_;const v=[pJ,_J],S=[];function A(C,I){return C[0]==null?0:1}return r=A(t),s=S[r]=v[r](t),f=new tr({props:{keyName:"dns_resolver",title:t[1]("DNS Resolver"),labelText:t[1]("DNS Resolver"),type:"text",helperText:""}}),g=new dJ({}),g.$on("updatednsinfo",t[4]),{c(){e=R("h5"),i=q(n),l=B(),s.c(),o=B(),a=R("br"),u=B(),F(f.$$.fragment),c=B(),d=R("br"),h=B(),F(g.$$.fragment)},m(C,I){y(C,e,I),T(e,i),y(C,l,I),S[r].m(C,I),y(C,o,I),y(C,a,I),y(C,u,I),H(f,C,I),y(C,c,I),y(C,d,I),y(C,h,I),H(g,C,I),_=!0},p(C,I){(!_||I&2)&&n!==(n=C[1]("DNS Info")+"")&&Z(i,n);let M=r;r=A(C),r===M?S[r].p(C,I):(fe(),k(S[M],1,1,()=>{S[M]=null}),ce(),s=S[r],s?s.p(C,I):(s=S[r]=v[r](C),s.c()),b(s,1),s.m(o.parentNode,o));const L={};I&2&&(L.title=C[1]("DNS Resolver")),I&2&&(L.labelText=C[1]("DNS Resolver")),f.$set(L)},i(C){_||(b(s),b(f.$$.fragment,C),b(g.$$.fragment,C),_=!0)},o(C){k(s),k(f.$$.fragment,C),k(g.$$.fragment,C),_=!1},d(C){C&&(w(e),w(l),w(o),w(a),w(u),w(c),w(d),w(h)),S[r].d(C),U(f,C),U(g,C)}}}function vJ(t){let e,n;return e=new F$({}),e.$on("updatednsinfo",t[4]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function kJ(t){let e,n,i,l;return e=new zn({props:{sm:5,md:5,lg:5,$$slots:{default:[bJ]},$$scope:{ctx:t}}}),i=new zn({props:{sm:11,md:11,lg:11,$$slots:{default:[vJ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&67&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&64&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function wJ(t){let e,n,i,l,r,s,o,a;return e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[gJ]},$$scope:{ctx:t}}}),o=new dl({props:{$$slots:{default:[kJ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),i=R("h2"),i.textContent="DNS Server",l=B(),r=R("br"),s=B(),F(o.$$.fragment)},m(u,f){H(e,u,f),y(u,n,f),y(u,i,f),y(u,l,f),y(u,r,f),y(u,s,f),H(o,u,f),a=!0},p(u,[f]){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};f&67&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(b(e.$$.fragment,u),b(o.$$.fragment,u),a=!0)},o(u){k(e.$$.fragment,u),k(o.$$.fragment,u),a=!1},d(u){u&&(w(n),w(i),w(l),w(r),w(s)),U(e,u),U(o,u)}}}function yJ(t,e,n){let i,l;Mt(t,An,u=>n(5,i=u)),Mt(t,ii,u=>n(1,l=u));let r=null;const s=async()=>{n(0,r=null),n(0,r=await i.api.doCall("/dns/info"))};return _n(async()=>{await s()}),[r,l,s,u=>new Date(u*1e3).toLocaleString(),async()=>{n(0,r=null),setTimeout(async()=>{await s()},3e3)}]}class TJ extends De{constructor(e){super(),Re(this,e,yJ,wJ,Ie,{})}}var T8=(t=>(t.RENDER_FINISHED="render-finished",t.RESIZE="chart-resize",t.MOUSEOVER="chart-mouseover",t.MOUSEOUT="chart-mouseout",t))(T8||{}),S8=(t=>(t.SHOW="show-modal",t.HIDE="hide-modal",t))(S8||{}),E8=(t=>(t.UPDATE="model-update",t))(E8||{}),M8=(t=>(t.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",t.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",t.BUTTON_CLICK="toolbar-button-click",t))(M8||{}),O8=(t=>(t.UPDATE="zoom-bar-update",t.SELECTION_START="zoom-bar-selection-start",t.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",t.SELECTION_END="zoom-bar-selection-end",t))(O8||{}),A8=(t=>(t.CHANGE="zoom-domain-change",t))(A8||{}),C8=(t=>(t.CANVAS_ZOOM_IN="canvas-zoom-in",t.CANVAS_ZOOM_OUT="canvas-zoom-out",t))(C8||{}),L8=(t=>(t.LABEL_MOUSEOVER="axis-label-mouseover",t.LABEL_MOUSEMOVE="axis-label-mousemove",t.LABEL_CLICK="axis-label-click",t.LABEL_MOUSEOUT="axis-label-mouseout",t.LABEL_FOCUS="axis-label-focus",t.LABEL_BLUR="axis-label-blur",t.RENDER_COMPLETE="axis-render-complete",t))(L8||{}),I8=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(I8||{}),R8=(t=>(t.WORD_MOUSEOVER="wordcloud-word-mouseover",t.WORD_MOUSEMOVE="wordcloud-word-mousemove",t.WORD_CLICK="wordcloud-word-click",t.WORD_MOUSEOUT="wordcloud-word-mouseout",t))(R8||{}),D8=(t=>(t.SLICE_MOUSEOVER="pie-slice-mouseover",t.SLICE_MOUSEMOVE="pie-slice-mousemove",t.SLICE_CLICK="pie-slice-click",t.SLICE_MOUSEOUT="pie-slice-mouseout",t))(D8||{}),P8=(t=>(t.ARC_MOUSEOVER="gauge-arc-mouseover",t.ARC_MOUSEMOVE="gauge-arc-mousemove",t.ARC_CLICK="gauge-arc-click",t.ARC_MOUSEOUT="gauge-arc-mouseout",t))(P8||{}),N8=(t=>(t.BAR_MOUSEOVER="bar-mouseover",t.BAR_MOUSEMOVE="bar-mousemove",t.BAR_CLICK="bar-click",t.BAR_MOUSEOUT="bar-mouseout",t))(N8||{}),B8=(t=>(t.BOX_MOUSEOVER="box-mouseover",t.BOX_MOUSEMOVE="box-mousemove",t.BOX_CLICK="box-click",t.BOX_MOUSEOUT="box-mouseout",t.OUTLIER_MOUSEOVER="outlier-mouseover",t.OUTLIER_MOUSEMOVE="outlier-mousemove",t.OUTLIER_CLICK="outlier-click",t.OUTLIER_MOUSEOUT="outlier-mouseout",t))(B8||{}),z8=(t=>(t.SCATTER_MOUSEOVER="scatter-mouseover",t.SCATTER_MOUSEMOVE="scatter-mousemove",t.SCATTER_CLICK="scatter-click",t.SCATTER_MOUSEOUT="scatter-mouseout",t))(z8||{}),H8=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(H8||{}),U8=(t=>(t.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",t.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",t.X_AXIS_CLICK="radar-x-axis-click",t.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",t))(U8||{}),F8=(t=>(t.NODE_MOUSEOVER="tree-node-mouseover",t.NODE_CLICK="tree-node-click",t.NODE_MOUSEOUT="tree-node-mouseout",t))(F8||{}),G8=(t=>(t.LEAF_MOUSEOVER="leaf-mouseover",t.LEAF_MOUSEMOVE="leaf-mousemove",t.LEAF_CLICK="leaf-click",t.LEAF_MOUSEOUT="leaf-mouseout",t))(G8||{}),V8=(t=>(t.SHOW="show-tooltip",t.MOVE="move-tooltip",t.HIDE="hide-tooltip",t))(V8||{}),W8=(t=>(t.SHOW="show-threshold",t.HIDE="hide-threshold",t))(W8||{}),q8=(t=>(t.ITEM_HOVER="legend-item-onhover",t.ITEM_CLICK="legend-item-onclick",t.ITEM_MOUSEOUT="legend-item-onmouseout",t.ITEMS_UPDATE="legend-items-update",t))(q8||{}),j8=(t=>(t.CIRCLE_MOUSEOVER="circle-leaf-mouseover",t.CIRCLE_CLICK="circle-leaf-click",t.CIRCLE_MOUSEOUT="circle-leaf-mouseout",t.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",t))(j8||{}),Y8=(t=>(t.NODE_MOUSEOVER="alluvial-node-mouseover",t.NODE_CLICK="alluvial-node-click",t.NODE_MOUSEOUT="alluvial-node-mouseout",t.NODE_MOUSEMOVE="alluvial-node-mousemove",t.LINE_MOUSEOVER="alluvial-line-mouseover",t.LINE_CLICK="alluvial-line-click",t.LINE_MOUSEOUT="alluvial-line-mouseout",t.LINE_MOUSEMOVE="alluvial-line-mousemove",t))(Y8||{}),Z8=(t=>(t.METER_MOUSEOVER="meter-mouseover",t.METER_CLICK="meter-click",t.METER_MOUSEOUT="meter-mouseout",t.METER_MOUSEMOVE="meter-mousemove",t))(Z8||{}),X8=(t=>(t.HEATMAP_MOUSEOVER="heatmap-mouseover",t.HEATMAP_CLICK="heatmap-click",t.HEATMAP_MOUSEOUT="heatmap-mouseout",t.HEATMAP_MOUSEMOVE="hetmap-mousemove",t))(X8||{}),K8=(t=>(t.CHOROPLETH_MOUSEOVER="choropleth-mouseover",t.CHOROPLETH_CLICK="choropleth-click",t.CHOROPLETH_MOUSEOUT="choropleth-mouseout",t.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",t))(K8||{});const SJ=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Y8,Area:I8,Axis:L8,Bar:N8,Boxplot:B8,CanvasZoom:C8,Chart:T8,Choropleth:K8,CirclePack:j8,Gauge:P8,Heatmap:X8,Legend:q8,Line:H8,Meter:Z8,Modal:S8,Model:E8,Pie:D8,Radar:U8,Scatter:z8,Threshold:W8,Toolbar:M8,Tooltip:V8,Tree:F8,Treemap:G8,WordCloud:R8,ZoomBar:O8,ZoomDomain:A8},Symbol.toStringTag,{value:"Module"})),je=SJ;var wn=(t=>(t.HTML="html",t.SVG="svg",t))(wn||{}),$8=(t=>(t.WHITE="white",t.G100="g100",t.G90="g90",t.G10="g10",t))($8||{}),Ii=(t=>(t.BACKGROUND="background",t.FILL="fill",t.STROKE="stroke",t.TOOLTIP="tooltip",t))(Ii||{}),it=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom",t))(it||{}),br=(t=>(t.GRAPH_VIEW="graph_view",t.SLIDER_VIEW="slider_view",t))(br||{}),rr=(t=>(t.END_LINE="end_line",t.MID_LINE="mid_line",t.FRONT_LINE="front_line",t.NONE="none",t))(rr||{}),hl=(t=>(t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t))(hl||{}),Nt=(t=>(t.TIME="time",t.LINEAR="linear",t.LOG="log",t.LABELS="labels",t.LABELS_RATIO="labels-ratio",t))(Nt||{}),au=(t=>(t.RIGHT="right",t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t))(au||{}),jl=(t=>(t.LEFT="left",t.CENTER="center",t.RIGHT="right",t))(jl||{}),bu=(t=>(t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t))(bu||{}),J8=(t=>(t.TREE="tree",t.DENDROGRAM="dendrogram",t))(J8||{}),pi=(t=>(t.ROW="row",t.COLUMN="column",t.ROW_REVERSE="row-reverse",t.COLUMN_REVERSE="column-reverse",t))(pi||{}),Nn=(t=>(t.FIXED="fixed",t.PREFERRED="preferred",t.STRETCH="stretch",t))(Nn||{}),vd=(t=>(t.CENTER="center",t))(vd||{}),Uo=(t=>(t.GRID="grid",t.VERT_OR_HORIZ="vertOrHoriz",t.PIE="pie",t.DONUT="donut",t))(Uo||{}),Q8=(t=>(t.SEMI="semi",t.FULL="full",t))(Q8||{}),nc=(t=>(t.ALWAYS="always",t.AUTO="auto",t.NEVER="never",t))(nc||{}),ps=(t=>(t.SCATTER="scatter",t.LINE="line",t.SIMPLE_BAR="simple-bar",t.STACKED_BAR="stacked-bar",t.GROUPED_BAR="grouped-bar",t.AREA="area",t.STACKED_AREA="stacked-area",t))(ps||{}),Yn=(t=>(t.EXPORT_CSV="Export as CSV",t.EXPORT_PNG="Export as PNG",t.EXPORT_JPG="Export as JPG",t.ZOOM_IN="Zoom in",t.ZOOM_OUT="Zoom out",t.RESET_ZOOM="Reset zoom",t.MAKE_FULLSCREEN="Make fullscreen",t.SHOW_AS_DATATABLE="Show as data-table",t.CUSTOM="Custom",t))(Yn||{}),Qm=(t=>(t.LEFT="left",t.RIGHT="right",t))(Qm||{}),Ti=(t=>(t.CHECKBOX="checkbox",t.RADIUS="radius",t.AREA="area",t.SIZE="size",t.LINE="line",t.QUARTILE="quartile",t.ZOOM="zoom",t))(Ti||{}),x8=(t=>(t.ON="on",t.AUTO="auto",t.OFF="off",t))(x8||{}),i0=(t=>(t.DEFAULT="default",t.HOVERABLE="hoverable",t))(i0||{}),eS=(t=>(t.geoEqualEarth="geoEqualEarth",t.geoAlbers="geoAlbers",t.geoConicEqualArea="geoConicEqualArea",t.geoConicEquidistant="geoConicEquidistant",t.geoEquirectangular="geoEquirectangular",t.geoMercator="geoMercator",t.geoNaturalEarth1="geoNaturalEarth1",t))(eS||{});function ic(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function EJ(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function l0(t){let e,n,i;t.length!==2?(e=ic,n=(o,a)=>ic(t(o),a),i=(o,a)=>t(o)-a):(e=t===ic||t===EJ?t:MJ,n=t,i=t);function l(o,a,u=0,f=o.length){if(u>>1;n(o[c],a)<0?u=c+1:f=c}while(u>>1;n(o[c],a)<=0?u=c+1:f=c}while(uu&&i(o[c-1],a)>-i(o[c],a)?c-1:c}return{left:l,center:s,right:r}}function MJ(){return 0}function OJ(t){return t===null?NaN:+t}const AJ=l0(ic),CJ=AJ.right;l0(OJ).center;const tS=CJ;function LJ(t,e){let n=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&++n;else{let i=-1;for(let l of t)(l=e(l,++i,t))!=null&&(l=+l)>=l&&++n}return n}function Yo(t,e){let n,i;if(e===void 0)for(const l of t)l!=null&&(n===void 0?l>=l&&(n=i=l):(n>l&&(n=l),i=r&&(n=i=r):(n>r&&(n=r),it}const zJ=Math.sqrt(50),HJ=Math.sqrt(10),UJ=Math.sqrt(2);function Oc(t,e,n){const i=(e-t)/Math.max(0,n),l=Math.floor(Math.log10(i)),r=i/Math.pow(10,l),s=r>=zJ?10:r>=HJ?5:r>=UJ?2:1;let o,a,u;return l<0?(u=Math.pow(10,-l)/s,o=Math.round(t*u),a=Math.round(e*u),o/ue&&--a,u=-u):(u=Math.pow(10,l)*s,o=Math.round(t/u),a=Math.round(e/u),o*ue&&--a),a0))return[];if(t===e)return[t];const i=e=l))return[];const o=r-l+1,a=new Array(o);if(i)if(s<0)for(let u=0;u0?(t=Math.floor(t/l)*l,e=Math.ceil(e/l)*l):l<0&&(t=Math.ceil(t*l)/l,e=Math.floor(e*l)/l),i=l}}function GJ(t){return Math.max(1,Math.ceil(Math.log(LJ(t))/Math.LN2)+1)}function VJ(){var t=PJ,e=Yo,n=GJ;function i(l){Array.isArray(l)||(l=Array.from(l));var r,s=l.length,o,a,u=new Array(s);for(r=0;r=d)if(C>=d&&e===Yo){const M=na(c,d,I);isFinite(M)&&(M>0?d=(Math.floor(d/M)+1)*M:M<0&&(d=(Math.ceil(d*-M)+1)/-M))}else h.pop()}for(var g=h.length,_=0,v=g;h[_]<=c;)++_;for(;h[v-1]>d;)--v;(_||v0?h[r-1]:c,A.x1=r0)for(r=0;r=i)&&(n=i);else{let i=-1;for(let l of t)(l=e(l,++i,t))!=null&&(n=l)&&(n=l)}return n}function qJ(t,e){let n;if(e===void 0)for(const i of t)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let l of t)(l=e(l,++i,t))!=null&&(n>l||n===void 0&&l>=l)&&(n=l)}return n}function jJ(t,e,n){t=+t,e=+e,n=(l=arguments.length)<2?(e=t,t=0,1):l<3?1:+n;for(var i=-1,l=Math.max(0,Math.ceil((e-t)/n))|0,r=new Array(l);++i+t(e)}function $J(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function JJ(){return!this.__axis}function kd(t,e){var n=[],i=null,l=null,r=6,s=6,o=3,a=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===lc||t===tu?-1:1,f=t===tu||t===rc?"x":"y",c=t===lc||t===e1?ZJ:XJ;function d(h){var g=i??(e.ticks?e.ticks.apply(e,n):e.domain()),_=l??(e.tickFormat?e.tickFormat.apply(e,n):YJ),v=Math.max(r,0)+o,S=e.range(),A=+S[0]+a,C=+S[S.length-1]+a,I=(e.bandwidth?$J:KJ)(e.copy(),a),M=h.selection?h.selection():h,L=M.selectAll(".domain").data([null]),N=M.selectAll(".tick").data(g,e).order(),z=N.exit(),W=N.enter().append("g").attr("class","tick"),D=N.select("line"),G=N.select("text");L=L.merge(L.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),N=N.merge(W),D=D.merge(W.append("line").attr("stroke","currentColor").attr(f+"2",u*r)),G=G.merge(W.append("text").attr("fill","currentColor").attr(f,u*v).attr("dy",t===lc?"0em":t===e1?"0.71em":"0.32em")),h!==M&&(L=L.transition(h),N=N.transition(h),D=D.transition(h),G=G.transition(h),z=z.transition(h).attr("opacity",a4).attr("transform",function($){return isFinite($=I($))?c($+a):this.getAttribute("transform")}),W.attr("opacity",a4).attr("transform",function($){var j=this.parentNode.__axis;return c((j&&isFinite(j=j($))?j:I($))+a)})),z.remove(),L.attr("d",t===tu||t===rc?s?"M"+u*s+","+A+"H"+a+"V"+C+"H"+u*s:"M"+a+","+A+"V"+C:s?"M"+A+","+u*s+"V"+a+"H"+C+"V"+u*s:"M"+A+","+a+"H"+C),N.attr("opacity",1).attr("transform",function($){return c(I($)+a)}),D.attr(f+"2",u*r),G.attr(f,u*v).text(_),M.filter(JJ).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===rc?"start":t===tu?"end":"middle"),M.each(function(){this.__axis=I})}return d.scale=function(h){return arguments.length?(e=h,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(h){return arguments.length?(n=h==null?[]:Array.from(h),d):n.slice()},d.tickValues=function(h){return arguments.length?(i=h==null?null:Array.from(h),d):i&&i.slice()},d.tickFormat=function(h){return arguments.length?(l=h,d):l},d.tickSize=function(h){return arguments.length?(r=s=+h,d):r},d.tickSizeInner=function(h){return arguments.length?(r=+h,d):r},d.tickSizeOuter=function(h){return arguments.length?(s=+h,d):s},d.tickPadding=function(h){return arguments.length?(o=+h,d):o},d.offset=function(h){return arguments.length?(a=+h,d):a},d}function QJ(t){return kd(lc,t)}function xJ(t){return kd(rc,t)}function nS(t){return kd(e1,t)}function iS(t){return kd(tu,t)}var eQ={value:()=>{}};function r0(){for(var t=0,e=arguments.length,n={},i;t=0&&(i=n.slice(l+1),n=n.slice(0,l)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}sc.prototype=r0.prototype={constructor:sc,on:function(t,e){var n=this._,i=tQ(t+"",n),l,r=-1,s=i.length;if(arguments.length<2){for(;++r0)for(var n=new Array(l),i=0,l,r;i=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),f4.hasOwnProperty(e)?{space:f4[e],local:t}:t}function iQ(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===t1&&e.documentElement.namespaceURI===t1?e.createElement(t):e.createElementNS(n,t)}}function lQ(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function lS(t){var e=wd(t);return(e.local?lQ:iQ)(e)}function rQ(){}function s0(t){return t==null?rQ:function(){return this.querySelector(t)}}function sQ(t){typeof t!="function"&&(t=s0(t));for(var e=this._groups,n=e.length,i=new Array(n),l=0;l=C&&(C=A+1);!(M=v[C])&&++C=0;)(s=i[l])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function IQ(t){t||(t=RQ);function e(c,d){return c&&d?t(c.__data__,d.__data__):!c-!d}for(var n=this._groups,i=n.length,l=new Array(i),r=0;re?1:t>=e?0:NaN}function DQ(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function PQ(){return Array.from(this)}function NQ(){for(var t=this._groups,e=0,n=t.length;e1?this.each((e==null?YQ:typeof e=="function"?XQ:ZQ)(t,e,n??"")):ia(this.node(),t)}function ia(t,e){return t.style.getPropertyValue(e)||uS(t).getComputedStyle(t,null).getPropertyValue(e)}function $Q(t){return function(){delete this[t]}}function JQ(t,e){return function(){this[t]=e}}function QQ(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function xQ(t,e){return arguments.length>1?this.each((e==null?$Q:typeof e=="function"?QQ:JQ)(t,e)):this.node()[t]}function fS(t){return t.trim().split(/^|\s+/)}function o0(t){return t.classList||new cS(t)}function cS(t){this._node=t,this._names=fS(t.getAttribute("class")||"")}cS.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function dS(t,e){for(var n=o0(t),i=-1,l=e.length;++i=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function Ox(t){return function(){var e=this.__on;if(e){for(var n=0,i=-1,l=e.length,r;n>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?qf(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?qf(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ux.exec(t))?new fl(e[1],e[2],e[3],1):(e=Fx.exec(t))?new fl(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Gx.exec(t))?qf(e[1],e[2],e[3],e[4]):(e=Vx.exec(t))?qf(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Wx.exec(t))?p4(e[1],e[2]/100,e[3]/100,1):(e=qx.exec(t))?p4(e[1],e[2]/100,e[3]/100,e[4]):c4.hasOwnProperty(t)?m4(c4[t]):t==="transparent"?new fl(NaN,NaN,NaN,0):null}function m4(t){return new fl(t>>16&255,t>>8&255,t&255,1)}function qf(t,e,n,i){return i<=0&&(t=e=n=NaN),new fl(t,e,n,i)}function Zx(t){return t instanceof Gu||(t=to(t)),t?(t=t.rgb(),new fl(t.r,t.g,t.b,t.opacity)):new fl}function l1(t,e,n,i){return arguments.length===1?Zx(t):new fl(t,e,n,i??1)}function fl(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}a0(fl,l1,_S(Gu,{brighter(t){return t=t==null?Lc:Math.pow(Lc,t),new fl(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?vu:Math.pow(vu,t),new fl(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new fl(Xs(this.r),Xs(this.g),Xs(this.b),Ic(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:g4,formatHex:g4,formatHex8:Xx,formatRgb:_4,toString:_4}));function g4(){return`#${Zs(this.r)}${Zs(this.g)}${Zs(this.b)}`}function Xx(){return`#${Zs(this.r)}${Zs(this.g)}${Zs(this.b)}${Zs((isNaN(this.opacity)?1:this.opacity)*255)}`}function _4(){const t=Ic(this.opacity);return`${t===1?"rgb(":"rgba("}${Xs(this.r)}, ${Xs(this.g)}, ${Xs(this.b)}${t===1?")":`, ${t})`}`}function Ic(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Xs(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Zs(t){return t=Xs(t),(t<16?"0":"")+t.toString(16)}function p4(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new lr(t,e,n,i)}function pS(t){if(t instanceof lr)return new lr(t.h,t.s,t.l,t.opacity);if(t instanceof Gu||(t=to(t)),!t)return new lr;if(t instanceof lr)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,l=Math.min(e,n,i),r=Math.max(e,n,i),s=NaN,o=r-l,a=(r+l)/2;return o?(e===r?s=(n-i)/o+(n0&&a<1?0:s,new lr(s,o,a,t.opacity)}function Kx(t,e,n,i){return arguments.length===1?pS(t):new lr(t,e,n,i??1)}function lr(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}a0(lr,Kx,_S(Gu,{brighter(t){return t=t==null?Lc:Math.pow(Lc,t),new lr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?vu:Math.pow(vu,t),new lr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,l=2*n-i;return new fl(am(t>=240?t-240:t+120,l,i),am(t,l,i),am(t<120?t+240:t-120,l,i),this.opacity)},clamp(){return new lr(b4(this.h),jf(this.s),jf(this.l),Ic(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ic(this.opacity);return`${t===1?"hsl(":"hsla("}${b4(this.h)}, ${jf(this.s)*100}%, ${jf(this.l)*100}%${t===1?")":`, ${t})`}`}}));function b4(t){return t=(t||0)%360,t<0?t+360:t}function jf(t){return Math.max(0,Math.min(1,t||0))}function am(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const u0=t=>()=>t;function $x(t,e){return function(n){return t+n*e}}function Jx(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function Qx(t){return(t=+t)==1?bS:function(e,n){return n-e?Jx(e,n,t):u0(isNaN(e)?n:e)}}function bS(t,e){var n=e-t;return n?$x(t,n):u0(isNaN(t)?e:t)}const Rc=function t(e){var n=Qx(e);function i(l,r){var s=n((l=l1(l)).r,(r=l1(r)).r),o=n(l.g,r.g),a=n(l.b,r.b),u=bS(l.opacity,r.opacity);return function(f){return l.r=s(f),l.g=o(f),l.b=a(f),l.opacity=u(f),l+""}}return i.gamma=t,i}(1);function xx(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),l;return function(r){for(l=0;ln&&(r=e.slice(n,r),o[s]?o[s]+=r:o[++s]=r),(i=i[0])===(l=l[0])?o[s]?o[s]+=l:o[++s]=l:(o[++s]=null,a.push({i:s,x:ir(i,l)})),n=um.lastIndex;return n180?f+=360:f-u>180&&(u+=360),d.push({i:c.push(l(c)+"rotate(",null,i)-2,x:ir(u,f)})):f&&c.push(l(c)+"rotate("+f+i)}function o(u,f,c,d){u!==f?d.push({i:c.push(l(c)+"skewX(",null,i)-2,x:ir(u,f)}):f&&c.push(l(c)+"skewX("+f+i)}function a(u,f,c,d,h,g){if(u!==c||f!==d){var _=h.push(l(h)+"scale(",null,",",null,")");g.push({i:_-4,x:ir(u,c)},{i:_-2,x:ir(f,d)})}else(c!==1||d!==1)&&h.push(l(h)+"scale("+c+","+d+")")}return function(u,f){var c=[],d=[];return u=t(u),f=t(f),r(u.translateX,u.translateY,f.translateX,f.translateY,c,d),s(u.rotate,f.rotate,c,d),o(u.skewX,f.skewX,c,d),a(u.scaleX,u.scaleY,f.scaleX,f.scaleY,c,d),u=f=null,function(h){for(var g=-1,_=d.length,v;++g<_;)c[(v=d[g]).i]=v.x(h);return c.join("")}}}var uee=wS(oee,"px, ","px)","deg)"),fee=wS(aee,", ",")",")"),la=0,nu=0,ja=0,yS=1e3,Dc,iu,Pc=0,no=0,Td=0,wu=typeof performance=="object"&&performance.now?performance:Date,TS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function f0(){return no||(TS(cee),no=wu.now()+Td)}function cee(){no=0}function Nc(){this._call=this._time=this._next=null}Nc.prototype=SS.prototype={constructor:Nc,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?f0():+n)+(e==null?0:+e),!this._next&&iu!==this&&(iu?iu._next=this:Dc=this,iu=this),this._call=t,this._time=n,o1()},stop:function(){this._call&&(this._call=null,this._time=1/0,o1())}};function SS(t,e,n){var i=new Nc;return i.restart(t,e,n),i}function dee(){f0(),++la;for(var t=Dc,e;t;)(e=no-t._time)>=0&&t._call.call(void 0,e),t=t._next;--la}function k4(){no=(Pc=wu.now())+Td,la=nu=0;try{dee()}finally{la=0,mee(),no=0}}function hee(){var t=wu.now(),e=t-Pc;e>yS&&(Td-=e,Pc=t)}function mee(){for(var t,e=Dc,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Dc=n);iu=t,o1(i)}function o1(t){if(!la){nu&&(nu=clearTimeout(nu));var e=t-no;e>24?(t<1/0&&(nu=setTimeout(k4,t-wu.now()-Td)),ja&&(ja=clearInterval(ja))):(ja||(Pc=wu.now(),ja=setInterval(hee,yS)),la=1,TS(k4))}}function w4(t,e,n){var i=new Nc;return e=e==null?0:+e,i.restart(l=>{i.stop(),t(l+e)},e,n),i}var gee=r0("start","end","cancel","interrupt"),_ee=[],ES=0,y4=1,a1=2,oc=3,T4=4,u1=5,ac=6;function Sd(t,e,n,i,l,r){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;pee(t,n,{name:e,index:i,group:l,on:gee,tween:_ee,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:ES})}function c0(t,e){var n=or(t,e);if(n.state>ES)throw new Error("too late; already scheduled");return n}function Tr(t,e){var n=or(t,e);if(n.state>oc)throw new Error("too late; already running");return n}function or(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function pee(t,e,n){var i=t.__transition,l;i[e]=n,n.timer=SS(r,0,n.time);function r(u){n.state=y4,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var f,c,d,h;if(n.state!==y4)return a();for(f in i)if(h=i[f],h.name===n.name){if(h.state===oc)return w4(s);h.state===T4?(h.state=ac,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+fa1&&i.state=0&&(e=e.slice(0,n)),!e||e==="start"})}function Zee(t,e,n){var i,l,r=Yee(e)?c0:Tr;return function(){var s=r(this,t),o=s.on;o!==i&&(l=(i=o).copy()).on(e,n),s.on=l}}function Xee(t,e){var n=this._id;return arguments.length<2?or(this.node(),n).on.on(t):this.each(Zee(n,t,e))}function Kee(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function $ee(){return this.on("end.remove",Kee(this._id))}function Jee(t){var e=this._name,n=this._id;typeof t!="function"&&(t=s0(t));for(var i=this._groups,l=i.length,r=new Array(l),s=0;s+t;function CS(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var vte={time:null,delay:0,duration:250,ease:CS};function kte(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function wte(t){var e,n;t instanceof Yr?(e=t._id,t=t._name):(e=AS(),(n=vte).time=f0(),t=t==null?null:t+"");for(var i=this._groups,l=i.length,r=0;r()=>t;function yte(t,{sourceEvent:e,target:n,selection:i,mode:l,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:l,enumerable:!0,configurable:!0},_:{value:r}})}function Tte(t){t.stopImmediatePropagation()}function cm(t){t.preventDefault(),t.stopImmediatePropagation()}var S4={name:"drag"},dm={name:"space"},Do={name:"handle"},Po={name:"center"};const{abs:E4,max:Hi,min:Ui}=Math;function M4(t){return[+t[0],+t[1]]}function O4(t){return[M4(t[0]),M4(t[1])]}var uc={name:"x",handles:["w","e"].map(Bc),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},hm={name:"y",handles:["n","s"].map(Bc),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},zr={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},A4={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},C4={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Ste={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Ete={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Bc(t){return{type:t}}function Mte(t){return!t.ctrlKey&&!t.button}function Ote(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Ate(){return navigator.maxTouchPoints||"ontouchstart"in this}function mm(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Cte(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function LS(){return Lte(uc)}function Lte(t){var e=Ote,n=Mte,i=Ate,l=!0,r=r0("start","brush","end"),s=6,o;function a(v){var S=v.property("__brush",_).selectAll(".overlay").data([Bc("overlay")]);S.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",zr.overlay).merge(S).each(function(){var C=mm(this).extent;ht(this).attr("x",C[0][0]).attr("y",C[0][1]).attr("width",C[1][0]-C[0][0]).attr("height",C[1][1]-C[0][1])}),v.selectAll(".selection").data([Bc("selection")]).enter().append("rect").attr("class","selection").attr("cursor",zr.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var A=v.selectAll(".handle").data(t.handles,function(C){return C.type});A.exit().remove(),A.enter().append("rect").attr("class",function(C){return"handle handle--"+C.type}).attr("cursor",function(C){return zr[C.type]}),v.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(i).on("touchstart.brush",d).on("touchmove.brush",h).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}a.move=function(v,S,A){v.tween?v.on("start.brush",function(C){f(this,arguments).beforestart().start(C)}).on("interrupt.brush end.brush",function(C){f(this,arguments).end(C)}).tween("brush",function(){var C=this,I=C.__brush,M=f(C,arguments),L=I.selection,N=t.input(typeof S=="function"?S.apply(this,arguments):S,I.extent),z=yd(L,N);function W(D){I.selection=D===1&&N===null?null:z(D),u.call(C),M.brush()}return L!==null&&N!==null?W:W(1)}):v.each(function(){var C=this,I=arguments,M=C.__brush,L=t.input(typeof S=="function"?S.apply(C,I):S,M.extent),N=f(C,I).beforestart();f1(C),M.selection=L===null?null:L,u.call(C),N.start(A).brush(A).end(A)})},a.clear=function(v,S){a.move(v,null,S)};function u(){var v=ht(this),S=mm(this).selection;S?(v.selectAll(".selection").style("display",null).attr("x",S[0][0]).attr("y",S[0][1]).attr("width",S[1][0]-S[0][0]).attr("height",S[1][1]-S[0][1]),v.selectAll(".handle").style("display",null).attr("x",function(A){return A.type[A.type.length-1]==="e"?S[1][0]-s/2:S[0][0]-s/2}).attr("y",function(A){return A.type[0]==="s"?S[1][1]-s/2:S[0][1]-s/2}).attr("width",function(A){return A.type==="n"||A.type==="s"?S[1][0]-S[0][0]+s:s}).attr("height",function(A){return A.type==="e"||A.type==="w"?S[1][1]-S[0][1]+s:s})):v.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function f(v,S,A){var C=v.__brush.emitter;return C&&(!A||!C.clean)?C:new c(v,S,A)}function c(v,S,A){this.that=v,this.args=S,this.state=v.__brush,this.active=0,this.clean=A}c.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(v,S){return this.starting?(this.starting=!1,this.emit("start",v,S)):this.emit("brush",v),this},brush:function(v,S){return this.emit("brush",v,S),this},end:function(v,S){return--this.active===0&&(delete this.state.emitter,this.emit("end",v,S)),this},emit:function(v,S,A){var C=ht(this.that).datum();r.call(v,this.that,new yte(v,{sourceEvent:S,target:a,selection:t.output(this.state.selection),mode:A,dispatch:r}),C)}};function d(v){if(o&&!v.touches||!n.apply(this,arguments))return;var S=this,A=v.target.__data__.type,C=(l&&v.metaKey?A="overlay":A)==="selection"?S4:l&&v.altKey?Po:Do,I=t===hm?null:Ste[A],M=t===uc?null:Ete[A],L=mm(S),N=L.extent,z=L.selection,W=N[0][0],D,G,$=N[0][1],j,Q,le=N[1][0],oe,X,de=N[1][1],re,x,me=0,ee=0,ke,pe=I&&M&&l&&v.shiftKey,Fe,Ve,Ee=Array.from(v.touches||[v],at=>{const ut=at.identifier;return at=eo(at,S),at.point0=at.slice(),at.identifier=ut,at});f1(S);var We=f(S,arguments,!0).beforestart();if(A==="overlay"){z&&(ke=!0);const at=[Ee[0],Ee[1]||Ee[0]];L.selection=z=[[D=t===hm?W:Ui(at[0][0],at[1][0]),j=t===uc?$:Ui(at[0][1],at[1][1])],[oe=t===hm?le:Hi(at[0][0],at[1][0]),re=t===uc?de:Hi(at[0][1],at[1][1])]],Ee.length>1&&nt(v)}else D=z[0][0],j=z[0][1],oe=z[1][0],re=z[1][1];G=D,Q=j,X=oe,x=re;var ge=ht(S).attr("pointer-events","none"),ve=ge.selectAll(".overlay").attr("cursor",zr[A]);if(v.touches)We.moved=ue,We.ended=Oe;else{var be=ht(v.view).on("mousemove.brush",ue,!0).on("mouseup.brush",Oe,!0);l&&be.on("keydown.brush",dt,!0).on("keyup.brush",yt,!0),Bx(v.view)}u.call(S),We.start(v,C.name);function ue(at){for(const ut of at.changedTouches||[at])for(const At of Ee)At.identifier===ut.identifier&&(At.cur=eo(ut,S));if(pe&&!Fe&&!Ve&&Ee.length===1){const ut=Ee[0];E4(ut.cur[0]-ut[0])>E4(ut.cur[1]-ut[1])?Ve=!0:Fe=!0}for(const ut of Ee)ut.cur&&(ut[0]=ut.cur[0],ut[1]=ut.cur[1]);ke=!0,cm(at),nt(at)}function nt(at){const ut=Ee[0],At=ut.point0;var xe;switch(me=ut[0]-At[0],ee=ut[1]-At[1],C){case dm:case S4:{I&&(me=Hi(W-D,Ui(le-oe,me)),G=D+me,X=oe+me),M&&(ee=Hi($-j,Ui(de-re,ee)),Q=j+ee,x=re+ee);break}case Do:{Ee[1]?(I&&(G=Hi(W,Ui(le,Ee[0][0])),X=Hi(W,Ui(le,Ee[1][0])),I=1),M&&(Q=Hi($,Ui(de,Ee[0][1])),x=Hi($,Ui(de,Ee[1][1])),M=1)):(I<0?(me=Hi(W-D,Ui(le-D,me)),G=D+me,X=oe):I>0&&(me=Hi(W-oe,Ui(le-oe,me)),G=D,X=oe+me),M<0?(ee=Hi($-j,Ui(de-j,ee)),Q=j+ee,x=re):M>0&&(ee=Hi($-re,Ui(de-re,ee)),Q=j,x=re+ee));break}case Po:{I&&(G=Hi(W,Ui(le,D-me*I)),X=Hi(W,Ui(le,oe+me*I))),M&&(Q=Hi($,Ui(de,j-ee*M)),x=Hi($,Ui(de,re+ee*M)));break}}X0&&(D=G-me),M<0?re=x-ee:M>0&&(j=Q-ee),C=dm,ve.attr("cursor",zr.selection),nt(at));break}default:return}cm(at)}function yt(at){switch(at.keyCode){case 16:{pe&&(Fe=Ve=pe=!1,nt(at));break}case 18:{C===Po&&(I<0?oe=X:I>0&&(D=G),M<0?re=x:M>0&&(j=Q),C=Do,nt(at));break}case 32:{C===dm&&(at.altKey?(I&&(oe=X-me*I,D=G+me*I),M&&(re=x-ee*M,j=Q+ee*M),C=Po):(I<0?oe=X:I>0&&(D=G),M<0?re=x:M>0&&(j=Q),C=Do),ve.attr("cursor",zr[A]),nt(at));break}default:return}cm(at)}}function h(v){f(this,arguments).moved(v)}function g(v){f(this,arguments).ended(v)}function _(){var v=this.__brush||{selection:null};return v.extent=O4(e.apply(this,arguments)),v.dim=t,v}return a.extent=function(v){return arguments.length?(e=typeof v=="function"?v:fm(O4(v)),a):e},a.filter=function(v){return arguments.length?(n=typeof v=="function"?v:fm(!!v),a):n},a.touchable=function(v){return arguments.length?(i=typeof v=="function"?v:fm(!!v),a):i},a.handleSize=function(v){return arguments.length?(s=+v,a):s},a.keyModifiers=function(v){return arguments.length?(l=!!v,a):l},a.on=function(){var v=r.on.apply(r,arguments);return v===r?a:v},a}const c1=Math.PI,d1=2*c1,Vs=1e-6,Ite=d1-Vs;function IS(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return IS;const n=10**e;return function(i){this._+=i[0];for(let l=1,r=i.length;lVs)if(!(Math.abs(c*a-u*f)>Vs)||!r)this._append`L${this._x1=e},${this._y1=n}`;else{let h=i-s,g=l-o,_=a*a+u*u,v=h*h+g*g,S=Math.sqrt(_),A=Math.sqrt(d),C=r*Math.tan((c1-Math.acos((_+d-v)/(2*S*A)))/2),I=C/A,M=C/S;Math.abs(I-1)>Vs&&this._append`L${e+I*f},${n+I*c}`,this._append`A${r},${r},0,0,${+(c*h>f*g)},${this._x1=e+M*a},${this._y1=n+M*u}`}}arc(e,n,i,l,r,s){if(e=+e,n=+n,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let o=i*Math.cos(l),a=i*Math.sin(l),u=e+o,f=n+a,c=1^s,d=s?l-r:r-l;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>Vs||Math.abs(this._y1-f)>Vs)&&this._append`L${u},${f}`,i&&(d<0&&(d=d%d1+d1),d>Ite?this._append`A${i},${i},0,1,${c},${e-o},${n-a}A${i},${i},0,1,${c},${this._x1=u},${this._y1=f}`:d>Vs&&this._append`A${i},${i},0,${+(d>=c1)},${c},${this._x1=e+i*Math.cos(r)},${this._y1=n+i*Math.sin(r)}`)}rect(e,n,i,l){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${i=+i}v${+l}h${-i}Z`}toString(){return this._}}function Pte(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function zc(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function ra(t){return t=zc(Math.abs(t)),t?t[1]:NaN}function Nte(t,e){return function(n,i){for(var l=n.length,r=[],s=0,o=t[0],a=0;l>0&&o>0&&(a+o+1>i&&(o=Math.max(1,i-a)),r.push(n.substring(l-=o,l+o)),!((a+=o+1)>i));)o=t[s=(s+1)%t.length];return r.reverse().join(e)}}function Bte(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var zte=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function yu(t){if(!(e=zte.exec(t)))throw new Error("invalid format: "+t);var e;return new h0({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}yu.prototype=h0.prototype;function h0(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}h0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Hte(t){e:for(var e=t.length,n=1,i=-1,l;n0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(l+1):t}var RS;function Ute(t,e){var n=zc(t,e);if(!n)return t+"";var i=n[0],l=n[1],r=l-(RS=Math.max(-8,Math.min(8,Math.floor(l/3)))*3)+1,s=i.length;return r===s?i:r>s?i+new Array(r-s+1).join("0"):r>0?i.slice(0,r)+"."+i.slice(r):"0."+new Array(1-r).join("0")+zc(t,Math.max(0,e+r-1))[0]}function L4(t,e){var n=zc(t,e);if(!n)return t+"";var i=n[0],l=n[1];return l<0?"0."+new Array(-l).join("0")+i:i.length>l+1?i.slice(0,l+1)+"."+i.slice(l+1):i+new Array(l-i.length+2).join("0")}const I4={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Pte,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>L4(t*100,e),r:L4,s:Ute,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function R4(t){return t}var D4=Array.prototype.map,P4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Fte(t){var e=t.grouping===void 0||t.thousands===void 0?R4:Nte(D4.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",l=t.decimal===void 0?".":t.decimal+"",r=t.numerals===void 0?R4:Bte(D4.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",a=t.nan===void 0?"NaN":t.nan+"";function u(c){c=yu(c);var d=c.fill,h=c.align,g=c.sign,_=c.symbol,v=c.zero,S=c.width,A=c.comma,C=c.precision,I=c.trim,M=c.type;M==="n"?(A=!0,M="g"):I4[M]||(C===void 0&&(C=12),I=!0,M="g"),(v||d==="0"&&h==="=")&&(v=!0,d="0",h="=");var L=_==="$"?n:_==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():"",N=_==="$"?i:/[%p]/.test(M)?s:"",z=I4[M],W=/[defgprs%]/.test(M);C=C===void 0?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function D(G){var $=L,j=N,Q,le,oe;if(M==="c")j=z(G)+j,G="";else{G=+G;var X=G<0||1/G<0;if(G=isNaN(G)?a:z(Math.abs(G),C),I&&(G=Hte(G)),X&&+G==0&&g!=="+"&&(X=!1),$=(X?g==="("?g:o:g==="-"||g==="("?"":g)+$,j=(M==="s"?P4[8+RS/3]:"")+j+(X&&g==="("?")":""),W){for(Q=-1,le=G.length;++Qoe||oe>57){j=(oe===46?l+G.slice(Q+1):G.slice(Q))+j,G=G.slice(0,Q);break}}}A&&!v&&(G=e(G,1/0));var de=$.length+G.length+j.length,re=de>1)+$+G+j+re.slice(de);break;default:G=re+$+G+j;break}return r(G)}return D.toString=function(){return c+""},D}function f(c,d){var h=u((c=yu(c),c.type="f",c)),g=Math.max(-8,Math.min(8,Math.floor(ra(d)/3)))*3,_=Math.pow(10,-g),v=P4[8+g/3];return function(S){return h(_*S)+v}}return{format:u,formatPrefix:f}}var Zf,m0,DS;Gte({thousands:",",grouping:[3],currency:["$",""]});function Gte(t){return Zf=Fte(t),m0=Zf.format,DS=Zf.formatPrefix,Zf}function Vte(t){return Math.max(0,-ra(Math.abs(t)))}function Wte(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ra(e)/3)))*3-ra(Math.abs(t)))}function qte(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ra(e)-ra(t))+1}function Vu(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const N4=Symbol("implicit");function g0(){var t=new s4,e=[],n=[],i=N4;function l(r){let s=t.get(r);if(s===void 0){if(i!==N4)return i;t.set(r,s=e.push(r)-1)}return n[s%n.length]}return l.domain=function(r){if(!arguments.length)return e.slice();e=[],t=new s4;for(const s of r)t.has(s)||t.set(s,e.push(s)-1);return l},l.range=function(r){return arguments.length?(n=Array.from(r),l):n.slice()},l.unknown=function(r){return arguments.length?(i=r,l):i},l.copy=function(){return g0(e,n).unknown(i)},Vu.apply(l,arguments),l}function _0(){var t=g0().unknown(void 0),e=t.domain,n=t.range,i=0,l=1,r,s,o=!1,a=0,u=0,f=.5;delete t.unknown;function c(){var d=e().length,h=le&&(n=t,t=e,e=n),function(i){return Math.max(t,Math.min(e,i))}}function Xte(t,e,n){var i=t[0],l=t[1],r=e[0],s=e[1];return l2?Kte:Xte,a=u=null,c}function c(d){return d==null||isNaN(d=+d)?r:(a||(a=o(t.map(i),e,n)))(i(s(d)))}return c.invert=function(d){return s(l((u||(u=o(e,t.map(i),ir)))(d)))},c.domain=function(d){return arguments.length?(t=Array.from(d,Yte),f()):t.slice()},c.range=function(d){return arguments.length?(e=Array.from(d),f()):e.slice()},c.rangeRound=function(d){return e=Array.from(d),n=see,f()},c.clamp=function(d){return arguments.length?(s=d?!0:Fo,f()):s!==Fo},c.interpolate=function(d){return arguments.length?(n=d,f()):n},c.unknown=function(d){return arguments.length?(r=d,c):r},function(d,h){return i=d,l=h,f()}}function NS(){return PS()(Fo,Fo)}function $te(t,e,n,i){var l=xm(t,e,n),r;switch(i=yu(i??",f"),i.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return i.precision==null&&!isNaN(r=Wte(l,s))&&(i.precision=r),DS(i,s)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(r=qte(l,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=r-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(r=Vte(l))&&(i.precision=r-(i.type==="%")*2);break}}return m0(i)}function Jte(t){var e=t.domain;return t.ticks=function(n){var i=e();return Ac(i[0],i[i.length-1],n??10)},t.tickFormat=function(n,i){var l=e();return $te(l[0],l[l.length-1],n??10,i)},t.nice=function(n){n==null&&(n=10);var i=e(),l=0,r=i.length-1,s=i[l],o=i[r],a,u,f=10;for(o0;){if(u=na(s,o,n),u===a)return i[l]=s,i[r]=o,e(i);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;a=u}return t},t}function Hc(){var t=NS();return t.copy=function(){return p0(t,Hc())},Vu.apply(t,arguments),Jte(t)}function BS(t,e){t=t.slice();var n=0,i=t.length-1,l=t[n],r=t[i],s;return rMath.pow(t,e)}function nne(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function U4(t){return(e,n)=>-t(-e,n)}function ine(t){const e=t(z4,H4),n=e.domain;let i=10,l,r;function s(){return l=nne(i),r=tne(i),n()[0]<0?(l=U4(l),r=U4(r),t(Qte,xte)):t(z4,H4),e}return e.base=function(o){return arguments.length?(i=+o,s()):i},e.domain=function(o){return arguments.length?(n(o),s()):n()},e.ticks=o=>{const a=n();let u=a[0],f=a[a.length-1];const c=f0){for(;d<=h;++d)for(g=1;gf)break;S.push(_)}}else for(;d<=h;++d)for(g=i-1;g>=1;--g)if(_=d>0?g/r(-d):g*r(d),!(_f)break;S.push(_)}S.length*2{if(o==null&&(o=10),a==null&&(a=i===10?"s":","),typeof a!="function"&&(!(i%1)&&(a=yu(a)).precision==null&&(a.trim=!0),a=m0(a)),o===1/0)return a;const u=Math.max(1,i*o/e.ticks().length);return f=>{let c=f/r(Math.round(l(f)));return c*in(BS(n(),{floor:o=>r(Math.floor(l(o))),ceil:o=>r(Math.ceil(l(o)))})),e}function zS(){const t=ine(PS()).domain([1,10]);return t.copy=()=>p0(t,zS()).base(t.base()),Vu.apply(t,arguments),t}const gm=new Date,_m=new Date;function ki(t,e,n,i){function l(r){return t(r=arguments.length===0?new Date:new Date(+r)),r}return l.floor=r=>(t(r=new Date(+r)),r),l.ceil=r=>(t(r=new Date(r-1)),e(r,1),t(r),r),l.round=r=>{const s=l(r),o=l.ceil(r);return r-s(e(r=new Date(+r),s==null?1:Math.floor(s)),r),l.range=(r,s,o)=>{const a=[];if(r=l.ceil(r),o=o==null?1:Math.floor(o),!(r0))return a;let u;do a.push(u=new Date(+r)),e(r,o),t(r);while(uki(s=>{if(s>=s)for(;t(s),!r(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!r(s););else for(;--o>=0;)for(;e(s,1),!r(s););}),n&&(l.count=(r,s)=>(gm.setTime(+r),_m.setTime(+s),t(gm),t(_m),Math.floor(n(gm,_m))),l.every=r=>(r=Math.floor(r),!isFinite(r)||!(r>0)?null:r>1?l.filter(i?s=>i(s)%r===0:s=>l.count(0,s)%r===0):l)),l}const Uc=ki(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Uc.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ki(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Uc);Uc.range;const Wr=1e3,Vl=Wr*60,qr=Vl*60,Zr=qr*24,b0=Zr*7,F4=Zr*30,pm=Zr*365,Go=ki(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Wr)},(t,e)=>(e-t)/Wr,t=>t.getUTCSeconds());Go.range;const v0=ki(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Wr)},(t,e)=>{t.setTime(+t+e*Vl)},(t,e)=>(e-t)/Vl,t=>t.getMinutes());v0.range;const lne=ki(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Vl)},(t,e)=>(e-t)/Vl,t=>t.getUTCMinutes());lne.range;const k0=ki(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Wr-t.getMinutes()*Vl)},(t,e)=>{t.setTime(+t+e*qr)},(t,e)=>(e-t)/qr,t=>t.getHours());k0.range;const rne=ki(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*qr)},(t,e)=>(e-t)/qr,t=>t.getUTCHours());rne.range;const Wu=ki(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Vl)/Zr,t=>t.getDate()-1);Wu.range;const w0=ki(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Zr,t=>t.getUTCDate()-1);w0.range;const sne=ki(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Zr,t=>Math.floor(t/Zr));sne.range;function uo(t){return ki(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Vl)/b0)}const Ed=uo(0),Fc=uo(1),one=uo(2),ane=uo(3),sa=uo(4),une=uo(5),fne=uo(6);Ed.range;Fc.range;one.range;ane.range;sa.range;une.range;fne.range;function fo(t){return ki(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/b0)}const HS=fo(0),Gc=fo(1),cne=fo(2),dne=fo(3),oa=fo(4),hne=fo(5),mne=fo(6);HS.range;Gc.range;cne.range;dne.range;oa.range;hne.range;mne.range;const y0=ki(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());y0.range;const gne=ki(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());gne.range;const Xr=ki(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Xr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ki(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Xr.range;const io=ki(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());io.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ki(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});io.range;function _ne(t,e,n,i,l,r){const s=[[Go,1,Wr],[Go,5,5*Wr],[Go,15,15*Wr],[Go,30,30*Wr],[r,1,Vl],[r,5,5*Vl],[r,15,15*Vl],[r,30,30*Vl],[l,1,qr],[l,3,3*qr],[l,6,6*qr],[l,12,12*qr],[i,1,Zr],[i,2,2*Zr],[n,1,b0],[e,1,F4],[e,3,3*F4],[t,1,pm]];function o(u,f,c){const d=fv).right(s,d);if(h===s.length)return t.every(xm(u/pm,f/pm,c));if(h===0)return Uc.every(Math.max(xm(u,f,c),1));const[g,_]=s[d/s[h-1][2]53)return null;"w"in ue||(ue.w=1),"Z"in ue?(Oe=vm(Ya(ue.y,0,1)),dt=Oe.getUTCDay(),Oe=dt>4||dt===0?Gc.ceil(Oe):Gc(Oe),Oe=w0.offset(Oe,(ue.V-1)*7),ue.y=Oe.getUTCFullYear(),ue.m=Oe.getUTCMonth(),ue.d=Oe.getUTCDate()+(ue.w+6)%7):(Oe=bm(Ya(ue.y,0,1)),dt=Oe.getDay(),Oe=dt>4||dt===0?Fc.ceil(Oe):Fc(Oe),Oe=Wu.offset(Oe,(ue.V-1)*7),ue.y=Oe.getFullYear(),ue.m=Oe.getMonth(),ue.d=Oe.getDate()+(ue.w+6)%7)}else("W"in ue||"U"in ue)&&("w"in ue||(ue.w="u"in ue?ue.u%7:"W"in ue?1:0),dt="Z"in ue?vm(Ya(ue.y,0,1)).getUTCDay():bm(Ya(ue.y,0,1)).getDay(),ue.m=0,ue.d="W"in ue?(ue.w+6)%7+ue.W*7-(dt+5)%7:ue.w+ue.U*7-(dt+6)%7);return"Z"in ue?(ue.H+=ue.Z/100|0,ue.M+=ue.Z%100,vm(ue)):bm(ue)}}function z(ge,ve,be,ue){for(var nt=0,Oe=ve.length,dt=be.length,yt,at;nt=dt)return-1;if(yt=ve.charCodeAt(nt++),yt===37){if(yt=ve.charAt(nt++),at=M[yt in G4?ve.charAt(nt++):yt],!at||(ue=at(ge,be,ue))<0)return-1}else if(yt!=be.charCodeAt(ue++))return-1}return ue}function W(ge,ve,be){var ue=u.exec(ve.slice(be));return ue?(ge.p=f.get(ue[0].toLowerCase()),be+ue[0].length):-1}function D(ge,ve,be){var ue=h.exec(ve.slice(be));return ue?(ge.w=g.get(ue[0].toLowerCase()),be+ue[0].length):-1}function G(ge,ve,be){var ue=c.exec(ve.slice(be));return ue?(ge.w=d.get(ue[0].toLowerCase()),be+ue[0].length):-1}function $(ge,ve,be){var ue=S.exec(ve.slice(be));return ue?(ge.m=A.get(ue[0].toLowerCase()),be+ue[0].length):-1}function j(ge,ve,be){var ue=_.exec(ve.slice(be));return ue?(ge.m=v.get(ue[0].toLowerCase()),be+ue[0].length):-1}function Q(ge,ve,be){return z(ge,e,ve,be)}function le(ge,ve,be){return z(ge,n,ve,be)}function oe(ge,ve,be){return z(ge,i,ve,be)}function X(ge){return s[ge.getDay()]}function de(ge){return r[ge.getDay()]}function re(ge){return a[ge.getMonth()]}function x(ge){return o[ge.getMonth()]}function me(ge){return l[+(ge.getHours()>=12)]}function ee(ge){return 1+~~(ge.getMonth()/3)}function ke(ge){return s[ge.getUTCDay()]}function pe(ge){return r[ge.getUTCDay()]}function Fe(ge){return a[ge.getUTCMonth()]}function Ve(ge){return o[ge.getUTCMonth()]}function Ee(ge){return l[+(ge.getUTCHours()>=12)]}function We(ge){return 1+~~(ge.getUTCMonth()/3)}return{format:function(ge){var ve=L(ge+="",C);return ve.toString=function(){return ge},ve},parse:function(ge){var ve=N(ge+="",!1);return ve.toString=function(){return ge},ve},utcFormat:function(ge){var ve=L(ge+="",I);return ve.toString=function(){return ge},ve},utcParse:function(ge){var ve=N(ge+="",!0);return ve.toString=function(){return ge},ve}}}var G4={"-":"",_:" ",0:"0"},Ei=/^\s*\d+/,kne=/^%/,wne=/[\\^$*+?|[\]().{}]/g;function dn(t,e,n){var i=t<0?"-":"",l=(i?-t:t)+"",r=l.length;return i+(r[e.toLowerCase(),n]))}function Tne(t,e,n){var i=Ei.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Sne(t,e,n){var i=Ei.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function Ene(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function Mne(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function One(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function V4(t,e,n){var i=Ei.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function W4(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Ane(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Cne(t,e,n){var i=Ei.exec(e.slice(n,n+1));return i?(t.q=i[0]*3-3,n+i[0].length):-1}function Lne(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function q4(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function Ine(t,e,n){var i=Ei.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function j4(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function Rne(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function Dne(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function Pne(t,e,n){var i=Ei.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function Nne(t,e,n){var i=Ei.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Bne(t,e,n){var i=kne.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function zne(t,e,n){var i=Ei.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Hne(t,e,n){var i=Ei.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Y4(t,e){return dn(t.getDate(),e,2)}function Une(t,e){return dn(t.getHours(),e,2)}function Fne(t,e){return dn(t.getHours()%12||12,e,2)}function Gne(t,e){return dn(1+Wu.count(Xr(t),t),e,3)}function US(t,e){return dn(t.getMilliseconds(),e,3)}function Vne(t,e){return US(t,e)+"000"}function Wne(t,e){return dn(t.getMonth()+1,e,2)}function qne(t,e){return dn(t.getMinutes(),e,2)}function jne(t,e){return dn(t.getSeconds(),e,2)}function Yne(t){var e=t.getDay();return e===0?7:e}function Zne(t,e){return dn(Ed.count(Xr(t)-1,t),e,2)}function FS(t){var e=t.getDay();return e>=4||e===0?sa(t):sa.ceil(t)}function Xne(t,e){return t=FS(t),dn(sa.count(Xr(t),t)+(Xr(t).getDay()===4),e,2)}function Kne(t){return t.getDay()}function $ne(t,e){return dn(Fc.count(Xr(t)-1,t),e,2)}function Jne(t,e){return dn(t.getFullYear()%100,e,2)}function Qne(t,e){return t=FS(t),dn(t.getFullYear()%100,e,2)}function xne(t,e){return dn(t.getFullYear()%1e4,e,4)}function eie(t,e){var n=t.getDay();return t=n>=4||n===0?sa(t):sa.ceil(t),dn(t.getFullYear()%1e4,e,4)}function tie(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+dn(e/60|0,"0",2)+dn(e%60,"0",2)}function Z4(t,e){return dn(t.getUTCDate(),e,2)}function nie(t,e){return dn(t.getUTCHours(),e,2)}function iie(t,e){return dn(t.getUTCHours()%12||12,e,2)}function lie(t,e){return dn(1+w0.count(io(t),t),e,3)}function GS(t,e){return dn(t.getUTCMilliseconds(),e,3)}function rie(t,e){return GS(t,e)+"000"}function sie(t,e){return dn(t.getUTCMonth()+1,e,2)}function oie(t,e){return dn(t.getUTCMinutes(),e,2)}function aie(t,e){return dn(t.getUTCSeconds(),e,2)}function uie(t){var e=t.getUTCDay();return e===0?7:e}function fie(t,e){return dn(HS.count(io(t)-1,t),e,2)}function VS(t){var e=t.getUTCDay();return e>=4||e===0?oa(t):oa.ceil(t)}function cie(t,e){return t=VS(t),dn(oa.count(io(t),t)+(io(t).getUTCDay()===4),e,2)}function die(t){return t.getUTCDay()}function hie(t,e){return dn(Gc.count(io(t)-1,t),e,2)}function mie(t,e){return dn(t.getUTCFullYear()%100,e,2)}function gie(t,e){return t=VS(t),dn(t.getUTCFullYear()%100,e,2)}function _ie(t,e){return dn(t.getUTCFullYear()%1e4,e,4)}function pie(t,e){var n=t.getUTCDay();return t=n>=4||n===0?oa(t):oa.ceil(t),dn(t.getUTCFullYear()%1e4,e,4)}function bie(){return"+0000"}function X4(){return"%"}function K4(t){return+t}function $4(t){return Math.floor(+t/1e3)}var No,WS;vie({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function vie(t){return No=vne(t),WS=No.format,No.parse,No.utcFormat,No.utcParse,No}function kie(t){return new Date(t)}function wie(t){return t instanceof Date?+t:+new Date(+t)}function qS(t,e,n,i,l,r,s,o,a,u){var f=NS(),c=f.invert,d=f.domain,h=u(".%L"),g=u(":%S"),_=u("%I:%M"),v=u("%I %p"),S=u("%a %d"),A=u("%b %d"),C=u("%B"),I=u("%Y");function M(L){return(a(L)1?0:t<-1?Tu:Math.acos(t)}function Q4(t){return t>=1?Vc:t<=-1?-Vc:Math.asin(t)}function T0(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);e=i}return t},()=>new Dte(e)}function Eie(t){return t.innerRadius}function Mie(t){return t.outerRadius}function Oie(t){return t.startAngle}function Aie(t){return t.endAngle}function Cie(t){return t&&t.padAngle}function Lie(t,e,n,i,l,r,s,o){var a=n-t,u=i-e,f=s-l,c=o-r,d=c*a-f*u;if(!(d*dQ*Q+le*le&&(z=D,W=G),{cx:z,cy:W,x01:-f,y01:-c,x11:z*(l/M-1),y11:W*(l/M-1)}}function Iie(){var t=Eie,e=Mie,n=kn(0),i=null,l=Oie,r=Aie,s=Cie,o=null,a=T0(u);function u(){var f,c,d=+t.apply(this,arguments),h=+e.apply(this,arguments),g=l.apply(this,arguments)-Vc,_=r.apply(this,arguments)-Vc,v=J4(_-g),S=_>g;if(o||(o=f=a()),hGi))o.moveTo(0,0);else if(v>Tie-Gi)o.moveTo(h*Gs(g),h*_r(g)),o.arc(0,0,h,g,_,!S),d>Gi&&(o.moveTo(d*Gs(_),d*_r(_)),o.arc(0,0,d,_,g,S));else{var A=g,C=_,I=g,M=_,L=v,N=v,z=s.apply(this,arguments)/2,W=z>Gi&&(i?+i.apply(this,arguments):Vo(d*d+h*h)),D=km(J4(h-d)/2,+n.apply(this,arguments)),G=D,$=D,j,Q;if(W>Gi){var le=Q4(W/d*_r(z)),oe=Q4(W/h*_r(z));(L-=le*2)>Gi?(le*=S?1:-1,I+=le,M-=le):(L=0,I=M=(g+_)/2),(N-=oe*2)>Gi?(oe*=S?1:-1,A+=oe,C-=oe):(N=0,A=C=(g+_)/2)}var X=h*Gs(A),de=h*_r(A),re=d*Gs(M),x=d*_r(M);if(D>Gi){var me=h*Gs(C),ee=h*_r(C),ke=d*Gs(I),pe=d*_r(I),Fe;if(vGi?$>Gi?(j=Xf(ke,pe,X,de,h,$,S),Q=Xf(me,ee,re,x,h,$,S),o.moveTo(j.cx+j.x01,j.cy+j.y01),$Gi)||!(L>Gi)?o.lineTo(re,x):G>Gi?(j=Xf(re,x,me,ee,d,-G,S),Q=Xf(X,de,ke,pe,d,-G,S),o.lineTo(j.cx+j.x01,j.cy+j.y01),G=h;--g)o.point(C[g],I[g]);o.lineEnd(),o.areaEnd()}S&&(C[d]=+t(v,d,c),I[d]=+e(v,d,c),o.point(i?+i(v,d,c):C[d],n?+n(v,d,c):I[d]))}if(A)return o=null,A+""||null}function f(){return M0().defined(l).curve(s).context(r)}return u.x=function(c){return arguments.length?(t=typeof c=="function"?c:kn(+c),i=null,u):t},u.x0=function(c){return arguments.length?(t=typeof c=="function"?c:kn(+c),u):t},u.x1=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:kn(+c),u):i},u.y=function(c){return arguments.length?(e=typeof c=="function"?c:kn(+c),n=null,u):e},u.y0=function(c){return arguments.length?(e=typeof c=="function"?c:kn(+c),u):e},u.y1=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:kn(+c),u):n},u.lineX0=u.lineY0=function(){return f().x(t).y(e)},u.lineY1=function(){return f().x(t).y(n)},u.lineX1=function(){return f().x(i).y(e)},u.defined=function(c){return arguments.length?(l=typeof c=="function"?c:kn(!!c),u):l},u.curve=function(c){return arguments.length?(s=c,r!=null&&(o=s(r)),u):s},u.context=function(c){return arguments.length?(c==null?r=o=null:o=s(r=c),u):r},u}function ys(){}function Wc(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Md(t){this._context=t}Md.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Wc(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Wc(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Rie(t){return new Md(t)}function KS(t){this._context=t}KS.prototype={areaStart:ys,areaEnd:ys,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Wc(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Die(t){return new KS(t)}function $S(t){this._context=t}$S.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Wc(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Pie(t){return new $S(t)}function JS(t,e){this._basis=new Md(t),this._beta=e}JS.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i=t[0],l=e[0],r=t[n]-i,s=e[n]-l,o=-1,a;++o<=n;)a=o/n,this._basis.point(this._beta*t[o]+(1-this._beta)*(i+a*r),this._beta*e[o]+(1-this._beta)*(l+a*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Nie=function t(e){function n(i){return e===1?new Md(i):new JS(i,e)}return n.beta=function(i){return t(+i)},n}(.85);function qc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function A0(t,e){this._context=t,this._k=(1-e)/6}A0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:qc(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:qc(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Bie=function t(e){function n(i){return new A0(i,e)}return n.tension=function(i){return t(+i)},n}(0);function C0(t,e){this._context=t,this._k=(1-e)/6}C0.prototype={areaStart:ys,areaEnd:ys,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:qc(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const zie=function t(e){function n(i){return new C0(i,e)}return n.tension=function(i){return t(+i)},n}(0);function L0(t,e){this._context=t,this._k=(1-e)/6}L0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:qc(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Hie=function t(e){function n(i){return new L0(i,e)}return n.tension=function(i){return t(+i)},n}(0);function I0(t,e,n){var i=t._x1,l=t._y1,r=t._x2,s=t._y2;if(t._l01_a>Gi){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,a=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/a,l=(l*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/a}if(t._l23_a>Gi){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);r=(r*u+t._x1*t._l23_2a-e*t._l12_2a)/f,s=(s*u+t._y1*t._l23_2a-n*t._l12_2a)/f}t._context.bezierCurveTo(i,l,r,s,t._x2,t._y2)}function QS(t,e){this._context=t,this._alpha=e}QS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:I0(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Uie=function t(e){function n(i){return e?new QS(i,e):new A0(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function xS(t,e){this._context=t,this._alpha=e}xS.prototype={areaStart:ys,areaEnd:ys,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:I0(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Fie=function t(e){function n(i){return e?new xS(i,e):new C0(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function eE(t,e){this._context=t,this._alpha=e}eE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:I0(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Gie=function t(e){function n(i){return e?new eE(i,e):new L0(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function tE(t){this._context=t}tE.prototype={areaStart:ys,areaEnd:ys,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Vie(t){return new tE(t)}function x4(t){return t<0?-1:1}function ew(t,e,n){var i=t._x1-t._x0,l=e-t._x1,r=(t._y1-t._y0)/(i||l<0&&-0),s=(n-t._y1)/(l||i<0&&-0),o=(r*l+s*i)/(i+l);return(x4(r)+x4(s))*Math.min(Math.abs(r),Math.abs(s),.5*Math.abs(o))||0}function tw(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function wm(t,e,n){var i=t._x0,l=t._y0,r=t._x1,s=t._y1,o=(r-i)/3;t._context.bezierCurveTo(i+o,l+o*e,r-o,s-o*n,r,s)}function jc(t){this._context=t}jc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:wm(this,this._t0,tw(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,wm(this,tw(this,n=ew(this,t,e)),n);break;default:wm(this,this._t0,n=ew(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function nE(t){this._context=new iE(t)}(nE.prototype=Object.create(jc.prototype)).point=function(t,e){jc.prototype.point.call(this,e,t)};function iE(t){this._context=t}iE.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,l,r){this._context.bezierCurveTo(e,t,i,n,r,l)}};function Wie(t){return new jc(t)}function qie(t){return new nE(t)}function lE(t){this._context=t}lE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var i=nw(t),l=nw(e),r=0,s=1;s=0;--e)l[e]=(s[e]-l[e+1])/r[e];for(r[n-1]=(t[n]+l[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function Yie(t){return new Od(t,.5)}function Zie(t){return new Od(t,0)}function Xie(t){return new Od(t,1)}function iw(t,e){if((s=t.length)>1)for(var n=1,i,l,r=t[e[0]],s,o=r.length;n=0;)n[e]=e;return n}function Kie(t,e){return t[e]}function $ie(t){const e=[];return e.key=t,e}function ym(){var t=kn([]),e=lw,n=iw,i=Kie;function l(r){var s=Array.from(t.apply(this,arguments),$ie),o,a=s.length,u=-1,f;for(const c of r)for(o=0,++u;o0)for(var n,i=0,l,r,s,o,a,u=t[e[0]].length;i0?(l[0]=s,l[1]=s+=r):r<0?(l[1]=o,l[0]=o+=r):(l[0]=0,l[1]=r)}function lu(t,e,n){this.k=t,this.x=e,this.y=n}lu.prototype={constructor:lu,scale:function(t){return t===1?this:new lu(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new lu(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};lu.prototype;function Tm(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,i=t.formats[n]||t.formats[t.defaultWidth];return i}}function Ka(t){return function(e,n){var i=n!=null&&n.context?String(n.context):"standalone",l;if(i==="formatting"&&t.formattingValues){var r=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):r;l=t.formattingValues[s]||t.formattingValues[r]}else{var o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;l=t.values[a]||t.values[o]}var u=t.argumentCallback?t.argumentCallback(e):e;return l[u]}}function $a(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.width,l=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],r=e.match(l);if(!r)return null;var s=r[0],o=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],a=Array.isArray(o)?xie(o,function(c){return c.test(s)}):Qie(o,function(c){return c.test(s)}),u;u=t.valueCallback?t.valueCallback(a):a,u=n.valueCallback?n.valueCallback(u):u;var f=e.slice(s.length);return{value:u,rest:f}}}function Qie(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function xie(t,e){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},i=e.match(t.matchPattern);if(!i)return null;var l=i[0],r=e.match(t.parsePattern);if(!r)return null;var s=t.valueCallback?t.valueCallback(r[0]):r[0];s=n.valueCallback?n.valueCallback(s):s;var o=e.slice(l.length);return{value:s,rest:o}}}function Yc(t){"@babel/helpers - typeof";return Yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yc(t)}function vi(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Qt(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function gn(t){Qt(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||Yc(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Ad(t,e){Qt(2,arguments);var n=gn(t).getTime(),i=vi(e);return new Date(n+i)}var tle={};function Cd(){return tle}function m1(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function nle(t){return Qt(1,arguments),t instanceof Date||Yc(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function ile(t){if(Qt(1,arguments),!nle(t)&&typeof t!="number")return!1;var e=gn(t);return!isNaN(Number(e))}function lle(t,e){Qt(2,arguments);var n=vi(e);return Ad(t,-n)}var rle=864e5;function sle(t){Qt(1,arguments);var e=gn(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var i=e.getTime(),l=n-i;return Math.floor(l/rle)+1}function Zc(t){Qt(1,arguments);var e=1,n=gn(t),i=n.getUTCDay(),l=(i=l.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function ole(t){Qt(1,arguments);var e=rE(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var i=Zc(n);return i}var ale=6048e5;function ule(t){Qt(1,arguments);var e=gn(t),n=Zc(e).getTime()-ole(e).getTime();return Math.round(n/ale)+1}function Xc(t,e){var n,i,l,r,s,o,a,u;Qt(1,arguments);var f=Cd(),c=vi((n=(i=(l=(r=e==null?void 0:e.weekStartsOn)!==null&&r!==void 0?r:e==null||(s=e.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&l!==void 0?l:f.weekStartsOn)!==null&&i!==void 0?i:(a=f.locale)===null||a===void 0||(u=a.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=gn(t),h=d.getUTCDay(),g=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var g=new Date(0);g.setUTCFullYear(c+1,0,h),g.setUTCHours(0,0,0,0);var _=Xc(g,e),v=new Date(0);v.setUTCFullYear(c,0,h),v.setUTCHours(0,0,0,0);var S=Xc(v,e);return f.getTime()>=_.getTime()?c+1:f.getTime()>=S.getTime()?c:c-1}function fle(t,e){var n,i,l,r,s,o,a,u;Qt(1,arguments);var f=Cd(),c=vi((n=(i=(l=(r=e==null?void 0:e.firstWeekContainsDate)!==null&&r!==void 0?r:e==null||(s=e.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&l!==void 0?l:f.firstWeekContainsDate)!==null&&i!==void 0?i:(a=f.locale)===null||a===void 0||(u=a.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=sE(t,e),h=new Date(0);h.setUTCFullYear(d,0,c),h.setUTCHours(0,0,0,0);var g=Xc(h,e);return g}var cle=6048e5;function dle(t,e){Qt(1,arguments);var n=gn(t),i=Xc(n,e).getTime()-fle(n,e).getTime();return Math.round(i/cle)+1}function On(t,e){for(var n=t<0?"-":"",i=Math.abs(t).toString();i.length0?n:1-n;return On(e==="yy"?i%100:i,e.length)},M:function(t,e){var n=t.getUTCMonth();return e==="M"?String(n+1):On(n+1,2)},d:function(t,e){return On(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(t,e){return On(t.getUTCHours()%12||12,e.length)},H:function(t,e){return On(t.getUTCHours(),e.length)},m:function(t,e){return On(t.getUTCMinutes(),e.length)},s:function(t,e){return On(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,i=t.getUTCMilliseconds(),l=Math.floor(i*Math.pow(10,n-3));return On(l,e.length)}};const hs=hle;var Bo={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},mle={G:function(t,e,n){var i=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){var i=t.getUTCFullYear(),l=i>0?i:1-i;return n.ordinalNumber(l,{unit:"year"})}return hs.y(t,e)},Y:function(t,e,n,i){var l=sE(t,i),r=l>0?l:1-l;if(e==="YY"){var s=r%100;return On(s,2)}return e==="Yo"?n.ordinalNumber(r,{unit:"year"}):On(r,e.length)},R:function(t,e){var n=rE(t);return On(n,e.length)},u:function(t,e){var n=t.getUTCFullYear();return On(n,e.length)},Q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return On(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return On(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){var i=t.getUTCMonth();switch(e){case"M":case"MM":return hs.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){var i=t.getUTCMonth();switch(e){case"L":return String(i+1);case"LL":return On(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){var l=dle(t,i);return e==="wo"?n.ordinalNumber(l,{unit:"week"}):On(l,e.length)},I:function(t,e,n){var i=ule(t);return e==="Io"?n.ordinalNumber(i,{unit:"week"}):On(i,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):hs.d(t,e)},D:function(t,e,n){var i=sle(t);return e==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):On(i,e.length)},E:function(t,e,n){var i=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){var l=t.getUTCDay(),r=(l-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return On(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(l,{width:"short",context:"formatting"});case"eeee":default:return n.day(l,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){var l=t.getUTCDay(),r=(l-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return On(r,e.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(l,{width:"narrow",context:"standalone"});case"cccccc":return n.day(l,{width:"short",context:"standalone"});case"cccc":default:return n.day(l,{width:"wide",context:"standalone"})}},i:function(t,e,n){var i=t.getUTCDay(),l=i===0?7:i;switch(e){case"i":return String(l);case"ii":return On(l,e.length);case"io":return n.ordinalNumber(l,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){var i=t.getUTCHours(),l=i/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(t,e,n){var i=t.getUTCHours(),l;switch(i===12?l=Bo.noon:i===0?l=Bo.midnight:l=i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(t,e,n){var i=t.getUTCHours(),l;switch(i>=17?l=Bo.evening:i>=12?l=Bo.afternoon:i>=4?l=Bo.morning:l=Bo.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return hs.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):hs.H(t,e)},K:function(t,e,n){var i=t.getUTCHours()%12;return e==="Ko"?n.ordinalNumber(i,{unit:"hour"}):On(i,e.length)},k:function(t,e,n){var i=t.getUTCHours();return i===0&&(i=24),e==="ko"?n.ordinalNumber(i,{unit:"hour"}):On(i,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):hs.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):hs.s(t,e)},S:function(t,e){return hs.S(t,e)},X:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return sw(r);case"XXXX":case"XX":return Ws(r);case"XXXXX":case"XXX":default:return Ws(r,":")}},x:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();switch(e){case"x":return sw(r);case"xxxx":case"xx":return Ws(r);case"xxxxx":case"xxx":default:return Ws(r,":")}},O:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+rw(r,":");case"OOOO":default:return"GMT"+Ws(r,":")}},z:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+rw(r,":");case"zzzz":default:return"GMT"+Ws(r,":")}},t:function(t,e,n,i){var l=i._originalDate||t,r=Math.floor(l.getTime()/1e3);return On(r,e.length)},T:function(t,e,n,i){var l=i._originalDate||t,r=l.getTime();return On(r,e.length)}};function rw(t,e){var n=t>0?"-":"+",i=Math.abs(t),l=Math.floor(i/60),r=i%60;if(r===0)return n+String(l);var s=e||"";return n+String(l)+s+On(r,2)}function sw(t,e){if(t%60===0){var n=t>0?"-":"+";return n+On(Math.abs(t)/60,2)}return Ws(t,e)}function Ws(t,e){var n=e||"",i=t>0?"-":"+",l=Math.abs(t),r=On(Math.floor(l/60),2),s=On(l%60,2);return i+r+n+s}const gle=mle;var ow=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},oE=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},_le=function(t,e){var n=t.match(/(P+)(p+)?/)||[],i=n[1],l=n[2];if(!l)return ow(t,e);var r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",ow(i,e)).replace("{{time}}",oE(l,e))},ple={p:oE,P:_le};const ble=ple;var vle=["D","DD"],kle=["YY","YYYY"];function wle(t){return vle.indexOf(t)!==-1}function yle(t){return kle.indexOf(t)!==-1}function aw(t,e,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Tle={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Sle=function(t,e,n){var i,l=Tle[t];return typeof l=="string"?i=l:e===1?i=l.one:i=l.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};const Ele=Sle;var Mle={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ole={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ale={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cle={date:Tm({formats:Mle,defaultWidth:"full"}),time:Tm({formats:Ole,defaultWidth:"full"}),dateTime:Tm({formats:Ale,defaultWidth:"full"})};const Lle=Cle;var Ile={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rle=function(t,e,n,i){return Ile[t]};const Dle=Rle;var Ple={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Nle={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ble={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},zle={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Hle={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ule={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Fle=function(t,e){var n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Gle={ordinalNumber:Fle,era:Ka({values:Ple,defaultWidth:"wide"}),quarter:Ka({values:Nle,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Ka({values:Ble,defaultWidth:"wide"}),day:Ka({values:zle,defaultWidth:"wide"}),dayPeriod:Ka({values:Hle,defaultWidth:"wide",formattingValues:Ule,defaultFormattingWidth:"wide"})};const Vle=Gle;var Wle=/^(\d+)(th|st|nd|rd)?/i,qle=/\d+/i,jle={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Yle={any:[/^b/i,/^(a|c)/i]},Zle={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Xle={any:[/1/i,/2/i,/3/i,/4/i]},Kle={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},$le={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Jle={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Qle={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},xle={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ere={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},tre={ordinalNumber:ele({matchPattern:Wle,parsePattern:qle,valueCallback:function(t){return parseInt(t,10)}}),era:$a({matchPatterns:jle,defaultMatchWidth:"wide",parsePatterns:Yle,defaultParseWidth:"any"}),quarter:$a({matchPatterns:Zle,defaultMatchWidth:"wide",parsePatterns:Xle,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$a({matchPatterns:Kle,defaultMatchWidth:"wide",parsePatterns:$le,defaultParseWidth:"any"}),day:$a({matchPatterns:Jle,defaultMatchWidth:"wide",parsePatterns:Qle,defaultParseWidth:"any"}),dayPeriod:$a({matchPatterns:xle,defaultMatchWidth:"any",parsePatterns:ere,defaultParseWidth:"any"})};const nre=tre;var ire={code:"en-US",formatDistance:Ele,formatLong:Lle,formatRelative:Dle,localize:Vle,match:nre,options:{weekStartsOn:0,firstWeekContainsDate:1}};const aE=ire;var lre=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rre=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sre=/^'([^]*?)'?$/,ore=/''/g,are=/[a-zA-Z]/;function aa(t,e,n){var i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I;Qt(2,arguments);var M=String(e),L=Cd(),N=(i=(l=n==null?void 0:n.locale)!==null&&l!==void 0?l:L.locale)!==null&&i!==void 0?i:aE,z=vi((r=(s=(o=(a=n==null?void 0:n.firstWeekContainsDate)!==null&&a!==void 0?a:n==null||(u=n.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&o!==void 0?o:L.firstWeekContainsDate)!==null&&s!==void 0?s:(c=L.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&r!==void 0?r:1);if(!(z>=1&&z<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var W=vi((h=(g=(_=(v=n==null?void 0:n.weekStartsOn)!==null&&v!==void 0?v:n==null||(S=n.locale)===null||S===void 0||(A=S.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&_!==void 0?_:L.weekStartsOn)!==null&&g!==void 0?g:(C=L.locale)===null||C===void 0||(I=C.options)===null||I===void 0?void 0:I.weekStartsOn)!==null&&h!==void 0?h:0);if(!(W>=0&&W<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!N.localize)throw new RangeError("locale must contain localize property");if(!N.formatLong)throw new RangeError("locale must contain formatLong property");var D=gn(t);if(!ile(D))throw new RangeError("Invalid time value");var G=m1(D),$=lle(D,G),j={firstWeekContainsDate:z,weekStartsOn:W,locale:N,_originalDate:D},Q=M.match(rre).map(function(le){var oe=le[0];if(oe==="p"||oe==="P"){var X=ble[oe];return X(le,N.formatLong)}return le}).join("").match(lre).map(function(le){if(le==="''")return"'";var oe=le[0];if(oe==="'")return ure(le);var X=gle[oe];if(X)return!(n!=null&&n.useAdditionalWeekYearTokens)&&yle(le)&&aw(le,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&wle(le)&&aw(le,e,String(t)),X($,le,N.localize,j);if(oe.match(are))throw new RangeError("Format string contains an unescaped latin alphabet character `"+oe+"`");return le}).join("");return Q}function ure(t){var e=t.match(sre);return e?e[1].replace(ore,"'"):t}var fre=typeof global=="object"&&global&&global.Object===Object&&global;const uE=fre;var cre=typeof self=="object"&&self&&self.Object===Object&&self,dre=uE||cre||Function("return this")();const ar=dre;var hre=ar.Symbol;const Yl=hre;var fE=Object.prototype,mre=fE.hasOwnProperty,gre=fE.toString,Ja=Yl?Yl.toStringTag:void 0;function _re(t){var e=mre.call(t,Ja),n=t[Ja];try{t[Ja]=void 0;var i=!0}catch{}var l=gre.call(t);return i&&(e?t[Ja]=n:delete t[Ja]),l}var pre=Object.prototype,bre=pre.toString;function vre(t){return bre.call(t)}var kre="[object Null]",wre="[object Undefined]",uw=Yl?Yl.toStringTag:void 0;function co(t){return t==null?t===void 0?wre:kre:uw&&uw in Object(t)?_re(t):vre(t)}function yr(t){return t!=null&&typeof t=="object"}var yre="[object Symbol]";function Ld(t){return typeof t=="symbol"||yr(t)&&co(t)==yre}function Tre(t,e){for(var n=-1,i=t==null?0:t.length,l=Array(i);++n0){if(++e>=Xre)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Qre(t){return function(){return t}}var xre=function(){try{var t=mo(Object,"defineProperty");return t({},"",{}),t}catch{}}();const Kc=xre;var ese=Kc?function(t,e){return Kc(t,"toString",{configurable:!0,enumerable:!1,value:Qre(e),writable:!0})}:R0;const tse=ese;var nse=Jre(tse);const ise=nse;function lse(t,e){for(var n=-1,i=t==null?0:t.length;++n-1}var fse=9007199254740991,cse=/^(?:0|[1-9]\d*)$/;function P0(t,e){var n=typeof t;return e=e??fse,!!e&&(n=="number"||n!="symbol"&&cse.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=gse}function va(t){return t!=null&&N0(t.length)&&!D0(t)}function gE(t,e,n){if(!Zl(n))return!1;var i=typeof e;return(i=="number"?va(n)&&P0(e,n.length):i=="string"&&e in n)?qu(n[e],t):!1}function _se(t){return mE(function(e,n){var i=-1,l=n.length,r=l>1?n[l-1]:void 0,s=l>2?n[2]:void 0;for(r=t.length>3&&typeof r=="function"?(l--,r):void 0,s&&gE(n[0],n[1],s)&&(r=l<3?void 0:r,l=1),e=Object(e);++i-1}function Ioe(t,e){var n=this.__data__,i=Pd(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}function $r(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0&&n(o)?e>1?G0(o,e-1,n,i,l):F0(l,o):i||(l[l.length]=o)}return l}var Koe=kE(Object.getPrototypeOf,Object);const V0=Koe;var $oe="[object Object]",Joe=Function.prototype,Qoe=Object.prototype,SE=Joe.toString,xoe=Qoe.hasOwnProperty,eae=SE.call(Object);function tae(t){if(!yr(t)||co(t)!=$oe)return!1;var e=V0(t);if(e===null)return!0;var n=xoe.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&SE.call(n)==eae}function nae(){this.__data__=new $r,this.size=0}function iae(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function lae(t){return this.__data__.get(t)}function rae(t){return this.__data__.has(t)}var sae=200;function oae(t,e){var n=this.__data__;if(n instanceof $r){var i=n.__data__;if(!Eu||i.lengtho))return!1;var u=r.get(t),f=r.get(e);if(u&&f)return u==e&&f==t;var c=-1,d=!0,h=n&Wue?new Mu:void 0;for(r.set(t,e),r.set(e,t);++c=Gfe){var u=e?null:Ffe(t);if(u)return j0(u);s=!1,l=BE,a=new Mu}else a=e?[]:o;e:for(;++i{const e=Math.min(t.width,t.height);return[e*3/400,e*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:Ti.RADIUS,name:"Radius"}]}}),sce=en({},Ku,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Ti.AREA,name:"Poor area"},{type:Ti.AREA,name:"Satisfactory area"},{type:Ti.AREA,name:"Great area"},{type:Ti.QUARTILE,name:"Quartiles"}]}}),oce=en({},ro,{bars:{dividerSize:1.5},timeScale:en(Hd,{addSpaceOnEdges:0})}),ace=en({},ji,{tooltip:en({},WE,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:t=>{const e=Math.min(t.width,t.height);return[e*20/400,e*75/400]},wordMapsTo:"word"}}),XE=en({},ji,{pie:{labels:{formatter:null,enabled:!0},alignment:jl.LEFT,sortFunction:null,valueMapsTo:"value"}}),uce=en({},ji,{legend:{enabled:!1},gauge:{type:Q8.SEMI,arcWidth:16,deltaArrow:{size:t=>t/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:t=>t/8,valueFontSize:t=>t/2.5,numberFormatter:t=>Number(t.toFixed(2))%1!==0?t.toFixed(2).toLocaleString():t.toFixed().toLocaleString(),alignment:jl.LEFT}}),fce=en({},XE,{donut:{center:{numberFontSize:t=>`${Math.min(t/100*24,24)}px`,titleFontSize:t=>`${Math.min(t/100*15,15)}px`,titleYPosition:t=>Math.min(t/80*20,20),numberFormatter:t=>Math.floor(t).toLocaleString()},alignment:jl.LEFT}}),KE=en({},ji,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),cce=en({},KE,{legend:{enabled:!0}}),dce=en({},ji,{radar:{axes:{angle:"key",value:"value"},alignment:jl.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:t=>t??"N/A"}}),hce=en({},ro,{comboChartTypes:[]}),mce=en({tree:{type:J8.TREE}},ji,{}),gce=en({},ji,{data:en(ji.data,{groupMapsTo:"name"})}),_ce=en({},ji,qfe,{data:en(ji.data,{groupMapsTo:"name"})}),pce=en({},ji,{alluvial:{data:en(ji.data,{groupMapsTo:"source"}),nodeAlignment:jl.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),bce=en({},ji,{axes:qE,heatmap:{divider:{state:x8.AUTO},colorLegend:{type:"linear"}}}),vce=en({},jE,{choropleth:{colorLegend:{type:"linear"}}}),kce={alluvialChart:pce,areaChart:ZE,axisChart:Ku,boxplotChart:nce,bubbleChart:rce,bulletChart:sce,chart:ji,circlePackChart:_ce,choroplethChart:vce,comboChart:hce,donutChart:fce,gaugeChart:uce,groupedBarChart:ece,heatmapChart:bce,histogramChart:oce,lineChart:YE,lollipopChart:ice,meterChart:KE,pieChart:XE,proportionalMeterChart:cce,radarChart:dce,scatterChart:Z0,simpleBarChart:xfe,stackedAreaChart:lce,stackedBarChart:tce,thematicChart:jE,treeChart:mce,treemapChart:gce,wordCloudChart:ace};function wce(t,e,n){let i=null;return function(...l){const r=this;r.mousePosition=eo(l[0],n),clearTimeout(i),i=setTimeout(function(){t.apply(r,l)},e)}}function yce(t,e){var n;const i=Xu(t),l=Object.keys(e.axes||{});(n=e==null?void 0:e.toolbar)!=null&&n.controls&&delete i.toolbar.controls,l.length===0&&delete i.axes;for(const r in i.axes)if(l.includes(r)){const s=e.axes[r];if((s.primary||s.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format"),s.mapsTo==null){const a=s.scaleType;a==null?s.mapsTo="value":a===Nt.TIME?s.mapsTo="date":a===Nt.LABELS&&(s.mapsTo="key")}}else delete i.axes[r];return $E(i,e),en(i,e)}function Ur(t){if(!t)return;const e=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=t.getAttribute("transform").match(e);if(!n)return null;if(n[0]){const i=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:i[0],ty:i[1]}}return null}function Au(t,e,n){if(n>t.length)return t;if(e===rr.MID_LINE)return t.substr(0,n/2)+"..."+t.substr(-n/2);if(e===rr.FRONT_LINE)return"..."+t.substr(-n);if(e===rr.END_LINE)return t.substr(0,n)+"..."}function $E(t,e){const n=Te(t,"legend","additionalItems"),i=Te(e,"legend","additionalItems");if(n&&i){const l=i.map(o=>o.type),r=n.map(o=>o.type),s=Xfe.filter(o=>r.includes(o.type)&&!l.includes(o.type));t.legend.additionalItems=s,e.legend.additionalItems=Wfe(s,i,"name")}}const Te=(t,...e)=>{let n=t;if(n){for(const i of e)if(n[i]!==null&&n[i]!==void 0)n=n[i];else return null;return n}return null},JE=(t,e)=>e===hl.HORIZONTAL?{y0:t.x0,y1:t.x1,x0:t.y0,x1:t.y1}:t,X0=(t,e)=>{const{x0:n,x1:i,y0:l,y1:r}=JE(t,e);return`M${n},${l}L${n},${r}L${i},${r}L${i},${l}L${n},${l}`};function Ko(t,e,n){return n===hl.VERTICAL?[t,e]:[e,t]}var QE=(t=>(t["15seconds"]="15seconds",t.minute="minute",t["30minutes"]="30minutes",t.hourly="hourly",t.daily="daily",t.weekly="weekly",t.monthly="monthly",t.quarterly="quarterly",t.yearly="yearly",t))(QE||{});const Am=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function xE(t,e,n,i,l){const r=e===0,s=Number(aa(new Date(t),"c"))===2,o=Number(aa(new Date(t),"q"))===1,a=e!==0?n[e-1]:null;switch(i){case"15seconds":return r||$f(t)||xa(t,a)||ms(t);case"minute":return r||$f(t)||xa(t,a)||ms(t);case"30minutes":return r||$f(t)||xa(t,a)||ms(t);case"hourly":return r||$f(t)||xa(t,a)||ms(t);case"daily":return l?r||s||ms(t):r||xa(t,a)||ms(t);case"weekly":return r||s||ms(t);case"monthly":return r||ms(t);case"quarterly":return r||o;case"yearly":return!1;default:throw new Error(`${i} is not a valid time interval.`)}}function y1(t,e,n,i,l){const r=l.showDayName,s=i==="daily"&&r?"weekly":i,o=new Date(t),a=Te(l,"timeIntervalFormats")[s],u=Te(a,"primary"),f=Te(a,"secondary");let c=xE(t,e,n,i,r)?u:f;i==="15seconds"&&o.getMilliseconds()!==0&&(c=c.replace("pp","h:mm:ss.SSS a"));const d=l.localeObject;return aa(o,c,{locale:d})}function Jc(t){const e=new Date(t);return{M:e.getMonth()+1,d:e.getDate(),H:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}function Tce(t){if(t)return t.slice(1).map((e,n)=>e-t[n])}function Sce(t){const e=Am.reduce((n,[,i],l)=>{const r=Am[n][1],s=Math.abs(r-t),o=Math.abs(i-t);return s(t.GRAPHICS_DOCUMENT="graphics-document",t.GRAPHICS_OBJECT="graphics-object",t.GRAPHICS_SYMBOL="graphics-symbol",t.GROUP="group",t.DOCUMENT="document",t.CHECKBOX="checkbox",t.BUTTON="button",t.MENU="menu",t.MENU_ITEM="menuitem",t.IMG="img",t))(fi||{});function Ece(t,e){return t&&FE(t,e,Yu)}function Mce(t,e){return function(n,i){if(n==null)return n;if(!va(n))return t(n,i);for(var l=n.length,r=e?l:-1,s=Object(n);(e?r--:++re.includes(o[r]))),s&&Object.keys(s).forEach(o=>{const a=s[o].mapsTo,u=s[o].scaleType;if((u===Nt.LINEAR||u===Nt.LOG)&&(i=i.map(f=>({...f,[a]:f[a]===null?f[a]:Number(f[a])}))),a&&s[o].domain)if(u===Nt.LABELS)i=i.filter(f=>s[o].domain.includes(f[a]));else{const[f,c]=s[o].domain;i=i.filter(d=>!(a in d)||d[a]>=f&&d[a]<=c)}}),i.filter(o=>l.find(a=>a.name===o[r]))}getDisplayData(e){if(!this.get("data"))return null;const{ACTIVE:n}=Ci.items.status,i=this.getDataGroups(e),{groupMapsTo:l}=this.getOptions().data;return this.getAllDataFromDomain(e).filter(r=>i.find(s=>s.name===r[l]&&s.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(e){const n=this.sanitize(Xu(e)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),n}getDataGroups(e){return Te(this.getOptions(),"data","loading")?[]:e?this.get("dataGroups").filter(n=>e.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(e){const{ACTIVE:n}=Ci.items.status;return this.getDataGroups(e).filter(i=>i.status===n)}getDataGroupNames(e){return this.getDataGroups(e).map(n=>n.name)}getActiveDataGroupNames(e){return this.getActiveDataGroups(e).map(n=>n.name)}aggregateBinDataByGroup(e){return Nce(e,"group")}getBinConfigurations(){const e=this.getDisplayData(),n=this.getOptions(),i=this.services.cartesianScales.getMainXAxisPosition(),l=this.services.cartesianScales.getDomainIdentifier(),r=n.axes[i],{groupMapsTo:s}=n.data,{bins:o=Yfe.defaultBins}=r,a=Array.isArray(o),u=VJ().value(h=>h[l]).thresholds(o)(e);if(a)u[u.length-1].x1=o[o.length-1];else{const h=u[0].x1-u[0].x0;u[u.length-1].x1=+u[u.length-1].x0+h}const f=a?[o[0],o[o.length-1]]:[u[0].x0,u[u.length-1].x1],c=Array.from(new Set(e.map(h=>h[s]))),d=[];return u.forEach(h=>{const g=`${h.x0}-${h.x1}`,_=this.aggregateBinDataByGroup(h);c.forEach(v=>{d.push({group:v,key:g,value:_[v]||0,bin:h.x0})})}),{bins:u,binsDomain:f}}getBinnedStackedData(){const e=this.getOptions(),{groupMapsTo:n}=e.data,i=this.getActiveDataGroupNames(),{bins:l}=this.getBinConfigurations(),r=this.getDataValuesGroupedByKeys({bins:l});return ym().keys(i)(r).map((s,o)=>Object.keys(s).filter(a=>!isNaN(a)).map(a=>{const u=s[a];return u[n]=i[o],u}))}getGroupedData(e){const n=this.getDisplayData(e),i={},{groupMapsTo:l}=this.getOptions().data;return n.map(r=>{const s=r[l];i[s]!==null&&i[s]!==void 0?i[s].push(r):i[s]=[r]}),Object.keys(i).map(r=>({name:r,data:i[r]}))}getStackKeys({bins:e=null,groups:n=null}={bins:null,groups:null}){const i=this.getOptions(),l=this.getDisplayData(n);let r;e?r=e.map(a=>`${a.x0}-${a.x1}`):r=Ou(l.map(a=>{const u=this.services.cartesianScales.getDomainIdentifier(a);return a[u]instanceof Date?Fw(a[u]):a[u]&&typeof a[u].toString=="function"?a[u].toString():a[u]}));const s=this.services.cartesianScales.domainAxisPosition,o=i.axes[s].scaleType;return o===Nt.TIME?r.sort((a,u)=>{const f=new Date(a),c=new Date(u);return f-c}):(o===Nt.LOG||o===Nt.LINEAR)&&r.sort((a,u)=>a-u),r}getDataValuesGroupedByKeys({bins:e=null,groups:n=null}){const i=this.getOptions(),{groupMapsTo:l}=i.data,r=this.getDisplayData(n),s=this.getDataGroupNames(),o=this.getStackKeys({bins:e,groups:n});return e?o.map(a=>{const[u,f]=a.split("-"),c={x0:u,x1:f},d=e.find(h=>h.x0.toString()===u.toString());return s.forEach(h=>{c[h]=d.filter(g=>g[l]===h).length}),c}):o.map(a=>{const u={sharedStackKey:a};return s.forEach(f=>{const c=r.find(h=>{const g=this.services.cartesianScales.getDomainIdentifier(h);return h[l]===f&&Object.prototype.hasOwnProperty.call(h,g)&&(h[g]instanceof Date?Fw(h[g])===a:h[g].toString()===a)}),d=this.services.cartesianScales.getRangeIdentifier(u);u[f]=c?c[d]:null}),u})}getStackedData({percentage:e=!1,groups:n=null,divergent:i=!1}){const l=this.getOptions(),{groupMapsTo:r}=l.data,s=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(e){const a=Ice(o.map(u=>[u.sharedStackKey,0]));o.forEach(u=>{s.forEach(f=>{a[u.sharedStackKey]+=u[f]})}),o.forEach(u=>{s.forEach(f=>{const c=a[u.sharedStackKey];a[u.sharedStackKey]?u[f]=u[f]/c*100:u[f]=0})})}return(i?ym().offset(Jie):ym()).keys(s)(o).map((a,u)=>Object.keys(a).filter(f=>!isNaN(f)).map(f=>{const c=a[f];return c[r]=s[u],c}))}getOptions(){return this.state.options}set(e,n){this.state=Object.assign({},this.state,e);const i=Object.assign({skipUpdate:!1,animate:!0},n);i.skipUpdate||this.update(i.animate)}get(e){return e?this.state[e]:this.state}setOptions(e){const n=this.getOptions();$E(n,e),this.set({options:en(n,e)})}update(e=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(je.Model.UPDATE,{animate:e}))}toggleDataLabel(e){const{ACTIVE:n,DISABLED:i}=Ci.items.status,l=this.getDataGroups(),r=l.some(u=>u.status===i),s=l.filter(u=>u.status===n);if(r)if(s.length===1&&s[0].name===e)l.forEach((u,f)=>{l[f].status=n});else{const u=l.findIndex(f=>f.name===e);l[u].status=l[u].status===i?n:i}else l.forEach((u,f)=>{l[f].status=u.name===e?n:i});const o=l.filter(u=>u.status===n),a=this.getOptions();l.some(u=>u.status===i)?a.data.selectedGroups=o.map(u=>u.name):a.data.selectedGroups=[],this.services.events.dispatchEvent(je.Legend.ITEMS_UPDATE,{dataGroups:l}),this.set({dataGroups:l})}getIsFilled(e,n,i,l){const r=this.getOptions();return r.getIsFilled?r.getIsFilled(e,n,i,l):l}getFillColor(e,n,i){const l=this.getOptions(),r=Te(this.colorScale,e);return l.getFillColor?l.getFillColor(e,n,i,r):r}getStrokeColor(e,n,i){const l=this.getOptions(),r=Te(this.colorScale,e);return l.getStrokeColor?l.getStrokeColor(e,n,i,r):r}isUserProvidedColorScaleValid(){const e=Te(this.getOptions(),"color","scale"),n=this.getDataGroups();return e==null||Object.keys(e).length==0?!1:n.some(i=>Object.keys(e).includes(i.name))}getColorClassName(e){const n=this.colorClassNames(e.dataGroupName);let i=e.originalClassName;return e.classNameTypes.forEach(l=>i=e.originalClassName?`${i} ${l}-${n}`:`${l}-${n}`),i||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(e){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format");const n=[],{datasets:i,labels:l}=e;return i.forEach(r=>{r.data.forEach((s,o)=>{let a;const u=Te(r,"label");if(u===null){const c=Te(l,o);c?a=c:a="Ungrouped"}else a=u;const f={group:a,key:l[o]};isNaN(s)?(f.value=s.value,f.date=s.date):f.value=s,n.push(f)})}),n}getTabularDataArray(){return[]}exportToCSV(){const e=this.getTabularDataArray().map(l=>l.map(r=>`"${r==="–"?"–":r}"`));let n="",i="";e.forEach(function(l,r){i=l.join(","),n+=r{this.allDataGroups.indexOf(e)===-1&&this.allDataGroups.push(e)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(e){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:i,DISABLED:l}=Ci.items.status,r=this.getOptions(),s=Ou(e.map(a=>a[n]));r.data.selectedGroups.length&&(r.data.selectedGroups.every(a=>s.includes(a))||(r.data.selectedGroups=[]));const o=a=>!r.data.selectedGroups.length||r.data.selectedGroups.includes(a)?i:l;return s.map(a=>({name:a,status:o(a)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const e=this.getOptions(),n=Te(e,"color","scale");Object.keys(n).forEach(i=>{this.allDataGroups.includes(i)||console.warn(`"${i}" does not exist in data groups.`)}),this.allDataGroups.filter(i=>n[i]).forEach(i=>this.colorScale[i]=n[i])}setColorClassNames(){const e=Te(this.getOptions(),"color","pairing");let n=Te(e,"numberOfVariants");(!n||n5?14:n,s=`${r}-color`;i=i<=l[s]?i:1;const o=this.allDataGroups.map((a,u)=>`${r}-${i}-${u%14+1}`);this.colorClassNames=g0().range(o).domain(this.allDataGroups)}}class Bce extends tM{constructor(e){super(e),this.axisFlavor=i0.DEFAULT}assignRangeAndDomains(){const{cartesianScales:e}=this.services,n=this.getOptions(),i=e.isDualAxes(),l={primaryDomain:e.domainAxisPosition,primaryRange:e.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return i&&(l.secondaryDomain=e.secondaryDomainAxisPosition,l.secondaryRange=e.secondaryRangeAxisPosition),Object.keys(l).forEach(r=>{const s=l[r];e.scales[s]?l[r]={position:s,label:e.getScaleLabel(s),identifier:Te(n,"axes",s,"mapsTo")}:l[r]=null}),l}getTabularDataArray(){const e=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{cartesianScales:l}=this.services,{primaryDomain:r,primaryRange:s,secondaryDomain:o,secondaryRange:a}=this.assignRangeAndDomains(),u=l.getDomainAxisScaleType();let f;return u===Nt.TIME&&(f=c=>aa(c,"MMM d, yyyy")),[["Group",r.label,s.label,...o?[o.label]:[],...a?[a.label]:[]],...e.map(c=>[c[i],c[r.identifier]===null?"–":f?f(c[r.identifier]):c[r.identifier],c[s.identifier]===null||isNaN(c[s.identifier])?"–":c[s.identifier].toLocaleString(),...o?[c[o.identifier]===null?"–":c[o.identifier]]:[],...a?[c[a.identifier]===null||isNaN(c[a.identifier])?"–":c[a.identifier]]:[]])]}setData(e){let n;if(e&&(n=super.setData(e),Te(this.getOptions(),"zoomBar",it.TOP,"enabled"))){const i=Te(this.getOptions(),"zoomBar",it.TOP,"data");this.setZoomBarData(i)}return n}setZoomBarData(e){const n=e?this.sanitize(Xu(e)):this.getDisplayData();let i=n;const{cartesianScales:l}=this.services;if(n&&l.domainAxisPosition&&l.rangeAxisPosition){const r=l.getDomainIdentifier(),s=l.getRangeIdentifier();let o=n.map(a=>a[r].getTime());o=Ou(o).sort(),i=o.map(a=>{let u=0;const f={};return n.forEach(c=>{c[r].getTime()===a&&(u+=c[s])}),f[r]=new Date(a),f[s]=u,f})}this.set({zoomBarData:i})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(e){const n=this.getOptions();if(!n.axes)return e;const i=[];return Object.keys(it).forEach(l=>{const r=it[l],s=n.axes[r];if(s&&s.scaleType===Nt.TIME){const o=s.mapsTo;(o!==null||o!==void 0)&&i.push(o)}}),i.length>0&&e.forEach(l=>{i.forEach(r=>{Te(l,r,"getTime")===null&&(l[r]=new Date(l[r]))})}),e}sanitize(e){return e=super.sanitize(e),e=this.sanitizeDateValues(e),e}}var zce=/\s/;function Hce(t){for(var e=t.length;e--&&zce.test(t.charAt(e)););return e}var Uce=/^\s+/;function Fce(t){return t&&t.slice(0,Hce(t)+1).replace(Uce,"")}var Gw=0/0,Gce=/^[-+]0x[0-9a-f]+$/i,Vce=/^0b[01]+$/i,Wce=/^0o[0-7]+$/i,qce=parseInt;function fu(t){if(typeof t=="number")return t;if(Ld(t))return Gw;if(Zl(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Zl(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Fce(t);var n=Vce.test(t);return n||Wce.test(t)?qce(t.slice(2),n?2:8):Gce.test(t)?Gw:+t}var jce=function(){return ar.Date.now()};const Cm=jce;var Yce="Expected a function",Zce=Math.max,Xce=Math.min;function Kce(t,e,n){var i,l,r,s,o,a,u=0,f=!1,c=!1,d=!0;if(typeof t!="function")throw new TypeError(Yce);e=fu(e)||0,Zl(n)&&(f=!!n.leading,c="maxWait"in n,r=c?Zce(fu(n.maxWait)||0,e):r,d="trailing"in n?!!n.trailing:d);function h(L){var N=i,z=l;return i=l=void 0,u=L,s=t.apply(z,N),s}function g(L){return u=L,o=setTimeout(S,e),f?h(L):s}function _(L){var N=L-a,z=L-u,W=e-N;return c?Xce(W,r-z):W}function v(L){var N=L-a,z=L-u;return a===void 0||N>=e||N<0||c&&z>=r}function S(){var L=Cm();if(v(L))return A(L);o=setTimeout(S,_(L))}function A(L){return o=void 0,d&&i?h(L):(i=l=void 0,s)}function C(){o!==void 0&&clearTimeout(o),u=0,i=a=l=o=void 0}function I(){return o===void 0?s:A(Cm())}function M(){var L=Cm(),N=v(L);if(i=arguments,l=this,a=L,N){if(o===void 0)return g(a);if(c)return clearTimeout(o),o=setTimeout(S,e),h(a)}return o===void 0&&(o=setTimeout(S,e)),s}return M.cancel=C,M.flush=I,M}function $ce(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),i=n.createElement("base"),l=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(l),e&&(i.href=e),l.href=t,l.href}const Jce=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function jr(t){const e=[];for(let n=0,i=t.length;nTl||t.height>Tl)&&(t.width>Tl&&t.height>Tl?t.width>t.height?(t.height*=Tl/t.width,t.width=Tl):(t.width*=Tl/t.height,t.height=Tl):t.width>Tl?(t.height*=Tl/t.width,t.width=Tl):(t.width*=Tl/t.height,t.height=Tl))}function xc(t){return new Promise((e,n)=>{const i=new Image;i.decode=()=>e(i),i.onload=()=>e(i),i.onerror=n,i.crossOrigin="anonymous",i.decoding="async",i.src=t})}async function nde(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function ide(t,e,n){const i="http://www.w3.org/2000/svg",l=document.createElementNS(i,"svg"),r=document.createElementNS(i,"foreignObject");return l.setAttribute("width",`${e}`),l.setAttribute("height",`${n}`),l.setAttribute("viewBox",`0 0 ${e} ${n}`),r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("x","0"),r.setAttribute("y","0"),r.setAttribute("externalResourcesRequired","true"),l.appendChild(r),r.appendChild(t),nde(l)}const cl=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||cl(n,e)};function lde(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function rde(t){return jr(t).map(e=>{const n=t.getPropertyValue(e),i=t.getPropertyPriority(e);return`${e}: ${n}${i?" !important":""};`}).join(" ")}function sde(t,e,n){const i=`.${t}:${e}`,l=n.cssText?lde(n):rde(n);return document.createTextNode(`${i}{${l}}`)}function Vw(t,e,n){const i=window.getComputedStyle(t,n),l=i.getPropertyValue("content");if(l===""||l==="none")return;const r=Jce();try{e.className=`${e.className} ${r}`}catch{return}const s=document.createElement("style");s.appendChild(sde(r,n,i)),e.appendChild(s)}function ode(t,e){Vw(t,e,":before"),Vw(t,e,":after")}const Ww="application/font-woff",qw="image/jpeg",ade={woff:Ww,woff2:Ww,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:qw,jpeg:qw,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function ude(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function K0(t){const e=ude(t).toLowerCase();return ade[e]||""}function fde(t){return t.split(/,/)[1]}function S1(t){return t.search(/^(data:)/)!==-1}function iM(t,e){return`data:${e};base64,${t}`}async function lM(t,e,n){const i=await fetch(t,e);if(i.status===404)throw new Error(`Resource "${i.url}" not found`);const l=await i.blob();return new Promise((r,s)=>{const o=new FileReader;o.onerror=s,o.onloadend=()=>{try{r(n({res:i,result:o.result}))}catch(a){s(a)}},o.readAsDataURL(l)})}const Lm={};function cde(t,e,n){let i=t.replace(/\?.*/,"");return n&&(i=t),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),e?`[${e}]${i}`:i}async function $0(t,e,n){const i=cde(t,e,n.includeQueryParams);if(Lm[i]!=null)return Lm[i];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let l;try{const r=await lM(t,n.fetchRequestInit,({res:s,result:o})=>(e||(e=s.headers.get("Content-Type")||""),fde(o)));l=iM(r,e)}catch(r){l=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${t}`;r&&(s=typeof r=="string"?r:r.message),s&&console.warn(s)}return Lm[i]=l,l}async function dde(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):xc(e)}async function hde(t,e){if(t.currentSrc){const r=document.createElement("canvas"),s=r.getContext("2d");r.width=t.clientWidth,r.height=t.clientHeight,s==null||s.drawImage(t,0,0,r.width,r.height);const o=r.toDataURL();return xc(o)}const n=t.poster,i=K0(n),l=await $0(n,i,e);return xc(l)}async function mde(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await Ud(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function gde(t,e){return cl(t,HTMLCanvasElement)?dde(t):cl(t,HTMLVideoElement)?hde(t,e):cl(t,HTMLIFrameElement)?mde(t):t.cloneNode(!1)}const _de=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function pde(t,e,n){var i,l;let r=[];return _de(t)&&t.assignedNodes?r=jr(t.assignedNodes()):cl(t,HTMLIFrameElement)&&!((i=t.contentDocument)===null||i===void 0)&&i.body?r=jr(t.contentDocument.body.childNodes):r=jr(((l=t.shadowRoot)!==null&&l!==void 0?l:t).childNodes),r.length===0||cl(t,HTMLVideoElement)||await r.reduce((s,o)=>s.then(()=>Ud(o,n)).then(a=>{a&&e.appendChild(a)}),Promise.resolve()),e}function bde(t,e){const n=e.style;if(!n)return;const i=window.getComputedStyle(t);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):jr(i).forEach(l=>{let r=i.getPropertyValue(l);l==="font-size"&&r.endsWith("px")&&(r=`${Math.floor(parseFloat(r.substring(0,r.length-2)))-.1}px`),cl(t,HTMLIFrameElement)&&l==="display"&&r==="inline"&&(r="block"),l==="d"&&e.getAttribute("d")&&(r=`path(${e.getAttribute("d")})`),n.setProperty(l,r,i.getPropertyPriority(l))})}function vde(t,e){cl(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),cl(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function kde(t,e){if(cl(t,HTMLSelectElement)){const n=e,i=Array.from(n.children).find(l=>t.value===l.getAttribute("value"));i&&i.setAttribute("selected","")}}function wde(t,e){return cl(e,Element)&&(bde(t,e),ode(t,e),vde(t,e),kde(t,e)),e}async function yde(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const i={};for(let r=0;rgde(i,e)).then(i=>pde(t,i,e)).then(i=>wde(t,i)).then(i=>yde(i,e))}const rM=/url\((['"]?)([^'"]+?)\1\)/g,Tde=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Sde=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Ede(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function Mde(t){const e=[];return t.replace(rM,(n,i,l)=>(e.push(l),n)),e.filter(n=>!S1(n))}async function Ode(t,e,n,i,l){try{const r=n?$ce(e,n):e,s=K0(e);let o;if(l){const a=await l(r);o=iM(a,s)}else o=await $0(r,s,i);return t.replace(Ede(e),`$1${o}$3`)}catch{}return t}function Ade(t,{preferredFontFormat:e}){return e?t.replace(Sde,n=>{for(;;){const[i,,l]=Tde.exec(n)||[];if(!l)return"";if(l===e)return`src: ${i};`}}):t}function sM(t){return t.search(rM)!==-1}async function oM(t,e,n){if(!sM(t))return t;const i=Ade(t,n);return Mde(i).reduce((l,r)=>l.then(s=>Ode(s,r,e,n)),Promise.resolve(i))}async function Jf(t,e,n){var i;const l=(i=e.style)===null||i===void 0?void 0:i.getPropertyValue(t);if(l){const r=await oM(l,null,n);return e.style.setProperty(t,r,e.style.getPropertyPriority(t)),!0}return!1}async function Cde(t,e){await Jf("background",t,e)||await Jf("background-image",t,e),await Jf("mask",t,e)||await Jf("mask-image",t,e)}async function Lde(t,e){const n=cl(t,HTMLImageElement);if(!(n&&!S1(t.src))&&!(cl(t,SVGImageElement)&&!S1(t.href.baseVal)))return;const i=n?t.src:t.href.baseVal,l=await $0(i,K0(i),e);await new Promise((r,s)=>{t.onload=r,t.onerror=s;const o=t;o.decode&&(o.decode=r),o.loading==="lazy"&&(o.loading="eager"),n?(t.srcset="",t.src=l):t.href.baseVal=l})}async function Ide(t,e){const n=jr(t.childNodes).map(i=>aM(i,e));await Promise.all(n).then(()=>t)}async function aM(t,e){cl(t,Element)&&(await Cde(t,e),await Lde(t,e),await Ide(t,e))}function Rde(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const i=e.style;return i!=null&&Object.keys(i).forEach(l=>{n[l]=i[l]}),t}const jw={};async function Yw(t){let e=jw[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},jw[t]=e,e}async function Zw(t,e){let n=t.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,l=(n.match(/url\([^)]+\)/g)||[]).map(async r=>{let s=r.replace(i,"$1");return s.startsWith("https://")||(s=new URL(s,t.url).href),lM(s,e.fetchRequestInit,({result:o})=>(n=n.replace(r,`url(${o})`),[r,o]))});return Promise.all(l).then(()=>n)}function Xw(t){if(t==null)return[];const e=[],n=/(\/\*[\s\S]*?\*\/)/gi;let i=t.replace(n,"");const l=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const a=l.exec(i);if(a===null)break;e.push(a[0])}i=i.replace(l,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(s,"gi");for(;;){let a=r.exec(i);if(a===null){if(a=o.exec(i),a===null)break;r.lastIndex=o.lastIndex}else o.lastIndex=r.lastIndex;e.push(a[0])}return e}async function Dde(t,e){const n=[],i=[];return t.forEach(l=>{if("cssRules"in l)try{jr(l.cssRules||[]).forEach((r,s)=>{if(r.type===CSSRule.IMPORT_RULE){let o=s+1;const a=r.href,u=Yw(a).then(f=>Zw(f,e)).then(f=>Xw(f).forEach(c=>{try{l.insertRule(c,c.startsWith("@import")?o+=1:l.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:c,error:d})}})).catch(f=>{console.error("Error loading remote css",f.toString())});i.push(u)}})}catch(r){const s=t.find(o=>o.href==null)||document.styleSheets[0];l.href!=null&&i.push(Yw(l.href).then(o=>Zw(o,e)).then(o=>Xw(o).forEach(a=>{s.insertRule(a,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",r)}}),Promise.all(i).then(()=>(t.forEach(l=>{if("cssRules"in l)try{jr(l.cssRules||[]).forEach(r=>{n.push(r)})}catch(r){console.error(`Error while reading CSS rules from ${l.href}`,r)}}),n))}function Pde(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>sM(e.style.getPropertyValue("src")))}async function Nde(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=jr(t.ownerDocument.styleSheets),i=await Dde(n,e);return Pde(i)}async function Bde(t,e){const n=await Nde(t,e);return(await Promise.all(n.map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return oM(i.cssText,l,e)}))).join(` -`)}async function zde(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await Bde(t,e);if(n){const i=document.createElement("style"),l=document.createTextNode(n);i.appendChild(l),t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)}}async function Hde(t,e={}){const{width:n,height:i}=nM(t,e),l=await Ud(t,e,!0);return await zde(l,e),await aM(l,e),Rde(l,e),await ide(l,n,i)}async function uM(t,e={}){const{width:n,height:i}=nM(t,e),l=await Hde(t,e),r=await xc(l),s=document.createElement("canvas"),o=s.getContext("2d"),a=e.pixelRatio||ede(),u=e.canvasWidth||n,f=e.canvasHeight||i;return s.width=u*a,s.height=f*a,e.skipAutoScale||tde(s),s.style.width=`${u}`,s.style.height=`${f}`,e.backgroundColor&&(o.fillStyle=e.backgroundColor,o.fillRect(0,0,s.width,s.height)),o.drawImage(r,0,0,s.width,s.height),s}async function Ude(t,e={}){return(await uM(t,e)).toDataURL()}async function Fde(t,e={}){return(await uM(t,e)).toDataURL("image/jpeg",e.quality||1)}class Qr{constructor(e,n){this.model=e,this.services=n,this.init()}init(){}update(){}setModel(e){this.model=e}setServices(e){this.services=e}}const Gde="DONT_STYLE_ME_css_styles_verifier";class bt extends Qr{constructor(e,n){super(e,n),this.chartID=""}static getHTMLElementSize(e){return{width:e.clientWidth,height:e.clientHeight}}static getSVGElementSize(e,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){e.attr||(e=ht(e));const i={width:0,height:0},l=d=>{d&&Object.keys(i).forEach(h=>{if(d[h]){const g=d[h],_=parseFloat(g);g&&_>i[h]&&(""+g).indexOf("%")===-1&&(i[h]=_)}})},r={width:e.attr("width"),height:e.attr("height")},s=e.node();let o,a,u,f;try{typeof s.getBBox=="function"&&(o=s.getBBox(),a={width:o.width,height:o.height})}catch(d){console.error(d)}try{typeof(s==null?void 0:s.getBoundingClientRect)=="function"&&(u=s.getBoundingClientRect(),f={width:u.width,height:u.height})}catch(d){console.error(d)}let c;if(s instanceof SVGSVGElement&&(c={width:s.clientWidth,height:s.clientHeight}),n){if(n.useAttrs&&(l(r),i.width>0&&i.height>0))return i;if(n.useClientDimensions&&(l(c),i.width>0&&i.height>0))return c;if(n.useBBox&&(l(a),i.width>0&&i.height>0))return a;if(n.useBoundingRect&&(l(f),i.width>0&&i.height>0))return f}try{const d={width:Te(e.node(),"width","baseVal","value"),height:Te(e.node(),"height","baseVal","value")};l(d)}catch{l(c),l(a),l(r)}return i}static appendOrSelect(e,n){const i=e.select(`${n}`);if(i.empty()){let l=n.split("#"),r,s;return l.length===2?(r=l[0],l=l[1].split("."),s=l[0]):(l=n.split("."),r=l[0]),e.append(r).attr("id",s).attr("class",l.slice(1).join(" "))}return i}init(){this.styleHolderElement(),this.initializeID(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}generateElementIDString(e){return`chart-${this.chartID}-${e}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const e=this.model.getOptions(),n=Te(e,"style","prefix"),i=ht(this.getHolder()).append("div").classed(`${al}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");i.append("g").attr("class",Gde),this.mainContainer=i.node()}update(){this.styleHolderElement()}styleHolderElement(){const e=this.getHolder(),{width:n,height:i,theme:l}=this.model.getOptions();n!==this.width&&(e.style.width=n,this.width=n),i!==this.height&&(e.style.height=i,this.height=i),ht(this.getHolder()).classed(`${al}--chart-holder`,!0).attr("data-carbon-theme",l)}getHolder(){return this.model.get("holder")}exportToJPG(){const e=this,n=this.getHolder(),i=ht(n);i.classed("filled",!0),Fde(this.getMainContainer(),{quality:1,filter:l=>!(l.classList&&l.classList.contains("cds--cc--toolbar"))}).then(function(l){var r;(r=e.services.files)==null||r.downloadImage(l,"myChart.jpg"),i.classed("filled",!1)})}exportToPNG(){const e=this,n=this.getHolder(),i=ht(n);i.classed("filled",!0),Ude(this.getMainContainer(),{quality:1,filter:l=>!(l.classList&&l.classList.contains("cds--cc--toolbar"))}).then(function(l){var r;(r=e.services.files)==null||r.downloadImage(l,"myChart.png"),i.classed("filled",!1)}).catch(function(l){console.error("oops, something went wrong!",l)})}toggleFullscreen(){const e=this.getHolder();ht(e).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const e=ht(this.getHolder()),n=e.classed("fullscreen");e.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:e}=bt.getSVGElementSize(ht(this.mainContainer),{useBBox:!0}),n=ht(this.mainContainer).attr("class"),i=ht(this.mainContainer).selectAll(`.${n} > svg`);let l=0;i.nodes().forEach(function(r){l+=Number(bt.getSVGElementSize(ht(r),{useBBox:!0}).height)}),l<=e?ht(this.mainContainer).attr("height",l):ht(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const e=this.getHolder();e&&ht(e).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(je.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(je.Chart.MOUSEOUT)})}addResizeListener(){const e=this.getHolder();if(!e)return;let n=e.clientWidth,i=e.clientHeight;const l=Kce(()=>{var r;e&&(Math.abs(n-e.clientWidth)>1||Math.abs(i-e.clientHeight)>1)&&(n=e.clientWidth,i=e.clientHeight,(r=this.services.events)==null||r.dispatchEvent(je.Chart.RESIZE))},12.5);new ResizeObserver(l).observe(e)}}class Cu extends Qr{static appendOrUpdateLinearGradient(e){let n=e.svg.select(`defs linearGradient#${e.id}`);n.empty()&&(n=e.svg.append("defs").append("linearGradient").attr("id",e.id).attr("x1",e.x1).attr("x2",e.x2).attr("y1",e.y1).attr("y2",e.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(e.stops).enter().append("stop").attr("offset",i=>i.offset).style("stop-color",i=>i.color).style("stop-opacity",i=>i.opacity)}static getOffsetRatio(e){return(Math.abs(e[1])*100/Math.abs(e[0]-e[1])).toFixed(2)+"%"}static getStops(e,n){const i=e[0]<0&&e[1]>0;let l=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return i&&(l=[{offset:"0%",color:n,opacity:"0.6"},{offset:Cu.getOffsetRatio(e),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),l}}var Vde={value:function(){}};function fM(){for(var t=0,e=arguments.length,n={},i;t=0&&(i=n.slice(l+1),n=n.slice(0,l)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}cc.prototype=fM.prototype={constructor:cc,on:function(t,e){var n=this._,i=Wde(t+"",n),l,r=-1,s=i.length;if(arguments.length<2){for(;++r0)for(var n=new Array(l),i=0,l,r;i=e?t:e)),t}function Xde(t,e,n){return n===void 0&&(n=e,e=void 0),n!==void 0&&(n=fu(n),n=n===n?n:0),e!==void 0&&(e=fu(e),e=e===e?e:0),Zde(fu(t),e,n)}function Kde(t,e){return zd(t,e)}function $de(t,e){var n;return eM(t,function(i,l,r){return n=e(i,l,r),!n}),!!n}function Jde(t,e,n){var i=qi(t)?NE:$de;return n&&gE(t,e,n)&&(e=void 0),i(t,Y0(e))}class Xn{constructor(e,n,i){if(this.type="",this.renderType=wn.HTML,this.id="",this.parent=void 0,this.configs={},this.model=e,this.services=n,i&&(this.configs=i,this.configs.id)){const l=Te(this.model.getOptions(),"style","prefix");this.id=`${l}--${this.configs.id}`}this.parent||this.setParent(ht(this.services.domUtils.getMainContainer()))}init(){}render(e=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(e){this.model=e}setServices(e){this.services=e}setParent(e){var n;const i=this.parent;if(this.parent=e,!(i&&i.node()===e.node())&&this.type){const l=Te(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${al}--${l}--${this.type}`,!0),i&&i.classed(`${al}--${l}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(e={withinChartClip:!1}){if(this.type){const n=Te(this.model.getOptions(),"style","prefix"),i=this.id?`#${this.id}`:"",l=bt.appendOrSelect(this.parent,`${this.renderType===wn.SVG?"svg":"div"}${i}.${al}--${n}--${this.type}`);if(e.withinChartClip){const r=this.model.get("chartClipId");if(r){const s=ht(`#${r}`).select("rect");s.size()!==0&&parseFloat(s.attr("height"))>0&&l.attr("clip-path",`url(#${r})`)}}return l.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?en({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const cM=class dM extends Xn{constructor(){super(...arguments),this.type="toolbar",this.renderType=wn.HTML}init(){const e=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(je.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",e)}),this.services.events.addEventListener(je.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",e)})}render(e=!0){const n=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(Te(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("

      "));const{buttonList:i,overflowMenuItemList:l}=this.getControlConfigs();l&&i.push(this.getOverflowButtonConfig());const r=n.selectAll("div.toolbar-control").data(i,a=>a.id);r.exit().remove();const s=r.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),o=this;s.merge(r).classed("disabled",a=>a.shouldBeDisabled()).attr("aria-disabled",a=>a.shouldBeDisabled()).attr("aria-label",a=>a.title).html(a=>` +`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),G$=new RegExp(`(?:^${nr}$)|(?:^${bd}$)`),V$=new RegExp(`^${nr}$`),W$=new RegExp(`^${bd}$`),n0=t=>t&&t.exact?G$:new RegExp(`(?:${vs(t)}${nr}${vs(t)})|(?:${vs(t)}${bd}${vs(t)})`,"g");n0.v4=t=>t&&t.exact?V$:new RegExp(`${vs(t)}${nr}${vs(t)}`,"g");n0.v6=t=>t&&t.exact?W$:new RegExp(`${vs(t)}${bd}${vs(t)}`,"g");function q$(t){const e=(...n)=>t(...n);return Object.defineProperty(e,"name",{value:`functionTimeout(${t.name||""})`,configurable:!0}),e}const{toString:j$}=Object.prototype;function Y$(t){return j$.call(t)==="[object RegExp]"}const e4={global:"g",ignoreCase:"i",multiline:"m",dotAll:"s",sticky:"y",unicode:"u"};function Z$(t,e={}){if(!Y$(t))throw new TypeError("Expected a RegExp instance");const n=Object.keys(e4).map(l=>(typeof e[l]=="boolean"?e[l]:t[l])?e4[l]:"").join(""),i=new RegExp(e.source||t.source,n);return i.lastIndex=typeof e.lastIndex=="number"?e.lastIndex:t.lastIndex,i}function X$(t,e,{timeout:n}={}){try{return q$(()=>Z$(t).test(e),{timeout:n})()}catch(i){throw i}}const K$=15,$$={timeout:400};function t4(t){return t.length>K$?!1:X$(n0.v4({exact:!0}),t,$$)}function J$(t){let e,n=t[5]("Custom A Records")+"",i,l,r,s=t[5]("Add all domains that you would like to resolve internally here.")+"",o,a,u,f,c,d,h,g=t[4]&&n4(t);return d=new Ol({props:{sortable:!0,size:"medium",style:"width:100%;",headers:[{key:"domain",value:"Domain"},{key:"ip",value:"IP"},{key:"actions",value:""}],rows:t[0].map(l4).sort(r4),$$slots:{cell:[uJ,({row:_,cell:v})=>({20:_,21:v}),({row:_,cell:v})=>(_?1048576:0)|(v?2097152:0)],default:[sJ]},$$scope:{ctx:t}}}),{c(){e=R("h5"),i=q(n),l=B(),r=R("p"),o=q(s),a=B(),u=R("br"),f=B(),g&&g.c(),c=B(),F(d.$$.fragment)},m(_,v){y(_,e,v),T(e,i),y(_,l,v),y(_,r,v),T(r,o),y(_,a,v),y(_,u,v),y(_,f,v),g&&g.m(_,v),y(_,c,v),H(d,_,v),h=!0},p(_,v){(!h||v&32)&&n!==(n=_[5]("Custom A Records")+"")&&Z(i,n),(!h||v&32)&&s!==(s=_[5]("Add all domains that you would like to resolve internally here.")+"")&&Z(o,s),_[4]?g?(g.p(_,v),v&16&&b(g,1)):(g=n4(_),g.c(),b(g,1),g.m(c.parentNode,c)):g&&(fe(),k(g,1,1,()=>{g=null}),ce());const S={};v&1&&(S.rows=_[0].map(l4).sort(r4)),v&7340088&&(S.$$scope={dirty:v,ctx:_}),d.$set(S)},i(_){h||(b(g),b(d.$$.fragment,_),h=!0)},o(_){k(g),k(d.$$.fragment,_),h=!1},d(_){_&&(w(e),w(l),w(r),w(a),w(u),w(f),w(c)),g&&g.d(_),U(d,_)}}}function Q$(t){let e;return{c(){e=R("p"),e.textContent="Loading..."},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function n4(t){let e,n;return e=new Iu({props:{open:!0,preventCloseOnClickOutside:!0,$$slots:{default:[eJ]},$$scope:{ctx:t}}}),e.$on("submit",t[11]),e.$on("close",t[12]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4194342&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function x$(t){let e,n,i,l,r,s,o,a;function u(h){t[9](h)}let f={labelText:t[5]("Domain"),type:"text",placeholder:"domain.com",size:"sm"};t[1]!==void 0&&(f.value=t[1]),e=new Jn({props:f}),ft.push(()=>Yt(e,"value",u));function c(h){t[10](h)}let d={type:"text",placeholder:"1.1.1.1",size:"sm",labelText:t[5]("IP Address")};return t[2]!==void 0&&(d.value=t[2]),s=new Jn({props:d}),ft.push(()=>Yt(s,"value",c)),{c(){F(e.$$.fragment),i=B(),l=R("br"),r=B(),F(s.$$.fragment)},m(h,g){H(e,h,g),y(h,i,g),y(h,l,g),y(h,r,g),H(s,h,g),a=!0},p(h,g){const _={};g&32&&(_.labelText=h[5]("Domain")),!n&&g&2&&(n=!0,_.value=h[1],jt(()=>n=!1)),e.$set(_);const v={};g&32&&(v.labelText=h[5]("IP Address")),!o&&g&4&&(o=!0,v.value=h[2],jt(()=>o=!1)),s.$set(v)},i(h){a||(b(e.$$.fragment,h),b(s.$$.fragment,h),a=!0)},o(h){k(e.$$.fragment,h),k(s.$$.fragment,h),a=!1},d(h){h&&(w(i),w(l),w(r)),U(e,h),U(s,h)}}}function eJ(t){let e,n,i,l,r,s;return e=new Ru({props:{title:t[5]("Add an entry")}}),i=new Du({props:{hasForm:!0,$$slots:{default:[x$]},$$scope:{ctx:t}}}),r=new Pu({props:{primaryButtonDisabled:!t4(t[2]),primaryButtonIcon:ws,primaryButtonText:t[5]("Save")}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){H(e,o,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,a){const u={};a&32&&(u.title=o[5]("Add an entry")),e.$set(u);const f={};a&4194342&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a&4&&(c.primaryButtonDisabled=!t4(o[2])),a&32&&(c.primaryButtonText=o[5]("Save")),r.$set(c)},i(o){s||(b(e.$$.fragment,o),b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(e.$$.fragment,o),k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(n),w(l)),U(e,o),U(i,o),U(r,o)}}}function tJ(t){let e,n;return e=new Rt({props:{icon:zu,$$slots:{default:[iJ]},$$scope:{ctx:t}}}),e.$on("click",t[15]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4194336&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function nJ(t){return{c:he,m:he,p:he,i:he,o:he,d:he}}function iJ(t){let e=t[5]("Insert")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&32&&e!==(e=i[5]("Insert")+"")&&Z(n,e)},d(i){i&&w(n)}}}function lJ(t){let e,n,i,l;const r=[nJ,tJ],s=[];function o(a,u){return a[4]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function rJ(t){let e,n;return e=new X1({props:{$$slots:{default:[lJ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4194352&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function sJ(t){let e,n;return e=new Z1({props:{size:"sm",$$slots:{default:[rJ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4194352&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function oJ(t){let e=t[21].value+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&2097152&&e!==(e=i[21].value+"")&&Z(n,e)},i:he,o:he,d(i){i&&w(n)}}}function aJ(t){let e,n,i,l,r;function s(){return t[13](t[20])}n=new Rt({props:{icon:t[3]!=null&&t[20].id===t[3]?ws:xs,iconDescription:t[5]("Edit"),disabled:t[20].id==t[3]}}),n.$on("click",s);function o(){return t[14](t[20])}return l=new Rt({props:{icon:dd,iconDescription:t[5]("Delete")}}),l.$on("click",o),{c(){e=R("div"),F(n.$$.fragment),i=B(),F(l.$$.fragment),wt(e,"float","right")},m(a,u){y(a,e,u),H(n,e,null),T(e,i),H(l,e,null),r=!0},p(a,u){t=a;const f={};u&1048584&&(f.icon=t[3]!=null&&t[20].id===t[3]?ws:xs),u&32&&(f.iconDescription=t[5]("Edit")),u&1048584&&(f.disabled=t[20].id==t[3]),n.$set(f);const c={};u&32&&(c.iconDescription=t[5]("Delete")),l.$set(c)},i(a){r||(b(n.$$.fragment,a),b(l.$$.fragment,a),r=!0)},o(a){k(n.$$.fragment,a),k(l.$$.fragment,a),r=!1},d(a){a&&w(e),U(n),U(l)}}}function uJ(t){let e,n,i,l;const r=[aJ,oJ],s=[];function o(a,u){return a[21].key==="actions"?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function fJ(t){let e,n,i,l;const r=[Q$,J$],s=[];function o(a,u){return a[0]==null?0:1}return n=o(t),i=s[n]=r[n](t),{c(){e=R("div"),i.c()},m(a,u){y(a,e,u),s[n].m(e,null),l=!0},p(a,[u]){let f=n;n=o(a),n===f?s[n].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),i=s[n],i?i.p(a,u):(i=s[n]=r[n](a),i.c()),b(i,1),i.m(e,null))},i(a){l||(b(i),l=!0)},o(a){k(i),l=!1},d(a){a&&w(e),s[n].d()}}}const i4="/dns/custom_entries",l4=(t,e)=>({...t,actions:""}),r4=(t,e)=>e.id-t.id;function cJ(t,e,n){let i,l;Mt(t,ii,N=>n(5,i=N)),Mt(t,An,N=>n(16,l=N));const r=yn();let s=null,o="",a="",u=null,f=!1;const c=()=>{n(0,s=[]),l.api.doCall(i4).then(function(N){n(0,s=N.data.map((z,W)=>({...z,id:W+1})))})},d=()=>{const N=s.map(z=>({domain:z.domain,ip:z.ip}));l.api.doCall(i4,"post",N,{"Content-Type":"application/json"}).then(function(z){z.ok==!0?(c(),n(1,o=""),n(2,a=""),n(4,f=!1),r("updatednsinfo"),ci.add({kind:"success",title:i("Success:"),subtitle:i("Successfully saved data to the api")})):"error"in z&&(ci.add(ao({title:i("Error"),subtitle:z.error},i)),c())}).catch(function(z){ci.add({kind:"error",title:i("Error:"),subtitle:i("Unable to save data to the api : ")+z.message,timeout:3e4}),c()})};c();const h=()=>{u?(s.find(N=>N.id===u),n(0,s[u-1].domain=o,s),n(0,s[u-1].ip=a,s),n(3,u=null)):n(0,s=[...s,{id:s.length+1,domain:o,ip:a}]),d()},g=N=>{n(3,u=N);const z=s.find(W=>W.id===N);n(1,o=z.domain),n(2,a=z.ip),n(4,f=!0)},_=N=>{n(0,s=[...s.filter(z=>z.id!==N)]),d()};function v(N){o=N,n(1,o)}function S(N){a=N,n(2,a)}return[s,o,a,u,f,i,h,g,_,v,S,()=>{h()},()=>{n(4,f=!1),n(1,o=""),n(2,a="")},N=>g(N.id),N=>_(N.id),()=>n(4,f=!0)]}class dJ extends De{constructor(e){super(),Re(this,e,cJ,fJ,Ie,{})}}function hJ(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function mJ(t){let e;return{c(){e=q("DNS Server")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function gJ(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[hJ]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[mJ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&64&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&64&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function _J(t){var le,oe,X;let e,n,i,l,r,s=t[1]("Blocked domains")+"",o,a,u,f=((le=t[0])==null?void 0:le.number_domains_blocked)+"",c,d,h,g=t[1]("Last updated")+"",_,v,S,A=t[3]((oe=t[0])==null?void 0:oe.last_updated)+"",C,I,M,L=t[1]("Next update")+"",N,z,W,D=t[3]((X=t[0])==null?void 0:X.next_update)+"",G,$,j,Q;return i=new $1({}),{c(){e=R("div"),n=R("span"),F(i.$$.fragment),l=B(),r=R("div"),o=q(s),a=B(),u=R("label"),c=q(f),d=B(),h=R("div"),_=q(g),v=B(),S=R("label"),C=q(A),I=B(),M=R("div"),N=q(L),z=B(),W=R("label"),G=q(D),wt(n,"position","absolute"),wt(n,"right","5px"),wt(n,"top","5px"),wt(n,"cursor","pointer"),wt(n,"color","gray"),P(u,"class","bx--label svelte-u41t5x"),P(r,"class","info-item svelte-u41t5x"),P(S,"class","bx--label svelte-u41t5x"),P(h,"class","info-item svelte-u41t5x"),P(W,"class","bx--label svelte-u41t5x"),P(M,"class","info-item svelte-u41t5x"),P(e,"class","simple-border"),wt(e,"font-size","0.95em"),wt(e,"position","relative")},m(de,re){y(de,e,re),T(e,n),H(i,n,null),T(e,l),T(e,r),T(r,o),T(r,a),T(r,u),T(u,c),T(e,d),T(e,h),T(h,_),T(h,v),T(h,S),T(S,C),T(e,I),T(e,M),T(M,N),T(M,z),T(M,W),T(W,G),$=!0,j||(Q=J(n,"click",t[2]),j=!0)},p(de,re){var x,me,ee;(!$||re&2)&&s!==(s=de[1]("Blocked domains")+"")&&Z(o,s),(!$||re&1)&&f!==(f=((x=de[0])==null?void 0:x.number_domains_blocked)+"")&&Z(c,f),(!$||re&2)&&g!==(g=de[1]("Last updated")+"")&&Z(_,g),(!$||re&1)&&A!==(A=de[3]((me=de[0])==null?void 0:me.last_updated)+"")&&Z(C,A),(!$||re&2)&&L!==(L=de[1]("Next update")+"")&&Z(N,L),(!$||re&1)&&D!==(D=de[3]((ee=de[0])==null?void 0:ee.next_update)+"")&&Z(G,D)},i(de){$||(b(i.$$.fragment,de),$=!0)},o(de){k(i.$$.fragment,de),$=!1},d(de){de&&w(e),U(i),j=!1,Q()}}}function pJ(t){let e,n=t[1]("Loading...")+"",i;return{c(){e=R("div"),i=q(n),P(e,"class","simple-border")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r&2&&n!==(n=l[1]("Loading...")+"")&&Z(i,n)},i:he,o:he,d(l){l&&w(e)}}}function bJ(t){let e,n=t[1]("DNS Info")+"",i,l,r,s,o,a,u,f,c,d,h,g,_;const v=[pJ,_J],S=[];function A(C,I){return C[0]==null?0:1}return r=A(t),s=S[r]=v[r](t),f=new tr({props:{keyName:"dns_resolver",title:t[1]("DNS Resolver"),labelText:t[1]("DNS Resolver"),type:"text",helperText:""}}),g=new dJ({}),g.$on("updatednsinfo",t[4]),{c(){e=R("h5"),i=q(n),l=B(),s.c(),o=B(),a=R("br"),u=B(),F(f.$$.fragment),c=B(),d=R("br"),h=B(),F(g.$$.fragment)},m(C,I){y(C,e,I),T(e,i),y(C,l,I),S[r].m(C,I),y(C,o,I),y(C,a,I),y(C,u,I),H(f,C,I),y(C,c,I),y(C,d,I),y(C,h,I),H(g,C,I),_=!0},p(C,I){(!_||I&2)&&n!==(n=C[1]("DNS Info")+"")&&Z(i,n);let M=r;r=A(C),r===M?S[r].p(C,I):(fe(),k(S[M],1,1,()=>{S[M]=null}),ce(),s=S[r],s?s.p(C,I):(s=S[r]=v[r](C),s.c()),b(s,1),s.m(o.parentNode,o));const L={};I&2&&(L.title=C[1]("DNS Resolver")),I&2&&(L.labelText=C[1]("DNS Resolver")),f.$set(L)},i(C){_||(b(s),b(f.$$.fragment,C),b(g.$$.fragment,C),_=!0)},o(C){k(s),k(f.$$.fragment,C),k(g.$$.fragment,C),_=!1},d(C){C&&(w(e),w(l),w(o),w(a),w(u),w(c),w(d),w(h)),S[r].d(C),U(f,C),U(g,C)}}}function vJ(t){let e,n;return e=new F$({}),e.$on("updatednsinfo",t[4]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function kJ(t){let e,n,i,l;return e=new zn({props:{sm:5,md:5,lg:5,$$slots:{default:[bJ]},$$scope:{ctx:t}}}),i=new zn({props:{sm:11,md:11,lg:11,$$slots:{default:[vJ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&67&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&64&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function wJ(t){let e,n,i,l,r,s,o,a;return e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[gJ]},$$scope:{ctx:t}}}),o=new dl({props:{$$slots:{default:[kJ]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),i=R("h2"),i.textContent="DNS Server",l=B(),r=R("br"),s=B(),F(o.$$.fragment)},m(u,f){H(e,u,f),y(u,n,f),y(u,i,f),y(u,l,f),y(u,r,f),y(u,s,f),H(o,u,f),a=!0},p(u,[f]){const c={};f&64&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};f&67&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(b(e.$$.fragment,u),b(o.$$.fragment,u),a=!0)},o(u){k(e.$$.fragment,u),k(o.$$.fragment,u),a=!1},d(u){u&&(w(n),w(i),w(l),w(r),w(s)),U(e,u),U(o,u)}}}function yJ(t,e,n){let i,l;Mt(t,An,u=>n(5,i=u)),Mt(t,ii,u=>n(1,l=u));let r=null;const s=async()=>{n(0,r=null),n(0,r=await i.api.doCall("/dns/info"))};return _n(async()=>{await s()}),[r,l,s,u=>new Date(u*1e3).toLocaleString(),async()=>{n(0,r=null),setTimeout(async()=>{await s()},3e3)}]}class TJ extends De{constructor(e){super(),Re(this,e,yJ,wJ,Ie,{})}}var S8=(t=>(t.RENDER_FINISHED="render-finished",t.RESIZE="chart-resize",t.MOUSEOVER="chart-mouseover",t.MOUSEOUT="chart-mouseout",t))(S8||{}),E8=(t=>(t.SHOW="show-modal",t.HIDE="hide-modal",t))(E8||{}),M8=(t=>(t.UPDATE="model-update",t))(M8||{}),O8=(t=>(t.SHOW_OVERFLOW_MENU="show-toolbar-overflow-menu",t.HIDE_OVERFLOW_MENU="hide-toolbar-overflow-menu",t.BUTTON_CLICK="toolbar-button-click",t))(O8||{}),A8=(t=>(t.UPDATE="zoom-bar-update",t.SELECTION_START="zoom-bar-selection-start",t.SELECTION_IN_PROGRESS="zoom-bar-selection-in-progress",t.SELECTION_END="zoom-bar-selection-end",t))(A8||{}),C8=(t=>(t.CHANGE="zoom-domain-change",t))(C8||{}),L8=(t=>(t.CANVAS_ZOOM_IN="canvas-zoom-in",t.CANVAS_ZOOM_OUT="canvas-zoom-out",t))(L8||{}),I8=(t=>(t.LABEL_MOUSEOVER="axis-label-mouseover",t.LABEL_MOUSEMOVE="axis-label-mousemove",t.LABEL_CLICK="axis-label-click",t.LABEL_MOUSEOUT="axis-label-mouseout",t.LABEL_FOCUS="axis-label-focus",t.LABEL_BLUR="axis-label-blur",t.RENDER_COMPLETE="axis-render-complete",t))(I8||{}),R8=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(R8||{}),D8=(t=>(t.WORD_MOUSEOVER="wordcloud-word-mouseover",t.WORD_MOUSEMOVE="wordcloud-word-mousemove",t.WORD_CLICK="wordcloud-word-click",t.WORD_MOUSEOUT="wordcloud-word-mouseout",t))(D8||{}),P8=(t=>(t.SLICE_MOUSEOVER="pie-slice-mouseover",t.SLICE_MOUSEMOVE="pie-slice-mousemove",t.SLICE_CLICK="pie-slice-click",t.SLICE_MOUSEOUT="pie-slice-mouseout",t))(P8||{}),N8=(t=>(t.ARC_MOUSEOVER="gauge-arc-mouseover",t.ARC_MOUSEMOVE="gauge-arc-mousemove",t.ARC_CLICK="gauge-arc-click",t.ARC_MOUSEOUT="gauge-arc-mouseout",t))(N8||{}),B8=(t=>(t.BAR_MOUSEOVER="bar-mouseover",t.BAR_MOUSEMOVE="bar-mousemove",t.BAR_CLICK="bar-click",t.BAR_MOUSEOUT="bar-mouseout",t))(B8||{}),z8=(t=>(t.BOX_MOUSEOVER="box-mouseover",t.BOX_MOUSEMOVE="box-mousemove",t.BOX_CLICK="box-click",t.BOX_MOUSEOUT="box-mouseout",t.OUTLIER_MOUSEOVER="outlier-mouseover",t.OUTLIER_MOUSEMOVE="outlier-mousemove",t.OUTLIER_CLICK="outlier-click",t.OUTLIER_MOUSEOUT="outlier-mouseout",t))(z8||{}),H8=(t=>(t.SCATTER_MOUSEOVER="scatter-mouseover",t.SCATTER_MOUSEMOVE="scatter-mousemove",t.SCATTER_CLICK="scatter-click",t.SCATTER_MOUSEOUT="scatter-mouseout",t))(H8||{}),U8=(t=>(t.POINT_MOUSEOVER="scatter-mouseover",t.POINT_MOUSEMOVE="scatter-mousemove",t.POINT_CLICK="scatter-click",t.POINT_MOUSEOUT="scatter-mouseout",t))(U8||{}),F8=(t=>(t.X_AXIS_MOUSEOVER="radar-x-axis-mouseover",t.X_AXIS_MOUSEMOVE="radar-x-axis-mousemove",t.X_AXIS_CLICK="radar-x-axis-click",t.X_AXIS_MOUSEOUT="radar-x-axis-mouseout",t))(F8||{}),G8=(t=>(t.NODE_MOUSEOVER="tree-node-mouseover",t.NODE_CLICK="tree-node-click",t.NODE_MOUSEOUT="tree-node-mouseout",t))(G8||{}),V8=(t=>(t.LEAF_MOUSEOVER="leaf-mouseover",t.LEAF_MOUSEMOVE="leaf-mousemove",t.LEAF_CLICK="leaf-click",t.LEAF_MOUSEOUT="leaf-mouseout",t))(V8||{}),W8=(t=>(t.SHOW="show-tooltip",t.MOVE="move-tooltip",t.HIDE="hide-tooltip",t))(W8||{}),q8=(t=>(t.SHOW="show-threshold",t.HIDE="hide-threshold",t))(q8||{}),j8=(t=>(t.ITEM_HOVER="legend-item-onhover",t.ITEM_CLICK="legend-item-onclick",t.ITEM_MOUSEOUT="legend-item-onmouseout",t.ITEMS_UPDATE="legend-items-update",t))(j8||{}),Y8=(t=>(t.CIRCLE_MOUSEOVER="circle-leaf-mouseover",t.CIRCLE_CLICK="circle-leaf-click",t.CIRCLE_MOUSEOUT="circle-leaf-mouseout",t.CIRCLE_MOUSEMOVE="circle-leaf-mousemove",t))(Y8||{}),Z8=(t=>(t.NODE_MOUSEOVER="alluvial-node-mouseover",t.NODE_CLICK="alluvial-node-click",t.NODE_MOUSEOUT="alluvial-node-mouseout",t.NODE_MOUSEMOVE="alluvial-node-mousemove",t.LINE_MOUSEOVER="alluvial-line-mouseover",t.LINE_CLICK="alluvial-line-click",t.LINE_MOUSEOUT="alluvial-line-mouseout",t.LINE_MOUSEMOVE="alluvial-line-mousemove",t))(Z8||{}),X8=(t=>(t.METER_MOUSEOVER="meter-mouseover",t.METER_CLICK="meter-click",t.METER_MOUSEOUT="meter-mouseout",t.METER_MOUSEMOVE="meter-mousemove",t))(X8||{}),K8=(t=>(t.HEATMAP_MOUSEOVER="heatmap-mouseover",t.HEATMAP_CLICK="heatmap-click",t.HEATMAP_MOUSEOUT="heatmap-mouseout",t.HEATMAP_MOUSEMOVE="hetmap-mousemove",t))(K8||{}),$8=(t=>(t.CHOROPLETH_MOUSEOVER="choropleth-mouseover",t.CHOROPLETH_CLICK="choropleth-click",t.CHOROPLETH_MOUSEOUT="choropleth-mouseout",t.CHOROPLETH_MOUSEMOVE="choropleth-mousemove",t))($8||{});const SJ=Object.freeze(Object.defineProperty({__proto__:null,Alluvial:Z8,Area:R8,Axis:I8,Bar:B8,Boxplot:z8,CanvasZoom:L8,Chart:S8,Choropleth:$8,CirclePack:Y8,Gauge:N8,Heatmap:K8,Legend:j8,Line:U8,Meter:X8,Modal:E8,Model:M8,Pie:P8,Radar:F8,Scatter:H8,Threshold:q8,Toolbar:O8,Tooltip:W8,Tree:G8,Treemap:V8,WordCloud:D8,ZoomBar:A8,ZoomDomain:C8},Symbol.toStringTag,{value:"Module"})),je=SJ;var wn=(t=>(t.HTML="html",t.SVG="svg",t))(wn||{}),J8=(t=>(t.WHITE="white",t.G100="g100",t.G90="g90",t.G10="g10",t))(J8||{}),Ii=(t=>(t.BACKGROUND="background",t.FILL="fill",t.STROKE="stroke",t.TOOLTIP="tooltip",t))(Ii||{}),it=(t=>(t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom",t))(it||{}),br=(t=>(t.GRAPH_VIEW="graph_view",t.SLIDER_VIEW="slider_view",t))(br||{}),rr=(t=>(t.END_LINE="end_line",t.MID_LINE="mid_line",t.FRONT_LINE="front_line",t.NONE="none",t))(rr||{}),hl=(t=>(t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t))(hl||{}),Nt=(t=>(t.TIME="time",t.LINEAR="linear",t.LOG="log",t.LABELS="labels",t.LABELS_RATIO="labels-ratio",t))(Nt||{}),au=(t=>(t.RIGHT="right",t.LEFT="left",t.TOP="top",t.BOTTOM="bottom",t))(au||{}),jl=(t=>(t.LEFT="left",t.CENTER="center",t.RIGHT="right",t))(jl||{}),bu=(t=>(t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t))(bu||{}),Q8=(t=>(t.TREE="tree",t.DENDROGRAM="dendrogram",t))(Q8||{}),pi=(t=>(t.ROW="row",t.COLUMN="column",t.ROW_REVERSE="row-reverse",t.COLUMN_REVERSE="column-reverse",t))(pi||{}),Nn=(t=>(t.FIXED="fixed",t.PREFERRED="preferred",t.STRETCH="stretch",t))(Nn||{}),vd=(t=>(t.CENTER="center",t))(vd||{}),Uo=(t=>(t.GRID="grid",t.VERT_OR_HORIZ="vertOrHoriz",t.PIE="pie",t.DONUT="donut",t))(Uo||{}),x8=(t=>(t.SEMI="semi",t.FULL="full",t))(x8||{}),nc=(t=>(t.ALWAYS="always",t.AUTO="auto",t.NEVER="never",t))(nc||{}),ps=(t=>(t.SCATTER="scatter",t.LINE="line",t.SIMPLE_BAR="simple-bar",t.STACKED_BAR="stacked-bar",t.GROUPED_BAR="grouped-bar",t.AREA="area",t.STACKED_AREA="stacked-area",t))(ps||{}),Yn=(t=>(t.EXPORT_CSV="Export as CSV",t.EXPORT_PNG="Export as PNG",t.EXPORT_JPG="Export as JPG",t.ZOOM_IN="Zoom in",t.ZOOM_OUT="Zoom out",t.RESET_ZOOM="Reset zoom",t.MAKE_FULLSCREEN="Make fullscreen",t.SHOW_AS_DATATABLE="Show as data-table",t.CUSTOM="Custom",t))(Yn||{}),Qm=(t=>(t.LEFT="left",t.RIGHT="right",t))(Qm||{}),Ti=(t=>(t.CHECKBOX="checkbox",t.RADIUS="radius",t.AREA="area",t.SIZE="size",t.LINE="line",t.QUARTILE="quartile",t.ZOOM="zoom",t))(Ti||{}),eS=(t=>(t.ON="on",t.AUTO="auto",t.OFF="off",t))(eS||{}),i0=(t=>(t.DEFAULT="default",t.HOVERABLE="hoverable",t))(i0||{}),tS=(t=>(t.geoEqualEarth="geoEqualEarth",t.geoAlbers="geoAlbers",t.geoConicEqualArea="geoConicEqualArea",t.geoConicEquidistant="geoConicEquidistant",t.geoEquirectangular="geoEquirectangular",t.geoMercator="geoMercator",t.geoNaturalEarth1="geoNaturalEarth1",t))(tS||{});function ic(t,e){return t==null||e==null?NaN:te?1:t>=e?0:NaN}function EJ(t,e){return t==null||e==null?NaN:et?1:e>=t?0:NaN}function l0(t){let e,n,i;t.length!==2?(e=ic,n=(o,a)=>ic(t(o),a),i=(o,a)=>t(o)-a):(e=t===ic||t===EJ?t:MJ,n=t,i=t);function l(o,a,u=0,f=o.length){if(u>>1;n(o[c],a)<0?u=c+1:f=c}while(u>>1;n(o[c],a)<=0?u=c+1:f=c}while(uu&&i(o[c-1],a)>-i(o[c],a)?c-1:c}return{left:l,center:s,right:r}}function MJ(){return 0}function OJ(t){return t===null?NaN:+t}const AJ=l0(ic),CJ=AJ.right;l0(OJ).center;const nS=CJ;function LJ(t,e){let n=0;if(e===void 0)for(let i of t)i!=null&&(i=+i)>=i&&++n;else{let i=-1;for(let l of t)(l=e(l,++i,t))!=null&&(l=+l)>=l&&++n}return n}function Yo(t,e){let n,i;if(e===void 0)for(const l of t)l!=null&&(n===void 0?l>=l&&(n=i=l):(n>l&&(n=l),i=r&&(n=i=r):(n>r&&(n=r),it}const zJ=Math.sqrt(50),HJ=Math.sqrt(10),UJ=Math.sqrt(2);function Oc(t,e,n){const i=(e-t)/Math.max(0,n),l=Math.floor(Math.log10(i)),r=i/Math.pow(10,l),s=r>=zJ?10:r>=HJ?5:r>=UJ?2:1;let o,a,u;return l<0?(u=Math.pow(10,-l)/s,o=Math.round(t*u),a=Math.round(e*u),o/ue&&--a,u=-u):(u=Math.pow(10,l)*s,o=Math.round(t/u),a=Math.round(e/u),o*ue&&--a),a0))return[];if(t===e)return[t];const i=e=l))return[];const o=r-l+1,a=new Array(o);if(i)if(s<0)for(let u=0;u0?(t=Math.floor(t/l)*l,e=Math.ceil(e/l)*l):l<0&&(t=Math.ceil(t*l)/l,e=Math.floor(e*l)/l),i=l}}function GJ(t){return Math.max(1,Math.ceil(Math.log(LJ(t))/Math.LN2)+1)}function VJ(){var t=PJ,e=Yo,n=GJ;function i(l){Array.isArray(l)||(l=Array.from(l));var r,s=l.length,o,a,u=new Array(s);for(r=0;r=d)if(C>=d&&e===Yo){const M=na(c,d,I);isFinite(M)&&(M>0?d=(Math.floor(d/M)+1)*M:M<0&&(d=(Math.ceil(d*-M)+1)/-M))}else h.pop()}for(var g=h.length,_=0,v=g;h[_]<=c;)++_;for(;h[v-1]>d;)--v;(_||v0?h[r-1]:c,A.x1=r0)for(r=0;r=i)&&(n=i);else{let i=-1;for(let l of t)(l=e(l,++i,t))!=null&&(n=l)&&(n=l)}return n}function qJ(t,e){let n;if(e===void 0)for(const i of t)i!=null&&(n>i||n===void 0&&i>=i)&&(n=i);else{let i=-1;for(let l of t)(l=e(l,++i,t))!=null&&(n>l||n===void 0&&l>=l)&&(n=l)}return n}function jJ(t,e,n){t=+t,e=+e,n=(l=arguments.length)<2?(e=t,t=0,1):l<3?1:+n;for(var i=-1,l=Math.max(0,Math.ceil((e-t)/n))|0,r=new Array(l);++i+t(e)}function $J(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function JJ(){return!this.__axis}function kd(t,e){var n=[],i=null,l=null,r=6,s=6,o=3,a=typeof window<"u"&&window.devicePixelRatio>1?0:.5,u=t===lc||t===tu?-1:1,f=t===tu||t===rc?"x":"y",c=t===lc||t===e1?ZJ:XJ;function d(h){var g=i??(e.ticks?e.ticks.apply(e,n):e.domain()),_=l??(e.tickFormat?e.tickFormat.apply(e,n):YJ),v=Math.max(r,0)+o,S=e.range(),A=+S[0]+a,C=+S[S.length-1]+a,I=(e.bandwidth?$J:KJ)(e.copy(),a),M=h.selection?h.selection():h,L=M.selectAll(".domain").data([null]),N=M.selectAll(".tick").data(g,e).order(),z=N.exit(),W=N.enter().append("g").attr("class","tick"),D=N.select("line"),G=N.select("text");L=L.merge(L.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),N=N.merge(W),D=D.merge(W.append("line").attr("stroke","currentColor").attr(f+"2",u*r)),G=G.merge(W.append("text").attr("fill","currentColor").attr(f,u*v).attr("dy",t===lc?"0em":t===e1?"0.71em":"0.32em")),h!==M&&(L=L.transition(h),N=N.transition(h),D=D.transition(h),G=G.transition(h),z=z.transition(h).attr("opacity",a4).attr("transform",function($){return isFinite($=I($))?c($+a):this.getAttribute("transform")}),W.attr("opacity",a4).attr("transform",function($){var j=this.parentNode.__axis;return c((j&&isFinite(j=j($))?j:I($))+a)})),z.remove(),L.attr("d",t===tu||t===rc?s?"M"+u*s+","+A+"H"+a+"V"+C+"H"+u*s:"M"+a+","+A+"V"+C:s?"M"+A+","+u*s+"V"+a+"H"+C+"V"+u*s:"M"+A+","+a+"H"+C),N.attr("opacity",1).attr("transform",function($){return c(I($)+a)}),D.attr(f+"2",u*r),G.attr(f,u*v).text(_),M.filter(JJ).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===rc?"start":t===tu?"end":"middle"),M.each(function(){this.__axis=I})}return d.scale=function(h){return arguments.length?(e=h,d):e},d.ticks=function(){return n=Array.from(arguments),d},d.tickArguments=function(h){return arguments.length?(n=h==null?[]:Array.from(h),d):n.slice()},d.tickValues=function(h){return arguments.length?(i=h==null?null:Array.from(h),d):i&&i.slice()},d.tickFormat=function(h){return arguments.length?(l=h,d):l},d.tickSize=function(h){return arguments.length?(r=s=+h,d):r},d.tickSizeInner=function(h){return arguments.length?(r=+h,d):r},d.tickSizeOuter=function(h){return arguments.length?(s=+h,d):s},d.tickPadding=function(h){return arguments.length?(o=+h,d):o},d.offset=function(h){return arguments.length?(a=+h,d):a},d}function QJ(t){return kd(lc,t)}function xJ(t){return kd(rc,t)}function iS(t){return kd(e1,t)}function lS(t){return kd(tu,t)}var eQ={value:()=>{}};function r0(){for(var t=0,e=arguments.length,n={},i;t=0&&(i=n.slice(l+1),n=n.slice(0,l)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}sc.prototype=r0.prototype={constructor:sc,on:function(t,e){var n=this._,i=tQ(t+"",n),l,r=-1,s=i.length;if(arguments.length<2){for(;++r0)for(var n=new Array(l),i=0,l,r;i=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),f4.hasOwnProperty(e)?{space:f4[e],local:t}:t}function iQ(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===t1&&e.documentElement.namespaceURI===t1?e.createElement(t):e.createElementNS(n,t)}}function lQ(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function rS(t){var e=wd(t);return(e.local?lQ:iQ)(e)}function rQ(){}function s0(t){return t==null?rQ:function(){return this.querySelector(t)}}function sQ(t){typeof t!="function"&&(t=s0(t));for(var e=this._groups,n=e.length,i=new Array(n),l=0;l=C&&(C=A+1);!(M=v[C])&&++C=0;)(s=i[l])&&(r&&s.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(s,r),r=s);return this}function IQ(t){t||(t=RQ);function e(c,d){return c&&d?t(c.__data__,d.__data__):!c-!d}for(var n=this._groups,i=n.length,l=new Array(i),r=0;re?1:t>=e?0:NaN}function DQ(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function PQ(){return Array.from(this)}function NQ(){for(var t=this._groups,e=0,n=t.length;e1?this.each((e==null?YQ:typeof e=="function"?XQ:ZQ)(t,e,n??"")):ia(this.node(),t)}function ia(t,e){return t.style.getPropertyValue(e)||fS(t).getComputedStyle(t,null).getPropertyValue(e)}function $Q(t){return function(){delete this[t]}}function JQ(t,e){return function(){this[t]=e}}function QQ(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function xQ(t,e){return arguments.length>1?this.each((e==null?$Q:typeof e=="function"?QQ:JQ)(t,e)):this.node()[t]}function cS(t){return t.trim().split(/^|\s+/)}function o0(t){return t.classList||new dS(t)}function dS(t){this._node=t,this._names=cS(t.getAttribute("class")||"")}dS.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function hS(t,e){for(var n=o0(t),i=-1,l=e.length;++i=0&&(n=e.slice(i+1),e=e.slice(0,i)),{type:e,name:n}})}function Ox(t){return function(){var e=this.__on;if(e){for(var n=0,i=-1,l=e.length,r;n>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?qf(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?qf(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Ux.exec(t))?new fl(e[1],e[2],e[3],1):(e=Fx.exec(t))?new fl(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=Gx.exec(t))?qf(e[1],e[2],e[3],e[4]):(e=Vx.exec(t))?qf(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Wx.exec(t))?p4(e[1],e[2]/100,e[3]/100,1):(e=qx.exec(t))?p4(e[1],e[2]/100,e[3]/100,e[4]):c4.hasOwnProperty(t)?m4(c4[t]):t==="transparent"?new fl(NaN,NaN,NaN,0):null}function m4(t){return new fl(t>>16&255,t>>8&255,t&255,1)}function qf(t,e,n,i){return i<=0&&(t=e=n=NaN),new fl(t,e,n,i)}function Zx(t){return t instanceof Gu||(t=to(t)),t?(t=t.rgb(),new fl(t.r,t.g,t.b,t.opacity)):new fl}function l1(t,e,n,i){return arguments.length===1?Zx(t):new fl(t,e,n,i??1)}function fl(t,e,n,i){this.r=+t,this.g=+e,this.b=+n,this.opacity=+i}a0(fl,l1,pS(Gu,{brighter(t){return t=t==null?Lc:Math.pow(Lc,t),new fl(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?vu:Math.pow(vu,t),new fl(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new fl(Xs(this.r),Xs(this.g),Xs(this.b),Ic(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:g4,formatHex:g4,formatHex8:Xx,formatRgb:_4,toString:_4}));function g4(){return`#${Zs(this.r)}${Zs(this.g)}${Zs(this.b)}`}function Xx(){return`#${Zs(this.r)}${Zs(this.g)}${Zs(this.b)}${Zs((isNaN(this.opacity)?1:this.opacity)*255)}`}function _4(){const t=Ic(this.opacity);return`${t===1?"rgb(":"rgba("}${Xs(this.r)}, ${Xs(this.g)}, ${Xs(this.b)}${t===1?")":`, ${t})`}`}function Ic(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Xs(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Zs(t){return t=Xs(t),(t<16?"0":"")+t.toString(16)}function p4(t,e,n,i){return i<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new lr(t,e,n,i)}function bS(t){if(t instanceof lr)return new lr(t.h,t.s,t.l,t.opacity);if(t instanceof Gu||(t=to(t)),!t)return new lr;if(t instanceof lr)return t;t=t.rgb();var e=t.r/255,n=t.g/255,i=t.b/255,l=Math.min(e,n,i),r=Math.max(e,n,i),s=NaN,o=r-l,a=(r+l)/2;return o?(e===r?s=(n-i)/o+(n0&&a<1?0:s,new lr(s,o,a,t.opacity)}function Kx(t,e,n,i){return arguments.length===1?bS(t):new lr(t,e,n,i??1)}function lr(t,e,n,i){this.h=+t,this.s=+e,this.l=+n,this.opacity=+i}a0(lr,Kx,pS(Gu,{brighter(t){return t=t==null?Lc:Math.pow(Lc,t),new lr(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?vu:Math.pow(vu,t),new lr(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,i=n+(n<.5?n:1-n)*e,l=2*n-i;return new fl(am(t>=240?t-240:t+120,l,i),am(t,l,i),am(t<120?t+240:t-120,l,i),this.opacity)},clamp(){return new lr(b4(this.h),jf(this.s),jf(this.l),Ic(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Ic(this.opacity);return`${t===1?"hsl(":"hsla("}${b4(this.h)}, ${jf(this.s)*100}%, ${jf(this.l)*100}%${t===1?")":`, ${t})`}`}}));function b4(t){return t=(t||0)%360,t<0?t+360:t}function jf(t){return Math.max(0,Math.min(1,t||0))}function am(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const u0=t=>()=>t;function $x(t,e){return function(n){return t+n*e}}function Jx(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(i){return Math.pow(t+i*e,n)}}function Qx(t){return(t=+t)==1?vS:function(e,n){return n-e?Jx(e,n,t):u0(isNaN(e)?n:e)}}function vS(t,e){var n=e-t;return n?$x(t,n):u0(isNaN(t)?e:t)}const Rc=function t(e){var n=Qx(e);function i(l,r){var s=n((l=l1(l)).r,(r=l1(r)).r),o=n(l.g,r.g),a=n(l.b,r.b),u=vS(l.opacity,r.opacity);return function(f){return l.r=s(f),l.g=o(f),l.b=a(f),l.opacity=u(f),l+""}}return i.gamma=t,i}(1);function xx(t,e){e||(e=[]);var n=t?Math.min(e.length,t.length):0,i=e.slice(),l;return function(r){for(l=0;ln&&(r=e.slice(n,r),o[s]?o[s]+=r:o[++s]=r),(i=i[0])===(l=l[0])?o[s]?o[s]+=l:o[++s]=l:(o[++s]=null,a.push({i:s,x:ir(i,l)})),n=um.lastIndex;return n180?f+=360:f-u>180&&(u+=360),d.push({i:c.push(l(c)+"rotate(",null,i)-2,x:ir(u,f)})):f&&c.push(l(c)+"rotate("+f+i)}function o(u,f,c,d){u!==f?d.push({i:c.push(l(c)+"skewX(",null,i)-2,x:ir(u,f)}):f&&c.push(l(c)+"skewX("+f+i)}function a(u,f,c,d,h,g){if(u!==c||f!==d){var _=h.push(l(h)+"scale(",null,",",null,")");g.push({i:_-4,x:ir(u,c)},{i:_-2,x:ir(f,d)})}else(c!==1||d!==1)&&h.push(l(h)+"scale("+c+","+d+")")}return function(u,f){var c=[],d=[];return u=t(u),f=t(f),r(u.translateX,u.translateY,f.translateX,f.translateY,c,d),s(u.rotate,f.rotate,c,d),o(u.skewX,f.skewX,c,d),a(u.scaleX,u.scaleY,f.scaleX,f.scaleY,c,d),u=f=null,function(h){for(var g=-1,_=d.length,v;++g<_;)c[(v=d[g]).i]=v.x(h);return c.join("")}}}var uee=yS(oee,"px, ","px)","deg)"),fee=yS(aee,", ",")",")"),la=0,nu=0,ja=0,TS=1e3,Dc,iu,Pc=0,no=0,Td=0,wu=typeof performance=="object"&&performance.now?performance:Date,SS=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function f0(){return no||(SS(cee),no=wu.now()+Td)}function cee(){no=0}function Nc(){this._call=this._time=this._next=null}Nc.prototype=ES.prototype={constructor:Nc,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?f0():+n)+(e==null?0:+e),!this._next&&iu!==this&&(iu?iu._next=this:Dc=this,iu=this),this._call=t,this._time=n,o1()},stop:function(){this._call&&(this._call=null,this._time=1/0,o1())}};function ES(t,e,n){var i=new Nc;return i.restart(t,e,n),i}function dee(){f0(),++la;for(var t=Dc,e;t;)(e=no-t._time)>=0&&t._call.call(void 0,e),t=t._next;--la}function k4(){no=(Pc=wu.now())+Td,la=nu=0;try{dee()}finally{la=0,mee(),no=0}}function hee(){var t=wu.now(),e=t-Pc;e>TS&&(Td-=e,Pc=t)}function mee(){for(var t,e=Dc,n,i=1/0;e;)e._call?(i>e._time&&(i=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Dc=n);iu=t,o1(i)}function o1(t){if(!la){nu&&(nu=clearTimeout(nu));var e=t-no;e>24?(t<1/0&&(nu=setTimeout(k4,t-wu.now()-Td)),ja&&(ja=clearInterval(ja))):(ja||(Pc=wu.now(),ja=setInterval(hee,TS)),la=1,SS(k4))}}function w4(t,e,n){var i=new Nc;return e=e==null?0:+e,i.restart(l=>{i.stop(),t(l+e)},e,n),i}var gee=r0("start","end","cancel","interrupt"),_ee=[],MS=0,y4=1,a1=2,oc=3,T4=4,u1=5,ac=6;function Sd(t,e,n,i,l,r){var s=t.__transition;if(!s)t.__transition={};else if(n in s)return;pee(t,n,{name:e,index:i,group:l,on:gee,tween:_ee,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:MS})}function c0(t,e){var n=or(t,e);if(n.state>MS)throw new Error("too late; already scheduled");return n}function Tr(t,e){var n=or(t,e);if(n.state>oc)throw new Error("too late; already running");return n}function or(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function pee(t,e,n){var i=t.__transition,l;i[e]=n,n.timer=ES(r,0,n.time);function r(u){n.state=y4,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var f,c,d,h;if(n.state!==y4)return a();for(f in i)if(h=i[f],h.name===n.name){if(h.state===oc)return w4(s);h.state===T4?(h.state=ac,h.timer.stop(),h.on.call("interrupt",t,t.__data__,h.index,h.group),delete i[f]):+fa1&&i.state=0&&(e=e.slice(0,n)),!e||e==="start"})}function Zee(t,e,n){var i,l,r=Yee(e)?c0:Tr;return function(){var s=r(this,t),o=s.on;o!==i&&(l=(i=o).copy()).on(e,n),s.on=l}}function Xee(t,e){var n=this._id;return arguments.length<2?or(this.node(),n).on.on(t):this.each(Zee(n,t,e))}function Kee(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function $ee(){return this.on("end.remove",Kee(this._id))}function Jee(t){var e=this._name,n=this._id;typeof t!="function"&&(t=s0(t));for(var i=this._groups,l=i.length,r=new Array(l),s=0;s+t;function LS(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var vte={time:null,delay:0,duration:250,ease:LS};function kte(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function wte(t){var e,n;t instanceof Yr?(e=t._id,t=t._name):(e=CS(),(n=vte).time=f0(),t=t==null?null:t+"");for(var i=this._groups,l=i.length,r=0;r()=>t;function yte(t,{sourceEvent:e,target:n,selection:i,mode:l,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},selection:{value:i,enumerable:!0,configurable:!0},mode:{value:l,enumerable:!0,configurable:!0},_:{value:r}})}function Tte(t){t.stopImmediatePropagation()}function cm(t){t.preventDefault(),t.stopImmediatePropagation()}var S4={name:"drag"},dm={name:"space"},Do={name:"handle"},Po={name:"center"};const{abs:E4,max:Hi,min:Ui}=Math;function M4(t){return[+t[0],+t[1]]}function O4(t){return[M4(t[0]),M4(t[1])]}var uc={name:"x",handles:["w","e"].map(Bc),input:function(t,e){return t==null?null:[[+t[0],e[0][1]],[+t[1],e[1][1]]]},output:function(t){return t&&[t[0][0],t[1][0]]}},hm={name:"y",handles:["n","s"].map(Bc),input:function(t,e){return t==null?null:[[e[0][0],+t[0]],[e[1][0],+t[1]]]},output:function(t){return t&&[t[0][1],t[1][1]]}},zr={overlay:"crosshair",selection:"move",n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},A4={e:"w",w:"e",nw:"ne",ne:"nw",se:"sw",sw:"se"},C4={n:"s",s:"n",nw:"sw",ne:"se",se:"ne",sw:"nw"},Ste={overlay:1,selection:1,n:null,e:1,s:null,w:-1,nw:-1,ne:1,se:1,sw:-1},Ete={overlay:1,selection:1,n:-1,e:null,s:1,w:null,nw:-1,ne:-1,se:1,sw:1};function Bc(t){return{type:t}}function Mte(t){return!t.ctrlKey&&!t.button}function Ote(){var t=this.ownerSVGElement||this;return t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]}function Ate(){return navigator.maxTouchPoints||"ontouchstart"in this}function mm(t){for(;!t.__brush;)if(!(t=t.parentNode))return;return t.__brush}function Cte(t){return t[0][0]===t[1][0]||t[0][1]===t[1][1]}function IS(){return Lte(uc)}function Lte(t){var e=Ote,n=Mte,i=Ate,l=!0,r=r0("start","brush","end"),s=6,o;function a(v){var S=v.property("__brush",_).selectAll(".overlay").data([Bc("overlay")]);S.enter().append("rect").attr("class","overlay").attr("pointer-events","all").attr("cursor",zr.overlay).merge(S).each(function(){var C=mm(this).extent;ht(this).attr("x",C[0][0]).attr("y",C[0][1]).attr("width",C[1][0]-C[0][0]).attr("height",C[1][1]-C[0][1])}),v.selectAll(".selection").data([Bc("selection")]).enter().append("rect").attr("class","selection").attr("cursor",zr.selection).attr("fill","#777").attr("fill-opacity",.3).attr("stroke","#fff").attr("shape-rendering","crispEdges");var A=v.selectAll(".handle").data(t.handles,function(C){return C.type});A.exit().remove(),A.enter().append("rect").attr("class",function(C){return"handle handle--"+C.type}).attr("cursor",function(C){return zr[C.type]}),v.each(u).attr("fill","none").attr("pointer-events","all").on("mousedown.brush",d).filter(i).on("touchstart.brush",d).on("touchmove.brush",h).on("touchend.brush touchcancel.brush",g).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}a.move=function(v,S,A){v.tween?v.on("start.brush",function(C){f(this,arguments).beforestart().start(C)}).on("interrupt.brush end.brush",function(C){f(this,arguments).end(C)}).tween("brush",function(){var C=this,I=C.__brush,M=f(C,arguments),L=I.selection,N=t.input(typeof S=="function"?S.apply(this,arguments):S,I.extent),z=yd(L,N);function W(D){I.selection=D===1&&N===null?null:z(D),u.call(C),M.brush()}return L!==null&&N!==null?W:W(1)}):v.each(function(){var C=this,I=arguments,M=C.__brush,L=t.input(typeof S=="function"?S.apply(C,I):S,M.extent),N=f(C,I).beforestart();f1(C),M.selection=L===null?null:L,u.call(C),N.start(A).brush(A).end(A)})},a.clear=function(v,S){a.move(v,null,S)};function u(){var v=ht(this),S=mm(this).selection;S?(v.selectAll(".selection").style("display",null).attr("x",S[0][0]).attr("y",S[0][1]).attr("width",S[1][0]-S[0][0]).attr("height",S[1][1]-S[0][1]),v.selectAll(".handle").style("display",null).attr("x",function(A){return A.type[A.type.length-1]==="e"?S[1][0]-s/2:S[0][0]-s/2}).attr("y",function(A){return A.type[0]==="s"?S[1][1]-s/2:S[0][1]-s/2}).attr("width",function(A){return A.type==="n"||A.type==="s"?S[1][0]-S[0][0]+s:s}).attr("height",function(A){return A.type==="e"||A.type==="w"?S[1][1]-S[0][1]+s:s})):v.selectAll(".selection,.handle").style("display","none").attr("x",null).attr("y",null).attr("width",null).attr("height",null)}function f(v,S,A){var C=v.__brush.emitter;return C&&(!A||!C.clean)?C:new c(v,S,A)}function c(v,S,A){this.that=v,this.args=S,this.state=v.__brush,this.active=0,this.clean=A}c.prototype={beforestart:function(){return++this.active===1&&(this.state.emitter=this,this.starting=!0),this},start:function(v,S){return this.starting?(this.starting=!1,this.emit("start",v,S)):this.emit("brush",v),this},brush:function(v,S){return this.emit("brush",v,S),this},end:function(v,S){return--this.active===0&&(delete this.state.emitter,this.emit("end",v,S)),this},emit:function(v,S,A){var C=ht(this.that).datum();r.call(v,this.that,new yte(v,{sourceEvent:S,target:a,selection:t.output(this.state.selection),mode:A,dispatch:r}),C)}};function d(v){if(o&&!v.touches||!n.apply(this,arguments))return;var S=this,A=v.target.__data__.type,C=(l&&v.metaKey?A="overlay":A)==="selection"?S4:l&&v.altKey?Po:Do,I=t===hm?null:Ste[A],M=t===uc?null:Ete[A],L=mm(S),N=L.extent,z=L.selection,W=N[0][0],D,G,$=N[0][1],j,Q,le=N[1][0],oe,X,de=N[1][1],re,x,me=0,ee=0,ke,pe=I&&M&&l&&v.shiftKey,Fe,Ve,Ee=Array.from(v.touches||[v],at=>{const ut=at.identifier;return at=eo(at,S),at.point0=at.slice(),at.identifier=ut,at});f1(S);var We=f(S,arguments,!0).beforestart();if(A==="overlay"){z&&(ke=!0);const at=[Ee[0],Ee[1]||Ee[0]];L.selection=z=[[D=t===hm?W:Ui(at[0][0],at[1][0]),j=t===uc?$:Ui(at[0][1],at[1][1])],[oe=t===hm?le:Hi(at[0][0],at[1][0]),re=t===uc?de:Hi(at[0][1],at[1][1])]],Ee.length>1&&nt(v)}else D=z[0][0],j=z[0][1],oe=z[1][0],re=z[1][1];G=D,Q=j,X=oe,x=re;var ge=ht(S).attr("pointer-events","none"),ve=ge.selectAll(".overlay").attr("cursor",zr[A]);if(v.touches)We.moved=ue,We.ended=Oe;else{var be=ht(v.view).on("mousemove.brush",ue,!0).on("mouseup.brush",Oe,!0);l&&be.on("keydown.brush",dt,!0).on("keyup.brush",yt,!0),Bx(v.view)}u.call(S),We.start(v,C.name);function ue(at){for(const ut of at.changedTouches||[at])for(const At of Ee)At.identifier===ut.identifier&&(At.cur=eo(ut,S));if(pe&&!Fe&&!Ve&&Ee.length===1){const ut=Ee[0];E4(ut.cur[0]-ut[0])>E4(ut.cur[1]-ut[1])?Ve=!0:Fe=!0}for(const ut of Ee)ut.cur&&(ut[0]=ut.cur[0],ut[1]=ut.cur[1]);ke=!0,cm(at),nt(at)}function nt(at){const ut=Ee[0],At=ut.point0;var xe;switch(me=ut[0]-At[0],ee=ut[1]-At[1],C){case dm:case S4:{I&&(me=Hi(W-D,Ui(le-oe,me)),G=D+me,X=oe+me),M&&(ee=Hi($-j,Ui(de-re,ee)),Q=j+ee,x=re+ee);break}case Do:{Ee[1]?(I&&(G=Hi(W,Ui(le,Ee[0][0])),X=Hi(W,Ui(le,Ee[1][0])),I=1),M&&(Q=Hi($,Ui(de,Ee[0][1])),x=Hi($,Ui(de,Ee[1][1])),M=1)):(I<0?(me=Hi(W-D,Ui(le-D,me)),G=D+me,X=oe):I>0&&(me=Hi(W-oe,Ui(le-oe,me)),G=D,X=oe+me),M<0?(ee=Hi($-j,Ui(de-j,ee)),Q=j+ee,x=re):M>0&&(ee=Hi($-re,Ui(de-re,ee)),Q=j,x=re+ee));break}case Po:{I&&(G=Hi(W,Ui(le,D-me*I)),X=Hi(W,Ui(le,oe+me*I))),M&&(Q=Hi($,Ui(de,j-ee*M)),x=Hi($,Ui(de,re+ee*M)));break}}X0&&(D=G-me),M<0?re=x-ee:M>0&&(j=Q-ee),C=dm,ve.attr("cursor",zr.selection),nt(at));break}default:return}cm(at)}function yt(at){switch(at.keyCode){case 16:{pe&&(Fe=Ve=pe=!1,nt(at));break}case 18:{C===Po&&(I<0?oe=X:I>0&&(D=G),M<0?re=x:M>0&&(j=Q),C=Do,nt(at));break}case 32:{C===dm&&(at.altKey?(I&&(oe=X-me*I,D=G+me*I),M&&(re=x-ee*M,j=Q+ee*M),C=Po):(I<0?oe=X:I>0&&(D=G),M<0?re=x:M>0&&(j=Q),C=Do),ve.attr("cursor",zr[A]),nt(at));break}default:return}cm(at)}}function h(v){f(this,arguments).moved(v)}function g(v){f(this,arguments).ended(v)}function _(){var v=this.__brush||{selection:null};return v.extent=O4(e.apply(this,arguments)),v.dim=t,v}return a.extent=function(v){return arguments.length?(e=typeof v=="function"?v:fm(O4(v)),a):e},a.filter=function(v){return arguments.length?(n=typeof v=="function"?v:fm(!!v),a):n},a.touchable=function(v){return arguments.length?(i=typeof v=="function"?v:fm(!!v),a):i},a.handleSize=function(v){return arguments.length?(s=+v,a):s},a.keyModifiers=function(v){return arguments.length?(l=!!v,a):l},a.on=function(){var v=r.on.apply(r,arguments);return v===r?a:v},a}const c1=Math.PI,d1=2*c1,Vs=1e-6,Ite=d1-Vs;function RS(t){this._+=t[0];for(let e=1,n=t.length;e=0))throw new Error(`invalid digits: ${t}`);if(e>15)return RS;const n=10**e;return function(i){this._+=i[0];for(let l=1,r=i.length;lVs)if(!(Math.abs(c*a-u*f)>Vs)||!r)this._append`L${this._x1=e},${this._y1=n}`;else{let h=i-s,g=l-o,_=a*a+u*u,v=h*h+g*g,S=Math.sqrt(_),A=Math.sqrt(d),C=r*Math.tan((c1-Math.acos((_+d-v)/(2*S*A)))/2),I=C/A,M=C/S;Math.abs(I-1)>Vs&&this._append`L${e+I*f},${n+I*c}`,this._append`A${r},${r},0,0,${+(c*h>f*g)},${this._x1=e+M*a},${this._y1=n+M*u}`}}arc(e,n,i,l,r,s){if(e=+e,n=+n,i=+i,s=!!s,i<0)throw new Error(`negative radius: ${i}`);let o=i*Math.cos(l),a=i*Math.sin(l),u=e+o,f=n+a,c=1^s,d=s?l-r:r-l;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>Vs||Math.abs(this._y1-f)>Vs)&&this._append`L${u},${f}`,i&&(d<0&&(d=d%d1+d1),d>Ite?this._append`A${i},${i},0,1,${c},${e-o},${n-a}A${i},${i},0,1,${c},${this._x1=u},${this._y1=f}`:d>Vs&&this._append`A${i},${i},0,${+(d>=c1)},${c},${this._x1=e+i*Math.cos(r)},${this._y1=n+i*Math.sin(r)}`)}rect(e,n,i,l){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+n}h${i=+i}v${+l}h${-i}Z`}toString(){return this._}}function Pte(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function zc(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,i=t.slice(0,n);return[i.length>1?i[0]+i.slice(2):i,+t.slice(n+1)]}function ra(t){return t=zc(Math.abs(t)),t?t[1]:NaN}function Nte(t,e){return function(n,i){for(var l=n.length,r=[],s=0,o=t[0],a=0;l>0&&o>0&&(a+o+1>i&&(o=Math.max(1,i-a)),r.push(n.substring(l-=o,l+o)),!((a+=o+1)>i));)o=t[s=(s+1)%t.length];return r.reverse().join(e)}}function Bte(t){return function(e){return e.replace(/[0-9]/g,function(n){return t[+n]})}}var zte=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function yu(t){if(!(e=zte.exec(t)))throw new Error("invalid format: "+t);var e;return new h0({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}yu.prototype=h0.prototype;function h0(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}h0.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Hte(t){e:for(var e=t.length,n=1,i=-1,l;n0&&(i=0);break}return i>0?t.slice(0,i)+t.slice(l+1):t}var DS;function Ute(t,e){var n=zc(t,e);if(!n)return t+"";var i=n[0],l=n[1],r=l-(DS=Math.max(-8,Math.min(8,Math.floor(l/3)))*3)+1,s=i.length;return r===s?i:r>s?i+new Array(r-s+1).join("0"):r>0?i.slice(0,r)+"."+i.slice(r):"0."+new Array(1-r).join("0")+zc(t,Math.max(0,e+r-1))[0]}function L4(t,e){var n=zc(t,e);if(!n)return t+"";var i=n[0],l=n[1];return l<0?"0."+new Array(-l).join("0")+i:i.length>l+1?i.slice(0,l+1)+"."+i.slice(l+1):i+new Array(l-i.length+2).join("0")}const I4={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Pte,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>L4(t*100,e),r:L4,s:Ute,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function R4(t){return t}var D4=Array.prototype.map,P4=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Fte(t){var e=t.grouping===void 0||t.thousands===void 0?R4:Nte(D4.call(t.grouping,Number),t.thousands+""),n=t.currency===void 0?"":t.currency[0]+"",i=t.currency===void 0?"":t.currency[1]+"",l=t.decimal===void 0?".":t.decimal+"",r=t.numerals===void 0?R4:Bte(D4.call(t.numerals,String)),s=t.percent===void 0?"%":t.percent+"",o=t.minus===void 0?"−":t.minus+"",a=t.nan===void 0?"NaN":t.nan+"";function u(c){c=yu(c);var d=c.fill,h=c.align,g=c.sign,_=c.symbol,v=c.zero,S=c.width,A=c.comma,C=c.precision,I=c.trim,M=c.type;M==="n"?(A=!0,M="g"):I4[M]||(C===void 0&&(C=12),I=!0,M="g"),(v||d==="0"&&h==="=")&&(v=!0,d="0",h="=");var L=_==="$"?n:_==="#"&&/[boxX]/.test(M)?"0"+M.toLowerCase():"",N=_==="$"?i:/[%p]/.test(M)?s:"",z=I4[M],W=/[defgprs%]/.test(M);C=C===void 0?6:/[gprs]/.test(M)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function D(G){var $=L,j=N,Q,le,oe;if(M==="c")j=z(G)+j,G="";else{G=+G;var X=G<0||1/G<0;if(G=isNaN(G)?a:z(Math.abs(G),C),I&&(G=Hte(G)),X&&+G==0&&g!=="+"&&(X=!1),$=(X?g==="("?g:o:g==="-"||g==="("?"":g)+$,j=(M==="s"?P4[8+DS/3]:"")+j+(X&&g==="("?")":""),W){for(Q=-1,le=G.length;++Qoe||oe>57){j=(oe===46?l+G.slice(Q+1):G.slice(Q))+j,G=G.slice(0,Q);break}}}A&&!v&&(G=e(G,1/0));var de=$.length+G.length+j.length,re=de>1)+$+G+j+re.slice(de);break;default:G=re+$+G+j;break}return r(G)}return D.toString=function(){return c+""},D}function f(c,d){var h=u((c=yu(c),c.type="f",c)),g=Math.max(-8,Math.min(8,Math.floor(ra(d)/3)))*3,_=Math.pow(10,-g),v=P4[8+g/3];return function(S){return h(_*S)+v}}return{format:u,formatPrefix:f}}var Zf,m0,PS;Gte({thousands:",",grouping:[3],currency:["$",""]});function Gte(t){return Zf=Fte(t),m0=Zf.format,PS=Zf.formatPrefix,Zf}function Vte(t){return Math.max(0,-ra(Math.abs(t)))}function Wte(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ra(e)/3)))*3-ra(Math.abs(t)))}function qte(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,ra(e)-ra(t))+1}function Vu(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}const N4=Symbol("implicit");function g0(){var t=new s4,e=[],n=[],i=N4;function l(r){let s=t.get(r);if(s===void 0){if(i!==N4)return i;t.set(r,s=e.push(r)-1)}return n[s%n.length]}return l.domain=function(r){if(!arguments.length)return e.slice();e=[],t=new s4;for(const s of r)t.has(s)||t.set(s,e.push(s)-1);return l},l.range=function(r){return arguments.length?(n=Array.from(r),l):n.slice()},l.unknown=function(r){return arguments.length?(i=r,l):i},l.copy=function(){return g0(e,n).unknown(i)},Vu.apply(l,arguments),l}function _0(){var t=g0().unknown(void 0),e=t.domain,n=t.range,i=0,l=1,r,s,o=!1,a=0,u=0,f=.5;delete t.unknown;function c(){var d=e().length,h=le&&(n=t,t=e,e=n),function(i){return Math.max(t,Math.min(e,i))}}function Xte(t,e,n){var i=t[0],l=t[1],r=e[0],s=e[1];return l2?Kte:Xte,a=u=null,c}function c(d){return d==null||isNaN(d=+d)?r:(a||(a=o(t.map(i),e,n)))(i(s(d)))}return c.invert=function(d){return s(l((u||(u=o(e,t.map(i),ir)))(d)))},c.domain=function(d){return arguments.length?(t=Array.from(d,Yte),f()):t.slice()},c.range=function(d){return arguments.length?(e=Array.from(d),f()):e.slice()},c.rangeRound=function(d){return e=Array.from(d),n=see,f()},c.clamp=function(d){return arguments.length?(s=d?!0:Fo,f()):s!==Fo},c.interpolate=function(d){return arguments.length?(n=d,f()):n},c.unknown=function(d){return arguments.length?(r=d,c):r},function(d,h){return i=d,l=h,f()}}function BS(){return NS()(Fo,Fo)}function $te(t,e,n,i){var l=xm(t,e,n),r;switch(i=yu(i??",f"),i.type){case"s":{var s=Math.max(Math.abs(t),Math.abs(e));return i.precision==null&&!isNaN(r=Wte(l,s))&&(i.precision=r),PS(i,s)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(r=qte(l,Math.max(Math.abs(t),Math.abs(e))))&&(i.precision=r-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(r=Vte(l))&&(i.precision=r-(i.type==="%")*2);break}}return m0(i)}function Jte(t){var e=t.domain;return t.ticks=function(n){var i=e();return Ac(i[0],i[i.length-1],n??10)},t.tickFormat=function(n,i){var l=e();return $te(l[0],l[l.length-1],n??10,i)},t.nice=function(n){n==null&&(n=10);var i=e(),l=0,r=i.length-1,s=i[l],o=i[r],a,u,f=10;for(o0;){if(u=na(s,o,n),u===a)return i[l]=s,i[r]=o,e(i);if(u>0)s=Math.floor(s/u)*u,o=Math.ceil(o/u)*u;else if(u<0)s=Math.ceil(s*u)/u,o=Math.floor(o*u)/u;else break;a=u}return t},t}function Hc(){var t=BS();return t.copy=function(){return p0(t,Hc())},Vu.apply(t,arguments),Jte(t)}function zS(t,e){t=t.slice();var n=0,i=t.length-1,l=t[n],r=t[i],s;return rMath.pow(t,e)}function nne(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function U4(t){return(e,n)=>-t(-e,n)}function ine(t){const e=t(z4,H4),n=e.domain;let i=10,l,r;function s(){return l=nne(i),r=tne(i),n()[0]<0?(l=U4(l),r=U4(r),t(Qte,xte)):t(z4,H4),e}return e.base=function(o){return arguments.length?(i=+o,s()):i},e.domain=function(o){return arguments.length?(n(o),s()):n()},e.ticks=o=>{const a=n();let u=a[0],f=a[a.length-1];const c=f0){for(;d<=h;++d)for(g=1;gf)break;S.push(_)}}else for(;d<=h;++d)for(g=i-1;g>=1;--g)if(_=d>0?g/r(-d):g*r(d),!(_f)break;S.push(_)}S.length*2{if(o==null&&(o=10),a==null&&(a=i===10?"s":","),typeof a!="function"&&(!(i%1)&&(a=yu(a)).precision==null&&(a.trim=!0),a=m0(a)),o===1/0)return a;const u=Math.max(1,i*o/e.ticks().length);return f=>{let c=f/r(Math.round(l(f)));return c*in(zS(n(),{floor:o=>r(Math.floor(l(o))),ceil:o=>r(Math.ceil(l(o)))})),e}function HS(){const t=ine(NS()).domain([1,10]);return t.copy=()=>p0(t,HS()).base(t.base()),Vu.apply(t,arguments),t}const gm=new Date,_m=new Date;function ki(t,e,n,i){function l(r){return t(r=arguments.length===0?new Date:new Date(+r)),r}return l.floor=r=>(t(r=new Date(+r)),r),l.ceil=r=>(t(r=new Date(r-1)),e(r,1),t(r),r),l.round=r=>{const s=l(r),o=l.ceil(r);return r-s(e(r=new Date(+r),s==null?1:Math.floor(s)),r),l.range=(r,s,o)=>{const a=[];if(r=l.ceil(r),o=o==null?1:Math.floor(o),!(r0))return a;let u;do a.push(u=new Date(+r)),e(r,o),t(r);while(uki(s=>{if(s>=s)for(;t(s),!r(s);)s.setTime(s-1)},(s,o)=>{if(s>=s)if(o<0)for(;++o<=0;)for(;e(s,-1),!r(s););else for(;--o>=0;)for(;e(s,1),!r(s););}),n&&(l.count=(r,s)=>(gm.setTime(+r),_m.setTime(+s),t(gm),t(_m),Math.floor(n(gm,_m))),l.every=r=>(r=Math.floor(r),!isFinite(r)||!(r>0)?null:r>1?l.filter(i?s=>i(s)%r===0:s=>l.count(0,s)%r===0):l)),l}const Uc=ki(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);Uc.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ki(e=>{e.setTime(Math.floor(e/t)*t)},(e,n)=>{e.setTime(+e+n*t)},(e,n)=>(n-e)/t):Uc);Uc.range;const Wr=1e3,Vl=Wr*60,qr=Vl*60,Zr=qr*24,b0=Zr*7,F4=Zr*30,pm=Zr*365,Go=ki(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*Wr)},(t,e)=>(e-t)/Wr,t=>t.getUTCSeconds());Go.range;const v0=ki(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Wr)},(t,e)=>{t.setTime(+t+e*Vl)},(t,e)=>(e-t)/Vl,t=>t.getMinutes());v0.range;const lne=ki(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Vl)},(t,e)=>(e-t)/Vl,t=>t.getUTCMinutes());lne.range;const k0=ki(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*Wr-t.getMinutes()*Vl)},(t,e)=>{t.setTime(+t+e*qr)},(t,e)=>(e-t)/qr,t=>t.getHours());k0.range;const rne=ki(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*qr)},(t,e)=>(e-t)/qr,t=>t.getUTCHours());rne.range;const Wu=ki(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Vl)/Zr,t=>t.getDate()-1);Wu.range;const w0=ki(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Zr,t=>t.getUTCDate()-1);w0.range;const sne=ki(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Zr,t=>Math.floor(t/Zr));sne.range;function uo(t){return ki(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,n)=>{e.setDate(e.getDate()+n*7)},(e,n)=>(n-e-(n.getTimezoneOffset()-e.getTimezoneOffset())*Vl)/b0)}const Ed=uo(0),Fc=uo(1),one=uo(2),ane=uo(3),sa=uo(4),une=uo(5),fne=uo(6);Ed.range;Fc.range;one.range;ane.range;sa.range;une.range;fne.range;function fo(t){return ki(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCDate(e.getUTCDate()+n*7)},(e,n)=>(n-e)/b0)}const US=fo(0),Gc=fo(1),cne=fo(2),dne=fo(3),oa=fo(4),hne=fo(5),mne=fo(6);US.range;Gc.range;cne.range;dne.range;oa.range;hne.range;mne.range;const y0=ki(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());y0.range;const gne=ki(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());gne.range;const Xr=ki(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Xr.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ki(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,n)=>{e.setFullYear(e.getFullYear()+n*t)});Xr.range;const io=ki(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());io.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ki(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)});io.range;function _ne(t,e,n,i,l,r){const s=[[Go,1,Wr],[Go,5,5*Wr],[Go,15,15*Wr],[Go,30,30*Wr],[r,1,Vl],[r,5,5*Vl],[r,15,15*Vl],[r,30,30*Vl],[l,1,qr],[l,3,3*qr],[l,6,6*qr],[l,12,12*qr],[i,1,Zr],[i,2,2*Zr],[n,1,b0],[e,1,F4],[e,3,3*F4],[t,1,pm]];function o(u,f,c){const d=fv).right(s,d);if(h===s.length)return t.every(xm(u/pm,f/pm,c));if(h===0)return Uc.every(Math.max(xm(u,f,c),1));const[g,_]=s[d/s[h-1][2]53)return null;"w"in ue||(ue.w=1),"Z"in ue?(Oe=vm(Ya(ue.y,0,1)),dt=Oe.getUTCDay(),Oe=dt>4||dt===0?Gc.ceil(Oe):Gc(Oe),Oe=w0.offset(Oe,(ue.V-1)*7),ue.y=Oe.getUTCFullYear(),ue.m=Oe.getUTCMonth(),ue.d=Oe.getUTCDate()+(ue.w+6)%7):(Oe=bm(Ya(ue.y,0,1)),dt=Oe.getDay(),Oe=dt>4||dt===0?Fc.ceil(Oe):Fc(Oe),Oe=Wu.offset(Oe,(ue.V-1)*7),ue.y=Oe.getFullYear(),ue.m=Oe.getMonth(),ue.d=Oe.getDate()+(ue.w+6)%7)}else("W"in ue||"U"in ue)&&("w"in ue||(ue.w="u"in ue?ue.u%7:"W"in ue?1:0),dt="Z"in ue?vm(Ya(ue.y,0,1)).getUTCDay():bm(Ya(ue.y,0,1)).getDay(),ue.m=0,ue.d="W"in ue?(ue.w+6)%7+ue.W*7-(dt+5)%7:ue.w+ue.U*7-(dt+6)%7);return"Z"in ue?(ue.H+=ue.Z/100|0,ue.M+=ue.Z%100,vm(ue)):bm(ue)}}function z(ge,ve,be,ue){for(var nt=0,Oe=ve.length,dt=be.length,yt,at;nt=dt)return-1;if(yt=ve.charCodeAt(nt++),yt===37){if(yt=ve.charAt(nt++),at=M[yt in G4?ve.charAt(nt++):yt],!at||(ue=at(ge,be,ue))<0)return-1}else if(yt!=be.charCodeAt(ue++))return-1}return ue}function W(ge,ve,be){var ue=u.exec(ve.slice(be));return ue?(ge.p=f.get(ue[0].toLowerCase()),be+ue[0].length):-1}function D(ge,ve,be){var ue=h.exec(ve.slice(be));return ue?(ge.w=g.get(ue[0].toLowerCase()),be+ue[0].length):-1}function G(ge,ve,be){var ue=c.exec(ve.slice(be));return ue?(ge.w=d.get(ue[0].toLowerCase()),be+ue[0].length):-1}function $(ge,ve,be){var ue=S.exec(ve.slice(be));return ue?(ge.m=A.get(ue[0].toLowerCase()),be+ue[0].length):-1}function j(ge,ve,be){var ue=_.exec(ve.slice(be));return ue?(ge.m=v.get(ue[0].toLowerCase()),be+ue[0].length):-1}function Q(ge,ve,be){return z(ge,e,ve,be)}function le(ge,ve,be){return z(ge,n,ve,be)}function oe(ge,ve,be){return z(ge,i,ve,be)}function X(ge){return s[ge.getDay()]}function de(ge){return r[ge.getDay()]}function re(ge){return a[ge.getMonth()]}function x(ge){return o[ge.getMonth()]}function me(ge){return l[+(ge.getHours()>=12)]}function ee(ge){return 1+~~(ge.getMonth()/3)}function ke(ge){return s[ge.getUTCDay()]}function pe(ge){return r[ge.getUTCDay()]}function Fe(ge){return a[ge.getUTCMonth()]}function Ve(ge){return o[ge.getUTCMonth()]}function Ee(ge){return l[+(ge.getUTCHours()>=12)]}function We(ge){return 1+~~(ge.getUTCMonth()/3)}return{format:function(ge){var ve=L(ge+="",C);return ve.toString=function(){return ge},ve},parse:function(ge){var ve=N(ge+="",!1);return ve.toString=function(){return ge},ve},utcFormat:function(ge){var ve=L(ge+="",I);return ve.toString=function(){return ge},ve},utcParse:function(ge){var ve=N(ge+="",!0);return ve.toString=function(){return ge},ve}}}var G4={"-":"",_:" ",0:"0"},Ei=/^\s*\d+/,kne=/^%/,wne=/[\\^$*+?|[\]().{}]/g;function dn(t,e,n){var i=t<0?"-":"",l=(i?-t:t)+"",r=l.length;return i+(r[e.toLowerCase(),n]))}function Tne(t,e,n){var i=Ei.exec(e.slice(n,n+1));return i?(t.w=+i[0],n+i[0].length):-1}function Sne(t,e,n){var i=Ei.exec(e.slice(n,n+1));return i?(t.u=+i[0],n+i[0].length):-1}function Ene(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.U=+i[0],n+i[0].length):-1}function Mne(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.V=+i[0],n+i[0].length):-1}function One(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.W=+i[0],n+i[0].length):-1}function V4(t,e,n){var i=Ei.exec(e.slice(n,n+4));return i?(t.y=+i[0],n+i[0].length):-1}function W4(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),n+i[0].length):-1}function Ane(t,e,n){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),n+i[0].length):-1}function Cne(t,e,n){var i=Ei.exec(e.slice(n,n+1));return i?(t.q=i[0]*3-3,n+i[0].length):-1}function Lne(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.m=i[0]-1,n+i[0].length):-1}function q4(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.d=+i[0],n+i[0].length):-1}function Ine(t,e,n){var i=Ei.exec(e.slice(n,n+3));return i?(t.m=0,t.d=+i[0],n+i[0].length):-1}function j4(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.H=+i[0],n+i[0].length):-1}function Rne(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.M=+i[0],n+i[0].length):-1}function Dne(t,e,n){var i=Ei.exec(e.slice(n,n+2));return i?(t.S=+i[0],n+i[0].length):-1}function Pne(t,e,n){var i=Ei.exec(e.slice(n,n+3));return i?(t.L=+i[0],n+i[0].length):-1}function Nne(t,e,n){var i=Ei.exec(e.slice(n,n+6));return i?(t.L=Math.floor(i[0]/1e3),n+i[0].length):-1}function Bne(t,e,n){var i=kne.exec(e.slice(n,n+1));return i?n+i[0].length:-1}function zne(t,e,n){var i=Ei.exec(e.slice(n));return i?(t.Q=+i[0],n+i[0].length):-1}function Hne(t,e,n){var i=Ei.exec(e.slice(n));return i?(t.s=+i[0],n+i[0].length):-1}function Y4(t,e){return dn(t.getDate(),e,2)}function Une(t,e){return dn(t.getHours(),e,2)}function Fne(t,e){return dn(t.getHours()%12||12,e,2)}function Gne(t,e){return dn(1+Wu.count(Xr(t),t),e,3)}function FS(t,e){return dn(t.getMilliseconds(),e,3)}function Vne(t,e){return FS(t,e)+"000"}function Wne(t,e){return dn(t.getMonth()+1,e,2)}function qne(t,e){return dn(t.getMinutes(),e,2)}function jne(t,e){return dn(t.getSeconds(),e,2)}function Yne(t){var e=t.getDay();return e===0?7:e}function Zne(t,e){return dn(Ed.count(Xr(t)-1,t),e,2)}function GS(t){var e=t.getDay();return e>=4||e===0?sa(t):sa.ceil(t)}function Xne(t,e){return t=GS(t),dn(sa.count(Xr(t),t)+(Xr(t).getDay()===4),e,2)}function Kne(t){return t.getDay()}function $ne(t,e){return dn(Fc.count(Xr(t)-1,t),e,2)}function Jne(t,e){return dn(t.getFullYear()%100,e,2)}function Qne(t,e){return t=GS(t),dn(t.getFullYear()%100,e,2)}function xne(t,e){return dn(t.getFullYear()%1e4,e,4)}function eie(t,e){var n=t.getDay();return t=n>=4||n===0?sa(t):sa.ceil(t),dn(t.getFullYear()%1e4,e,4)}function tie(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+dn(e/60|0,"0",2)+dn(e%60,"0",2)}function Z4(t,e){return dn(t.getUTCDate(),e,2)}function nie(t,e){return dn(t.getUTCHours(),e,2)}function iie(t,e){return dn(t.getUTCHours()%12||12,e,2)}function lie(t,e){return dn(1+w0.count(io(t),t),e,3)}function VS(t,e){return dn(t.getUTCMilliseconds(),e,3)}function rie(t,e){return VS(t,e)+"000"}function sie(t,e){return dn(t.getUTCMonth()+1,e,2)}function oie(t,e){return dn(t.getUTCMinutes(),e,2)}function aie(t,e){return dn(t.getUTCSeconds(),e,2)}function uie(t){var e=t.getUTCDay();return e===0?7:e}function fie(t,e){return dn(US.count(io(t)-1,t),e,2)}function WS(t){var e=t.getUTCDay();return e>=4||e===0?oa(t):oa.ceil(t)}function cie(t,e){return t=WS(t),dn(oa.count(io(t),t)+(io(t).getUTCDay()===4),e,2)}function die(t){return t.getUTCDay()}function hie(t,e){return dn(Gc.count(io(t)-1,t),e,2)}function mie(t,e){return dn(t.getUTCFullYear()%100,e,2)}function gie(t,e){return t=WS(t),dn(t.getUTCFullYear()%100,e,2)}function _ie(t,e){return dn(t.getUTCFullYear()%1e4,e,4)}function pie(t,e){var n=t.getUTCDay();return t=n>=4||n===0?oa(t):oa.ceil(t),dn(t.getUTCFullYear()%1e4,e,4)}function bie(){return"+0000"}function X4(){return"%"}function K4(t){return+t}function $4(t){return Math.floor(+t/1e3)}var No,qS;vie({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function vie(t){return No=vne(t),qS=No.format,No.parse,No.utcFormat,No.utcParse,No}function kie(t){return new Date(t)}function wie(t){return t instanceof Date?+t:+new Date(+t)}function jS(t,e,n,i,l,r,s,o,a,u){var f=BS(),c=f.invert,d=f.domain,h=u(".%L"),g=u(":%S"),_=u("%I:%M"),v=u("%I %p"),S=u("%a %d"),A=u("%b %d"),C=u("%B"),I=u("%Y");function M(L){return(a(L)1?0:t<-1?Tu:Math.acos(t)}function Q4(t){return t>=1?Vc:t<=-1?-Vc:Math.asin(t)}function T0(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(n==null)e=null;else{const i=Math.floor(n);if(!(i>=0))throw new RangeError(`invalid digits: ${n}`);e=i}return t},()=>new Dte(e)}function Eie(t){return t.innerRadius}function Mie(t){return t.outerRadius}function Oie(t){return t.startAngle}function Aie(t){return t.endAngle}function Cie(t){return t&&t.padAngle}function Lie(t,e,n,i,l,r,s,o){var a=n-t,u=i-e,f=s-l,c=o-r,d=c*a-f*u;if(!(d*dQ*Q+le*le&&(z=D,W=G),{cx:z,cy:W,x01:-f,y01:-c,x11:z*(l/M-1),y11:W*(l/M-1)}}function Iie(){var t=Eie,e=Mie,n=kn(0),i=null,l=Oie,r=Aie,s=Cie,o=null,a=T0(u);function u(){var f,c,d=+t.apply(this,arguments),h=+e.apply(this,arguments),g=l.apply(this,arguments)-Vc,_=r.apply(this,arguments)-Vc,v=J4(_-g),S=_>g;if(o||(o=f=a()),hGi))o.moveTo(0,0);else if(v>Tie-Gi)o.moveTo(h*Gs(g),h*_r(g)),o.arc(0,0,h,g,_,!S),d>Gi&&(o.moveTo(d*Gs(_),d*_r(_)),o.arc(0,0,d,_,g,S));else{var A=g,C=_,I=g,M=_,L=v,N=v,z=s.apply(this,arguments)/2,W=z>Gi&&(i?+i.apply(this,arguments):Vo(d*d+h*h)),D=km(J4(h-d)/2,+n.apply(this,arguments)),G=D,$=D,j,Q;if(W>Gi){var le=Q4(W/d*_r(z)),oe=Q4(W/h*_r(z));(L-=le*2)>Gi?(le*=S?1:-1,I+=le,M-=le):(L=0,I=M=(g+_)/2),(N-=oe*2)>Gi?(oe*=S?1:-1,A+=oe,C-=oe):(N=0,A=C=(g+_)/2)}var X=h*Gs(A),de=h*_r(A),re=d*Gs(M),x=d*_r(M);if(D>Gi){var me=h*Gs(C),ee=h*_r(C),ke=d*Gs(I),pe=d*_r(I),Fe;if(vGi?$>Gi?(j=Xf(ke,pe,X,de,h,$,S),Q=Xf(me,ee,re,x,h,$,S),o.moveTo(j.cx+j.x01,j.cy+j.y01),$Gi)||!(L>Gi)?o.lineTo(re,x):G>Gi?(j=Xf(re,x,me,ee,d,-G,S),Q=Xf(X,de,ke,pe,d,-G,S),o.lineTo(j.cx+j.x01,j.cy+j.y01),G=h;--g)o.point(C[g],I[g]);o.lineEnd(),o.areaEnd()}S&&(C[d]=+t(v,d,c),I[d]=+e(v,d,c),o.point(i?+i(v,d,c):C[d],n?+n(v,d,c):I[d]))}if(A)return o=null,A+""||null}function f(){return M0().defined(l).curve(s).context(r)}return u.x=function(c){return arguments.length?(t=typeof c=="function"?c:kn(+c),i=null,u):t},u.x0=function(c){return arguments.length?(t=typeof c=="function"?c:kn(+c),u):t},u.x1=function(c){return arguments.length?(i=c==null?null:typeof c=="function"?c:kn(+c),u):i},u.y=function(c){return arguments.length?(e=typeof c=="function"?c:kn(+c),n=null,u):e},u.y0=function(c){return arguments.length?(e=typeof c=="function"?c:kn(+c),u):e},u.y1=function(c){return arguments.length?(n=c==null?null:typeof c=="function"?c:kn(+c),u):n},u.lineX0=u.lineY0=function(){return f().x(t).y(e)},u.lineY1=function(){return f().x(t).y(n)},u.lineX1=function(){return f().x(i).y(e)},u.defined=function(c){return arguments.length?(l=typeof c=="function"?c:kn(!!c),u):l},u.curve=function(c){return arguments.length?(s=c,r!=null&&(o=s(r)),u):s},u.context=function(c){return arguments.length?(c==null?r=o=null:o=s(r=c),u):r},u}function ys(){}function Wc(t,e,n){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+n)/6)}function Md(t){this._context=t}Md.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Wc(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Wc(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Rie(t){return new Md(t)}function $S(t){this._context=t}$S.prototype={areaStart:ys,areaEnd:ys,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Wc(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Die(t){return new $S(t)}function JS(t){this._context=t}JS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+t)/6,i=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(n,i):this._context.moveTo(n,i);break;case 3:this._point=4;default:Wc(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Pie(t){return new JS(t)}function QS(t,e){this._basis=new Md(t),this._beta=e}QS.prototype={lineStart:function(){this._x=[],this._y=[],this._basis.lineStart()},lineEnd:function(){var t=this._x,e=this._y,n=t.length-1;if(n>0)for(var i=t[0],l=e[0],r=t[n]-i,s=e[n]-l,o=-1,a;++o<=n;)a=o/n,this._basis.point(this._beta*t[o]+(1-this._beta)*(i+a*r),this._beta*e[o]+(1-this._beta)*(l+a*s));this._x=this._y=null,this._basis.lineEnd()},point:function(t,e){this._x.push(+t),this._y.push(+e)}};const Nie=function t(e){function n(i){return e===1?new Md(i):new QS(i,e)}return n.beta=function(i){return t(+i)},n}(.85);function qc(t,e,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-e),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function A0(t,e){this._context=t,this._k=(1-e)/6}A0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:qc(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2,this._x1=t,this._y1=e;break;case 2:this._point=3;default:qc(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Bie=function t(e){function n(i){return new A0(i,e)}return n.tension=function(i){return t(+i)},n}(0);function C0(t,e){this._context=t,this._k=(1-e)/6}C0.prototype={areaStart:ys,areaEnd:ys,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:qc(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const zie=function t(e){function n(i){return new C0(i,e)}return n.tension=function(i){return t(+i)},n}(0);function L0(t,e){this._context=t,this._k=(1-e)/6}L0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:qc(this,t,e);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Hie=function t(e){function n(i){return new L0(i,e)}return n.tension=function(i){return t(+i)},n}(0);function I0(t,e,n){var i=t._x1,l=t._y1,r=t._x2,s=t._y2;if(t._l01_a>Gi){var o=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,a=3*t._l01_a*(t._l01_a+t._l12_a);i=(i*o-t._x0*t._l12_2a+t._x2*t._l01_2a)/a,l=(l*o-t._y0*t._l12_2a+t._y2*t._l01_2a)/a}if(t._l23_a>Gi){var u=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,f=3*t._l23_a*(t._l23_a+t._l12_a);r=(r*u+t._x1*t._l23_2a-e*t._l12_2a)/f,s=(s*u+t._y1*t._l23_2a-n*t._l12_2a)/f}t._context.bezierCurveTo(i,l,r,s,t._x2,t._y2)}function xS(t,e){this._context=t,this._alpha=e}xS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3;default:I0(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Uie=function t(e){function n(i){return e?new xS(i,e):new A0(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function eE(t,e){this._context=t,this._alpha=e}eE.prototype={areaStart:ys,areaEnd:ys,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=t,this._y3=e;break;case 1:this._point=2,this._context.moveTo(this._x4=t,this._y4=e);break;case 2:this._point=3,this._x5=t,this._y5=e;break;default:I0(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Fie=function t(e){function n(i){return e?new eE(i,e):new C0(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function tE(t,e){this._context=t,this._alpha=e}tE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){if(t=+t,e=+e,this._point){var n=this._x2-t,i=this._y2-e;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:I0(this,t,e);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=e}};const Gie=function t(e){function n(i){return e?new tE(i,e):new L0(i,0)}return n.alpha=function(i){return t(+i)},n}(.5);function nE(t){this._context=t}nE.prototype={areaStart:ys,areaEnd:ys,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Vie(t){return new nE(t)}function x4(t){return t<0?-1:1}function ew(t,e,n){var i=t._x1-t._x0,l=e-t._x1,r=(t._y1-t._y0)/(i||l<0&&-0),s=(n-t._y1)/(l||i<0&&-0),o=(r*l+s*i)/(i+l);return(x4(r)+x4(s))*Math.min(Math.abs(r),Math.abs(s),.5*Math.abs(o))||0}function tw(t,e){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-e)/2:e}function wm(t,e,n){var i=t._x0,l=t._y0,r=t._x1,s=t._y1,o=(r-i)/3;t._context.bezierCurveTo(i+o,l+o*e,r-o,s-o*n,r,s)}function jc(t){this._context=t}jc.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:wm(this,this._t0,tw(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var n=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,wm(this,tw(this,n=ew(this,t,e)),n);break;default:wm(this,this._t0,n=ew(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=n}}};function iE(t){this._context=new lE(t)}(iE.prototype=Object.create(jc.prototype)).point=function(t,e){jc.prototype.point.call(this,e,t)};function lE(t){this._context=t}lE.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,n,i,l,r){this._context.bezierCurveTo(e,t,i,n,r,l)}};function Wie(t){return new jc(t)}function qie(t){return new iE(t)}function rE(t){this._context=t}rE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),n===2)this._context.lineTo(t[1],e[1]);else for(var i=nw(t),l=nw(e),r=0,s=1;s=0;--e)l[e]=(s[e]-l[e+1])/r[e];for(r[n-1]=(t[n]+l[n-1])/2,e=0;e=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,e)}break}}this._x=t,this._y=e}};function Yie(t){return new Od(t,.5)}function Zie(t){return new Od(t,0)}function Xie(t){return new Od(t,1)}function iw(t,e){if((s=t.length)>1)for(var n=1,i,l,r=t[e[0]],s,o=r.length;n=0;)n[e]=e;return n}function Kie(t,e){return t[e]}function $ie(t){const e=[];return e.key=t,e}function ym(){var t=kn([]),e=lw,n=iw,i=Kie;function l(r){var s=Array.from(t.apply(this,arguments),$ie),o,a=s.length,u=-1,f;for(const c of r)for(o=0,++u;o0)for(var n,i=0,l,r,s,o,a,u=t[e[0]].length;i0?(l[0]=s,l[1]=s+=r):r<0?(l[1]=o,l[0]=o+=r):(l[0]=0,l[1]=r)}function lu(t,e,n){this.k=t,this.x=e,this.y=n}lu.prototype={constructor:lu,scale:function(t){return t===1?this:new lu(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new lu(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};lu.prototype;function Tm(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=e.width?String(e.width):t.defaultWidth,i=t.formats[n]||t.formats[t.defaultWidth];return i}}function Ka(t){return function(e,n){var i=n!=null&&n.context?String(n.context):"standalone",l;if(i==="formatting"&&t.formattingValues){var r=t.defaultFormattingWidth||t.defaultWidth,s=n!=null&&n.width?String(n.width):r;l=t.formattingValues[s]||t.formattingValues[r]}else{var o=t.defaultWidth,a=n!=null&&n.width?String(n.width):t.defaultWidth;l=t.values[a]||t.values[o]}var u=t.argumentCallback?t.argumentCallback(e):e;return l[u]}}function $a(t){return function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.width,l=i&&t.matchPatterns[i]||t.matchPatterns[t.defaultMatchWidth],r=e.match(l);if(!r)return null;var s=r[0],o=i&&t.parsePatterns[i]||t.parsePatterns[t.defaultParseWidth],a=Array.isArray(o)?xie(o,function(c){return c.test(s)}):Qie(o,function(c){return c.test(s)}),u;u=t.valueCallback?t.valueCallback(a):a,u=n.valueCallback?n.valueCallback(u):u;var f=e.slice(s.length);return{value:u,rest:f}}}function Qie(t,e){for(var n in t)if(t.hasOwnProperty(n)&&e(t[n]))return n}function xie(t,e){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},i=e.match(t.matchPattern);if(!i)return null;var l=i[0],r=e.match(t.parsePattern);if(!r)return null;var s=t.valueCallback?t.valueCallback(r[0]):r[0];s=n.valueCallback?n.valueCallback(s):s;var o=e.slice(l.length);return{value:s,rest:o}}}function Yc(t){"@babel/helpers - typeof";return Yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yc(t)}function vi(t){if(t===null||t===!0||t===!1)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function Qt(t,e){if(e.length1?"s":"")+" required, but only "+e.length+" present")}function gn(t){Qt(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||Yc(t)==="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Ad(t,e){Qt(2,arguments);var n=gn(t).getTime(),i=vi(e);return new Date(n+i)}var tle={};function Cd(){return tle}function m1(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function nle(t){return Qt(1,arguments),t instanceof Date||Yc(t)==="object"&&Object.prototype.toString.call(t)==="[object Date]"}function ile(t){if(Qt(1,arguments),!nle(t)&&typeof t!="number")return!1;var e=gn(t);return!isNaN(Number(e))}function lle(t,e){Qt(2,arguments);var n=vi(e);return Ad(t,-n)}var rle=864e5;function sle(t){Qt(1,arguments);var e=gn(t),n=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var i=e.getTime(),l=n-i;return Math.floor(l/rle)+1}function Zc(t){Qt(1,arguments);var e=1,n=gn(t),i=n.getUTCDay(),l=(i=l.getTime()?n+1:e.getTime()>=s.getTime()?n:n-1}function ole(t){Qt(1,arguments);var e=sE(t),n=new Date(0);n.setUTCFullYear(e,0,4),n.setUTCHours(0,0,0,0);var i=Zc(n);return i}var ale=6048e5;function ule(t){Qt(1,arguments);var e=gn(t),n=Zc(e).getTime()-ole(e).getTime();return Math.round(n/ale)+1}function Xc(t,e){var n,i,l,r,s,o,a,u;Qt(1,arguments);var f=Cd(),c=vi((n=(i=(l=(r=e==null?void 0:e.weekStartsOn)!==null&&r!==void 0?r:e==null||(s=e.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.weekStartsOn)!==null&&l!==void 0?l:f.weekStartsOn)!==null&&i!==void 0?i:(a=f.locale)===null||a===void 0||(u=a.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&n!==void 0?n:0);if(!(c>=0&&c<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var d=gn(t),h=d.getUTCDay(),g=(h=1&&h<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var g=new Date(0);g.setUTCFullYear(c+1,0,h),g.setUTCHours(0,0,0,0);var _=Xc(g,e),v=new Date(0);v.setUTCFullYear(c,0,h),v.setUTCHours(0,0,0,0);var S=Xc(v,e);return f.getTime()>=_.getTime()?c+1:f.getTime()>=S.getTime()?c:c-1}function fle(t,e){var n,i,l,r,s,o,a,u;Qt(1,arguments);var f=Cd(),c=vi((n=(i=(l=(r=e==null?void 0:e.firstWeekContainsDate)!==null&&r!==void 0?r:e==null||(s=e.locale)===null||s===void 0||(o=s.options)===null||o===void 0?void 0:o.firstWeekContainsDate)!==null&&l!==void 0?l:f.firstWeekContainsDate)!==null&&i!==void 0?i:(a=f.locale)===null||a===void 0||(u=a.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&n!==void 0?n:1),d=oE(t,e),h=new Date(0);h.setUTCFullYear(d,0,c),h.setUTCHours(0,0,0,0);var g=Xc(h,e);return g}var cle=6048e5;function dle(t,e){Qt(1,arguments);var n=gn(t),i=Xc(n,e).getTime()-fle(n,e).getTime();return Math.round(i/cle)+1}function On(t,e){for(var n=t<0?"-":"",i=Math.abs(t).toString();i.length0?n:1-n;return On(e==="yy"?i%100:i,e.length)},M:function(t,e){var n=t.getUTCMonth();return e==="M"?String(n+1):On(n+1,2)},d:function(t,e){return On(t.getUTCDate(),e.length)},a:function(t,e){var n=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(t,e){return On(t.getUTCHours()%12||12,e.length)},H:function(t,e){return On(t.getUTCHours(),e.length)},m:function(t,e){return On(t.getUTCMinutes(),e.length)},s:function(t,e){return On(t.getUTCSeconds(),e.length)},S:function(t,e){var n=e.length,i=t.getUTCMilliseconds(),l=Math.floor(i*Math.pow(10,n-3));return On(l,e.length)}};const hs=hle;var Bo={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},mle={G:function(t,e,n){var i=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,e,n){if(e==="yo"){var i=t.getUTCFullYear(),l=i>0?i:1-i;return n.ordinalNumber(l,{unit:"year"})}return hs.y(t,e)},Y:function(t,e,n,i){var l=oE(t,i),r=l>0?l:1-l;if(e==="YY"){var s=r%100;return On(s,2)}return e==="Yo"?n.ordinalNumber(r,{unit:"year"}):On(r,e.length)},R:function(t,e){var n=sE(t);return On(n,e.length)},u:function(t,e){var n=t.getUTCFullYear();return On(n,e.length)},Q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(i);case"QQ":return On(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,e,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(i);case"qq":return On(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,e,n){var i=t.getUTCMonth();switch(e){case"M":case"MM":return hs.M(t,e);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,e,n){var i=t.getUTCMonth();switch(e){case"L":return String(i+1);case"LL":return On(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,e,n,i){var l=dle(t,i);return e==="wo"?n.ordinalNumber(l,{unit:"week"}):On(l,e.length)},I:function(t,e,n){var i=ule(t);return e==="Io"?n.ordinalNumber(i,{unit:"week"}):On(i,e.length)},d:function(t,e,n){return e==="do"?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):hs.d(t,e)},D:function(t,e,n){var i=sle(t);return e==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):On(i,e.length)},E:function(t,e,n){var i=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,e,n,i){var l=t.getUTCDay(),r=(l-i.weekStartsOn+8)%7||7;switch(e){case"e":return String(r);case"ee":return On(r,2);case"eo":return n.ordinalNumber(r,{unit:"day"});case"eee":return n.day(l,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(l,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(l,{width:"short",context:"formatting"});case"eeee":default:return n.day(l,{width:"wide",context:"formatting"})}},c:function(t,e,n,i){var l=t.getUTCDay(),r=(l-i.weekStartsOn+8)%7||7;switch(e){case"c":return String(r);case"cc":return On(r,e.length);case"co":return n.ordinalNumber(r,{unit:"day"});case"ccc":return n.day(l,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(l,{width:"narrow",context:"standalone"});case"cccccc":return n.day(l,{width:"short",context:"standalone"});case"cccc":default:return n.day(l,{width:"wide",context:"standalone"})}},i:function(t,e,n){var i=t.getUTCDay(),l=i===0?7:i;switch(e){case"i":return String(l);case"ii":return On(l,e.length);case"io":return n.ordinalNumber(l,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,e,n){var i=t.getUTCHours(),l=i/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},b:function(t,e,n){var i=t.getUTCHours(),l;switch(i===12?l=Bo.noon:i===0?l=Bo.midnight:l=i/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},B:function(t,e,n){var i=t.getUTCHours(),l;switch(i>=17?l=Bo.evening:i>=12?l=Bo.afternoon:i>=4?l=Bo.morning:l=Bo.night,e){case"B":case"BB":case"BBB":return n.dayPeriod(l,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(l,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(l,{width:"wide",context:"formatting"})}},h:function(t,e,n){if(e==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return hs.h(t,e)},H:function(t,e,n){return e==="Ho"?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):hs.H(t,e)},K:function(t,e,n){var i=t.getUTCHours()%12;return e==="Ko"?n.ordinalNumber(i,{unit:"hour"}):On(i,e.length)},k:function(t,e,n){var i=t.getUTCHours();return i===0&&(i=24),e==="ko"?n.ordinalNumber(i,{unit:"hour"}):On(i,e.length)},m:function(t,e,n){return e==="mo"?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):hs.m(t,e)},s:function(t,e,n){return e==="so"?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):hs.s(t,e)},S:function(t,e){return hs.S(t,e)},X:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();if(r===0)return"Z";switch(e){case"X":return sw(r);case"XXXX":case"XX":return Ws(r);case"XXXXX":case"XXX":default:return Ws(r,":")}},x:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();switch(e){case"x":return sw(r);case"xxxx":case"xx":return Ws(r);case"xxxxx":case"xxx":default:return Ws(r,":")}},O:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+rw(r,":");case"OOOO":default:return"GMT"+Ws(r,":")}},z:function(t,e,n,i){var l=i._originalDate||t,r=l.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+rw(r,":");case"zzzz":default:return"GMT"+Ws(r,":")}},t:function(t,e,n,i){var l=i._originalDate||t,r=Math.floor(l.getTime()/1e3);return On(r,e.length)},T:function(t,e,n,i){var l=i._originalDate||t,r=l.getTime();return On(r,e.length)}};function rw(t,e){var n=t>0?"-":"+",i=Math.abs(t),l=Math.floor(i/60),r=i%60;if(r===0)return n+String(l);var s=e||"";return n+String(l)+s+On(r,2)}function sw(t,e){if(t%60===0){var n=t>0?"-":"+";return n+On(Math.abs(t)/60,2)}return Ws(t,e)}function Ws(t,e){var n=e||"",i=t>0?"-":"+",l=Math.abs(t),r=On(Math.floor(l/60),2),s=On(l%60,2);return i+r+n+s}const gle=mle;var ow=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},aE=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},_le=function(t,e){var n=t.match(/(P+)(p+)?/)||[],i=n[1],l=n[2];if(!l)return ow(t,e);var r;switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});break}return r.replace("{{date}}",ow(i,e)).replace("{{time}}",aE(l,e))},ple={p:aE,P:_le};const ble=ple;var vle=["D","DD"],kle=["YY","YYYY"];function wle(t){return vle.indexOf(t)!==-1}function yle(t){return kle.indexOf(t)!==-1}function aw(t,e,n){if(t==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(t==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Tle={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Sle=function(t,e,n){var i,l=Tle[t];return typeof l=="string"?i=l:e===1?i=l.one:i=l.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};const Ele=Sle;var Mle={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ole={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Ale={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Cle={date:Tm({formats:Mle,defaultWidth:"full"}),time:Tm({formats:Ole,defaultWidth:"full"}),dateTime:Tm({formats:Ale,defaultWidth:"full"})};const Lle=Cle;var Ile={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rle=function(t,e,n,i){return Ile[t]};const Dle=Rle;var Ple={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Nle={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ble={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},zle={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Hle={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Ule={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Fle=function(t,e){var n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},Gle={ordinalNumber:Fle,era:Ka({values:Ple,defaultWidth:"wide"}),quarter:Ka({values:Nle,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Ka({values:Ble,defaultWidth:"wide"}),day:Ka({values:zle,defaultWidth:"wide"}),dayPeriod:Ka({values:Hle,defaultWidth:"wide",formattingValues:Ule,defaultFormattingWidth:"wide"})};const Vle=Gle;var Wle=/^(\d+)(th|st|nd|rd)?/i,qle=/\d+/i,jle={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Yle={any:[/^b/i,/^(a|c)/i]},Zle={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Xle={any:[/1/i,/2/i,/3/i,/4/i]},Kle={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},$le={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Jle={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Qle={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},xle={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ere={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},tre={ordinalNumber:ele({matchPattern:Wle,parsePattern:qle,valueCallback:function(t){return parseInt(t,10)}}),era:$a({matchPatterns:jle,defaultMatchWidth:"wide",parsePatterns:Yle,defaultParseWidth:"any"}),quarter:$a({matchPatterns:Zle,defaultMatchWidth:"wide",parsePatterns:Xle,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:$a({matchPatterns:Kle,defaultMatchWidth:"wide",parsePatterns:$le,defaultParseWidth:"any"}),day:$a({matchPatterns:Jle,defaultMatchWidth:"wide",parsePatterns:Qle,defaultParseWidth:"any"}),dayPeriod:$a({matchPatterns:xle,defaultMatchWidth:"any",parsePatterns:ere,defaultParseWidth:"any"})};const nre=tre;var ire={code:"en-US",formatDistance:Ele,formatLong:Lle,formatRelative:Dle,localize:Vle,match:nre,options:{weekStartsOn:0,firstWeekContainsDate:1}};const uE=ire;var lre=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,rre=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,sre=/^'([^]*?)'?$/,ore=/''/g,are=/[a-zA-Z]/;function aa(t,e,n){var i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I;Qt(2,arguments);var M=String(e),L=Cd(),N=(i=(l=n==null?void 0:n.locale)!==null&&l!==void 0?l:L.locale)!==null&&i!==void 0?i:uE,z=vi((r=(s=(o=(a=n==null?void 0:n.firstWeekContainsDate)!==null&&a!==void 0?a:n==null||(u=n.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&o!==void 0?o:L.firstWeekContainsDate)!==null&&s!==void 0?s:(c=L.locale)===null||c===void 0||(d=c.options)===null||d===void 0?void 0:d.firstWeekContainsDate)!==null&&r!==void 0?r:1);if(!(z>=1&&z<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var W=vi((h=(g=(_=(v=n==null?void 0:n.weekStartsOn)!==null&&v!==void 0?v:n==null||(S=n.locale)===null||S===void 0||(A=S.options)===null||A===void 0?void 0:A.weekStartsOn)!==null&&_!==void 0?_:L.weekStartsOn)!==null&&g!==void 0?g:(C=L.locale)===null||C===void 0||(I=C.options)===null||I===void 0?void 0:I.weekStartsOn)!==null&&h!==void 0?h:0);if(!(W>=0&&W<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!N.localize)throw new RangeError("locale must contain localize property");if(!N.formatLong)throw new RangeError("locale must contain formatLong property");var D=gn(t);if(!ile(D))throw new RangeError("Invalid time value");var G=m1(D),$=lle(D,G),j={firstWeekContainsDate:z,weekStartsOn:W,locale:N,_originalDate:D},Q=M.match(rre).map(function(le){var oe=le[0];if(oe==="p"||oe==="P"){var X=ble[oe];return X(le,N.formatLong)}return le}).join("").match(lre).map(function(le){if(le==="''")return"'";var oe=le[0];if(oe==="'")return ure(le);var X=gle[oe];if(X)return!(n!=null&&n.useAdditionalWeekYearTokens)&&yle(le)&&aw(le,e,String(t)),!(n!=null&&n.useAdditionalDayOfYearTokens)&&wle(le)&&aw(le,e,String(t)),X($,le,N.localize,j);if(oe.match(are))throw new RangeError("Format string contains an unescaped latin alphabet character `"+oe+"`");return le}).join("");return Q}function ure(t){var e=t.match(sre);return e?e[1].replace(ore,"'"):t}var fre=typeof global=="object"&&global&&global.Object===Object&&global;const fE=fre;var cre=typeof self=="object"&&self&&self.Object===Object&&self,dre=fE||cre||Function("return this")();const ar=dre;var hre=ar.Symbol;const Yl=hre;var cE=Object.prototype,mre=cE.hasOwnProperty,gre=cE.toString,Ja=Yl?Yl.toStringTag:void 0;function _re(t){var e=mre.call(t,Ja),n=t[Ja];try{t[Ja]=void 0;var i=!0}catch{}var l=gre.call(t);return i&&(e?t[Ja]=n:delete t[Ja]),l}var pre=Object.prototype,bre=pre.toString;function vre(t){return bre.call(t)}var kre="[object Null]",wre="[object Undefined]",uw=Yl?Yl.toStringTag:void 0;function co(t){return t==null?t===void 0?wre:kre:uw&&uw in Object(t)?_re(t):vre(t)}function yr(t){return t!=null&&typeof t=="object"}var yre="[object Symbol]";function Ld(t){return typeof t=="symbol"||yr(t)&&co(t)==yre}function Tre(t,e){for(var n=-1,i=t==null?0:t.length,l=Array(i);++n0){if(++e>=Xre)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Qre(t){return function(){return t}}var xre=function(){try{var t=mo(Object,"defineProperty");return t({},"",{}),t}catch{}}();const Kc=xre;var ese=Kc?function(t,e){return Kc(t,"toString",{configurable:!0,enumerable:!1,value:Qre(e),writable:!0})}:R0;const tse=ese;var nse=Jre(tse);const ise=nse;function lse(t,e){for(var n=-1,i=t==null?0:t.length;++n-1}var fse=9007199254740991,cse=/^(?:0|[1-9]\d*)$/;function P0(t,e){var n=typeof t;return e=e??fse,!!e&&(n=="number"||n!="symbol"&&cse.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=gse}function va(t){return t!=null&&N0(t.length)&&!D0(t)}function _E(t,e,n){if(!Zl(n))return!1;var i=typeof e;return(i=="number"?va(n)&&P0(e,n.length):i=="string"&&e in n)?qu(n[e],t):!1}function _se(t){return gE(function(e,n){var i=-1,l=n.length,r=l>1?n[l-1]:void 0,s=l>2?n[2]:void 0;for(r=t.length>3&&typeof r=="function"?(l--,r):void 0,s&&_E(n[0],n[1],s)&&(r=l<3?void 0:r,l=1),e=Object(e);++i-1}function Ioe(t,e){var n=this.__data__,i=Pd(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}function $r(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e0&&n(o)?e>1?G0(o,e-1,n,i,l):F0(l,o):i||(l[l.length]=o)}return l}var Koe=wE(Object.getPrototypeOf,Object);const V0=Koe;var $oe="[object Object]",Joe=Function.prototype,Qoe=Object.prototype,EE=Joe.toString,xoe=Qoe.hasOwnProperty,eae=EE.call(Object);function tae(t){if(!yr(t)||co(t)!=$oe)return!1;var e=V0(t);if(e===null)return!0;var n=xoe.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&EE.call(n)==eae}function nae(){this.__data__=new $r,this.size=0}function iae(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function lae(t){return this.__data__.get(t)}function rae(t){return this.__data__.has(t)}var sae=200;function oae(t,e){var n=this.__data__;if(n instanceof $r){var i=n.__data__;if(!Eu||i.lengtho))return!1;var u=r.get(t),f=r.get(e);if(u&&f)return u==e&&f==t;var c=-1,d=!0,h=n&Wue?new Mu:void 0;for(r.set(t,e),r.set(e,t);++c=Gfe){var u=e?null:Ffe(t);if(u)return j0(u);s=!1,l=zE,a=new Mu}else a=e?[]:o;e:for(;++i{const e=Math.min(t.width,t.height);return[e*3/400,e*25/400]},fillOpacity:.2,enabled:!0},points:{filled:!0},legend:{additionalItems:[{type:Ti.RADIUS,name:"Radius"}]}}),sce=en({},Ku,{bullet:{performanceAreaTitles:["Poor","Satisfactory","Great"]},grid:{x:{enabled:!1},y:{enabled:!1}},legend:{additionalItems:[{type:Ti.AREA,name:"Poor area"},{type:Ti.AREA,name:"Satisfactory area"},{type:Ti.AREA,name:"Great area"},{type:Ti.QUARTILE,name:"Quartiles"}]}}),oce=en({},ro,{bars:{dividerSize:1.5},timeScale:en(Hd,{addSpaceOnEdges:0})}),ace=en({},ji,{tooltip:en({},qE,{wordLabel:"Word",valueLabel:"Value"}),wordCloud:{fontSizeMapsTo:"value",fontSizeRange:t=>{const e=Math.min(t.width,t.height);return[e*20/400,e*75/400]},wordMapsTo:"word"}}),KE=en({},ji,{pie:{labels:{formatter:null,enabled:!0},alignment:jl.LEFT,sortFunction:null,valueMapsTo:"value"}}),uce=en({},ji,{legend:{enabled:!1},gauge:{type:x8.SEMI,arcWidth:16,deltaArrow:{size:t=>t/8,enabled:!0},showPercentageSymbol:!0,status:null,numberSpacing:10,deltaFontSize:t=>t/8,valueFontSize:t=>t/2.5,numberFormatter:t=>Number(t.toFixed(2))%1!==0?t.toFixed(2).toLocaleString():t.toFixed().toLocaleString(),alignment:jl.LEFT}}),fce=en({},KE,{donut:{center:{numberFontSize:t=>`${Math.min(t/100*24,24)}px`,titleFontSize:t=>`${Math.min(t/100*15,15)}px`,titleYPosition:t=>Math.min(t/80*20,20),numberFormatter:t=>Math.floor(t).toLocaleString()},alignment:jl.LEFT}}),$E=en({},ji,{legend:{enabled:!1,clickable:!1},meter:{showLabels:!0,proportional:null,statusBar:{percentageIndicator:{enabled:!0}}}}),cce=en({},$E,{legend:{enabled:!0}}),dce=en({},ji,{radar:{axes:{angle:"key",value:"value"},alignment:jl.LEFT},tooltip:{gridline:{enabled:!0},valueFormatter:t=>t??"N/A"}}),hce=en({},ro,{comboChartTypes:[]}),mce=en({tree:{type:Q8.TREE}},ji,{}),gce=en({},ji,{data:en(ji.data,{groupMapsTo:"name"})}),_ce=en({},ji,qfe,{data:en(ji.data,{groupMapsTo:"name"})}),pce=en({},ji,{alluvial:{data:en(ji.data,{groupMapsTo:"source"}),nodeAlignment:jl.CENTER,nodePadding:24,monochrome:!1,nodes:[]}}),bce=en({},ji,{axes:jE,heatmap:{divider:{state:eS.AUTO},colorLegend:{type:"linear"}}}),vce=en({},YE,{choropleth:{colorLegend:{type:"linear"}}}),kce={alluvialChart:pce,areaChart:XE,axisChart:Ku,boxplotChart:nce,bubbleChart:rce,bulletChart:sce,chart:ji,circlePackChart:_ce,choroplethChart:vce,comboChart:hce,donutChart:fce,gaugeChart:uce,groupedBarChart:ece,heatmapChart:bce,histogramChart:oce,lineChart:ZE,lollipopChart:ice,meterChart:$E,pieChart:KE,proportionalMeterChart:cce,radarChart:dce,scatterChart:Z0,simpleBarChart:xfe,stackedAreaChart:lce,stackedBarChart:tce,thematicChart:YE,treeChart:mce,treemapChart:gce,wordCloudChart:ace};function wce(t,e,n){let i=null;return function(...l){const r=this;r.mousePosition=eo(l[0],n),clearTimeout(i),i=setTimeout(function(){t.apply(r,l)},e)}}function yce(t,e){var n;const i=Xu(t),l=Object.keys(e.axes||{});(n=e==null?void 0:e.toolbar)!=null&&n.controls&&delete i.toolbar.controls,l.length===0&&delete i.axes;for(const r in i.axes)if(l.includes(r)){const s=e.axes[r];if((s.primary||s.secondary)&&console.warn("`primary` & `secondary` are no longer needed for axis configurations. Read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format"),s.mapsTo==null){const a=s.scaleType;a==null?s.mapsTo="value":a===Nt.TIME?s.mapsTo="date":a===Nt.LABELS&&(s.mapsTo="key")}}else delete i.axes[r];return JE(i,e),en(i,e)}function Ur(t){if(!t)return;const e=/translate\([0-9]+\.?[0-9]*,[0-9]+\.?[0-9]*\)/,n=t.getAttribute("transform").match(e);if(!n)return null;if(n[0]){const i=n[0].replace(/translate\(/,"").replace(/\)/,"").split(",");return{tx:i[0],ty:i[1]}}return null}function Au(t,e,n){if(n>t.length)return t;if(e===rr.MID_LINE)return t.substr(0,n/2)+"..."+t.substr(-n/2);if(e===rr.FRONT_LINE)return"..."+t.substr(-n);if(e===rr.END_LINE)return t.substr(0,n)+"..."}function JE(t,e){const n=Te(t,"legend","additionalItems"),i=Te(e,"legend","additionalItems");if(n&&i){const l=i.map(o=>o.type),r=n.map(o=>o.type),s=Xfe.filter(o=>r.includes(o.type)&&!l.includes(o.type));t.legend.additionalItems=s,e.legend.additionalItems=Wfe(s,i,"name")}}const Te=(t,...e)=>{let n=t;if(n){for(const i of e)if(n[i]!==null&&n[i]!==void 0)n=n[i];else return null;return n}return null},QE=(t,e)=>e===hl.HORIZONTAL?{y0:t.x0,y1:t.x1,x0:t.y0,x1:t.y1}:t,X0=(t,e)=>{const{x0:n,x1:i,y0:l,y1:r}=QE(t,e);return`M${n},${l}L${n},${r}L${i},${r}L${i},${l}L${n},${l}`};function Ko(t,e,n){return n===hl.VERTICAL?[t,e]:[e,t]}var xE=(t=>(t["15seconds"]="15seconds",t.minute="minute",t["30minutes"]="30minutes",t.hourly="hourly",t.daily="daily",t.weekly="weekly",t.monthly="monthly",t.quarterly="quarterly",t.yearly="yearly",t))(xE||{});const Am=[["15seconds",15*1e3],["minute",60*1e3],["30minutes",30*60*1e3],["hourly",60*60*1e3],["daily",24*60*60*1e3],["monthly",30*24*60*60*1e3],["quarterly",3*30*24*60*60*1e3],["yearly",12*30*24*60*60*1e3]];function eM(t,e,n,i,l){const r=e===0,s=Number(aa(new Date(t),"c"))===2,o=Number(aa(new Date(t),"q"))===1,a=e!==0?n[e-1]:null;switch(i){case"15seconds":return r||$f(t)||xa(t,a)||ms(t);case"minute":return r||$f(t)||xa(t,a)||ms(t);case"30minutes":return r||$f(t)||xa(t,a)||ms(t);case"hourly":return r||$f(t)||xa(t,a)||ms(t);case"daily":return l?r||s||ms(t):r||xa(t,a)||ms(t);case"weekly":return r||s||ms(t);case"monthly":return r||ms(t);case"quarterly":return r||o;case"yearly":return!1;default:throw new Error(`${i} is not a valid time interval.`)}}function y1(t,e,n,i,l){const r=l.showDayName,s=i==="daily"&&r?"weekly":i,o=new Date(t),a=Te(l,"timeIntervalFormats")[s],u=Te(a,"primary"),f=Te(a,"secondary");let c=eM(t,e,n,i,r)?u:f;i==="15seconds"&&o.getMilliseconds()!==0&&(c=c.replace("pp","h:mm:ss.SSS a"));const d=l.localeObject;return aa(o,c,{locale:d})}function Jc(t){const e=new Date(t);return{M:e.getMonth()+1,d:e.getDate(),H:e.getHours(),m:e.getMinutes(),s:e.getSeconds()}}function Tce(t){if(t)return t.slice(1).map((e,n)=>e-t[n])}function Sce(t){const e=Am.reduce((n,[,i],l)=>{const r=Am[n][1],s=Math.abs(r-t),o=Math.abs(i-t);return s(t.GRAPHICS_DOCUMENT="graphics-document",t.GRAPHICS_OBJECT="graphics-object",t.GRAPHICS_SYMBOL="graphics-symbol",t.GROUP="group",t.DOCUMENT="document",t.CHECKBOX="checkbox",t.BUTTON="button",t.MENU="menu",t.MENU_ITEM="menuitem",t.IMG="img",t))(fi||{});function Ece(t,e){return t&&GE(t,e,Yu)}function Mce(t,e){return function(n,i){if(n==null)return n;if(!va(n))return t(n,i);for(var l=n.length,r=e?l:-1,s=Object(n);(e?r--:++re.includes(o[r]))),s&&Object.keys(s).forEach(o=>{const a=s[o].mapsTo,u=s[o].scaleType;if((u===Nt.LINEAR||u===Nt.LOG)&&(i=i.map(f=>({...f,[a]:f[a]===null?f[a]:Number(f[a])}))),a&&s[o].domain)if(u===Nt.LABELS)i=i.filter(f=>s[o].domain.includes(f[a]));else{const[f,c]=s[o].domain;i=i.filter(d=>!(a in d)||d[a]>=f&&d[a]<=c)}}),i.filter(o=>l.find(a=>a.name===o[r]))}getDisplayData(e){if(!this.get("data"))return null;const{ACTIVE:n}=Ci.items.status,i=this.getDataGroups(e),{groupMapsTo:l}=this.getOptions().data;return this.getAllDataFromDomain(e).filter(r=>i.find(s=>s.name===r[l]&&s.status===n))}getData(){return this.get("data")}isDataEmpty(){return!this.getData().length}setData(e){const n=this.sanitize(Xu(e)),i=this.generateDataGroups(n);return this.set({data:n,dataGroups:i}),n}getDataGroups(e){return Te(this.getOptions(),"data","loading")?[]:e?this.get("dataGroups").filter(n=>e.includes(n.name)):this.get("dataGroups")}getActiveDataGroups(e){const{ACTIVE:n}=Ci.items.status;return this.getDataGroups(e).filter(i=>i.status===n)}getDataGroupNames(e){return this.getDataGroups(e).map(n=>n.name)}getActiveDataGroupNames(e){return this.getActiveDataGroups(e).map(n=>n.name)}aggregateBinDataByGroup(e){return Nce(e,"group")}getBinConfigurations(){const e=this.getDisplayData(),n=this.getOptions(),i=this.services.cartesianScales.getMainXAxisPosition(),l=this.services.cartesianScales.getDomainIdentifier(),r=n.axes[i],{groupMapsTo:s}=n.data,{bins:o=Yfe.defaultBins}=r,a=Array.isArray(o),u=VJ().value(h=>h[l]).thresholds(o)(e);if(a)u[u.length-1].x1=o[o.length-1];else{const h=u[0].x1-u[0].x0;u[u.length-1].x1=+u[u.length-1].x0+h}const f=a?[o[0],o[o.length-1]]:[u[0].x0,u[u.length-1].x1],c=Array.from(new Set(e.map(h=>h[s]))),d=[];return u.forEach(h=>{const g=`${h.x0}-${h.x1}`,_=this.aggregateBinDataByGroup(h);c.forEach(v=>{d.push({group:v,key:g,value:_[v]||0,bin:h.x0})})}),{bins:u,binsDomain:f}}getBinnedStackedData(){const e=this.getOptions(),{groupMapsTo:n}=e.data,i=this.getActiveDataGroupNames(),{bins:l}=this.getBinConfigurations(),r=this.getDataValuesGroupedByKeys({bins:l});return ym().keys(i)(r).map((s,o)=>Object.keys(s).filter(a=>!isNaN(a)).map(a=>{const u=s[a];return u[n]=i[o],u}))}getGroupedData(e){const n=this.getDisplayData(e),i={},{groupMapsTo:l}=this.getOptions().data;return n.map(r=>{const s=r[l];i[s]!==null&&i[s]!==void 0?i[s].push(r):i[s]=[r]}),Object.keys(i).map(r=>({name:r,data:i[r]}))}getStackKeys({bins:e=null,groups:n=null}={bins:null,groups:null}){const i=this.getOptions(),l=this.getDisplayData(n);let r;e?r=e.map(a=>`${a.x0}-${a.x1}`):r=Ou(l.map(a=>{const u=this.services.cartesianScales.getDomainIdentifier(a);return a[u]instanceof Date?Fw(a[u]):a[u]&&typeof a[u].toString=="function"?a[u].toString():a[u]}));const s=this.services.cartesianScales.domainAxisPosition,o=i.axes[s].scaleType;return o===Nt.TIME?r.sort((a,u)=>{const f=new Date(a),c=new Date(u);return f-c}):(o===Nt.LOG||o===Nt.LINEAR)&&r.sort((a,u)=>a-u),r}getDataValuesGroupedByKeys({bins:e=null,groups:n=null}){const i=this.getOptions(),{groupMapsTo:l}=i.data,r=this.getDisplayData(n),s=this.getDataGroupNames(),o=this.getStackKeys({bins:e,groups:n});return e?o.map(a=>{const[u,f]=a.split("-"),c={x0:u,x1:f},d=e.find(h=>h.x0.toString()===u.toString());return s.forEach(h=>{c[h]=d.filter(g=>g[l]===h).length}),c}):o.map(a=>{const u={sharedStackKey:a};return s.forEach(f=>{const c=r.find(h=>{const g=this.services.cartesianScales.getDomainIdentifier(h);return h[l]===f&&Object.prototype.hasOwnProperty.call(h,g)&&(h[g]instanceof Date?Fw(h[g])===a:h[g].toString()===a)}),d=this.services.cartesianScales.getRangeIdentifier(u);u[f]=c?c[d]:null}),u})}getStackedData({percentage:e=!1,groups:n=null,divergent:i=!1}){const l=this.getOptions(),{groupMapsTo:r}=l.data,s=this.getActiveDataGroupNames(n),o=this.getDataValuesGroupedByKeys({groups:n});if(e){const a=Ice(o.map(u=>[u.sharedStackKey,0]));o.forEach(u=>{s.forEach(f=>{a[u.sharedStackKey]+=u[f]})}),o.forEach(u=>{s.forEach(f=>{const c=a[u.sharedStackKey];a[u.sharedStackKey]?u[f]=u[f]/c*100:u[f]=0})})}return(i?ym().offset(Jie):ym()).keys(s)(o).map((a,u)=>Object.keys(a).filter(f=>!isNaN(f)).map(f=>{const c=a[f];return c[r]=s[u],c}))}getOptions(){return this.state.options}set(e,n){this.state=Object.assign({},this.state,e);const i=Object.assign({skipUpdate:!1,animate:!0},n);i.skipUpdate||this.update(i.animate)}get(e){return e?this.state[e]:this.state}setOptions(e){const n=this.getOptions();JE(n,e),this.set({options:en(n,e)})}update(e=!0){this.getDisplayData()&&(this.updateAllDataGroups(),this.setCustomColorScale(),this.setColorClassNames(),this.services.events.dispatchEvent(je.Model.UPDATE,{animate:e}))}toggleDataLabel(e){const{ACTIVE:n,DISABLED:i}=Ci.items.status,l=this.getDataGroups(),r=l.some(u=>u.status===i),s=l.filter(u=>u.status===n);if(r)if(s.length===1&&s[0].name===e)l.forEach((u,f)=>{l[f].status=n});else{const u=l.findIndex(f=>f.name===e);l[u].status=l[u].status===i?n:i}else l.forEach((u,f)=>{l[f].status=u.name===e?n:i});const o=l.filter(u=>u.status===n),a=this.getOptions();l.some(u=>u.status===i)?a.data.selectedGroups=o.map(u=>u.name):a.data.selectedGroups=[],this.services.events.dispatchEvent(je.Legend.ITEMS_UPDATE,{dataGroups:l}),this.set({dataGroups:l})}getIsFilled(e,n,i,l){const r=this.getOptions();return r.getIsFilled?r.getIsFilled(e,n,i,l):l}getFillColor(e,n,i){const l=this.getOptions(),r=Te(this.colorScale,e);return l.getFillColor?l.getFillColor(e,n,i,r):r}getStrokeColor(e,n,i){const l=this.getOptions(),r=Te(this.colorScale,e);return l.getStrokeColor?l.getStrokeColor(e,n,i,r):r}isUserProvidedColorScaleValid(){const e=Te(this.getOptions(),"color","scale"),n=this.getDataGroups();return e==null||Object.keys(e).length==0?!1:n.some(i=>Object.keys(e).includes(i.name))}getColorClassName(e){const n=this.colorClassNames(e.dataGroupName);let i=e.originalClassName;return e.classNameTypes.forEach(l=>i=e.originalClassName?`${i} ${l}-${n}`:`${l}-${n}`),i||""}getStatus(){return null}getAllDataGroupsNames(){return this.allDataGroups}transformToTabularData(e){console.warn("We've updated the charting data format to be tabular by default. The current format you're using is deprecated and will be removed in v1.0, read more here https://carbon-design-system.github.io/carbon-charts/?path=/story/docs-tutorials--tabular-data-format");const n=[],{datasets:i,labels:l}=e;return i.forEach(r=>{r.data.forEach((s,o)=>{let a;const u=Te(r,"label");if(u===null){const c=Te(l,o);c?a=c:a="Ungrouped"}else a=u;const f={group:a,key:l[o]};isNaN(s)?(f.value=s.value,f.date=s.date):f.value=s,n.push(f)})}),n}getTabularDataArray(){return[]}exportToCSV(){const e=this.getTabularDataArray().map(l=>l.map(r=>`"${r==="–"?"–":r}"`));let n="",i="";e.forEach(function(l,r){i=l.join(","),n+=r{this.allDataGroups.indexOf(e)===-1&&this.allDataGroups.push(e)}):this.allDataGroups=this.getDataGroupNames()}generateDataGroups(e){const{groupMapsTo:n}=this.getOptions().data,{ACTIVE:i,DISABLED:l}=Ci.items.status,r=this.getOptions(),s=Ou(e.map(a=>a[n]));r.data.selectedGroups.length&&(r.data.selectedGroups.every(a=>s.includes(a))||(r.data.selectedGroups=[]));const o=a=>!r.data.selectedGroups.length||r.data.selectedGroups.includes(a)?i:l;return s.map(a=>({name:a,status:o(a)}))}setCustomColorScale(){if(!this.isUserProvidedColorScaleValid())return;const e=this.getOptions(),n=Te(e,"color","scale");Object.keys(n).forEach(i=>{this.allDataGroups.includes(i)||console.warn(`"${i}" does not exist in data groups.`)}),this.allDataGroups.filter(i=>n[i]).forEach(i=>this.colorScale[i]=n[i])}setColorClassNames(){const e=Te(this.getOptions(),"color","pairing");let n=Te(e,"numberOfVariants");(!n||n5?14:n,s=`${r}-color`;i=i<=l[s]?i:1;const o=this.allDataGroups.map((a,u)=>`${r}-${i}-${u%14+1}`);this.colorClassNames=g0().range(o).domain(this.allDataGroups)}}class Bce extends nM{constructor(e){super(e),this.axisFlavor=i0.DEFAULT}assignRangeAndDomains(){const{cartesianScales:e}=this.services,n=this.getOptions(),i=e.isDualAxes(),l={primaryDomain:e.domainAxisPosition,primaryRange:e.rangeAxisPosition,secondaryDomain:null,secondaryRange:null};return i&&(l.secondaryDomain=e.secondaryDomainAxisPosition,l.secondaryRange=e.secondaryRangeAxisPosition),Object.keys(l).forEach(r=>{const s=l[r];e.scales[s]?l[r]={position:s,label:e.getScaleLabel(s),identifier:Te(n,"axes",s,"mapsTo")}:l[r]=null}),l}getTabularDataArray(){const e=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:i}=n.data,{cartesianScales:l}=this.services,{primaryDomain:r,primaryRange:s,secondaryDomain:o,secondaryRange:a}=this.assignRangeAndDomains(),u=l.getDomainAxisScaleType();let f;return u===Nt.TIME&&(f=c=>aa(c,"MMM d, yyyy")),[["Group",r.label,s.label,...o?[o.label]:[],...a?[a.label]:[]],...e.map(c=>[c[i],c[r.identifier]===null?"–":f?f(c[r.identifier]):c[r.identifier],c[s.identifier]===null||isNaN(c[s.identifier])?"–":c[s.identifier].toLocaleString(),...o?[c[o.identifier]===null?"–":c[o.identifier]]:[],...a?[c[a.identifier]===null||isNaN(c[a.identifier])?"–":c[a.identifier]]:[]])]}setData(e){let n;if(e&&(n=super.setData(e),Te(this.getOptions(),"zoomBar",it.TOP,"enabled"))){const i=Te(this.getOptions(),"zoomBar",it.TOP,"data");this.setZoomBarData(i)}return n}setZoomBarData(e){const n=e?this.sanitize(Xu(e)):this.getDisplayData();let i=n;const{cartesianScales:l}=this.services;if(n&&l.domainAxisPosition&&l.rangeAxisPosition){const r=l.getDomainIdentifier(),s=l.getRangeIdentifier();let o=n.map(a=>a[r].getTime());o=Ou(o).sort(),i=o.map(a=>{let u=0;const f={};return n.forEach(c=>{c[r].getTime()===a&&(u+=c[s])}),f[r]=new Date(a),f[s]=u,f})}this.set({zoomBarData:i})}getZoomBarData(){return this.get("zoomBarData")}sanitizeDateValues(e){const n=this.getOptions();if(!n.axes)return e;const i=[];return Object.keys(it).forEach(l=>{const r=it[l],s=n.axes[r];if(s&&s.scaleType===Nt.TIME){const o=s.mapsTo;(o!==null||o!==void 0)&&i.push(o)}}),i.length>0&&e.forEach(l=>{i.forEach(r=>{Te(l,r,"getTime")===null&&(l[r]=new Date(l[r]))})}),e}sanitize(e){return e=super.sanitize(e),e=this.sanitizeDateValues(e),e}}var zce=/\s/;function Hce(t){for(var e=t.length;e--&&zce.test(t.charAt(e)););return e}var Uce=/^\s+/;function Fce(t){return t&&t.slice(0,Hce(t)+1).replace(Uce,"")}var Gw=0/0,Gce=/^[-+]0x[0-9a-f]+$/i,Vce=/^0b[01]+$/i,Wce=/^0o[0-7]+$/i,qce=parseInt;function fu(t){if(typeof t=="number")return t;if(Ld(t))return Gw;if(Zl(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Zl(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Fce(t);var n=Vce.test(t);return n||Wce.test(t)?qce(t.slice(2),n?2:8):Gce.test(t)?Gw:+t}var jce=function(){return ar.Date.now()};const Cm=jce;var Yce="Expected a function",Zce=Math.max,Xce=Math.min;function Kce(t,e,n){var i,l,r,s,o,a,u=0,f=!1,c=!1,d=!0;if(typeof t!="function")throw new TypeError(Yce);e=fu(e)||0,Zl(n)&&(f=!!n.leading,c="maxWait"in n,r=c?Zce(fu(n.maxWait)||0,e):r,d="trailing"in n?!!n.trailing:d);function h(L){var N=i,z=l;return i=l=void 0,u=L,s=t.apply(z,N),s}function g(L){return u=L,o=setTimeout(S,e),f?h(L):s}function _(L){var N=L-a,z=L-u,W=e-N;return c?Xce(W,r-z):W}function v(L){var N=L-a,z=L-u;return a===void 0||N>=e||N<0||c&&z>=r}function S(){var L=Cm();if(v(L))return A(L);o=setTimeout(S,_(L))}function A(L){return o=void 0,d&&i?h(L):(i=l=void 0,s)}function C(){o!==void 0&&clearTimeout(o),u=0,i=a=l=o=void 0}function I(){return o===void 0?s:A(Cm())}function M(){var L=Cm(),N=v(L);if(i=arguments,l=this,a=L,N){if(o===void 0)return g(a);if(c)return clearTimeout(o),o=setTimeout(S,e),h(a)}return o===void 0&&(o=setTimeout(S,e)),s}return M.cancel=C,M.flush=I,M}function $ce(t,e){if(t.match(/^[a-z]+:\/\//i))return t;if(t.match(/^\/\//))return window.location.protocol+t;if(t.match(/^[a-z]+:/i))return t;const n=document.implementation.createHTMLDocument(),i=n.createElement("base"),l=n.createElement("a");return n.head.appendChild(i),n.body.appendChild(l),e&&(i.href=e),l.href=t,l.href}const Jce=(()=>{let t=0;const e=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${e()}${t}`)})();function jr(t){const e=[];for(let n=0,i=t.length;nTl||t.height>Tl)&&(t.width>Tl&&t.height>Tl?t.width>t.height?(t.height*=Tl/t.width,t.width=Tl):(t.width*=Tl/t.height,t.height=Tl):t.width>Tl?(t.height*=Tl/t.width,t.width=Tl):(t.width*=Tl/t.height,t.height=Tl))}function xc(t){return new Promise((e,n)=>{const i=new Image;i.decode=()=>e(i),i.onload=()=>e(i),i.onerror=n,i.crossOrigin="anonymous",i.decoding="async",i.src=t})}async function nde(t){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(t)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}async function ide(t,e,n){const i="http://www.w3.org/2000/svg",l=document.createElementNS(i,"svg"),r=document.createElementNS(i,"foreignObject");return l.setAttribute("width",`${e}`),l.setAttribute("height",`${n}`),l.setAttribute("viewBox",`0 0 ${e} ${n}`),r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("x","0"),r.setAttribute("y","0"),r.setAttribute("externalResourcesRequired","true"),l.appendChild(r),r.appendChild(t),nde(l)}const cl=(t,e)=>{if(t instanceof e)return!0;const n=Object.getPrototypeOf(t);return n===null?!1:n.constructor.name===e.name||cl(n,e)};function lde(t){const e=t.getPropertyValue("content");return`${t.cssText} content: '${e.replace(/'|"/g,"")}';`}function rde(t){return jr(t).map(e=>{const n=t.getPropertyValue(e),i=t.getPropertyPriority(e);return`${e}: ${n}${i?" !important":""};`}).join(" ")}function sde(t,e,n){const i=`.${t}:${e}`,l=n.cssText?lde(n):rde(n);return document.createTextNode(`${i}{${l}}`)}function Vw(t,e,n){const i=window.getComputedStyle(t,n),l=i.getPropertyValue("content");if(l===""||l==="none")return;const r=Jce();try{e.className=`${e.className} ${r}`}catch{return}const s=document.createElement("style");s.appendChild(sde(r,n,i)),e.appendChild(s)}function ode(t,e){Vw(t,e,":before"),Vw(t,e,":after")}const Ww="application/font-woff",qw="image/jpeg",ade={woff:Ww,woff2:Ww,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:qw,jpeg:qw,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function ude(t){const e=/\.([^./]*?)$/g.exec(t);return e?e[1]:""}function K0(t){const e=ude(t).toLowerCase();return ade[e]||""}function fde(t){return t.split(/,/)[1]}function S1(t){return t.search(/^(data:)/)!==-1}function lM(t,e){return`data:${e};base64,${t}`}async function rM(t,e,n){const i=await fetch(t,e);if(i.status===404)throw new Error(`Resource "${i.url}" not found`);const l=await i.blob();return new Promise((r,s)=>{const o=new FileReader;o.onerror=s,o.onloadend=()=>{try{r(n({res:i,result:o.result}))}catch(a){s(a)}},o.readAsDataURL(l)})}const Lm={};function cde(t,e,n){let i=t.replace(/\?.*/,"");return n&&(i=t),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),e?`[${e}]${i}`:i}async function $0(t,e,n){const i=cde(t,e,n.includeQueryParams);if(Lm[i]!=null)return Lm[i];n.cacheBust&&(t+=(/\?/.test(t)?"&":"?")+new Date().getTime());let l;try{const r=await rM(t,n.fetchRequestInit,({res:s,result:o})=>(e||(e=s.headers.get("Content-Type")||""),fde(o)));l=lM(r,e)}catch(r){l=n.imagePlaceholder||"";let s=`Failed to fetch resource: ${t}`;r&&(s=typeof r=="string"?r:r.message),s&&console.warn(s)}return Lm[i]=l,l}async function dde(t){const e=t.toDataURL();return e==="data:,"?t.cloneNode(!1):xc(e)}async function hde(t,e){if(t.currentSrc){const r=document.createElement("canvas"),s=r.getContext("2d");r.width=t.clientWidth,r.height=t.clientHeight,s==null||s.drawImage(t,0,0,r.width,r.height);const o=r.toDataURL();return xc(o)}const n=t.poster,i=K0(n),l=await $0(n,i,e);return xc(l)}async function mde(t){var e;try{if(!((e=t==null?void 0:t.contentDocument)===null||e===void 0)&&e.body)return await Ud(t.contentDocument.body,{},!0)}catch{}return t.cloneNode(!1)}async function gde(t,e){return cl(t,HTMLCanvasElement)?dde(t):cl(t,HTMLVideoElement)?hde(t,e):cl(t,HTMLIFrameElement)?mde(t):t.cloneNode(!1)}const _de=t=>t.tagName!=null&&t.tagName.toUpperCase()==="SLOT";async function pde(t,e,n){var i,l;let r=[];return _de(t)&&t.assignedNodes?r=jr(t.assignedNodes()):cl(t,HTMLIFrameElement)&&!((i=t.contentDocument)===null||i===void 0)&&i.body?r=jr(t.contentDocument.body.childNodes):r=jr(((l=t.shadowRoot)!==null&&l!==void 0?l:t).childNodes),r.length===0||cl(t,HTMLVideoElement)||await r.reduce((s,o)=>s.then(()=>Ud(o,n)).then(a=>{a&&e.appendChild(a)}),Promise.resolve()),e}function bde(t,e){const n=e.style;if(!n)return;const i=window.getComputedStyle(t);i.cssText?(n.cssText=i.cssText,n.transformOrigin=i.transformOrigin):jr(i).forEach(l=>{let r=i.getPropertyValue(l);l==="font-size"&&r.endsWith("px")&&(r=`${Math.floor(parseFloat(r.substring(0,r.length-2)))-.1}px`),cl(t,HTMLIFrameElement)&&l==="display"&&r==="inline"&&(r="block"),l==="d"&&e.getAttribute("d")&&(r=`path(${e.getAttribute("d")})`),n.setProperty(l,r,i.getPropertyPriority(l))})}function vde(t,e){cl(t,HTMLTextAreaElement)&&(e.innerHTML=t.value),cl(t,HTMLInputElement)&&e.setAttribute("value",t.value)}function kde(t,e){if(cl(t,HTMLSelectElement)){const n=e,i=Array.from(n.children).find(l=>t.value===l.getAttribute("value"));i&&i.setAttribute("selected","")}}function wde(t,e){return cl(e,Element)&&(bde(t,e),ode(t,e),vde(t,e),kde(t,e)),e}async function yde(t,e){const n=t.querySelectorAll?t.querySelectorAll("use"):[];if(n.length===0)return t;const i={};for(let r=0;rgde(i,e)).then(i=>pde(t,i,e)).then(i=>wde(t,i)).then(i=>yde(i,e))}const sM=/url\((['"]?)([^'"]+?)\1\)/g,Tde=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Sde=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function Ede(t){const e=t.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${e})(['"]?\\))`,"g")}function Mde(t){const e=[];return t.replace(sM,(n,i,l)=>(e.push(l),n)),e.filter(n=>!S1(n))}async function Ode(t,e,n,i,l){try{const r=n?$ce(e,n):e,s=K0(e);let o;if(l){const a=await l(r);o=lM(a,s)}else o=await $0(r,s,i);return t.replace(Ede(e),`$1${o}$3`)}catch{}return t}function Ade(t,{preferredFontFormat:e}){return e?t.replace(Sde,n=>{for(;;){const[i,,l]=Tde.exec(n)||[];if(!l)return"";if(l===e)return`src: ${i};`}}):t}function oM(t){return t.search(sM)!==-1}async function aM(t,e,n){if(!oM(t))return t;const i=Ade(t,n);return Mde(i).reduce((l,r)=>l.then(s=>Ode(s,r,e,n)),Promise.resolve(i))}async function Jf(t,e,n){var i;const l=(i=e.style)===null||i===void 0?void 0:i.getPropertyValue(t);if(l){const r=await aM(l,null,n);return e.style.setProperty(t,r,e.style.getPropertyPriority(t)),!0}return!1}async function Cde(t,e){await Jf("background",t,e)||await Jf("background-image",t,e),await Jf("mask",t,e)||await Jf("mask-image",t,e)}async function Lde(t,e){const n=cl(t,HTMLImageElement);if(!(n&&!S1(t.src))&&!(cl(t,SVGImageElement)&&!S1(t.href.baseVal)))return;const i=n?t.src:t.href.baseVal,l=await $0(i,K0(i),e);await new Promise((r,s)=>{t.onload=r,t.onerror=s;const o=t;o.decode&&(o.decode=r),o.loading==="lazy"&&(o.loading="eager"),n?(t.srcset="",t.src=l):t.href.baseVal=l})}async function Ide(t,e){const n=jr(t.childNodes).map(i=>uM(i,e));await Promise.all(n).then(()=>t)}async function uM(t,e){cl(t,Element)&&(await Cde(t,e),await Lde(t,e),await Ide(t,e))}function Rde(t,e){const{style:n}=t;e.backgroundColor&&(n.backgroundColor=e.backgroundColor),e.width&&(n.width=`${e.width}px`),e.height&&(n.height=`${e.height}px`);const i=e.style;return i!=null&&Object.keys(i).forEach(l=>{n[l]=i[l]}),t}const jw={};async function Yw(t){let e=jw[t];if(e!=null)return e;const n=await(await fetch(t)).text();return e={url:t,cssText:n},jw[t]=e,e}async function Zw(t,e){let n=t.cssText;const i=/url\(["']?([^"')]+)["']?\)/g,l=(n.match(/url\([^)]+\)/g)||[]).map(async r=>{let s=r.replace(i,"$1");return s.startsWith("https://")||(s=new URL(s,t.url).href),rM(s,e.fetchRequestInit,({result:o})=>(n=n.replace(r,`url(${o})`),[r,o]))});return Promise.all(l).then(()=>n)}function Xw(t){if(t==null)return[];const e=[],n=/(\/\*[\s\S]*?\*\/)/gi;let i=t.replace(n,"");const l=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const a=l.exec(i);if(a===null)break;e.push(a[0])}i=i.replace(l,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,s="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",o=new RegExp(s,"gi");for(;;){let a=r.exec(i);if(a===null){if(a=o.exec(i),a===null)break;r.lastIndex=o.lastIndex}else o.lastIndex=r.lastIndex;e.push(a[0])}return e}async function Dde(t,e){const n=[],i=[];return t.forEach(l=>{if("cssRules"in l)try{jr(l.cssRules||[]).forEach((r,s)=>{if(r.type===CSSRule.IMPORT_RULE){let o=s+1;const a=r.href,u=Yw(a).then(f=>Zw(f,e)).then(f=>Xw(f).forEach(c=>{try{l.insertRule(c,c.startsWith("@import")?o+=1:l.cssRules.length)}catch(d){console.error("Error inserting rule from remote css",{rule:c,error:d})}})).catch(f=>{console.error("Error loading remote css",f.toString())});i.push(u)}})}catch(r){const s=t.find(o=>o.href==null)||document.styleSheets[0];l.href!=null&&i.push(Yw(l.href).then(o=>Zw(o,e)).then(o=>Xw(o).forEach(a=>{s.insertRule(a,l.cssRules.length)})).catch(o=>{console.error("Error loading remote stylesheet",o)})),console.error("Error inlining remote css file",r)}}),Promise.all(i).then(()=>(t.forEach(l=>{if("cssRules"in l)try{jr(l.cssRules||[]).forEach(r=>{n.push(r)})}catch(r){console.error(`Error while reading CSS rules from ${l.href}`,r)}}),n))}function Pde(t){return t.filter(e=>e.type===CSSRule.FONT_FACE_RULE).filter(e=>oM(e.style.getPropertyValue("src")))}async function Nde(t,e){if(t.ownerDocument==null)throw new Error("Provided element is not within a Document");const n=jr(t.ownerDocument.styleSheets),i=await Dde(n,e);return Pde(i)}async function Bde(t,e){const n=await Nde(t,e);return(await Promise.all(n.map(i=>{const l=i.parentStyleSheet?i.parentStyleSheet.href:null;return aM(i.cssText,l,e)}))).join(` +`)}async function zde(t,e){const n=e.fontEmbedCSS!=null?e.fontEmbedCSS:e.skipFonts?null:await Bde(t,e);if(n){const i=document.createElement("style"),l=document.createTextNode(n);i.appendChild(l),t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)}}async function Hde(t,e={}){const{width:n,height:i}=iM(t,e),l=await Ud(t,e,!0);return await zde(l,e),await uM(l,e),Rde(l,e),await ide(l,n,i)}async function fM(t,e={}){const{width:n,height:i}=iM(t,e),l=await Hde(t,e),r=await xc(l),s=document.createElement("canvas"),o=s.getContext("2d"),a=e.pixelRatio||ede(),u=e.canvasWidth||n,f=e.canvasHeight||i;return s.width=u*a,s.height=f*a,e.skipAutoScale||tde(s),s.style.width=`${u}`,s.style.height=`${f}`,e.backgroundColor&&(o.fillStyle=e.backgroundColor,o.fillRect(0,0,s.width,s.height)),o.drawImage(r,0,0,s.width,s.height),s}async function Ude(t,e={}){return(await fM(t,e)).toDataURL()}async function Fde(t,e={}){return(await fM(t,e)).toDataURL("image/jpeg",e.quality||1)}class Qr{constructor(e,n){this.model=e,this.services=n,this.init()}init(){}update(){}setModel(e){this.model=e}setServices(e){this.services=e}}const Gde="DONT_STYLE_ME_css_styles_verifier";class bt extends Qr{constructor(e,n){super(e,n),this.chartID=""}static getHTMLElementSize(e){return{width:e.clientWidth,height:e.clientHeight}}static getSVGElementSize(e,n={useAttrs:!1,useClientDimensions:!1,useBBox:!1,useBoundingRect:!1}){e.attr||(e=ht(e));const i={width:0,height:0},l=d=>{d&&Object.keys(i).forEach(h=>{if(d[h]){const g=d[h],_=parseFloat(g);g&&_>i[h]&&(""+g).indexOf("%")===-1&&(i[h]=_)}})},r={width:e.attr("width"),height:e.attr("height")},s=e.node();let o,a,u,f;try{typeof s.getBBox=="function"&&(o=s.getBBox(),a={width:o.width,height:o.height})}catch(d){console.error(d)}try{typeof(s==null?void 0:s.getBoundingClientRect)=="function"&&(u=s.getBoundingClientRect(),f={width:u.width,height:u.height})}catch(d){console.error(d)}let c;if(s instanceof SVGSVGElement&&(c={width:s.clientWidth,height:s.clientHeight}),n){if(n.useAttrs&&(l(r),i.width>0&&i.height>0))return i;if(n.useClientDimensions&&(l(c),i.width>0&&i.height>0))return c;if(n.useBBox&&(l(a),i.width>0&&i.height>0))return a;if(n.useBoundingRect&&(l(f),i.width>0&&i.height>0))return f}try{const d={width:Te(e.node(),"width","baseVal","value"),height:Te(e.node(),"height","baseVal","value")};l(d)}catch{l(c),l(a),l(r)}return i}static appendOrSelect(e,n){const i=e.select(`${n}`);if(i.empty()){let l=n.split("#"),r,s;return l.length===2?(r=l[0],l=l[1].split("."),s=l[0]):(l=n.split("."),r=l[0]),e.append(r).attr("id",s).attr("class",l.slice(1).join(" "))}return i}init(){this.styleHolderElement(),this.initializeID(),this.addMainContainer(),this.model.getOptions().resizable&&this.addResizeListener(),this.addHolderListeners(),this.handleFullscreenChange()}getChartID(){return this.chartID}generateElementIDString(e){return`chart-${this.chartID}-${e}`}initializeID(){this.chartID=Math.floor((1+Math.random())*281474976710656).toString(16)}addMainContainer(){const e=this.model.getOptions(),n=Te(e,"style","prefix"),i=ht(this.getHolder()).append("div").classed(`${al}--${n}--chart-wrapper`,!0).attr("id",`chart-${this.getChartID()}`).style("height","100%").style("width","100%");i.append("g").attr("class",Gde),this.mainContainer=i.node()}update(){this.styleHolderElement()}styleHolderElement(){const e=this.getHolder(),{width:n,height:i,theme:l}=this.model.getOptions();n!==this.width&&(e.style.width=n,this.width=n),i!==this.height&&(e.style.height=i,this.height=i),ht(this.getHolder()).classed(`${al}--chart-holder`,!0).attr("data-carbon-theme",l)}getHolder(){return this.model.get("holder")}exportToJPG(){const e=this,n=this.getHolder(),i=ht(n);i.classed("filled",!0),Fde(this.getMainContainer(),{quality:1,filter:l=>!(l.classList&&l.classList.contains("cds--cc--toolbar"))}).then(function(l){var r;(r=e.services.files)==null||r.downloadImage(l,"myChart.jpg"),i.classed("filled",!1)})}exportToPNG(){const e=this,n=this.getHolder(),i=ht(n);i.classed("filled",!0),Ude(this.getMainContainer(),{quality:1,filter:l=>!(l.classList&&l.classList.contains("cds--cc--toolbar"))}).then(function(l){var r;(r=e.services.files)==null||r.downloadImage(l,"myChart.png"),i.classed("filled",!1)}).catch(function(l){console.error("oops, something went wrong!",l)})}toggleFullscreen(){const e=this.getHolder();ht(e).classed("fullscreen")&&(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)?document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():e.requestFullscreen?e.requestFullscreen():e.webkitRequestFullscreen?e.webkitRequestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()}handleFullscreenChange(){document.addEventListener("fullscreenchange",()=>{const e=ht(this.getHolder()),n=e.classed("fullscreen");e.classed("fullscreen",!n)})}setSVGMaxHeight(){if(!this.model.getOptions().height){const{height:e}=bt.getSVGElementSize(ht(this.mainContainer),{useBBox:!0}),n=ht(this.mainContainer).attr("class"),i=ht(this.mainContainer).selectAll(`.${n} > svg`);let l=0;i.nodes().forEach(function(r){l+=Number(bt.getSVGElementSize(ht(r),{useBBox:!0}).height)}),l<=e?ht(this.mainContainer).attr("height",l):ht(this.mainContainer).attr("height","100%")}}getMainContainer(){return this.mainContainer}addHolderListeners(){const e=this.getHolder();e&&ht(e).on("mouseover",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(je.Chart.MOUSEOVER)}).on("mouseout",()=>{var n;(n=this.services.events)==null||n.dispatchEvent(je.Chart.MOUSEOUT)})}addResizeListener(){const e=this.getHolder();if(!e)return;let n=e.clientWidth,i=e.clientHeight;const l=Kce(()=>{var r;e&&(Math.abs(n-e.clientWidth)>1||Math.abs(i-e.clientHeight)>1)&&(n=e.clientWidth,i=e.clientHeight,(r=this.services.events)==null||r.dispatchEvent(je.Chart.RESIZE))},12.5);new ResizeObserver(l).observe(e)}}class Cu extends Qr{static appendOrUpdateLinearGradient(e){let n=e.svg.select(`defs linearGradient#${e.id}`);n.empty()&&(n=e.svg.append("defs").append("linearGradient").attr("id",e.id).attr("x1",e.x1).attr("x2",e.x2).attr("y1",e.y1).attr("y2",e.y2)),n.selectAll("stop").remove(),n.selectAll("stop").data(e.stops).enter().append("stop").attr("offset",i=>i.offset).style("stop-color",i=>i.color).style("stop-opacity",i=>i.opacity)}static getOffsetRatio(e){return(Math.abs(e[1])*100/Math.abs(e[0]-e[1])).toFixed(2)+"%"}static getStops(e,n){const i=e[0]<0&&e[1]>0;let l=[{offset:"0%",color:n,opacity:"0.6"},{offset:"80%",color:n,opacity:"0"}];return i&&(l=[{offset:"0%",color:n,opacity:"0.6"},{offset:Cu.getOffsetRatio(e),color:n,opacity:"0"},{offset:"100%",color:n,opacity:"0.6"}]),l}}var Vde={value:function(){}};function cM(){for(var t=0,e=arguments.length,n={},i;t=0&&(i=n.slice(l+1),n=n.slice(0,l)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:i}})}cc.prototype=cM.prototype={constructor:cc,on:function(t,e){var n=this._,i=Wde(t+"",n),l,r=-1,s=i.length;if(arguments.length<2){for(;++r0)for(var n=new Array(l),i=0,l,r;i=e?t:e)),t}function Xde(t,e,n){return n===void 0&&(n=e,e=void 0),n!==void 0&&(n=fu(n),n=n===n?n:0),e!==void 0&&(e=fu(e),e=e===e?e:0),Zde(fu(t),e,n)}function Kde(t,e){return zd(t,e)}function $de(t,e){var n;return tM(t,function(i,l,r){return n=e(i,l,r),!n}),!!n}function Jde(t,e,n){var i=qi(t)?BE:$de;return n&&_E(t,e,n)&&(e=void 0),i(t,Y0(e))}class Xn{constructor(e,n,i){if(this.type="",this.renderType=wn.HTML,this.id="",this.parent=void 0,this.configs={},this.model=e,this.services=n,i&&(this.configs=i,this.configs.id)){const l=Te(this.model.getOptions(),"style","prefix");this.id=`${l}--${this.configs.id}`}this.parent||this.setParent(ht(this.services.domUtils.getMainContainer()))}init(){}render(e=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(e){this.model=e}setServices(e){this.services=e}setParent(e){var n;const i=this.parent;if(this.parent=e,!(i&&i.node()===e.node())&&this.type){const l=Te(this.model.getOptions(),"style","prefix");(n=this.parent)==null||n.classed(`${al}--${l}--${this.type}`,!0),i&&i.classed(`${al}--${l}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(e={withinChartClip:!1}){if(this.type){const n=Te(this.model.getOptions(),"style","prefix"),i=this.id?`#${this.id}`:"",l=bt.appendOrSelect(this.parent,`${this.renderType===wn.SVG?"svg":"div"}${i}.${al}--${n}--${this.type}`);if(e.withinChartClip){const r=this.model.get("chartClipId");if(r){const s=ht(`#${r}`).select("rect");s.size()!==0&&parseFloat(s.attr("height"))>0&&l.attr("clip-path",`url(#${r})`)}}return l.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?en({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const dM=class hM extends Xn{constructor(){super(...arguments),this.type="toolbar",this.renderType=wn.HTML}init(){const e=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(je.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",e)}),this.services.events.addEventListener(je.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",e)})}render(e=!0){const n=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(Te(this.getOptions(),"data","loading"))n.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=n.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("
        "));const{buttonList:i,overflowMenuItemList:l}=this.getControlConfigs();l&&i.push(this.getOverflowButtonConfig());const r=n.selectAll("div.toolbar-control").data(i,a=>a.id);r.exit().remove();const s=r.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),o=this;s.merge(r).classed("disabled",a=>a.shouldBeDisabled()).attr("aria-disabled",a=>a.shouldBeDisabled()).attr("aria-label",a=>a.title).html(a=>` `).each(function(a,u){ht(this).select("svg").style("will-change","transform").style("width",a.iconSVG.width!==void 0?a.iconSVG.width:"20px").style("height",a.iconSVG.height!==void 0?a.iconSVG.height:"20px"),ht(this).select("button").on("click",f=>{a.shouldBeDisabled()||o.triggerFunctionAndEvent(a,f,this)}).on("keydown",f=>{f.key&&f.key==="Enter"||f.key===" "?(f.preventDefault(),o.triggerFunctionAndEvent(a,f,this)):f.key&&f.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(u):f.key&&f.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(u)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:e}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(e,l=>Te(l,"id"));n.exit().remove();const i=n.enter().append("li").attr("id",l=>this.services.domUtils.generateElementIDString(`control-${l.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);i.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),i.merge(n).classed("cds--overflow-menu-options__option--disabled",l=>l.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",l=>l.shouldBeDisabled()).attr("aria-disabled",l=>l.shouldBeDisabled()).selectAll("button").text(l=>l.text)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(e){this.overflowMenu&&(this.overflowMenu.classed("is-open",e),this.overflowButton&&(this.overflowButton.attr("aria-expanded",e),ht(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",e).classed("cds--overflow-menu--open",e)),e?this.services.events.dispatchEvent(je.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(je.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(e){const n=this.getToolbarButtonItems();let i=n.length;for(let l=e-1;l>=0;l--)if(!n[l].shouldBeDisabled()){i=l;break}if(i-1){const l=ht(`button#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)}`).node();"focus"in l&&l.focus()}}focusOnPreviousEnabledMenuItem(e){const n=this.getOverflowMenuItems();let i=n.length;for(let l=e-1;l>=0;l--)if(!n[l].shouldBeDisabled()){i=l;break}if(i-1){const l=ht(`#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)} button`).node();"focus"in l&&l.focus()}}toggleOverflowMenu(e){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((i,l)=>{const r=ht(`#${this.services.domUtils.generateElementIDString(`control-${i.id}`)}`);r!==null&&(r.on("click",()=>{n.triggerFunctionAndEvent(i,e,r.node()),n.updateOverflowMenu(!1)}),r.on("keydown",s=>{s&&s.key==="Enter"?n.triggerFunctionAndEvent(i,e,r.node()):s&&s.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(l):s&&s.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(l):s&&s.key==="Escape"&&n.updateOverflowMenu(!1),s.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}e&&e.stopImmediatePropagation()}triggerFunctionAndEvent(e,n,i){typeof e.shouldBeDisabled=="function"&&e.shouldBeDisabled()||(typeof e.clickFunction=="function"&&e.clickFunction(n),this.services.events.dispatchEvent(je.Toolbar.BUTTON_CLICK,{control:e,event:n,element:i}))}getControlConfigs(){const e=Te(this.getOptions(),"toolbar","numberOfIcons")-1,n=Te(this.getOptions(),"toolbar","controls"),i=[],l=[],r=[];return n.forEach(s=>{let o=null;s.type===Yn.CUSTOM?(Te(s,"id")===null&&(s.id=`toolbar-button-${dM.buttonID++}`),Te(s,"shouldBeDisabled")===null&&(s.shouldBeDisabled=()=>!1),o=s):o=this.getControlConfigByType(s.type),o&&(o.text=s.text?s.text:s.type,o.id.indexOf("toolbar-export")!==-1?i.push(o):l.length!1,iconSVG:{content:` + `).each(function(a,u){ht(this).select("svg").style("will-change","transform").style("width",a.iconSVG.width!==void 0?a.iconSVG.width:"20px").style("height",a.iconSVG.height!==void 0?a.iconSVG.height:"20px"),ht(this).select("button").on("click",f=>{a.shouldBeDisabled()||o.triggerFunctionAndEvent(a,f,this)}).on("keydown",f=>{f.key&&f.key==="Enter"||f.key===" "?(f.preventDefault(),o.triggerFunctionAndEvent(a,f,this)):f.key&&f.key==="ArrowLeft"?o.focusOnPreviousEnabledToolbarItem(u):f.key&&f.key==="ArrowRight"&&o.focusOnNextEnabledToolbarItem(u)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:e}=this.getControlConfigs(),n=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(e,l=>Te(l,"id"));n.exit().remove();const i=n.enter().append("li").attr("id",l=>this.services.domUtils.generateElementIDString(`control-${l.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);i.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),i.merge(n).classed("cds--overflow-menu-options__option--disabled",l=>l.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",l=>l.shouldBeDisabled()).attr("aria-disabled",l=>l.shouldBeDisabled()).selectAll("button").text(l=>l.text)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(e){this.overflowMenu&&(this.overflowMenu.classed("is-open",e),this.overflowButton&&(this.overflowButton.attr("aria-expanded",e),ht(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",e).classed("cds--overflow-menu--open",e)),e?this.services.events.dispatchEvent(je.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(je.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(e){const n=this.getToolbarButtonItems();let i=n.length;for(let l=e-1;l>=0;l--)if(!n[l].shouldBeDisabled()){i=l;break}if(i-1){const l=ht(`button#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)}`).node();"focus"in l&&l.focus()}}focusOnPreviousEnabledMenuItem(e){const n=this.getOverflowMenuItems();let i=n.length;for(let l=e-1;l>=0;l--)if(!n[l].shouldBeDisabled()){i=l;break}if(i-1){const l=ht(`#${this.services.domUtils.generateElementIDString(`control-${n[i].id}`)} button`).node();"focus"in l&&l.focus()}}toggleOverflowMenu(e){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const n=this;this.getOverflowMenuItems().forEach((i,l)=>{const r=ht(`#${this.services.domUtils.generateElementIDString(`control-${i.id}`)}`);r!==null&&(r.on("click",()=>{n.triggerFunctionAndEvent(i,e,r.node()),n.updateOverflowMenu(!1)}),r.on("keydown",s=>{s&&s.key==="Enter"?n.triggerFunctionAndEvent(i,e,r.node()):s&&s.key==="ArrowUp"?n.focusOnPreviousEnabledMenuItem(l):s&&s.key==="ArrowDown"?n.focusOnNextEnabledMenuItem(l):s&&s.key==="Escape"&&n.updateOverflowMenu(!1),s.preventDefault()}))}),n.focusOnNextEnabledMenuItem(-1)}e&&e.stopImmediatePropagation()}triggerFunctionAndEvent(e,n,i){typeof e.shouldBeDisabled=="function"&&e.shouldBeDisabled()||(typeof e.clickFunction=="function"&&e.clickFunction(n),this.services.events.dispatchEvent(je.Toolbar.BUTTON_CLICK,{control:e,event:n,element:i}))}getControlConfigs(){const e=Te(this.getOptions(),"toolbar","numberOfIcons")-1,n=Te(this.getOptions(),"toolbar","controls"),i=[],l=[],r=[];return n.forEach(s=>{let o=null;s.type===Yn.CUSTOM?(Te(s,"id")===null&&(s.id=`toolbar-button-${hM.buttonID++}`),Te(s,"shouldBeDisabled")===null&&(s.shouldBeDisabled=()=>!1),o=s):o=this.getControlConfigByType(s.type),o&&(o.text=s.text?s.text:s.type,o.id.indexOf("toolbar-export")!==-1?i.push(o):l.length!1,iconSVG:{content:` `},clickFunction:e=>this.toggleOverflowMenu(e)}}getControlConfigByType(e){const n=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),i=this.model.getDisplayData();let l;switch(e){case Yn.ZOOM_IN:n&&(l={id:"toolbar-zoomIn",title:"Zoom in",shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(e)},clickFunction:()=>this.services.zoom.zoomIn()});break;case Yn.ZOOM_OUT:n&&(l={id:"toolbar-zoomOut",title:"Zoom out",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(e)},clickFunction:()=>this.services.zoom.zoomOut()});break;case Yn.RESET_ZOOM:n&&(l={id:"toolbar-resetZoom",title:"Reset zoom",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(e)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case Yn.MAKE_FULLSCREEN:l={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(e),width:"15px",height:"15px"},title:"Make fullscreen",shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case Yn.SHOW_AS_DATATABLE:l={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(e)},title:"Show as table",shouldBeDisabled:()=>i.length===0,clickFunction:()=>this.services.events.dispatchEvent(je.Modal.SHOW)};break;case Yn.EXPORT_CSV:l={id:"toolbar-export-CSV",title:"Export as CSV",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(e)},clickFunction:()=>this.model.exportToCSV()};break;case Yn.EXPORT_PNG:l={id:"toolbar-export-PNG",title:"Export as PNG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(e)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case Yn.EXPORT_JPG:l={id:"toolbar-export-JPG",title:"Export as JPG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(e)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+e)}return l}getControlIconByType(e){switch(e){case Yn.ZOOM_IN:return` `;case Yn.ZOOM_OUT:return` - `;case Yn.RESET_ZOOM:return'';case Yn.MAKE_FULLSCREEN:return'';case Yn.SHOW_AS_DATATABLE:return'';case Yn.EXPORT_CSV:return'';case Yn.EXPORT_JPG:return'';case Yn.EXPORT_PNG:return'';default:throw Error("Not supported toolbar control type: "+e)}}};cM.buttonID=0;let hM=cM;const mM=class gM extends Xn{constructor(e,n,i,l){super(e,n,l),this.type="layout",this.configs=l,this.children=i,this._instanceID=gM.instanceID++,this.init()}init(){this.children.forEach(e=>{e.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const e=this.parent;let n=0;return e.selectAll(`div.layout-child-${this._instanceID}`).filter(i=>{const l=Te(i,"growth");return l===Nn.PREFERRED||l===Nn.FIXED}).each(function(i){n+=i.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(e=>Te(e,"growth")===Nn.STRETCH).size()}render(e=!0){const n=this.parent,{width:i,height:l}=bt.getHTMLElementSize(n.node()),r=this.configs.direction===pi.ROW||this.configs.direction===pi.ROW_REVERSE,s=Te(this.model.getOptions(),"style","prefix"),o=n.classed(`${al}--${s}--layout-row`,this.configs.direction===pi.ROW).classed(`${al}--${s}--layout-row-reverse`,this.configs.direction===pi.ROW_REVERSE).classed(`${al}--${s}--layout-column`,this.configs.direction===pi.COLUMN).classed(`${al}--${s}--layout-column-reverse`,this.configs.direction===pi.COLUMN_REVERSE).classed(`${al}--${s}--layout-alignitems-center`,this.configs.alignItems===vd.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);o.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",u=>`layout-child layout-child-${this._instanceID} ${u.id}`).each(function(u){u.components.forEach(f=>{const c=ht(this),d=Te(u,"renderType")===wn.SVG;f.setParent(d?bt.appendOrSelect(c,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):c);const h=Te(u,"growth");(h===Nn.PREFERRED||h===Nn.FIXED)&&f.render(e)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(u){const f=Te(u,"growth"),c=Te(u,"renderType")===wn.SVG?bt.getSVGElementSize(ht(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):bt.getHTMLElementSize(this);if(f===Nn.PREFERRED){const d=r?c.width:c.height,h=r?i:l;u.size=d/h*100}}),o.exit().remove(),this.children.filter(u=>Te(u,"growth")===Nn.STRETCH).forEach(u=>{u.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const a=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);r?a.style("width",u=>`${u.size/100*i}px`).style("height","100%"):a.style("height",u=>`${u.size/100*l}px`).style("width","100%"),a.each(function(u){u.components.forEach(f=>{Te(u,"growth")===Nn.STRETCH&&f.render(e)})})}setModel(e){super.setModel(e),this.children.forEach(n=>{n.components.forEach(i=>i.setModel(e))})}setServices(e){super.setServices(e),this.children.forEach(n=>{n.components.forEach(i=>i.setServices(e))})}destroy(){this.children.forEach(e=>{e.components.forEach(n=>n.destroy())})}};mM.instanceID=Math.floor(Math.random()*99999999999);let $o=mM;class ed extends Xn{constructor(){super(...arguments),this.type="spacer"}render(e=!1){this.getComponentContainer().style("width",`${this.configs.size||Hw.default.size}px`).style("height",`${this.configs.size||Hw.default.size}px`).attr("opacity",0)}}var Qde={prefix:"bx",selectorTabbable:` + `;case Yn.RESET_ZOOM:return'';case Yn.MAKE_FULLSCREEN:return'';case Yn.SHOW_AS_DATATABLE:return'';case Yn.EXPORT_CSV:return'';case Yn.EXPORT_JPG:return'';case Yn.EXPORT_PNG:return'';default:throw Error("Not supported toolbar control type: "+e)}}};dM.buttonID=0;let mM=dM;const gM=class _M extends Xn{constructor(e,n,i,l){super(e,n,l),this.type="layout",this.configs=l,this.children=i,this._instanceID=_M.instanceID++,this.init()}init(){this.children.forEach(e=>{e.components.forEach(n=>{n.init()})})}getPreferedAndFixedSizeSum(){const e=this.parent;let n=0;return e.selectAll(`div.layout-child-${this._instanceID}`).filter(i=>{const l=Te(i,"growth");return l===Nn.PREFERRED||l===Nn.FIXED}).each(function(i){n+=i.size}),n}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(e=>Te(e,"growth")===Nn.STRETCH).size()}render(e=!0){const n=this.parent,{width:i,height:l}=bt.getHTMLElementSize(n.node()),r=this.configs.direction===pi.ROW||this.configs.direction===pi.ROW_REVERSE,s=Te(this.model.getOptions(),"style","prefix"),o=n.classed(`${al}--${s}--layout-row`,this.configs.direction===pi.ROW).classed(`${al}--${s}--layout-row-reverse`,this.configs.direction===pi.ROW_REVERSE).classed(`${al}--${s}--layout-column`,this.configs.direction===pi.COLUMN).classed(`${al}--${s}--layout-column-reverse`,this.configs.direction===pi.COLUMN_REVERSE).classed(`${al}--${s}--layout-alignitems-center`,this.configs.alignItems===vd.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);o.enter().append("div").merge(n.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",u=>`layout-child layout-child-${this._instanceID} ${u.id}`).each(function(u){u.components.forEach(f=>{const c=ht(this),d=Te(u,"renderType")===wn.SVG;f.setParent(d?bt.appendOrSelect(c,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):c);const h=Te(u,"growth");(h===Nn.PREFERRED||h===Nn.FIXED)&&f.render(e)})}),n.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(u){const f=Te(u,"growth"),c=Te(u,"renderType")===wn.SVG?bt.getSVGElementSize(ht(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):bt.getHTMLElementSize(this);if(f===Nn.PREFERRED){const d=r?c.width:c.height,h=r?i:l;u.size=d/h*100}}),o.exit().remove(),this.children.filter(u=>Te(u,"growth")===Nn.STRETCH).forEach(u=>{u.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const a=n.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);r?a.style("width",u=>`${u.size/100*i}px`).style("height","100%"):a.style("height",u=>`${u.size/100*l}px`).style("width","100%"),a.each(function(u){u.components.forEach(f=>{Te(u,"growth")===Nn.STRETCH&&f.render(e)})})}setModel(e){super.setModel(e),this.children.forEach(n=>{n.components.forEach(i=>i.setModel(e))})}setServices(e){super.setServices(e),this.children.forEach(n=>{n.components.forEach(i=>i.setServices(e))})}destroy(){this.children.forEach(e=>{e.components.forEach(n=>n.destroy())})}};gM.instanceID=Math.floor(Math.random()*99999999999);let $o=gM;class ed extends Xn{constructor(){super(...arguments),this.type="spacer"}render(e=!1){this.getComponentContainer().style("width",`${this.configs.size||Hw.default.size}px`).style("height",`${this.configs.size||Hw.default.size}px`).attr("opacity",0)}}var Qde={prefix:"bx",selectorTabbable:` a[href], area[href], input:not([disabled]):not([tabindex='-1']), button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']), textarea:not([disabled]):not([tabindex='-1']), @@ -125,8 +125,8 @@ function print() { __p += __j.call(arguments, '') } textarea:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable=true] `},Im=Qde;function $w(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,i=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function td(t){return td=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},td(t)}function hhe(t){var e=function(n){uhe(l,n);var i=fhe(l);function l(r){var s,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ohe(this,l),s=i.call(this,r,o),s.children=[],!r||r.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");return s.element=r,s.options=Object.assign(Object.create(s.constructor.options),o),s.constructor.components.set(s.element,pM(s)),s}return ahe(l,[{key:"release",value:function(){for(var r=this.children.pop();r;r=this.children.pop())r.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(r,s){return this.components.get(r)||new this(r,s)}}]),l}(t);return e}function A1(t){"@babel/helpers - typeof";return A1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A1(t)}function mhe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qw(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ha(t){return ha=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ha(t)}function yhe(t){var e=function(n){phe(l,n);var i=bhe(l);function l(){var r;mhe(this,l);for(var s=arguments.length,o=new Array(s),a=0;a1?e-1:0),i=1;it.length)&&(e=t.length);for(var n=0,i=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function nd(t){return nd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},nd(t)}function Nhe(t){var e=function(n){Lhe(l,n);var i=Ihe(l);function l(){return Ahe(this,l),i.apply(this,arguments)}return Che(l,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var r=this,s=arguments.length,o=new Array(s),a=0;a"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function id(t){return id=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},id(t)}function Whe(t){var e=function(n){Hhe(l,n);var i=Uhe(l);function l(){return Bhe(this,l),i.apply(this,arguments)}return zhe(l,[{key:"show",value:function(r,s){(!r||typeof r=="function")&&(s=r),this.changeState("shown",e6(r),s)}},{key:"hide",value:function(r,s){(!r||typeof r=="function")&&(s=r),this.changeState("hidden",e6(r),s)}}]),l}(t);return e}var qhe=[Nhe,Whe];const jhe=qhe;function B1(t){"@babel/helpers - typeof";return B1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B1(t)}function Yhe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n6(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ld(t){return ld=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ld(t)}function xhe(t){var e=function(n){Xhe(l,n);var i=Khe(l);function l(){return Yhe(this,l),i.apply(this,arguments)}return Zhe(l,null,[{key:"init",value:function(){var r=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=Object.assign(Object.create(this.options),o);if(!s||s.nodeType!==Node.ELEMENT_NODE&&s.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(s.nodeType===Node.ELEMENT_NODE&&s.matches(a.selectorInit))this.create(s,o);else{var u=a.initEventNames.map(function(f){return ru(s,f,function(c){var d=D1(c,"[".concat(a.attribInitTarget,"]"));if(d){c.delegateTarget=d;var h=d.ownerDocument.querySelectorAll(d.getAttribute(a.attribInitTarget));if(h.length>1)throw new Error("Target widget must be unique.");if(h.length===1){d.tagName==="A"&&c.preventDefault();var g=r.create(h[0],o);typeof g.createdByLauncher=="function"&&g.createdByLauncher(c)}}})});return{release:function(){for(var f=u.pop();f;f=u.pop())f.release()}}}return""}}]),l.forLazyInit=!0,l}(t);return e}function H1(t){"@babel/helpers - typeof";return H1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H1(t)}function eme(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i6(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function rd(t){return rd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},rd(t)}var ome=function(t){nme(n,t);var e=ime(n);function n(i,l){var r;return eme(this,n),r=e.call(this,i,l),r._handleFocusinListener=void 0,r._handleKeydownListener=void 0,r._handleFocusin=function(s){var o=r.element.querySelector(r.options.selectorModalContainer)||r.element;r.element.classList.contains(r.options.classVisible)&&!o.contains(s.target)&&r.options.selectorsFloatingMenus.every(function(a){return!D1(s,a)})&&r.element.querySelector(Im.selectorTabbable).focus()},r._hookCloseActions(),r}return tme(n,[{key:"createdByLauncher",value:function(i){this.show(i)}},{key:"shouldStateBeChanged",value:function(i){return i==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(i,l,r){var s=this,o,a=function(){if(o&&(o=s.unmanage(o).release()),i==="shown"&&s.element.offsetWidth>0&&s.element.offsetHeight>0){s.previouslyFocusedNode=s.element.ownerDocument.activeElement;var c=s.element.querySelector(s.options.selectorPrimaryFocus)||s.element.querySelector(Im.selectorTabbable);c.focus()}r()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),i==="shown"){var u="onfocusin"in this.element.ownerDocument.defaultView,f=u?"focusin":"focus";this._handleFocusinListener=this.manage(ru(this.element.ownerDocument,f,this._handleFocusin,!u))}i==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):i==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),o=this.manage(ru(this.element,"transitionend",a))}},{key:"_hookCloseActions",value:function(){var i=this;this.manage(ru(this.element,"click",function(l){var r=D1(l,i.options.selectorModalClose);r&&(l.delegateTarget=r),(r||l.target===i.element)&&i.hide(l)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(ru(this.element.ownerDocument.body,"keydown",function(l){l.which===27&&i.shouldStateBeChanged("hidden")&&(l.stopPropagation(),i.hide(l))}))}}],[{key:"options",get:function(){var i=Im.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(i,"--overflow-menu-options"),".".concat(i,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(i,"--modal-container"),classVisible:"is-visible",classBody:"".concat(i,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),n.components=new WeakMap,n}(she(hhe,xhe,jhe,yhe));const ame=ome;class bM extends Xn{constructor(e,n,i){super(e,n,i),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),ame.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(je.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(je.Modal.SHOW,this.handleShowModal)}getModalHTML(){const e=this.model.getOptions(),n=Te(e,"style","prefix"),i=this.model.getTabularDataArray();return` +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ihe(t,e){if(t){if(typeof t=="string")return E1(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E1(t,e)}}function lhe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function rhe(t){if(Array.isArray(t))return E1(t)}function E1(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function td(t){return td=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},td(t)}function hhe(t){var e=function(n){uhe(l,n);var i=fhe(l);function l(r){var s,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(ohe(this,l),s=i.call(this,r,o),s.children=[],!r||r.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");return s.element=r,s.options=Object.assign(Object.create(s.constructor.options),o),s.constructor.components.set(s.element,bM(s)),s}return ahe(l,[{key:"release",value:function(){for(var r=this.children.pop();r;r=this.children.pop())r.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(r,s){return this.components.get(r)||new this(r,s)}}]),l}(t);return e}function A1(t){"@babel/helpers - typeof";return A1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A1(t)}function mhe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qw(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ha(t){return ha=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ha(t)}function yhe(t){var e=function(n){phe(l,n);var i=bhe(l);function l(){var r;mhe(this,l);for(var s=arguments.length,o=new Array(s),a=0;a1?e-1:0),i=1;it.length)&&(e=t.length);for(var n=0,i=new Array(e);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function nd(t){return nd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},nd(t)}function Nhe(t){var e=function(n){Lhe(l,n);var i=Ihe(l);function l(){return Ahe(this,l),i.apply(this,arguments)}return Che(l,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var r=this,s=arguments.length,o=new Array(s),a=0;a"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function id(t){return id=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},id(t)}function Whe(t){var e=function(n){Hhe(l,n);var i=Uhe(l);function l(){return Bhe(this,l),i.apply(this,arguments)}return zhe(l,[{key:"show",value:function(r,s){(!r||typeof r=="function")&&(s=r),this.changeState("shown",e6(r),s)}},{key:"hide",value:function(r,s){(!r||typeof r=="function")&&(s=r),this.changeState("hidden",e6(r),s)}}]),l}(t);return e}var qhe=[Nhe,Whe];const jhe=qhe;function B1(t){"@babel/helpers - typeof";return B1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B1(t)}function Yhe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n6(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ld(t){return ld=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ld(t)}function xhe(t){var e=function(n){Xhe(l,n);var i=Khe(l);function l(){return Yhe(this,l),i.apply(this,arguments)}return Zhe(l,null,[{key:"init",value:function(){var r=this,s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=Object.assign(Object.create(this.options),o);if(!s||s.nodeType!==Node.ELEMENT_NODE&&s.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(s.nodeType===Node.ELEMENT_NODE&&s.matches(a.selectorInit))this.create(s,o);else{var u=a.initEventNames.map(function(f){return ru(s,f,function(c){var d=D1(c,"[".concat(a.attribInitTarget,"]"));if(d){c.delegateTarget=d;var h=d.ownerDocument.querySelectorAll(d.getAttribute(a.attribInitTarget));if(h.length>1)throw new Error("Target widget must be unique.");if(h.length===1){d.tagName==="A"&&c.preventDefault();var g=r.create(h[0],o);typeof g.createdByLauncher=="function"&&g.createdByLauncher(c)}}})});return{release:function(){for(var f=u.pop();f;f=u.pop())f.release()}}}return""}}]),l.forLazyInit=!0,l}(t);return e}function H1(t){"@babel/helpers - typeof";return H1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H1(t)}function eme(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i6(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function rd(t){return rd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},rd(t)}var ome=function(t){nme(n,t);var e=ime(n);function n(i,l){var r;return eme(this,n),r=e.call(this,i,l),r._handleFocusinListener=void 0,r._handleKeydownListener=void 0,r._handleFocusin=function(s){var o=r.element.querySelector(r.options.selectorModalContainer)||r.element;r.element.classList.contains(r.options.classVisible)&&!o.contains(s.target)&&r.options.selectorsFloatingMenus.every(function(a){return!D1(s,a)})&&r.element.querySelector(Im.selectorTabbable).focus()},r._hookCloseActions(),r}return tme(n,[{key:"createdByLauncher",value:function(i){this.show(i)}},{key:"shouldStateBeChanged",value:function(i){return i==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(i,l,r){var s=this,o,a=function(){if(o&&(o=s.unmanage(o).release()),i==="shown"&&s.element.offsetWidth>0&&s.element.offsetHeight>0){s.previouslyFocusedNode=s.element.ownerDocument.activeElement;var c=s.element.querySelector(s.options.selectorPrimaryFocus)||s.element.querySelector(Im.selectorTabbable);c.focus()}r()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),i==="shown"){var u="onfocusin"in this.element.ownerDocument.defaultView,f=u?"focusin":"focus";this._handleFocusinListener=this.manage(ru(this.element.ownerDocument,f,this._handleFocusin,!u))}i==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):i==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),o=this.manage(ru(this.element,"transitionend",a))}},{key:"_hookCloseActions",value:function(){var i=this;this.manage(ru(this.element,"click",function(l){var r=D1(l,i.options.selectorModalClose);r&&(l.delegateTarget=r),(r||l.target===i.element)&&i.hide(l)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(ru(this.element.ownerDocument.body,"keydown",function(l){l.which===27&&i.shouldStateBeChanged("hidden")&&(l.stopPropagation(),i.hide(l))}))}}],[{key:"options",get:function(){var i=Im.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(i,"--overflow-menu-options"),".".concat(i,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(i,"--modal-container"),classVisible:"is-visible",classBody:"".concat(i,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),n.components=new WeakMap,n}(she(hhe,xhe,jhe,yhe));const ame=ome;class vM extends Xn{constructor(e,n,i){super(e,n,i),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),ame.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(je.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(je.Modal.SHOW,this.handleShowModal)}getModalHTML(){const e=this.model.getOptions(),n=Te(e,"style","prefix"),i=this.model.getTabularDataArray();return`
        @@ -162,7 +162,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
        -
        `}render(e=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const i=ht(this.services.domUtils.getHolder()),l=Te(n,"style","prefix");this.modal=bt.appendOrSelect(i,`div.${al}--${l}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0,this.modal.attr("data-modal",!0).attr("class","cds--modal cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby","modal-title").attr("aria-describedby","modal-description").attr("tabindex",-1)}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class vM extends Xn{constructor(){super(...arguments),this.type="title",this.renderType=wn.HTML}render(e=!1){const n=this.getComponentContainer(),i=Te(this.getOptions(),"title"),l=n.selectAll("p.title").data([i]);if(l.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(l).html(r=>r),l.node()&&l.node().offsetWidthn){e.append("tspan").text("...");const l=bt.appendOrSelect(e,"tspan").node().getComputedTextLength(),r=e.text(),s=this.getSubstringIndex(e.node(),0,r.length-1,n-l);e.html(r.substring(0,s-1)).append("tspan").text("...");const o=this;e.on("mouseover",function(a){o.services.events.dispatchEvent(je.Tooltip.SHOW,{event:a,hoveredElement:e,content:i})}).on("mousemove",function(a){o.services.events.dispatchEvent(je.Tooltip.MOVE,{event:a})}).on("mouseout",function(){o.services.events.dispatchEvent(je.Tooltip.HIDE)})}}getMaxTitleWidth(){return bt.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(e,n,i,l){const r=Math.floor((i+n)/2);return e.getSubStringLength(0,r)>l?this.getSubstringIndex(e,n,r,l):e.getSubStringLength(0,r)l?r:this.getSubstringIndex(e,r,i,l):r}}class kM extends Xn{constructor(){super(...arguments),this.type="legend",this.renderType=wn.HTML}render(e=!1){const n=this.getOptions(),i=Te(n,"legend"),l=Te(i,"alignment"),r=Te(n,"legend","orientation");let s=this.model.getDataGroups();const{DISABLED:o}=Ci.items.status,a=s.some(A=>A.status===o),u=Te(i,"order"),f=this.getComponentContainer().classed("center-aligned",l===jl.CENTER).classed("right-aligned",l===jl.RIGHT).classed(r,!0).classed("has-deactivated-items",a).attr("role",fi.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");u&&(s=this.sortDataGroups(s,u));const c=f.selectAll("div.legend-item").data(s,A=>A.name),d=c.enter().append("div").attr("class","legend-item");d.merge(f.selectAll("div.legend-item")).classed("active",function(A){return A.status===Ci.items.status.ACTIVE});const h=Te(this.getOptions(),"legend","clickable");f.classed("clickable",h&&s.length>1);const g=Ci.checkbox.radius,_=d.append("div").classed("checkbox",!0),v=_.merge(c.select("div.checkbox")).attr("role",fi.CHECKBOX).attr("tabindex",h?0:-1).attr("aria-labelledby",(A,C)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${C}-title`)).attr("aria-checked",({status:A})=>A===Ci.items.status.ACTIVE).attr("width",g*2).attr("height",g*2).attr("class",A=>this.model.getColorClassName({classNameTypes:[Ii.BACKGROUND],dataGroupName:A.name,originalClassName:"checkbox"})).style("background",A=>A.status===Ci.items.status.ACTIVE?this.model.getFillColor(A.name)||this.model.getStrokeColor(A.name):null).classed("active",function(A){return A.status===Ci.items.status.ACTIVE});_.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),d.append("p").merge(c.select("p"));const S=Te(n,"legend","additionalItems");if(S&&s.length){const A=this,C=f.selectAll("div.additional-item").data(S);C.exit().remove();const I=C.enter().append("div").merge(C).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(N,z)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${v.size()+z}-title`));I.selectAll("*").remove();let M,L=1;I.append("svg").classed("icon",!0).each(function(N){const z=ht(this);!M||M!=N.type?(M=N.type,L=1):L++,A.addAdditionalItem(z,N,L)}),I.append("p").merge(I.select("p")),this.truncateLegendText()}c.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),h&&d.size()>1&&this.addEventListeners()}sortDataGroups(e,n){if(e.sort((i,l)=>n.indexOf(i.name)-n.indexOf(l.name)),n.lengthu.cx).attr("cy",u=>u.cy).attr("r",u=>u.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:a)}else if(n.type===Ti.LINE){const s=Ci.line;e.select("line.line").empty()&&e.append("line").classed(`line-${i}`,!0).attr("role",fi.IMG).attr("aria-label","line").attr("x1",0).attr("y1",s.yPosition).attr("x2",l).attr("y2",s.yPosition).style("stroke",n.stroke?n.stroke:s.stroke).style("stroke-width",s.strokeWidth)}else if(n.type===Ti.AREA)e.select("rect.area").empty()&&e.append("rect").classed(`area-${i}`,!0).attr("role",fi.IMG).attr("aria-label","area").attr("width",l).attr("height",r).style("fill",i>3&&!n.fill?Ci.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Ti.SIZE){const{iconData:s,fill:o,stroke:a}=Ci.size;e.attr("fill","none").attr("role",fi.IMG).attr("aria-label","size").selectAll("rect").data(s).enter().append("rect").classed("size",!0).attr("width",u=>u.width).attr("height",u=>u.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:a).style("stroke-width",1)}else if(n.type===Ti.QUARTILE){const{iconData:s}=Ci.quartile;e.selectAll("rect").attr("role",fi.IMG).attr("aria-label","quartile").data(s).enter().append("rect").attr("class",(o,a)=>`quartile-${a===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===Ti.ZOOM){const{iconData:s,color:o}=Te(Ci,"zoom"),a=e.attr("role",fi.IMG).attr("aria-label","zoom").selectAll("g.icon").data(s).enter();a.append("g").attr("x",u=>u.x).attr("y",u=>u.y).attr("width",u=>u.width).attr("height",u=>u.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),a.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const e=this.getComponentContainer(),n=Te(this.getOptions(),"legend","truncation"),i=Te(n,"type"),l=Te(n,"threshold"),r=Te(n,"numCharacter"),s=e.selectAll("div.legend-item p");s.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),i!==rr.NONE?s.html(function(o){return o.name.length>l?Au(o.name,i,r):o.name}):s.html(o=>o.name)}addEventListeners(){const e=this,n=this.getComponentContainer(),i=this.getOptions(),l=Te(i,"legend"),r=Te(l,"truncation");n.selectAll("div.legend-item").on("mouseover",function(s){e.services.events.dispatchEvent(je.Legend.ITEM_HOVER,{hoveredElement:ht(this)});const o=ht(this);o.select("div.checkbox").classed("hovered",!0);const a=o.datum();a.name.length>r.threshold&&r.type!==rr.NONE&&e.services.events.dispatchEvent(je.Tooltip.SHOW,{event:s,hoveredElement:o,content:a.name})}).on("mousemove",function(s){ht(this).datum().name.length>r.threshold&&r.type!==rr.NONE&&e.services.events.dispatchEvent(je.Tooltip.MOVE,{event:s})}).on("click",function(){e.services.events.dispatchEvent(je.Legend.ITEM_CLICK,{clickedElement:ht(this)});const s=ht(this).datum();e.model.toggleDataLabel(s.name)}).on("mouseout",function(){const s=ht(this);s.select("div.checkbox").classed("hovered",!1),s.datum().name.length>r.threshold&&r.type!==rr.NONE&&e.services.events.dispatchEvent(je.Tooltip.HIDE),e.services.events.dispatchEvent(je.Legend.ITEM_MOUSEOUT,{hoveredElement:s})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(s){s.key&&s.key==="Tab"&&e.services.events.dispatchEvent(je.Legend.ITEM_HOVER,{hoveredElement:ht(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(s,o){s.key&&s.key===" "?(s.preventDefault(),e.model.toggleDataLabel(o.name)):s.key&&s.key==="Tab"&&e.services.events.dispatchEvent(je.Legend.ITEM_MOUSEOUT,{hoveredElement:ht(this)})}),n.selectAll("g.additional-item").on("mouseover",function(s){const o=ht(this),a=o.datum();a.name.length>r.threshold&&e.services.events.dispatchEvent(je.Tooltip.SHOW,{event:s,hoveredElement:o,content:a.name})})}}class wM extends Xn{constructor(e,n,i){super(e,n,i),this.type="chart-clip",this.renderType=wn.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(e=!0){this.createClipPath()}createClipPath(){const e=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const i=n.getMainXScale(),l=n.getMainYScale(),[r,s]=i.range(),[o,a]=l.range();if(!e)throw new Error("svg is undefined");this.chartClipPath=bt.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const u=bt.appendOrSelect(this.chartClipPath,`rect.${this.type}`);s-r>0&&u.attr("x",r).attr("y",a).attr("width",s-r).attr("height",o-a),this.chartClipPath.merge(u).lower()}}class ume extends wM{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const e=this.parent,{width:n,height:i}=bt.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=bt.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const l=bt.appendOrSelect(this.chartClipPath,`rect.${this.type}`);l.attr("x",0).attr("y",0).attr("width",n).attr("height",i),this.chartClipPath.merge(l).lower()}}var zo,Li;(function(t){t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom"})(Li||(Li={}));var l6=(zo={},zo[Li.LEFT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left-e.offsetWidth)}},zo[Li.RIGHT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left+n.width)}},zo[Li.TOP]=function(t,e,n){return{top:Math.round(t.top-e.offsetHeight),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},zo[Li.BOTTOM]=function(t,e,n){return{top:Math.round(t.top+n.height),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},zo),r6=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Fd=function(){function t(e){e===void 0&&(e={}),this.positions=l6,this.positions=Object.assign({},l6,e)}return t.prototype.getRelativeOffset=function(e){for(var n={left:e.offsetLeft,top:e.offsetTop};e.offsetParent&&getComputedStyle(e.offsetParent).position==="static";)n.left+=e.offsetLeft,n.top+=e.offsetTop,e=e.offsetParent;return n},t.prototype.getAbsoluteOffset=function(e){for(var n=e,i={top:0,left:0};n.offsetParent;){var l=getComputedStyle(n.offsetParent);l.position==="static"&&l.marginLeft&&l.marginTop&&(parseInt(l.marginTop,10)&&(i.top+=parseInt(l.marginTop,10)),parseInt(l.marginLeft,10)&&(i.left+=parseInt(l.marginLeft,10))),n=n.offsetParent}var r=e.getBoundingClientRect(),s=document.body.getBoundingClientRect();return{top:r.top-s.top+i.top,left:r.left-s.left+i.left}},t.prototype.findRelative=function(e,n,i){var l=this.getRelativeOffset(e),r=e.getBoundingClientRect();return this.calculatePosition(l,r,n,i)},t.prototype.findAbsolute=function(e,n,i){var l=this.getAbsoluteOffset(e),r=e.getBoundingClientRect();return this.calculatePosition(l,r,n,i)},t.prototype.findPosition=function(e,n,i,l){l===void 0&&(l=this.getAbsoluteOffset.bind(this));var r=l(e),s=e.getBoundingClientRect();return this.calculatePosition(r,s,n,i)},t.prototype.findPositionAt=function(e,n,i){return this.calculatePosition(e,{top:0,left:0,height:0,width:0},n,i)},t.prototype.getPlacementBox=function(e,n){var i=e.offsetHeight+n.top,l=e.offsetWidth+n.left;return{top:n.top,bottom:i,left:n.left,right:l}},t.prototype.addOffset=function(e,n,i){return n===void 0&&(n=0),i===void 0&&(i=0),Object.assign({},e,{top:e.top+n,left:e.left+i})},t.prototype.setElement=function(e,n){e.style.top=n.top+"px",e.style.left=n.left+"px"},t.prototype.findBestPlacement=function(e,n,i,l,r){var s=this;l===void 0&&(l=this.defaultContainerFunction.bind(this)),r===void 0&&(r=this.findPosition.bind(this));var o=i.map(function(a){var u=r(e,n,a),f=s.getPlacementBox(n,u),c=0,d=0,h=l();f.toph.height&&(c=f.bottom-h.height),f.lefth.width&&(d=f.right-h.width),c&&!d?d=1:d&&!c&&(c=1);var g=n.offsetHeight*n.offsetWidth,_=c*d,v=g-_,S=v/g;return{placement:a,weight:S}});return o.sort(function(a,u){return u.weight-a.weight}),o[0].placement},t.prototype.findBestPlacementAt=function(e,n,i,l){var r=this;l===void 0&&(l=this.defaultContainerFunction.bind(this));var s=function(o,a,u){return r.findPositionAt(e,a,u)};return this.findBestPlacement(null,n,i,l,s)},t.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:r6.innerHeight,width:r6.innerWidth}},t.prototype.calculatePosition=function(e,n,i,l){return this.positions[l]?this.positions[l](e,i,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},t}();new Fd;class yM extends Xn{constructor(e,n,i){super(e,n,i),this.type="tooltip",this.renderType=wn.HTML,this.isEventListenerAdded=!1,this.positionService=new Fd,this.handleShowTooltip=l=>{const r=l.detail.data||l.detail.items;let s;const o=this.formatItems(this.getItems(l));l.detail.content?s=`

        ${l.detail.content}

        `:s=this.getTooltipHTML(o);const a=bt.appendOrSelect(this.tooltip,"div.content-box");if(Te(this.getOptions(),"tooltip","customHTML"))if(l.detail.content){const u=`

        ${l.detail.content}

        `;a.html(u)}else a.html(this.model.getOptions().tooltip.customHTML(r,s));else a.html(s);a.selectAll(".datapoint-tooltip").each(function(u,f){const c=o[f];o[f]&&o[f].color&&ht(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",c.color)}),this.positionTooltip(l),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1)},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(je.Tooltip.MOVE,e=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(e)}),this.services.events.addEventListener(je.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(je.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(je.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(je.Tooltip.MOVE,null),this.services.events.removeEventListener(je.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(je.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(je.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(e){return e.detail.items?e.detail.items:[]}formatItems(e){const n=this.getOptions(),i=Te(n,"tooltip","truncation","type"),l=Te(n,"tooltip","truncation","threshold"),r=Te(n,"tooltip","truncation","numCharacter");return i!==rr.NONE?e.map(s=>{const o=s.labelIcon?12:0;return s.value=s.value?this.valueFormatter(s.value,s.label):s.value,s.label&&s.label.length+o>l&&(s.label=Au(s.label,i,r)),s.value&&s.value.length>l&&(s.value=Au(s.value,i,r)),s}):e}getTooltipHTML(e){return'
          '+e.map(n=>`
        • + `}render(e=!1){const n=this.model.getOptions();if(!this.isEventListenerAdded){const i=ht(this.services.domUtils.getHolder()),l=Te(n,"style","prefix");this.modal=bt.appendOrSelect(i,`div.${al}--${l}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0,this.modal.attr("data-modal",!0).attr("class","cds--modal cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby","modal-title").attr("aria-describedby","modal-description").attr("tabindex",-1)}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class kM extends Xn{constructor(){super(...arguments),this.type="title",this.renderType=wn.HTML}render(e=!1){const n=this.getComponentContainer(),i=Te(this.getOptions(),"title"),l=n.selectAll("p.title").data([i]);if(l.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(l).html(r=>r),l.node()&&l.node().offsetWidthn){e.append("tspan").text("...");const l=bt.appendOrSelect(e,"tspan").node().getComputedTextLength(),r=e.text(),s=this.getSubstringIndex(e.node(),0,r.length-1,n-l);e.html(r.substring(0,s-1)).append("tspan").text("...");const o=this;e.on("mouseover",function(a){o.services.events.dispatchEvent(je.Tooltip.SHOW,{event:a,hoveredElement:e,content:i})}).on("mousemove",function(a){o.services.events.dispatchEvent(je.Tooltip.MOVE,{event:a})}).on("mouseout",function(){o.services.events.dispatchEvent(je.Tooltip.HIDE)})}}getMaxTitleWidth(){return bt.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(e,n,i,l){const r=Math.floor((i+n)/2);return e.getSubStringLength(0,r)>l?this.getSubstringIndex(e,n,r,l):e.getSubStringLength(0,r)l?r:this.getSubstringIndex(e,r,i,l):r}}class wM extends Xn{constructor(){super(...arguments),this.type="legend",this.renderType=wn.HTML}render(e=!1){const n=this.getOptions(),i=Te(n,"legend"),l=Te(i,"alignment"),r=Te(n,"legend","orientation");let s=this.model.getDataGroups();const{DISABLED:o}=Ci.items.status,a=s.some(A=>A.status===o),u=Te(i,"order"),f=this.getComponentContainer().classed("center-aligned",l===jl.CENTER).classed("right-aligned",l===jl.RIGHT).classed(r,!0).classed("has-deactivated-items",a).attr("role",fi.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");u&&(s=this.sortDataGroups(s,u));const c=f.selectAll("div.legend-item").data(s,A=>A.name),d=c.enter().append("div").attr("class","legend-item");d.merge(f.selectAll("div.legend-item")).classed("active",function(A){return A.status===Ci.items.status.ACTIVE});const h=Te(this.getOptions(),"legend","clickable");f.classed("clickable",h&&s.length>1);const g=Ci.checkbox.radius,_=d.append("div").classed("checkbox",!0),v=_.merge(c.select("div.checkbox")).attr("role",fi.CHECKBOX).attr("tabindex",h?0:-1).attr("aria-labelledby",(A,C)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${C}-title`)).attr("aria-checked",({status:A})=>A===Ci.items.status.ACTIVE).attr("width",g*2).attr("height",g*2).attr("class",A=>this.model.getColorClassName({classNameTypes:[Ii.BACKGROUND],dataGroupName:A.name,originalClassName:"checkbox"})).style("background",A=>A.status===Ci.items.status.ACTIVE?this.model.getFillColor(A.name)||this.model.getStrokeColor(A.name):null).classed("active",function(A){return A.status===Ci.items.status.ACTIVE});_.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),d.append("p").merge(c.select("p"));const S=Te(n,"legend","additionalItems");if(S&&s.length){const A=this,C=f.selectAll("div.additional-item").data(S);C.exit().remove();const I=C.enter().append("div").merge(C).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(N,z)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${v.size()+z}-title`));I.selectAll("*").remove();let M,L=1;I.append("svg").classed("icon",!0).each(function(N){const z=ht(this);!M||M!=N.type?(M=N.type,L=1):L++,A.addAdditionalItem(z,N,L)}),I.append("p").merge(I.select("p")),this.truncateLegendText()}c.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),h&&d.size()>1&&this.addEventListeners()}sortDataGroups(e,n){if(e.sort((i,l)=>n.indexOf(i.name)-n.indexOf(l.name)),n.lengthu.cx).attr("cy",u=>u.cy).attr("r",u=>u.r).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:a)}else if(n.type===Ti.LINE){const s=Ci.line;e.select("line.line").empty()&&e.append("line").classed(`line-${i}`,!0).attr("role",fi.IMG).attr("aria-label","line").attr("x1",0).attr("y1",s.yPosition).attr("x2",l).attr("y2",s.yPosition).style("stroke",n.stroke?n.stroke:s.stroke).style("stroke-width",s.strokeWidth)}else if(n.type===Ti.AREA)e.select("rect.area").empty()&&e.append("rect").classed(`area-${i}`,!0).attr("role",fi.IMG).attr("aria-label","area").attr("width",l).attr("height",r).style("fill",i>3&&!n.fill?Ci.area.fill:n.fill).style("stroke",n.stroke);else if(n.type===Ti.SIZE){const{iconData:s,fill:o,stroke:a}=Ci.size;e.attr("fill","none").attr("role",fi.IMG).attr("aria-label","size").selectAll("rect").data(s).enter().append("rect").classed("size",!0).attr("width",u=>u.width).attr("height",u=>u.height).attr("y",()=>0).style("fill",n.fill?n.fill:o).style("stroke",n.stroke?n.stroke:a).style("stroke-width",1)}else if(n.type===Ti.QUARTILE){const{iconData:s}=Ci.quartile;e.selectAll("rect").attr("role",fi.IMG).attr("aria-label","quartile").data(s).enter().append("rect").attr("class",(o,a)=>`quartile-${a===0?"wrapper":"line"}`).attr("x",o=>o.x).attr("y",o=>o.y).attr("width",o=>o.width).attr("height",o=>o.height)}else if(n.type===Ti.ZOOM){const{iconData:s,color:o}=Te(Ci,"zoom"),a=e.attr("role",fi.IMG).attr("aria-label","zoom").selectAll("g.icon").data(s).enter();a.append("g").attr("x",u=>u.x).attr("y",u=>u.y).attr("width",u=>u.width).attr("height",u=>u.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>n.color?n.color:o),a.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>n.color?n.color:o)}}truncateLegendText(){const e=this.getComponentContainer(),n=Te(this.getOptions(),"legend","truncation"),i=Te(n,"type"),l=Te(n,"threshold"),r=Te(n,"numCharacter"),s=e.selectAll("div.legend-item p");s.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),i!==rr.NONE?s.html(function(o){return o.name.length>l?Au(o.name,i,r):o.name}):s.html(o=>o.name)}addEventListeners(){const e=this,n=this.getComponentContainer(),i=this.getOptions(),l=Te(i,"legend"),r=Te(l,"truncation");n.selectAll("div.legend-item").on("mouseover",function(s){e.services.events.dispatchEvent(je.Legend.ITEM_HOVER,{hoveredElement:ht(this)});const o=ht(this);o.select("div.checkbox").classed("hovered",!0);const a=o.datum();a.name.length>r.threshold&&r.type!==rr.NONE&&e.services.events.dispatchEvent(je.Tooltip.SHOW,{event:s,hoveredElement:o,content:a.name})}).on("mousemove",function(s){ht(this).datum().name.length>r.threshold&&r.type!==rr.NONE&&e.services.events.dispatchEvent(je.Tooltip.MOVE,{event:s})}).on("click",function(){e.services.events.dispatchEvent(je.Legend.ITEM_CLICK,{clickedElement:ht(this)});const s=ht(this).datum();e.model.toggleDataLabel(s.name)}).on("mouseout",function(){const s=ht(this);s.select("div.checkbox").classed("hovered",!1),s.datum().name.length>r.threshold&&r.type!==rr.NONE&&e.services.events.dispatchEvent(je.Tooltip.HIDE),e.services.events.dispatchEvent(je.Legend.ITEM_MOUSEOUT,{hoveredElement:s})}),n.selectAll("div.legend-item div.checkbox").on("keyup",function(s){s.key&&s.key==="Tab"&&e.services.events.dispatchEvent(je.Legend.ITEM_HOVER,{hoveredElement:ht(this)})}),n.selectAll("div.legend-item div.checkbox").on("keydown",function(s,o){s.key&&s.key===" "?(s.preventDefault(),e.model.toggleDataLabel(o.name)):s.key&&s.key==="Tab"&&e.services.events.dispatchEvent(je.Legend.ITEM_MOUSEOUT,{hoveredElement:ht(this)})}),n.selectAll("g.additional-item").on("mouseover",function(s){const o=ht(this),a=o.datum();a.name.length>r.threshold&&e.services.events.dispatchEvent(je.Tooltip.SHOW,{event:s,hoveredElement:o,content:a.name})})}}class yM extends Xn{constructor(e,n,i){super(e,n,i),this.type="chart-clip",this.renderType=wn.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(e=!0){this.createClipPath()}createClipPath(){const e=this.parent,{cartesianScales:n}=this.services;if(!n)throw new Error("Service cartesianScales was undefined");const i=n.getMainXScale(),l=n.getMainYScale(),[r,s]=i.range(),[o,a]=l.range();if(!e)throw new Error("svg is undefined");this.chartClipPath=bt.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const u=bt.appendOrSelect(this.chartClipPath,`rect.${this.type}`);s-r>0&&u.attr("x",r).attr("y",a).attr("width",s-r).attr("height",o-a),this.chartClipPath.merge(u).lower()}}class ume extends yM{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const e=this.parent,{width:n,height:i}=bt.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=bt.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const l=bt.appendOrSelect(this.chartClipPath,`rect.${this.type}`);l.attr("x",0).attr("y",0).attr("width",n).attr("height",i),this.chartClipPath.merge(l).lower()}}var zo,Li;(function(t){t.LEFT="left",t.RIGHT="right",t.TOP="top",t.BOTTOM="bottom"})(Li||(Li={}));var l6=(zo={},zo[Li.LEFT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left-e.offsetWidth)}},zo[Li.RIGHT]=function(t,e,n){return{top:t.top-Math.round(e.offsetHeight/2)+Math.round(n.height/2),left:Math.round(t.left+n.width)}},zo[Li.TOP]=function(t,e,n){return{top:Math.round(t.top-e.offsetHeight),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},zo[Li.BOTTOM]=function(t,e,n){return{top:Math.round(t.top+n.height),left:t.left-Math.round(e.offsetWidth/2)+Math.round(n.width/2)}},zo),r6=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},Fd=function(){function t(e){e===void 0&&(e={}),this.positions=l6,this.positions=Object.assign({},l6,e)}return t.prototype.getRelativeOffset=function(e){for(var n={left:e.offsetLeft,top:e.offsetTop};e.offsetParent&&getComputedStyle(e.offsetParent).position==="static";)n.left+=e.offsetLeft,n.top+=e.offsetTop,e=e.offsetParent;return n},t.prototype.getAbsoluteOffset=function(e){for(var n=e,i={top:0,left:0};n.offsetParent;){var l=getComputedStyle(n.offsetParent);l.position==="static"&&l.marginLeft&&l.marginTop&&(parseInt(l.marginTop,10)&&(i.top+=parseInt(l.marginTop,10)),parseInt(l.marginLeft,10)&&(i.left+=parseInt(l.marginLeft,10))),n=n.offsetParent}var r=e.getBoundingClientRect(),s=document.body.getBoundingClientRect();return{top:r.top-s.top+i.top,left:r.left-s.left+i.left}},t.prototype.findRelative=function(e,n,i){var l=this.getRelativeOffset(e),r=e.getBoundingClientRect();return this.calculatePosition(l,r,n,i)},t.prototype.findAbsolute=function(e,n,i){var l=this.getAbsoluteOffset(e),r=e.getBoundingClientRect();return this.calculatePosition(l,r,n,i)},t.prototype.findPosition=function(e,n,i,l){l===void 0&&(l=this.getAbsoluteOffset.bind(this));var r=l(e),s=e.getBoundingClientRect();return this.calculatePosition(r,s,n,i)},t.prototype.findPositionAt=function(e,n,i){return this.calculatePosition(e,{top:0,left:0,height:0,width:0},n,i)},t.prototype.getPlacementBox=function(e,n){var i=e.offsetHeight+n.top,l=e.offsetWidth+n.left;return{top:n.top,bottom:i,left:n.left,right:l}},t.prototype.addOffset=function(e,n,i){return n===void 0&&(n=0),i===void 0&&(i=0),Object.assign({},e,{top:e.top+n,left:e.left+i})},t.prototype.setElement=function(e,n){e.style.top=n.top+"px",e.style.left=n.left+"px"},t.prototype.findBestPlacement=function(e,n,i,l,r){var s=this;l===void 0&&(l=this.defaultContainerFunction.bind(this)),r===void 0&&(r=this.findPosition.bind(this));var o=i.map(function(a){var u=r(e,n,a),f=s.getPlacementBox(n,u),c=0,d=0,h=l();f.toph.height&&(c=f.bottom-h.height),f.lefth.width&&(d=f.right-h.width),c&&!d?d=1:d&&!c&&(c=1);var g=n.offsetHeight*n.offsetWidth,_=c*d,v=g-_,S=v/g;return{placement:a,weight:S}});return o.sort(function(a,u){return u.weight-a.weight}),o[0].placement},t.prototype.findBestPlacementAt=function(e,n,i,l){var r=this;l===void 0&&(l=this.defaultContainerFunction.bind(this));var s=function(o,a,u){return r.findPositionAt(e,a,u)};return this.findBestPlacement(null,n,i,l,s)},t.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:r6.innerHeight,width:r6.innerWidth}},t.prototype.calculatePosition=function(e,n,i,l){return this.positions[l]?this.positions[l](e,i,n):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},t}();new Fd;class TM extends Xn{constructor(e,n,i){super(e,n,i),this.type="tooltip",this.renderType=wn.HTML,this.isEventListenerAdded=!1,this.positionService=new Fd,this.handleShowTooltip=l=>{const r=l.detail.data||l.detail.items;let s;const o=this.formatItems(this.getItems(l));l.detail.content?s=`

          ${l.detail.content}

          `:s=this.getTooltipHTML(o);const a=bt.appendOrSelect(this.tooltip,"div.content-box");if(Te(this.getOptions(),"tooltip","customHTML"))if(l.detail.content){const u=`

          ${l.detail.content}

          `;a.html(u)}else a.html(this.model.getOptions().tooltip.customHTML(r,s));else a.html(s);a.selectAll(".datapoint-tooltip").each(function(u,f){const c=o[f];o[f]&&o[f].color&&ht(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",c.color)}),this.positionTooltip(l),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1)},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(je.Tooltip.MOVE,e=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(e)}),this.services.events.addEventListener(je.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(je.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(je.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(je.Tooltip.MOVE,null),this.services.events.removeEventListener(je.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(je.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(je.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(e){return e.detail.items?e.detail.items:[]}formatItems(e){const n=this.getOptions(),i=Te(n,"tooltip","truncation","type"),l=Te(n,"tooltip","truncation","threshold"),r=Te(n,"tooltip","truncation","numCharacter");return i!==rr.NONE?e.map(s=>{const o=s.labelIcon?12:0;return s.value=s.value?this.valueFormatter(s.value,s.label):s.value,s.label&&s.label.length+o>l&&(s.label=Au(s.label,i,r)),s.value&&s.value.length>l&&(s.value=Au(s.value,i,r)),s}):e}getTooltipHTML(e){return'
            '+e.map(n=>`
          • ${n.class||n.color?`
            `:""}
            @@ -171,19 +171,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
            ${n.value===void 0||n.value===null?"":`

            ${n.value}

            `}
            -
          • `).join("")+"
          "}valueFormatter(e,n){const i=this.getOptions(),l=Te(i,"tooltip","valueFormatter");if(l)return l(e,n);if(typeof e.getTime=="function")return aa(e,"MMM d, yyyy");try{if(typeof e=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(e))return aa(Date.parse(e),"MMM d, yyyy")}catch{}return e.toLocaleString()}render(e=!1){const n=this.getOptions(),i=Te(n,"tooltip","enabled");if(i){const l=ht(this.services.domUtils.getHolder()),r=Te(n,"style","prefix");this.tooltip=bt.appendOrSelect(l,`div.${al}--${r}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!i&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(e){const n=this.services.domUtils.getHolder(),i=this.tooltip.node(),l=this.getOptions(),r=Te(l,"zoomBar","top","enabled");let s=Te(e,"detail","mousePosition");if(!s)s=eo(Te(e,"detail","event"),n);else{const d=Te(l,"zoomBar","top","type"),h=Sl.height[d];r&&(s[1]+=h+Sl.spacerHeight)}const o=n.offsetWidth,a=n.offsetHeight;let u;s[0]/o>.9?u=Li.LEFT:s[0]/o<.1?u=Li.RIGHT:u=this.positionService.findBestPlacementAt({left:s[0],top:s[1]},i,[Li.RIGHT,Li.LEFT,Li.TOP,Li.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:a}));let{horizontalOffset:f}=Zfe;u===Li.LEFT&&(f*=-1);const c=this.positionService.findPositionAt({left:s[0]+f,top:s[1]},i,u);this.positionService.setElement(i,c)}}const TM=class hc extends Xn{constructor(){super(...arguments),this.type="grid-brush",this.renderType=wn.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(e=!0){const n=this.parent,i=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const l=bt.appendOrSelect(n,"svg.chart-grid-backdrop"),r=bt.appendOrSelect(l,`g.${this.type}`),s=bt.appendOrSelect(r,this.selectionSelector),{width:o,height:a}=bt.getSVGElementSize(l,{useAttrs:!0}),{cartesianScales:u}=this.services,f=u.getMainXScaleType(),c=u.getMainXScale(),[d]=c.range();i.attr("transform",`translate(${d},0)`);const h=bt.appendOrSelect(i,this.frontSelectionSelector);if(c&&f===Nt.TIME){let g=this.model.get("zoomDomain");g===void 0&&(g=this.services.zoom.getDefaultZoomBarDomain(),g&&this.model.set({zoomDomain:g},{animate:!1}));const _=M=>{const L=M[1]-M[0];let N="0,"+L.toString();const z=Math.floor(a/hc.DASH_LENGTH),W=z*hc.DASH_LENGTH;for(let D=0;D{const L=M.selection;L===null||L[0]===L[1]||(h.attr("x",parseFloat(s.attr("x"))+parseFloat(l.attr("x"))).attr("y",s.attr("y")).attr("width",s.attr("width")).attr("height",s.attr("height")).style("cursor","pointer").style("display",null),_(L))},S=(M,L)=>{const N=jS().range([0,o]).domain(g);let z=[N.invert(M),N.invert(L)];z[0].valueOf()===z[1].valueOf()&&(z=this.services.zoom.getDefaultZoomBarDomain()),(g[0].valueOf()!==z[0].valueOf()||g[1].valueOf()!==z[1].valueOf())&&this.services.zoom.handleDomainChange(z)};let A;const C=M=>{const L=M.selection;L!==null&&(S(L[0],L[1]),r.call(A.move,null),h.style("display","none"))};a!=0&&o!=0&&(A=LS().extent([[0,0],[o-1,a]]).on("start brush end",v).on("end.brushed",C),r.call(A));const I=this.services.zoom.getZoomRatio();l.on("click",function(M){if(M.shiftKey){const L=this.services.domUtils.getHolder(),N=eo(r.node(),L)[0];let z=N-o*I/2;z<0&&(z=0);let W=N+o*I/2;W>o&&(W=o),S(z,W)}})}}};TM.DASH_LENGTH=4;let fme=TM;class cme extends Xn{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=wn.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=LS(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(je.ZoomBar.UPDATE,this.render.bind(this));const e=Te(this.getOptions(),"zoomBar",it.TOP,"data");this.model.setZoomBarData(e)}render(e=!0){const n=this.getComponentContainer(),i=this.services.zoom.isZoomBarLoading(it.TOP),l=this.services.zoom.isZoomBarLocked(it.TOP),r=Te(this.getOptions(),"zoomBar",it.TOP,"type"),s=Te(this.getOptions(),"axes",it.BOTTOM,"highlights"),o=Sl.height[r],{width:a}=bt.getSVGElementSize(this.parent,{useAttrs:!0});if(a===0)return;let u=0;const f=this.model.get("axesMargins");f&&f.left&&(u=f.left);const c=bt.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(bt.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Sl.spacerHeight).attr("opacity",1).attr("fill","none"),r===br.GRAPH_VIEW?bt.appendOrSelect(c,"rect.zoom-bg").attr("x",u).attr("y",0).attr("width",a-u).attr("height","100%").classed("zoom-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):r===br.SLIDER_VIEW&&bt.appendOrSelect(c,"rect.zoom-slider-bg").attr("x",u).attr("y",o/2-1).attr("width",a-u).attr("height",2).classed("zoom-slider-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),i){this.renderSkeleton(c,u,a);return}const{cartesianScales:d}=this.services,h=d.getMainXScale(),g=d.getMainYScale(),_=d.getMainXScaleType();if(h&&_===Nt.TIME){let v=this.services.zoom.getZoomBarData();if(Bfe(v)||v.length===1)return;this.xScale=h.copy(),this.yScale=g.copy();const S=this.services.zoom.getDefaultZoomBarDomain(v);v=this.compensateDataForDefaultDomain(v,S);const A=this.model.get("initialZoomDomain"),C=Te(this.getOptions(),"zoomBar",it.TOP,"initialZoomDomain");C&&C[0]&&C[1]&&(C[0]=new Date(C[0]),C[1]=new Date(C[1])),C&&!(A&&A[0].valueOf()===C[0].valueOf()&&A[1].valueOf()===C[1].valueOf())?this.model.set({initialZoomDomain:en([],C),zoomDomain:C?en([],C):S},{skipUpdate:!0}):C===null&&A!==null&&this.model.set({initialZoomDomain:null,zoomDomain:en([],S)},{skipUpdate:!0}),this.xScale.range([u,a]).domain(S),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Yo(v,L=>L.value));const I=this.model.get("zoomDomain");if(r===br.GRAPH_VIEW&&(this.renderZoomBarArea(c,"path.zoom-graph-area-unselected",v,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(c,"path.zoom-graph-area",v,this.clipId),this.renderZoomBarBaseline(c,u,a),s)){const L=s.highlightStartMapsTo,N=s.highlightEndMapsTo,z=s.color,W=s.labelMapsTo;s.data.forEach((D,G)=>{bt.appendOrSelect(c,`rect.highlight-${G}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(D[L])).attr("width",this.xScale(D[N])-this.xScale(D[L])).style("fill",z&&z.scale[D[W]]?z.scale[D[W]]:null).style("fill-opacity",.1).style("stroke",z&&z.scale[D[W]]?z.scale[D[W]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(I,u,a);const M=bt.appendOrSelect(n,this.brushSelector).call(this.brush);if(I!==void 0)if(I[0].valueOf()===I[1].valueOf())M.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const L=I.map(N=>this.xScale(N));L[1]-L[0]!1),M.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(e,n,i){const l=o=>{const a=o.selection;a===null?this.handleBrushedEvent(o,e,this.xScale,this.xScale.range()):a[0]===a[1]||this.handleBrushedEvent(o,e,this.xScale,a)},r=Te(this.getOptions(),"zoomBar",it.TOP,"type"),s=Sl.height[r];this.brush.extent([[n,0],[i,s]]).on("start brush end",null).on("start brush end",l)}handleBrushedEvent(e,n,i,l){const r=[i.invert(l[0]),i.invert(l[1])];if(this.updateBrushHandle(this.getComponentContainer(),l),e.sourceEvent!=null&&(e.sourceEvent.type==="mousemove"||e.sourceEvent.type==="mouseup"||e.sourceEvent.type==="mousedown"||e.sourceEvent.type==="touchstart"||e.sourceEvent.type==="touchmove"||e.sourceEvent.type==="touchend")){(n===void 0||n[0]!==r[0]||n[1]!==r[1])&&this.services.zoom.handleDomainChange(r,{dispatchEvent:!1});let s;e.type==="start"?s=je.ZoomBar.SELECTION_START:e.type==="brush"?s=je.ZoomBar.SELECTION_IN_PROGRESS:e.type==="end"&&(s=je.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(je.ZoomDomain.CHANGE,{newDomain:r})),this.services.events.dispatchEvent(s,{selection:l,newDomain:r})}}updateBrushHandle(e,n){const i=this,l=Sl.handleWidth,r=Te(this.getOptions(),"zoomBar",it.TOP,"type"),s=Sl.height[r],o=-l/2,a=Sl.handleBarWidth,u=r===br.GRAPH_VIEW?Sl.handleBarHeight:6,f=-a/2,c=(s-u)/2;e.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(h){if(h.type==="w")return Math.max(n[0]+o,i.maxSelectionRange[0]);if(h.type==="e")return Math.min(n[1]+o,i.maxSelectionRange[1]-l)}).attr("y",0).attr("width",l).attr("height",s).attr("cursor","ew-resize").style("display",null);const d=e.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);d.enter().append("rect").attr("class",function(h){return"handle-bar handle-bar--"+h.type}),d.attr("x",function(h){if(h.type==="w")return Math.max(n[0]+f,i.maxSelectionRange[0]-o+f);if(h.type==="e")return Math.min(n[1]+f,i.maxSelectionRange[1]+o+f)}).attr("y",c).attr("width",a).attr("height",u).attr("cursor","ew-resize"),r===br.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(e,this.clipId,n[0],0,n[1]-n[0],s)}updateSliderSelectedArea(e){const n=Te(this.getOptions(),"zoomBar",it.TOP,"type"),i=Sl.height[n],l=this.getComponentContainer().select("svg.zoom-container");bt.appendOrSelect(l,"rect.zoom-slider-selected-area").attr("x",e[0]).attr("y",i/2-1).attr("width",e[1]-e[0]).attr("height",2)}renderZoomBarArea(e,n,i,l){const{cartesianScales:r}=this.services,s=r.getMainXAxisPosition(),o=r.getMainYAxisPosition(),a=r.getMainXScaleType(),u=r.getMainYScaleType(),f=(S,A,C)=>I=>r.getValueFromScale(S,A,C,I),c=f(this.xScale,a,s),d=f(this.yScale,u,o),h=Te(this.getOptions(),"zoomBar",it.TOP,"type"),g=Sl.height[h],_=O0().x(S=>c(S)).y0(g).y1(S=>g-d(S)),v=bt.appendOrSelect(e,n).datum(i).attr("d",_);l&&v.attr("clip-path",`url(#${l})`)}updateClipPath(e,n,i,l,r,s){const o=bt.appendOrSelect(e,"clipPath").attr("id",n);bt.appendOrSelect(o,"rect").attr("x",i).attr("y",l).attr("width",r).attr("height",s)}compensateDataForDefaultDomain(e,n){if(!e||e.length<2)return;const i=Xu(e),l=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])Number(i[i.length-1][l])){const s={};s[l]=n[1],s[r]=0,i.push(s)}return i}renderZoomBarBaseline(e,n,i,l=!1){const r=Te(this.model.getOptions(),"zoomBar",it.TOP,"type"),s=Sl.height[r],o=M0()([[n,s],[i,s]]);bt.appendOrSelect(e,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",l).style("stroke",l?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(e,n,i){this.renderZoomBarArea(e,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(e,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),bt.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),Te(this.getOptions(),"zoomBar",it.TOP,"type")===br.GRAPH_VIEW&&this.renderZoomBarBaseline(e,n,i,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(je.ZoomBar.UPDATE,this.render.bind(this))}}class dme extends Xn{constructor(e,n){super(e,n),this.type="threshold",this.renderType=wn.SVG,this.positionService=new Fd}render(e=!1){const n=Te(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(u=>{if(Object.values(it).includes(u)){const f=n[u];f.thresholds&&f.thresholds.length>0&&i.push({axisPosition:u,thresholds:f.thresholds,correspondingDatasets:f==null?void 0:f.correspondingDatasets,mapsTo:f==null?void 0:f.mapsTo})}});const l=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(i,u=>u.axisPosition);l.exit().attr("opacity",0).remove();const r=l.enter().append("g").merge(l);r.attr("class",u=>`axis-thresholds ${u.axisPosition}`);const s=r.selectAll("g.threshold-group").data(u=>u.thresholds.map(f=>(f.axisPosition=u.axisPosition,f.datum=this.constructDatumObj(u,f),f)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(s).attr("class","threshold-group");const a=this;r.each(function({axisPosition:u}){const f=a.services.cartesianScales.getScaleByPosition(u),c=a.services.cartesianScales.getScaleTypeByPosition(u);let d=null,h=null;u===it.LEFT||u===it.RIGHT?(h=f,d=a.services.cartesianScales.getMainXScale()):(d=f,h=a.services.cartesianScales.getMainYScale());const g=c===Nt.LABELS,[_,v]=d.range(),[S,A]=h.range(),{cartesianScales:C}=a.services,I=C.getOrientation(),M=D=>C.getDomainValue(D),L=D=>C.getRangeValue(D),[N,z]=Ko(M,L,I),W=ht(this);u===it.TOP||u===it.BOTTOM?(W.selectAll("line.threshold-line").transition().call(D=>a.services.transitions.setupTransition({transition:D,name:"threshold-line-update",animate:e})).attr("y1",A).attr("y2",S).attr("x1",({datum:D})=>N(D)+(g?f.step()/2:0)).attr("x2",({datum:D})=>N(D)+(g?f.step()/2:0)).style("stroke",({fillColor:D})=>D),W.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:D})=>-N(D)).attr("width",Math.abs(S-A)).classed("rotate",!0)):(W.selectAll("line.threshold-line").transition().call(D=>a.services.transitions.setupTransition({transition:D,name:"threshold-line-update",animate:e})).attr("x1",_).attr("x2",v).attr("y1",({datum:D})=>z(D)+(g?f.step()/2:0)).attr("y2",({datum:D})=>z(D)+(g?f.step()/2:0)).style("stroke",({fillColor:D})=>D),W.selectAll("rect.threshold-hoverable-area").attr("x",_).attr("y",({datum:D})=>z(D)).attr("width",Math.abs(v-_)).classed("rotate",!1))}),this.services.events.addEventListener(je.Threshold.SHOW,u=>{this.setThresholdLabelPosition(u.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(je.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(e){const{value:n,axisPosition:i}=e,l=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(i)===Nt.TIME){const r=[it.LEFT,it.RIGHT].includes(i),s=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),a=r?o:s,u=Te(l,"timeScale"),f=T1(a.ticks(),Te(u,"timeInterval"));return y1(n,0,a.ticks(),f,u)}return n.toLocaleString("en")}appendThresholdLabel(){const e=ht(this.services.domUtils.getHolder()),n=Te(this.getOptions(),"style","prefix");this.label=bt.appendOrSelect(e,`div.${al}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:e,datum:n}){const i=this.services.domUtils.getHolder(),l=eo(e,i),r=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(`${n.label||"Threshold"}: ${r}`).style("background-color",n.fillColor);const s=this.label.node(),o=this.positionService.findBestPlacementAt({left:l[0],top:l[1]},s,[Li.RIGHT,Li.LEFT,Li.TOP,Li.BOTTOM],()=>({top:void 0,left:void 0,width:i.offsetWidth,height:i.offsetHeight})),a=this.positionService.findPositionAt({left:l[0],top:l[1]},s,o);this.positionService.setElement(s,a)}constructDatumObj(e,n){const i={};return e.correspondingDatasets&&(i.group=Te(e,"correspondingDatasets",0)),i[e.mapsTo]=n.value,i}addEventListeners(){const e=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){ht(this.parentNode).select("line.threshold-line").classed("active",!0),e.services.events.dispatchEvent(je.Threshold.SHOW,{event:n,hoveredElement:ht(this),datum:ht(this).datum()})}).on("mouseout",function(n){ht(this.parentNode).select("line.threshold-line").classed("active",!1),e.services.events.dispatchEvent(je.Threshold.HIDE,{event:n,hoveredElement:ht(this),datum:ht(this).datum()})})}}class hme extends Xn{constructor(e,n){super(e,n),this.type="highlight",this.renderType=wn.SVG,this.positionService=new Fd,this.highlightStrokeWidth=1}render(e=!1){const n=Te(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(u=>{if(Object.values(it).includes(u)){const f=n[u];f.highlights&&f.highlights.data.length>0&&i.push({axisPosition:u,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const l=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(i,u=>u.axisPosition);l.exit().attr("opacity",0).remove();const r=l.enter().append("g").merge(l);r.attr("class",u=>`axis-highlight ${u.axisPosition}`);const s=r.selectAll("g.highlight-group").data(u=>u.highlight.map(f=>(f.axisPosition=u.axisPosition,f.highlightStartMapsTo=u.highlightStartMapsTo,f.labelMapsTo=u.labelMapsTo,f.color=u.color,f.highlightEndMapsTo=u.highlightEndMapsTo,f)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(s).attr("class","highlight-group");const a=this;r.each(function({axisPosition:u}){const f=a.services.cartesianScales.getMainXScale(),c=a.services.cartesianScales.getMainYScale(),[d,h]=f.range(),[g,_]=c.range(),{cartesianScales:v}=a.services,S=v.getOrientation(),A=N=>v.getDomainValue(N),C=N=>v.getRangeValue(N),[I,M]=Ko(A,C,S),L=ht(this);u===it.TOP||u===it.BOTTOM?L.selectAll("rect.highlight-bar").transition().call(N=>a.services.transitions.setupTransition({transition:N,name:"highlight-bar-update",animate:e})).attr("y",Math.max(_+a.highlightStrokeWidth,0)).attr("height",Math.max(g-2*a.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:N,...z})=>I(z[N])).attr("width",({highlightStartMapsTo:N,highlightEndMapsTo:z,...W})=>Math.max(I(W[z])-I(W[N]),0)).style("stroke",({color:N,labelMapsTo:z,...W})=>N&&N.scale[W[z]]?N.scale[W[z]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:N,labelMapsTo:z,...W})=>N&&N.scale[W[z]]?N.scale[W[z]]:null):L.selectAll("rect.highlight-bar").transition().call(N=>a.services.transitions.setupTransition({transition:N,name:"highlight-bar-update",animate:e})).attr("x",d).attr("width",Math.max(h-d,0)).attr("y",({highlightEndMapsTo:N,...z})=>M(z[N])).attr("height",({highlightStartMapsTo:N,highlightEndMapsTo:z,...W})=>Math.max(M(W[N])-M(W[z]),0)).style("stroke",({color:N,labelMapsTo:z,...W})=>N&&N.scale[W[z]]?N.scale[W[z]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:N,labelMapsTo:z,...W})=>N&&N.scale[W[z]]?N.scale[W[z]]:null)})}}class mme extends yM{getItems(e){if(e.detail.items)return e.detail.items;const{data:n}=e.detail;if(!n||!n.length||!n[0])return[];const i=this.getOptions(),{cartesianScales:l}=this.services,r=l.getDomainIdentifier(),s=l.isDualAxes(),{groupMapsTo:o}=i.data,a=l.getDomainLabel();let u=l.getRangeLabel();const f=n[0][r];let c;if(n.length===1){const d=n[0],h=l.getRangeIdentifier(d);if(s){const _=l.getRangeAxisPosition({datum:d,groups:[d[o]]});u=l.getScaleLabel(_)}const g=d[h];c=[{label:a,value:f},...Array.isArray(g)&&g.length===2?[{label:"Start",value:g[0]},{label:"End",value:g[1]}]:[{label:u,value:d[h]}]],e.detail.additionalItems&&e.detail.additionalItems.forEach(_=>c.push({label:_.label,value:_.value})),c.push({label:i.tooltip.groupLabel,value:d[o],color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[Ii.TOOLTIP],dataGroupName:d[o]})})}else if(n.length>1&&(c=[{label:a,value:f}],c=c.concat(n.map(d=>{const h=d[l.getRangeIdentifier(d)];return{label:d[o],value:Array.isArray(h)&&h.length===2?`${h[0]} - ${h[1]}`:h,color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[Ii.TOOLTIP],dataGroupName:d[o]})}}).sort((d,h)=>h.value-d.value)),!s&&Te(i,"tooltip","showTotal")===!0)){const d=l.getRangeIdentifier();c.push({label:U0(i,"tooltip.totalLabel")||"Total",value:n.reduce((h,g)=>h+g[d],0),bold:!0})}return c}}class gme extends Xn{constructor(){super(...arguments),this.type="grid",this.renderType=wn.SVG}render(e=!0){const n=Te(this.getOptions(),"grid","x","enabled"),i=Te(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,i),!(!n&&!i)&&(n&&(bt.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(e)),i&&(bt.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(e)))}drawXGrid(e){const n=this.parent,i=this.backdrop.attr("height"),l=this.services.cartesianScales.getMainXScale(),r=nS(l).tickSizeInner(-i).tickSizeOuter(0);if(Te(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),a=Te(this.getOptions(),"axes",o,"ticks","values");a&&r.tickValues(a)}else{const o=Te(this.getOptions(),"grid","x","numberOfTicks");r.ticks(o)}const s=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${i})`);e?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:e})).call(r):s.call(r),this.cleanGrid(s)}drawYGrid(e){const n=this.parent,i=this.backdrop.attr("width"),l=this.services.cartesianScales.getMainYScale(),r=iS(l).tickSizeInner(-i).tickSizeOuter(0);if(Te(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),a=Te(this.getOptions(),"axes",o,"ticks","values");a&&r.tickValues(a)}else{const o=Te(this.getOptions(),"grid","y","numberOfTicks");r.ticks(o)}const s=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);e?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:e})).call(r):s.call(r),this.cleanGrid(s)}getGridlineThreshold(e){const n=this.parent,i=n.selectAll(".x.grid .tick").nodes().sort((f,c)=>Number(Ur(f).tx)-Number(Ur(c).tx));let l=-1;if(!i.length)return;i.forEach(f=>{e[0]>=+Ur(f).tx&&l++});const r=l+1{const{hoveredElement:n}=e.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-area"})).attr("opacity",i=>i.name!==n.datum().name?Fr.opacity.unselected:Fr.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",Fr.opacity.selected)}}init(){const e=this.services.events;e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions();let l=[0,0];const{cartesianScales:r}=this.services,s=r.getOrientation(),o=O0().curve(this.services.curves.getD3Curve()).defined(M=>{const L=r.getRangeIdentifier();return M[L]!=null}),a=this.model.getGroupedData(this.configs.groups),u=Te(i,"bounds"),f=u&&a&&a.length===1;!f&&u&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${a.length}`);let c=0;const d=(M,L)=>{Te(i,"axes",M,"includeZero")===!1&&L[0]>0&&L[1]>0&&(c=L[0])},h=M=>f?r.getBoundedScaledValues(M)[0]:r.getRangeValue(c),g=M=>f?r.getBoundedScaledValues(M)[1]:r.getRangeValue(M);s===hl.VERTICAL?(l=r.getMainYScale().domain(),d(r.getMainYAxisPosition(),l),o.x(M=>r.getDomainValue(M)).y0(M=>h(M)).y1(M=>g(M))):(l=r.getMainXScale().domain(),d(r.getMainXAxisPosition(),l),o.x0(M=>h(M)).x1(M=>g(M)).y(M=>r.getDomainValue(M)));const _=Te(i,"color","gradient","enabled"),v=a&&a.length===1&&_;a.length>1&&_&&console.error("Gradients can only be enabled when having 1 single dataset");const S=n.selectAll("path.area").data(a,M=>M.name),A=ht(this.services.domUtils.getMainContainer());if(S.exit().attr("opacity",0).remove(),!a.length)return;if(v){const M=A.select(`path.${this.model.getColorClassName({classNameTypes:[Ii.STROKE],dataGroupName:a[0].name})}`).node();let L;if(M)L=getComputedStyle(M,null).getPropertyValue("stroke");else{const N=Te(this.model.getOptions(),"color","scale");if(N!==null){const z=Object.keys(N);L=N[z[0]]}}Cu.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${a[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:Cu.getStops(l,L)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const C=this,I=S.enter().append("path");v?I.merge(S).style("fill",M=>`url(#${this.services.domUtils.generateElementIDString(`${M.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",M=>this.model.getColorClassName({classNameTypes:[Ii.FILL],dataGroupName:M.name,originalClassName:"area"})).attr("d",M=>{const{data:L}=M;return o(L)}):(I.attr("opacity",0).merge(S).attr("class","area").attr("class",M=>this.model.getColorClassName({classNameTypes:[Ii.FILL,Ii.STROKE],dataGroupName:M.name,originalClassName:"area"})).style("fill",M=>C.model.getFillColor(M.name)).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"area-update-enter",animate:e})).attr("opacity",f?1:Fr.opacity.selected).attr("d",M=>{const{data:L}=M;return o(L)}),f&&I.attr("fill-opacity",Fr.opacity.selected).style("stroke",M=>C.model.getStrokeColor(M.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const e=this.services.events;e.removeEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class mc extends Xn{constructor(){super(...arguments),this.type="line",this.renderType=wn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-line"})).attr("opacity",i=>i.name!==n.datum().name?Om.opacity.unselected:Om.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-line"})).attr("opacity",Om.opacity.selected)}}init(){const{events:e}=this.services;e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:i,curves:l}=this.services,r=h=>i.getDomainValue(h),s=h=>i.getRangeValue(h),[o,a]=Ko(r,s,i.getOrientation()),u=this.getOptions(),f=M0().x(o).y(a).curve(l.getD3Curve()).defined(h=>{const g=i.getRangeIdentifier(h);return h[g]!=null});let c=[];if(this.configs.stacked){const h=Object.keys(u.axes).some(_=>u.axes[_].percentage),{groupMapsTo:g}=u.data;c=this.model.getStackedData({groups:this.configs.groups,percentage:h}).map(_=>{const v=this.services.cartesianScales.getDomainIdentifier(_),S=this.services.cartesianScales.getRangeIdentifier(_);return{name:Te(_,0,g),data:_.map(A=>({[v]:A.data.sharedStackKey,[g]:A[g],[S]:A[1]})),hidden:!Jde(_,A=>A[0]!==A[1])}})}else c=this.model.getGroupedData(this.configs.groups);const d=n.selectAll("path.line").data(c,h=>h.name);d.exit().attr("opacity",0).remove(),d.enter().append("path").classed("line",!0).attr("opacity",0).merge(d).data(c,h=>h.name).attr("class",h=>this.model.getColorClassName({classNameTypes:[Ii.STROKE],dataGroupName:h.name,originalClassName:"line"})).style("stroke",h=>this.model.getStrokeColor(h.name)).attr("role",fi.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",h=>{const{data:g}=h;return g.map(_=>{const v=this.services.cartesianScales.getRangeIdentifier(_);return _[v]}).join(",")}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"line-update-enter",animate:e})).attr("opacity",h=>h.hidden?0:1).attr("d",h=>{const{data:g}=h;return f(g)})}destroy(){const e=this.services.events;e.removeEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const s6=5;function _me(t,e){return t>e-s6&&t({domainValue:this.services.cartesianScales.getDomainValue(v),originalData:v})).filter(v=>_me(v.domainValue,f));if(this.pointsWithinLine&&g.length===this.pointsWithinLine.length&&g.map(v=>v.domainValue).join()===this.pointsWithinLine.map(v=>v.domainValue).join())return this.pointsWithinLine=g,this.services.events.dispatchEvent(je.Tooltip.MOVE,{mousePosition:[n,i]});this.pointsWithinLine=g;const _=this.pointsWithinLine.reduce((v,S)=>{if(v.length===0)return v.push(S),v;const A=v[0].domainValue,C=Math.abs(f-S.domainValue),I=Math.abs(f-A);return C>I||(C0){const v=_.map(I=>I.originalData).filter(I=>{const M=this.services.cartesianScales.getRangeIdentifier(I);return I[M]!=null}),S=_.map(I=>I.domainValue),A=h.filter(I=>{const M=this.services.cartesianScales.getDomainValue(I);return S.includes(M)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Kde(this.elementsToHighlight,A)&&this.hideRuler(),A.dispatch("mouseover"),this.elementsToHighlight=A,this.services.events.dispatchEvent(je.Tooltip.SHOW,{mousePosition:[n,i],hoveredElement:d,data:this.formatTooltipData(v)}),c.attr("opacity",1);const C=_[0];r==="horizontal"?d.attr("x1",u).attr("x2",a).attr("y1",C.domainValue).attr("y2",C.domainValue):d.attr("y1",u).attr("y2",a).attr("x1",C.domainValue).attr("x2",C.domainValue)}else this.hideRuler()}hideRuler(){const e=this.parent,n=bt.appendOrSelect(e,"g.ruler");e.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(je.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const e=this,n=this.services.domUtils.getHolder(),i=this.model.getDisplayData();let l=function(r){const s=eo(r,e.parent.node());e.showRuler(r,s)};if(i.length>100){const r=i.length%50*12.5;l=wce(function(s){const{mousePosition:o}=this;e.showRuler(s,o)},r,n)}this.backdrop.on("mousemove mouseover",l).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const e=this.parent;this.backdrop=bt.appendOrSelect(e,"svg.chart-grid-backdrop")}}class cu extends Xn{constructor(){super(...arguments),this.type="scatter",this.renderType=wn.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(e=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:e,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(e=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:e,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(l=>{var r;return(r=this.services.transitions)==null?void 0:r.setupTransition({transition:l,name:"legend-hover-scatter"})}).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(e=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:e,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:e}=this.services;if(!e)throw new Error("Services events are undefined.");e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(e.addEventListener(je.Chart.MOUSEOVER,this.handleChartHolderOnHover),e.addEventListener(je.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(e){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const i=n.getDomainIdentifier(e),l=this.model.get("zoomDomain");return l!==void 0?e.filter(r=>r[i].getTime()>=l[0].getTime()&&r[i].getTime()<=l[1].getTime()):e}getScatterData(){const e=this.getOptions(),{stacked:n}=this.configs;let i;if(n){const l=Object.keys(e.axes).some(r=>e.axes[r].percentage);i=this.model.getStackedData({groups:this.configs.groups,percentage:l})}else{const{cartesianScales:l}=this.services;if(!l)throw new Error("Services cartesianScales are undefined.");i=this.model.getDisplayData(this.configs.groups).filter(r=>{const s=l.getRangeIdentifier(r);return r[s]!==void 0&&r[s]!==null})}return this.filterBasedOnZoomDomain(i)}render(e){if(!(Te(this.getOptions(),"points","enabled")||Te(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:l}=i.data,{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales are undefined.");const s=r.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),u=>`${u[l]}-${u[s]}`);o.exit().attr("opacity",0).remove();const a=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(a,e),this.addEventListeners()}isDatapointThresholdAnomaly(e){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const l=i.getOrientation(),[r,s]=Ko(i.getHighestDomainThreshold(),i.getHighestRangeThreshold(),l),[o,a]=Ko(c=>i.getDomainValue(c),c=>i.getRangeValue(c),l),u=o(e),f=a(e);return s&&r?f<=s.scaleValue&&u>=r.scaleValue:s?f<=s.scaleValue:r?u>=r.scaleValue:!1}styleCircles(e,n){const i=this.getOptions(),{filled:l,fillOpacity:r}=i.points,{cartesianScales:s}=this.services;if(!s)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=i.data,a=h=>s.getDomainValue(h),u=h=>s.getRangeValue(h),[f,c]=Ko(a,u,s.getOrientation()),{fadeInOnChartHolderMouseover:d}=this.configs;e.raise().classed("dot",!0).attr("class",h=>{const g=s.getDomainIdentifier(h),_=this.model.getIsFilled(h[o],h[g],h,l)?[Ii.FILL,Ii.STROKE]:[Ii.STROKE];return this.model.getColorClassName({classNameTypes:_,dataGroupName:h[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",h=>this.isDatapointThresholdAnomaly(h)).classed("filled",h=>{const g=s.getDomainIdentifier(h);return this.model.getIsFilled(h[o],h[g],h,l)}).classed("unfilled",h=>{const g=s.getDomainIdentifier(h);return!this.model.getIsFilled(h[o],h[g],h,l)}).transition().call(h=>{var g;return(g=this.services.transitions)==null?void 0:g.setupTransition({transition:h,name:"scatter-update-enter",animate:n})}).attr("cx",f).attr("cy",c).attr("r",i.points.radius).style("fill",h=>{const g=s.getDomainIdentifier(h);if(this.model.getIsFilled(h[o],h[g],h,l))return this.model.getFillColor(h[o],h[g],h)}).style("stroke",h=>{const g=s.getDomainIdentifier(h);return this.model.getStrokeColor(h[o],h[g],h)}).attr("fill-opacity",l?r:1).attr("opacity",d?0:1).attr("role",fi.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",h=>{const g=s.getRangeIdentifier(h);return h[g]}),this.addEventListeners()}getTooltipAdditionalItems(e){return null}addEventListeners(){const e=this,{groupMapsTo:n}=e.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(i,l){var r,s;const o=ht(this);o.classed("hovered",!0).attr("class",a=>e.model.getColorClassName({classNameTypes:[Ii.FILL],dataGroupName:a[n],originalClassName:o.attr("class")})).style("fill",a=>{var u;const f=(u=e.services.cartesianScales)==null?void 0:u.getDomainIdentifier(a);return e.model.getFillColor(a[n],a[f],a)}).classed("unfilled",!1),(r=e.services.events)==null||r.dispatchEvent(je.Tooltip.SHOW,{event:i,hoveredElement:o,data:[l],additionalItems:e.getTooltipAdditionalItems(l)}),(s=e.services.events)==null||s.dispatchEvent(je.Scatter.SCATTER_MOUSEOVER,{event:i,element:o,datum:l})}).on("mousemove",function(i,l){var r,s;const o=ht(this);(r=e.services.events)==null||r.dispatchEvent(je.Scatter.SCATTER_MOUSEMOVE,{event:i,element:o,datum:l}),(s=e.services.events)==null||s.dispatchEvent(je.Tooltip.MOVE,{event:i})}).on("click",function(i,l){var r;(r=e.services.events)==null||r.dispatchEvent(je.Scatter.SCATTER_CLICK,{event:i,element:ht(this),datum:l})}).on("mouseout",function(i,l){var r,s,o;const a=ht(this);if(a.classed("hovered",!1),!e.configs.filled){const{filled:u}=e.getOptions().points,f=(r=e.services.cartesianScales)==null?void 0:r.getDomainIdentifier(l),c=e.model.getIsFilled(l[n],l[f],l,u);a.classed("unfilled",!c).style("fill",d=>c||u?e.model.getFillColor(d[n],d[f],d):null)}(s=e.services.events)==null||s.dispatchEvent(je.Scatter.SCATTER_MOUSEOUT,{event:i,element:a,datum:l}),(o=e.services.events)==null||o.dispatchEvent(je.Tooltip.HIDE,{hoveredElement:a})})}destroy(){var e;(e=this.parent)==null||e.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(je.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(je.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class MM extends Xn{constructor(e,n,i){super(e,n,i),this.type="axes",this.renderType=wn.SVG,this.truncation={[it.LEFT]:!1,[it.RIGHT]:!1,[it.TOP]:!1,[it.BOTTOM]:!1},i&&(this.configs=i),this.margins=this.configs.margins}render(e=!0){const{position:n}=this.configs,i=this.getOptions(),l=Te(i,"axes",n,"visible"),r=this.getComponentContainer(),{width:s,height:o}=bt.getSVGElementSize(r,{useAttrs:!0}),a=bt.appendOrSelect(r,`g.axis.${n}`);let u,f;if(n===it.BOTTOM||n===it.TOP?(u=this.configs.axes[it.LEFT]?this.margins.left:0,f=this.configs.axes[it.RIGHT]?s-this.margins.right:s):(u=o-this.margins.bottom,f=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const c=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===Nt.LABELS||this.scaleType===Nt.LABELS_RATIO?c.rangeRound([u,f]):c.range([u,f]);let d;switch(n){case it.LEFT:d=iS;break;case it.BOTTOM:d=nS;break;case it.RIGHT:d=xJ;break;case it.TOP:d=QJ;break}a.attr("aria-label",`${n} axis`);const h=!a.select("g.ticks").empty();let g=bt.appendOrSelect(a,"g.ticks");h||(g.attr("role",`${fi.GRAPHICS_OBJECT} ${fi.GROUP}`),g.attr("aria-label",`${n} ticks`));const _=bt.appendOrSelect(a,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),v=Te(i,"axes",n),S=this.scaleType===Nt.TIME||v.scaleType===Nt.TIME,A=n===it.LEFT||n===it.RIGHT,C=this.model.get("zoomDomain");if(C&&S&&!A&&c.domain(C),!l){g.attr("aria-hidden",!0);return}const I=Te(v,"scaleType"),M=Te(i,"data","loading"),L=Te(v,"ticks","number"),N=Te(v,"ticks","values"),z=Te(v,"truncation","type"),W=Te(v,"truncation","threshold"),D=Te(v,"truncation","numCharacter"),G=L!==null,$=Te(i,"timeScale"),j=bt.appendOrSelect(_,"g.tick"),Q=bt.appendOrSelect(j,"text").text("0"),le=bt.getSVGElementSize(Q.node(),{useBBox:!0}).height;j.remove();const oe=this.scaleType||v.scaleType||Nt.LINEAR,X=d(c).tickSizeOuter(0);if(c.ticks){let pe;if(G?pe=L:(pe=ks.ticks.number,A&&(pe=this.getNumberOfFittingTicks(o,le,ks.ticks.verticalSpaceRatio))),c.ticks().length===1&&c.ticks()[0]===0&&(pe=0),X.ticks(pe),S)if(!c.ticks(pe).length)X.tickValues([]);else{const Fe=Te(i,"timeScale","addSpaceOnEdges"),Ve=Te(i,"axes",n,"domain"),Ee=c.copy();Fe&&!Ve&&Ee.nice(pe);const We=Ee.ticks(pe);Fe&&We.length>2&&!Ve&&(We.splice(We.length-1,1),We.splice(0,1)),X.tickValues(We)}}let de;const re=Te(v,"ticks","formatter");if(S){const pe=T1(X.tickValues(),Te(i,"timeScale","timeInterval"));re===null?de=(Fe,Ve)=>y1(Fe,Ve,X.tickValues(),pe,$):de=(Fe,Ve)=>{const Ee=y1(Fe,Ve,X.tickValues(),pe,$);return re(Fe,Ve,Ee)}}else re===null?oe===Nt.LINEAR&&(de=pe=>pe.toLocaleString()):de=re;X.tickFormat(de);const[x,me]=this.services.cartesianScales.getScaleByPosition(n).domain();let ee;if(N){if(S)N.forEach((pe,Fe)=>{pe.getTime===void 0&&(N[Fe]=new Date(pe))}),ee=N.filter(pe=>{const Fe=pe.getTime();return Fe>=new Date(x).getTime()&&Fe<=new Date(me).getTime()});else if(I===Nt.LABELS){const pe=this.services.cartesianScales.getScaleByPosition(n).domain();ee=N.filter(Fe=>pe.includes(Fe))}else ee=N.filter(pe=>pe>=x&&pe<=me);X.tickValues(ee)}switch(n){case it.LEFT:g.attr("transform",`translate(${this.margins.left}, 0)`);break;case it.BOTTOM:g.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case it.RIGHT:g.attr("transform",`translate(${s-this.margins.right}, 0)`);break;case it.TOP:g.attr("transform",`translate(0, ${this.margins.top})`);break}const ke=this.model.isDataEmpty();if(v.title){const pe=bt.appendOrSelect(a,"text.axis-title").html(ke||M?"":v.title),Fe=Te(v,"titleOrientation");let Ve;switch(n){case it.LEFT:Fe===Qm.RIGHT?pe.attr("transform","rotate(90)").attr("y",0).attr("x",c.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):pe.attr("transform","rotate(-90)").attr("y",0).attr("x",-(c.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case it.BOTTOM:pe.attr("transform",`translate(${this.margins.left/2+c.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case it.RIGHT:Fe===Qm.LEFT?pe.attr("transform","rotate(-90)").attr("y",s).attr("x",-(c.range()[0]/2)).style("text-anchor","middle"):pe.attr("transform","rotate(90)").attr("y",-s).attr("x",c.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case it.TOP:Ve=bt.getSVGElementSize(pe,{useBBox:!0}).height,pe.attr("transform",`translate(${this.margins.left/2+c.range()[1]/2}, ${Ve/2})`).style("text-anchor","middle");break}}if(S){const pe=T1(X.tickValues(),Te(i,"timeScale","timeInterval")),Fe=$.showDayName,Ve=g;e&&(g=g.transition().call(Ee=>this.services.transitions.setupTransition({transition:Ee,name:"axis-update",animate:e}))),g=g.call(X),Ve.selectAll(".tick").data(X.tickValues(),c).order().select("text").style("font-weight",(Ee,We)=>xE(Ee,We,X.tickValues(),pe,Fe)?"bold":"normal")}else!e||!h?g=g.call(X):g=g.transition().call(pe=>this.services.transitions.setupTransition({transition:pe,name:"axis-update",animate:e})).call(X);if(_.call(X),n===it.BOTTOM||n===it.TOP){let pe=!1;const Fe=Te(v,"ticks","rotation");if(Fe===nc.ALWAYS)pe=!0;else if(Fe===nc.NEVER)pe=!1;else if(!Fe||Fe===nc.AUTO)if(c.step)pe=_.selectAll("g.tick text").nodes().some(Ve=>bt.getSVGElementSize(Ve,{useBBox:!0}).width>=c.step());else{pe=!1;const Ve=_.append("text").text("A"),Ee=bt.getSVGElementSize(Ve.node(),{useBBox:!0}).width;let We;_.selectAll("g.tick").each(function(){const ge=ht(this),ve=parseFloat(Te(Ur(this),"tx"));ve!==null&&We+ge.text().length*Ee*.8>=ve&&(pe=!0),We=ve}),Ve.remove()}pe?(G||(X.ticks(this.getNumberOfFittingTicks(s,le,ks.ticks.horizontalSpaceRatio)),_.call(X),g.call(X)),a.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===it.TOP?"start":"end")):a.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(M?a.attr("opacity",0):a.attr("opacity",1),g.selectAll("g.tick").attr("aria-label",pe=>pe),_.selectAll("g.tick").attr("aria-label",pe=>pe),z!==rr.NONE&&I===Nt.LABELS&&!N){const pe=this.services.cartesianScales.getScaleDomain(n);if(pe.length>0){const Fe=r.select(`g.axis.${n} g.ticks g.tick`).html();a.selectAll("g.ticks g.tick").html(Fe);const Ve=this;a.selectAll("g.tick text").data(pe).text(function(Ee){return Ee.length>W?(Ve.truncation[n]=!0,Au(Ee,z,D)):Ee}),this.getInvisibleAxisRef().selectAll("g.tick text").data(pe).text(function(Ee){return Ee.length>W?Au(Ee,z,D):Ee}),a.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),a.selectAll("g.tick text").data(pe)}}this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:n}=this.configs,i=bt.appendOrSelect(e,`g.axis.${n}`),l=this.getOptions(),r=Te(l,"axes",n),s=Te(r,"scaleType"),o=Te(r,"truncation","threshold"),a=this;i.selectAll("g.tick text").on("mouseover",function(u,f){a.services.events.dispatchEvent(je.Axis.LABEL_MOUSEOVER,{event:u,element:ht(this),datum:f}),s===Nt.LABELS&&f.length>o&&a.services.events.dispatchEvent(je.Tooltip.SHOW,{event:u,hoveredElement:ht(this),content:f})}).on("mousemove",function(u,f){a.services.events.dispatchEvent(je.Axis.LABEL_MOUSEMOVE,{event:u,element:ht(this),datum:f}),s===Nt.LABELS&&f.length>o&&a.services.events.dispatchEvent(je.Tooltip.MOVE,{event:u})}).on("click",function(u,f){a.services.events.dispatchEvent(je.Axis.LABEL_CLICK,{event:u,element:ht(this),datum:f})}).on("mouseout",function(u,f){a.services.events.dispatchEvent(je.Axis.LABEL_MOUSEOUT,{event:u,element:ht(this),datum:f}),s===Nt.LABELS&&a.services.events.dispatchEvent(je.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} g.ticks.invisible`)}getTitleRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} text.axis-title`)}getNumberOfFittingTicks(e,n,i){const l=Math.floor(e/(n*i));return Xde(l,2,ks.ticks.number)}destroy(){const e=this.getComponentContainer(),{position:n}=this.configs;bt.appendOrSelect(e,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class pme extends MM{constructor(e,n,i){super(e,n,i)}render(e=!0){super.render(e),super.destroy();const n=this.configs.position,i=this.getComponentContainer(),l=bt.appendOrSelect(i,`g.axis.${n}`),r=this;l.selectAll("g.tick").each(function(s,o){const a=ht(this);a.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const u=a.select("text"),{width:f,height:c}=bt.getSVGElementSize(u,{useBBox:!0}),d=bt.appendOrSelect(a,"rect.axis-holder");let h=0,g=0;switch(n){case it.LEFT:h=-f+Number(u.attr("x")),g=-(c/2);break;case it.RIGHT:h=Math.abs(Number(u.attr("x"))),g=-(c/2);break;case it.TOP:h=-(f/2),g=-c+Number(u.attr("y"))/2,r.truncation[n]&&(h=0,d.attr("transform","rotate(-45)"));break;case it.BOTTOM:h=-(f/2),g=c/2-2,r.truncation[n]&&(h=-f,d.attr("transform","rotate(-45)"));break}d.attr("x",h-ks.hover.rectanglePadding).attr("y",g).attr("width",f+ks.hover.rectanglePadding*2).attr("height",c).lower()}),this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:n}=this.configs,i=bt.appendOrSelect(e,`g.axis.${n}`),l=this.getOptions(),r=Te(l,"axes",n),s=Te(r,"scaleType"),o=Te(r,"truncation","threshold"),a=this;i.selectAll("g.tick.tick-hover").on("mouseover",function(u){const f=ht(this).select("text"),c=f.datum();a.services.events.dispatchEvent(je.Axis.LABEL_MOUSEOVER,{event:u,element:f,datum:c}),s===Nt.LABELS&&c.length>o&&a.services.events.dispatchEvent(je.Tooltip.SHOW,{event:u,element:f,datum:c})}).on("mousemove",function(u){const f=ht(this).select("text"),c=f.datum();a.services.events.dispatchEvent(je.Axis.LABEL_MOUSEMOVE,{event:u,element:f,datum:c}),a.services.events.dispatchEvent(je.Tooltip.MOVE,{event:u})}).on("click",function(u){a.services.events.dispatchEvent(je.Axis.LABEL_CLICK,{event:u,element:ht(this).select("text"),datum:ht(this).select("text").datum()})}).on("mouseout",function(u){a.services.events.dispatchEvent(je.Axis.LABEL_MOUSEOUT,{event:u,element:ht(this).select("text"),datum:ht(this).select("text").datum()}),s===Nt.LABELS&&a.services.events.dispatchEvent(je.Tooltip.HIDE)}).on("focus",function(u){const f={clientX:0,clientY:0};if(u.target){u.target.focus();const c=u.target.getBoundingClientRect();f.clientX=c.x,f.clientY=c.y}a.services.events.dispatchEvent(je.Axis.LABEL_FOCUS,{event:{...u,...f},element:ht(this),datum:ht(this).select("text").datum()})}).on("blur",function(u){a.services.events.dispatchEvent(je.Axis.LABEL_BLUR,{event:u,element:ht(this),datum:ht(this).select("text").datum()})}).on("keydown",function(u){u.key&&u.key==="Escape"&&(a.services.events.dispatchEvent(je.Tooltip.HIDE),a.services.events.dispatchEvent(je.Axis.LABEL_BLUR,{event:u,element:ht(this),datum:ht(this).select("text").datum()})),n===it.LEFT||n===it.RIGHT?u.key&&u.key==="ArrowUp"?a.goNext(this,u):u.key&&u.key==="ArrowDown"&&a.goPrevious(this,u):u.key&&u.key==="ArrowLeft"?a.goPrevious(this,u):u.key&&u.key==="ArrowRight"&&a.goNext(this,u)})}goNext(e,n){e.nextElementSibling&&e.nextElementSibling.tagName!=="path"&&e.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(e,n){e.previousElementSibling&&e.previousElementSibling.tagName!=="path"&&e.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const e=this.getComponentContainer(),{position:n}=this.configs;bt.appendOrSelect(e,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class bme extends Xn{constructor(){super(...arguments),this.type="2D-axes",this.renderType=wn.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(e=!1){const n={},i=Object.keys(it),l=Te(this.getOptions(),"axes");i.forEach(s=>{l[it[s]]&&(n[it[s]]=!0)}),this.configs.axes=n,i.forEach(s=>{const o=it[s];if(this.configs.axes[o]&&!this.children[o]){const a={position:o,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===i0.DEFAULT?new MM(this.model,this.services,a):new pme(this.model,this.services,a);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[o]=u}}),Object.keys(this.children).forEach(s=>{this.children[s].render(e)});const r={};Object.keys(this.children).forEach(s=>{const o=this.children[s],a=o.configs.position,u=o.getInvisibleAxisRef(),{width:f,height:c}=bt.getSVGElementSize(u,{useBBox:!0});let d;switch(o.getTitleRef().empty()?d=0:(d=bt.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(a===it.LEFT||a===it.RIGHT)&&(d+=5)),a){case it.TOP:r.top=c+d;break;case it.BOTTOM:r.bottom=c+d;break;case it.LEFT:r.left=f+d;break;case it.RIGHT:r.right=f+d;break}}),this.services.events.dispatchEvent(je.Axis.RENDER_COMPLETE),Object.keys(r).some(s=>this.margins[s]!==r[s])&&(this.margins=Object.assign(this.margins,r),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(je.ZoomBar.UPDATE),Object.keys(this.children).forEach(s=>{const o=this.children[s];o.margins=this.margins}),this.render(!0))}}class vme extends Xn{constructor(){super(...arguments),this.type="skeleton"}render(e=!0){const n=Te(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(e){if(this.configs.skeleton===Uo.GRID)this.renderGridSkeleton(e);else if(this.configs.skeleton===Uo.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(e);else if(this.configs.skeleton===Uo.PIE)this.renderPieSkeleton(e);else if(this.configs.skeleton===Uo.DONUT)this.renderDonutSkeleton(e);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(e){this.setScales(),this.drawBackdrop(e),this.drawXGrid(e),this.drawYGrid(e),e&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(e){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(e),n===hl.VERTICAL&&this.drawYGrid(e),n===hl.HORIZONTAL&&this.drawXGrid(e),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(e){const n=this.computeOuterRadius(),i=0;this.drawRing(n,i,e),e&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(e){const n=this.computeOuterRadius(),i=this.computeInnerRadius();this.drawRing(n,i,e),e&&this.setShimmerEffect("shimmer-areas")}setScales(){const e=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Hc().domain([0,1]).range(e),this.yScale=Hc().domain([0,1]).range(n)}drawBackdrop(e){const n=this.parent,{width:i,height:l}=bt.getSVGElementSize(n,{useAttrs:!0});this.backdrop=bt.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",i).attr("height",l);const r=bt.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");r.attr("width","100%").attr("height","100%");const[s]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(r).attr("x",s).attr("y",o),r.classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(e){const n=+this.backdrop.attr("width"),i=Te(this.getOptions(),"grid","x","numberOfTicks"),l=this.xScale.ticks(i).map(o=>o*n),r=bt.appendOrSelect(this.backdrop,"g.x.skeleton"),s=r.selectAll("line").data(l);s.enter().append("line").merge(s).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),r.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(e){const n=+this.backdrop.attr("height"),i=this.backdrop.attr("width"),l=Te(this.getOptions(),"grid","y","numberOfTicks"),r=this.xScale.ticks(l).map(a=>a*n),s=bt.appendOrSelect(this.backdrop,"g.y.skeleton"),o=s.selectAll("line").data(r);o.enter().append("line").merge(o).attr("x1",0).attr("x2",i).attr("y1",a=>a).attr("y2",a=>a),s.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(e,n,i=!0){const l=this.parent,{width:r,height:s}=bt.getSVGElementSize(l,{useAttrs:!0}),o=bt.appendOrSelect(l,"svg.chart-skeleton").attr("width",r).attr("height",s),a=n===0?"pie":"donut",u=Te(this.getOptions(),a,"alignment");bt.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",r).attr("height",s).attr("fill","none");const f=Iie().innerRadius(n).outerRadius(e).startAngle(0).endAngle(Math.PI*2),c=e+Math.abs(Qa.radiusOffset),d=e+(Math.min(r,s)-e*2)/2,h=bt.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${c}, ${d})`).attr("d",f).classed("shimmer-effect-areas",i).classed("empty-state-areas",!i).style("fill",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let g=e+Qa.xOffset;u===jl.CENTER?g=r/2:u===jl.RIGHT&&(g=r-e-Qa.xOffset);const _=e+Qa.yOffset;h.attr("transform",`translate(${g}, ${_})`)}computeOuterRadius(){const{width:e,height:n}=bt.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(e,n)/2+Qa.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(e){const n="stop-bg-shimmer",i="stop-shimmer",l=this.parent.select(".chart-skeleton"),{width:r}=bt.getSVGElementSize(this.parent,{useAttrs:!0}),s=0,o=r,a=bt.appendOrSelect(l,"defs").lower(),u=bt.appendOrSelect(a,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(e)).attr("class",e).attr("x1",s-3*.2*r).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=` +
        • `).join("")+"
        "}valueFormatter(e,n){const i=this.getOptions(),l=Te(i,"tooltip","valueFormatter");if(l)return l(e,n);if(typeof e.getTime=="function")return aa(e,"MMM d, yyyy");try{if(typeof e=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(e))return aa(Date.parse(e),"MMM d, yyyy")}catch{}return e.toLocaleString()}render(e=!1){const n=this.getOptions(),i=Te(n,"tooltip","enabled");if(i){const l=ht(this.services.domUtils.getHolder()),r=Te(n,"style","prefix");this.tooltip=bt.appendOrSelect(l,`div.${al}--${r}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!i&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(e){const n=this.services.domUtils.getHolder(),i=this.tooltip.node(),l=this.getOptions(),r=Te(l,"zoomBar","top","enabled");let s=Te(e,"detail","mousePosition");if(!s)s=eo(Te(e,"detail","event"),n);else{const d=Te(l,"zoomBar","top","type"),h=Sl.height[d];r&&(s[1]+=h+Sl.spacerHeight)}const o=n.offsetWidth,a=n.offsetHeight;let u;s[0]/o>.9?u=Li.LEFT:s[0]/o<.1?u=Li.RIGHT:u=this.positionService.findBestPlacementAt({left:s[0],top:s[1]},i,[Li.RIGHT,Li.LEFT,Li.TOP,Li.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:a}));let{horizontalOffset:f}=Zfe;u===Li.LEFT&&(f*=-1);const c=this.positionService.findPositionAt({left:s[0]+f,top:s[1]},i,u);this.positionService.setElement(i,c)}}const SM=class hc extends Xn{constructor(){super(...arguments),this.type="grid-brush",this.renderType=wn.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(e=!0){const n=this.parent,i=this.getComponentContainer();if(!n)throw new Error("SVG was not defined");const l=bt.appendOrSelect(n,"svg.chart-grid-backdrop"),r=bt.appendOrSelect(l,`g.${this.type}`),s=bt.appendOrSelect(r,this.selectionSelector),{width:o,height:a}=bt.getSVGElementSize(l,{useAttrs:!0}),{cartesianScales:u}=this.services,f=u.getMainXScaleType(),c=u.getMainXScale(),[d]=c.range();i.attr("transform",`translate(${d},0)`);const h=bt.appendOrSelect(i,this.frontSelectionSelector);if(c&&f===Nt.TIME){let g=this.model.get("zoomDomain");g===void 0&&(g=this.services.zoom.getDefaultZoomBarDomain(),g&&this.model.set({zoomDomain:g},{animate:!1}));const _=M=>{const L=M[1]-M[0];let N="0,"+L.toString();const z=Math.floor(a/hc.DASH_LENGTH),W=z*hc.DASH_LENGTH;for(let D=0;D{const L=M.selection;L===null||L[0]===L[1]||(h.attr("x",parseFloat(s.attr("x"))+parseFloat(l.attr("x"))).attr("y",s.attr("y")).attr("width",s.attr("width")).attr("height",s.attr("height")).style("cursor","pointer").style("display",null),_(L))},S=(M,L)=>{const N=YS().range([0,o]).domain(g);let z=[N.invert(M),N.invert(L)];z[0].valueOf()===z[1].valueOf()&&(z=this.services.zoom.getDefaultZoomBarDomain()),(g[0].valueOf()!==z[0].valueOf()||g[1].valueOf()!==z[1].valueOf())&&this.services.zoom.handleDomainChange(z)};let A;const C=M=>{const L=M.selection;L!==null&&(S(L[0],L[1]),r.call(A.move,null),h.style("display","none"))};a!=0&&o!=0&&(A=IS().extent([[0,0],[o-1,a]]).on("start brush end",v).on("end.brushed",C),r.call(A));const I=this.services.zoom.getZoomRatio();l.on("click",function(M){if(M.shiftKey){const L=this.services.domUtils.getHolder(),N=eo(r.node(),L)[0];let z=N-o*I/2;z<0&&(z=0);let W=N+o*I/2;W>o&&(W=o),S(z,W)}})}}};SM.DASH_LENGTH=4;let fme=SM;class cme extends Xn{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=wn.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=IS(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(je.ZoomBar.UPDATE,this.render.bind(this));const e=Te(this.getOptions(),"zoomBar",it.TOP,"data");this.model.setZoomBarData(e)}render(e=!0){const n=this.getComponentContainer(),i=this.services.zoom.isZoomBarLoading(it.TOP),l=this.services.zoom.isZoomBarLocked(it.TOP),r=Te(this.getOptions(),"zoomBar",it.TOP,"type"),s=Te(this.getOptions(),"axes",it.BOTTOM,"highlights"),o=Sl.height[r],{width:a}=bt.getSVGElementSize(this.parent,{useAttrs:!0});if(a===0)return;let u=0;const f=this.model.get("axesMargins");f&&f.left&&(u=f.left);const c=bt.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(bt.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Sl.spacerHeight).attr("opacity",1).attr("fill","none"),r===br.GRAPH_VIEW?bt.appendOrSelect(c,"rect.zoom-bg").attr("x",u).attr("y",0).attr("width",a-u).attr("height","100%").classed("zoom-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):r===br.SLIDER_VIEW&&bt.appendOrSelect(c,"rect.zoom-slider-bg").attr("x",u).attr("y",o/2-1).attr("width",a-u).attr("height",2).classed("zoom-slider-bg-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),i){this.renderSkeleton(c,u,a);return}const{cartesianScales:d}=this.services,h=d.getMainXScale(),g=d.getMainYScale(),_=d.getMainXScaleType();if(h&&_===Nt.TIME){let v=this.services.zoom.getZoomBarData();if(Bfe(v)||v.length===1)return;this.xScale=h.copy(),this.yScale=g.copy();const S=this.services.zoom.getDefaultZoomBarDomain(v);v=this.compensateDataForDefaultDomain(v,S);const A=this.model.get("initialZoomDomain"),C=Te(this.getOptions(),"zoomBar",it.TOP,"initialZoomDomain");C&&C[0]&&C[1]&&(C[0]=new Date(C[0]),C[1]=new Date(C[1])),C&&!(A&&A[0].valueOf()===C[0].valueOf()&&A[1].valueOf()===C[1].valueOf())?this.model.set({initialZoomDomain:en([],C),zoomDomain:C?en([],C):S},{skipUpdate:!0}):C===null&&A!==null&&this.model.set({initialZoomDomain:null,zoomDomain:en([],S)},{skipUpdate:!0}),this.xScale.range([u,a]).domain(S),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Yo(v,L=>L.value));const I=this.model.get("zoomDomain");if(r===br.GRAPH_VIEW&&(this.renderZoomBarArea(c,"path.zoom-graph-area-unselected",v,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(c,"path.zoom-graph-area",v,this.clipId),this.renderZoomBarBaseline(c,u,a),s)){const L=s.highlightStartMapsTo,N=s.highlightEndMapsTo,z=s.color,W=s.labelMapsTo;s.data.forEach((D,G)=>{bt.appendOrSelect(c,`rect.highlight-${G}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(D[L])).attr("width",this.xScale(D[N])-this.xScale(D[L])).style("fill",z&&z.scale[D[W]]?z.scale[D[W]]:null).style("fill-opacity",.1).style("stroke",z&&z.scale[D[W]]?z.scale[D[W]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(I,u,a);const M=bt.appendOrSelect(n,this.brushSelector).call(this.brush);if(I!==void 0)if(I[0].valueOf()===I[1].valueOf())M.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const L=I.map(N=>this.xScale(N));L[1]-L[0]!1),M.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(e,n,i){const l=o=>{const a=o.selection;a===null?this.handleBrushedEvent(o,e,this.xScale,this.xScale.range()):a[0]===a[1]||this.handleBrushedEvent(o,e,this.xScale,a)},r=Te(this.getOptions(),"zoomBar",it.TOP,"type"),s=Sl.height[r];this.brush.extent([[n,0],[i,s]]).on("start brush end",null).on("start brush end",l)}handleBrushedEvent(e,n,i,l){const r=[i.invert(l[0]),i.invert(l[1])];if(this.updateBrushHandle(this.getComponentContainer(),l),e.sourceEvent!=null&&(e.sourceEvent.type==="mousemove"||e.sourceEvent.type==="mouseup"||e.sourceEvent.type==="mousedown"||e.sourceEvent.type==="touchstart"||e.sourceEvent.type==="touchmove"||e.sourceEvent.type==="touchend")){(n===void 0||n[0]!==r[0]||n[1]!==r[1])&&this.services.zoom.handleDomainChange(r,{dispatchEvent:!1});let s;e.type==="start"?s=je.ZoomBar.SELECTION_START:e.type==="brush"?s=je.ZoomBar.SELECTION_IN_PROGRESS:e.type==="end"&&(s=je.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(je.ZoomDomain.CHANGE,{newDomain:r})),this.services.events.dispatchEvent(s,{selection:l,newDomain:r})}}updateBrushHandle(e,n){const i=this,l=Sl.handleWidth,r=Te(this.getOptions(),"zoomBar",it.TOP,"type"),s=Sl.height[r],o=-l/2,a=Sl.handleBarWidth,u=r===br.GRAPH_VIEW?Sl.handleBarHeight:6,f=-a/2,c=(s-u)/2;e.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(h){if(h.type==="w")return Math.max(n[0]+o,i.maxSelectionRange[0]);if(h.type==="e")return Math.min(n[1]+o,i.maxSelectionRange[1]-l)}).attr("y",0).attr("width",l).attr("height",s).attr("cursor","ew-resize").style("display",null);const d=e.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);d.enter().append("rect").attr("class",function(h){return"handle-bar handle-bar--"+h.type}),d.attr("x",function(h){if(h.type==="w")return Math.max(n[0]+f,i.maxSelectionRange[0]-o+f);if(h.type==="e")return Math.min(n[1]+f,i.maxSelectionRange[1]+o+f)}).attr("y",c).attr("width",a).attr("height",u).attr("cursor","ew-resize"),r===br.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(e,this.clipId,n[0],0,n[1]-n[0],s)}updateSliderSelectedArea(e){const n=Te(this.getOptions(),"zoomBar",it.TOP,"type"),i=Sl.height[n],l=this.getComponentContainer().select("svg.zoom-container");bt.appendOrSelect(l,"rect.zoom-slider-selected-area").attr("x",e[0]).attr("y",i/2-1).attr("width",e[1]-e[0]).attr("height",2)}renderZoomBarArea(e,n,i,l){const{cartesianScales:r}=this.services,s=r.getMainXAxisPosition(),o=r.getMainYAxisPosition(),a=r.getMainXScaleType(),u=r.getMainYScaleType(),f=(S,A,C)=>I=>r.getValueFromScale(S,A,C,I),c=f(this.xScale,a,s),d=f(this.yScale,u,o),h=Te(this.getOptions(),"zoomBar",it.TOP,"type"),g=Sl.height[h],_=O0().x(S=>c(S)).y0(g).y1(S=>g-d(S)),v=bt.appendOrSelect(e,n).datum(i).attr("d",_);l&&v.attr("clip-path",`url(#${l})`)}updateClipPath(e,n,i,l,r,s){const o=bt.appendOrSelect(e,"clipPath").attr("id",n);bt.appendOrSelect(o,"rect").attr("x",i).attr("y",l).attr("width",r).attr("height",s)}compensateDataForDefaultDomain(e,n){if(!e||e.length<2)return;const i=Xu(e),l=this.services.cartesianScales.getDomainIdentifier(),r=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])Number(i[i.length-1][l])){const s={};s[l]=n[1],s[r]=0,i.push(s)}return i}renderZoomBarBaseline(e,n,i,l=!1){const r=Te(this.model.getOptions(),"zoomBar",it.TOP,"type"),s=Sl.height[r],o=M0()([[n,s],[i,s]]);bt.appendOrSelect(e,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",l).style("stroke",l?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(e,n,i){this.renderZoomBarArea(e,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(e,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),bt.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),Te(this.getOptions(),"zoomBar",it.TOP,"type")===br.GRAPH_VIEW&&this.renderZoomBarBaseline(e,n,i,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(je.ZoomBar.UPDATE,this.render.bind(this))}}class dme extends Xn{constructor(e,n){super(e,n),this.type="threshold",this.renderType=wn.SVG,this.positionService=new Fd}render(e=!1){const n=Te(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(u=>{if(Object.values(it).includes(u)){const f=n[u];f.thresholds&&f.thresholds.length>0&&i.push({axisPosition:u,thresholds:f.thresholds,correspondingDatasets:f==null?void 0:f.correspondingDatasets,mapsTo:f==null?void 0:f.mapsTo})}});const l=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(i,u=>u.axisPosition);l.exit().attr("opacity",0).remove();const r=l.enter().append("g").merge(l);r.attr("class",u=>`axis-thresholds ${u.axisPosition}`);const s=r.selectAll("g.threshold-group").data(u=>u.thresholds.map(f=>(f.axisPosition=u.axisPosition,f.datum=this.constructDatumObj(u,f),f)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("line").attr("class","threshold-line"),o.append("rect").attr("class","threshold-hoverable-area"),o.merge(s).attr("class","threshold-group");const a=this;r.each(function({axisPosition:u}){const f=a.services.cartesianScales.getScaleByPosition(u),c=a.services.cartesianScales.getScaleTypeByPosition(u);let d=null,h=null;u===it.LEFT||u===it.RIGHT?(h=f,d=a.services.cartesianScales.getMainXScale()):(d=f,h=a.services.cartesianScales.getMainYScale());const g=c===Nt.LABELS,[_,v]=d.range(),[S,A]=h.range(),{cartesianScales:C}=a.services,I=C.getOrientation(),M=D=>C.getDomainValue(D),L=D=>C.getRangeValue(D),[N,z]=Ko(M,L,I),W=ht(this);u===it.TOP||u===it.BOTTOM?(W.selectAll("line.threshold-line").transition().call(D=>a.services.transitions.setupTransition({transition:D,name:"threshold-line-update",animate:e})).attr("y1",A).attr("y2",S).attr("x1",({datum:D})=>N(D)+(g?f.step()/2:0)).attr("x2",({datum:D})=>N(D)+(g?f.step()/2:0)).style("stroke",({fillColor:D})=>D),W.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:D})=>-N(D)).attr("width",Math.abs(S-A)).classed("rotate",!0)):(W.selectAll("line.threshold-line").transition().call(D=>a.services.transitions.setupTransition({transition:D,name:"threshold-line-update",animate:e})).attr("x1",_).attr("x2",v).attr("y1",({datum:D})=>z(D)+(g?f.step()/2:0)).attr("y2",({datum:D})=>z(D)+(g?f.step()/2:0)).style("stroke",({fillColor:D})=>D),W.selectAll("rect.threshold-hoverable-area").attr("x",_).attr("y",({datum:D})=>z(D)).attr("width",Math.abs(v-_)).classed("rotate",!1))}),this.services.events.addEventListener(je.Threshold.SHOW,u=>{this.setThresholdLabelPosition(u.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(je.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(e){const{value:n,axisPosition:i}=e,l=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(i)===Nt.TIME){const r=[it.LEFT,it.RIGHT].includes(i),s=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),a=r?o:s,u=Te(l,"timeScale"),f=T1(a.ticks(),Te(u,"timeInterval"));return y1(n,0,a.ticks(),f,u)}return n.toLocaleString("en")}appendThresholdLabel(){const e=ht(this.services.domUtils.getHolder()),n=Te(this.getOptions(),"style","prefix");this.label=bt.appendOrSelect(e,`div.${al}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:e,datum:n}){const i=this.services.domUtils.getHolder(),l=eo(e,i),r=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(`${n.label||"Threshold"}: ${r}`).style("background-color",n.fillColor);const s=this.label.node(),o=this.positionService.findBestPlacementAt({left:l[0],top:l[1]},s,[Li.RIGHT,Li.LEFT,Li.TOP,Li.BOTTOM],()=>({top:void 0,left:void 0,width:i.offsetWidth,height:i.offsetHeight})),a=this.positionService.findPositionAt({left:l[0],top:l[1]},s,o);this.positionService.setElement(s,a)}constructDatumObj(e,n){const i={};return e.correspondingDatasets&&(i.group=Te(e,"correspondingDatasets",0)),i[e.mapsTo]=n.value,i}addEventListeners(){const e=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(n){ht(this.parentNode).select("line.threshold-line").classed("active",!0),e.services.events.dispatchEvent(je.Threshold.SHOW,{event:n,hoveredElement:ht(this),datum:ht(this).datum()})}).on("mouseout",function(n){ht(this.parentNode).select("line.threshold-line").classed("active",!1),e.services.events.dispatchEvent(je.Threshold.HIDE,{event:n,hoveredElement:ht(this),datum:ht(this).datum()})})}}class hme extends Xn{constructor(e,n){super(e,n),this.type="highlight",this.renderType=wn.SVG,this.positionService=new Fd,this.highlightStrokeWidth=1}render(e=!1){const n=Te(this.getOptions(),"axes"),i=[];Object.keys(n).forEach(u=>{if(Object.values(it).includes(u)){const f=n[u];f.highlights&&f.highlights.data.length>0&&i.push({axisPosition:u,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const l=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(i,u=>u.axisPosition);l.exit().attr("opacity",0).remove();const r=l.enter().append("g").merge(l);r.attr("class",u=>`axis-highlight ${u.axisPosition}`);const s=r.selectAll("g.highlight-group").data(u=>u.highlight.map(f=>(f.axisPosition=u.axisPosition,f.highlightStartMapsTo=u.highlightStartMapsTo,f.labelMapsTo=u.labelMapsTo,f.color=u.color,f.highlightEndMapsTo=u.highlightEndMapsTo,f)));s.exit().attr("opacity",0).remove();const o=s.enter().append("g");o.append("rect").attr("class","highlight-bar"),o.append("line").attr("class","highlight-line"),o.merge(s).attr("class","highlight-group");const a=this;r.each(function({axisPosition:u}){const f=a.services.cartesianScales.getMainXScale(),c=a.services.cartesianScales.getMainYScale(),[d,h]=f.range(),[g,_]=c.range(),{cartesianScales:v}=a.services,S=v.getOrientation(),A=N=>v.getDomainValue(N),C=N=>v.getRangeValue(N),[I,M]=Ko(A,C,S),L=ht(this);u===it.TOP||u===it.BOTTOM?L.selectAll("rect.highlight-bar").transition().call(N=>a.services.transitions.setupTransition({transition:N,name:"highlight-bar-update",animate:e})).attr("y",Math.max(_+a.highlightStrokeWidth,0)).attr("height",Math.max(g-2*a.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:N,...z})=>I(z[N])).attr("width",({highlightStartMapsTo:N,highlightEndMapsTo:z,...W})=>Math.max(I(W[z])-I(W[N]),0)).style("stroke",({color:N,labelMapsTo:z,...W})=>N&&N.scale[W[z]]?N.scale[W[z]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:N,labelMapsTo:z,...W})=>N&&N.scale[W[z]]?N.scale[W[z]]:null):L.selectAll("rect.highlight-bar").transition().call(N=>a.services.transitions.setupTransition({transition:N,name:"highlight-bar-update",animate:e})).attr("x",d).attr("width",Math.max(h-d,0)).attr("y",({highlightEndMapsTo:N,...z})=>M(z[N])).attr("height",({highlightStartMapsTo:N,highlightEndMapsTo:z,...W})=>Math.max(M(W[N])-M(W[z]),0)).style("stroke",({color:N,labelMapsTo:z,...W})=>N&&N.scale[W[z]]?N.scale[W[z]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",a.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:N,labelMapsTo:z,...W})=>N&&N.scale[W[z]]?N.scale[W[z]]:null)})}}class mme extends TM{getItems(e){if(e.detail.items)return e.detail.items;const{data:n}=e.detail;if(!n||!n.length||!n[0])return[];const i=this.getOptions(),{cartesianScales:l}=this.services,r=l.getDomainIdentifier(),s=l.isDualAxes(),{groupMapsTo:o}=i.data,a=l.getDomainLabel();let u=l.getRangeLabel();const f=n[0][r];let c;if(n.length===1){const d=n[0],h=l.getRangeIdentifier(d);if(s){const _=l.getRangeAxisPosition({datum:d,groups:[d[o]]});u=l.getScaleLabel(_)}const g=d[h];c=[{label:a,value:f},...Array.isArray(g)&&g.length===2?[{label:"Start",value:g[0]},{label:"End",value:g[1]}]:[{label:u,value:d[h]}]],e.detail.additionalItems&&e.detail.additionalItems.forEach(_=>c.push({label:_.label,value:_.value})),c.push({label:i.tooltip.groupLabel,value:d[o],color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[Ii.TOOLTIP],dataGroupName:d[o]})})}else if(n.length>1&&(c=[{label:a,value:f}],c=c.concat(n.map(d=>{const h=d[l.getRangeIdentifier(d)];return{label:d[o],value:Array.isArray(h)&&h.length===2?`${h[0]} - ${h[1]}`:h,color:this.model.getFillColor(d[o]),class:this.model.getColorClassName({classNameTypes:[Ii.TOOLTIP],dataGroupName:d[o]})}}).sort((d,h)=>h.value-d.value)),!s&&Te(i,"tooltip","showTotal")===!0)){const d=l.getRangeIdentifier();c.push({label:U0(i,"tooltip.totalLabel")||"Total",value:n.reduce((h,g)=>h+g[d],0),bold:!0})}return c}}class gme extends Xn{constructor(){super(...arguments),this.type="grid",this.renderType=wn.SVG}render(e=!0){const n=Te(this.getOptions(),"grid","x","enabled"),i=Te(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,i),!(!n&&!i)&&(n&&(bt.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(e)),i&&(bt.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(e)))}drawXGrid(e){const n=this.parent,i=this.backdrop.attr("height"),l=this.services.cartesianScales.getMainXScale(),r=iS(l).tickSizeInner(-i).tickSizeOuter(0);if(Te(this.getOptions(),"grid","x","alignWithAxisTicks")){const o=this.services.cartesianScales.getDomainAxisPosition(),a=Te(this.getOptions(),"axes",o,"ticks","values");a&&r.tickValues(a)}else{const o=Te(this.getOptions(),"grid","x","numberOfTicks");r.ticks(o)}const s=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${i})`);e?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:e})).call(r):s.call(r),this.cleanGrid(s)}drawYGrid(e){const n=this.parent,i=this.backdrop.attr("width"),l=this.services.cartesianScales.getMainYScale(),r=lS(l).tickSizeInner(-i).tickSizeOuter(0);if(Te(this.getOptions(),"grid","y","alignWithAxisTicks")){const o=this.services.cartesianScales.getRangeAxisPosition(),a=Te(this.getOptions(),"axes",o,"ticks","values");a&&r.tickValues(a)}else{const o=Te(this.getOptions(),"grid","y","numberOfTicks");r.ticks(o)}const s=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);e?s.transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"grid-update",animate:e})).call(r):s.call(r),this.cleanGrid(s)}getGridlineThreshold(e){const n=this.parent,i=n.selectAll(".x.grid .tick").nodes().sort((f,c)=>Number(Ur(f).tx)-Number(Ur(c).tx));let l=-1;if(!i.length)return;i.forEach(f=>{e[0]>=+Ur(f).tx&&l++});const r=l+1{const{hoveredElement:n}=e.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-area"})).attr("opacity",i=>i.name!==n.datum().name?Fr.opacity.unselected:Fr.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",Fr.opacity.selected)}}init(){const e=this.services.events;e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions();let l=[0,0];const{cartesianScales:r}=this.services,s=r.getOrientation(),o=O0().curve(this.services.curves.getD3Curve()).defined(M=>{const L=r.getRangeIdentifier();return M[L]!=null}),a=this.model.getGroupedData(this.configs.groups),u=Te(i,"bounds"),f=u&&a&&a.length===1;!f&&u&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${a.length}`);let c=0;const d=(M,L)=>{Te(i,"axes",M,"includeZero")===!1&&L[0]>0&&L[1]>0&&(c=L[0])},h=M=>f?r.getBoundedScaledValues(M)[0]:r.getRangeValue(c),g=M=>f?r.getBoundedScaledValues(M)[1]:r.getRangeValue(M);s===hl.VERTICAL?(l=r.getMainYScale().domain(),d(r.getMainYAxisPosition(),l),o.x(M=>r.getDomainValue(M)).y0(M=>h(M)).y1(M=>g(M))):(l=r.getMainXScale().domain(),d(r.getMainXAxisPosition(),l),o.x0(M=>h(M)).x1(M=>g(M)).y(M=>r.getDomainValue(M)));const _=Te(i,"color","gradient","enabled"),v=a&&a.length===1&&_;a.length>1&&_&&console.error("Gradients can only be enabled when having 1 single dataset");const S=n.selectAll("path.area").data(a,M=>M.name),A=ht(this.services.domUtils.getMainContainer());if(S.exit().attr("opacity",0).remove(),!a.length)return;if(v){const M=A.select(`path.${this.model.getColorClassName({classNameTypes:[Ii.STROKE],dataGroupName:a[0].name})}`).node();let L;if(M)L=getComputedStyle(M,null).getPropertyValue("stroke");else{const N=Te(this.model.getOptions(),"color","scale");if(N!==null){const z=Object.keys(N);L=N[z[0]]}}Cu.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${a[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:Cu.getStops(l,L)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const C=this,I=S.enter().append("path");v?I.merge(S).style("fill",M=>`url(#${this.services.domUtils.generateElementIDString(`${M.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",M=>this.model.getColorClassName({classNameTypes:[Ii.FILL],dataGroupName:M.name,originalClassName:"area"})).attr("d",M=>{const{data:L}=M;return o(L)}):(I.attr("opacity",0).merge(S).attr("class","area").attr("class",M=>this.model.getColorClassName({classNameTypes:[Ii.FILL,Ii.STROKE],dataGroupName:M.name,originalClassName:"area"})).style("fill",M=>C.model.getFillColor(M.name)).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"area-update-enter",animate:e})).attr("opacity",f?1:Fr.opacity.selected).attr("d",M=>{const{data:L}=M;return o(L)}),f&&I.attr("fill-opacity",Fr.opacity.selected).style("stroke",M=>C.model.getStrokeColor(M.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const e=this.services.events;e.removeEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class mc extends Xn{constructor(){super(...arguments),this.type="line",this.renderType=wn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-line"})).attr("opacity",i=>i.name!==n.datum().name?Om.opacity.unselected:Om.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-line"})).attr("opacity",Om.opacity.selected)}}init(){const{events:e}=this.services;e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const n=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:i,curves:l}=this.services,r=h=>i.getDomainValue(h),s=h=>i.getRangeValue(h),[o,a]=Ko(r,s,i.getOrientation()),u=this.getOptions(),f=M0().x(o).y(a).curve(l.getD3Curve()).defined(h=>{const g=i.getRangeIdentifier(h);return h[g]!=null});let c=[];if(this.configs.stacked){const h=Object.keys(u.axes).some(_=>u.axes[_].percentage),{groupMapsTo:g}=u.data;c=this.model.getStackedData({groups:this.configs.groups,percentage:h}).map(_=>{const v=this.services.cartesianScales.getDomainIdentifier(_),S=this.services.cartesianScales.getRangeIdentifier(_);return{name:Te(_,0,g),data:_.map(A=>({[v]:A.data.sharedStackKey,[g]:A[g],[S]:A[1]})),hidden:!Jde(_,A=>A[0]!==A[1])}})}else c=this.model.getGroupedData(this.configs.groups);const d=n.selectAll("path.line").data(c,h=>h.name);d.exit().attr("opacity",0).remove(),d.enter().append("path").classed("line",!0).attr("opacity",0).merge(d).data(c,h=>h.name).attr("class",h=>this.model.getColorClassName({classNameTypes:[Ii.STROKE],dataGroupName:h.name,originalClassName:"line"})).style("stroke",h=>this.model.getStrokeColor(h.name)).attr("role",fi.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",h=>{const{data:g}=h;return g.map(_=>{const v=this.services.cartesianScales.getRangeIdentifier(_);return _[v]}).join(",")}).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"line-update-enter",animate:e})).attr("opacity",h=>h.hidden?0:1).attr("d",h=>{const{data:g}=h;return f(g)})}destroy(){const e=this.services.events;e.removeEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const s6=5;function _me(t,e){return t>e-s6&&t({domainValue:this.services.cartesianScales.getDomainValue(v),originalData:v})).filter(v=>_me(v.domainValue,f));if(this.pointsWithinLine&&g.length===this.pointsWithinLine.length&&g.map(v=>v.domainValue).join()===this.pointsWithinLine.map(v=>v.domainValue).join())return this.pointsWithinLine=g,this.services.events.dispatchEvent(je.Tooltip.MOVE,{mousePosition:[n,i]});this.pointsWithinLine=g;const _=this.pointsWithinLine.reduce((v,S)=>{if(v.length===0)return v.push(S),v;const A=v[0].domainValue,C=Math.abs(f-S.domainValue),I=Math.abs(f-A);return C>I||(C0){const v=_.map(I=>I.originalData).filter(I=>{const M=this.services.cartesianScales.getRangeIdentifier(I);return I[M]!=null}),S=_.map(I=>I.domainValue),A=h.filter(I=>{const M=this.services.cartesianScales.getDomainValue(I);return S.includes(M)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Kde(this.elementsToHighlight,A)&&this.hideRuler(),A.dispatch("mouseover"),this.elementsToHighlight=A,this.services.events.dispatchEvent(je.Tooltip.SHOW,{mousePosition:[n,i],hoveredElement:d,data:this.formatTooltipData(v)}),c.attr("opacity",1);const C=_[0];r==="horizontal"?d.attr("x1",u).attr("x2",a).attr("y1",C.domainValue).attr("y2",C.domainValue):d.attr("y1",u).attr("y2",a).attr("x1",C.domainValue).attr("x2",C.domainValue)}else this.hideRuler()}hideRuler(){const e=this.parent,n=bt.appendOrSelect(e,"g.ruler");e.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(je.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const e=this,n=this.services.domUtils.getHolder(),i=this.model.getDisplayData();let l=function(r){const s=eo(r,e.parent.node());e.showRuler(r,s)};if(i.length>100){const r=i.length%50*12.5;l=wce(function(s){const{mousePosition:o}=this;e.showRuler(s,o)},r,n)}this.backdrop.on("mousemove mouseover",l).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const e=this.parent;this.backdrop=bt.appendOrSelect(e,"svg.chart-grid-backdrop")}}class cu extends Xn{constructor(){super(...arguments),this.type="scatter",this.renderType=wn.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(e=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:e,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(e=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:e,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(l=>{var r;return(r=this.services.transitions)==null?void 0:r.setupTransition({transition:l,name:"legend-hover-scatter"})}).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(e=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:e,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:e}=this.services;if(!e)throw new Error("Services events are undefined.");e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(e.addEventListener(je.Chart.MOUSEOVER,this.handleChartHolderOnHover),e.addEventListener(je.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(e){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const i=n.getDomainIdentifier(e),l=this.model.get("zoomDomain");return l!==void 0?e.filter(r=>r[i].getTime()>=l[0].getTime()&&r[i].getTime()<=l[1].getTime()):e}getScatterData(){const e=this.getOptions(),{stacked:n}=this.configs;let i;if(n){const l=Object.keys(e.axes).some(r=>e.axes[r].percentage);i=this.model.getStackedData({groups:this.configs.groups,percentage:l})}else{const{cartesianScales:l}=this.services;if(!l)throw new Error("Services cartesianScales are undefined.");i=this.model.getDisplayData(this.configs.groups).filter(r=>{const s=l.getRangeIdentifier(r);return r[s]!==void 0&&r[s]!==null})}return this.filterBasedOnZoomDomain(i)}render(e){if(!(Te(this.getOptions(),"points","enabled")||Te(this.getOptions(),"bubble","enabled")))return;const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:l}=i.data,{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales are undefined.");const s=r.getDomainIdentifier(),o=n.selectAll("circle.dot").data(this.getScatterData(),u=>`${u[l]}-${u[s]}`);o.exit().attr("opacity",0).remove();const a=o.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(o);this.styleCircles(a,e),this.addEventListeners()}isDatapointThresholdAnomaly(e){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const l=i.getOrientation(),[r,s]=Ko(i.getHighestDomainThreshold(),i.getHighestRangeThreshold(),l),[o,a]=Ko(c=>i.getDomainValue(c),c=>i.getRangeValue(c),l),u=o(e),f=a(e);return s&&r?f<=s.scaleValue&&u>=r.scaleValue:s?f<=s.scaleValue:r?u>=r.scaleValue:!1}styleCircles(e,n){const i=this.getOptions(),{filled:l,fillOpacity:r}=i.points,{cartesianScales:s}=this.services;if(!s)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=i.data,a=h=>s.getDomainValue(h),u=h=>s.getRangeValue(h),[f,c]=Ko(a,u,s.getOrientation()),{fadeInOnChartHolderMouseover:d}=this.configs;e.raise().classed("dot",!0).attr("class",h=>{const g=s.getDomainIdentifier(h),_=this.model.getIsFilled(h[o],h[g],h,l)?[Ii.FILL,Ii.STROKE]:[Ii.STROKE];return this.model.getColorClassName({classNameTypes:_,dataGroupName:h[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",h=>this.isDatapointThresholdAnomaly(h)).classed("filled",h=>{const g=s.getDomainIdentifier(h);return this.model.getIsFilled(h[o],h[g],h,l)}).classed("unfilled",h=>{const g=s.getDomainIdentifier(h);return!this.model.getIsFilled(h[o],h[g],h,l)}).transition().call(h=>{var g;return(g=this.services.transitions)==null?void 0:g.setupTransition({transition:h,name:"scatter-update-enter",animate:n})}).attr("cx",f).attr("cy",c).attr("r",i.points.radius).style("fill",h=>{const g=s.getDomainIdentifier(h);if(this.model.getIsFilled(h[o],h[g],h,l))return this.model.getFillColor(h[o],h[g],h)}).style("stroke",h=>{const g=s.getDomainIdentifier(h);return this.model.getStrokeColor(h[o],h[g],h)}).attr("fill-opacity",l?r:1).attr("opacity",d?0:1).attr("role",fi.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",h=>{const g=s.getRangeIdentifier(h);return h[g]}),this.addEventListeners()}getTooltipAdditionalItems(e){return null}addEventListeners(){const e=this,{groupMapsTo:n}=e.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(i,l){var r,s;const o=ht(this);o.classed("hovered",!0).attr("class",a=>e.model.getColorClassName({classNameTypes:[Ii.FILL],dataGroupName:a[n],originalClassName:o.attr("class")})).style("fill",a=>{var u;const f=(u=e.services.cartesianScales)==null?void 0:u.getDomainIdentifier(a);return e.model.getFillColor(a[n],a[f],a)}).classed("unfilled",!1),(r=e.services.events)==null||r.dispatchEvent(je.Tooltip.SHOW,{event:i,hoveredElement:o,data:[l],additionalItems:e.getTooltipAdditionalItems(l)}),(s=e.services.events)==null||s.dispatchEvent(je.Scatter.SCATTER_MOUSEOVER,{event:i,element:o,datum:l})}).on("mousemove",function(i,l){var r,s;const o=ht(this);(r=e.services.events)==null||r.dispatchEvent(je.Scatter.SCATTER_MOUSEMOVE,{event:i,element:o,datum:l}),(s=e.services.events)==null||s.dispatchEvent(je.Tooltip.MOVE,{event:i})}).on("click",function(i,l){var r;(r=e.services.events)==null||r.dispatchEvent(je.Scatter.SCATTER_CLICK,{event:i,element:ht(this),datum:l})}).on("mouseout",function(i,l){var r,s,o;const a=ht(this);if(a.classed("hovered",!1),!e.configs.filled){const{filled:u}=e.getOptions().points,f=(r=e.services.cartesianScales)==null?void 0:r.getDomainIdentifier(l),c=e.model.getIsFilled(l[n],l[f],l,u);a.classed("unfilled",!c).style("fill",d=>c||u?e.model.getFillColor(d[n],d[f],d):null)}(s=e.services.events)==null||s.dispatchEvent(je.Scatter.SCATTER_MOUSEOUT,{event:i,element:a,datum:l}),(o=e.services.events)==null||o.dispatchEvent(je.Tooltip.HIDE,{hoveredElement:a})})}destroy(){var e;(e=this.parent)==null||e.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:n}=this.services;if(!n)throw new Error("Services events undefined");n.removeEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),n.removeEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),n.removeEventListener(je.Chart.MOUSEOVER,this.handleChartHolderOnHover),n.removeEventListener(je.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class OM extends Xn{constructor(e,n,i){super(e,n,i),this.type="axes",this.renderType=wn.SVG,this.truncation={[it.LEFT]:!1,[it.RIGHT]:!1,[it.TOP]:!1,[it.BOTTOM]:!1},i&&(this.configs=i),this.margins=this.configs.margins}render(e=!0){const{position:n}=this.configs,i=this.getOptions(),l=Te(i,"axes",n,"visible"),r=this.getComponentContainer(),{width:s,height:o}=bt.getSVGElementSize(r,{useAttrs:!0}),a=bt.appendOrSelect(r,`g.axis.${n}`);let u,f;if(n===it.BOTTOM||n===it.TOP?(u=this.configs.axes[it.LEFT]?this.margins.left:0,f=this.configs.axes[it.RIGHT]?s-this.margins.right:s):(u=o-this.margins.bottom,f=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const c=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===Nt.LABELS||this.scaleType===Nt.LABELS_RATIO?c.rangeRound([u,f]):c.range([u,f]);let d;switch(n){case it.LEFT:d=lS;break;case it.BOTTOM:d=iS;break;case it.RIGHT:d=xJ;break;case it.TOP:d=QJ;break}a.attr("aria-label",`${n} axis`);const h=!a.select("g.ticks").empty();let g=bt.appendOrSelect(a,"g.ticks");h||(g.attr("role",`${fi.GRAPHICS_OBJECT} ${fi.GROUP}`),g.attr("aria-label",`${n} ticks`));const _=bt.appendOrSelect(a,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),v=Te(i,"axes",n),S=this.scaleType===Nt.TIME||v.scaleType===Nt.TIME,A=n===it.LEFT||n===it.RIGHT,C=this.model.get("zoomDomain");if(C&&S&&!A&&c.domain(C),!l){g.attr("aria-hidden",!0);return}const I=Te(v,"scaleType"),M=Te(i,"data","loading"),L=Te(v,"ticks","number"),N=Te(v,"ticks","values"),z=Te(v,"truncation","type"),W=Te(v,"truncation","threshold"),D=Te(v,"truncation","numCharacter"),G=L!==null,$=Te(i,"timeScale"),j=bt.appendOrSelect(_,"g.tick"),Q=bt.appendOrSelect(j,"text").text("0"),le=bt.getSVGElementSize(Q.node(),{useBBox:!0}).height;j.remove();const oe=this.scaleType||v.scaleType||Nt.LINEAR,X=d(c).tickSizeOuter(0);if(c.ticks){let pe;if(G?pe=L:(pe=ks.ticks.number,A&&(pe=this.getNumberOfFittingTicks(o,le,ks.ticks.verticalSpaceRatio))),c.ticks().length===1&&c.ticks()[0]===0&&(pe=0),X.ticks(pe),S)if(!c.ticks(pe).length)X.tickValues([]);else{const Fe=Te(i,"timeScale","addSpaceOnEdges"),Ve=Te(i,"axes",n,"domain"),Ee=c.copy();Fe&&!Ve&&Ee.nice(pe);const We=Ee.ticks(pe);Fe&&We.length>2&&!Ve&&(We.splice(We.length-1,1),We.splice(0,1)),X.tickValues(We)}}let de;const re=Te(v,"ticks","formatter");if(S){const pe=T1(X.tickValues(),Te(i,"timeScale","timeInterval"));re===null?de=(Fe,Ve)=>y1(Fe,Ve,X.tickValues(),pe,$):de=(Fe,Ve)=>{const Ee=y1(Fe,Ve,X.tickValues(),pe,$);return re(Fe,Ve,Ee)}}else re===null?oe===Nt.LINEAR&&(de=pe=>pe.toLocaleString()):de=re;X.tickFormat(de);const[x,me]=this.services.cartesianScales.getScaleByPosition(n).domain();let ee;if(N){if(S)N.forEach((pe,Fe)=>{pe.getTime===void 0&&(N[Fe]=new Date(pe))}),ee=N.filter(pe=>{const Fe=pe.getTime();return Fe>=new Date(x).getTime()&&Fe<=new Date(me).getTime()});else if(I===Nt.LABELS){const pe=this.services.cartesianScales.getScaleByPosition(n).domain();ee=N.filter(Fe=>pe.includes(Fe))}else ee=N.filter(pe=>pe>=x&&pe<=me);X.tickValues(ee)}switch(n){case it.LEFT:g.attr("transform",`translate(${this.margins.left}, 0)`);break;case it.BOTTOM:g.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case it.RIGHT:g.attr("transform",`translate(${s-this.margins.right}, 0)`);break;case it.TOP:g.attr("transform",`translate(0, ${this.margins.top})`);break}const ke=this.model.isDataEmpty();if(v.title){const pe=bt.appendOrSelect(a,"text.axis-title").html(ke||M?"":v.title),Fe=Te(v,"titleOrientation");let Ve;switch(n){case it.LEFT:Fe===Qm.RIGHT?pe.attr("transform","rotate(90)").attr("y",0).attr("x",c.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):pe.attr("transform","rotate(-90)").attr("y",0).attr("x",-(c.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case it.BOTTOM:pe.attr("transform",`translate(${this.margins.left/2+c.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case it.RIGHT:Fe===Qm.LEFT?pe.attr("transform","rotate(-90)").attr("y",s).attr("x",-(c.range()[0]/2)).style("text-anchor","middle"):pe.attr("transform","rotate(90)").attr("y",-s).attr("x",c.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case it.TOP:Ve=bt.getSVGElementSize(pe,{useBBox:!0}).height,pe.attr("transform",`translate(${this.margins.left/2+c.range()[1]/2}, ${Ve/2})`).style("text-anchor","middle");break}}if(S){const pe=T1(X.tickValues(),Te(i,"timeScale","timeInterval")),Fe=$.showDayName,Ve=g;e&&(g=g.transition().call(Ee=>this.services.transitions.setupTransition({transition:Ee,name:"axis-update",animate:e}))),g=g.call(X),Ve.selectAll(".tick").data(X.tickValues(),c).order().select("text").style("font-weight",(Ee,We)=>eM(Ee,We,X.tickValues(),pe,Fe)?"bold":"normal")}else!e||!h?g=g.call(X):g=g.transition().call(pe=>this.services.transitions.setupTransition({transition:pe,name:"axis-update",animate:e})).call(X);if(_.call(X),n===it.BOTTOM||n===it.TOP){let pe=!1;const Fe=Te(v,"ticks","rotation");if(Fe===nc.ALWAYS)pe=!0;else if(Fe===nc.NEVER)pe=!1;else if(!Fe||Fe===nc.AUTO)if(c.step)pe=_.selectAll("g.tick text").nodes().some(Ve=>bt.getSVGElementSize(Ve,{useBBox:!0}).width>=c.step());else{pe=!1;const Ve=_.append("text").text("A"),Ee=bt.getSVGElementSize(Ve.node(),{useBBox:!0}).width;let We;_.selectAll("g.tick").each(function(){const ge=ht(this),ve=parseFloat(Te(Ur(this),"tx"));ve!==null&&We+ge.text().length*Ee*.8>=ve&&(pe=!0),We=ve}),Ve.remove()}pe?(G||(X.ticks(this.getNumberOfFittingTicks(s,le,ks.ticks.horizontalSpaceRatio)),_.call(X),g.call(X)),a.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===it.TOP?"start":"end")):a.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(M?a.attr("opacity",0):a.attr("opacity",1),g.selectAll("g.tick").attr("aria-label",pe=>pe),_.selectAll("g.tick").attr("aria-label",pe=>pe),z!==rr.NONE&&I===Nt.LABELS&&!N){const pe=this.services.cartesianScales.getScaleDomain(n);if(pe.length>0){const Fe=r.select(`g.axis.${n} g.ticks g.tick`).html();a.selectAll("g.ticks g.tick").html(Fe);const Ve=this;a.selectAll("g.tick text").data(pe).text(function(Ee){return Ee.length>W?(Ve.truncation[n]=!0,Au(Ee,z,D)):Ee}),this.getInvisibleAxisRef().selectAll("g.tick text").data(pe).text(function(Ee){return Ee.length>W?Au(Ee,z,D):Ee}),a.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),a.selectAll("g.tick text").data(pe)}}this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:n}=this.configs,i=bt.appendOrSelect(e,`g.axis.${n}`),l=this.getOptions(),r=Te(l,"axes",n),s=Te(r,"scaleType"),o=Te(r,"truncation","threshold"),a=this;i.selectAll("g.tick text").on("mouseover",function(u,f){a.services.events.dispatchEvent(je.Axis.LABEL_MOUSEOVER,{event:u,element:ht(this),datum:f}),s===Nt.LABELS&&f.length>o&&a.services.events.dispatchEvent(je.Tooltip.SHOW,{event:u,hoveredElement:ht(this),content:f})}).on("mousemove",function(u,f){a.services.events.dispatchEvent(je.Axis.LABEL_MOUSEMOVE,{event:u,element:ht(this),datum:f}),s===Nt.LABELS&&f.length>o&&a.services.events.dispatchEvent(je.Tooltip.MOVE,{event:u})}).on("click",function(u,f){a.services.events.dispatchEvent(je.Axis.LABEL_CLICK,{event:u,element:ht(this),datum:f})}).on("mouseout",function(u,f){a.services.events.dispatchEvent(je.Axis.LABEL_MOUSEOUT,{event:u,element:ht(this),datum:f}),s===Nt.LABELS&&a.services.events.dispatchEvent(je.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} g.ticks.invisible`)}getTitleRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} text.axis-title`)}getNumberOfFittingTicks(e,n,i){const l=Math.floor(e/(n*i));return Xde(l,2,ks.ticks.number)}destroy(){const e=this.getComponentContainer(),{position:n}=this.configs;bt.appendOrSelect(e,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class pme extends OM{constructor(e,n,i){super(e,n,i)}render(e=!0){super.render(e),super.destroy();const n=this.configs.position,i=this.getComponentContainer(),l=bt.appendOrSelect(i,`g.axis.${n}`),r=this;l.selectAll("g.tick").each(function(s,o){const a=ht(this);a.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const u=a.select("text"),{width:f,height:c}=bt.getSVGElementSize(u,{useBBox:!0}),d=bt.appendOrSelect(a,"rect.axis-holder");let h=0,g=0;switch(n){case it.LEFT:h=-f+Number(u.attr("x")),g=-(c/2);break;case it.RIGHT:h=Math.abs(Number(u.attr("x"))),g=-(c/2);break;case it.TOP:h=-(f/2),g=-c+Number(u.attr("y"))/2,r.truncation[n]&&(h=0,d.attr("transform","rotate(-45)"));break;case it.BOTTOM:h=-(f/2),g=c/2-2,r.truncation[n]&&(h=-f,d.attr("transform","rotate(-45)"));break}d.attr("x",h-ks.hover.rectanglePadding).attr("y",g).attr("width",f+ks.hover.rectanglePadding*2).attr("height",c).lower()}),this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:n}=this.configs,i=bt.appendOrSelect(e,`g.axis.${n}`),l=this.getOptions(),r=Te(l,"axes",n),s=Te(r,"scaleType"),o=Te(r,"truncation","threshold"),a=this;i.selectAll("g.tick.tick-hover").on("mouseover",function(u){const f=ht(this).select("text"),c=f.datum();a.services.events.dispatchEvent(je.Axis.LABEL_MOUSEOVER,{event:u,element:f,datum:c}),s===Nt.LABELS&&c.length>o&&a.services.events.dispatchEvent(je.Tooltip.SHOW,{event:u,element:f,datum:c})}).on("mousemove",function(u){const f=ht(this).select("text"),c=f.datum();a.services.events.dispatchEvent(je.Axis.LABEL_MOUSEMOVE,{event:u,element:f,datum:c}),a.services.events.dispatchEvent(je.Tooltip.MOVE,{event:u})}).on("click",function(u){a.services.events.dispatchEvent(je.Axis.LABEL_CLICK,{event:u,element:ht(this).select("text"),datum:ht(this).select("text").datum()})}).on("mouseout",function(u){a.services.events.dispatchEvent(je.Axis.LABEL_MOUSEOUT,{event:u,element:ht(this).select("text"),datum:ht(this).select("text").datum()}),s===Nt.LABELS&&a.services.events.dispatchEvent(je.Tooltip.HIDE)}).on("focus",function(u){const f={clientX:0,clientY:0};if(u.target){u.target.focus();const c=u.target.getBoundingClientRect();f.clientX=c.x,f.clientY=c.y}a.services.events.dispatchEvent(je.Axis.LABEL_FOCUS,{event:{...u,...f},element:ht(this),datum:ht(this).select("text").datum()})}).on("blur",function(u){a.services.events.dispatchEvent(je.Axis.LABEL_BLUR,{event:u,element:ht(this),datum:ht(this).select("text").datum()})}).on("keydown",function(u){u.key&&u.key==="Escape"&&(a.services.events.dispatchEvent(je.Tooltip.HIDE),a.services.events.dispatchEvent(je.Axis.LABEL_BLUR,{event:u,element:ht(this),datum:ht(this).select("text").datum()})),n===it.LEFT||n===it.RIGHT?u.key&&u.key==="ArrowUp"?a.goNext(this,u):u.key&&u.key==="ArrowDown"&&a.goPrevious(this,u):u.key&&u.key==="ArrowLeft"?a.goPrevious(this,u):u.key&&u.key==="ArrowRight"&&a.goNext(this,u)})}goNext(e,n){e.nextElementSibling&&e.nextElementSibling.tagName!=="path"&&e.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(e,n){e.previousElementSibling&&e.previousElementSibling.tagName!=="path"&&e.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const e=this.getComponentContainer(),{position:n}=this.configs;bt.appendOrSelect(e,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class bme extends Xn{constructor(){super(...arguments),this.type="2D-axes",this.renderType=wn.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(e=!1){const n={},i=Object.keys(it),l=Te(this.getOptions(),"axes");i.forEach(s=>{l[it[s]]&&(n[it[s]]=!0)}),this.configs.axes=n,i.forEach(s=>{const o=it[s];if(this.configs.axes[o]&&!this.children[o]){const a={position:o,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===i0.DEFAULT?new OM(this.model,this.services,a):new pme(this.model,this.services,a);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[o]=u}}),Object.keys(this.children).forEach(s=>{this.children[s].render(e)});const r={};Object.keys(this.children).forEach(s=>{const o=this.children[s],a=o.configs.position,u=o.getInvisibleAxisRef(),{width:f,height:c}=bt.getSVGElementSize(u,{useBBox:!0});let d;switch(o.getTitleRef().empty()?d=0:(d=bt.getSVGElementSize(o.getTitleRef(),{useBBox:!0}).height,(a===it.LEFT||a===it.RIGHT)&&(d+=5)),a){case it.TOP:r.top=c+d;break;case it.BOTTOM:r.bottom=c+d;break;case it.LEFT:r.left=f+d;break;case it.RIGHT:r.right=f+d;break}}),this.services.events.dispatchEvent(je.Axis.RENDER_COMPLETE),Object.keys(r).some(s=>this.margins[s]!==r[s])&&(this.margins=Object.assign(this.margins,r),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(je.ZoomBar.UPDATE),Object.keys(this.children).forEach(s=>{const o=this.children[s];o.margins=this.margins}),this.render(!0))}}class vme extends Xn{constructor(){super(...arguments),this.type="skeleton"}render(e=!0){const n=Te(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(e){if(this.configs.skeleton===Uo.GRID)this.renderGridSkeleton(e);else if(this.configs.skeleton===Uo.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(e);else if(this.configs.skeleton===Uo.PIE)this.renderPieSkeleton(e);else if(this.configs.skeleton===Uo.DONUT)this.renderDonutSkeleton(e);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(e){this.setScales(),this.drawBackdrop(e),this.drawXGrid(e),this.drawYGrid(e),e&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(e){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(e),n===hl.VERTICAL&&this.drawYGrid(e),n===hl.HORIZONTAL&&this.drawXGrid(e),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(e){const n=this.computeOuterRadius(),i=0;this.drawRing(n,i,e),e&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(e){const n=this.computeOuterRadius(),i=this.computeInnerRadius();this.drawRing(n,i,e),e&&this.setShimmerEffect("shimmer-areas")}setScales(){const e=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Hc().domain([0,1]).range(e),this.yScale=Hc().domain([0,1]).range(n)}drawBackdrop(e){const n=this.parent,{width:i,height:l}=bt.getSVGElementSize(n,{useAttrs:!0});this.backdrop=bt.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",i).attr("height",l);const r=bt.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");r.attr("width","100%").attr("height","100%");const[s]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(r).attr("x",s).attr("y",o),r.classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(e){const n=+this.backdrop.attr("width"),i=Te(this.getOptions(),"grid","x","numberOfTicks"),l=this.xScale.ticks(i).map(o=>o*n),r=bt.appendOrSelect(this.backdrop,"g.x.skeleton"),s=r.selectAll("line").data(l);s.enter().append("line").merge(s).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),r.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(e){const n=+this.backdrop.attr("height"),i=this.backdrop.attr("width"),l=Te(this.getOptions(),"grid","y","numberOfTicks"),r=this.xScale.ticks(l).map(a=>a*n),s=bt.appendOrSelect(this.backdrop,"g.y.skeleton"),o=s.selectAll("line").data(r);o.enter().append("line").merge(o).attr("x1",0).attr("x2",i).attr("y1",a=>a).attr("y2",a=>a),s.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(e,n,i=!0){const l=this.parent,{width:r,height:s}=bt.getSVGElementSize(l,{useAttrs:!0}),o=bt.appendOrSelect(l,"svg.chart-skeleton").attr("width",r).attr("height",s),a=n===0?"pie":"donut",u=Te(this.getOptions(),a,"alignment");bt.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",r).attr("height",s).attr("fill","none");const f=Iie().innerRadius(n).outerRadius(e).startAngle(0).endAngle(Math.PI*2),c=e+Math.abs(Qa.radiusOffset),d=e+(Math.min(r,s)-e*2)/2,h=bt.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${c}, ${d})`).attr("d",f).classed("shimmer-effect-areas",i).classed("empty-state-areas",!i).style("fill",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let g=e+Qa.xOffset;u===jl.CENTER?g=r/2:u===jl.RIGHT&&(g=r-e-Qa.xOffset);const _=e+Qa.yOffset;h.attr("transform",`translate(${g}, ${_})`)}computeOuterRadius(){const{width:e,height:n}=bt.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(e,n)/2+Qa.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(e){const n="stop-bg-shimmer",i="stop-shimmer",l=this.parent.select(".chart-skeleton"),{width:r}=bt.getSVGElementSize(this.parent,{useAttrs:!0}),s=0,o=r,a=bt.appendOrSelect(l,"defs").lower(),u=bt.appendOrSelect(a,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(e)).attr("class",e).attr("x1",s-3*.2*r).attr("x2",o).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=` - `;u.html(f),c();function c(){u.attr("gradientTransform",`translate(${s-3*.2*r}, 0)`).transition().duration(2e3).delay(1e3).ease(bte).attr("gradientTransform",`translate(${o+3*.2*r}, 0)`).on("end",c)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class kme extends Xn{constructor(){super(...arguments),this.type="zero-line",this.renderType=wn.SVG}render(e){const n=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),i=this.services.cartesianScales.getScaleByPosition(n),[l,r]=i.domain(),s=l>0&&r<0||l<0&&r>0,o=this.getComponentContainer();if(!s){o.selectAll("line.domain").remove();return}const[a,u]=this.services.cartesianScales.getDomainScale().range();let f=+i(0)+.5;f||(f=i.range()[0]);const c=JE({x0:a,x1:u,y0:f,y1:f},this.services.cartesianScales.getOrientation());bt.appendOrSelect(o,"line.domain").transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"zero-line-update",animate:e})).attr("y1",c.y0).attr("y2",c.y1).attr("x1",c.x0).attr("x2",c.x1)}}class o6 extends EM{formatTooltipData(e){return e.reverse()}}class J0 extends Xn{getBarWidth(){const e=this.getOptions();if(e.bars.width)return e.bars.width;const n=this.model.getDisplayData().length,i=this.services.cartesianScales.getMainXScale(),l=bt.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!i.step){const r=Te(e,"bars","spacingFactor");return Math.min(e.bars.maxWidth,l*r/n)}return Math.min(e.bars.maxWidth,i.step()/2)}isOutsideZoomedDomain(e,n){if(this.model.getDisplayData().length<=1)return!1;const i=this.model.get("zoomDomain");if(i!==void 0){const l=this.services.cartesianScales.getDomainScale();return el(i[1])}return!1}}class wme extends J0{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=wn.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(l=>this.services.transitions.setupTransition({transition:l,name:"legend-hover-bar"})).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const n=this.model.getDisplayData(this.configs.groups),i=this.getOptions(),{groupMapsTo:l}=i.data;this.setGroupScale();const r=this.getComponentContainer({withinChartClip:!0}),s=Ou(n.map(f=>{const c=this.services.cartesianScales.getDomainIdentifier(f);return f[c]&&typeof f[c].toString=="function"?f[c].toString():f[c]})),o=r.selectAll("g.bars").data(s,f=>f);o.exit().attr("opacity",0).remove();const a=o.enter().append("g").classed("bars",!0).attr("role",fi.GROUP).attr("data-name","bars").merge(o);a.transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"bar-group-update-enter",animate:e})).attr("transform",f=>{const c=this.services.cartesianScales.getDomainValue(f)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===hl.VERTICAL?`translate(${c}, 0)`:`translate(0, ${c})`});const u=a.selectAll("path.bar").data(f=>this.getDataCorrespondingToLabel(f),f=>f[l]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"bar-update-enter",animate:e})).attr("class",f=>this.model.getColorClassName({classNameTypes:[Ii.FILL],dataGroupName:f[l],originalClassName:"bar"})).style("fill",f=>this.model.getFillColor(f[l])).attr("d",f=>{const c=this.groupScale(f[l]),d=this.getBarWidth(),h=c,g=c+d,_=this.services.cartesianScales.getRangeAxisPosition({datum:f}),v=this.services.cartesianScales.getValueThroughAxisPosition(_,0),S=this.services.cartesianScales.getRangeValue(f),A=this.services.cartesianScales.getDomainValue(f)-d/2,C=A+d;if(!this.isOutsideZoomedDomain(A,C))return X0({x0:h,x1:g,y0:v,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",fi.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",f=>f.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(n,i){const l=ht(this);l.classed("hovered",!0),e.services.events.dispatchEvent(je.Bar.BAR_MOUSEOVER,{event:n,element:l,datum:i}),e.services.events.dispatchEvent(je.Tooltip.SHOW,{event:n,hoveredElement:l,data:[i]})}).on("mousemove",function(n,i){const l=ht(this);e.services.events.dispatchEvent(je.Bar.BAR_MOUSEMOVE,{event:n,element:l,datum:i}),e.services.events.dispatchEvent(je.Tooltip.MOVE,{event:n})}).on("click",function(n,i){e.services.events.dispatchEvent(je.Bar.BAR_CLICK,{event:n,element:ht(this),datum:i})}).on("mouseout",function(n,i){const l=ht(this);l.classed("hovered",!1),e.services.events.dispatchEvent(je.Bar.BAR_MOUSEOUT,{event:n,element:l,datum:i}),e.services.events.dispatchEvent(je.Tooltip.HIDE,{hoveredElement:l})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(e){return this.model.getDisplayData(this.configs.groups).filter(n=>{const i=this.services.cartesianScales.getDomainIdentifier(n);return n[i].toString()===e})}getGroupWidth(){const e=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*e.length+n}getDomainScaleStep(){const e=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let i=this.defaultStepFactor;if(typeof e.step=="function")i=e.step();else if(n.length>0){const l=n.find(r=>{var s;return((s=r.data)==null?void 0:s.length)>1});if(l){const r=this.services.cartesianScales.getDomainIdentifier(l.data[0]);i=Math.abs(e(l.data[1][r])-e(l.data[0][r]))}}return i}getTotalGroupPadding(){const e=this.model.getGroupedData(this.configs.groups);return e.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(e.length-1)}getBarWidth(){const e=this.getOptions(),n=Te(e,"bars","width"),i=Te(e,"bars","maxWidth");if(n!==null&&(i===null||n<=i))return n;const l=this.model.getGroupedData(this.configs.groups).length,r=this.getTotalGroupPadding();return Math.min(i,(this.getDomainScaleStep()-r)/l)}setGroupScale(){const e=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=_0().domain(e).rangeRound([0,this.getGroupWidth()])}}class yme extends J0{constructor(){super(...arguments),this.type="simple-bar",this.renderType=wn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(l=>this.services.transitions.setupTransition({transition:l,name:"legend-hover-simple-bar"})).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const n=this.getOptions(),{groupMapsTo:i}=n.data,l=this.getComponentContainer({withinChartClip:!0}),r=this.model.getDisplayData(this.configs.groups),s=this.services.cartesianScales.getOrientation(),o=l.selectAll("path.bar").data(r,a=>a[i]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(a=>this.services.transitions.setupTransition({transition:a,name:"bar-update-enter",animate:e})).attr("class",a=>this.model.getColorClassName({classNameTypes:[Ii.FILL],dataGroupName:a[i],originalClassName:"bar"})).style("fill",a=>this.model.getFillColor(a[i])).attr("d",a=>{const u=this.services.cartesianScales.getRangeIdentifier(),f=this.getBarWidth(),c=a[u],d=this.services.cartesianScales.getDomainValue(a)-f/2,h=d+f;let g,_;if(Array.isArray(c)&&c.length===2)g=this.services.cartesianScales.getRangeValue(c[0]),_=this.services.cartesianScales.getRangeValue(c[1]);else{const S=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,S)),_=this.services.cartesianScales.getRangeValue(a)}const v=Math.abs(_-g);if(v!==0&&v<2&&(c>0&&s===hl.VERTICAL||c<0&&s===hl.HORIZONTAL?_=g-2:_=g+2),!this.isOutsideZoomedDomain(d,h))return X0({x0:d,x1:h,y0:g,y1:_},s)}).attr("opacity",1).attr("role",fi.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",a=>a.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(n,i){const l=ht(this);l.classed("hovered",!0),e.services.events.dispatchEvent(je.Bar.BAR_MOUSEOVER,{event:n,element:l,datum:i}),e.services.events.dispatchEvent(je.Tooltip.SHOW,{event:n,hoveredElement:l,data:[i]})}).on("mousemove",function(n,i){e.services.events.dispatchEvent(je.Bar.BAR_MOUSEMOVE,{event:n,element:ht(this),datum:i}),e.services.events.dispatchEvent(je.Tooltip.MOVE,{event:n})}).on("click",function(n,i){e.services.events.dispatchEvent(je.Bar.BAR_CLICK,{event:n,element:ht(this),datum:i})}).on("mouseout",function(n,i){const l=ht(this);l.classed("hovered",!1),e.services.events.dispatchEvent(je.Bar.BAR_MOUSEOUT,{event:n,element:l,datum:i}),e.services.events.dispatchEvent(je.Tooltip.HIDE,{hoveredElement:l})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Tme extends Xn{constructor(){super(...arguments),this.type="area-stacked",this.renderType=wn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,i=this.getOptions(),{groupMapsTo:l}=i.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>Te(r,0,l)!==n.datum().name?Fr.opacity.unselected:Fr.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",Fr.opacity.selected)}}init(){const e=this.services.events;e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const n=this.getComponentContainer({withinChartClip:!0}),i=this,l=this.getOptions(),{groupMapsTo:r}=l.data,s=Object.keys(l.axes).some(h=>l.axes[h].percentage),o=this.model.getStackedData({percentage:s,groups:this.configs.groups}),a=Te(o,0,0),u=this.services.cartesianScales.getDomainAxisPosition({datum:a}),f=this.services.cartesianScales.getRangeAxisPosition({datum:a}),c=this.services.cartesianScales.getScaleByPosition(f),d=n.selectAll("path.area").data(o,h=>Te(h,0,r));this.areaGenerator=O0().x(h=>this.services.cartesianScales.getValueThroughAxisPosition(u,h.data.sharedStackKey)).y0(h=>c(h[0])).y1(h=>c(h[1])).curve(this.services.curves.getD3Curve()),d.exit().attr("opacity",0).remove(),d.enter().append("path").attr("opacity",0).merge(d).data(o,h=>Te(h,0,r)).attr("class","area").attr("class",h=>this.model.getColorClassName({classNameTypes:[Ii.FILL],dataGroupName:Te(h,0,r),originalClassName:"area"})).style("fill",h=>i.model.getFillColor(Te(h,0,r))).attr("role",fi.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",h=>Te(h,0,r)).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"area-update-enter",animate:e})).attr("opacity",Fr.opacity.selected).attr("d",this.areaGenerator)}}class Sme extends J0{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=wn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(l=>this.services.transitions.setupTransition({transition:l,name:"legend-hover-bar"})).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:l}=i.data,r=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),s=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(r,u=>Te(u,0,l));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",fi.GROUP).attr("data-name","bars");const a=n.selectAll("g.bars").selectAll("path.bar").data(u=>u,u=>u.data.sharedStackKey);a.exit().remove(),a.enter().append("path").merge(a).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:e})).attr("class",u=>this.model.getColorClassName({classNameTypes:[Ii.FILL],dataGroupName:u[l],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[l])).attr("d",u=>{const f=u.data.sharedStackKey,c=this.getBarWidth(),d=this.services.cartesianScales.getDomainValue(f)-c/2,h=d+c,g=this.services.cartesianScales.getRangeValue(u[0]);let _=this.services.cartesianScales.getRangeValue(u[1]);if(!this.isOutsideZoomedDomain(d,h)){if(Math.abs(_-g)>0&&Math.abs(_-g)>i.bars.dividerSize){const v=u[0]<0&&u[1]<=0;v&&s.length>1?this.services.cartesianScales.getOrientation()===hl.VERTICAL?_+=u[1]===0?2:1:_-=1:v||(this.services.cartesianScales.getOrientation()===hl.VERTICAL?_+=1:_-=1)}return X0({x0:d,x1:h,y0:g,y1:_},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",fi.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u[1]-u[0]),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:n}=e.data,i=this;this.parent.selectAll("path.bar").on("mouseover",function(l,r){const s=ht(this);s.classed("hovered",!0),i.services.events.dispatchEvent(je.Bar.BAR_MOUSEOVER,{event:l,element:s,datum:r});let o=i.model.getDisplayData(i.configs.groups).find(a=>{const u=i.services.cartesianScales.getDomainIdentifier(a),f=i.services.cartesianScales.getRangeIdentifier(a);return a[f]===r.data[r[n]]&&a[u].toString()===r.data.sharedStackKey&&a[n]===r[n]});if(o===void 0){const a=i.services.cartesianScales.getDomainIdentifier(),u=i.services.cartesianScales.getRangeIdentifier();o={[a]:r.data.sharedStackKey,[u]:r.data[r[n]],[n]:r[n]}}i.services.events.dispatchEvent(je.Tooltip.SHOW,{event:l,hoveredElement:s,data:[o]})}).on("mousemove",function(l,r){const s=ht(this);i.services.events.dispatchEvent(je.Bar.BAR_MOUSEMOVE,{event:l,element:s,datum:r}),i.services.events.dispatchEvent(je.Tooltip.MOVE,{event:l})}).on("click",function(l,r){i.services.events.dispatchEvent(je.Bar.BAR_CLICK,{event:l,element:ht(this),datum:r})}).on("mouseout",function(l,r){const s=ht(this);s.classed("hovered",!1),i.services.events.dispatchEvent(je.Bar.BAR_MOUSEOUT,{event:l,element:s,datum:r}),i.services.events.dispatchEvent(je.Tooltip.HIDE,{hoveredElement:s})})}getBarWidth(){const e=this.getOptions();if(Te(e,"bars","width"))return e.bars.width;const n=this.services.cartesianScales.getMainXScale(),i=bt.getSVGElementSize(this.parent,{useAttrs:!0}).width,l=this.model.getStackKeys().length,r=Te(e,"bars","spacingFactor");return n.step?Math.min(e.bars.maxWidth,n.step()/2):Math.min(e.bars.maxWidth,i*r/l)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Eme extends cu{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=wn.SVG}render(e){if(!Te(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:l}=i.data,r=Object.keys(i.axes).some(f=>i.axes[f].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:r}),o=n.selectAll("g.dots").data(s,f=>Te(f,0,l));o.exit().attr("opacity",0).remove();const a=o.enter().append("g").classed("dots",!0).attr("role",fi.GROUP).merge(o).selectAll("circle.dot").data(f=>f);a.exit().attr("opacity",0).remove();const u=a.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(a).datum(f=>{const c=f[l],d=this.services.cartesianScales.getDomainIdentifier(f),h=this.services.cartesianScales.getRangeIdentifier(f);return{[l]:c,[d]:f.data.sharedStackKey,[h]:f[1]}});this.styleCircles(u,e),this.addEventListeners()}getTooltipData(e,n){const i=this.getOptions(),{groupMapsTo:l}=i.data,r=Object.keys(i.axes).some(a=>i.axes[a].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:r}),o=[];return s.forEach((a,u)=>{a.forEach((f,c)=>{const d=f[l],h=f.data.sharedStackKey;let g=f.data[d];const _=f[1],v=this.services.cartesianScales.getDomainIdentifier(f),S=this.services.cartesianScales.getRangeIdentifier(f);g!=null&&e===this.services.cartesianScales.getDomainValue(h)&&n===this.services.cartesianScales.getRangeValue(_)&&(r&&(g=this.model.getStackedData({groups:this.configs.groups})[u][c].data[d]),g!==null&&o.push({[l]:d,[v]:h,[S]:g}))})}),this.model.getDisplayData(this.configs.groups).filter(a=>{const u=this.services.cartesianScales.getDomainIdentifier(a),f=this.services.cartesianScales.getRangeIdentifier(a);return o.find(c=>c[l]==a[l]&&c[u]==a[u]&&c[f]==a[f])!==void 0})}}function OM(t,e){Qt(2,arguments);var n=gn(t),i=vi(e);return isNaN(i)?new Date(NaN):(i&&n.setDate(n.getDate()+i),n)}function Q0(t,e){Qt(2,arguments);var n=gn(t),i=vi(e);if(isNaN(i))return new Date(NaN);if(!i)return n;var l=n.getDate(),r=new Date(n.getTime());r.setMonth(n.getMonth()+i+1,0);var s=r.getDate();return l>=s?r:(n.setFullYear(r.getFullYear(),r.getMonth(),l),n)}var Mme=36e5;function AM(t,e){Qt(2,arguments);var n=vi(e);return Ad(t,n*Mme)}function a6(t){Qt(1,arguments);var e=gn(t);return e.setHours(0,0,0,0),e}var Ome=864e5;function Ame(t,e){Qt(2,arguments);var n=a6(t),i=a6(e),l=n.getTime()-m1(n),r=i.getTime()-m1(i);return Math.round((l-r)/Ome)}var Cme=6e4;function F1(t,e){Qt(2,arguments);var n=vi(e);return Ad(t,n*Cme)}function G1(t,e){Qt(2,arguments);var n=vi(e);return Ad(t,n*1e3)}function CM(t,e){Qt(2,arguments);var n=vi(e);return Q0(t,n*12)}function du(t,e){Qt(2,arguments);var n=gn(t),i=gn(e),l=n.getTime()-i.getTime();return l<0?-1:l>0?1:l}var Lme=6e4,Ime=36e5;function Rme(t,e){Qt(2,arguments);var n=gn(t),i=gn(e),l=n.getFullYear()-i.getFullYear(),r=n.getMonth()-i.getMonth();return l*12+r}function Dme(t,e){Qt(2,arguments);var n=gn(t),i=gn(e);return n.getFullYear()-i.getFullYear()}function u6(t,e){var n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function Pme(t,e){Qt(2,arguments);var n=gn(t),i=gn(e),l=u6(n,i),r=Math.abs(Ame(n,i));n.setDate(n.getDate()-l*r);var s=+(u6(n,i)===-l),o=l*(r-s);return o===0?0:o}function x0(t,e){return Qt(2,arguments),gn(t).getTime()-gn(e).getTime()}var f6={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},Nme="trunc";function eg(t){return t?f6[t]:f6[Nme]}function Bme(t,e,n){Qt(2,arguments);var i=x0(t,e)/Ime;return eg(n==null?void 0:n.roundingMethod)(i)}function c6(t,e,n){Qt(2,arguments);var i=x0(t,e)/Lme;return eg(n==null?void 0:n.roundingMethod)(i)}function zme(t){Qt(1,arguments);var e=gn(t);return e.setHours(23,59,59,999),e}function Hme(t){Qt(1,arguments);var e=gn(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Ume(t){Qt(1,arguments);var e=gn(t);return zme(e).getTime()===Hme(e).getTime()}function Fme(t,e){Qt(2,arguments);var n=gn(t),i=gn(e),l=du(n,i),r=Math.abs(Rme(n,i)),s;if(r<1)s=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-l*r);var o=du(n,i)===-l;Ume(gn(t))&&r===1&&du(t,i)===1&&(o=!1),s=l*(r-Number(o))}return s===0?0:s}function d6(t,e,n){Qt(2,arguments);var i=x0(t,e)/1e3;return eg(n==null?void 0:n.roundingMethod)(i)}function Gme(t,e){Qt(2,arguments);var n=gn(t),i=gn(e),l=du(n,i),r=Math.abs(Dme(n,i));n.setFullYear(1584),i.setFullYear(1584);var s=du(n,i)===-l,o=l*(r-Number(s));return o===0?0:o}function Vme(t,e){Qt(2,arguments);var n=vi(e);return OM(t,-n)}function Wme(t,e){Qt(2,arguments);var n=vi(e);return Q0(t,-n)}function qme(t,e){Qt(2,arguments);var n=vi(e);return AM(t,-n)}function h6(t,e){Qt(2,arguments);var n=vi(e);return F1(t,-n)}function m6(t,e){Qt(2,arguments);var n=vi(e);return G1(t,-n)}function jme(t,e){Qt(2,arguments);var n=vi(e);return CM(t,-n)}function Yme(t){var e=t==null?0:t.length;return e?G0(t,1):[]}class Zme extends Qr{zoomIn(e,n,i){let l,r,s;const o=i||zw;e&&(l=e.x,r=e.y,s=2);const{width:a,height:u}=bt.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${a/2}, ${u/2}) scale(${s}) translate(${-l},${-r})`),this.services.events.dispatchEvent(je.CanvasZoom.CANVAS_ZOOM_IN,{element:ht(e)})}zoomOut(e,n){const i=n||zw;e.transition().duration(i.duration).ease(i.ease).attr("transform",""),this.services.events.dispatchEvent(je.CanvasZoom.CANVAS_ZOOM_OUT)}}class Xme extends Qr{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(e,n){this.documentFragment.addEventListener(e,n)}removeEventListener(e,n){this.documentFragment.removeEventListener(e,n)}dispatchEvent(e,n){let i;n?i=new CustomEvent(e,{detail:n}):(i=document.createEvent("Event"),i.initEvent(e,!1,!0)),this.documentFragment.dispatchEvent(i)}}class Kme extends Qr{constructor(e,n){super(e,n)}downloadCSV(e,n){const i=document.createElement("a"),l="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([e],{type:l}),n);else if(URL&&"download"in i){const r=URL.createObjectURL(new Blob([e],{type:l}));i.href=r,i.setAttribute("download",n),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}else location.href=`data:application/octet-stream,${encodeURIComponent(e)}`}downloadImage(e,n){const i=document.createElement("a");i.download=n,i.href=e,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}class $me extends Qr{constructor(){super(...arguments),this.pendingTransitions={}}init(){var e;(e=this.services.events)==null||e.addEventListener(je.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:e,name:n,animate:i}){return this.pendingTransitions[e._id]=e,e.on("end interrupt cancel",()=>{delete this.pendingTransitions[e._id]}),this.model.getOptions().animations===!1||i===!1?e.duration(0):e.duration(Te(Uw,n,"duration")||Uw.default.duration)}getPendingTransitions(){return this.pendingTransitions}}class Jme extends Qr{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:e=null}={}){if(this.dualAxes&&e){const n=this.model.getOptions(),{groupMapsTo:i}=n.data,l=Te(n,"axes",this.secondaryDomainAxisPosition),r=e[i];if(l!=null&&l.correspondingDatasets&&l.correspondingDatasets.includes(r))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:e=null,groups:n=null}={}){if(this.dualAxes){const i=this.model.getOptions(),{groupMapsTo:l}=i.data,r=Te(i,"axes",this.secondaryRangeAxisPosition);let s;if(e!==null?s=e[l]:n&&n.length>0&&(s=n[0]),r!=null&&r.correspondingDatasets&&r.correspondingDatasets.includes(s))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(e){return Te(this.model.getOptions(),"axes",e)}getDomainAxisOptions(){const e=this.getDomainAxisPosition();return this.getAxisOptions(e)}getRangeAxisOptions(){const e=this.getRangeAxisPosition();return this.getAxisOptions(e)}getScaleLabel(e){return this.getAxisOptions(e).title||(e===it.BOTTOM||e===it.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(it).map(e=>it[e]).forEach(e=>{this.scales[e]=this.createScale(e)})}findDomainAndRangeAxes(){const e=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),i=this.findDomainAndRangeAxesPositions(e,n);this.domainAxisPosition=i.primaryDomainAxisPosition,this.rangeAxisPosition=i.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=i.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=i.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===it.LEFT||this.rangeAxisPosition===it.RIGHT)&&(this.domainAxisPosition===it.BOTTOM||this.domainAxisPosition===it.TOP)?this.orientation=hl.VERTICAL:this.orientation=hl.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var e,n,i,l;const r=this.model.getOptions(),s=Te(r,"axes");((e=s[it.LEFT])!=null&&e.correspondingDatasets&&s[it.RIGHT]||(n=s[it.RIGHT])!=null&&n.correspondingDatasets&&s[it.LEFT]||(i=s[it.TOP])!=null&&i.correspondingDatasets&&s[it.BOTTOM]||(l=s[it.BOTTOM])!=null&&l.correspondingDatasets&&s[it.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(e){const n=Te(this.model.getOptions(),"axes",e,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${e} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[e]===Nt.LINEAR||this.scaleTypes[e]===Nt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[e]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(e){return this.scales[e]}getScaleTypeByPosition(e){return this.scaleTypes[e]}getDomainAxisScaleType(){const e=this.getDomainAxisPosition();return this.getScaleTypeByPosition(e)}getRangeAxisScaleType(){const e=this.getRangeAxisPosition();return this.getScaleTypeByPosition(e)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const e=[it.BOTTOM,it.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>e.indexOf(n)>-1)}getMainYAxisPosition(){const e=[it.LEFT,it.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>e.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(e,n,i,l){const r=this.model.getOptions(),s=Te(r,"axes")[i],{mapsTo:o}=s,a=Te(l,o)!==null?l[o]:l;let u;switch(n){case Nt.LABELS:u=e(a)+e.step()/2;break;case Nt.TIME:u=e(new Date(a));break;default:u=e(a)}return u}getBoundedScaledValues(e){const{bounds:n}=this.model.getOptions(),i=this.getRangeAxisPosition({datum:e}),l=this.scales[i],r=this.model.getOptions(),s=Te(r,"axes")[i],{mapsTo:o}=s,a=e[o]!==void 0?e[o]:e;return[l(Te(e,n.upperBoundMapsTo)!==null?e[n.upperBoundMapsTo]:a),l(Te(e,n.lowerBoundMapsTo)!==null?e[n.lowerBoundMapsTo]:a)]}getValueThroughAxisPosition(e,n){const i=this.scaleTypes[e],l=this.scales[e];return this.getValueFromScale(l,i,e,n)}getDomainValue(e){const n=this.getDomainAxisPosition({datum:e});return this.getValueThroughAxisPosition(n,e)}getRangeValue(e){const n=this.getRangeAxisPosition({datum:e});return this.getValueThroughAxisPosition(n,e)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(e){const n=this.model.getOptions();return Te(n,"axes",this.getDomainAxisPosition({datum:e}),"mapsTo")}getRangeIdentifier(e){const n=this.model.getOptions();return Te(n,"axes",this.getRangeAxisPosition({datum:e}),"mapsTo")}extendsDomain(e,n){const i=this.model.getOptions(),l=Te(i,"axes",e);if(l.scaleType===Nt.TIME){const r=Te(i,"timeScale","addSpaceOnEdges");return Qme(n,r)}else return xme(n,ks.paddingRatio,l.scaleType)}findVerticalAxesPositions(){const e=this.model.getOptions(),n=Te(e,"axes"),i=this.isDualAxes();return Te(n,it.LEFT)===null&&Te(n,it.RIGHT)!==null||Te(n,it.RIGHT,"main")===!0||i&&Te(n,it.LEFT,"correspondingDatasets")?{primary:it.RIGHT,secondary:it.LEFT}:{primary:it.LEFT,secondary:it.RIGHT}}findHorizontalAxesPositions(){const e=this.model.getOptions(),n=Te(e,"axes"),i=this.isDualAxes();return Te(n,it.BOTTOM)===null&&Te(n,it.TOP)!==null||Te(n,it.TOP,"main")===!0||i&&Te(n,it.BOTTOM,"correspondingDatasets")?{primary:it.TOP,secondary:it.BOTTOM}:{primary:it.BOTTOM,secondary:it.TOP}}findDomainAndRangeAxesPositions(e,n){const i=this.model.getOptions(),l=Te(i,"axes",e.primary),r=Te(i,"axes",n.primary),s=l.scaleType||Nt.LINEAR,o=r.scaleType||Nt.LINEAR,a={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return a.primaryDomainAxisPosition=n.primary,a.primaryRangeAxisPosition=e.primary,a.secondaryDomainAxisPosition=n.secondary,a.secondaryRangeAxisPosition=e.secondary,(!(o===Nt.LABELS||o===Nt.TIME)&&s===Nt.LABELS||s===Nt.TIME)&&(a.primaryDomainAxisPosition=e.primary,a.primaryRangeAxisPosition=n.primary,a.secondaryDomainAxisPosition=e.secondary,a.secondaryRangeAxisPosition=n.secondary),a}getScaleDomain(e){const n=this.model.getOptions(),i=Te(n,"axes",e),l=Te(n,"bounds"),{includeZero:r}=i,s=Te(i,"scaleType")||Nt.LINEAR;if(this.model.isDataEmpty())return[];if(i.binned){const{bins:S}=this.model.getBinConfigurations();return[0,WJ(S,A=>A.length)]}else if(i.limitDomainToBins){const{bins:S}=this.model.getBinConfigurations(),A=this.model.getStackKeys({bins:S});return[A[0].split("-")[0],A[A.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:a,mapsTo:u,percentage:f,thresholds:c}=i,{reference:d,compareTo:h}=ks.ratio;if(i.domain)return s===Nt.LABELS?i.domain:(s===Nt.TIME&&(i.domain=i.domain.map(S=>S.getTime===void 0?new Date(S):S)),this.extendsDomain(e,i.domain));if(f)return[0,100];if(i&&s===Nt.LABELS)return Ou(o.map(S=>S[u]));let g,_;const v=this.model.getDataGroupNames();if(s===Nt.LABELS_RATIO)return o.map(S=>`${S[d]}/${S[h]}`);if(s===Nt.TIME)_=o.map(S=>+new Date(S[u]));else if(l&&n.axes)_=[],o.forEach(S=>{_.push(S[u]),S[l.upperBoundMapsTo]&&_.push(S[l.upperBoundMapsTo]),S[l.lowerBoundMapsTo]&&_.push(S[l.lowerBoundMapsTo])});else if(i.stacked===!0&&v&&e===this.getRangeAxisPosition()){const{groupMapsTo:S}=n.data,A=this.model.getDataValuesGroupedByKeys({groups:v}),C=o.filter(M=>!v.includes(M[S])),I=[];A.forEach(M=>{const{...L}=M;let N=0,z=0;Object.values(L).forEach(W=>{isNaN(W)||(W<0?z+=W:N+=W)}),I.push([z,N])}),_=[...Yme(I),...C.map(M=>M[u])]}else _=[],o.forEach(S=>{const A=S[u];Array.isArray(A)&&A.length===2?(_.push(A[0]),_.push(A[1])):(a&&_.push(Math.max(S[u],S[a])),_.push(A))});return s!==Nt.TIME&&s!==Nt.LOG&&r&&_.push(0),c&&c.length>0&&c.forEach(S=>{const A=Te(S,"value");A!==null&&_.push(A)}),g=Yo(_),g=this.extendsDomain(e,g),g}createScale(e){const n=this.model.getOptions(),i=Te(n,"axes",e);if(!i)return null;const l=Te(i,"scaleType")||Nt.LINEAR;this.scaleTypes[e]=l;let r;return l===Nt.TIME?r=jS():l===Nt.LOG?r=zS().base(i.base||10):l===Nt.LABELS||l===Nt.LABELS_RATIO?r=_0():r=Hc(),r.domain(this.getScaleDomain(e)),r}getHighestDomainThreshold(){const e=Te(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:i}=e[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const l=this.getDomainScale(),r=i.sort((s,o)=>o.value-s.value)[0];return this.getScaleTypeByPosition(n)===Nt.TIME&&(typeof r.value=="string"||r.value.getTime===void 0)&&(r.value=new Date(r.value)),{threshold:r,scaleValue:l(r.value)}}getHighestRangeThreshold(){const e=Te(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:i}=e[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const l=this.getRangeScale(),r=i.sort((s,o)=>o.value-s.value)[0];return{threshold:r,scaleValue:l(r.value)}}}function Qme(t,e){const n=new Date(t[0]),i=new Date(t[1]);return Gme(i,n)>1?[jme(n,e),CM(i,e)]:Fme(i,n)>1?[Wme(n,e),Q0(i,e)]:Pme(i,n)>1?[Vme(n,e),OM(i,e)]:Bme(i,n)>1?[qme(n,e),AM(i,e)]:c6(i,n)>30?[h6(n,e*30),F1(i,e*30)]:c6(i,n)>1?[h6(n,e),F1(i,e)]:d6(i,n)>15?[m6(n,e*15),G1(i,e*15)]:d6(i,n)>1?[m6(n,e),G1(i,e)]:[n,i]}function xme([t,e],n,i){const l=(e-t)*n,r=e<=0&&e+l>0?0:e+l;let s=t>=0&&t-l<0?0:t-l;if(i===Nt.LOG&&s<=0){if(t<=0)throw Error("Data must have values greater than 0 if log scale type is used.");s=t}return[s,r]}class e1e extends Qr{constructor(){super(...arguments),this.curveTypes={curveLinear:E0,curveLinearClosed:Vie,curveBasis:Rie,curveBasisClosed:Die,curveBasisOpen:Pie,curveBundle:Nie,curveCardinal:Bie,curveCardinalClosed:zie,curveCardinalOpen:Hie,curveCatmullRom:Uie,curveCatmullRomClosed:Fie,curveCatmullRomOpen:Gie,curveMonotoneX:Wie,curveMonotoneY:qie,curveNatural:jie,curveStep:Yie,curveStepAfter:Xie,curveStepBefore:Zie}}getD3Curve(){let e="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?e=n:e=n.name),this.curveTypes[e]){let i=this.curveTypes[e];return n&&Object.keys(n).forEach(l=>{i[l]&&(i=i[l](n[l]))}),i}return console.warn(`The curve type '${e}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class t1e extends Qr{isZoomBarEnabled(){if(!this.services.cartesianScales||!Te(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const e=this.services.cartesianScales.getMainXAxisPosition(),n=Te(this.model.getOptions(),"axes",e,"scaleType");return e===it.BOTTOM&&n===Nt.TIME}getZoomBarData(){const e=this.model.getZoomBarData();return e&&e.length>1?e:this.model.getDisplayData()}getDefaultZoomBarDomain(e){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=e||this.services.zoom.getZoomBarData(),{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales undefined");const l=i.getMainXAxisPosition(),r=i.getDomainIdentifier(),s=Te(this.model.getOptions(),"axes",l,"domain");if(Array.isArray(s)&&s.length===2)return s;if(!l)throw new Error("Not defined: mainXAxisPosition");return i.extendsDomain(l,Yo(n,o=>o[r]))}handleDomainChange(e,n={dispatchEvent:!0}){var i;this.model.set({zoomDomain:e},{animate:!1}),n.dispatchEvent&&((i=this.services.events)==null||i.dispatchEvent(je.ZoomDomain.CHANGE,{newDomain:e}))}getZoomRatio(){return Te(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(e,n){var i;const l=this.model.get("zoomDomain"),r=Object.assign({stacked:!1},n),s=Te(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&l){const o=r.stacked?"sharedStackKey":(i=this.services.cartesianScales)==null?void 0:i.getDomainIdentifier(),a=e.filter(u=>new Date(u[o])>=l[0]&&new Date(u[o])<=l[1]);if(a.length>0)return a}return e}zoomIn(e=this.getZoomRatio()){var n;const i=this.model.get("zoomDomain"),l=Sl.handleWidth,r=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const s=r(i[0]),o=r(i[1]);if(o-s=d&&(c=s+u/2-l/2,d=o-u/2+l/2);const h=[r.invert(c),r.invert(d)];(i[0].valueOf()!==h[0].valueOf()||i[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h)}zoomOut(e=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const i=this.services.cartesianScales.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const l=i(n[0]),r=i(n[1]),s=i.range(),o=(s[1]-s[0])/2*(e/2),a=Math.max(l-o,s[0]),u=Math.min(r+o,s[1]),f=[i.invert(a),i.invert(u)];(n[0].valueOf()!==f[0].valueOf()||n[1].valueOf()!==f[1].valueOf())&&this.handleDomainChange(f)}resetZoomDomain(){const e=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(e[0].valueOf()!==n[0].valueOf()||e[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const e=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!e||!n)return!1;const i=e[1].valueOf()-e[0].valueOf(),l=n[1].valueOf()-n[0].valueOf(),r=Te(this.model.getOptions(),"zoomBar","minZoomRatio");return i/l{const l=this.services[i];this.services[i]=new l(this.model,this.services)}),this.services.events.addEventListener(je.Model.UPDATE,i=>{const l=!!Te(i,"detail","animate");this.update(l)}),this.model.setData(n.data),this.services.events.addEventListener(je.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(e=!0){if(!this.components)return;Object.keys(this.services).forEach(l=>{this.services[l].update()}),this.components.forEach(l=>l.render(e));const n=this.services.transitions.getPendingTransitions(),i=Object.keys(n).map(l=>n[l].end().catch(r=>r));Promise.all(i).then(()=>this.services.events.dispatchEvent(je.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(e=>e.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(e,n){const i=this.model.getOptions(),l=Te(i,"toolbar","enabled"),r={id:"legend",components:[new kM(this.model,this.services)],growth:Nn.PREFERRED},s=Te(i,"canvasZoom","enabled");s&&s===!0&&e.push(new ume(this.model,this.services));const o=!!this.model.getOptions().title,a={id:"title",components:[new vM(this.model,this.services)],growth:Nn.STRETCH},u={id:"toolbar",components:[new hM(this.model,this.services)],growth:Nn.PREFERRED},f={id:"header",components:[new $o(this.model,this.services,[a,...l?[u]:[]],{direction:pi.ROW,alignItems:vd.CENTER})],growth:Nn.PREFERRED},c={id:"graph-frame",components:e,growth:Nn.STRETCH,renderType:Te(n,"graphFrameRenderType")||wn.SVG},d=Te(n,"excludeLegend")!==!0&&i.legend.enabled!==!1;let h=pi.COLUMN;if(d){const S=Te(i,"legend","position");S==="left"?(h=pi.ROW,i.legend.orientation||(i.legend.orientation=bu.VERTICAL)):S==="right"?(h=pi.ROW_REVERSE,i.legend.orientation||(i.legend.orientation=bu.VERTICAL)):S==="bottom"&&(h=pi.COLUMN_REVERSE)}const g={id:"spacer",components:[new ed(this.model,this.services)],growth:Nn.PREFERRED},_={id:"full-frame",components:[new $o(this.model,this.services,[...d?[r]:[],...d?[g]:[],c],{direction:h})],growth:Nn.STRETCH},v=[];if(o||l){v.push(f);const S={id:"spacer",components:[new ed(this.model,this.services,l?{size:15}:void 0)],growth:Nn.PREFERRED};v.push(S)}return v.push(_),[new yM(this.model,this.services),new bM(this.model,this.services),new $o(this.model,this.services,v,{direction:pi.COLUMN})]}}class i1e extends n1e{constructor(e,n){super(e,n),this.services=Object.assign(this.services,{cartesianScales:Jme,curves:e1e,zoom:t1e}),this.model=new Bce(this.services)}getAxisChartComponents(e,n){const i=this.model.getOptions(),l=Te(i,"zoomBar",it.TOP,"enabled"),r=Te(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=this.services.cartesianScales.getMainXAxisPosition(),o=Te(i,"axes",s,"scaleType"),a=l&&s===it.BOTTOM&&o===Nt.TIME,u=this.services.zoom.isZoomBarLocked(it.TOP),f=!!this.model.getOptions().title,c={id:"title",components:[new vM(this.model,this.services)],growth:Nn.STRETCH},d={id:"toolbar",components:[new hM(this.model,this.services)],growth:Nn.PREFERRED},h={id:"header",components:[new $o(this.model,this.services,[c,...r?[d]:[]],{direction:pi.ROW,alignItems:vd.CENTER})],growth:Nn.PREFERRED},g={id:"legend",components:[new kM(this.model,this.services)],growth:Nn.PREFERRED};a&&!u&&e.push(new wM(this.model,this.services),new fme(this.model,this.services)),e.push(new dme(this.model,this.services)),e.push(new hme(this.model,this.services));const _={id:"graph-frame",components:e,growth:Nn.STRETCH,renderType:wn.SVG},v=Te(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let S=pi.COLUMN;if(v){const L=Te(this.model.getOptions(),"legend","position");L===au.LEFT?(S=pi.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=bu.VERTICAL)):L===au.RIGHT?(S=pi.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=bu.VERTICAL)):L===au.BOTTOM&&(S=pi.COLUMN_REVERSE)}const A={id:"spacer",components:[new ed(this.model,this.services)],growth:Nn.PREFERRED},C={id:"full-frame",components:[new $o(this.model,this.services,[...v?[g]:[],...v?[A]:[],_],{direction:S})],growth:Nn.STRETCH},I={id:"zoom-bar",components:[new cme(this.model,this.services)],growth:Nn.PREFERRED,renderType:wn.SVG},M=[];if(f||r){M.push(h);const L={id:"spacer",components:[new ed(this.model,this.services,r?{size:15}:void 0)],growth:Nn.PREFERRED};M.push(L)}return a&&M.push(I),M.push(C),[new mme(this.model,this.services),new bM(this.model,this.services),new $o(this.model,this.services,M,{direction:pi.COLUMN})]}}class l1e extends i1e{constructor(e,n){super(e,n),this.model.setOptions(yce(Xu(kce.areaChart),n.options)),this.init(e,n)}getComponents(){const e=[new bme(this.model,this.services),new gme(this.model,this.services),new EM(this.model,this.services),new mc(this.model,this.services),new SM(this.model,this.services),new cu(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new vme(this.model,this.services,{skeleton:Uo.GRID})];return this.getAxisChartComponents(e)}}ps.LINE+"",ps.SCATTER+"",ps.AREA+"",ps.STACKED_AREA+"",ps.SIMPLE_BAR+"",ps.GROUPED_BAR+"",ps.STACKED_BAR+"";function r1e(t){let e=t[6]("Dashboard")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Dashboard")+"")&&Z(n,e)},d(i){i&&w(n)}}}function s1e(t){let e=t[6]("Stats")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Stats")+"")&&Z(n,e)},d(i){i&&w(n)}}}function o1e(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[r1e]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[s1e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&64|s[1]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&64|s[1]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function a1e(t){let e,n,i,l;return e=new Op({props:{text:t[6]("24 hours")}}),i=new Op({props:{text:t[6]("7 days")}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&64&&(o.text=r[6]("24 hours")),e.$set(o);const a={};s[0]&64&&(a.text=r[6]("7 days")),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function g6(t){let e,n;return e=new xi({props:{kind:"error",title:t[6]("Stats unavailable"),subtitle:t[2],hideCloseButton:!0}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.title=i[6]("Stats unavailable")),l[0]&4&&(r.subtitle=i[2]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function _6(t){let e,n;return e=new Vt({props:{type:"red",size:"sm",$$slots:{default:[u1e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function u1e(t){let e=t[6]("Check the logs")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Check the logs")+"")&&Z(n,e)},d(i){i&&w(n)}}}function f1e(t){let e=t[6]("Since GateSentry started")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Since GateSentry started")+"")&&Z(n,e)},d(i){i&&w(n)}}}function c1e(t){let e=t[6]("Since GateSentry started")+"",n,i,l=new Date(t[4].started_at).toLocaleString()+"",r;return{c(){n=q(e),i=q(" · "),r=q(l)},m(s,o){y(s,n,o),y(s,i,o),y(s,r,o)},p(s,o){o[0]&64&&e!==(e=s[6]("Since GateSentry started")+"")&&Z(n,e),o[0]&16&&l!==(l=new Date(s[4].started_at).toLocaleString()+"")&&Z(r,l)},d(s){s&&(w(n),w(i),w(r))}}}function p6(t){let e,n,i,l=t[6]("Most blocked domains")+"",r,s,o,a,u,f,c,d=t[6]("Most requested domains")+"",h,g,_,v,S,A,C,I=t[6]("Most active devices")+"",M,L,N,z,W,D,G,$=t[6]("Blocks by policy")+"",j,Q,le,oe,X,de,re,x=t[6]("Block reasons")+"",me,ee,ke,pe,Fe,Ve,Ee,We=t[6]("Traffic breakdown")+"",ge,ve,be,ue,nt,Oe;const dt=[h1e,d1e],yt=[];function at(se,Le){var _t;return(_t=se[0].top_blocked_domains)!=null&&_t.length?0:1}o=at(t),a=yt[o]=dt[o](t);const ut=[g1e,m1e],At=[];function xe(se,Le){var _t;return(_t=se[0].top_domains)!=null&&_t.length?0:1}_=xe(t),v=At[_]=ut[_](t);const mt=[p1e,_1e],we=[];function gt(se,Le){var _t;return(_t=se[0].affected_devices)!=null&&_t.length?0:1}N=gt(t),z=we[N]=mt[N](t);const It=[v1e,b1e],Ht=[];function Wt(se,Le){var _t;return(_t=se[0].blocks_by_policy)!=null&&_t.length?0:1}le=Wt(t),oe=Ht[le]=It[le](t);const qt=[w1e,k1e],Xt=[];function Ce(se,Le){var _t;return(_t=se[0].top_reasons)!=null&&_t.length?0:1}return ke=Ce(t),pe=Xt[ke]=qt[ke](t),be=new Ol({props:{size:"short",headers:[{key:"key",value:t[6]("Layer")},{key:"count",value:t[6]("Requests")},{key:"share",value:t[6]("Share")}],rows:t[13](t[0].by_layer,t[7],t[0].total)}}),nt=new Ol({props:{size:"short",headers:[{key:"key",value:t[6]("Outcome")},{key:"count",value:t[6]("Requests")},{key:"share",value:t[6]("Share")}],rows:t[13](t[0].by_action,t[8],t[0].total)}}),{c(){e=R("div"),n=R("section"),i=R("h3"),r=q(l),s=B(),a.c(),u=B(),f=R("section"),c=R("h3"),h=q(d),g=B(),v.c(),S=B(),A=R("section"),C=R("h3"),M=q(I),L=B(),z.c(),W=B(),D=R("section"),G=R("h3"),j=q($),Q=B(),oe.c(),X=B(),de=R("section"),re=R("h3"),me=q(x),ee=B(),pe.c(),Fe=B(),Ve=R("section"),Ee=R("h3"),ge=q(We),ve=B(),F(be.$$.fragment),ue=B(),F(nt.$$.fragment),P(i,"class","svelte-1f2qoe8"),P(n,"class","panel svelte-1f2qoe8"),P(c,"class","svelte-1f2qoe8"),P(f,"class","panel svelte-1f2qoe8"),P(C,"class","svelte-1f2qoe8"),P(A,"class","panel svelte-1f2qoe8"),P(G,"class","svelte-1f2qoe8"),P(D,"class","panel svelte-1f2qoe8"),P(re,"class","svelte-1f2qoe8"),P(de,"class","panel svelte-1f2qoe8"),P(Ee,"class","svelte-1f2qoe8"),P(Ve,"class","panel svelte-1f2qoe8"),P(e,"class","columns svelte-1f2qoe8")},m(se,Le){y(se,e,Le),T(e,n),T(n,i),T(i,r),T(n,s),yt[o].m(n,null),T(e,u),T(e,f),T(f,c),T(c,h),T(f,g),At[_].m(f,null),T(e,S),T(e,A),T(A,C),T(C,M),T(A,L),we[N].m(A,null),T(e,W),T(e,D),T(D,G),T(G,j),T(D,Q),Ht[le].m(D,null),T(e,X),T(e,de),T(de,re),T(re,me),T(de,ee),Xt[ke].m(de,null),T(e,Fe),T(e,Ve),T(Ve,Ee),T(Ee,ge),T(Ve,ve),H(be,Ve,null),T(Ve,ue),H(nt,Ve,null),Oe=!0},p(se,Le){(!Oe||Le[0]&64)&&l!==(l=se[6]("Most blocked domains")+"")&&Z(r,l);let _t=o;o=at(se),o===_t?yt[o].p(se,Le):(fe(),k(yt[_t],1,1,()=>{yt[_t]=null}),ce(),a=yt[o],a?a.p(se,Le):(a=yt[o]=dt[o](se),a.c()),b(a,1),a.m(n,null)),(!Oe||Le[0]&64)&&d!==(d=se[6]("Most requested domains")+"")&&Z(h,d);let zt=_;_=xe(se),_===zt?At[_].p(se,Le):(fe(),k(At[zt],1,1,()=>{At[zt]=null}),ce(),v=At[_],v?v.p(se,Le):(v=At[_]=ut[_](se),v.c()),b(v,1),v.m(f,null)),(!Oe||Le[0]&64)&&I!==(I=se[6]("Most active devices")+"")&&Z(M,I);let Be=N;N=gt(se),N===Be?we[N].p(se,Le):(fe(),k(we[Be],1,1,()=>{we[Be]=null}),ce(),z=we[N],z?z.p(se,Le):(z=we[N]=mt[N](se),z.c()),b(z,1),z.m(A,null)),(!Oe||Le[0]&64)&&$!==($=se[6]("Blocks by policy")+"")&&Z(j,$);let Ot=le;le=Wt(se),le===Ot?Ht[le].p(se,Le):(fe(),k(Ht[Ot],1,1,()=>{Ht[Ot]=null}),ce(),oe=Ht[le],oe?oe.p(se,Le):(oe=Ht[le]=It[le](se),oe.c()),b(oe,1),oe.m(D,null)),(!Oe||Le[0]&64)&&x!==(x=se[6]("Block reasons")+"")&&Z(me,x);let kt=ke;ke=Ce(se),ke===kt?Xt[ke].p(se,Le):(fe(),k(Xt[kt],1,1,()=>{Xt[kt]=null}),ce(),pe=Xt[ke],pe?pe.p(se,Le):(pe=Xt[ke]=qt[ke](se),pe.c()),b(pe,1),pe.m(de,null)),(!Oe||Le[0]&64)&&We!==(We=se[6]("Traffic breakdown")+"")&&Z(ge,We);const Pt={};Le[0]&64&&(Pt.headers=[{key:"key",value:se[6]("Layer")},{key:"count",value:se[6]("Requests")},{key:"share",value:se[6]("Share")}]),Le[0]&1&&(Pt.rows=se[13](se[0].by_layer,se[7],se[0].total)),be.$set(Pt);const Ye={};Le[0]&64&&(Ye.headers=[{key:"key",value:se[6]("Outcome")},{key:"count",value:se[6]("Requests")},{key:"share",value:se[6]("Share")}]),Le[0]&1&&(Ye.rows=se[13](se[0].by_action,se[8],se[0].total)),nt.$set(Ye)},i(se){Oe||(b(a),b(v),b(z),b(oe),b(pe),b(be.$$.fragment,se),b(nt.$$.fragment,se),Oe=!0)},o(se){k(a),k(v),k(z),k(oe),k(pe),k(be.$$.fragment,se),k(nt.$$.fragment,se),Oe=!1},d(se){se&&w(e),yt[o].d(),At[_].d(),we[N].d(),Ht[le].d(),Xt[ke].d(),U(be),U(nt)}}}function d1e(t){let e,n=t[6]("Nothing blocked in this window.")+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","helper svelte-1f2qoe8")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("Nothing blocked in this window.")+"")&&Z(i,n)},i:he,o:he,d(l){l&&w(e)}}}function h1e(t){let e,n;return e=new Ol({props:{size:"short",headers:[{key:"key",value:t[6]("Domain")},{key:"count",value:t[6]("Blocks")}],rows:t[12](t[0].top_blocked_domains,"b")}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"key",value:i[6]("Domain")},{key:"count",value:i[6]("Blocks")}]),l[0]&1&&(r.rows=i[12](i[0].top_blocked_domains,"b")),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function m1e(t){let e,n=t[6]("No requests in this window.")+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","helper svelte-1f2qoe8")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No requests in this window.")+"")&&Z(i,n)},i:he,o:he,d(l){l&&w(e)}}}function g1e(t){let e,n;return e=new Ol({props:{size:"short",headers:[{key:"key",value:t[6]("Domain")},{key:"count",value:t[6]("Requests")}],rows:t[12](t[0].top_domains,"t")}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"key",value:i[6]("Domain")},{key:"count",value:i[6]("Requests")}]),l[0]&1&&(r.rows=i[12](i[0].top_domains,"t")),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function _1e(t){let e,n=t[6]("No device activity in this window.")+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","helper svelte-1f2qoe8")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No device activity in this window.")+"")&&Z(i,n)},i:he,o:he,d(l){l&&w(e)}}}function p1e(t){let e,n;return e=new Ol({props:{size:"short",headers:[{key:"device",value:t[6]("Device")},{key:"count",value:t[6]("Requests")}],rows:t[0].affected_devices.map(t[17])}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"device",value:i[6]("Device")},{key:"count",value:i[6]("Requests")}]),l[0]&1&&(r.rows=i[0].affected_devices.map(i[17])),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function b1e(t){let e,n=t[6]("No policy blocks in this window.")+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","helper svelte-1f2qoe8")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No policy blocks in this window.")+"")&&Z(i,n)},i:he,o:he,d(l){l&&w(e)}}}function v1e(t){let e,n;return e=new Ol({props:{size:"short",headers:[{key:"name",value:t[6]("Policy")},{key:"count",value:t[6]("Blocks")}],rows:t[0].blocks_by_policy.map(t[18])}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"name",value:i[6]("Policy")},{key:"count",value:i[6]("Blocks")}]),l[0]&1&&(r.rows=i[0].blocks_by_policy.map(i[18])),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function k1e(t){let e,n=t[6]("No recorded reasons in this window.")+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","helper svelte-1f2qoe8")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No recorded reasons in this window.")+"")&&Z(i,n)},i:he,o:he,d(l){l&&w(e)}}}function w1e(t){let e,n;return e=new Ol({props:{size:"short",headers:[{key:"key",value:t[6]("Reason")},{key:"count",value:t[6]("Decisions")}],rows:t[12](t[0].top_reasons,"r")}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"key",value:i[6]("Reason")},{key:"count",value:i[6]("Decisions")}]),l[0]&1&&(r.rows=i[12](i[0].top_reasons,"r")),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function y1e(t){var Di,el,Xl,Cs,_l,Ls,xr,si;let e,n,i,l,r,s=t[6]("Stats")+"",o,a,u,f,c,d,h,g,_,v=t[6]("Requests")+"",S,A,C,I=t[9]((Di=t[0])==null?void 0:Di.total)+"",M,L,N,z,W=t[6]("Blocked")+"",D,G,$,j=t[9](t[5])+"",Q,le,oe,X=t[10](t[5],((el=t[0])==null?void 0:el.total)||0)+"",de,re,x=t[6]("of requests")+"",me,ee,ke,pe,Fe=t[6]("Active clients")+"",Ve,Ee,We,ge=t[9]((Xl=t[0])==null?void 0:Xl.unique_clients)+"",ve,be,ue,nt,Oe=t[6]("Distinct domains")+"",dt,yt,at,ut=t[9]((Cs=t[0])==null?void 0:Cs.unique_domains)+"",At,xe,mt,we,gt=t[6]("Inspection errors")+"",It,Ht,Wt,qt=t[9]((_l=t[0])==null?void 0:_l.inspection_failures)+"",Xt,Ce,se,Le,_t,zt=t[6]("Live proxy traffic")+"",Be,Ot,kt,Pt=t[11]((Ls=t[4])==null?void 0:Ls.total_bytes)+"",Ye,ze,Qe,He=t[6]("Down")+"",Tt,Bt,qn=t[11]((xr=t[4])==null?void 0:xr.download_bytes)+"",li,di,hi=t[6]("Up")+"",Mi,wi,Ri=t[11]((si=t[4])==null?void 0:si.upload_bytes)+"",Zi,ur,Kn,Rn,lt,St,Dn=t[6]("Requests over time")+"",Hn,Ll,mi,Un,tn;n=new Kr({props:{noTrailingSlash:!0,$$slots:{default:[o1e]},$$scope:{ctx:t}}}),f=new sD({props:{size:"sm",selectedIndex:t[1],$$slots:{default:[a1e]},$$scope:{ctx:t}}}),f.$on("change",t[15]);let Tn=t[2]&&g6(t),pn=t[0]&&t[0].inspection_failures>0&&_6(t);function ml(Lt,Kt){var Kl;return(Kl=Lt[4])!=null&&Kl.started_at?c1e:f1e}let gl=ml(t),ri=gl(t),Sn=t[0]&&p6(t);return{c(){e=R("div"),F(n.$$.fragment),i=B(),l=R("header"),r=R("h2"),o=q(s),a=B(),u=R("div"),F(f.$$.fragment),c=B(),Tn&&Tn.c(),d=B(),h=R("section"),g=R("div"),_=R("span"),S=q(v),A=B(),C=R("span"),M=q(I),L=B(),N=R("div"),z=R("span"),D=q(W),G=B(),$=R("span"),Q=q(j),le=B(),oe=R("span"),de=q(X),re=B(),me=q(x),ee=B(),ke=R("div"),pe=R("span"),Ve=q(Fe),Ee=B(),We=R("span"),ve=q(ge),be=B(),ue=R("div"),nt=R("span"),dt=q(Oe),yt=B(),at=R("span"),At=q(ut),xe=B(),mt=R("div"),we=R("span"),It=q(gt),Ht=B(),Wt=R("span"),Xt=q(qt),Ce=B(),pn&&pn.c(),se=B(),Le=R("div"),_t=R("span"),Be=q(zt),Ot=B(),kt=R("span"),Ye=q(Pt),ze=B(),Qe=R("span"),Tt=q(He),Bt=B(),li=q(qn),di=q(" · "),Mi=q(hi),wi=B(),Zi=q(Ri),ur=B(),Kn=R("span"),ri.c(),Rn=B(),lt=R("section"),St=R("h3"),Hn=q(Dn),Ll=B(),mi=R("div"),Un=B(),Sn&&Sn.c(),P(u,"class","switcher svelte-1f2qoe8"),P(l,"class","page-head svelte-1f2qoe8"),P(_,"class","tile-label svelte-1f2qoe8"),P(C,"class","tile-value svelte-1f2qoe8"),P(g,"class","tile svelte-1f2qoe8"),P(z,"class","tile-label svelte-1f2qoe8"),P($,"class","tile-value svelte-1f2qoe8"),P(oe,"class","tile-foot svelte-1f2qoe8"),P(N,"class","tile svelte-1f2qoe8"),P(pe,"class","tile-label svelte-1f2qoe8"),P(We,"class","tile-value svelte-1f2qoe8"),P(ke,"class","tile svelte-1f2qoe8"),P(nt,"class","tile-label svelte-1f2qoe8"),P(at,"class","tile-value svelte-1f2qoe8"),P(ue,"class","tile svelte-1f2qoe8"),P(we,"class","tile-label svelte-1f2qoe8"),P(Wt,"class","tile-value svelte-1f2qoe8"),P(mt,"class","tile svelte-1f2qoe8"),P(_t,"class","tile-label svelte-1f2qoe8"),P(kt,"class","tile-value svelte-1f2qoe8"),P(Qe,"class","tile-foot svelte-1f2qoe8"),P(Kn,"class","tile-foot svelte-1f2qoe8"),P(Le,"class","tile traffic-tile svelte-1f2qoe8"),P(h,"class","tiles svelte-1f2qoe8"),P(St,"class","svelte-1f2qoe8"),P(mi,"class","chart svelte-1f2qoe8"),P(lt,"class","panel svelte-1f2qoe8"),P(e,"class","page svelte-1f2qoe8")},m(Lt,Kt){y(Lt,e,Kt),H(n,e,null),T(e,i),T(e,l),T(l,r),T(r,o),T(l,a),T(l,u),H(f,u,null),T(e,c),Tn&&Tn.m(e,null),T(e,d),T(e,h),T(h,g),T(g,_),T(_,S),T(g,A),T(g,C),T(C,M),T(h,L),T(h,N),T(N,z),T(z,D),T(N,G),T(N,$),T($,Q),T(N,le),T(N,oe),T(oe,de),T(oe,re),T(oe,me),T(h,ee),T(h,ke),T(ke,pe),T(pe,Ve),T(ke,Ee),T(ke,We),T(We,ve),T(h,be),T(h,ue),T(ue,nt),T(nt,dt),T(ue,yt),T(ue,at),T(at,At),T(h,xe),T(h,mt),T(mt,we),T(we,It),T(mt,Ht),T(mt,Wt),T(Wt,Xt),T(mt,Ce),pn&&pn.m(mt,null),T(h,se),T(h,Le),T(Le,_t),T(_t,Be),T(Le,Ot),T(Le,kt),T(kt,Ye),T(Le,ze),T(Le,Qe),T(Qe,Tt),T(Qe,Bt),T(Qe,li),T(Qe,di),T(Qe,Mi),T(Qe,wi),T(Qe,Zi),T(Le,ur),T(Le,Kn),ri.m(Kn,null),T(e,Rn),T(e,lt),T(lt,St),T(St,Hn),T(lt,Ll),T(lt,mi),t[16](mi),T(e,Un),Sn&&Sn.m(e,null),tn=!0},p(Lt,Kt){var Sr,fr,Er,ts,tl,Is,cr,Il;const Kl={};Kt[0]&64|Kt[1]&4&&(Kl.$$scope={dirty:Kt,ctx:Lt}),n.$set(Kl),(!tn||Kt[0]&64)&&s!==(s=Lt[6]("Stats")+"")&&Z(o,s);const es={};Kt[0]&2&&(es.selectedIndex=Lt[1]),Kt[0]&64|Kt[1]&4&&(es.$$scope={dirty:Kt,ctx:Lt}),f.$set(es),Lt[2]?Tn?(Tn.p(Lt,Kt),Kt[0]&4&&b(Tn,1)):(Tn=g6(Lt),Tn.c(),b(Tn,1),Tn.m(e,d)):Tn&&(fe(),k(Tn,1,1,()=>{Tn=null}),ce()),(!tn||Kt[0]&64)&&v!==(v=Lt[6]("Requests")+"")&&Z(S,v),(!tn||Kt[0]&1)&&I!==(I=Lt[9]((Sr=Lt[0])==null?void 0:Sr.total)+"")&&Z(M,I),(!tn||Kt[0]&64)&&W!==(W=Lt[6]("Blocked")+"")&&Z(D,W),(!tn||Kt[0]&32)&&j!==(j=Lt[9](Lt[5])+"")&&Z(Q,j),(!tn||Kt[0]&33)&&X!==(X=Lt[10](Lt[5],((fr=Lt[0])==null?void 0:fr.total)||0)+"")&&Z(de,X),(!tn||Kt[0]&64)&&x!==(x=Lt[6]("of requests")+"")&&Z(me,x),(!tn||Kt[0]&64)&&Fe!==(Fe=Lt[6]("Active clients")+"")&&Z(Ve,Fe),(!tn||Kt[0]&1)&&ge!==(ge=Lt[9]((Er=Lt[0])==null?void 0:Er.unique_clients)+"")&&Z(ve,ge),(!tn||Kt[0]&64)&&Oe!==(Oe=Lt[6]("Distinct domains")+"")&&Z(dt,Oe),(!tn||Kt[0]&1)&&ut!==(ut=Lt[9]((ts=Lt[0])==null?void 0:ts.unique_domains)+"")&&Z(At,ut),(!tn||Kt[0]&64)&>!==(gt=Lt[6]("Inspection errors")+"")&&Z(It,gt),(!tn||Kt[0]&1)&&qt!==(qt=Lt[9]((tl=Lt[0])==null?void 0:tl.inspection_failures)+"")&&Z(Xt,qt),Lt[0]&&Lt[0].inspection_failures>0?pn?(pn.p(Lt,Kt),Kt[0]&1&&b(pn,1)):(pn=_6(Lt),pn.c(),b(pn,1),pn.m(mt,null)):pn&&(fe(),k(pn,1,1,()=>{pn=null}),ce()),(!tn||Kt[0]&64)&&zt!==(zt=Lt[6]("Live proxy traffic")+"")&&Z(Be,zt),(!tn||Kt[0]&16)&&Pt!==(Pt=Lt[11]((Is=Lt[4])==null?void 0:Is.total_bytes)+"")&&Z(Ye,Pt),(!tn||Kt[0]&64)&&He!==(He=Lt[6]("Down")+"")&&Z(Tt,He),(!tn||Kt[0]&16)&&qn!==(qn=Lt[11]((cr=Lt[4])==null?void 0:cr.download_bytes)+"")&&Z(li,qn),(!tn||Kt[0]&64)&&hi!==(hi=Lt[6]("Up")+"")&&Z(Mi,hi),(!tn||Kt[0]&16)&&Ri!==(Ri=Lt[11]((Il=Lt[4])==null?void 0:Il.upload_bytes)+"")&&Z(Zi,Ri),gl===(gl=ml(Lt))&&ri?ri.p(Lt,Kt):(ri.d(1),ri=gl(Lt),ri&&(ri.c(),ri.m(Kn,null))),(!tn||Kt[0]&64)&&Dn!==(Dn=Lt[6]("Requests over time")+"")&&Z(Hn,Dn),Lt[0]?Sn?(Sn.p(Lt,Kt),Kt[0]&1&&b(Sn,1)):(Sn=p6(Lt),Sn.c(),b(Sn,1),Sn.m(e,null)):Sn&&(fe(),k(Sn,1,1,()=>{Sn=null}),ce())},i(Lt){tn||(b(n.$$.fragment,Lt),b(f.$$.fragment,Lt),b(Tn),b(pn),b(Sn),tn=!0)},o(Lt){k(n.$$.fragment,Lt),k(f.$$.fragment,Lt),k(Tn),k(pn),k(Sn),tn=!1},d(Lt){Lt&&w(e),U(n),U(f),Tn&&Tn.d(),pn&&pn.d(),ri.d(),t[16](null),Sn&&Sn.d()}}}function T1e(t,e,n){let i,l,r;Mt(t,An,x=>n(26,l=x)),Mt(t,ii,x=>n(6,r=x));const s=[1,7],o={dns:"DNS",explicit_proxy:"Proxy",transparent_proxy:"Transparent proxy",content:"Content inspection"},a={allow:"Allowed",block:"Blocked",inspect:"Inspected",bypass:"Bypassed",error:"Errors",unknown:"Other"};let u=1,f=null,c="",d=null,h,g=null,_=!1,v=!1,S=null,A=null,C=!1,I=!1;const M=x=>typeof x=="number"?x.toLocaleString():"—",L=(x,me)=>me>0?(x/me*100).toFixed(1)+"%":"—",N=x=>{if(typeof x!="number")return"—";const me=["B","KiB","MiB","GiB","TiB"];let ee=x,ke=0;for(;ee>=1024&&ke=100?0:ee>=10?1:2;return`${ee.toFixed(pe)} ${me[ke]}`},z=x=>(x.timeline||[]).flatMap(me=>{const ee=new Date(me.start*1e3).toISOString();return[{group:"Requests",date:ee,value:me.total},{group:"Blocked",date:ee,value:me.blocked}]}),W=x=>{const me=z(x);h&&(d?d.model.setData(me):d=new l1e(h,{data:me,options:{axes:{bottom:{mapsTo:"date",scaleType:Nt.TIME},left:{mapsTo:"value",scaleType:Nt.LINEAR}},curve:"curveMonotoneX",height:"320px",toolbar:{enabled:!1},legend:{alignment:jl.LEFT}}}))},D=async()=>{if(_||I)return;_=!0;const x=u;try{const me=s[x],ee=await l.api.doCall(`/decisions/summary?days=${me}`);!I&&x===u&&(n(0,f=ee),n(2,c=""),f&&W(f))}catch{!I&&x===u&&n(2,c="Unable to load statistics.")}finally{if(_=!1,I)return;v?(v=!1,D()):g=setTimeout(D,3e4)}},G=()=>{if(g&&clearTimeout(g),g=null,_){v=!0;return}D()},$=async()=>{if(!(C||I)){C=!0;try{const x=await l.api.doCall("/proxy/traffic");I||n(4,S=x)}catch{}finally{C=!1,I||(A=setTimeout($,5e3))}}},j=(x,me)=>(x||[]).map((ee,ke)=>({id:me+ke,key:ee.key,count:M(ee.count)})),Q=(x,me,ee)=>Object.entries(x||{}).sort((ke,pe)=>pe[1]-ke[1]).map(([ke,pe])=>({id:ke,key:me[ke]||ke,count:M(pe),share:L(pe,ee)})),le=x=>{n(1,u=x),G()};_n(()=>{D(),$()}),Es(()=>{I=!0,g&&clearTimeout(g),A&&clearTimeout(A),d&&d.destroy()});const oe=x=>le(x.detail);function X(x){ft[x?"unshift":"push"](()=>{h=x,n(3,h)})}const de=(x,me)=>({id:"d"+me,device:x.device||x.ip,count:M(x.count)}),re=x=>({id:x.id,name:x.name,count:M(x.count)});return t.$$.update=()=>{var x;t.$$.dirty[0]&1&&n(5,i=((x=f==null?void 0:f.by_action)==null?void 0:x.block)||0)},[f,u,c,h,S,i,r,o,a,M,L,N,j,Q,le,oe,X,de,re]}class S1e extends De{constructor(e){super(),Re(this,e,T1e,y1e,Ie,{},null,[-1,-1])}}function E1e(t){let e;return{c(){e=q("Alpha")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function M1e(t){let e=t[8](t[3].state)+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&8&&e!==(e=i[8](i[3].state)+"")&&Z(n,e)},d(i){i&&w(n)}}}function O1e(t){let e,n=t[8](t[2].state)+"",i;return{c(){e=q("Grok: "),i=q(n)},m(l,r){y(l,e,r),y(l,i,r)},p(l,r){r&4&&n!==(n=l[8](l[2].state)+"")&&Z(i,n)},d(l){l&&(w(e),w(i))}}}function A1e(t){let e,n=t[8](t[1].state)+"",i;return{c(){e=q("ChatGPT: "),i=q(n)},m(l,r){y(l,e,r),y(l,i,r)},p(l,r){r&2&&n!==(n=l[8](l[1].state)+"")&&Z(i,n)},d(l){l&&(w(e),w(i))}}}function C1e(t){let e=t[8](t[0].state)+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1&&e!==(e=i[8](i[0].state)+"")&&Z(n,e)},d(i){i&&w(n)}}}function L1e(t){let e=t[8](t[4].state)+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[8](i[4].state)+"")&&Z(n,e)},d(i){i&&w(n)}}}function I1e(t){let e,n,i,l,r,s,o,a,u=t[5]("Work in progress. Remote vision APIs are too slow to block every image on the request path; scanning strategy is still being decided.")+"",f,c,d,h,g,_,v=t[5]("Image filtering")+"",S,A,C,I,M,L,N,z=t[5]("Use a vision model to classify images that pass through the MITM proxy (NSFW / not safe for work). HTTPS inspection must be enabled or the proxy never sees the image bytes.")+"",W,D,G,$,j,Q,le,oe,X=t[5]("API keys")+"",de,re,x,me,ee,ke,pe,Fe,Ve=t[5]("Keys are stored in GateSentry settings on the server. They are never sent to the browser except to this admin page. Use the provider that matches the radio above.")+"",Ee,We,ge,ve,be,ue,nt,Oe,dt,yt,at,ut,At,xe,mt,we=t[5]("Local LLM (Ollama)")+"",gt,It,Ht,Wt,qt,Xt,Ce,se=t[5]("Used when Enable Local LLM is selected. Point this at an Ollama HTTP API. Scanning is not live in the proxy yet (Alpha).")+"",Le,_t,zt,Be,Ot,kt,Pt,Ye,ze,Qe,He,Tt=t[5]("Legacy local scanner")+"",Bt,qn,li,di,hi,Mi,wi,Ri=t[5]("Optional. The original GateSentry AI path posted image bytes to a local classifier URL. It is not used when Grok or ChatGPT is selected.")+"",Zi,ur,Kn,Rn;return n=new fq({props:{size:24}}),s=new Vt({props:{type:"red",size:"sm",$$slots:{default:[E1e]},$$scope:{ctx:t}}}),I=new Vt({props:{type:pr(t[3].state),size:"sm",$$slots:{default:[M1e]},$$scope:{ctx:t}}}),G=new tr({props:{keyName:"ai_image_filtering_mode",title:t[5]("AI image filtering"),labelText:t[5]("AI image filtering"),type:"radio",helperText:"",orientation:"horizontal",radioOptions:t[6],onSaved:t[7]}}),me=new Vt({props:{type:pr(t[2].state),size:"sm",title:t[2].detail,$$slots:{default:[O1e]},$$scope:{ctx:t}}}),ke=new Vt({props:{type:pr(t[1].state),size:"sm",title:t[1].detail,$$slots:{default:[A1e]},$$scope:{ctx:t}}}),ve=new tr({props:{keyName:"ai_grok_api_key",title:t[5]("Grok API key"),labelText:t[5]("Grok API key"),type:"password",helperText:t[5]("xAI / Grok key from console.x.ai. Used when Enable Grok is selected."),onSaved:t[7]}}),ue=new tr({props:{keyName:"ai_grok_model",title:t[5]("Grok model"),labelText:t[5]("Grok model"),type:"text",helperText:t[5]("Vision model id. Empty uses grok-4.5."),onSaved:t[7]}}),Oe=new tr({props:{keyName:"ai_openai_api_key",title:t[5]("OpenAI API key"),labelText:t[5]("OpenAI API key"),type:"password",helperText:t[5]("OpenAI key. Used when Enable ChatGPT is selected."),onSaved:t[7]}}),yt=new tr({props:{keyName:"ai_openai_model",title:t[5]("ChatGPT model"),labelText:t[5]("ChatGPT model"),type:"text",helperText:t[5]("Vision model id. Empty uses gpt-4o-mini."),onSaved:t[7]}}),Wt=new Vt({props:{type:pr(t[0].state),size:"sm",$$slots:{default:[C1e]},$$scope:{ctx:t}}}),Be=new tr({props:{keyName:"ai_local_llm_url",title:t[5]("Local LLM URL"),labelText:t[5]("Local LLM URL"),type:"text",helperText:t[5]("Ollama base URL, for example http://127.0.0.1:11434"),onSaved:t[7]}}),kt=new tr({props:{keyName:"ai_local_llm_model",title:t[5]("Ollama model"),labelText:t[5]("Ollama model"),type:"text",helperText:t[5]("Vision model tag, for example gemma4:e4b-mlx. Empty uses llava."),onSaved:t[7]}}),di=new Vt({props:{type:pr(t[4].state),size:"sm",$$slots:{default:[L1e]},$$scope:{ctx:t}}}),Kn=new tr({props:{keyName:"ai_scanner_url",title:t[5]("AI Service URL"),labelText:t[5]("AI Service URL"),type:"text",helperText:t[5]("HTTP endpoint that accepts a multipart image upload. Leave empty unless you run a local scanner."),onSaved:t[7]}}),{c(){e=R("div"),F(n.$$.fragment),i=B(),l=R("h2"),l.textContent="Gatesentry AI",r=B(),F(s.$$.fragment),o=B(),a=R("p"),f=q(u),c=B(),d=R("section"),h=R("div"),g=R("div"),_=R("h5"),S=q(v),A=B(),C=R("span"),F(I.$$.fragment),L=B(),N=R("p"),W=q(z),D=B(),F(G.$$.fragment),$=B(),j=R("section"),Q=R("div"),le=R("div"),oe=R("h5"),de=q(X),re=B(),x=R("span"),F(me.$$.fragment),ee=B(),F(ke.$$.fragment),pe=B(),Fe=R("p"),Ee=q(Ve),We=B(),ge=R("div"),F(ve.$$.fragment),be=B(),F(ue.$$.fragment),nt=B(),F(Oe.$$.fragment),dt=B(),F(yt.$$.fragment),at=B(),ut=R("section"),At=R("div"),xe=R("div"),mt=R("h5"),gt=q(we),It=B(),Ht=R("span"),F(Wt.$$.fragment),Xt=B(),Ce=R("p"),Le=q(se),_t=B(),zt=R("div"),F(Be.$$.fragment),Ot=B(),F(kt.$$.fragment),Pt=B(),Ye=R("section"),ze=R("div"),Qe=R("div"),He=R("h5"),Bt=q(Tt),qn=B(),li=R("span"),F(di.$$.fragment),Mi=B(),wi=R("p"),Zi=q(Ri),ur=B(),F(Kn.$$.fragment),P(e,"class","gs-page-title"),P(a,"class","gs-page-info"),P(_,"class","svelte-16pcwyt"),P(C,"class","card-status svelte-16pcwyt"),P(C,"title",M=t[3].detail),P(g,"class","card-header svelte-16pcwyt"),P(N,"class","card-copy svelte-16pcwyt"),P(h,"class","gs-card settings-card svelte-16pcwyt"),P(d,"class","gs-section"),P(oe,"class","svelte-16pcwyt"),P(x,"class","card-status svelte-16pcwyt"),P(le,"class","card-header svelte-16pcwyt"),P(Fe,"class","card-copy svelte-16pcwyt"),P(ge,"class","card-fields svelte-16pcwyt"),P(Q,"class","gs-card settings-card svelte-16pcwyt"),P(j,"class","gs-section"),P(mt,"class","svelte-16pcwyt"),P(Ht,"class","card-status svelte-16pcwyt"),P(Ht,"title",qt=t[0].detail),P(xe,"class","card-header svelte-16pcwyt"),P(Ce,"class","card-copy svelte-16pcwyt"),P(zt,"class","card-fields svelte-16pcwyt"),P(At,"class","gs-card settings-card svelte-16pcwyt"),P(ut,"class","gs-section"),P(He,"class","svelte-16pcwyt"),P(li,"class","card-status svelte-16pcwyt"),P(li,"title",hi=t[4].detail),P(Qe,"class","card-header svelte-16pcwyt"),P(wi,"class","card-copy svelte-16pcwyt"),P(ze,"class","gs-card settings-card svelte-16pcwyt"),P(Ye,"class","gs-section")},m(lt,St){y(lt,e,St),H(n,e,null),T(e,i),T(e,l),T(e,r),H(s,e,null),y(lt,o,St),y(lt,a,St),T(a,f),y(lt,c,St),y(lt,d,St),T(d,h),T(h,g),T(g,_),T(_,S),T(g,A),T(g,C),H(I,C,null),T(h,L),T(h,N),T(N,W),T(h,D),H(G,h,null),y(lt,$,St),y(lt,j,St),T(j,Q),T(Q,le),T(le,oe),T(oe,de),T(le,re),T(le,x),H(me,x,null),T(x,ee),H(ke,x,null),T(Q,pe),T(Q,Fe),T(Fe,Ee),T(Q,We),T(Q,ge),H(ve,ge,null),T(ge,be),H(ue,ge,null),T(ge,nt),H(Oe,ge,null),T(ge,dt),H(yt,ge,null),y(lt,at,St),y(lt,ut,St),T(ut,At),T(At,xe),T(xe,mt),T(mt,gt),T(xe,It),T(xe,Ht),H(Wt,Ht,null),T(At,Xt),T(At,Ce),T(Ce,Le),T(At,_t),T(At,zt),H(Be,zt,null),T(zt,Ot),H(kt,zt,null),y(lt,Pt,St),y(lt,Ye,St),T(Ye,ze),T(ze,Qe),T(Qe,He),T(He,Bt),T(Qe,qn),T(Qe,li),H(di,li,null),T(ze,Mi),T(ze,wi),T(wi,Zi),T(ze,ur),H(Kn,ze,null),Rn=!0},p(lt,[St]){const Dn={};St&4194304&&(Dn.$$scope={dirty:St,ctx:lt}),s.$set(Dn),(!Rn||St&32)&&u!==(u=lt[5]("Work in progress. Remote vision APIs are too slow to block every image on the request path; scanning strategy is still being decided.")+"")&&Z(f,u),(!Rn||St&32)&&v!==(v=lt[5]("Image filtering")+"")&&Z(S,v);const Hn={};St&8&&(Hn.type=pr(lt[3].state)),St&4194312&&(Hn.$$scope={dirty:St,ctx:lt}),I.$set(Hn),(!Rn||St&8&&M!==(M=lt[3].detail))&&P(C,"title",M),(!Rn||St&32)&&z!==(z=lt[5]("Use a vision model to classify images that pass through the MITM proxy (NSFW / not safe for work). HTTPS inspection must be enabled or the proxy never sees the image bytes.")+"")&&Z(W,z);const Ll={};St&32&&(Ll.title=lt[5]("AI image filtering")),St&32&&(Ll.labelText=lt[5]("AI image filtering")),G.$set(Ll),(!Rn||St&32)&&X!==(X=lt[5]("API keys")+"")&&Z(de,X);const mi={};St&4&&(mi.type=pr(lt[2].state)),St&4&&(mi.title=lt[2].detail),St&4194308&&(mi.$$scope={dirty:St,ctx:lt}),me.$set(mi);const Un={};St&2&&(Un.type=pr(lt[1].state)),St&2&&(Un.title=lt[1].detail),St&4194306&&(Un.$$scope={dirty:St,ctx:lt}),ke.$set(Un),(!Rn||St&32)&&Ve!==(Ve=lt[5]("Keys are stored in GateSentry settings on the server. They are never sent to the browser except to this admin page. Use the provider that matches the radio above.")+"")&&Z(Ee,Ve);const tn={};St&32&&(tn.title=lt[5]("Grok API key")),St&32&&(tn.labelText=lt[5]("Grok API key")),St&32&&(tn.helperText=lt[5]("xAI / Grok key from console.x.ai. Used when Enable Grok is selected.")),ve.$set(tn);const Tn={};St&32&&(Tn.title=lt[5]("Grok model")),St&32&&(Tn.labelText=lt[5]("Grok model")),St&32&&(Tn.helperText=lt[5]("Vision model id. Empty uses grok-4.5.")),ue.$set(Tn);const pn={};St&32&&(pn.title=lt[5]("OpenAI API key")),St&32&&(pn.labelText=lt[5]("OpenAI API key")),St&32&&(pn.helperText=lt[5]("OpenAI key. Used when Enable ChatGPT is selected.")),Oe.$set(pn);const ml={};St&32&&(ml.title=lt[5]("ChatGPT model")),St&32&&(ml.labelText=lt[5]("ChatGPT model")),St&32&&(ml.helperText=lt[5]("Vision model id. Empty uses gpt-4o-mini.")),yt.$set(ml),(!Rn||St&32)&&we!==(we=lt[5]("Local LLM (Ollama)")+"")&&Z(gt,we);const gl={};St&1&&(gl.type=pr(lt[0].state)),St&4194305&&(gl.$$scope={dirty:St,ctx:lt}),Wt.$set(gl),(!Rn||St&1&&qt!==(qt=lt[0].detail))&&P(Ht,"title",qt),(!Rn||St&32)&&se!==(se=lt[5]("Used when Enable Local LLM is selected. Point this at an Ollama HTTP API. Scanning is not live in the proxy yet (Alpha).")+"")&&Z(Le,se);const ri={};St&32&&(ri.title=lt[5]("Local LLM URL")),St&32&&(ri.labelText=lt[5]("Local LLM URL")),St&32&&(ri.helperText=lt[5]("Ollama base URL, for example http://127.0.0.1:11434")),Be.$set(ri);const Sn={};St&32&&(Sn.title=lt[5]("Ollama model")),St&32&&(Sn.labelText=lt[5]("Ollama model")),St&32&&(Sn.helperText=lt[5]("Vision model tag, for example gemma4:e4b-mlx. Empty uses llava.")),kt.$set(Sn),(!Rn||St&32)&&Tt!==(Tt=lt[5]("Legacy local scanner")+"")&&Z(Bt,Tt);const Di={};St&16&&(Di.type=pr(lt[4].state)),St&4194320&&(Di.$$scope={dirty:St,ctx:lt}),di.$set(Di),(!Rn||St&16&&hi!==(hi=lt[4].detail))&&P(li,"title",hi),(!Rn||St&32)&&Ri!==(Ri=lt[5]("Optional. The original GateSentry AI path posted image bytes to a local classifier URL. It is not used when Grok or ChatGPT is selected.")+"")&&Z(Zi,Ri);const el={};St&32&&(el.title=lt[5]("AI Service URL")),St&32&&(el.labelText=lt[5]("AI Service URL")),St&32&&(el.helperText=lt[5]("HTTP endpoint that accepts a multipart image upload. Leave empty unless you run a local scanner.")),Kn.$set(el)},i(lt){Rn||(b(n.$$.fragment,lt),b(s.$$.fragment,lt),b(I.$$.fragment,lt),b(G.$$.fragment,lt),b(me.$$.fragment,lt),b(ke.$$.fragment,lt),b(ve.$$.fragment,lt),b(ue.$$.fragment,lt),b(Oe.$$.fragment,lt),b(yt.$$.fragment,lt),b(Wt.$$.fragment,lt),b(Be.$$.fragment,lt),b(kt.$$.fragment,lt),b(di.$$.fragment,lt),b(Kn.$$.fragment,lt),Rn=!0)},o(lt){k(n.$$.fragment,lt),k(s.$$.fragment,lt),k(I.$$.fragment,lt),k(G.$$.fragment,lt),k(me.$$.fragment,lt),k(ke.$$.fragment,lt),k(ve.$$.fragment,lt),k(ue.$$.fragment,lt),k(Oe.$$.fragment,lt),k(yt.$$.fragment,lt),k(Wt.$$.fragment,lt),k(Be.$$.fragment,lt),k(kt.$$.fragment,lt),k(di.$$.fragment,lt),k(Kn.$$.fragment,lt),Rn=!1},d(lt){lt&&(w(e),w(o),w(a),w(c),w(d),w($),w(j),w(at),w(ut),w(Pt),w(Ye)),U(n),U(s),U(I),U(G),U(me),U(ke),U(ve),U(ue),U(Oe),U(yt),U(Wt),U(Be),U(kt),U(di),U(Kn)}}}function LM(t){if(!t||typeof t!="object")return"";const e=t.Value!=null?t.Value:t.value;return String(e||"").trim()}function Qf(t){return t&&typeof t=="object"&&t.Configured!=null?!!t.Configured:LM(t)!==""}function R1e(t,e){return Promise.race([t,new Promise((n,i)=>setTimeout(()=>i(new Error("status timeout")),e))])}function pr(t){switch(t){case"ok":return"green";case"unauthorized":return"magenta";case"unreachable":return"red";case"disabled":case"not_configured":return"gray";case"checking":return"cool-gray";default:return"gray"}}function D1e(t,e,n){let i,l,r,s,o,a,u;Mt(t,ii,W=>n(5,a=W)),Mt(t,An,W=>n(16,u=W));const f=[{value:"disabled",label:a("Disable")},{value:"grok",label:a("Enable Grok")},{value:"chatgpt",label:a("Enable ChatGPT")},{value:"local",label:a("Enable Local LLM")}],c={state:"checking",detail:""},d={state:"not_configured",detail:""};let h=null,g=!1,_="disabled",v=!1,S=!1,A=!1,C=!1;async function I(){try{const[W,D,G,$,j]=await Promise.all([u.api.getSetting("ai_image_filtering_mode"),u.api.getSetting("ai_grok_api_key"),u.api.getSetting("ai_openai_api_key"),u.api.getSetting("ai_local_llm_url"),u.api.getSetting("ai_scanner_url")]);n(11,_=LM(W)||"disabled"),n(12,v=Qf(D)),n(13,S=Qf(G)),n(14,A=Qf($)),n(15,C=Qf(j))}catch{}}async function M(){n(10,g=!0);try{await I();const W=await R1e(u.api.doCall("/ai/status"),12e3);W&&W.grok&&(n(9,h=W),W.mode&&n(11,_=W.mode))}catch{n(9,h=null)}finally{n(10,g=!1)}}function L(W,D,G,$){return D&&D[W]&&D[W].state?D[W]:$?G?c:{state:"unreachable",detail:"Status check did not complete"}:d}function N(W,D,G,$,j){const Q=W&&W.mode||D||"disabled";return Q==="disabled"?{state:"disabled",detail:"Image filtering is off"}:Q==="grok"?G:Q==="chatgpt"?$:Q==="local"?j:d}function z(W){switch(W){case"ok":return a("Reachable");case"unauthorized":return a("Invalid key");case"unreachable":return a("Unreachable");case"not_configured":return a("Not configured");case"disabled":return a("Disabled");case"checking":return a("Checking…");default:return W}}return _n(async()=>{await I(),await M()}),t.$$.update=()=>{t.$$.dirty&5632&&n(2,i=L("grok",h,g,v)),t.$$.dirty&9728&&n(1,l=L("chatgpt",h,g,S)),t.$$.dirty&17920&&n(0,r=L("local",h,g,A)),t.$$.dirty&34304&&n(4,s=L("legacy",h,g,C)),t.$$.dirty&2567&&n(3,o=N(h,_,i,l,r))},[r,l,i,o,s,a,f,M,z,h,g,_,v,S,A,C]}class P1e extends De{constructor(e){super(),Re(this,e,D1e,I1e,Ie,{})}}function b6(t){let e,n,i,l;function r(o){t[7](o)}let s={shouldSubmitOnEnter:t[4],hasForm:t[3],modalHeading:t[2],primaryButtonDisabled:!0,$$slots:{default:[N1e]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),n=new gH({props:s}),ft.push(()=>Yt(n,"open",r)),n.$on("close",function(){$s(t[1].close)&&t[1].close.apply(this,arguments)}),{c(){e=R("div"),F(n.$$.fragment),P(e,"class","gatesentry-modal")},m(o,a){y(o,e,a),H(n,e,null),l=!0},p(o,a){t=o;const u={};a&16&&(u.shouldSubmitOnEnter=t[4]),a&8&&(u.hasForm=t[3]),a&4&&(u.modalHeading=t[2]),a&256&&(u.$$scope={dirty:a,ctx:t}),!i&&a&1&&(i=!0,u.open=t[0],jt(()=>i=!1)),n.$set(u)},i(o){l||(b(n.$$.fragment,o),l=!0)},o(o){k(n.$$.fragment,o),l=!1},d(o){o&&w(e),U(n)}}}function N1e(t){let e;const n=t[6].default,i=Ze(n,t,t[8],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&256)&&Ke(i,n,l,l[8],e?Xe(n,l[8],r,null):$e(l[8]),null)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function B1e(t){let e,n,i=t[0]&&b6(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,[r]){l[0]?i?(i.p(l,r),r&1&&b(i,1)):(i=b6(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function z1e(t,e,n){let{$$slots:i={},$$scope:l}=e,{open:r=!1}=e,{on:s={close:()=>{}}}=e,{title:o=""}=e,{children:a=null}=e,{hasForm:u=!1}=e,{shouldSubmitOnEnter:f=!1}=e;function c(d){r=d,n(0,r)}return t.$$set=d=>{"open"in d&&n(0,r=d.open),"on"in d&&n(1,s=d.on),"title"in d&&n(2,o=d.title),"children"in d&&n(5,a=d.children),"hasForm"in d&&n(3,u=d.hasForm),"shouldSubmitOnEnter"in d&&n(4,f=d.shouldSubmitOnEnter),"$$scope"in d&&n(8,l=d.$$scope)},[r,s,o,u,f,a,i,c,l]}class H1e extends De{constructor(e){super(),Re(this,e,z1e,B1e,Ie,{open:0,on:1,title:2,children:5,hasForm:3,shouldSubmitOnEnter:4})}}function U1e(t){let e,n,i,l;return e=new mu({props:{value:"true",labelText:t[4]("Allow access")}}),i=new mu({props:{value:"false",labelText:t[4]("Deny access")}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&16&&(o.labelText=r[4]("Allow access")),e.$set(o);const a={};s&16&&(a.labelText=r[4]("Deny access")),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function F1e(t){let e,n;return e=new Rt({props:{type:"submit",$$slots:{default:[V1e]},$$scope:{ctx:t}}}),e.$on("click",t[5]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8208&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function G1e(t){let e,n;return e=new Rt({props:{type:"submit",$$slots:{default:[W1e]},$$scope:{ctx:t}}}),e.$on("click",t[5]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8208&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function V1e(t){let e=t[4]("Create User")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Create User")+"")&&Z(n,e)},d(i){i&&w(n)}}}function W1e(t){let e=t[4]("Save User")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Save User")+"")&&Z(n,e)},d(i){i&&w(n)}}}function q1e(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S;function A(G){t[7](G)}let C={id:"user",labelText:t[4]("User"),disabled:!!t[0]};t[1]!==void 0&&(C.value=t[1]),e=new Jn({props:C}),ft.push(()=>Yt(e,"value",A));function I(G){t[8](G)}let M={id:"password",labelText:t[4]("Password"),type:"password"};t[2]!==void 0&&(M.value=t[2]),s=new Jn({props:M}),ft.push(()=>Yt(s,"value",I));function L(G){t[9](G)}let N={legendText:"Allow internet access",$$slots:{default:[U1e]},$$scope:{ctx:t}};t[3]!==void 0&&(N.selected=t[3]),c=new HT({props:N}),ft.push(()=>Yt(c,"selected",L));const z=[G1e,F1e],W=[];function D(G,$){return G[0]?0:1}return _=D(t),v=W[_]=z[_](t),{c(){F(e.$$.fragment),i=B(),l=R("br"),r=B(),F(s.$$.fragment),a=B(),u=R("br"),f=B(),F(c.$$.fragment),h=B(),g=R("div"),v.c(),P(g,"class","content-right"),wt(g,"margin-top","10px")},m(G,$){H(e,G,$),y(G,i,$),y(G,l,$),y(G,r,$),H(s,G,$),y(G,a,$),y(G,u,$),y(G,f,$),H(c,G,$),y(G,h,$),y(G,g,$),W[_].m(g,null),S=!0},p(G,$){const j={};$&16&&(j.labelText=G[4]("User")),$&1&&(j.disabled=!!G[0]),!n&&$&2&&(n=!0,j.value=G[1],jt(()=>n=!1)),e.$set(j);const Q={};$&16&&(Q.labelText=G[4]("Password")),!o&&$&4&&(o=!0,Q.value=G[2],jt(()=>o=!1)),s.$set(Q);const le={};$&8208&&(le.$$scope={dirty:$,ctx:G}),!d&&$&8&&(d=!0,le.selected=G[3],jt(()=>d=!1)),c.$set(le);let oe=_;_=D(G),_===oe?W[_].p(G,$):(fe(),k(W[oe],1,1,()=>{W[oe]=null}),ce(),v=W[_],v?v.p(G,$):(v=W[_]=z[_](G),v.c()),b(v,1),v.m(g,null))},i(G){S||(b(e.$$.fragment,G),b(s.$$.fragment,G),b(c.$$.fragment,G),b(v),S=!0)},o(G){k(e.$$.fragment,G),k(s.$$.fragment,G),k(c.$$.fragment,G),k(v),S=!1},d(G){G&&(w(i),w(l),w(r),w(a),w(u),w(f),w(h),w(g)),U(e,G),U(s,G),U(c,G),W[_].d()}}}function j1e(t){let e,n;return e=new RT({props:{$$slots:{default:[q1e]},$$scope:{ctx:t}}}),e.$on("submit",t[5]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&8223&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Y1e(t,e,n){let i,l;Mt(t,An,v=>n(10,i=v)),Mt(t,ii,v=>n(4,l=v));const r=yn();let{showForm:s=!1}=e,{user:o=null}=e,a=(o==null?void 0:o.username)??"",u=(o==null?void 0:o.password)??"",f=o!=null&&o.allowaccess&&o.allowaccess==!0?"true":"false";Es(()=>{n(1,a=""),n(2,u=""),n(3,f="true")});const c=v=>{ci.add(ao({title:l("Error"),subtitle:l("Error : "+v)},l))},d=async v=>{v.preventDefault();try{if(o){const S=await i.api.updateUser({username:a,password:u,allowaccess:f=="true"});S.ok?r("updateuser",{username:a,password:u}):c(S.error);return}else{const S=await i.api.createUser({username:a,password:u,allowaccess:f=="true"});S.ok?r("createuser",{username:a,password:u}):c(S.error)}}catch(S){c(S.message)}};function h(v){a=v,n(1,a)}function g(v){u=v,n(2,u)}function _(v){f=v,n(3,f)}return t.$$set=v=>{"showForm"in v&&n(6,s=v.showForm),"user"in v&&n(0,o=v.user)},[o,a,u,f,l,d,s,h,g,_]}class Z1e extends De{constructor(e){super(),Re(this,e,Y1e,j1e,Ie,{showForm:6,user:0})}}function X1e(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function K1e(t){let e;return{c(){e=q("Users")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function $1e(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[X1e]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[K1e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&1048576&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1048576&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function v6(t){let e,n,i;return n=new K1({}),{c(){e=R("div"),F(n.$$.fragment)},m(l,r){y(l,e,r),H(n,e,null),i=!0},i(l){i||(b(n.$$.fragment,l),i=!0)},o(l){k(n.$$.fragment,l),i=!1},d(l){l&&w(e),U(n)}}}function J1e(t){let e,n;return e=new Z1e({props:{user:t[2]}}),e.$on("createuser",t[8]),e.$on("updateuser",t[9]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4&&(r.user=i[2]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function k6(t){var a;let e,n,i,l,r,s;n=new Rt({props:{size:"small",icon:zu,$$slots:{default:[Q1e]},$$scope:{ctx:t}}}),n.$on("click",t[13]);let o=t[1].length===0&&w6(t);return r=new Ol({props:{headers:[{key:"user",value:t[4]("Name")},{key:"dataconsumed",value:t[4]("Data Consumed")},{key:"allowaccess",value:t[4]("Allow Access")},{key:"actions",value:t[4]("Actions")}],rows:(a=t[1])==null?void 0:a.map(y6),$$slots:{cell:[a0e,({row:u,cell:f})=>({18:u,19:f}),({row:u,cell:f})=>(u?262144:0)|(f?524288:0)]},$$scope:{ctx:t}}}),{c(){e=R("div"),F(n.$$.fragment),i=B(),o&&o.c(),l=B(),F(r.$$.fragment),wt(e,"padding-bottom","10px"),P(e,"class","content-right")},m(u,f){y(u,e,f),H(n,e,null),y(u,i,f),o&&o.m(u,f),y(u,l,f),H(r,u,f),s=!0},p(u,f){var h;const c={};f&1048592&&(c.$$scope={dirty:f,ctx:u}),n.$set(c),u[1].length===0?o?o.p(u,f):(o=w6(u),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null);const d={};f&16&&(d.headers=[{key:"user",value:u[4]("Name")},{key:"dataconsumed",value:u[4]("Data Consumed")},{key:"allowaccess",value:u[4]("Allow Access")},{key:"actions",value:u[4]("Actions")}]),f&2&&(d.rows=(h=u[1])==null?void 0:h.map(y6)),f&1835032&&(d.$$scope={dirty:f,ctx:u}),r.$set(d)},i(u){s||(b(n.$$.fragment,u),b(r.$$.fragment,u),s=!0)},o(u){k(n.$$.fragment,u),k(r.$$.fragment,u),s=!1},d(u){u&&(w(e),w(i),w(l)),U(n),o&&o.d(u),U(r,u)}}}function Q1e(t){let e=t[4]("Add User")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Add User")+"")&&Z(n,e)},d(i){i&&w(n)}}}function w6(t){let e,n=t[4]("No users registered yet.")+"",i;return{c(){e=R("div"),i=q(n)},m(l,r){y(l,e,r),T(e,i)},p(l,r){r&16&&n!==(n=l[4]("No users registered yet.")+"")&&Z(i,n)},d(l){l&&w(e)}}}function x1e(t){let e=t[19].value+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&524288&&e!==(e=i[19].value+"")&&Z(n,e)},i:he,o:he,d(i){i&&w(n)}}}function e0e(t){let e=Pk(t[19].value)+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&524288&&e!==(e=Pk(i[19].value)+"")&&Z(n,e)},i:he,o:he,d(i){i&&w(n)}}}function t0e(t){let e,n,i,l,r,s,o,a;function u(){return t[14](t[18])}n=new Rt({props:{size:"small",icon:dd,iconDescription:t[4]("Delete"),$$slots:{default:[n0e]},$$scope:{ctx:t}}}),n.$on("click",u);function f(){return t[15](t[18])}l=new Rt({props:{size:"small",icon:xs,iconDescription:t[4]("Edit User"),$$slots:{default:[i0e]},$$scope:{ctx:t}}}),l.$on("click",f);const c=[r0e,l0e],d=[];function h(g,_){return g[18].allowaccess?0:1}return s=h(t),o=d[s]=c[s](t),{c(){e=R("div"),F(n.$$.fragment),i=B(),F(l.$$.fragment),r=B(),o.c(),wt(e,"float","right")},m(g,_){y(g,e,_),H(n,e,null),T(e,i),H(l,e,null),T(e,r),d[s].m(e,null),a=!0},p(g,_){t=g;const v={};_&16&&(v.iconDescription=t[4]("Delete")),_&1048592&&(v.$$scope={dirty:_,ctx:t}),n.$set(v);const S={};_&16&&(S.iconDescription=t[4]("Edit User")),_&1048592&&(S.$$scope={dirty:_,ctx:t}),l.$set(S);let A=s;s=h(t),s===A?d[s].p(t,_):(fe(),k(d[A],1,1,()=>{d[A]=null}),ce(),o=d[s],o?o.p(t,_):(o=d[s]=c[s](t),o.c()),b(o,1),o.m(e,null))},i(g){a||(b(n.$$.fragment,g),b(l.$$.fragment,g),b(o),a=!0)},o(g){k(n.$$.fragment,g),k(l.$$.fragment,g),k(o),a=!1},d(g){g&&w(e),U(n),U(l),d[s].d()}}}function n0e(t){let e=t[4]("Delete")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Delete")+"")&&Z(n,e)},d(i){i&&w(n)}}}function i0e(t){let e=t[4]("Edit User")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Edit User")+"")&&Z(n,e)},d(i){i&&w(n)}}}function l0e(t){let e,n;function i(){return t[17](t[18])}return e=new Rt({props:{size:"small",icon:$1,iconDescription:t[4]("Enable Internet Access"),$$slots:{default:[s0e]},$$scope:{ctx:t}}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&16&&(s.iconDescription=t[4]("Enable Internet Access")),r&1048592&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function r0e(t){let e,n;function i(){return t[16](t[18])}return e=new Rt({props:{size:"small",icon:Pq,iconDescription:t[4]("Disable Internet Access"),$$slots:{default:[o0e]},$$scope:{ctx:t}}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&16&&(s.iconDescription=t[4]("Disable Internet Access")),r&1048592&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function s0e(t){let e=t[4]("Enable Internet Access")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Enable Internet Access")+"")&&Z(n,e)},d(i){i&&w(n)}}}function o0e(t){let e=t[4]("Disable Internet Access")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Disable Internet Access")+"")&&Z(n,e)},d(i){i&&w(n)}}}function a0e(t){let e,n,i,l;const r=[t0e,e0e,x1e],s=[];function o(a,u){return a[19].key==="actions"?0:a[19].key==="dataconsumed"?1:2}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function u0e(t){let e,n,i,l=t[4]("Users")+"",r,s,o,a,u,f,c,d,h,g,_,v;e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[$1e]},$$scope:{ctx:t}}});let S=!t[1]&&v6();function A(M){t[11](M)}let C={shouldSubmitOnEnter:!0,hasForm:!0,title:t[2]!=null?t[4]("Edit User"):t[4]("Add User"),$$slots:{default:[J1e]},$$scope:{ctx:t}};t[0]!==void 0&&(C.open=t[0]),f=new H1e({props:C}),ft.push(()=>Yt(f,"open",A)),f.$on("close",t[12]),h=new tr({props:{keyName:"EnableUsers",type:"radio",title:t[4]("Allow only registered users to access the proxy server"),labelText:t[4]("Allow only registered users to access the proxy server"),helperText:""}});let I=t[1]&&k6(t);return{c(){F(e.$$.fragment),n=B(),i=R("h2"),r=q(l),s=B(),o=R("br"),a=B(),S&&S.c(),u=B(),F(f.$$.fragment),d=B(),F(h.$$.fragment),g=B(),I&&I.c(),_=qe()},m(M,L){H(e,M,L),y(M,n,L),y(M,i,L),T(i,r),y(M,s,L),y(M,o,L),y(M,a,L),S&&S.m(M,L),y(M,u,L),H(f,M,L),y(M,d,L),H(h,M,L),y(M,g,L),I&&I.m(M,L),y(M,_,L),v=!0},p(M,[L]){const N={};L&1048576&&(N.$$scope={dirty:L,ctx:M}),e.$set(N),(!v||L&16)&&l!==(l=M[4]("Users")+"")&&Z(r,l),M[1]?S&&(fe(),k(S,1,1,()=>{S=null}),ce()):S?L&2&&b(S,1):(S=v6(),S.c(),b(S,1),S.m(u.parentNode,u));const z={};L&20&&(z.title=M[2]!=null?M[4]("Edit User"):M[4]("Add User")),L&1048580&&(z.$$scope={dirty:L,ctx:M}),!c&&L&1&&(c=!0,z.open=M[0],jt(()=>c=!1)),f.$set(z);const W={};L&16&&(W.title=M[4]("Allow only registered users to access the proxy server")),L&16&&(W.labelText=M[4]("Allow only registered users to access the proxy server")),h.$set(W),M[1]?I?(I.p(M,L),L&2&&b(I,1)):(I=k6(M),I.c(),b(I,1),I.m(_.parentNode,_)):I&&(fe(),k(I,1,1,()=>{I=null}),ce())},i(M){v||(b(e.$$.fragment,M),b(S),b(f.$$.fragment,M),b(h.$$.fragment,M),b(I),v=!0)},o(M){k(e.$$.fragment,M),k(S),k(f.$$.fragment,M),k(h.$$.fragment,M),k(I),v=!1},d(M){M&&(w(n),w(i),w(s),w(o),w(a),w(u),w(d),w(g),w(_)),U(e,M),S&&S.d(M),U(f,M),U(h,M),I&&I.d(M)}}}const y6=t=>({id:t.username,user:t.username,dataconsumed:t.dataconsumed,allowaccess:t.allowaccess});function f0e(t,e,n){let i,l;Mt(t,An,M=>n(3,i=M)),Mt(t,ii,M=>n(4,l=M));let r=!1,s=null,o=null;const a=async()=>{n(1,s=null),n(1,s=(await i.api.getUsers()).users??[])};_n(a);const u=M=>{n(2,o=s==null?void 0:s.find(L=>L.username===M)),n(0,r=!0)},f=async M=>{confirm(l("Are you sure you want to delete this user?"))&&(await i.api.deleteUser(M),await a())},c=async M=>{n(0,r=!1),await a()},d=async M=>{n(0,r=!1),await a()},h=()=>{n(2,o=null),n(0,r=!0)};function g(M){r=M,n(0,r)}return[r,s,o,i,l,a,u,f,c,d,h,g,()=>{n(0,r=!1),n(2,o=null)},()=>{h()},M=>f(M.id),M=>u(M.id),async M=>{await i.api.updateUser({username:M.id,password:"",allowaccess:!1}),a()},async M=>{await i.api.updateUser({username:M.id,password:"",allowaccess:!0}),a()}]}class c0e extends De{constructor(e){super(),Re(this,e,f0e,u0e,Ie,{})}}function d0e(t){let e,n,i,l;return e=new jZ({}),i=new cX({props:{userProfilePanelOpen:t[1]}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&2&&(o.userProfilePanelOpen=r[1]),i.$set(o)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function h0e(t){let e,n;return e=new $V({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function m0e(t){let e,n,i;function l(s){t[3](s)}let r={company:"Gatesentry",platformName:t[2],persistentHamburgerMenu:!0,$$slots:{"skip-to-content":[h0e],default:[d0e]},$$scope:{ctx:t}};return t[0]!==void 0&&(r.isSideNavOpen=t[0]),e=new RG({props:r}),ft.push(()=>Yt(e,"isSideNavOpen",l)),{c(){F(e.$$.fragment)},m(s,o){H(e,s,o),i=!0},p(s,[o]){const a={};o&4&&(a.platformName=s[2]),o&34&&(a.$$scope={dirty:o,ctx:s}),!n&&o&1&&(n=!0,a.isSideNavOpen=s[0],jt(()=>n=!1)),e.$set(a)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){U(e,s)}}}function g0e(t,e,n){let i;Mt(t,An,a=>n(4,i=a));let{isSideNavOpen:l=!1}=e,{userProfilePanelOpen:r=!1}=e,s="";_n(async()=>{const a=await i.api.doCall("/about");n(2,s=a.version)});function o(a){l=a,n(0,l)}return t.$$set=a=>{"isSideNavOpen"in a&&n(0,l=a.isSideNavOpen),"userProfilePanelOpen"in a&&n(1,r=a.userProfilePanelOpen)},[l,r,s,o]}class _0e extends De{constructor(e){super(),Re(this,e,g0e,m0e,Ie,{isSideNavOpen:0,userProfilePanelOpen:1})}}function T6(t,e,n){const i=t.slice();return i[7]=e[n],i}function S6(t){let e,n=t[7].description+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","category-note svelte-1orxodp")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r&1&&n!==(n=l[7].description+"")&&Z(i,n)},d(l){l&&w(e)}}}function E6(t,e){let n,i,l,r,s,o=M6(e[7])+"",a,u,f,c;function d(...g){return e[5](e[7],...g)}l=new yT({props:{labelText:e[7].name,checked:e[1].includes(e[7].id),disabled:e[2]}}),l.$on("check",d);let h=!e[3]&&S6(e);return{key:t,first:null,c(){n=R("div"),i=R("div"),F(l.$$.fragment),r=B(),s=R("span"),a=q(o),u=B(),h&&h.c(),f=B(),P(s,"class","category-count svelte-1orxodp"),P(i,"class","category-line svelte-1orxodp"),P(n,"class","category-item svelte-1orxodp"),this.first=n},m(g,_){y(g,n,_),T(n,i),H(l,i,null),T(i,r),T(i,s),T(s,a),T(n,u),h&&h.m(n,null),T(n,f),c=!0},p(g,_){e=g;const v={};_&1&&(v.labelText=e[7].name),_&3&&(v.checked=e[1].includes(e[7].id)),_&4&&(v.disabled=e[2]),l.$set(v),(!c||_&1)&&o!==(o=M6(e[7])+"")&&Z(a,o),e[3]?h&&(h.d(1),h=null):h?h.p(e,_):(h=S6(e),h.c(),h.m(n,f))},i(g){c||(b(l.$$.fragment,g),c=!0)},o(g){k(l.$$.fragment,g),c=!1},d(g){g&&w(n),U(l),h&&h.d()}}}function p0e(t){let e,n=[],i=new Map,l,r=ct(t[0]);const s=o=>o[7].id;for(let o=0;od!==f))}const u=(f,c)=>a(f.id,c.detail);return t.$$set=f=>{"categories"in f&&n(0,i=f.categories),"selection"in f&&n(1,l=f.selection),"disabled"in f&&n(2,r=f.disabled),"compact"in f&&n(3,s=f.compact)},[i,l,r,s,a,u]}class tg extends De{constructor(e){super(),Re(this,e,b0e,p0e,Ie,{categories:0,selection:1,disabled:2,compact:3})}}function O6(t,e,n){const i=t.slice();return i[10]=e[n],i}function v0e(t){let e;return{c(){e=q("Add")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function A6(t){let e,n=[],i=new Map,l,r=ct(t[0]);const s=o=>o[10];for(let o=0;oYt(n,"value",u)),n.$on("keydown",t[7]),r=new Rt({props:{size:"small",kind:"tertiary",$$slots:{default:[v0e]},$$scope:{ctx:t}}}),r.$on("click",t[4]);let c=t[0].length&&A6(t);return{c(){e=R("div"),F(n.$$.fragment),l=B(),F(r.$$.fragment),s=B(),c&&c.c(),o=qe(),P(e,"class","list-entry svelte-cz2jd")},m(d,h){y(d,e,h),H(n,e,null),T(e,l),H(r,e,null),y(d,s,h),c&&c.m(d,h),y(d,o,h),a=!0},p(d,[h]){const g={};h&2&&(g.labelText=d[1]),!i&&h&8&&(i=!0,g.value=d[3],jt(()=>i=!1)),n.$set(g);const _={};h&8192&&(_.$$scope={dirty:h,ctx:d}),r.$set(_),d[0].length?c?(c.p(d,h),h&1&&b(c,1)):(c=A6(d),c.c(),b(c,1),c.m(o.parentNode,o)):c&&(fe(),k(c,1,1,()=>{c=null}),ce())},i(d){a||(b(n.$$.fragment,d),b(r.$$.fragment,d),b(c),a=!0)},o(d){k(n.$$.fragment,d),k(r.$$.fragment,d),k(c),a=!1},d(d){d&&(w(e),w(s),w(o)),U(n),U(r),c&&c.d(d)}}}function y0e(t){let e=t.trim().toLowerCase();const n=e.indexOf("://");return n>=0&&(e=e.slice(n+3)),e=e.split(/[/?#]/)[0].replace(/:\d+$/,"").replace(/\.$/,""),e}function T0e(t,e,n){let{entries:i=[]}=e,{label:l="Domain"}=e,{tagType:r="outline"}=e;const s=yn();let o="";function a(){const h=o.split(/[\s,]+/).map(y0e).filter(Boolean),g=[...i];for(const _ of h)g.includes(_)||g.push(_);n(3,o=""),g.length!==i.length&&s("change",g)}function u(h){s("change",i.filter(g=>g!==h))}function f(h){o=h,n(3,o)}const c=h=>h.key==="Enter"&&a(),d=h=>u(h);return t.$$set=h=>{"entries"in h&&n(0,i=h.entries),"label"in h&&n(1,l=h.label),"tagType"in h&&n(2,r=h.tagType)},[i,l,r,o,a,u,f,c,d]}class ng extends De{constructor(e){super(),Re(this,e,T0e,w0e,Ie,{entries:0,label:1,tagType:2})}}const ol="default",IM=[{id:"0",text:"Sunday"},{id:"1",text:"Monday"},{id:"2",text:"Tuesday"},{id:"3",text:"Wednesday"},{id:"4",text:"Thursday"},{id:"5",text:"Friday"},{id:"6",text:"Saturday"}],S0e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],V1="custom";function Rm(){return{id:"",name:"",description:"",blocked_categories:[],blocked_domains:[],allowed_domains:[],rules:[],safe_search:!1,users:[],priority:0}}function RM(){return{id:"",name:"",enabled:!0,action:"block",target:{all_traffic:!1,domains:[],categories:[]},url_regexes:[],blocked_content_types:[],schedule:null,users:[],domain_draft:"",url_draft:"",content_type_draft:""}}function E0e(t){return t?{timezone:t.timezone||"UTC",weekdays:[...t.weekdays||[]],windows:(t.windows||[]).map(e=>({from:e.from,to:e.to})),...t.preset?{preset:t.preset}:{}}:null}function M0e(t){var e,n,i;return{id:t.id||"",name:t.name||"",enabled:t.enabled!==!1,action:t.action==="allow"?"allow":"block",target:{all_traffic:!!((e=t.target)!=null&&e.all_traffic),domains:[...((n=t.target)==null?void 0:n.domains)||[]],categories:[...((i=t.target)==null?void 0:i.categories)||[]]},url_regexes:[...t.url_regexes||[]],blocked_content_types:[...t.blocked_content_types||[]],schedule:E0e(t.schedule),users:[...t.users||[]],domain_draft:"",url_draft:"",content_type_draft:""}}function xf(t){return{id:t.id||"",name:t.name||"",description:t.description||"",blocked_categories:[...t.blocked_categories||[]],blocked_domains:[...t.blocked_domains||[]],allowed_domains:[...t.allowed_domains||[]],rules:(t.rules||[]).map(M0e),safe_search:!!t.safe_search,users:[...t.users||[]],priority:t.priority||0}}function O0e(t){return{id:t.id,name:t.name.trim(),description:t.description,blocked_categories:t.blocked_categories,blocked_domains:t.blocked_domains,allowed_domains:t.allowed_domains,safe_search:t.safe_search,users:t.users,priority:t.priority,rules:t.rules.map(e=>({id:e.id,name:e.name.trim(),enabled:e.enabled,action:e.action,target:e.target,url_regexes:e.url_regexes,blocked_content_types:e.blocked_content_types,schedule:e.schedule,users:e.users}))}}function A0e(t){return!(t!=null&&t.length)||t.length>=7?"":[...t].sort((e,n)=>e-n).map(e=>S0e[e]).filter(Boolean).join(", ")}function sd(t){if(!t)return"Always";const e=(t.windows||[]).map(i=>i.from+"-"+i.to).join(", "),n=A0e(t.weekdays);return e+(n?" "+n:" every day")}function C0e(t,e){if(t.all_traffic)return"all traffic";const n=[...t.categories.map(e),...t.domains];return n.length?n.length>3?n.slice(0,3).join(", ")+" and "+(n.length-3)+" more":n.join(", "):"nothing yet"}function L6(t,e){let n=(t.action==="allow"?"Allow ":"Block ")+C0e(t.target,e);return t.url_regexes.length&&(n+=" when the URL matches "+t.url_regexes.join(" or ")),t.blocked_content_types.length&&(n+=(t.url_regexes.length?" or the response is ":" when the response is ")+t.blocked_content_types.join(", ")),t.schedule&&(n+=", "+sd(t.schedule)),t.users.length&&(n+=", for "+t.users.join(", ")),n}function I6(t){return t.url_regexes.length>0||t.blocked_content_types.length>0||t.users.length>0}function od(t){return t.action==="block"&&t.target.all_traffic&&!!t.schedule&&t.url_regexes.length===0&&t.blocked_content_types.length===0&&t.users.length===0}function L0e(t,e){var i;const n=RM();return n.name="Bedtime",n.target.all_traffic=!0,n.schedule={timezone:t,weekdays:e?[...e.weekdays]:[],windows:(i=e==null?void 0:e.windows)!=null&&i.length?e.windows.map(l=>({from:l.from,to:l.to})):[{from:"21:00",to:"07:00"}]},n}function I0e(t){const e=t.rules.filter(od);return t.users.length>0||t.rules.length>e.length||e.length>1}function R6(t,e){const n=[];if(t.blocked_categories.length){const r=t.blocked_categories.map(e);n.push("Blocks "+(r.length>3?r.slice(0,3).join(", ")+" and "+(r.length-3)+" more":r.join(", ")))}t.blocked_domains.length&&n.push(t.blocked_domains.length+" blocked site"+(t.blocked_domains.length===1?"":"s")),t.allowed_domains.length&&n.push(t.allowed_domains.length+" always-allowed site"+(t.allowed_domains.length===1?"":"s")),t.safe_search&&n.push("Safe search");const i=t.rules.find(r=>r.enabled&&od(r));i&&n.push("Bedtime "+sd(i.schedule));const l=t.rules.filter(r=>!od(r)).length;return l&&n.push(l+" custom rule"+(l===1?"":"s")),n.length?n.join(" · "):"Blocks nothing of its own"}function D6(t,e,n){const i=t.slice();return i[62]=e[n],i[63]=e,i[64]=n,i}function P6(t,e,n){const i=t.slice();return i[65]=e[n],i}function N6(t,e,n){const i=t.slice();return i[68]=e[n],i}function B6(t,e,n){const i=t.slice();return i[71]=e[n],i}function R0e(t){let e,n,i,l,r;return l=new ng({props:{label:"Block a domain",entries:t[0].blocked_domains,tagType:"red"}}),l.$on("change",t[30]),{c(){e=R("fieldset"),n=R("legend"),n.textContent="Blocked domains",i=B(),F(l.$$.fragment),P(n,"class","field-label svelte-k7r9rn"),P(e,"class","field svelte-k7r9rn")},m(s,o){y(s,e,o),T(e,n),T(e,i),H(l,e,null),r=!0},p(s,o){const a={};o[0]&1&&(a.entries=s[0].blocked_domains),l.$set(a)},i(s){r||(b(l.$$.fragment,s),r=!0)},o(s){k(l.$$.fragment,s),r=!1},d(s){s&&w(e),U(l)}}}function D0e(t){let e,n,i,l,r,s,o;return l=new ng({props:{label:"Allow a domain",entries:t[0].allowed_domains,tagType:"green"}}),l.$on("change",t[31]),{c(){e=R("fieldset"),n=R("legend"),n.textContent="Always allowed domains",i=B(),F(l.$$.fragment),r=B(),s=R("p"),s.textContent="Always reachable, even if a blocked category lists it.",P(n,"class","field-label svelte-k7r9rn"),P(s,"class","field-note svelte-k7r9rn"),P(e,"class","field svelte-k7r9rn")},m(a,u){y(a,e,u),T(e,n),T(e,i),H(l,e,null),T(e,r),T(e,s),o=!0},p(a,u){const f={};u[0]&1&&(f.entries=a[0].allowed_domains),l.$set(f)},i(a){o||(b(l.$$.fragment,a),o=!0)},o(a){k(l.$$.fragment,a),o=!1},d(a){a&&w(e),U(l)}}}function P0e(t){let e,n,i,l;return e=new zn({props:{sm:4,md:8,lg:8,$$slots:{default:[R0e]},$$scope:{ctx:t}}}),i=new zn({props:{sm:4,md:8,lg:8,$$slots:{default:[D0e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&1|s[2]&4096&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&4096&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function z6(t){var g,_;let e,n,i,l,r,s,o,a,u,f=(t[8].schedule.timezone||"UTC")+"",c,d,h;return n=new vc({props:{size:"sm",labelText:"From",placeholder:"HH:MM",pattern:ad,value:((g=t[8].schedule.windows[0])==null?void 0:g.from)||""}}),n.$on("change",t[34]),l=new vc({props:{size:"sm",labelText:"Until",placeholder:"HH:MM",pattern:ad,value:((_=t[8].schedule.windows[0])==null?void 0:_.to)||""}}),l.$on("change",t[35]),s=new cd({props:{size:"sm",titleText:"Nights",label:"Every night",items:IM,selectedIds:t[8].schedule.weekdays.map(String)}}),s.$on("select",t[36]),{c(){e=R("div"),F(n.$$.fragment),i=B(),F(l.$$.fragment),r=B(),F(s.$$.fragment),o=B(),a=R("p"),u=q("A night lasts until the next morning, in "),c=q(f),d=q("."),P(e,"class","window-row bedtime-row svelte-k7r9rn"),P(a,"class","field-note svelte-k7r9rn")},m(v,S){y(v,e,S),H(n,e,null),T(e,i),H(l,e,null),T(e,r),H(s,e,null),y(v,o,S),y(v,a,S),T(a,u),T(a,c),T(a,d),h=!0},p(v,S){var M,L;const A={};S[0]&256&&(A.value=((M=v[8].schedule.windows[0])==null?void 0:M.from)||""),n.$set(A);const C={};S[0]&256&&(C.value=((L=v[8].schedule.windows[0])==null?void 0:L.to)||""),l.$set(C);const I={};S[0]&256&&(I.selectedIds=v[8].schedule.weekdays.map(String)),s.$set(I),(!h||S[0]&256)&&f!==(f=(v[8].schedule.timezone||"UTC")+"")&&Z(c,f)},i(v){h||(b(n.$$.fragment,v),b(l.$$.fragment,v),b(s.$$.fragment,v),h=!0)},o(v){k(n.$$.fragment,v),k(l.$$.fragment,v),k(s.$$.fragment,v),h=!1},d(v){v&&(w(e),w(o),w(a)),U(n),U(l),U(s)}}}function H6(t){let e,n,i,l,r;return n=new cd({props:{titleText:"Proxy users on this policy",label:"Only devices assigned to it",items:t[2].map(x6),selectedIds:t[0].users}}),n.$on("select",t[38]),{c(){e=R("div"),F(n.$$.fragment),i=B(),l=R("p"),l.textContent="A signed-in proxy user gets this policy on any device.",P(l,"class","field-note svelte-k7r9rn"),P(e,"class","field svelte-k7r9rn")},m(s,o){y(s,e,o),H(n,e,null),T(e,i),T(e,l),r=!0},p(s,o){const a={};o[0]&4&&(a.items=s[2].map(x6)),o[0]&1&&(a.selectedIds=s[0].users),n.$set(a)},i(s){r||(b(n.$$.fragment,s),r=!0)},o(s){k(n.$$.fragment,s),r=!1},d(s){s&&w(e),U(n)}}}function U6(t){let e,n,i,l,r=t[64]+1+"",s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,L,N=J6(t[62]),z,W=I6(t[62]),D;function G(re){t[39](re,t[62])}let $={size:"sm",labelText:"Enabled",hideLabel:!0};t[62].enabled!==void 0&&($.toggled=t[62].enabled),u=new bc({props:$}),ft.push(()=>Yt(u,"toggled",G));function j(){return t[40](t[64])}d=new Rt({props:{size:"small",kind:"ghost",icon:UW,iconDescription:"Move rule up",disabled:t[64]===0}}),d.$on("click",j);function Q(){return t[41](t[64])}g=new Rt({props:{size:"small",kind:"ghost",icon:DW,iconDescription:"Move rule down",disabled:t[64]===t[0].rules.length-1}}),g.$on("click",Q);function le(){return t[42](t[64])}v=new Rt({props:{size:"small",kind:"danger-ghost",$$slots:{default:[N0e]},$$scope:{ctx:t}}}),v.$on("click",le),A=new dl({props:{$$slots:{default:[G0e]},$$scope:{ctx:t}}});let oe=!t[62].target.all_traffic&&F6(t);M=new dl({props:{$$slots:{default:[j0e]},$$scope:{ctx:t}}});let X=N&&q6(t),de=W&&K6();return{c(){e=R("div"),n=R("div"),i=R("h5"),l=q("Rule "),s=q(r),o=B(),a=R("div"),F(u.$$.fragment),c=B(),F(d.$$.fragment),h=B(),F(g.$$.fragment),_=B(),F(v.$$.fragment),S=B(),F(A.$$.fragment),C=B(),oe&&oe.c(),I=B(),F(M.$$.fragment),L=B(),X&&X.c(),z=B(),de&&de.c(),P(i,"class","svelte-k7r9rn"),P(a,"class","rule-head-controls svelte-k7r9rn"),P(n,"class","rule-head svelte-k7r9rn"),P(e,"class","rule svelte-k7r9rn")},m(re,x){y(re,e,x),T(e,n),T(n,i),T(i,l),T(i,s),T(n,o),T(n,a),H(u,a,null),T(a,c),H(d,a,null),T(a,h),H(g,a,null),T(a,_),H(v,a,null),T(e,S),H(A,e,null),T(e,C),oe&&oe.m(e,null),T(e,I),H(M,e,null),T(e,L),X&&X.m(e,null),T(e,z),de&&de.m(e,null),D=!0},p(re,x){t=re,(!D||x[0]&1)&&r!==(r=t[64]+1+"")&&Z(s,r);const me={};!f&&x[0]&1&&(f=!0,me.toggled=t[62].enabled,jt(()=>f=!1)),u.$set(me);const ee={};x[0]&1&&(ee.disabled=t[64]===0),d.$set(ee);const ke={};x[0]&1&&(ke.disabled=t[64]===t[0].rules.length-1),g.$set(ke);const pe={};x[2]&4096&&(pe.$$scope={dirty:x,ctx:t}),v.$set(pe);const Fe={};x[0]&1|x[2]&4096&&(Fe.$$scope={dirty:x,ctx:t}),A.$set(Fe),t[62].target.all_traffic?oe&&(fe(),k(oe,1,1,()=>{oe=null}),ce()):oe?(oe.p(t,x),x[0]&1&&b(oe,1)):(oe=F6(t),oe.c(),b(oe,1),oe.m(e,I));const Ve={};x[0]&13|x[2]&4096&&(Ve.$$scope={dirty:x,ctx:t}),M.$set(Ve),x[0]&1&&(N=J6(t[62])),N?X?(X.p(t,x),x[0]&1&&b(X,1)):(X=q6(t),X.c(),b(X,1),X.m(e,z)):X&&(fe(),k(X,1,1,()=>{X=null}),ce()),x[0]&1&&(W=I6(t[62])),W?de||(de=K6(),de.c(),de.m(e,null)):de&&(de.d(1),de=null)},i(re){D||(b(u.$$.fragment,re),b(d.$$.fragment,re),b(g.$$.fragment,re),b(v.$$.fragment,re),b(A.$$.fragment,re),b(oe),b(M.$$.fragment,re),b(X),D=!0)},o(re){k(u.$$.fragment,re),k(d.$$.fragment,re),k(g.$$.fragment,re),k(v.$$.fragment,re),k(A.$$.fragment,re),k(oe),k(M.$$.fragment,re),k(X),D=!1},d(re){re&&w(e),U(u),U(d),U(g),U(v),U(A),oe&&oe.d(),U(M),X&&X.d(),de&&de.d()}}}function N0e(t){let e;return{c(){e=q("Remove rule")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function B0e(t){let e,n,i;function l(s){t[43](s,t[62])}let r={labelText:"Name",placeholder:"Bedtime"};return t[62].name!==void 0&&(r.value=t[62].name),e=new Jn({props:r}),ft.push(()=>Yt(e,"value",l)),{c(){F(e.$$.fragment)},m(s,o){H(e,s,o),i=!0},p(s,o){t=s;const a={};!n&&o[0]&1&&(n=!0,a.value=t[62].name,jt(()=>n=!1)),e.$set(a)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){U(e,s)}}}function z0e(t){let e,n,i,l;return e=new Ln({props:{value:"block",text:"Block"}}),i=new Ln({props:{value:"allow",text:"Allow"}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p:he,i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function H0e(t){let e,n,i;function l(s){t[44](s,t[62])}let r={labelText:"Action",$$slots:{default:[z0e]},$$scope:{ctx:t}};return t[62].action!==void 0&&(r.selected=t[62].action),e=new wr({props:r}),ft.push(()=>Yt(e,"selected",l)),e.$on("change",t[14]),{c(){F(e.$$.fragment)},m(s,o){H(e,s,o),i=!0},p(s,o){t=s;const a={};o[2]&4096&&(a.$$scope={dirty:o,ctx:t}),!n&&o[0]&1&&(n=!0,a.selected=t[62].action,jt(()=>n=!1)),e.$set(a)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){U(e,s)}}}function U0e(t){let e,n,i,l;return e=new Ln({props:{value:"listed",text:"Selected categories and domains"}}),i=new Ln({props:{value:"all",text:"All traffic"}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p:he,i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function F0e(t){let e,n;function i(...l){return t[45](t[62],...l)}return e=new wr({props:{labelText:"Applies to",selected:t[62].target.all_traffic?"all":"listed",$$slots:{default:[U0e]},$$scope:{ctx:t}}}),e.$on("change",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&1&&(s.selected=t[62].target.all_traffic?"all":"listed"),r[2]&4096&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function G0e(t){let e,n,i,l,r,s;return e=new zn({props:{sm:4,md:4,lg:5,$$slots:{default:[B0e]},$$scope:{ctx:t}}}),i=new zn({props:{sm:4,md:4,lg:5,$$slots:{default:[H0e]},$$scope:{ctx:t}}}),r=new zn({props:{sm:4,md:8,lg:6,$$slots:{default:[F0e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){H(e,o,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,a){const u={};a[0]&1|a[2]&4096&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a[0]&1|a[2]&4096&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a[0]&1|a[2]&4096&&(c.$$scope={dirty:a,ctx:o}),r.$set(c)},i(o){s||(b(e.$$.fragment,o),b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(e.$$.fragment,o),k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(n),w(l)),U(e,o),U(i,o),U(r,o)}}}function F6(t){let e,n,i,l,r;function s(...a){return t[46](t[62],t[63],t[64],...a)}n=new tg({props:{categories:t[1],compact:!0,selection:t[62].target.categories}}),n.$on("change",s);function o(...a){return t[47](t[62],t[63],t[64],...a)}return l=new ng({props:{label:"Domain",entries:t[62].target.domains}}),l.$on("change",o),{c(){e=R("div"),F(n.$$.fragment),i=B(),F(l.$$.fragment),P(e,"class","rule-target svelte-k7r9rn")},m(a,u){y(a,e,u),H(n,e,null),T(e,i),H(l,e,null),r=!0},p(a,u){t=a;const f={};u[0]&2&&(f.categories=t[1]),u[0]&1&&(f.selection=t[62].target.categories),n.$set(f);const c={};u[0]&1&&(c.entries=t[62].target.domains),l.$set(c)},i(a){r||(b(n.$$.fragment,a),b(l.$$.fragment,a),r=!0)},o(a){k(n.$$.fragment,a),k(l.$$.fragment,a),r=!1},d(a){a&&w(e),U(n),U(l)}}}function G6(t,e){let n,i,l;return i=new Ln({props:{value:e[71].id,text:Q6(e[71])}}),{key:t,first:null,c(){n=qe(),F(i.$$.fragment),this.first=n},m(r,s){y(r,n,s),H(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&8&&(o.value=e[71].id),s[0]&8&&(o.text=Q6(e[71])),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(i,r)}}}function V0e(t){let e,n,i=[],l=new Map,r,s,o;e=new Ln({props:{value:"",text:"Always"}});let a=ct(t[3]);const u=f=>f[71].id;for(let f=0;f{s=null}),ce())},i(o){l||(b(e.$$.fragment,o),b(s),l=!0)},o(o){k(e.$$.fragment,o),k(s),l=!1},d(o){o&&(w(n),w(i)),U(e,o),s&&s.d(o)}}}function W6(t){let e,n;function i(...l){return t[52](t[62],...l)}return e=new cd({props:{titleText:"Only for proxy users",label:"Everyone on this policy",items:t[2].map(ey),selectedIds:t[62].users}}),e.$on("select",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&4&&(s.items=t[2].map(ey)),r[0]&1&&(s.selectedIds=t[62].users),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function q0e(t){let e,n,i=t[2].length&&W6(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,r){l[2].length?i?(i.p(l,r),r[0]&4&&b(i,1)):(i=W6(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function j0e(t){let e,n,i,l;return e=new zn({props:{sm:4,md:8,lg:8,$$slots:{default:[W0e]},$$scope:{ctx:t}}}),i=new zn({props:{sm:4,md:8,lg:8,$$slots:{default:[q0e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&9|s[2]&4096&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&5|s[2]&4096&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function q6(t){let e,n,i,l,r,s;return l=new dl({props:{$$slots:{default:[Q0e]},$$scope:{ctx:t}}}),{c(){e=R("details"),n=R("summary"),n.textContent="Block only part of the site",i=B(),F(l.$$.fragment),P(n,"class","svelte-k7r9rn"),P(e,"class","advanced svelte-k7r9rn"),e.open=r=t[62].url_regexes.length>0||t[62].blocked_content_types.length>0},m(o,a){y(o,e,a),T(e,n),T(e,i),H(l,e,null),s=!0},p(o,a){const u={};a[0]&1|a[2]&4096&&(u.$$scope={dirty:a,ctx:o}),l.$set(u),(!s||a[0]&1&&r!==(r=o[62].url_regexes.length>0||o[62].blocked_content_types.length>0))&&(e.open=r)},i(o){s||(b(l.$$.fragment,o),s=!0)},o(o){k(l.$$.fragment,o),s=!1},d(o){o&&w(e),U(l)}}}function Y0e(t){let e;return{c(){e=q("Add pattern")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function j6(t){let e,n=[],i=new Map,l,r=ct(t[62].url_regexes);const s=o=>o[68];for(let o=0;oYt(n,"value",u)),n.$on("keydown",f);function d(){return t[55](t[62])}r=new Rt({props:{size:"small",kind:"tertiary",$$slots:{default:[Y0e]},$$scope:{ctx:t}}}),r.$on("click",d);let h=t[62].url_regexes.length&&j6(t);return{c(){e=R("div"),F(n.$$.fragment),l=B(),F(r.$$.fragment),s=B(),h&&h.c(),o=qe(),P(e,"class","list-entry svelte-k7r9rn")},m(g,_){y(g,e,_),H(n,e,null),T(e,l),H(r,e,null),y(g,s,_),h&&h.m(g,_),y(g,o,_),a=!0},p(g,_){t=g;const v={};!i&&_[0]&1&&(i=!0,v.value=t[62].url_draft,jt(()=>i=!1)),n.$set(v);const S={};_[2]&4096&&(S.$$scope={dirty:_,ctx:t}),r.$set(S),t[62].url_regexes.length?h?(h.p(t,_),_[0]&1&&b(h,1)):(h=j6(t),h.c(),b(h,1),h.m(o.parentNode,o)):h&&(fe(),k(h,1,1,()=>{h=null}),ce())},i(g){a||(b(n.$$.fragment,g),b(r.$$.fragment,g),b(h),a=!0)},o(g){k(n.$$.fragment,g),k(r.$$.fragment,g),k(h),a=!1},d(g){g&&(w(e),w(s),w(o)),U(n),U(r),h&&h.d(g)}}}function K0e(t){let e;return{c(){e=q("Add type")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Z6(t){let e,n=[],i=new Map,l,r=ct(t[62].blocked_content_types);const s=o=>o[65];for(let o=0;oYt(n,"value",u)),n.$on("keydown",f);function d(){return t[59](t[62])}r=new Rt({props:{size:"small",kind:"tertiary",$$slots:{default:[K0e]},$$scope:{ctx:t}}}),r.$on("click",d);let h=t[62].blocked_content_types.length&&Z6(t);return{c(){e=R("div"),F(n.$$.fragment),l=B(),F(r.$$.fragment),s=B(),h&&h.c(),o=qe(),P(e,"class","list-entry svelte-k7r9rn")},m(g,_){y(g,e,_),H(n,e,null),T(e,l),H(r,e,null),y(g,s,_),h&&h.m(g,_),y(g,o,_),a=!0},p(g,_){t=g;const v={};!i&&_[0]&1&&(i=!0,v.value=t[62].content_type_draft,jt(()=>i=!1)),n.$set(v);const S={};_[2]&4096&&(S.$$scope={dirty:_,ctx:t}),r.$set(S),t[62].blocked_content_types.length?h?(h.p(t,_),_[0]&1&&b(h,1)):(h=Z6(t),h.c(),b(h,1),h.m(o.parentNode,o)):h&&(fe(),k(h,1,1,()=>{h=null}),ce())},i(g){a||(b(n.$$.fragment,g),b(r.$$.fragment,g),b(h),a=!0)},o(g){k(n.$$.fragment,g),k(r.$$.fragment,g),k(h),a=!1},d(g){g&&(w(e),w(s),w(o)),U(n),U(r),h&&h.d(g)}}}function Q0e(t){let e,n,i,l;return e=new zn({props:{sm:4,md:8,lg:8,$$slots:{default:[X0e]},$$scope:{ctx:t}}}),i=new zn({props:{sm:4,md:8,lg:8,$$slots:{default:[J0e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&1|s[2]&4096&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&4096&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function K6(t){let e;return{c(){e=R("p"),e.textContent=`DNS cannot see URLs, response types, or proxy logins, so this rule is enforced by the proxy only. Devices - that use GateSentry for DNS alone are not affected by it.`,P(e,"class","field-note proxy-note svelte-k7r9rn")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function $6(t,e){let n,i,l,r=e[64]!==e[7]&&U6(e);return{key:t,first:null,c(){n=qe(),r&&r.c(),i=qe(),this.first=n},m(s,o){y(s,n,o),r&&r.m(s,o),y(s,i,o),l=!0},p(s,o){e=s,e[64]!==e[7]?r?(r.p(e,o),o[0]&129&&b(r,1)):(r=U6(e),r.c(),b(r,1),r.m(i.parentNode,i)):r&&(fe(),k(r,1,1,()=>{r=null}),ce())},i(s){l||(b(r),l=!0)},o(s){k(r),l=!1},d(s){s&&(w(n),w(i)),r&&r.d(s)}}}function x0e(t){let e;return{c(){e=q("Add rule")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function ege(t){let e;return{c(){e=q("Save policy")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function tge(t){let e;return{c(){e=q("Cancel")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function nge(t){var mt;let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,L,N,z,W,D,G,$,j,Q,le,oe,X,de,re,x,me=[],ee=new Map,ke,pe,Fe,Ve,Ee,We,ge,ve;function be(we){t[28](we)}let ue={labelText:"Name",placeholder:"Kids"};t[0].name!==void 0&&(ue.value=t[0].name),n=new Jn({props:ue}),ft.push(()=>Yt(n,"value",be)),f=new tg({props:{categories:t[1],selection:t[0].blocked_categories}}),f.$on("change",t[29]),d=new dl({props:{$$slots:{default:[P0e]},$$scope:{ctx:t}}});function nt(we){t[32](we)}let Oe={labelText:"Safe search",labelA:"Off",labelB:"Google, Bing, DuckDuckGo, and YouTube restricted mode"};t[0].safe_search!==void 0&&(Oe.toggled=t[0].safe_search),_=new bc({props:Oe}),ft.push(()=>Yt(_,"toggled",nt)),M=new bc({props:{labelText:"Bedtime",hideLabel:!0,labelA:"Off",labelB:"No internet during these hours",toggled:!!t[8]}}),M.$on("toggle",t[33]);let dt=((mt=t[8])==null?void 0:mt.schedule)&&z6(t);function yt(we){t[37](we)}let at={labelText:"Description",rows:1};t[0].description!==void 0&&(at.value=t[0].description),$=new FT({props:at}),ft.push(()=>Yt($,"value",yt));let ut=!t[9]&&t[2].length&&H6(t),At=ct(t[0].rules);const xe=we=>we[64];for(let we=0;wei=!1)),n.$set(It);const Ht={};gt[0]&2&&(Ht.categories=t[1]),gt[0]&1&&(Ht.selection=t[0].blocked_categories),f.$set(Ht);const Wt={};gt[0]&1|gt[2]&4096&&(Wt.$$scope={dirty:gt,ctx:t}),d.$set(Wt);const qt={};!v&>[0]&1&&(v=!0,qt.toggled=t[0].safe_search,jt(()=>v=!1)),_.$set(qt);const Xt={};gt[0]&256&&(Xt.toggled=!!t[8]),M.$set(Xt),(zt=t[8])!=null&&zt.schedule?dt?(dt.p(t,gt),gt[0]&256&&b(dt,1)):(dt=z6(t),dt.c(),b(dt,1),dt.m(A,null)):dt&&(fe(),k(dt,1,1,()=>{dt=null}),ce());const Ce={};!j&>[0]&1&&(j=!0,Ce.value=t[0].description,jt(()=>j=!1)),$.$set(Ce),!t[9]&&t[2].length?ut?(ut.p(t,gt),gt[0]&516&&b(ut,1)):(ut=H6(t),ut.c(),b(ut,1),ut.m(z,le)):ut&&(fe(),k(ut,1,1,()=>{ut=null}),ce()),gt[0]&67059855&&(At=ct(t[0].rules),fe(),me=Wn(me,gt,xe,1,t,At,ee,oe,Qn,$6,ke,D6),ce());const se={};gt[2]&4096&&(se.$$scope={dirty:gt,ctx:t}),pe.$set(se);const Le={};gt[0]&16&&(Le.disabled=t[4]),gt[2]&4096&&(Le.$$scope={dirty:gt,ctx:t}),Ee.$set(Le);const _t={};gt[2]&4096&&(_t.$$scope={dirty:gt,ctx:t}),ge.$set(_t)},i(we){if(!ve){b(n.$$.fragment,we),b(f.$$.fragment,we),b(d.$$.fragment,we),b(_.$$.fragment,we),b(M.$$.fragment,we),b(dt),b($.$$.fragment,we),b(ut);for(let gt=0;gt({id:t,text:t}),ey=t=>({id:t,text:t});function ige(t,e,n){let i,l,r,{draft:s}=e,{categories:o=[]}=e,{users:a=[]}=e,{schedulePresets:u=[]}=e,{timezone:f="UTC"}=e,{saving:c=!1}=e,{onSave:d=()=>{}}=e,{onCancel:h=()=>{}}=e;const g=I0e(s);function _(Ce){if(Ce&&!r){const se=u.find(Le=>Le.id==="bedtime");n(0,s.rules=[L0e(f,se),...s.rules],s)}else!Ce&&r&&I(l)}function v(Ce,se){r!=null&&r.schedule&&(n(8,r.schedule.windows[0][Ce]=se.target.value,r),n(8,r.schedule.preset=void 0,r),A())}function S(Ce){r!=null&&r.schedule&&(n(8,r.schedule.weekdays=Ce.map(Number).sort((se,Le)=>se-Le),r),n(8,r.schedule.preset=void 0,r),A())}function A(){n(0,s.rules=[...s.rules],s)}function C(){n(0,s.rules=[...s.rules,RM()],s)}function I(Ce){n(0,s.rules=s.rules.filter((se,Le)=>Le!==Ce),s)}function M(Ce,se){const Le=Ce+se;if(Le<0||Le>=s.rules.length)return;const _t=[...s.rules];[_t[Ce],_t[Le]]=[_t[Le],_t[Ce]],n(0,s.rules=_t,s)}function L(Ce,se){Ce.target.all_traffic=se.target.value==="all",A()}function N(Ce,se,Le,_t=!1){let zt=Ce[Le].trim();_t&&(zt=zt.toLowerCase()),!(!zt||Ce[se].includes(zt))&&(Ce[se]=[...Ce[se],zt],Ce[Le]="",A())}function z(Ce,se,Le){Ce[se]=Ce[se].filter(_t=>_t!==Le),A()}function W(Ce,se){Ce.users=se.map(String),A()}function D(Ce,se){Ce.schedule&&(Ce.schedule.weekdays=se.map(Number).sort((Le,_t)=>Le-_t),A())}function G(Ce){return Ce.schedule?Ce.schedule.preset||V1:""}function $(Ce,se){var _t,zt,Be;if(!se){Ce.schedule=null,A();return}if(se===V1){const Ot=((zt=(_t=Ce.schedule)==null?void 0:_t.windows)==null?void 0:zt[0])||{from:"20:00",to:"07:00"};Ce.schedule={timezone:f,weekdays:(Be=Ce.schedule)!=null&&Be.weekdays?[...Ce.schedule.weekdays]:[],windows:[{from:Ot.from,to:Ot.to}]},A();return}const Le=u.find(Ot=>Ot.id===se);Le&&(Ce.schedule={timezone:f,weekdays:[...Le.weekdays],windows:Le.windows.map(Ot=>({from:Ot.from,to:Ot.to})),preset:Le.id},A())}function j(Ce,se){$(Ce,se.target.value)}function Q(Ce,se,Le){var _t,zt;(zt=(_t=Ce.schedule)==null?void 0:_t.windows)!=null&&zt.length&&(Ce.schedule.windows[0][se]=Le.target.value,A())}function le(Ce){n(0,s.users=Ce.map(String),s)}function oe(Ce){t.$$.not_equal(s.name,Ce)&&(s.name=Ce,n(0,s))}const X=Ce=>n(0,s.blocked_categories=Ce.detail,s),de=Ce=>n(0,s.blocked_domains=Ce.detail,s),re=Ce=>n(0,s.allowed_domains=Ce.detail,s);function x(Ce){t.$$.not_equal(s.safe_search,Ce)&&(s.safe_search=Ce,n(0,s))}const me=Ce=>_(Ce.detail.toggled),ee=Ce=>v("from",Ce),ke=Ce=>v("to",Ce),pe=Ce=>S(Ce.detail.selectedIds);function Fe(Ce){t.$$.not_equal(s.description,Ce)&&(s.description=Ce,n(0,s))}const Ve=Ce=>le(Ce.detail.selectedIds);function Ee(Ce,se){t.$$.not_equal(se.enabled,Ce)&&(se.enabled=Ce,n(0,s))}const We=Ce=>M(Ce,-1),ge=Ce=>M(Ce,1),ve=Ce=>I(Ce);function be(Ce,se){t.$$.not_equal(se.name,Ce)&&(se.name=Ce,n(0,s))}function ue(Ce,se){t.$$.not_equal(se.action,Ce)&&(se.action=Ce,n(0,s))}const nt=(Ce,se)=>L(Ce,se),Oe=(Ce,se,Le,_t)=>{n(0,se[Le].target.categories=_t.detail,s),A()},dt=(Ce,se,Le,_t)=>{n(0,se[Le].target.domains=_t.detail,s),A()},yt=(Ce,se)=>j(Ce,se),at=(Ce,se)=>Q(Ce,"from",se),ut=(Ce,se)=>Q(Ce,"to",se),At=(Ce,se)=>D(Ce,se.detail.selectedIds),xe=(Ce,se)=>W(Ce,se.detail.selectedIds);function mt(Ce,se){t.$$.not_equal(se.url_draft,Ce)&&(se.url_draft=Ce,n(0,s))}const we=(Ce,se)=>se.key==="Enter"&&N(Ce,"url_regexes","url_draft"),gt=Ce=>N(Ce,"url_regexes","url_draft"),It=(Ce,se)=>z(Ce,"url_regexes",se);function Ht(Ce,se){t.$$.not_equal(se.content_type_draft,Ce)&&(se.content_type_draft=Ce,n(0,s))}const Wt=(Ce,se)=>se.key==="Enter"&&N(Ce,"blocked_content_types","content_type_draft",!0),qt=Ce=>N(Ce,"blocked_content_types","content_type_draft",!0),Xt=(Ce,se)=>z(Ce,"blocked_content_types",se);return t.$$set=Ce=>{"draft"in Ce&&n(0,s=Ce.draft),"categories"in Ce&&n(1,o=Ce.categories),"users"in Ce&&n(2,a=Ce.users),"schedulePresets"in Ce&&n(3,u=Ce.schedulePresets),"timezone"in Ce&&n(27,f=Ce.timezone),"saving"in Ce&&n(4,c=Ce.saving),"onSave"in Ce&&n(5,d=Ce.onSave),"onCancel"in Ce&&n(6,h=Ce.onCancel)},t.$$.update=()=>{t.$$.dirty[0]&1&&n(9,i=s.id===ol),t.$$.dirty[0]&1&&n(7,l=s.rules.findIndex(od)),t.$$.dirty[0]&129&&n(8,r=l>=0?s.rules[l]:null)},[s,o,a,u,c,d,h,l,r,i,g,_,v,S,A,C,I,M,L,N,z,W,D,G,j,Q,le,f,oe,X,de,re,x,me,ee,ke,pe,Fe,Ve,Ee,We,ge,ve,be,ue,nt,Oe,dt,yt,at,ut,At,xe,mt,we,gt,It,Ht,Wt,qt,Xt]}class DM extends De{constructor(e){super(),Re(this,e,ige,nge,Ie,{draft:0,categories:1,users:2,schedulePresets:3,timezone:27,saving:4,onSave:5,onCancel:6},null,[-1,-1,-1])}}const{Boolean:ud}=LI;function ty(t,e,n){const i=t.slice();return i[71]=e[n],i}function ny(t,e,n){const i=t.slice();return i[74]=e[n],i}function iy(t,e,n){const i=t.slice();return i[77]=e[n],i[78]=e,i[79]=n,i}function ly(t,e,n){const i=t.slice();return i[74]=e[n],i}function ry(t,e,n){const i=t.slice();return i[82]=e[n],i}function sy(t,e,n){const i=t.slice();return i[85]=e[n],i}function oy(t,e,n){const i=t.slice();return i[88]=e[n],i}function ay(t,e,n){const i=t.slice();return i[88]=e[n],i}function uy(t,e,n){const i=t.slice();return i[93]=e[n],i}function fy(t,e,n){const i=t.slice();return i[96]=e[n],i}function cy(t,e,n){const i=t.slice();return i[93]=e[n],i}function dy(t){let e,n;return e=new xi({props:{kind:"error",title:"Error",subtitle:t[11]}}),e.$on("close",t[42]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.subtitle=i[11]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function hy(t){let e,n;return e=new xi({props:{kind:"success",title:"Done",subtitle:t[12]}}),e.$on("close",t[43]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&4096&&(r.subtitle=i[12]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function lge(t){let e,n,i,l,r,s,o,a,u,f,c=[],d=new Map,h,g,_,v,S,A,C,I,M,L,N,z,W,D,G,$,j,Q,le=t[24]&&my(t);o=new Rt({props:{size:"small",kind:"secondary",disabled:t[9],$$slots:{default:[oge]},$$scope:{ctx:t}}}),o.$on("click",t[27]);let oe=(!t[24]||t[22])&&gy(t),X=t[13]==="new"&&wy(t),de=ct(t[0]);const re=x=>x[77].id;for(let x=0;xPolicies',l=B(),r=R("div"),le&&le.c(),s=B(),F(o.$$.fragment),a=B(),oe&&oe.c(),u=B(),X&&X.c(),f=B();for(let x=0;xTest a site',v=B(),S=R("p"),S.textContent="Check whether a site is blocked for a device right now, and which setting decides it. Nothing is changed.",A=B(),F(C.$$.fragment),I=B(),M=R("details"),L=R("summary"),L.innerHTML='

        Gateway-wide categories

        ',N=B(),z=R("div"),W=R("div"),W.innerHTML=`

        Blocked for every device on every policy, like the global blocklist. A policy's always-allowed domains can - still exempt a site.

        `,D=B(),F(G.$$.fragment),$=B(),F(j.$$.fragment),P(r,"class","heading-actions svelte-5qb12c"),P(n,"class","section-heading svelte-5qb12c"),P(e,"class","section svelte-5qb12c"),P(_,"class","svelte-5qb12c"),P(S,"class","section-intro svelte-5qb12c"),P(g,"class","section fold svelte-5qb12c"),P(L,"class","svelte-5qb12c"),P(z,"class","section-heading svelte-5qb12c"),P(M,"class","section fold svelte-5qb12c")},m(x,me){y(x,e,me),T(e,n),T(n,i),T(n,l),T(n,r),le&&le.m(r,null),T(r,s),H(o,r,null),T(e,a),oe&&oe.m(e,null),T(e,u),X&&X.m(e,null),T(e,f);for(let ee=0;ee{le=null}),ce());const ee={};me[0]&512&&(ee.disabled=x[9]),me[3]&256&&(ee.$$scope={dirty:me,ctx:x}),o.$set(ee),!x[24]||x[22]?oe?(oe.p(x,me),me[0]&20971520&&b(oe,1)):(oe=gy(x),oe.c(),b(oe,1),oe.m(e,u)):oe&&(fe(),k(oe,1,1,()=>{oe=null}),ce()),x[13]==="new"?X?(X.p(x,me),me[0]&8192&&b(X,1)):(X=wy(x),X.c(),b(X,1),X.m(e,f)):X&&(fe(),k(X,1,1,()=>{X=null}),ce()),me[0]&1954603753|me[1]&47&&(de=ct(x[0]),fe(),c=Wn(c,me,re,1,x,de,d,e,Qn,Hy,null,iy),ce());const ke={};me[0]&37683200|me[3]&256&&(ke.$$scope={dirty:me,ctx:x}),C.$set(ke);const pe={};me[0]&1024&&(pe.disabled=x[10]),me[3]&256&&(pe.$$scope={dirty:me,ctx:x}),G.$set(pe);const Fe={};me[0]&8&&(Fe.categories=x[3]),me[0]&16&&(Fe.selection=x[4]),me[0]&1024&&(Fe.disabled=x[10]),j.$set(Fe)},i(x){if(!Q){b(le),b(o.$$.fragment,x),b(oe),b(X);for(let me=0;meg[96].id;for(let g=0;g{c=null}),ce()),_[0]&1073742338|_[1]&192&&(d=ct(g[1]),fe(),a=Wn(a,_,h,1,g,d,u,o,Qn,ky,null,fy),ce())},i(g){if(!f){b(c);for(let _=0;_k(l[s],1,1,()=>{l[s]=null});return{c(){e=R("div");for(let s=0;s{_=null}),ce()),(z=t[96].limitations)!=null&&z.length?v?v.p(t,M):(v=vy(t),v.c(),v.m(e,c)):v&&(v.d(1),v=null);const L={};M[0]&2&&(L.kind=t[38](t[96])?"ghost":"primary"),M[0]&514&&(L.disabled=t[9]||!t[96].available||t[38](t[96])),M[0]&2|M[3]&256&&(L.$$scope={dirty:M,ctx:t}),d.$set(L)},i(I){g||(b(_),b(d.$$.fragment,I),g=!0)},o(I){k(_),k(d.$$.fragment,I),g=!1},d(I){I&&(w(e),w(h)),_&&_.d(),v&&v.d(),U(d)}}}function ky(t,e){let n,i,l;return i=new Bu({props:{$$slots:{default:[fge]},$$scope:{ctx:e}}}),{key:t,first:null,c(){n=qe(),F(i.$$.fragment),this.first=n},m(r,s){y(r,n,s),H(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&514|s[3]&256&&(o.$$scope={dirty:s,ctx:e}),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(i,r)}}}function wy(t){let e,n,i;return n=new Bu({props:{$$slots:{default:[cge]},$$scope:{ctx:t}}}),{c(){e=R("div"),F(n.$$.fragment),P(e,"class","group-slot svelte-5qb12c")},m(l,r){y(l,e,r),H(n,e,null),i=!0},p(l,r){const s={};r[0]&17128|r[3]&256&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(b(n.$$.fragment,l),i=!0)},o(l){k(n.$$.fragment,l),i=!1},d(l){l&&w(e),U(n)}}}function cge(t){let e,n,i,l;return i=new DM({props:{draft:t[14],categories:t[3],users:t[6],schedulePresets:t[5],timezone:t[7],saving:t[9],onSave:t[34],onCancel:t[29]}}),{c(){e=R("h4"),e.textContent="New policy",n=B(),F(i.$$.fragment),P(e,"class","svelte-5qb12c")},m(r,s){y(r,e,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&16384&&(o.draft=r[14]),s[0]&8&&(o.categories=r[3]),s[0]&64&&(o.users=r[6]),s[0]&32&&(o.schedulePresets=r[5]),s[0]&128&&(o.timezone=r[7]),s[0]&512&&(o.saving=r[9]),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&(w(e),w(n)),U(i,r)}}}function dge(t){let e,n,i,l,r=t[77].name+"",s,o,a,u,f=(t[26][t[77].id]||[]).length+"",c,d,h=(t[26][t[77].id]||[]).length===1?"":"s",g,_=t[77].users.length?" · "+t[77].users.length+" proxy user"+(t[77].users.length===1?"":"s"):"",v,S,A,C=R6(t[77],t[30])+"",I,M,L,N,z=t[23][t[77].id]?"Hide details":"Details and devices",W,D,G,$=t[77].id!==ol&&t[32](t[77].id).length,j,Q,le,oe,X,de,re,x=t[77].id===ol&&yy(t);function me(ge,ve){if(ge[77].id===ol)return _ge;if(!(ge[26][ge[77].id]||[]).length&&!ge[77].users.length)return gge}let ee=me(t),ke=ee&&ee(t);function pe(){return t[46](t[77])}let Fe=t[23][t[77].id]&&Ty(t),Ve=$&&Ny(t);function Ee(){return t[50](t[77])}le=new Rt({props:{size:"small",kind:"ghost",disabled:t[9],$$slots:{default:[Mge]},$$scope:{ctx:t}}}),le.$on("click",Ee);let We=t[77].id!==ol&&zy(t);return{c(){e=R("div"),n=R("div"),i=R("div"),l=R("h4"),s=q(r),o=B(),x&&x.c(),a=B(),u=R("span"),c=q(f),d=q(" device"),g=q(h),v=q(_),S=B(),A=R("p"),I=q(C),M=B(),ke&&ke.c(),L=B(),N=R("button"),W=q(z),D=B(),Fe&&Fe.c(),G=B(),Ve&&Ve.c(),j=B(),Q=R("div"),F(le.$$.fragment),oe=B(),We&&We.c(),P(l,"class","svelte-5qb12c"),P(u,"class","device-count svelte-5qb12c"),P(i,"class","group-title svelte-5qb12c"),P(A,"class","summary-line svelte-5qb12c"),P(N,"type","button"),P(N,"class","link-button svelte-5qb12c"),P(n,"class","group-summary svelte-5qb12c"),P(Q,"class","group-actions svelte-5qb12c"),P(e,"class","group-row svelte-5qb12c")},m(ge,ve){y(ge,e,ve),T(e,n),T(n,i),T(i,l),T(l,s),T(i,o),x&&x.m(i,null),T(i,a),T(i,u),T(u,c),T(u,d),T(u,g),T(u,v),T(n,S),T(n,A),T(A,I),T(n,M),ke&&ke.m(n,null),T(n,L),T(n,N),T(N,W),T(n,D),Fe&&Fe.m(n,null),T(n,G),Ve&&Ve.m(n,null),T(e,j),T(e,Q),H(le,Q,null),T(Q,oe),We&&We.m(Q,null),X=!0,de||(re=J(N,"click",pe),de=!0)},p(ge,ve){t=ge,(!X||ve[0]&1)&&r!==(r=t[77].name+"")&&Z(s,r),t[77].id===ol?x?ve[0]&1&&b(x,1):(x=yy(t),x.c(),b(x,1),x.m(i,a)):x&&(fe(),k(x,1,1,()=>{x=null}),ce()),(!X||ve[0]&67108865)&&f!==(f=(t[26][t[77].id]||[]).length+"")&&Z(c,f),(!X||ve[0]&67108865)&&h!==(h=(t[26][t[77].id]||[]).length===1?"":"s")&&Z(g,h),(!X||ve[0]&1)&&_!==(_=t[77].users.length?" · "+t[77].users.length+" proxy user"+(t[77].users.length===1?"":"s"):"")&&Z(v,_),(!X||ve[0]&1)&&C!==(C=R6(t[77],t[30])+"")&&Z(I,C),ee!==(ee=me(t))&&(ke&&ke.d(1),ke=ee&&ee(t),ke&&(ke.c(),ke.m(n,L))),(!X||ve[0]&8388609)&&z!==(z=t[23][t[77].id]?"Hide details":"Details and devices")&&Z(W,z),t[23][t[77].id]?Fe?(Fe.p(t,ve),ve[0]&8388609&&b(Fe,1)):(Fe=Ty(t),Fe.c(),b(Fe,1),Fe.m(n,G)):Fe&&(fe(),k(Fe,1,1,()=>{Fe=null}),ce()),ve[0]&1&&($=t[77].id!==ol&&t[32](t[77].id).length),$?Ve?(Ve.p(t,ve),ve[0]&1&&b(Ve,1)):(Ve=Ny(t),Ve.c(),b(Ve,1),Ve.m(n,null)):Ve&&(fe(),k(Ve,1,1,()=>{Ve=null}),ce());const be={};ve[0]&512&&(be.disabled=t[9]),ve[3]&256&&(be.$$scope={dirty:ve,ctx:t}),le.$set(be),t[77].id!==ol?We?(We.p(t,ve),ve[0]&1&&b(We,1)):(We=zy(t),We.c(),b(We,1),We.m(Q,null)):We&&(fe(),k(We,1,1,()=>{We=null}),ce())},i(ge){X||(b(x),b(Fe),b(Ve),b(le.$$.fragment,ge),b(We),X=!0)},o(ge){k(x),k(Fe),k(Ve),k(le.$$.fragment,ge),k(We),X=!1},d(ge){ge&&w(e),x&&x.d(),ke&&ke.d(),Fe&&Fe.d(),Ve&&Ve.d(),U(le),We&&We.d(),de=!1,re()}}}function hge(t){let e,n,i=t[77].name+"",l,r,s,o;return s=new DM({props:{draft:t[14],categories:t[3],users:t[6],schedulePresets:t[5],timezone:t[7],saving:t[9],onSave:t[34],onCancel:t[29]}}),{c(){e=R("h4"),n=q("Edit "),l=q(i),r=B(),F(s.$$.fragment),P(e,"class","svelte-5qb12c")},m(a,u){y(a,e,u),T(e,n),T(e,l),y(a,r,u),H(s,a,u),o=!0},p(a,u){(!o||u[0]&1)&&i!==(i=a[77].name+"")&&Z(l,i);const f={};u[0]&16384&&(f.draft=a[14]),u[0]&8&&(f.categories=a[3]),u[0]&64&&(f.users=a[6]),u[0]&32&&(f.schedulePresets=a[5]),u[0]&128&&(f.timezone=a[7]),u[0]&512&&(f.saving=a[9]),s.$set(f)},i(a){o||(b(s.$$.fragment,a),o=!0)},o(a){k(s.$$.fragment,a),o=!1},d(a){a&&(w(e),w(r)),U(s,a)}}}function yy(t){let e,n;return e=new Vt({props:{size:"sm",type:"blue",$$slots:{default:[mge]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function mge(t){let e;return{c(){e=q("default")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function gge(t){let e;return{c(){e=R("p"),e.textContent="No devices yet, so this policy changes nothing until you add one.",P(e,"class","muted svelte-5qb12c")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function _ge(t){let e;return{c(){e=R("p"),e.textContent="Every device uses exactly one policy. Devices you haven't assigned use this one.",P(e,"class","muted svelte-5qb12c")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Ty(t){let e,n,i,l,r,s,o,a=(t[26][t[77].id]||[]).length+"",u,f,c,d,h,g=t[77].description&&Sy(t),_=(t[77].blocked_categories.length||t[77].blocked_domains.length)&&Ey(t),v=t[77].allowed_domains.length&&Ay(t),S=t[77].rules.length&&Ly(t),A=(t[26][t[77].id]||[]).length&&Ry(t),C=t[77].users.length&&Py(t);return{c(){g&&g.c(),e=B(),_&&_.c(),n=B(),v&&v.c(),i=B(),S&&S.c(),l=B(),r=R("div"),s=R("h5"),o=q("Devices on this policy ("),u=q(a),f=q(")"),c=B(),A&&A.c(),d=B(),C&&C.c(),P(s,"class","svelte-5qb12c"),P(r,"class","group-assignment svelte-5qb12c")},m(I,M){g&&g.m(I,M),y(I,e,M),_&&_.m(I,M),y(I,n,M),v&&v.m(I,M),y(I,i,M),S&&S.m(I,M),y(I,l,M),y(I,r,M),T(r,s),T(s,o),T(s,u),T(s,f),T(r,c),A&&A.m(r,null),T(r,d),C&&C.m(r,null),h=!0},p(I,M){I[77].description?g?g.p(I,M):(g=Sy(I),g.c(),g.m(e.parentNode,e)):g&&(g.d(1),g=null),I[77].blocked_categories.length||I[77].blocked_domains.length?_?(_.p(I,M),M[0]&1&&b(_,1)):(_=Ey(I),_.c(),b(_,1),_.m(n.parentNode,n)):_&&(fe(),k(_,1,1,()=>{_=null}),ce()),I[77].allowed_domains.length?v?(v.p(I,M),M[0]&1&&b(v,1)):(v=Ay(I),v.c(),b(v,1),v.m(i.parentNode,i)):v&&(fe(),k(v,1,1,()=>{v=null}),ce()),I[77].rules.length?S?S.p(I,M):(S=Ly(I),S.c(),S.m(l.parentNode,l)):S&&(S.d(1),S=null),(!h||M[0]&67108865)&&a!==(a=(I[26][I[77].id]||[]).length+"")&&Z(u,a),(I[26][I[77].id]||[]).length?A?(A.p(I,M),M[0]&67108865&&b(A,1)):(A=Ry(I),A.c(),b(A,1),A.m(r,d)):A&&(fe(),k(A,1,1,()=>{A=null}),ce()),I[77].users.length?C?C.p(I,M):(C=Py(I),C.c(),C.m(r,null)):C&&(C.d(1),C=null)},i(I){h||(b(_),b(v),b(A),h=!0)},o(I){k(_),k(v),k(A),h=!1},d(I){I&&(w(e),w(n),w(i),w(l),w(r)),g&&g.d(I),_&&_.d(I),v&&v.d(I),S&&S.d(I),A&&A.d(),C&&C.d()}}}function Sy(t){let e,n=t[77].description+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","svelte-5qb12c")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&1&&n!==(n=l[77].description+"")&&Z(i,n)},d(l){l&&w(e)}}}function Ey(t){let e,n,i,l,r,s=ct(t[77].blocked_categories),o=[];for(let d=0;dk(o[d],1,1,()=>{o[d]=null});let u=ct(t[77].blocked_domains),f=[];for(let d=0;dk(f[d],1,1,()=>{f[d]=null});return{c(){e=R("div"),n=R("span"),n.textContent="Blocks",i=B();for(let d=0;dk(s[a],1,1,()=>{s[a]=null});return{c(){e=R("div"),n=R("span"),n.textContent="Always allows",i=B();for(let a=0;as[85].id;for(let s=0;so[82];for(let o=0;o{a[d]=null}),ce(),l=a[i],l?l.p(e,c):(l=a[i]=o[i](e),l.c()),b(l,1),l.m(r.parentNode,r))},i(f){s||(b(l),s=!0)},o(f){k(l),s=!1},d(f){f&&(w(n),w(r)),a[i].d(f)}}}function Py(t){let e,n,i=t[77].users.join(", ")+"",l;return{c(){e=R("p"),n=q("Proxy users: "),l=q(i),P(e,"class","muted svelte-5qb12c")},m(r,s){y(r,e,s),T(e,n),T(e,l)},p(r,s){s[0]&1&&i!==(i=r[77].users.join(", ")+"")&&Z(l,i)},d(r){r&&w(e)}}}function Ny(t){let e,n,i,l,r,s;function o(f){t[48](f,t[77])}let a={size:"sm",hideLabel:!0,labelText:"Add a device",$$slots:{default:[Sge]},$$scope:{ctx:t}};t[15][t[77].id]!==void 0&&(a.selected=t[15][t[77].id]),n=new wr({props:a}),ft.push(()=>Yt(n,"selected",o));function u(){return t[49](t[77])}return r=new Rt({props:{size:"small",kind:"tertiary",disabled:t[9]||!t[15][t[77].id],$$slots:{default:[Ege]},$$scope:{ctx:t}}}),r.$on("click",u),{c(){e=R("div"),F(n.$$.fragment),l=B(),F(r.$$.fragment),P(e,"class","assign-row svelte-5qb12c")},m(f,c){y(f,e,c),H(n,e,null),T(e,l),H(r,e,null),s=!0},p(f,c){t=f;const d={};c[0]&1|c[3]&256&&(d.$$scope={dirty:c,ctx:t}),!i&&c[0]&32769&&(i=!0,d.selected=t[15][t[77].id],jt(()=>i=!1)),n.$set(d);const h={};c[0]&33281&&(h.disabled=t[9]||!t[15][t[77].id]),c[3]&256&&(h.$$scope={dirty:c,ctx:t}),r.$set(h)},i(f){s||(b(n.$$.fragment,f),b(r.$$.fragment,f),s=!0)},o(f){k(n.$$.fragment,f),k(r.$$.fragment,f),s=!1},d(f){f&&w(e),U(n),U(r)}}}function By(t,e){let n,i,l;return i=new Ln({props:{value:e[74].id,text:Ks(e[74])}}),{key:t,first:null,c(){n=qe(),F(i.$$.fragment),this.first=n},m(r,s){y(r,n,s),H(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&1&&(o.value=e[74].id),s[0]&1&&(o.text=Ks(e[74])),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(i,r)}}}function Sge(t){let e,n,i=[],l=new Map,r,s;e=new Ln({props:{value:"",text:"Add a device..."}});let o=ct(t[32](t[77].id));const a=u=>u[74].id;for(let u=0;u{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function Hy(t,e){let n,i,l,r;return i=new Bu({props:{$$slots:{default:[Age]},$$scope:{ctx:e}}}),{key:t,first:null,c(){n=R("div"),F(i.$$.fragment),l=B(),P(n,"class","group-slot svelte-5qb12c"),this.first=n},m(s,o){y(s,n,o),H(i,n,null),T(n,l),r=!0},p(s,o){e=s;const a={};o[0]&75555561|o[3]&256&&(a.$$scope={dirty:o,ctx:e}),i.$set(a)},i(s){r||(b(i.$$.fragment,s),r=!0)},o(s){k(i.$$.fragment,s),r=!1},d(s){s&&w(n),U(i)}}}function Uy(t,e){let n,i,l;return i=new Ln({props:{value:e[74].id,text:Ks(e[74])}}),{key:t,first:null,c(){n=qe(),F(i.$$.fragment),this.first=n},m(r,s){y(r,n,s),H(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&33554432&&(o.value=e[74].id),s[0]&33554432&&(o.text=Ks(e[74])),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(i,r)}}}function Cge(t){let e,n,i=[],l=new Map,r,s;e=new Ln({props:{value:"",text:"An unknown device (default policy)"}});let o=ct(t[25]);const a=u=>u[74].id;for(let u=0;uYt(n,"selected",S));function C(D){t[53](D)}let I={size:"sm",labelText:"Domain or URL",placeholder:"youtube.com/shorts/abc"};t[17]!==void 0&&(I.value=t[17]),r=new Jn({props:I}),ft.push(()=>Yt(r,"value",C)),r.$on("keydown",t[54]);function M(D){t[55](D)}let L={size:"sm",labelText:"Path",$$slots:{default:[Lge]},$$scope:{ctx:t}};t[18]!==void 0&&(L.selected=t[18]),a=new wr({props:L}),ft.push(()=>Yt(a,"selected",M)),c=new Rt({props:{size:"small",disabled:t[19]||!t[17].trim(),$$slots:{default:[Ige]},$$scope:{ctx:t}}}),c.$on("click",t[39]);let N=t[19]&&Fy(),z=t[21]&&Gy(t),W=t[20]&&Vy(t);return{c(){e=R("div"),F(n.$$.fragment),l=B(),F(r.$$.fragment),o=B(),F(a.$$.fragment),f=B(),F(c.$$.fragment),d=B(),N&&N.c(),h=B(),z&&z.c(),g=B(),W&&W.c(),_=qe(),P(e,"class","test-row svelte-5qb12c")},m(D,G){y(D,e,G),H(n,e,null),T(e,l),H(r,e,null),T(e,o),H(a,e,null),T(e,f),H(c,e,null),y(D,d,G),N&&N.m(D,G),y(D,h,G),z&&z.m(D,G),y(D,g,G),W&&W.m(D,G),y(D,_,G),v=!0},p(D,G){const $={};G[0]&33554432|G[3]&256&&($.$$scope={dirty:G,ctx:D}),!i&&G[0]&65536&&(i=!0,$.selected=D[16],jt(()=>i=!1)),n.$set($);const j={};!s&&G[0]&131072&&(s=!0,j.value=D[17],jt(()=>s=!1)),r.$set(j);const Q={};G[3]&256&&(Q.$$scope={dirty:G,ctx:D}),!u&&G[0]&262144&&(u=!0,Q.selected=D[18],jt(()=>u=!1)),a.$set(Q);const le={};G[0]&655360&&(le.disabled=D[19]||!D[17].trim()),G[3]&256&&(le.$$scope={dirty:G,ctx:D}),c.$set(le),D[19]?N?G[0]&524288&&b(N,1):(N=Fy(),N.c(),b(N,1),N.m(h.parentNode,h)):N&&(fe(),k(N,1,1,()=>{N=null}),ce()),D[21]?z?z.p(D,G):(z=Gy(D),z.c(),z.m(g.parentNode,g)):z&&(z.d(1),z=null),D[20]?W?(W.p(D,G),G[0]&1048576&&b(W,1)):(W=Vy(D),W.c(),b(W,1),W.m(_.parentNode,_)):W&&(fe(),k(W,1,1,()=>{W=null}),ce())},i(D){v||(b(n.$$.fragment,D),b(r.$$.fragment,D),b(a.$$.fragment,D),b(c.$$.fragment,D),b(N),b(W),v=!0)},o(D){k(n.$$.fragment,D),k(r.$$.fragment,D),k(a.$$.fragment,D),k(c.$$.fragment,D),k(N),k(W),v=!1},d(D){D&&(w(e),w(d),w(h),w(g),w(_)),U(n),U(r),U(a),U(c),N&&N.d(D),z&&z.d(D),W&&W.d(D)}}}function Pge(t){let e;return{c(){e=q("Save categories")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Nge(t){let e,n,i,l,r,s,o=t[11]&&dy(t),a=t[12]&&hy(t);const u=[rge,lge],f=[];function c(d,h){return d[8]?0:1}return i=c(t),l=f[i]=u[i](t),{c(){o&&o.c(),e=B(),a&&a.c(),n=B(),l.c(),r=qe()},m(d,h){o&&o.m(d,h),y(d,e,h),a&&a.m(d,h),y(d,n,h),f[i].m(d,h),y(d,r,h),s=!0},p(d,h){d[11]?o?(o.p(d,h),h[0]&2048&&b(o,1)):(o=dy(d),o.c(),b(o,1),o.m(e.parentNode,e)):o&&(fe(),k(o,1,1,()=>{o=null}),ce()),d[12]?a?(a.p(d,h),h[0]&4096&&b(a,1)):(a=hy(d),a.c(),b(a,1),a.m(n.parentNode,n)):a&&(fe(),k(a,1,1,()=>{a=null}),ce());let g=i;i=c(d),i===g?f[i].p(d,h):(fe(),k(f[g],1,1,()=>{f[g]=null}),ce(),l=f[i],l?l.p(d,h):(l=f[i]=u[i](d),l.c()),b(l,1),l.m(r.parentNode,r))},i(d){s||(b(o),b(a),b(l),s=!0)},o(d){k(o),k(a),k(l),s=!1},d(d){d&&(w(e),w(n),w(r)),o&&o.d(d),a&&a.d(d),f[i].d(d)}}}function Bge(){return localStorage.getItem("jwt")||""}function js(t=!1){const e={Authorization:"Bearer "+Bge()};return t&&(e["Content-Type"]="application/json"),e}async function Ys(t){const e=await t.text();try{const n=JSON.parse(e);if(n&&n.error)return n.error}catch{}return e||"Request failed ("+t.status+")"}async function Hr(t){const e=await fetch(t,{headers:js()});if(!e.ok)throw new Error(await Ys(e));return e.json()}function Ks(t){const e=t.display_name||(t.hostnames||[])[0]||t.ipv4||t.id;return t.ipv4&&e!==t.ipv4?e+" ("+t.ipv4+")":e}function fd(t){const e=t.active;return e.action==="block"||e.url_blocked?{text:"Blocked",type:"red"}:e.action==="allow"?{text:"Allowed by policy",type:"green"}:{text:"Not blocked by policy",type:"gray"}}function zge(t,e,n){let i,l,r;const s=ni()+"/api/policy/templates",o=ni()+"/api/policy/groups",a=ni()+"/api/policy/categories",u=ni()+"/api/policy/assignments",f=ni()+"/api/policy/preview",c=ni()+"/api/devices",d=ni()+"/api/policy/schedule-presets",h=ni()+"/api/users",g=ni()+"/api/settings/timezone";let _=[],v=[],S=[],A=[],C=[],I=[],M=[],L=[],N=[],z="UTC",W=!0,D=!1,G=!1,$="",j="",Q="",le=Rm(),oe={},X="",de="",re="dns",x=!1,me=null,ee="";async function ke(){try{n(5,L=(await Hr(d)).presets||[])}catch{n(5,L=[])}try{n(6,N=((await Hr(h)).users||[]).map(Ye=>Ye.username).filter(Boolean))}catch{n(6,N=[])}try{const Ye=await Hr(g);Ye.Value&&n(7,z=Ye.Value)}catch{}}async function pe(){n(8,W=!0),n(11,$="");try{const[Ye,ze,Qe,He,Tt]=await Promise.all([Hr(s),Hr(o),Hr(a),Hr(u),Hr(c),ke()]);n(1,_=Ye.templates||[]),n(2,v=Ye.shared_limitations||[]),n(0,S=(ze.groups||[]).map(xf)),n(3,A=Qe.categories||[]),n(40,C=He.assignments||[]),n(41,I=Tt.devices||[]),n(4,M=A.filter(Bt=>Bt.enabled).map(Bt=>Bt.id))}catch(Ye){n(11,$=Ye.message)}finally{n(8,W=!1)}}async function Fe(){n(40,C=(await Hr(u)).assignments||[])}function Ve(){n(13,Q="new"),n(14,le=Rm())}function Ee(Ye){n(13,Q=Ye.id),n(14,le=xf(Ye))}function We(){n(13,Q=""),n(14,le=Rm())}function ge(Ye){const ze=A.find(Qe=>Qe.id===Ye);return ze?ze.name:Ye}function ve(Ye,ze){var Tt;const Qe={[ol]:[]},He=new Set;for(const Bt of Ye)(Qe[Tt=Bt.group_id]||(Qe[Tt]=[])).push(Bt.device_id),He.add(Bt.device_id);for(const Bt of ze)He.has(Bt.id)||Qe[ol].push(Bt.id);return Qe}function be(Ye){const ze=I.find(Qe=>Qe.id===Ye);return ze?Ks(ze):Ye}function ue(Ye){const ze=new Set(i[Ye]||[]);return l.filter(Qe=>!ze.has(Qe.id))}async function nt(Ye,ze){if(Ye){n(9,D=!0),n(11,$=""),n(12,j="");try{const Qe=await fetch(c+"/"+Ye+"/assignment",{method:"PUT",headers:js(!0),body:JSON.stringify({group_id:ze===ol?"":ze})});if(!Qe.ok)throw new Error(await Ys(Qe));await Fe(),n(12,j=be(Ye)+" now uses "+Oe(ze)+".")}catch(Qe){n(11,$=Qe.message)}finally{n(9,D=!1)}}}function Oe(Ye){var ze;return((ze=S.find(Qe=>Qe.id===Ye))==null?void 0:ze.name)||Ye}async function dt(){if(!le.name.trim()){n(11,$="A policy needs a name.");return}n(9,D=!0),n(11,$=""),n(12,j="");try{const Ye=Q==="new",ze=Ye?o:o+"/"+Q,Qe=await fetch(ze,{method:Ye?"POST":"PUT",headers:js(!0),body:JSON.stringify(O0e(le))});if(!Qe.ok)throw new Error(await Ys(Qe));const He=xf((await Qe.json()).group);Ye?n(0,S=[...S,He]):n(0,S=S.map(Tt=>Tt.id===He.id?He:Tt)),n(12,j="Policy saved. It applies to new DNS lookups within a minute."),We()}catch(Ye){n(11,$=Ye.message)}finally{n(9,D=!1)}}async function yt(){n(10,G=!0),n(11,$=""),n(12,j="");try{const Ye=await fetch(a,{method:"PUT",headers:js(!0),body:JSON.stringify({categories:M})});if(!Ye.ok)throw new Error(await Ys(Ye));const ze=await Ye.json();n(3,A=ze.categories||[]),n(4,M=A.filter(Qe=>Qe.enabled).map(Qe=>Qe.id)),n(12,j=ze.refresh_scheduled?"Categories saved. The gateway is downloading the feeds now, so refresh in a moment to see the new counts.":"Categories saved. A download was already running, so the counts update when it finishes.")}catch(Ye){n(11,$=Ye.message)}finally{n(10,G=!1)}}async function at(Ye){if(confirm('Delete the policy "'+Ye.name+'"? Its devices move to the default policy.')){n(9,D=!0),n(11,$="");try{const ze=await fetch(o+"/"+Ye.id,{method:"DELETE",headers:js()});if(!ze.ok)throw new Error(await Ys(ze));n(0,S=S.filter(Qe=>Qe.id!==Ye.id)),await Fe(),n(12,j="Policy deleted; its devices now use the default policy.")}catch(ze){n(11,$=ze.message)}finally{n(9,D=!1)}}}async function ut(Ye){n(9,D=!0),n(11,$=""),n(12,j="");try{const ze=await fetch(s+"/"+Ye.id+"/apply",{method:"POST",headers:js()});if(!ze.ok)throw new Error(await Ys(ze));const Qe=await ze.json();n(0,S=[...S,xf(Qe.group)]),n(12,j=Ye.name+' was added as a policy. Assign devices to it under "Devices on this policy".')}catch(ze){n(11,$=ze.message)}finally{n(9,D=!1)}}function At(Ye){return S.some(ze=>ze.id===Ye.group_id)}async function xe(){const Ye=de.trim();if(!Ye)return;n(19,x=!0),n(21,ee=""),n(20,me=null);const ze=I.find(Bt=>Bt.id===X),Qe=Ye.includes("/"),He=Qe&&!Ye.includes("://")?"https://"+Ye:Ye,Tt={client_ip:(ze==null?void 0:ze.ipv4)||"",protocol:re};Qe?Tt.url=He:Tt.domain=Ye;try{const Bt=await fetch(f,{method:"POST",headers:js(!0),body:JSON.stringify(Tt)});if(!Bt.ok)throw new Error(await Ys(Bt));n(20,me=await Bt.json())}catch(Bt){n(21,ee=Bt.message)}finally{n(19,x=!1)}}let mt=!1,we={};_n(pe);const gt=()=>n(11,$=""),It=()=>n(12,j=""),Ht=()=>n(22,mt=!mt),Wt=Ye=>ut(Ye),qt=Ye=>n(23,we[Ye.id]=!we[Ye.id],we),Xt=Ye=>nt(Ye,ol);function Ce(Ye,ze){t.$$.not_equal(oe[ze.id],Ye)&&(oe[ze.id]=Ye,n(15,oe))}const se=Ye=>{nt(oe[Ye.id],Ye.id),n(15,oe[Ye.id]="",oe)},Le=Ye=>Ee(Ye),_t=Ye=>at(Ye);function zt(Ye){X=Ye,n(16,X)}function Be(Ye){de=Ye,n(17,de)}const Ot=Ye=>Ye.key==="Enter"&&xe();function kt(Ye){re=Ye,n(18,re)}const Pt=Ye=>n(4,M=Ye.detail);return t.$$.update=()=>{t.$$.dirty[1]&1536&&n(26,i=ve(C,I)),t.$$.dirty[1]&1024&&n(25,l=[...I].sort((Ye,ze)=>Ks(Ye).localeCompare(Ks(ze)))),t.$$.dirty[0]&1&&n(24,r=S.filter(Ye=>Ye.id!==ol).length)},[S,_,v,A,M,L,N,z,W,D,G,$,j,Q,le,oe,X,de,re,x,me,ee,mt,we,r,l,i,Ve,Ee,We,ge,be,ue,nt,dt,yt,at,ut,At,xe,C,I,gt,It,Ht,Wt,qt,Xt,Ce,se,Le,_t,zt,Be,Ot,kt,Pt]}class Hge extends De{constructor(e){super(),Re(this,e,zge,Nge,Ie,{},null,[-1,-1,-1,-1])}}function Uge(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Fge(t){let e;return{c(){e=q("Policies")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Gge(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[Uge]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[Fge]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Vge(t){let e,n,i,l,r,s,o,a;return e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[Gge]},$$scope:{ctx:t}}}),o=new Hge({}),{c(){F(e.$$.fragment),n=B(),i=R("h2"),i.textContent="Policies",l=B(),r=R("p"),r.textContent="Each device follows one policy. Pick what to block, turn on safe search or bedtime, and add devices to it.",s=B(),F(o.$$.fragment),P(r,"class","lead svelte-z5klpj")},m(u,f){H(e,u,f),y(u,n,f),y(u,i,f),y(u,l,f),y(u,r,f),y(u,s,f),H(o,u,f),a=!0},p(u,[f]){const c={};f&1&&(c.$$scope={dirty:f,ctx:u}),e.$set(c)},i(u){a||(b(e.$$.fragment,u),b(o.$$.fragment,u),a=!0)},o(u){k(e.$$.fragment,u),k(o.$$.fragment,u),a=!1},d(u){u&&(w(n),w(i),w(l),w(r),w(s)),U(e,u),U(o,u)}}}class Wge extends De{constructor(e){super(),Re(this,e,null,Vge,Ie,{})}}function Xy(t,e,n){const i=t.slice();return i[53]=e[n],i}function Ky(t,e,n){const i=t.slice();return i[56]=e[n],i}function $y(t,e,n){const i=t.slice();return i[59]=e[n],i}function Jy(t,e,n){const i=t.slice();return i[62]=e[n],i}function Qy(t,e,n){const i=t.slice();return i[62]=e[n],i}function xy(t,e,n){const i=t.slice();return i[67]=e[n],i}function e5(t,e,n){const i=t.slice();return i[70]=e[n],i}function t5(t,e,n){const i=t.slice();return i[73]=e[n],i}function n5(t,e,n){const i=t.slice();return i[59]=e[n],i}function i5(t,e,n){const i=t.slice();return i[73]=e[n],i}function l5(t,e,n){const i=t.slice();return i[73]=e[n],i}function r5(t,e,n){const i=t.slice();return i[59]=e[n],i}function s5(t,e,n){const i=t.slice();return i[84]=e[n],i}function o5(t,e,n){const i=t.slice();return i[87]=e[n],i}function a5(t){let e,n;return{c(){e=R("div"),n=q(t[6]),P(e,"class","error-message svelte-12fp22s")},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&64&&Z(n,i[6])},d(i){i&&w(e)}}}function qge(t){let e,n,i,l,r,s,o,a,u;function f(v){t[36](v)}let c={labelText:"Display Name",placeholder:"e.g., Vivienne's iPad"};t[2]!==void 0&&(c.value=t[2]),e=new Jn({props:c}),ft.push(()=>Yt(e,"value",f));function d(v){t[37](v)}let h={labelText:"Owner",helperText:"Descriptive label only — it does not change filtering.",placeholder:"e.g., Vivienne, Dad",style:"margin-top: 0.5rem;"};t[3]!==void 0&&(h.value=t[3]),l=new Jn({props:h}),ft.push(()=>Yt(l,"value",d));function g(v){t[38](v)}let _={labelText:"Category",helperText:"Descriptive label only — it does not change filtering.",placeholder:"e.g., kids, adults, iot",style:"margin-top: 0.5rem;"};return t[4]!==void 0&&(_.value=t[4]),o=new Jn({props:_}),ft.push(()=>Yt(o,"value",g)),{c(){F(e.$$.fragment),i=B(),F(l.$$.fragment),s=B(),F(o.$$.fragment)},m(v,S){H(e,v,S),y(v,i,S),H(l,v,S),y(v,s,S),H(o,v,S),u=!0},p(v,S){const A={};!n&&S[0]&4&&(n=!0,A.value=v[2],jt(()=>n=!1)),e.$set(A);const C={};!r&&S[0]&8&&(r=!0,C.value=v[3],jt(()=>r=!1)),l.$set(C);const I={};!a&&S[0]&16&&(a=!0,I.value=v[4],jt(()=>a=!1)),o.$set(I)},i(v){u||(b(e.$$.fragment,v),b(l.$$.fragment,v),b(o.$$.fragment,v),u=!0)},o(v){k(e.$$.fragment,v),k(l.$$.fragment,v),k(o.$$.fragment,v),u=!1},d(v){v&&(w(i),w(s)),U(e,v),U(l,v),U(o,v)}}}function u5(t){let e,n;return{c(){e=R("div"),n=q(t[13]),P(e,"class","error-message svelte-12fp22s")},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&8192&&Z(n,i[13])},d(i){i&&w(e)}}}function f5(t){let e;return{c(){e=R("div"),e.textContent="Policy saved.",P(e,"class","success-message svelte-12fp22s")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function c5(t,e){let n,i,l;return i=new Ln({props:{value:e[87].id,text:e[87].name||e[87].id}}),{key:t,first:null,c(){n=qe(),F(i.$$.fragment),this.first=n},m(r,s){y(r,n,s),H(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&1024&&(o.value=e[87].id),s[0]&1024&&(o.text=e[87].name||e[87].id),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(i,r)}}}function jge(t){let e,n,i=[],l=new Map,r,s;e=new Ln({props:{value:"",text:"Default policy"}});let o=ct(t[10].filter(nT));const a=u=>u[87].id;for(let u=0;u{u=null}),ce());let S=n;n=d(_),n===S?c[n].p(_,v):(fe(),k(c[S],1,1,()=>{c[S]=null}),ce(),i=c[n],i?i.p(_,v):(i=c[n]=f[n](_),i.c()),b(i,1),i.m(l.parentNode,l)),((C=_[15])==null?void 0:C.state)==="connected"?h?(h.p(_,v),v[0]&32768&&b(h,1)):(h=y5(_),h.c(),b(h,1),h.m(r.parentNode,r)):h&&(fe(),k(h,1,1,()=>{h=null}),ce());const A={};v[0]&2621440&&(A.disabled=_[21]||_[19]),v[2]&268435456&&(A.$$scope={dirty:v,ctx:_}),o.$set(A)},i(_){a||(b(u),b(i),b(h),b(o.$$.fragment,_),a=!0)},o(_){k(u),k(i),k(h),k(o.$$.fragment,_),a=!1},d(_){_&&(w(e),w(l),w(r),w(s)),u&&u.d(_),c[n].d(_),h&&h.d(_),U(o)}}}function Qge(t){let e,n;return e=new oo({props:{description:"Loading Tailscale peers..."}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function p5(t){let e,n;return e=new xi({props:{lowContrast:!0,hideCloseButton:!0,kind:$5(t[15].state),title:J5(t[15].state),subtitle:t[15].message||t[15].backend_state}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&32768&&(r.kind=$5(i[15].state)),l[0]&32768&&(r.title=J5(i[15].state)),l[0]&32768&&(r.subtitle=i[15].message||i[15].backend_state),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function xge(t){let e;return{c(){e=R("p"),e.textContent="No Tailscale peers are linked to this device.",P(e,"class","section-note svelte-12fp22s")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function e_e(t){let e,n=[],i=new Map,l,r=ct(t[16]);const s=o=>o[73].node_id;for(let o=0;ok(s[a],1,1,()=>{s[a]=null});return{c(){e=R("div"),n=R("span"),n.textContent="Informational WoL MAC:",i=B();for(let a=0;a{$=null}),ce())},i(le){W||(b(u.$$.fragment,le),b(c.$$.fragment,le),b($),W=!0)},o(le){k(u.$$.fragment,le),k(c.$$.fragment,le),k($),W=!1},d(le){le&&w(n),U(u),U(c),G&&G.d(),$&&$.d()}}}function y5(t){let e,n,i,l,r,s,o,a,u,f,c;function d(S){t[41](S)}let h={labelText:"Tailscale peer",helperText:"Choose an unlinked peer, then confirm the link.",disabled:t[21]||t[19],$$slots:{default:[l_e]},$$scope:{ctx:t}};t[18]!==void 0&&(h.selected=t[18]),i=new wr({props:h}),ft.push(()=>Yt(i,"selected",d)),s=new Rt({props:{kind:"primary",size:"field",disabled:t[21]||!t[18],$$slots:{default:[r_e]},$$scope:{ctx:t}}}),s.$on("click",t[29]);const g=[o_e,s_e],_=[];function v(S,A){return S[17].length?0:S[20]?1:-1}return~(a=v(t))&&(u=_[a]=g[a](t)),{c(){e=R("div"),n=R("div"),F(i.$$.fragment),r=B(),F(s.$$.fragment),o=B(),u&&u.c(),f=qe(),P(n,"class","assignment-select svelte-12fp22s"),P(e,"class","tailscale-link-row svelte-12fp22s")},m(S,A){y(S,e,A),T(e,n),H(i,n,null),T(e,r),H(s,e,null),y(S,o,A),~a&&_[a].m(S,A),y(S,f,A),c=!0},p(S,A){const C={};A[0]&2621440&&(C.disabled=S[21]||S[19]),A[0]&131072|A[2]&268435456&&(C.$$scope={dirty:A,ctx:S}),!l&&A[0]&262144&&(l=!0,C.selected=S[18],jt(()=>l=!1)),i.$set(C);const I={};A[0]&2359296&&(I.disabled=S[21]||!S[18]),A[0]&2097152|A[2]&268435456&&(I.$$scope={dirty:A,ctx:S}),s.$set(I);let M=a;a=v(S),a===M?~a&&_[a].p(S,A):(u&&(fe(),k(_[M],1,1,()=>{_[M]=null}),ce()),~a?(u=_[a],u?u.p(S,A):(u=_[a]=g[a](S),u.c()),b(u,1),u.m(f.parentNode,f)):u=null)},i(S){c||(b(i.$$.fragment,S),b(s.$$.fragment,S),b(u),c=!0)},o(S){k(i.$$.fragment,S),k(s.$$.fragment,S),k(u),c=!1},d(S){S&&(w(e),w(o),w(f)),U(i),U(s),~a&&_[a].d(S)}}}function T5(t,e){let n,i,l;return i=new Ln({props:{value:e[73].node_id,text:`${so(e[73])}${e[73].online?" (online)":" (offline)"}`}}),{key:t,first:null,c(){n=qe(),F(i.$$.fragment),this.first=n},m(r,s){y(r,n,s),H(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&131072&&(o.value=e[73].node_id),s[0]&131072&&(o.text=`${so(e[73])}${e[73].online?" (online)":" (offline)"}`),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(i,r)}}}function l_e(t){let e,n,i=[],l=new Map,r,s;e=new Ln({props:{value:"",text:"Choose a peer"}});let o=ct(t[17]);const a=u=>u[73].node_id;for(let u=0;uo[73].node_id;for(let o=0;o0&&r<0||l<0&&r>0,o=this.getComponentContainer();if(!s){o.selectAll("line.domain").remove();return}const[a,u]=this.services.cartesianScales.getDomainScale().range();let f=+i(0)+.5;f||(f=i.range()[0]);const c=QE({x0:a,x1:u,y0:f,y1:f},this.services.cartesianScales.getOrientation());bt.appendOrSelect(o,"line.domain").transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"zero-line-update",animate:e})).attr("y1",c.y0).attr("y2",c.y1).attr("x1",c.x0).attr("x2",c.x1)}}class o6 extends MM{formatTooltipData(e){return e.reverse()}}class J0 extends Xn{getBarWidth(){const e=this.getOptions();if(e.bars.width)return e.bars.width;const n=this.model.getDisplayData().length,i=this.services.cartesianScales.getMainXScale(),l=bt.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!i.step){const r=Te(e,"bars","spacingFactor");return Math.min(e.bars.maxWidth,l*r/n)}return Math.min(e.bars.maxWidth,i.step()/2)}isOutsideZoomedDomain(e,n){if(this.model.getDisplayData().length<=1)return!1;const i=this.model.get("zoomDomain");if(i!==void 0){const l=this.services.cartesianScales.getDomainScale();return el(i[1])}return!1}}class wme extends J0{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=wn.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(l=>this.services.transitions.setupTransition({transition:l,name:"legend-hover-bar"})).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const n=this.model.getDisplayData(this.configs.groups),i=this.getOptions(),{groupMapsTo:l}=i.data;this.setGroupScale();const r=this.getComponentContainer({withinChartClip:!0}),s=Ou(n.map(f=>{const c=this.services.cartesianScales.getDomainIdentifier(f);return f[c]&&typeof f[c].toString=="function"?f[c].toString():f[c]})),o=r.selectAll("g.bars").data(s,f=>f);o.exit().attr("opacity",0).remove();const a=o.enter().append("g").classed("bars",!0).attr("role",fi.GROUP).attr("data-name","bars").merge(o);a.transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"bar-group-update-enter",animate:e})).attr("transform",f=>{const c=this.services.cartesianScales.getDomainValue(f)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===hl.VERTICAL?`translate(${c}, 0)`:`translate(0, ${c})`});const u=a.selectAll("path.bar").data(f=>this.getDataCorrespondingToLabel(f),f=>f[l]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"bar-update-enter",animate:e})).attr("class",f=>this.model.getColorClassName({classNameTypes:[Ii.FILL],dataGroupName:f[l],originalClassName:"bar"})).style("fill",f=>this.model.getFillColor(f[l])).attr("d",f=>{const c=this.groupScale(f[l]),d=this.getBarWidth(),h=c,g=c+d,_=this.services.cartesianScales.getRangeAxisPosition({datum:f}),v=this.services.cartesianScales.getValueThroughAxisPosition(_,0),S=this.services.cartesianScales.getRangeValue(f),A=this.services.cartesianScales.getDomainValue(f)-d/2,C=A+d;if(!this.isOutsideZoomedDomain(A,C))return X0({x0:h,x1:g,y0:v,y1:S},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",fi.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",f=>f.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(n,i){const l=ht(this);l.classed("hovered",!0),e.services.events.dispatchEvent(je.Bar.BAR_MOUSEOVER,{event:n,element:l,datum:i}),e.services.events.dispatchEvent(je.Tooltip.SHOW,{event:n,hoveredElement:l,data:[i]})}).on("mousemove",function(n,i){const l=ht(this);e.services.events.dispatchEvent(je.Bar.BAR_MOUSEMOVE,{event:n,element:l,datum:i}),e.services.events.dispatchEvent(je.Tooltip.MOVE,{event:n})}).on("click",function(n,i){e.services.events.dispatchEvent(je.Bar.BAR_CLICK,{event:n,element:ht(this),datum:i})}).on("mouseout",function(n,i){const l=ht(this);l.classed("hovered",!1),e.services.events.dispatchEvent(je.Bar.BAR_MOUSEOUT,{event:n,element:l,datum:i}),e.services.events.dispatchEvent(je.Tooltip.HIDE,{hoveredElement:l})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(e){return this.model.getDisplayData(this.configs.groups).filter(n=>{const i=this.services.cartesianScales.getDomainIdentifier(n);return n[i].toString()===e})}getGroupWidth(){const e=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*e.length+n}getDomainScaleStep(){const e=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let i=this.defaultStepFactor;if(typeof e.step=="function")i=e.step();else if(n.length>0){const l=n.find(r=>{var s;return((s=r.data)==null?void 0:s.length)>1});if(l){const r=this.services.cartesianScales.getDomainIdentifier(l.data[0]);i=Math.abs(e(l.data[1][r])-e(l.data[0][r]))}}return i}getTotalGroupPadding(){const e=this.model.getGroupedData(this.configs.groups);return e.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(e.length-1)}getBarWidth(){const e=this.getOptions(),n=Te(e,"bars","width"),i=Te(e,"bars","maxWidth");if(n!==null&&(i===null||n<=i))return n;const l=this.model.getGroupedData(this.configs.groups).length,r=this.getTotalGroupPadding();return Math.min(i,(this.getDomainScaleStep()-r)/l)}setGroupScale(){const e=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=_0().domain(e).rangeRound([0,this.getGroupWidth()])}}class yme extends J0{constructor(){super(...arguments),this.type="simple-bar",this.renderType=wn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(l=>this.services.transitions.setupTransition({transition:l,name:"legend-hover-simple-bar"})).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const n=this.getOptions(),{groupMapsTo:i}=n.data,l=this.getComponentContainer({withinChartClip:!0}),r=this.model.getDisplayData(this.configs.groups),s=this.services.cartesianScales.getOrientation(),o=l.selectAll("path.bar").data(r,a=>a[i]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(a=>this.services.transitions.setupTransition({transition:a,name:"bar-update-enter",animate:e})).attr("class",a=>this.model.getColorClassName({classNameTypes:[Ii.FILL],dataGroupName:a[i],originalClassName:"bar"})).style("fill",a=>this.model.getFillColor(a[i])).attr("d",a=>{const u=this.services.cartesianScales.getRangeIdentifier(),f=this.getBarWidth(),c=a[u],d=this.services.cartesianScales.getDomainValue(a)-f/2,h=d+f;let g,_;if(Array.isArray(c)&&c.length===2)g=this.services.cartesianScales.getRangeValue(c[0]),_=this.services.cartesianScales.getRangeValue(c[1]);else{const S=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,S)),_=this.services.cartesianScales.getRangeValue(a)}const v=Math.abs(_-g);if(v!==0&&v<2&&(c>0&&s===hl.VERTICAL||c<0&&s===hl.HORIZONTAL?_=g-2:_=g+2),!this.isOutsideZoomedDomain(d,h))return X0({x0:d,x1:h,y0:g,y1:_},s)}).attr("opacity",1).attr("role",fi.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",a=>a.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(n,i){const l=ht(this);l.classed("hovered",!0),e.services.events.dispatchEvent(je.Bar.BAR_MOUSEOVER,{event:n,element:l,datum:i}),e.services.events.dispatchEvent(je.Tooltip.SHOW,{event:n,hoveredElement:l,data:[i]})}).on("mousemove",function(n,i){e.services.events.dispatchEvent(je.Bar.BAR_MOUSEMOVE,{event:n,element:ht(this),datum:i}),e.services.events.dispatchEvent(je.Tooltip.MOVE,{event:n})}).on("click",function(n,i){e.services.events.dispatchEvent(je.Bar.BAR_CLICK,{event:n,element:ht(this),datum:i})}).on("mouseout",function(n,i){const l=ht(this);l.classed("hovered",!1),e.services.events.dispatchEvent(je.Bar.BAR_MOUSEOUT,{event:n,element:l,datum:i}),e.services.events.dispatchEvent(je.Tooltip.HIDE,{hoveredElement:l})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Tme extends Xn{constructor(){super(...arguments),this.type="area-stacked",this.renderType=wn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,i=this.getOptions(),{groupMapsTo:l}=i.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>Te(r,0,l)!==n.datum().name?Fr.opacity.unselected:Fr.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",Fr.opacity.selected)}}init(){const e=this.services.events;e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const n=this.getComponentContainer({withinChartClip:!0}),i=this,l=this.getOptions(),{groupMapsTo:r}=l.data,s=Object.keys(l.axes).some(h=>l.axes[h].percentage),o=this.model.getStackedData({percentage:s,groups:this.configs.groups}),a=Te(o,0,0),u=this.services.cartesianScales.getDomainAxisPosition({datum:a}),f=this.services.cartesianScales.getRangeAxisPosition({datum:a}),c=this.services.cartesianScales.getScaleByPosition(f),d=n.selectAll("path.area").data(o,h=>Te(h,0,r));this.areaGenerator=O0().x(h=>this.services.cartesianScales.getValueThroughAxisPosition(u,h.data.sharedStackKey)).y0(h=>c(h[0])).y1(h=>c(h[1])).curve(this.services.curves.getD3Curve()),d.exit().attr("opacity",0).remove(),d.enter().append("path").attr("opacity",0).merge(d).data(o,h=>Te(h,0,r)).attr("class","area").attr("class",h=>this.model.getColorClassName({classNameTypes:[Ii.FILL],dataGroupName:Te(h,0,r),originalClassName:"area"})).style("fill",h=>i.model.getFillColor(Te(h,0,r))).attr("role",fi.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",h=>Te(h,0,r)).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"area-update-enter",animate:e})).attr("opacity",Fr.opacity.selected).attr("d",this.areaGenerator)}}class Sme extends J0{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=wn.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:n}=e.detail,{groupMapsTo:i}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(l=>this.services.transitions.setupTransition({transition:l,name:"legend-hover-bar"})).attr("opacity",l=>l[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:l}=i.data,r=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),s=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(r,u=>Te(u,0,l));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",fi.GROUP).attr("data-name","bars");const a=n.selectAll("g.bars").selectAll("path.bar").data(u=>u,u=>u.data.sharedStackKey);a.exit().remove(),a.enter().append("path").merge(a).classed("bar",!0).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"bar-update-enter",animate:e})).attr("class",u=>this.model.getColorClassName({classNameTypes:[Ii.FILL],dataGroupName:u[l],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[l])).attr("d",u=>{const f=u.data.sharedStackKey,c=this.getBarWidth(),d=this.services.cartesianScales.getDomainValue(f)-c/2,h=d+c,g=this.services.cartesianScales.getRangeValue(u[0]);let _=this.services.cartesianScales.getRangeValue(u[1]);if(!this.isOutsideZoomedDomain(d,h)){if(Math.abs(_-g)>0&&Math.abs(_-g)>i.bars.dividerSize){const v=u[0]<0&&u[1]<=0;v&&s.length>1?this.services.cartesianScales.getOrientation()===hl.VERTICAL?_+=u[1]===0?2:1:_-=1:v||(this.services.cartesianScales.getOrientation()===hl.VERTICAL?_+=1:_-=1)}return X0({x0:d,x1:h,y0:g,y1:_},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",fi.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>u[1]-u[0]),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:n}=e.data,i=this;this.parent.selectAll("path.bar").on("mouseover",function(l,r){const s=ht(this);s.classed("hovered",!0),i.services.events.dispatchEvent(je.Bar.BAR_MOUSEOVER,{event:l,element:s,datum:r});let o=i.model.getDisplayData(i.configs.groups).find(a=>{const u=i.services.cartesianScales.getDomainIdentifier(a),f=i.services.cartesianScales.getRangeIdentifier(a);return a[f]===r.data[r[n]]&&a[u].toString()===r.data.sharedStackKey&&a[n]===r[n]});if(o===void 0){const a=i.services.cartesianScales.getDomainIdentifier(),u=i.services.cartesianScales.getRangeIdentifier();o={[a]:r.data.sharedStackKey,[u]:r.data[r[n]],[n]:r[n]}}i.services.events.dispatchEvent(je.Tooltip.SHOW,{event:l,hoveredElement:s,data:[o]})}).on("mousemove",function(l,r){const s=ht(this);i.services.events.dispatchEvent(je.Bar.BAR_MOUSEMOVE,{event:l,element:s,datum:r}),i.services.events.dispatchEvent(je.Tooltip.MOVE,{event:l})}).on("click",function(l,r){i.services.events.dispatchEvent(je.Bar.BAR_CLICK,{event:l,element:ht(this),datum:r})}).on("mouseout",function(l,r){const s=ht(this);s.classed("hovered",!1),i.services.events.dispatchEvent(je.Bar.BAR_MOUSEOUT,{event:l,element:s,datum:r}),i.services.events.dispatchEvent(je.Tooltip.HIDE,{hoveredElement:s})})}getBarWidth(){const e=this.getOptions();if(Te(e,"bars","width"))return e.bars.width;const n=this.services.cartesianScales.getMainXScale(),i=bt.getSVGElementSize(this.parent,{useAttrs:!0}).width,l=this.model.getStackKeys().length,r=Te(e,"bars","spacingFactor");return n.step?Math.min(e.bars.maxWidth,n.step()/2):Math.min(e.bars.maxWidth,i*r/l)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(je.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(je.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Eme extends cu{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=wn.SVG}render(e){if(!Te(this.getOptions(),"points","enabled"))return;const n=this.getComponentContainer({withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:l}=i.data,r=Object.keys(i.axes).some(f=>i.axes[f].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:r}),o=n.selectAll("g.dots").data(s,f=>Te(f,0,l));o.exit().attr("opacity",0).remove();const a=o.enter().append("g").classed("dots",!0).attr("role",fi.GROUP).merge(o).selectAll("circle.dot").data(f=>f);a.exit().attr("opacity",0).remove();const u=a.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(a).datum(f=>{const c=f[l],d=this.services.cartesianScales.getDomainIdentifier(f),h=this.services.cartesianScales.getRangeIdentifier(f);return{[l]:c,[d]:f.data.sharedStackKey,[h]:f[1]}});this.styleCircles(u,e),this.addEventListeners()}getTooltipData(e,n){const i=this.getOptions(),{groupMapsTo:l}=i.data,r=Object.keys(i.axes).some(a=>i.axes[a].percentage),s=this.model.getStackedData({groups:this.configs.groups,percentage:r}),o=[];return s.forEach((a,u)=>{a.forEach((f,c)=>{const d=f[l],h=f.data.sharedStackKey;let g=f.data[d];const _=f[1],v=this.services.cartesianScales.getDomainIdentifier(f),S=this.services.cartesianScales.getRangeIdentifier(f);g!=null&&e===this.services.cartesianScales.getDomainValue(h)&&n===this.services.cartesianScales.getRangeValue(_)&&(r&&(g=this.model.getStackedData({groups:this.configs.groups})[u][c].data[d]),g!==null&&o.push({[l]:d,[v]:h,[S]:g}))})}),this.model.getDisplayData(this.configs.groups).filter(a=>{const u=this.services.cartesianScales.getDomainIdentifier(a),f=this.services.cartesianScales.getRangeIdentifier(a);return o.find(c=>c[l]==a[l]&&c[u]==a[u]&&c[f]==a[f])!==void 0})}}function AM(t,e){Qt(2,arguments);var n=gn(t),i=vi(e);return isNaN(i)?new Date(NaN):(i&&n.setDate(n.getDate()+i),n)}function Q0(t,e){Qt(2,arguments);var n=gn(t),i=vi(e);if(isNaN(i))return new Date(NaN);if(!i)return n;var l=n.getDate(),r=new Date(n.getTime());r.setMonth(n.getMonth()+i+1,0);var s=r.getDate();return l>=s?r:(n.setFullYear(r.getFullYear(),r.getMonth(),l),n)}var Mme=36e5;function CM(t,e){Qt(2,arguments);var n=vi(e);return Ad(t,n*Mme)}function a6(t){Qt(1,arguments);var e=gn(t);return e.setHours(0,0,0,0),e}var Ome=864e5;function Ame(t,e){Qt(2,arguments);var n=a6(t),i=a6(e),l=n.getTime()-m1(n),r=i.getTime()-m1(i);return Math.round((l-r)/Ome)}var Cme=6e4;function F1(t,e){Qt(2,arguments);var n=vi(e);return Ad(t,n*Cme)}function G1(t,e){Qt(2,arguments);var n=vi(e);return Ad(t,n*1e3)}function LM(t,e){Qt(2,arguments);var n=vi(e);return Q0(t,n*12)}function du(t,e){Qt(2,arguments);var n=gn(t),i=gn(e),l=n.getTime()-i.getTime();return l<0?-1:l>0?1:l}var Lme=6e4,Ime=36e5;function Rme(t,e){Qt(2,arguments);var n=gn(t),i=gn(e),l=n.getFullYear()-i.getFullYear(),r=n.getMonth()-i.getMonth();return l*12+r}function Dme(t,e){Qt(2,arguments);var n=gn(t),i=gn(e);return n.getFullYear()-i.getFullYear()}function u6(t,e){var n=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return n<0?-1:n>0?1:n}function Pme(t,e){Qt(2,arguments);var n=gn(t),i=gn(e),l=u6(n,i),r=Math.abs(Ame(n,i));n.setDate(n.getDate()-l*r);var s=+(u6(n,i)===-l),o=l*(r-s);return o===0?0:o}function x0(t,e){return Qt(2,arguments),gn(t).getTime()-gn(e).getTime()}var f6={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},Nme="trunc";function eg(t){return t?f6[t]:f6[Nme]}function Bme(t,e,n){Qt(2,arguments);var i=x0(t,e)/Ime;return eg(n==null?void 0:n.roundingMethod)(i)}function c6(t,e,n){Qt(2,arguments);var i=x0(t,e)/Lme;return eg(n==null?void 0:n.roundingMethod)(i)}function zme(t){Qt(1,arguments);var e=gn(t);return e.setHours(23,59,59,999),e}function Hme(t){Qt(1,arguments);var e=gn(t),n=e.getMonth();return e.setFullYear(e.getFullYear(),n+1,0),e.setHours(23,59,59,999),e}function Ume(t){Qt(1,arguments);var e=gn(t);return zme(e).getTime()===Hme(e).getTime()}function Fme(t,e){Qt(2,arguments);var n=gn(t),i=gn(e),l=du(n,i),r=Math.abs(Rme(n,i)),s;if(r<1)s=0;else{n.getMonth()===1&&n.getDate()>27&&n.setDate(30),n.setMonth(n.getMonth()-l*r);var o=du(n,i)===-l;Ume(gn(t))&&r===1&&du(t,i)===1&&(o=!1),s=l*(r-Number(o))}return s===0?0:s}function d6(t,e,n){Qt(2,arguments);var i=x0(t,e)/1e3;return eg(n==null?void 0:n.roundingMethod)(i)}function Gme(t,e){Qt(2,arguments);var n=gn(t),i=gn(e),l=du(n,i),r=Math.abs(Dme(n,i));n.setFullYear(1584),i.setFullYear(1584);var s=du(n,i)===-l,o=l*(r-Number(s));return o===0?0:o}function Vme(t,e){Qt(2,arguments);var n=vi(e);return AM(t,-n)}function Wme(t,e){Qt(2,arguments);var n=vi(e);return Q0(t,-n)}function qme(t,e){Qt(2,arguments);var n=vi(e);return CM(t,-n)}function h6(t,e){Qt(2,arguments);var n=vi(e);return F1(t,-n)}function m6(t,e){Qt(2,arguments);var n=vi(e);return G1(t,-n)}function jme(t,e){Qt(2,arguments);var n=vi(e);return LM(t,-n)}function Yme(t){var e=t==null?0:t.length;return e?G0(t,1):[]}class Zme extends Qr{zoomIn(e,n,i){let l,r,s;const o=i||zw;e&&(l=e.x,r=e.y,s=2);const{width:a,height:u}=bt.getSVGElementSize(this.services.domUtils.getHolder(),{useClientDimensions:!0});n.transition().duration(o.duration).ease(o.ease).attr("transform",`translate(${a/2}, ${u/2}) scale(${s}) translate(${-l},${-r})`),this.services.events.dispatchEvent(je.CanvasZoom.CANVAS_ZOOM_IN,{element:ht(e)})}zoomOut(e,n){const i=n||zw;e.transition().duration(i.duration).ease(i.ease).attr("transform",""),this.services.events.dispatchEvent(je.CanvasZoom.CANVAS_ZOOM_OUT)}}class Xme extends Qr{init(){this.documentFragment=document.createDocumentFragment()}addEventListener(e,n){this.documentFragment.addEventListener(e,n)}removeEventListener(e,n){this.documentFragment.removeEventListener(e,n)}dispatchEvent(e,n){let i;n?i=new CustomEvent(e,{detail:n}):(i=document.createEvent("Event"),i.initEvent(e,!1,!0)),this.documentFragment.dispatchEvent(i)}}class Kme extends Qr{constructor(e,n){super(e,n)}downloadCSV(e,n){const i=document.createElement("a"),l="text/csv;encoding:utf-8";if(navigator.msSaveBlob)navigator.msSaveBlob(new Blob([e],{type:l}),n);else if(URL&&"download"in i){const r=URL.createObjectURL(new Blob([e],{type:l}));i.href=r,i.setAttribute("download",n),document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}else location.href=`data:application/octet-stream,${encodeURIComponent(e)}`}downloadImage(e,n){const i=document.createElement("a");i.download=n,i.href=e,document.body.appendChild(i),i.click(),document.body.removeChild(i)}}class $me extends Qr{constructor(){super(...arguments),this.pendingTransitions={}}init(){var e;(e=this.services.events)==null||e.addEventListener(je.Model.UPDATE,()=>{this.pendingTransitions={}})}setupTransition({transition:e,name:n,animate:i}){return this.pendingTransitions[e._id]=e,e.on("end interrupt cancel",()=>{delete this.pendingTransitions[e._id]}),this.model.getOptions().animations===!1||i===!1?e.duration(0):e.duration(Te(Uw,n,"duration")||Uw.default.duration)}getPendingTransitions(){return this.pendingTransitions}}class Jme extends Qr{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:e=null}={}){if(this.dualAxes&&e){const n=this.model.getOptions(),{groupMapsTo:i}=n.data,l=Te(n,"axes",this.secondaryDomainAxisPosition),r=e[i];if(l!=null&&l.correspondingDatasets&&l.correspondingDatasets.includes(r))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:e=null,groups:n=null}={}){if(this.dualAxes){const i=this.model.getOptions(),{groupMapsTo:l}=i.data,r=Te(i,"axes",this.secondaryRangeAxisPosition);let s;if(e!==null?s=e[l]:n&&n.length>0&&(s=n[0]),r!=null&&r.correspondingDatasets&&r.correspondingDatasets.includes(s))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(e){return Te(this.model.getOptions(),"axes",e)}getDomainAxisOptions(){const e=this.getDomainAxisPosition();return this.getAxisOptions(e)}getRangeAxisOptions(){const e=this.getRangeAxisPosition();return this.getAxisOptions(e)}getScaleLabel(e){return this.getAxisOptions(e).title||(e===it.BOTTOM||e===it.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(it).map(e=>it[e]).forEach(e=>{this.scales[e]=this.createScale(e)})}findDomainAndRangeAxes(){const e=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),i=this.findDomainAndRangeAxesPositions(e,n);this.domainAxisPosition=i.primaryDomainAxisPosition,this.rangeAxisPosition=i.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=i.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=i.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===it.LEFT||this.rangeAxisPosition===it.RIGHT)&&(this.domainAxisPosition===it.BOTTOM||this.domainAxisPosition===it.TOP)?this.orientation=hl.VERTICAL:this.orientation=hl.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var e,n,i,l;const r=this.model.getOptions(),s=Te(r,"axes");((e=s[it.LEFT])!=null&&e.correspondingDatasets&&s[it.RIGHT]||(n=s[it.RIGHT])!=null&&n.correspondingDatasets&&s[it.LEFT]||(i=s[it.TOP])!=null&&i.correspondingDatasets&&s[it.BOTTOM]||(l=s[it.BOTTOM])!=null&&l.correspondingDatasets&&s[it.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(e){const n=Te(this.model.getOptions(),"axes",e,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${e} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[e]===Nt.LINEAR||this.scaleTypes[e]===Nt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[e]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(e){return this.scales[e]}getScaleTypeByPosition(e){return this.scaleTypes[e]}getDomainAxisScaleType(){const e=this.getDomainAxisPosition();return this.getScaleTypeByPosition(e)}getRangeAxisScaleType(){const e=this.getRangeAxisPosition();return this.getScaleTypeByPosition(e)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const e=[it.BOTTOM,it.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>e.indexOf(n)>-1)}getMainYAxisPosition(){const e=[it.LEFT,it.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>e.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(e,n,i,l){const r=this.model.getOptions(),s=Te(r,"axes")[i],{mapsTo:o}=s,a=Te(l,o)!==null?l[o]:l;let u;switch(n){case Nt.LABELS:u=e(a)+e.step()/2;break;case Nt.TIME:u=e(new Date(a));break;default:u=e(a)}return u}getBoundedScaledValues(e){const{bounds:n}=this.model.getOptions(),i=this.getRangeAxisPosition({datum:e}),l=this.scales[i],r=this.model.getOptions(),s=Te(r,"axes")[i],{mapsTo:o}=s,a=e[o]!==void 0?e[o]:e;return[l(Te(e,n.upperBoundMapsTo)!==null?e[n.upperBoundMapsTo]:a),l(Te(e,n.lowerBoundMapsTo)!==null?e[n.lowerBoundMapsTo]:a)]}getValueThroughAxisPosition(e,n){const i=this.scaleTypes[e],l=this.scales[e];return this.getValueFromScale(l,i,e,n)}getDomainValue(e){const n=this.getDomainAxisPosition({datum:e});return this.getValueThroughAxisPosition(n,e)}getRangeValue(e){const n=this.getRangeAxisPosition({datum:e});return this.getValueThroughAxisPosition(n,e)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(e){const n=this.model.getOptions();return Te(n,"axes",this.getDomainAxisPosition({datum:e}),"mapsTo")}getRangeIdentifier(e){const n=this.model.getOptions();return Te(n,"axes",this.getRangeAxisPosition({datum:e}),"mapsTo")}extendsDomain(e,n){const i=this.model.getOptions(),l=Te(i,"axes",e);if(l.scaleType===Nt.TIME){const r=Te(i,"timeScale","addSpaceOnEdges");return Qme(n,r)}else return xme(n,ks.paddingRatio,l.scaleType)}findVerticalAxesPositions(){const e=this.model.getOptions(),n=Te(e,"axes"),i=this.isDualAxes();return Te(n,it.LEFT)===null&&Te(n,it.RIGHT)!==null||Te(n,it.RIGHT,"main")===!0||i&&Te(n,it.LEFT,"correspondingDatasets")?{primary:it.RIGHT,secondary:it.LEFT}:{primary:it.LEFT,secondary:it.RIGHT}}findHorizontalAxesPositions(){const e=this.model.getOptions(),n=Te(e,"axes"),i=this.isDualAxes();return Te(n,it.BOTTOM)===null&&Te(n,it.TOP)!==null||Te(n,it.TOP,"main")===!0||i&&Te(n,it.BOTTOM,"correspondingDatasets")?{primary:it.TOP,secondary:it.BOTTOM}:{primary:it.BOTTOM,secondary:it.TOP}}findDomainAndRangeAxesPositions(e,n){const i=this.model.getOptions(),l=Te(i,"axes",e.primary),r=Te(i,"axes",n.primary),s=l.scaleType||Nt.LINEAR,o=r.scaleType||Nt.LINEAR,a={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return a.primaryDomainAxisPosition=n.primary,a.primaryRangeAxisPosition=e.primary,a.secondaryDomainAxisPosition=n.secondary,a.secondaryRangeAxisPosition=e.secondary,(!(o===Nt.LABELS||o===Nt.TIME)&&s===Nt.LABELS||s===Nt.TIME)&&(a.primaryDomainAxisPosition=e.primary,a.primaryRangeAxisPosition=n.primary,a.secondaryDomainAxisPosition=e.secondary,a.secondaryRangeAxisPosition=n.secondary),a}getScaleDomain(e){const n=this.model.getOptions(),i=Te(n,"axes",e),l=Te(n,"bounds"),{includeZero:r}=i,s=Te(i,"scaleType")||Nt.LINEAR;if(this.model.isDataEmpty())return[];if(i.binned){const{bins:S}=this.model.getBinConfigurations();return[0,WJ(S,A=>A.length)]}else if(i.limitDomainToBins){const{bins:S}=this.model.getBinConfigurations(),A=this.model.getStackKeys({bins:S});return[A[0].split("-")[0],A[A.length-1].split("-")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:a,mapsTo:u,percentage:f,thresholds:c}=i,{reference:d,compareTo:h}=ks.ratio;if(i.domain)return s===Nt.LABELS?i.domain:(s===Nt.TIME&&(i.domain=i.domain.map(S=>S.getTime===void 0?new Date(S):S)),this.extendsDomain(e,i.domain));if(f)return[0,100];if(i&&s===Nt.LABELS)return Ou(o.map(S=>S[u]));let g,_;const v=this.model.getDataGroupNames();if(s===Nt.LABELS_RATIO)return o.map(S=>`${S[d]}/${S[h]}`);if(s===Nt.TIME)_=o.map(S=>+new Date(S[u]));else if(l&&n.axes)_=[],o.forEach(S=>{_.push(S[u]),S[l.upperBoundMapsTo]&&_.push(S[l.upperBoundMapsTo]),S[l.lowerBoundMapsTo]&&_.push(S[l.lowerBoundMapsTo])});else if(i.stacked===!0&&v&&e===this.getRangeAxisPosition()){const{groupMapsTo:S}=n.data,A=this.model.getDataValuesGroupedByKeys({groups:v}),C=o.filter(M=>!v.includes(M[S])),I=[];A.forEach(M=>{const{...L}=M;let N=0,z=0;Object.values(L).forEach(W=>{isNaN(W)||(W<0?z+=W:N+=W)}),I.push([z,N])}),_=[...Yme(I),...C.map(M=>M[u])]}else _=[],o.forEach(S=>{const A=S[u];Array.isArray(A)&&A.length===2?(_.push(A[0]),_.push(A[1])):(a&&_.push(Math.max(S[u],S[a])),_.push(A))});return s!==Nt.TIME&&s!==Nt.LOG&&r&&_.push(0),c&&c.length>0&&c.forEach(S=>{const A=Te(S,"value");A!==null&&_.push(A)}),g=Yo(_),g=this.extendsDomain(e,g),g}createScale(e){const n=this.model.getOptions(),i=Te(n,"axes",e);if(!i)return null;const l=Te(i,"scaleType")||Nt.LINEAR;this.scaleTypes[e]=l;let r;return l===Nt.TIME?r=YS():l===Nt.LOG?r=HS().base(i.base||10):l===Nt.LABELS||l===Nt.LABELS_RATIO?r=_0():r=Hc(),r.domain(this.getScaleDomain(e)),r}getHighestDomainThreshold(){const e=Te(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:i}=e[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const l=this.getDomainScale(),r=i.sort((s,o)=>o.value-s.value)[0];return this.getScaleTypeByPosition(n)===Nt.TIME&&(typeof r.value=="string"||r.value.getTime===void 0)&&(r.value=new Date(r.value)),{threshold:r,scaleValue:l(r.value)}}getHighestRangeThreshold(){const e=Te(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:i}=e[n];if(!Array.isArray(i)||Array.isArray(i)&&!i.length)return null;const l=this.getRangeScale(),r=i.sort((s,o)=>o.value-s.value)[0];return{threshold:r,scaleValue:l(r.value)}}}function Qme(t,e){const n=new Date(t[0]),i=new Date(t[1]);return Gme(i,n)>1?[jme(n,e),LM(i,e)]:Fme(i,n)>1?[Wme(n,e),Q0(i,e)]:Pme(i,n)>1?[Vme(n,e),AM(i,e)]:Bme(i,n)>1?[qme(n,e),CM(i,e)]:c6(i,n)>30?[h6(n,e*30),F1(i,e*30)]:c6(i,n)>1?[h6(n,e),F1(i,e)]:d6(i,n)>15?[m6(n,e*15),G1(i,e*15)]:d6(i,n)>1?[m6(n,e),G1(i,e)]:[n,i]}function xme([t,e],n,i){const l=(e-t)*n,r=e<=0&&e+l>0?0:e+l;let s=t>=0&&t-l<0?0:t-l;if(i===Nt.LOG&&s<=0){if(t<=0)throw Error("Data must have values greater than 0 if log scale type is used.");s=t}return[s,r]}class e1e extends Qr{constructor(){super(...arguments),this.curveTypes={curveLinear:E0,curveLinearClosed:Vie,curveBasis:Rie,curveBasisClosed:Die,curveBasisOpen:Pie,curveBundle:Nie,curveCardinal:Bie,curveCardinalClosed:zie,curveCardinalOpen:Hie,curveCatmullRom:Uie,curveCatmullRomClosed:Fie,curveCatmullRomOpen:Gie,curveMonotoneX:Wie,curveMonotoneY:qie,curveNatural:jie,curveStep:Yie,curveStepAfter:Xie,curveStepBefore:Zie}}getD3Curve(){let e="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?e=n:e=n.name),this.curveTypes[e]){let i=this.curveTypes[e];return n&&Object.keys(n).forEach(l=>{i[l]&&(i=i[l](n[l]))}),i}return console.warn(`The curve type '${e}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class t1e extends Qr{isZoomBarEnabled(){if(!this.services.cartesianScales||!Te(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const e=this.services.cartesianScales.getMainXAxisPosition(),n=Te(this.model.getOptions(),"axes",e,"scaleType");return e===it.BOTTOM&&n===Nt.TIME}getZoomBarData(){const e=this.model.getZoomBarData();return e&&e.length>1?e:this.model.getDisplayData()}getDefaultZoomBarDomain(e){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=e||this.services.zoom.getZoomBarData(),{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales undefined");const l=i.getMainXAxisPosition(),r=i.getDomainIdentifier(),s=Te(this.model.getOptions(),"axes",l,"domain");if(Array.isArray(s)&&s.length===2)return s;if(!l)throw new Error("Not defined: mainXAxisPosition");return i.extendsDomain(l,Yo(n,o=>o[r]))}handleDomainChange(e,n={dispatchEvent:!0}){var i;this.model.set({zoomDomain:e},{animate:!1}),n.dispatchEvent&&((i=this.services.events)==null||i.dispatchEvent(je.ZoomDomain.CHANGE,{newDomain:e}))}getZoomRatio(){return Te(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(e,n){var i;const l=this.model.get("zoomDomain"),r=Object.assign({stacked:!1},n),s=Te(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&l){const o=r.stacked?"sharedStackKey":(i=this.services.cartesianScales)==null?void 0:i.getDomainIdentifier(),a=e.filter(u=>new Date(u[o])>=l[0]&&new Date(u[o])<=l[1]);if(a.length>0)return a}return e}zoomIn(e=this.getZoomRatio()){var n;const i=this.model.get("zoomDomain"),l=Sl.handleWidth,r=(n=this.services.cartesianScales)==null?void 0:n.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const s=r(i[0]),o=r(i[1]);if(o-s=d&&(c=s+u/2-l/2,d=o-u/2+l/2);const h=[r.invert(c),r.invert(d)];(i[0].valueOf()!==h[0].valueOf()||i[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h)}zoomOut(e=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const i=this.services.cartesianScales.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const l=i(n[0]),r=i(n[1]),s=i.range(),o=(s[1]-s[0])/2*(e/2),a=Math.max(l-o,s[0]),u=Math.min(r+o,s[1]),f=[i.invert(a),i.invert(u)];(n[0].valueOf()!==f[0].valueOf()||n[1].valueOf()!==f[1].valueOf())&&this.handleDomainChange(f)}resetZoomDomain(){const e=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(e[0].valueOf()!==n[0].valueOf()||e[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const e=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!e||!n)return!1;const i=e[1].valueOf()-e[0].valueOf(),l=n[1].valueOf()-n[0].valueOf(),r=Te(this.model.getOptions(),"zoomBar","minZoomRatio");return i/l{const l=this.services[i];this.services[i]=new l(this.model,this.services)}),this.services.events.addEventListener(je.Model.UPDATE,i=>{const l=!!Te(i,"detail","animate");this.update(l)}),this.model.setData(n.data),this.services.events.addEventListener(je.Chart.RESIZE,()=>{this.update(!1)}),this.components=this.getComponents(),this.update()}getComponents(){return console.error("getComponents() method is not implemented"),[]}update(e=!0){if(!this.components)return;Object.keys(this.services).forEach(l=>{this.services[l].update()}),this.components.forEach(l=>l.render(e));const n=this.services.transitions.getPendingTransitions(),i=Object.keys(n).map(l=>n[l].end().catch(r=>r));Promise.all(i).then(()=>this.services.events.dispatchEvent(je.Chart.RENDER_FINISHED))}destroy(){this.components.forEach(e=>e.destroy()),this.services.domUtils.getHolder().remove(),this.model.set({destroyed:!0},{skipUpdate:!0})}getChartComponents(e,n){const i=this.model.getOptions(),l=Te(i,"toolbar","enabled"),r={id:"legend",components:[new wM(this.model,this.services)],growth:Nn.PREFERRED},s=Te(i,"canvasZoom","enabled");s&&s===!0&&e.push(new ume(this.model,this.services));const o=!!this.model.getOptions().title,a={id:"title",components:[new kM(this.model,this.services)],growth:Nn.STRETCH},u={id:"toolbar",components:[new mM(this.model,this.services)],growth:Nn.PREFERRED},f={id:"header",components:[new $o(this.model,this.services,[a,...l?[u]:[]],{direction:pi.ROW,alignItems:vd.CENTER})],growth:Nn.PREFERRED},c={id:"graph-frame",components:e,growth:Nn.STRETCH,renderType:Te(n,"graphFrameRenderType")||wn.SVG},d=Te(n,"excludeLegend")!==!0&&i.legend.enabled!==!1;let h=pi.COLUMN;if(d){const S=Te(i,"legend","position");S==="left"?(h=pi.ROW,i.legend.orientation||(i.legend.orientation=bu.VERTICAL)):S==="right"?(h=pi.ROW_REVERSE,i.legend.orientation||(i.legend.orientation=bu.VERTICAL)):S==="bottom"&&(h=pi.COLUMN_REVERSE)}const g={id:"spacer",components:[new ed(this.model,this.services)],growth:Nn.PREFERRED},_={id:"full-frame",components:[new $o(this.model,this.services,[...d?[r]:[],...d?[g]:[],c],{direction:h})],growth:Nn.STRETCH},v=[];if(o||l){v.push(f);const S={id:"spacer",components:[new ed(this.model,this.services,l?{size:15}:void 0)],growth:Nn.PREFERRED};v.push(S)}return v.push(_),[new TM(this.model,this.services),new vM(this.model,this.services),new $o(this.model,this.services,v,{direction:pi.COLUMN})]}}class i1e extends n1e{constructor(e,n){super(e,n),this.services=Object.assign(this.services,{cartesianScales:Jme,curves:e1e,zoom:t1e}),this.model=new Bce(this.services)}getAxisChartComponents(e,n){const i=this.model.getOptions(),l=Te(i,"zoomBar",it.TOP,"enabled"),r=Te(i,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=this.services.cartesianScales.getMainXAxisPosition(),o=Te(i,"axes",s,"scaleType"),a=l&&s===it.BOTTOM&&o===Nt.TIME,u=this.services.zoom.isZoomBarLocked(it.TOP),f=!!this.model.getOptions().title,c={id:"title",components:[new kM(this.model,this.services)],growth:Nn.STRETCH},d={id:"toolbar",components:[new mM(this.model,this.services)],growth:Nn.PREFERRED},h={id:"header",components:[new $o(this.model,this.services,[c,...r?[d]:[]],{direction:pi.ROW,alignItems:vd.CENTER})],growth:Nn.PREFERRED},g={id:"legend",components:[new wM(this.model,this.services)],growth:Nn.PREFERRED};a&&!u&&e.push(new yM(this.model,this.services),new fme(this.model,this.services)),e.push(new dme(this.model,this.services)),e.push(new hme(this.model,this.services));const _={id:"graph-frame",components:e,growth:Nn.STRETCH,renderType:wn.SVG},v=Te(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let S=pi.COLUMN;if(v){const L=Te(this.model.getOptions(),"legend","position");L===au.LEFT?(S=pi.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=bu.VERTICAL)):L===au.RIGHT?(S=pi.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=bu.VERTICAL)):L===au.BOTTOM&&(S=pi.COLUMN_REVERSE)}const A={id:"spacer",components:[new ed(this.model,this.services)],growth:Nn.PREFERRED},C={id:"full-frame",components:[new $o(this.model,this.services,[...v?[g]:[],...v?[A]:[],_],{direction:S})],growth:Nn.STRETCH},I={id:"zoom-bar",components:[new cme(this.model,this.services)],growth:Nn.PREFERRED,renderType:wn.SVG},M=[];if(f||r){M.push(h);const L={id:"spacer",components:[new ed(this.model,this.services,r?{size:15}:void 0)],growth:Nn.PREFERRED};M.push(L)}return a&&M.push(I),M.push(C),[new mme(this.model,this.services),new vM(this.model,this.services),new $o(this.model,this.services,M,{direction:pi.COLUMN})]}}class l1e extends i1e{constructor(e,n){super(e,n),this.model.setOptions(yce(Xu(kce.areaChart),n.options)),this.init(e,n)}getComponents(){const e=[new bme(this.model,this.services),new gme(this.model,this.services),new MM(this.model,this.services),new mc(this.model,this.services),new EM(this.model,this.services),new cu(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0}),new vme(this.model,this.services,{skeleton:Uo.GRID})];return this.getAxisChartComponents(e)}}ps.LINE+"",ps.SCATTER+"",ps.AREA+"",ps.STACKED_AREA+"",ps.SIMPLE_BAR+"",ps.GROUPED_BAR+"",ps.STACKED_BAR+"";function r1e(t){let e=t[6]("Dashboard")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Dashboard")+"")&&Z(n,e)},d(i){i&&w(n)}}}function s1e(t){let e=t[6]("Stats")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Stats")+"")&&Z(n,e)},d(i){i&&w(n)}}}function o1e(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[r1e]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[s1e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&64|s[1]&4&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&64|s[1]&4&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function a1e(t){let e,n,i,l;return e=new Op({props:{text:t[6]("24 hours")}}),i=new Op({props:{text:t[6]("7 days")}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&64&&(o.text=r[6]("24 hours")),e.$set(o);const a={};s[0]&64&&(a.text=r[6]("7 days")),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function g6(t){let e,n;return e=new xi({props:{kind:"error",title:t[6]("Stats unavailable"),subtitle:t[2],hideCloseButton:!0}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.title=i[6]("Stats unavailable")),l[0]&4&&(r.subtitle=i[2]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function _6(t){let e,n;return e=new Vt({props:{type:"red",size:"sm",$$slots:{default:[u1e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64|l[1]&4&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function u1e(t){let e=t[6]("Check the logs")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Check the logs")+"")&&Z(n,e)},d(i){i&&w(n)}}}function f1e(t){let e=t[6]("Since GateSentry started")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&64&&e!==(e=i[6]("Since GateSentry started")+"")&&Z(n,e)},d(i){i&&w(n)}}}function c1e(t){let e=t[6]("Since GateSentry started")+"",n,i,l=new Date(t[4].started_at).toLocaleString()+"",r;return{c(){n=q(e),i=q(" · "),r=q(l)},m(s,o){y(s,n,o),y(s,i,o),y(s,r,o)},p(s,o){o[0]&64&&e!==(e=s[6]("Since GateSentry started")+"")&&Z(n,e),o[0]&16&&l!==(l=new Date(s[4].started_at).toLocaleString()+"")&&Z(r,l)},d(s){s&&(w(n),w(i),w(r))}}}function p6(t){let e,n,i,l=t[6]("Most blocked domains")+"",r,s,o,a,u,f,c,d=t[6]("Most requested domains")+"",h,g,_,v,S,A,C,I=t[6]("Most active devices")+"",M,L,N,z,W,D,G,$=t[6]("Blocks by policy")+"",j,Q,le,oe,X,de,re,x=t[6]("Block reasons")+"",me,ee,ke,pe,Fe,Ve,Ee,We=t[6]("Traffic breakdown")+"",ge,ve,be,ue,nt,Oe;const dt=[h1e,d1e],yt=[];function at(se,Le){var _t;return(_t=se[0].top_blocked_domains)!=null&&_t.length?0:1}o=at(t),a=yt[o]=dt[o](t);const ut=[g1e,m1e],At=[];function xe(se,Le){var _t;return(_t=se[0].top_domains)!=null&&_t.length?0:1}_=xe(t),v=At[_]=ut[_](t);const mt=[p1e,_1e],we=[];function gt(se,Le){var _t;return(_t=se[0].affected_devices)!=null&&_t.length?0:1}N=gt(t),z=we[N]=mt[N](t);const It=[v1e,b1e],Ht=[];function Wt(se,Le){var _t;return(_t=se[0].blocks_by_policy)!=null&&_t.length?0:1}le=Wt(t),oe=Ht[le]=It[le](t);const qt=[w1e,k1e],Xt=[];function Ce(se,Le){var _t;return(_t=se[0].top_reasons)!=null&&_t.length?0:1}return ke=Ce(t),pe=Xt[ke]=qt[ke](t),be=new Ol({props:{size:"short",headers:[{key:"key",value:t[6]("Layer")},{key:"count",value:t[6]("Requests")},{key:"share",value:t[6]("Share")}],rows:t[13](t[0].by_layer,t[7],t[0].total)}}),nt=new Ol({props:{size:"short",headers:[{key:"key",value:t[6]("Outcome")},{key:"count",value:t[6]("Requests")},{key:"share",value:t[6]("Share")}],rows:t[13](t[0].by_action,t[8],t[0].total)}}),{c(){e=R("div"),n=R("section"),i=R("h3"),r=q(l),s=B(),a.c(),u=B(),f=R("section"),c=R("h3"),h=q(d),g=B(),v.c(),S=B(),A=R("section"),C=R("h3"),M=q(I),L=B(),z.c(),W=B(),D=R("section"),G=R("h3"),j=q($),Q=B(),oe.c(),X=B(),de=R("section"),re=R("h3"),me=q(x),ee=B(),pe.c(),Fe=B(),Ve=R("section"),Ee=R("h3"),ge=q(We),ve=B(),F(be.$$.fragment),ue=B(),F(nt.$$.fragment),P(i,"class","svelte-1f2qoe8"),P(n,"class","panel svelte-1f2qoe8"),P(c,"class","svelte-1f2qoe8"),P(f,"class","panel svelte-1f2qoe8"),P(C,"class","svelte-1f2qoe8"),P(A,"class","panel svelte-1f2qoe8"),P(G,"class","svelte-1f2qoe8"),P(D,"class","panel svelte-1f2qoe8"),P(re,"class","svelte-1f2qoe8"),P(de,"class","panel svelte-1f2qoe8"),P(Ee,"class","svelte-1f2qoe8"),P(Ve,"class","panel svelte-1f2qoe8"),P(e,"class","columns svelte-1f2qoe8")},m(se,Le){y(se,e,Le),T(e,n),T(n,i),T(i,r),T(n,s),yt[o].m(n,null),T(e,u),T(e,f),T(f,c),T(c,h),T(f,g),At[_].m(f,null),T(e,S),T(e,A),T(A,C),T(C,M),T(A,L),we[N].m(A,null),T(e,W),T(e,D),T(D,G),T(G,j),T(D,Q),Ht[le].m(D,null),T(e,X),T(e,de),T(de,re),T(re,me),T(de,ee),Xt[ke].m(de,null),T(e,Fe),T(e,Ve),T(Ve,Ee),T(Ee,ge),T(Ve,ve),H(be,Ve,null),T(Ve,ue),H(nt,Ve,null),Oe=!0},p(se,Le){(!Oe||Le[0]&64)&&l!==(l=se[6]("Most blocked domains")+"")&&Z(r,l);let _t=o;o=at(se),o===_t?yt[o].p(se,Le):(fe(),k(yt[_t],1,1,()=>{yt[_t]=null}),ce(),a=yt[o],a?a.p(se,Le):(a=yt[o]=dt[o](se),a.c()),b(a,1),a.m(n,null)),(!Oe||Le[0]&64)&&d!==(d=se[6]("Most requested domains")+"")&&Z(h,d);let zt=_;_=xe(se),_===zt?At[_].p(se,Le):(fe(),k(At[zt],1,1,()=>{At[zt]=null}),ce(),v=At[_],v?v.p(se,Le):(v=At[_]=ut[_](se),v.c()),b(v,1),v.m(f,null)),(!Oe||Le[0]&64)&&I!==(I=se[6]("Most active devices")+"")&&Z(M,I);let Be=N;N=gt(se),N===Be?we[N].p(se,Le):(fe(),k(we[Be],1,1,()=>{we[Be]=null}),ce(),z=we[N],z?z.p(se,Le):(z=we[N]=mt[N](se),z.c()),b(z,1),z.m(A,null)),(!Oe||Le[0]&64)&&$!==($=se[6]("Blocks by policy")+"")&&Z(j,$);let Ot=le;le=Wt(se),le===Ot?Ht[le].p(se,Le):(fe(),k(Ht[Ot],1,1,()=>{Ht[Ot]=null}),ce(),oe=Ht[le],oe?oe.p(se,Le):(oe=Ht[le]=It[le](se),oe.c()),b(oe,1),oe.m(D,null)),(!Oe||Le[0]&64)&&x!==(x=se[6]("Block reasons")+"")&&Z(me,x);let kt=ke;ke=Ce(se),ke===kt?Xt[ke].p(se,Le):(fe(),k(Xt[kt],1,1,()=>{Xt[kt]=null}),ce(),pe=Xt[ke],pe?pe.p(se,Le):(pe=Xt[ke]=qt[ke](se),pe.c()),b(pe,1),pe.m(de,null)),(!Oe||Le[0]&64)&&We!==(We=se[6]("Traffic breakdown")+"")&&Z(ge,We);const Pt={};Le[0]&64&&(Pt.headers=[{key:"key",value:se[6]("Layer")},{key:"count",value:se[6]("Requests")},{key:"share",value:se[6]("Share")}]),Le[0]&1&&(Pt.rows=se[13](se[0].by_layer,se[7],se[0].total)),be.$set(Pt);const Ye={};Le[0]&64&&(Ye.headers=[{key:"key",value:se[6]("Outcome")},{key:"count",value:se[6]("Requests")},{key:"share",value:se[6]("Share")}]),Le[0]&1&&(Ye.rows=se[13](se[0].by_action,se[8],se[0].total)),nt.$set(Ye)},i(se){Oe||(b(a),b(v),b(z),b(oe),b(pe),b(be.$$.fragment,se),b(nt.$$.fragment,se),Oe=!0)},o(se){k(a),k(v),k(z),k(oe),k(pe),k(be.$$.fragment,se),k(nt.$$.fragment,se),Oe=!1},d(se){se&&w(e),yt[o].d(),At[_].d(),we[N].d(),Ht[le].d(),Xt[ke].d(),U(be),U(nt)}}}function d1e(t){let e,n=t[6]("Nothing blocked in this window.")+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","helper svelte-1f2qoe8")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("Nothing blocked in this window.")+"")&&Z(i,n)},i:he,o:he,d(l){l&&w(e)}}}function h1e(t){let e,n;return e=new Ol({props:{size:"short",headers:[{key:"key",value:t[6]("Domain")},{key:"count",value:t[6]("Blocks")}],rows:t[12](t[0].top_blocked_domains,"b")}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"key",value:i[6]("Domain")},{key:"count",value:i[6]("Blocks")}]),l[0]&1&&(r.rows=i[12](i[0].top_blocked_domains,"b")),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function m1e(t){let e,n=t[6]("No requests in this window.")+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","helper svelte-1f2qoe8")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No requests in this window.")+"")&&Z(i,n)},i:he,o:he,d(l){l&&w(e)}}}function g1e(t){let e,n;return e=new Ol({props:{size:"short",headers:[{key:"key",value:t[6]("Domain")},{key:"count",value:t[6]("Requests")}],rows:t[12](t[0].top_domains,"t")}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"key",value:i[6]("Domain")},{key:"count",value:i[6]("Requests")}]),l[0]&1&&(r.rows=i[12](i[0].top_domains,"t")),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function _1e(t){let e,n=t[6]("No device activity in this window.")+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","helper svelte-1f2qoe8")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No device activity in this window.")+"")&&Z(i,n)},i:he,o:he,d(l){l&&w(e)}}}function p1e(t){let e,n;return e=new Ol({props:{size:"short",headers:[{key:"device",value:t[6]("Device")},{key:"count",value:t[6]("Requests")}],rows:t[0].affected_devices.map(t[17])}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"device",value:i[6]("Device")},{key:"count",value:i[6]("Requests")}]),l[0]&1&&(r.rows=i[0].affected_devices.map(i[17])),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function b1e(t){let e,n=t[6]("No policy blocks in this window.")+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","helper svelte-1f2qoe8")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No policy blocks in this window.")+"")&&Z(i,n)},i:he,o:he,d(l){l&&w(e)}}}function v1e(t){let e,n;return e=new Ol({props:{size:"short",headers:[{key:"name",value:t[6]("Policy")},{key:"count",value:t[6]("Blocks")}],rows:t[0].blocks_by_policy.map(t[18])}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"name",value:i[6]("Policy")},{key:"count",value:i[6]("Blocks")}]),l[0]&1&&(r.rows=i[0].blocks_by_policy.map(i[18])),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function k1e(t){let e,n=t[6]("No recorded reasons in this window.")+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","helper svelte-1f2qoe8")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&64&&n!==(n=l[6]("No recorded reasons in this window.")+"")&&Z(i,n)},i:he,o:he,d(l){l&&w(e)}}}function w1e(t){let e,n;return e=new Ol({props:{size:"short",headers:[{key:"key",value:t[6]("Reason")},{key:"count",value:t[6]("Decisions")}],rows:t[12](t[0].top_reasons,"r")}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&64&&(r.headers=[{key:"key",value:i[6]("Reason")},{key:"count",value:i[6]("Decisions")}]),l[0]&1&&(r.rows=i[12](i[0].top_reasons,"r")),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function y1e(t){var Di,el,Xl,Cs,_l,Ls,xr,si;let e,n,i,l,r,s=t[6]("Stats")+"",o,a,u,f,c,d,h,g,_,v=t[6]("Requests")+"",S,A,C,I=t[9]((Di=t[0])==null?void 0:Di.total)+"",M,L,N,z,W=t[6]("Blocked")+"",D,G,$,j=t[9](t[5])+"",Q,le,oe,X=t[10](t[5],((el=t[0])==null?void 0:el.total)||0)+"",de,re,x=t[6]("of requests")+"",me,ee,ke,pe,Fe=t[6]("Active clients")+"",Ve,Ee,We,ge=t[9]((Xl=t[0])==null?void 0:Xl.unique_clients)+"",ve,be,ue,nt,Oe=t[6]("Distinct domains")+"",dt,yt,at,ut=t[9]((Cs=t[0])==null?void 0:Cs.unique_domains)+"",At,xe,mt,we,gt=t[6]("Inspection errors")+"",It,Ht,Wt,qt=t[9]((_l=t[0])==null?void 0:_l.inspection_failures)+"",Xt,Ce,se,Le,_t,zt=t[6]("Live proxy traffic")+"",Be,Ot,kt,Pt=t[11]((Ls=t[4])==null?void 0:Ls.total_bytes)+"",Ye,ze,Qe,He=t[6]("Down")+"",Tt,Bt,qn=t[11]((xr=t[4])==null?void 0:xr.download_bytes)+"",li,di,hi=t[6]("Up")+"",Mi,wi,Ri=t[11]((si=t[4])==null?void 0:si.upload_bytes)+"",Zi,ur,Kn,Rn,lt,St,Dn=t[6]("Requests over time")+"",Hn,Ll,mi,Un,tn;n=new Kr({props:{noTrailingSlash:!0,$$slots:{default:[o1e]},$$scope:{ctx:t}}}),f=new sD({props:{size:"sm",selectedIndex:t[1],$$slots:{default:[a1e]},$$scope:{ctx:t}}}),f.$on("change",t[15]);let Tn=t[2]&&g6(t),pn=t[0]&&t[0].inspection_failures>0&&_6(t);function ml(Lt,Kt){var Kl;return(Kl=Lt[4])!=null&&Kl.started_at?c1e:f1e}let gl=ml(t),ri=gl(t),Sn=t[0]&&p6(t);return{c(){e=R("div"),F(n.$$.fragment),i=B(),l=R("header"),r=R("h2"),o=q(s),a=B(),u=R("div"),F(f.$$.fragment),c=B(),Tn&&Tn.c(),d=B(),h=R("section"),g=R("div"),_=R("span"),S=q(v),A=B(),C=R("span"),M=q(I),L=B(),N=R("div"),z=R("span"),D=q(W),G=B(),$=R("span"),Q=q(j),le=B(),oe=R("span"),de=q(X),re=B(),me=q(x),ee=B(),ke=R("div"),pe=R("span"),Ve=q(Fe),Ee=B(),We=R("span"),ve=q(ge),be=B(),ue=R("div"),nt=R("span"),dt=q(Oe),yt=B(),at=R("span"),At=q(ut),xe=B(),mt=R("div"),we=R("span"),It=q(gt),Ht=B(),Wt=R("span"),Xt=q(qt),Ce=B(),pn&&pn.c(),se=B(),Le=R("div"),_t=R("span"),Be=q(zt),Ot=B(),kt=R("span"),Ye=q(Pt),ze=B(),Qe=R("span"),Tt=q(He),Bt=B(),li=q(qn),di=q(" · "),Mi=q(hi),wi=B(),Zi=q(Ri),ur=B(),Kn=R("span"),ri.c(),Rn=B(),lt=R("section"),St=R("h3"),Hn=q(Dn),Ll=B(),mi=R("div"),Un=B(),Sn&&Sn.c(),P(u,"class","switcher svelte-1f2qoe8"),P(l,"class","page-head svelte-1f2qoe8"),P(_,"class","tile-label svelte-1f2qoe8"),P(C,"class","tile-value svelte-1f2qoe8"),P(g,"class","tile svelte-1f2qoe8"),P(z,"class","tile-label svelte-1f2qoe8"),P($,"class","tile-value svelte-1f2qoe8"),P(oe,"class","tile-foot svelte-1f2qoe8"),P(N,"class","tile svelte-1f2qoe8"),P(pe,"class","tile-label svelte-1f2qoe8"),P(We,"class","tile-value svelte-1f2qoe8"),P(ke,"class","tile svelte-1f2qoe8"),P(nt,"class","tile-label svelte-1f2qoe8"),P(at,"class","tile-value svelte-1f2qoe8"),P(ue,"class","tile svelte-1f2qoe8"),P(we,"class","tile-label svelte-1f2qoe8"),P(Wt,"class","tile-value svelte-1f2qoe8"),P(mt,"class","tile svelte-1f2qoe8"),P(_t,"class","tile-label svelte-1f2qoe8"),P(kt,"class","tile-value svelte-1f2qoe8"),P(Qe,"class","tile-foot svelte-1f2qoe8"),P(Kn,"class","tile-foot svelte-1f2qoe8"),P(Le,"class","tile traffic-tile svelte-1f2qoe8"),P(h,"class","tiles svelte-1f2qoe8"),P(St,"class","svelte-1f2qoe8"),P(mi,"class","chart svelte-1f2qoe8"),P(lt,"class","panel svelte-1f2qoe8"),P(e,"class","page svelte-1f2qoe8")},m(Lt,Kt){y(Lt,e,Kt),H(n,e,null),T(e,i),T(e,l),T(l,r),T(r,o),T(l,a),T(l,u),H(f,u,null),T(e,c),Tn&&Tn.m(e,null),T(e,d),T(e,h),T(h,g),T(g,_),T(_,S),T(g,A),T(g,C),T(C,M),T(h,L),T(h,N),T(N,z),T(z,D),T(N,G),T(N,$),T($,Q),T(N,le),T(N,oe),T(oe,de),T(oe,re),T(oe,me),T(h,ee),T(h,ke),T(ke,pe),T(pe,Ve),T(ke,Ee),T(ke,We),T(We,ve),T(h,be),T(h,ue),T(ue,nt),T(nt,dt),T(ue,yt),T(ue,at),T(at,At),T(h,xe),T(h,mt),T(mt,we),T(we,It),T(mt,Ht),T(mt,Wt),T(Wt,Xt),T(mt,Ce),pn&&pn.m(mt,null),T(h,se),T(h,Le),T(Le,_t),T(_t,Be),T(Le,Ot),T(Le,kt),T(kt,Ye),T(Le,ze),T(Le,Qe),T(Qe,Tt),T(Qe,Bt),T(Qe,li),T(Qe,di),T(Qe,Mi),T(Qe,wi),T(Qe,Zi),T(Le,ur),T(Le,Kn),ri.m(Kn,null),T(e,Rn),T(e,lt),T(lt,St),T(St,Hn),T(lt,Ll),T(lt,mi),t[16](mi),T(e,Un),Sn&&Sn.m(e,null),tn=!0},p(Lt,Kt){var Sr,fr,Er,ts,tl,Is,cr,Il;const Kl={};Kt[0]&64|Kt[1]&4&&(Kl.$$scope={dirty:Kt,ctx:Lt}),n.$set(Kl),(!tn||Kt[0]&64)&&s!==(s=Lt[6]("Stats")+"")&&Z(o,s);const es={};Kt[0]&2&&(es.selectedIndex=Lt[1]),Kt[0]&64|Kt[1]&4&&(es.$$scope={dirty:Kt,ctx:Lt}),f.$set(es),Lt[2]?Tn?(Tn.p(Lt,Kt),Kt[0]&4&&b(Tn,1)):(Tn=g6(Lt),Tn.c(),b(Tn,1),Tn.m(e,d)):Tn&&(fe(),k(Tn,1,1,()=>{Tn=null}),ce()),(!tn||Kt[0]&64)&&v!==(v=Lt[6]("Requests")+"")&&Z(S,v),(!tn||Kt[0]&1)&&I!==(I=Lt[9]((Sr=Lt[0])==null?void 0:Sr.total)+"")&&Z(M,I),(!tn||Kt[0]&64)&&W!==(W=Lt[6]("Blocked")+"")&&Z(D,W),(!tn||Kt[0]&32)&&j!==(j=Lt[9](Lt[5])+"")&&Z(Q,j),(!tn||Kt[0]&33)&&X!==(X=Lt[10](Lt[5],((fr=Lt[0])==null?void 0:fr.total)||0)+"")&&Z(de,X),(!tn||Kt[0]&64)&&x!==(x=Lt[6]("of requests")+"")&&Z(me,x),(!tn||Kt[0]&64)&&Fe!==(Fe=Lt[6]("Active clients")+"")&&Z(Ve,Fe),(!tn||Kt[0]&1)&&ge!==(ge=Lt[9]((Er=Lt[0])==null?void 0:Er.unique_clients)+"")&&Z(ve,ge),(!tn||Kt[0]&64)&&Oe!==(Oe=Lt[6]("Distinct domains")+"")&&Z(dt,Oe),(!tn||Kt[0]&1)&&ut!==(ut=Lt[9]((ts=Lt[0])==null?void 0:ts.unique_domains)+"")&&Z(At,ut),(!tn||Kt[0]&64)&>!==(gt=Lt[6]("Inspection errors")+"")&&Z(It,gt),(!tn||Kt[0]&1)&&qt!==(qt=Lt[9]((tl=Lt[0])==null?void 0:tl.inspection_failures)+"")&&Z(Xt,qt),Lt[0]&&Lt[0].inspection_failures>0?pn?(pn.p(Lt,Kt),Kt[0]&1&&b(pn,1)):(pn=_6(Lt),pn.c(),b(pn,1),pn.m(mt,null)):pn&&(fe(),k(pn,1,1,()=>{pn=null}),ce()),(!tn||Kt[0]&64)&&zt!==(zt=Lt[6]("Live proxy traffic")+"")&&Z(Be,zt),(!tn||Kt[0]&16)&&Pt!==(Pt=Lt[11]((Is=Lt[4])==null?void 0:Is.total_bytes)+"")&&Z(Ye,Pt),(!tn||Kt[0]&64)&&He!==(He=Lt[6]("Down")+"")&&Z(Tt,He),(!tn||Kt[0]&16)&&qn!==(qn=Lt[11]((cr=Lt[4])==null?void 0:cr.download_bytes)+"")&&Z(li,qn),(!tn||Kt[0]&64)&&hi!==(hi=Lt[6]("Up")+"")&&Z(Mi,hi),(!tn||Kt[0]&16)&&Ri!==(Ri=Lt[11]((Il=Lt[4])==null?void 0:Il.upload_bytes)+"")&&Z(Zi,Ri),gl===(gl=ml(Lt))&&ri?ri.p(Lt,Kt):(ri.d(1),ri=gl(Lt),ri&&(ri.c(),ri.m(Kn,null))),(!tn||Kt[0]&64)&&Dn!==(Dn=Lt[6]("Requests over time")+"")&&Z(Hn,Dn),Lt[0]?Sn?(Sn.p(Lt,Kt),Kt[0]&1&&b(Sn,1)):(Sn=p6(Lt),Sn.c(),b(Sn,1),Sn.m(e,null)):Sn&&(fe(),k(Sn,1,1,()=>{Sn=null}),ce())},i(Lt){tn||(b(n.$$.fragment,Lt),b(f.$$.fragment,Lt),b(Tn),b(pn),b(Sn),tn=!0)},o(Lt){k(n.$$.fragment,Lt),k(f.$$.fragment,Lt),k(Tn),k(pn),k(Sn),tn=!1},d(Lt){Lt&&w(e),U(n),U(f),Tn&&Tn.d(),pn&&pn.d(),ri.d(),t[16](null),Sn&&Sn.d()}}}function T1e(t,e,n){let i,l,r;Mt(t,An,x=>n(26,l=x)),Mt(t,ii,x=>n(6,r=x));const s=[1,7],o={dns:"DNS",explicit_proxy:"Proxy",transparent_proxy:"Transparent proxy",content:"Content inspection"},a={allow:"Allowed",block:"Blocked",inspect:"Inspected",bypass:"Bypassed",error:"Errors",unknown:"Other"};let u=1,f=null,c="",d=null,h,g=null,_=!1,v=!1,S=null,A=null,C=!1,I=!1;const M=x=>typeof x=="number"?x.toLocaleString():"—",L=(x,me)=>me>0?(x/me*100).toFixed(1)+"%":"—",N=x=>{if(typeof x!="number")return"—";const me=["B","KiB","MiB","GiB","TiB"];let ee=x,ke=0;for(;ee>=1024&&ke=100?0:ee>=10?1:2;return`${ee.toFixed(pe)} ${me[ke]}`},z=x=>(x.timeline||[]).flatMap(me=>{const ee=new Date(me.start*1e3).toISOString();return[{group:"Requests",date:ee,value:me.total},{group:"Blocked",date:ee,value:me.blocked}]}),W=x=>{const me=z(x);h&&(d?d.model.setData(me):d=new l1e(h,{data:me,options:{axes:{bottom:{mapsTo:"date",scaleType:Nt.TIME},left:{mapsTo:"value",scaleType:Nt.LINEAR}},curve:"curveMonotoneX",height:"320px",toolbar:{enabled:!1},legend:{alignment:jl.LEFT}}}))},D=async()=>{if(_||I)return;_=!0;const x=u;try{const me=s[x],ee=await l.api.doCall(`/decisions/summary?days=${me}`);!I&&x===u&&(n(0,f=ee),n(2,c=""),f&&W(f))}catch{!I&&x===u&&n(2,c="Unable to load statistics.")}finally{if(_=!1,I)return;v?(v=!1,D()):g=setTimeout(D,3e4)}},G=()=>{if(g&&clearTimeout(g),g=null,_){v=!0;return}D()},$=async()=>{if(!(C||I)){C=!0;try{const x=await l.api.doCall("/proxy/traffic");I||n(4,S=x)}catch{}finally{C=!1,I||(A=setTimeout($,5e3))}}},j=(x,me)=>(x||[]).map((ee,ke)=>({id:me+ke,key:ee.key,count:M(ee.count)})),Q=(x,me,ee)=>Object.entries(x||{}).sort((ke,pe)=>pe[1]-ke[1]).map(([ke,pe])=>({id:ke,key:me[ke]||ke,count:M(pe),share:L(pe,ee)})),le=x=>{n(1,u=x),G()};_n(()=>{D(),$()}),Es(()=>{I=!0,g&&clearTimeout(g),A&&clearTimeout(A),d&&d.destroy()});const oe=x=>le(x.detail);function X(x){ft[x?"unshift":"push"](()=>{h=x,n(3,h)})}const de=(x,me)=>({id:"d"+me,device:x.device||x.ip,count:M(x.count)}),re=x=>({id:x.id,name:x.name,count:M(x.count)});return t.$$.update=()=>{var x;t.$$.dirty[0]&1&&n(5,i=((x=f==null?void 0:f.by_action)==null?void 0:x.block)||0)},[f,u,c,h,S,i,r,o,a,M,L,N,j,Q,le,oe,X,de,re]}class S1e extends De{constructor(e){super(),Re(this,e,T1e,y1e,Ie,{},null,[-1,-1])}}function E1e(t){let e;return{c(){e=q("Alpha")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function M1e(t){let e=t[8](t[3].state)+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&8&&e!==(e=i[8](i[3].state)+"")&&Z(n,e)},d(i){i&&w(n)}}}function O1e(t){let e,n=t[8](t[2].state)+"",i;return{c(){e=q("Grok: "),i=q(n)},m(l,r){y(l,e,r),y(l,i,r)},p(l,r){r&4&&n!==(n=l[8](l[2].state)+"")&&Z(i,n)},d(l){l&&(w(e),w(i))}}}function A1e(t){let e,n=t[8](t[1].state)+"",i;return{c(){e=q("ChatGPT: "),i=q(n)},m(l,r){y(l,e,r),y(l,i,r)},p(l,r){r&2&&n!==(n=l[8](l[1].state)+"")&&Z(i,n)},d(l){l&&(w(e),w(i))}}}function C1e(t){let e=t[8](t[0].state)+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&1&&e!==(e=i[8](i[0].state)+"")&&Z(n,e)},d(i){i&&w(n)}}}function L1e(t){let e=t[8](t[4].state)+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[8](i[4].state)+"")&&Z(n,e)},d(i){i&&w(n)}}}function I1e(t){let e,n,i,l,r,s,o,a,u=t[5]("Work in progress. Remote vision APIs are too slow to block every image on the request path; scanning strategy is still being decided.")+"",f,c,d,h,g,_,v=t[5]("Image filtering")+"",S,A,C,I,M,L,N,z=t[5]("Use a vision model to classify images that pass through the MITM proxy (NSFW / not safe for work). HTTPS inspection must be enabled or the proxy never sees the image bytes.")+"",W,D,G,$,j,Q,le,oe,X=t[5]("API keys")+"",de,re,x,me,ee,ke,pe,Fe,Ve=t[5]("Keys are stored in GateSentry settings on the server. They are never sent to the browser except to this admin page. Use the provider that matches the radio above.")+"",Ee,We,ge,ve,be,ue,nt,Oe,dt,yt,at,ut,At,xe,mt,we=t[5]("Local LLM (Ollama)")+"",gt,It,Ht,Wt,qt,Xt,Ce,se=t[5]("Used when Enable Local LLM is selected. Point this at an Ollama HTTP API. Scanning is not live in the proxy yet (Alpha).")+"",Le,_t,zt,Be,Ot,kt,Pt,Ye,ze,Qe,He,Tt=t[5]("Legacy local scanner")+"",Bt,qn,li,di,hi,Mi,wi,Ri=t[5]("Optional. The original GateSentry AI path posted image bytes to a local classifier URL. It is not used when Grok or ChatGPT is selected.")+"",Zi,ur,Kn,Rn;return n=new fq({props:{size:24}}),s=new Vt({props:{type:"red",size:"sm",$$slots:{default:[E1e]},$$scope:{ctx:t}}}),I=new Vt({props:{type:pr(t[3].state),size:"sm",$$slots:{default:[M1e]},$$scope:{ctx:t}}}),G=new tr({props:{keyName:"ai_image_filtering_mode",title:t[5]("AI image filtering"),labelText:t[5]("AI image filtering"),type:"radio",helperText:"",orientation:"horizontal",radioOptions:t[6],onSaved:t[7]}}),me=new Vt({props:{type:pr(t[2].state),size:"sm",title:t[2].detail,$$slots:{default:[O1e]},$$scope:{ctx:t}}}),ke=new Vt({props:{type:pr(t[1].state),size:"sm",title:t[1].detail,$$slots:{default:[A1e]},$$scope:{ctx:t}}}),ve=new tr({props:{keyName:"ai_grok_api_key",title:t[5]("Grok API key"),labelText:t[5]("Grok API key"),type:"password",helperText:t[5]("xAI / Grok key from console.x.ai. Used when Enable Grok is selected."),onSaved:t[7]}}),ue=new tr({props:{keyName:"ai_grok_model",title:t[5]("Grok model"),labelText:t[5]("Grok model"),type:"text",helperText:t[5]("Vision model id. Empty uses grok-4.5."),onSaved:t[7]}}),Oe=new tr({props:{keyName:"ai_openai_api_key",title:t[5]("OpenAI API key"),labelText:t[5]("OpenAI API key"),type:"password",helperText:t[5]("OpenAI key. Used when Enable ChatGPT is selected."),onSaved:t[7]}}),yt=new tr({props:{keyName:"ai_openai_model",title:t[5]("ChatGPT model"),labelText:t[5]("ChatGPT model"),type:"text",helperText:t[5]("Vision model id. Empty uses gpt-4o-mini."),onSaved:t[7]}}),Wt=new Vt({props:{type:pr(t[0].state),size:"sm",$$slots:{default:[C1e]},$$scope:{ctx:t}}}),Be=new tr({props:{keyName:"ai_local_llm_url",title:t[5]("Local LLM URL"),labelText:t[5]("Local LLM URL"),type:"text",helperText:t[5]("Ollama base URL, for example http://127.0.0.1:11434"),onSaved:t[7]}}),kt=new tr({props:{keyName:"ai_local_llm_model",title:t[5]("Ollama model"),labelText:t[5]("Ollama model"),type:"text",helperText:t[5]("Vision model tag, for example gemma4:e4b-mlx. Empty uses llava."),onSaved:t[7]}}),di=new Vt({props:{type:pr(t[4].state),size:"sm",$$slots:{default:[L1e]},$$scope:{ctx:t}}}),Kn=new tr({props:{keyName:"ai_scanner_url",title:t[5]("AI Service URL"),labelText:t[5]("AI Service URL"),type:"text",helperText:t[5]("HTTP endpoint that accepts a multipart image upload. Leave empty unless you run a local scanner."),onSaved:t[7]}}),{c(){e=R("div"),F(n.$$.fragment),i=B(),l=R("h2"),l.textContent="Gatesentry AI",r=B(),F(s.$$.fragment),o=B(),a=R("p"),f=q(u),c=B(),d=R("section"),h=R("div"),g=R("div"),_=R("h5"),S=q(v),A=B(),C=R("span"),F(I.$$.fragment),L=B(),N=R("p"),W=q(z),D=B(),F(G.$$.fragment),$=B(),j=R("section"),Q=R("div"),le=R("div"),oe=R("h5"),de=q(X),re=B(),x=R("span"),F(me.$$.fragment),ee=B(),F(ke.$$.fragment),pe=B(),Fe=R("p"),Ee=q(Ve),We=B(),ge=R("div"),F(ve.$$.fragment),be=B(),F(ue.$$.fragment),nt=B(),F(Oe.$$.fragment),dt=B(),F(yt.$$.fragment),at=B(),ut=R("section"),At=R("div"),xe=R("div"),mt=R("h5"),gt=q(we),It=B(),Ht=R("span"),F(Wt.$$.fragment),Xt=B(),Ce=R("p"),Le=q(se),_t=B(),zt=R("div"),F(Be.$$.fragment),Ot=B(),F(kt.$$.fragment),Pt=B(),Ye=R("section"),ze=R("div"),Qe=R("div"),He=R("h5"),Bt=q(Tt),qn=B(),li=R("span"),F(di.$$.fragment),Mi=B(),wi=R("p"),Zi=q(Ri),ur=B(),F(Kn.$$.fragment),P(e,"class","gs-page-title"),P(a,"class","gs-page-info"),P(_,"class","svelte-16pcwyt"),P(C,"class","card-status svelte-16pcwyt"),P(C,"title",M=t[3].detail),P(g,"class","card-header svelte-16pcwyt"),P(N,"class","card-copy svelte-16pcwyt"),P(h,"class","gs-card settings-card svelte-16pcwyt"),P(d,"class","gs-section"),P(oe,"class","svelte-16pcwyt"),P(x,"class","card-status svelte-16pcwyt"),P(le,"class","card-header svelte-16pcwyt"),P(Fe,"class","card-copy svelte-16pcwyt"),P(ge,"class","card-fields svelte-16pcwyt"),P(Q,"class","gs-card settings-card svelte-16pcwyt"),P(j,"class","gs-section"),P(mt,"class","svelte-16pcwyt"),P(Ht,"class","card-status svelte-16pcwyt"),P(Ht,"title",qt=t[0].detail),P(xe,"class","card-header svelte-16pcwyt"),P(Ce,"class","card-copy svelte-16pcwyt"),P(zt,"class","card-fields svelte-16pcwyt"),P(At,"class","gs-card settings-card svelte-16pcwyt"),P(ut,"class","gs-section"),P(He,"class","svelte-16pcwyt"),P(li,"class","card-status svelte-16pcwyt"),P(li,"title",hi=t[4].detail),P(Qe,"class","card-header svelte-16pcwyt"),P(wi,"class","card-copy svelte-16pcwyt"),P(ze,"class","gs-card settings-card svelte-16pcwyt"),P(Ye,"class","gs-section")},m(lt,St){y(lt,e,St),H(n,e,null),T(e,i),T(e,l),T(e,r),H(s,e,null),y(lt,o,St),y(lt,a,St),T(a,f),y(lt,c,St),y(lt,d,St),T(d,h),T(h,g),T(g,_),T(_,S),T(g,A),T(g,C),H(I,C,null),T(h,L),T(h,N),T(N,W),T(h,D),H(G,h,null),y(lt,$,St),y(lt,j,St),T(j,Q),T(Q,le),T(le,oe),T(oe,de),T(le,re),T(le,x),H(me,x,null),T(x,ee),H(ke,x,null),T(Q,pe),T(Q,Fe),T(Fe,Ee),T(Q,We),T(Q,ge),H(ve,ge,null),T(ge,be),H(ue,ge,null),T(ge,nt),H(Oe,ge,null),T(ge,dt),H(yt,ge,null),y(lt,at,St),y(lt,ut,St),T(ut,At),T(At,xe),T(xe,mt),T(mt,gt),T(xe,It),T(xe,Ht),H(Wt,Ht,null),T(At,Xt),T(At,Ce),T(Ce,Le),T(At,_t),T(At,zt),H(Be,zt,null),T(zt,Ot),H(kt,zt,null),y(lt,Pt,St),y(lt,Ye,St),T(Ye,ze),T(ze,Qe),T(Qe,He),T(He,Bt),T(Qe,qn),T(Qe,li),H(di,li,null),T(ze,Mi),T(ze,wi),T(wi,Zi),T(ze,ur),H(Kn,ze,null),Rn=!0},p(lt,[St]){const Dn={};St&4194304&&(Dn.$$scope={dirty:St,ctx:lt}),s.$set(Dn),(!Rn||St&32)&&u!==(u=lt[5]("Work in progress. Remote vision APIs are too slow to block every image on the request path; scanning strategy is still being decided.")+"")&&Z(f,u),(!Rn||St&32)&&v!==(v=lt[5]("Image filtering")+"")&&Z(S,v);const Hn={};St&8&&(Hn.type=pr(lt[3].state)),St&4194312&&(Hn.$$scope={dirty:St,ctx:lt}),I.$set(Hn),(!Rn||St&8&&M!==(M=lt[3].detail))&&P(C,"title",M),(!Rn||St&32)&&z!==(z=lt[5]("Use a vision model to classify images that pass through the MITM proxy (NSFW / not safe for work). HTTPS inspection must be enabled or the proxy never sees the image bytes.")+"")&&Z(W,z);const Ll={};St&32&&(Ll.title=lt[5]("AI image filtering")),St&32&&(Ll.labelText=lt[5]("AI image filtering")),G.$set(Ll),(!Rn||St&32)&&X!==(X=lt[5]("API keys")+"")&&Z(de,X);const mi={};St&4&&(mi.type=pr(lt[2].state)),St&4&&(mi.title=lt[2].detail),St&4194308&&(mi.$$scope={dirty:St,ctx:lt}),me.$set(mi);const Un={};St&2&&(Un.type=pr(lt[1].state)),St&2&&(Un.title=lt[1].detail),St&4194306&&(Un.$$scope={dirty:St,ctx:lt}),ke.$set(Un),(!Rn||St&32)&&Ve!==(Ve=lt[5]("Keys are stored in GateSentry settings on the server. They are never sent to the browser except to this admin page. Use the provider that matches the radio above.")+"")&&Z(Ee,Ve);const tn={};St&32&&(tn.title=lt[5]("Grok API key")),St&32&&(tn.labelText=lt[5]("Grok API key")),St&32&&(tn.helperText=lt[5]("xAI / Grok key from console.x.ai. Used when Enable Grok is selected.")),ve.$set(tn);const Tn={};St&32&&(Tn.title=lt[5]("Grok model")),St&32&&(Tn.labelText=lt[5]("Grok model")),St&32&&(Tn.helperText=lt[5]("Vision model id. Empty uses grok-4.5.")),ue.$set(Tn);const pn={};St&32&&(pn.title=lt[5]("OpenAI API key")),St&32&&(pn.labelText=lt[5]("OpenAI API key")),St&32&&(pn.helperText=lt[5]("OpenAI key. Used when Enable ChatGPT is selected.")),Oe.$set(pn);const ml={};St&32&&(ml.title=lt[5]("ChatGPT model")),St&32&&(ml.labelText=lt[5]("ChatGPT model")),St&32&&(ml.helperText=lt[5]("Vision model id. Empty uses gpt-4o-mini.")),yt.$set(ml),(!Rn||St&32)&&we!==(we=lt[5]("Local LLM (Ollama)")+"")&&Z(gt,we);const gl={};St&1&&(gl.type=pr(lt[0].state)),St&4194305&&(gl.$$scope={dirty:St,ctx:lt}),Wt.$set(gl),(!Rn||St&1&&qt!==(qt=lt[0].detail))&&P(Ht,"title",qt),(!Rn||St&32)&&se!==(se=lt[5]("Used when Enable Local LLM is selected. Point this at an Ollama HTTP API. Scanning is not live in the proxy yet (Alpha).")+"")&&Z(Le,se);const ri={};St&32&&(ri.title=lt[5]("Local LLM URL")),St&32&&(ri.labelText=lt[5]("Local LLM URL")),St&32&&(ri.helperText=lt[5]("Ollama base URL, for example http://127.0.0.1:11434")),Be.$set(ri);const Sn={};St&32&&(Sn.title=lt[5]("Ollama model")),St&32&&(Sn.labelText=lt[5]("Ollama model")),St&32&&(Sn.helperText=lt[5]("Vision model tag, for example gemma4:e4b-mlx. Empty uses llava.")),kt.$set(Sn),(!Rn||St&32)&&Tt!==(Tt=lt[5]("Legacy local scanner")+"")&&Z(Bt,Tt);const Di={};St&16&&(Di.type=pr(lt[4].state)),St&4194320&&(Di.$$scope={dirty:St,ctx:lt}),di.$set(Di),(!Rn||St&16&&hi!==(hi=lt[4].detail))&&P(li,"title",hi),(!Rn||St&32)&&Ri!==(Ri=lt[5]("Optional. The original GateSentry AI path posted image bytes to a local classifier URL. It is not used when Grok or ChatGPT is selected.")+"")&&Z(Zi,Ri);const el={};St&32&&(el.title=lt[5]("AI Service URL")),St&32&&(el.labelText=lt[5]("AI Service URL")),St&32&&(el.helperText=lt[5]("HTTP endpoint that accepts a multipart image upload. Leave empty unless you run a local scanner.")),Kn.$set(el)},i(lt){Rn||(b(n.$$.fragment,lt),b(s.$$.fragment,lt),b(I.$$.fragment,lt),b(G.$$.fragment,lt),b(me.$$.fragment,lt),b(ke.$$.fragment,lt),b(ve.$$.fragment,lt),b(ue.$$.fragment,lt),b(Oe.$$.fragment,lt),b(yt.$$.fragment,lt),b(Wt.$$.fragment,lt),b(Be.$$.fragment,lt),b(kt.$$.fragment,lt),b(di.$$.fragment,lt),b(Kn.$$.fragment,lt),Rn=!0)},o(lt){k(n.$$.fragment,lt),k(s.$$.fragment,lt),k(I.$$.fragment,lt),k(G.$$.fragment,lt),k(me.$$.fragment,lt),k(ke.$$.fragment,lt),k(ve.$$.fragment,lt),k(ue.$$.fragment,lt),k(Oe.$$.fragment,lt),k(yt.$$.fragment,lt),k(Wt.$$.fragment,lt),k(Be.$$.fragment,lt),k(kt.$$.fragment,lt),k(di.$$.fragment,lt),k(Kn.$$.fragment,lt),Rn=!1},d(lt){lt&&(w(e),w(o),w(a),w(c),w(d),w($),w(j),w(at),w(ut),w(Pt),w(Ye)),U(n),U(s),U(I),U(G),U(me),U(ke),U(ve),U(ue),U(Oe),U(yt),U(Wt),U(Be),U(kt),U(di),U(Kn)}}}function IM(t){if(!t||typeof t!="object")return"";const e=t.Value!=null?t.Value:t.value;return String(e||"").trim()}function Qf(t){return t&&typeof t=="object"&&t.Configured!=null?!!t.Configured:IM(t)!==""}function R1e(t,e){return Promise.race([t,new Promise((n,i)=>setTimeout(()=>i(new Error("status timeout")),e))])}function pr(t){switch(t){case"ok":return"green";case"unauthorized":return"magenta";case"unreachable":return"red";case"disabled":case"not_configured":return"gray";case"checking":return"cool-gray";default:return"gray"}}function D1e(t,e,n){let i,l,r,s,o,a,u;Mt(t,ii,W=>n(5,a=W)),Mt(t,An,W=>n(16,u=W));const f=[{value:"disabled",label:a("Disable")},{value:"grok",label:a("Enable Grok")},{value:"chatgpt",label:a("Enable ChatGPT")},{value:"local",label:a("Enable Local LLM")}],c={state:"checking",detail:""},d={state:"not_configured",detail:""};let h=null,g=!1,_="disabled",v=!1,S=!1,A=!1,C=!1;async function I(){try{const[W,D,G,$,j]=await Promise.all([u.api.getSetting("ai_image_filtering_mode"),u.api.getSetting("ai_grok_api_key"),u.api.getSetting("ai_openai_api_key"),u.api.getSetting("ai_local_llm_url"),u.api.getSetting("ai_scanner_url")]);n(11,_=IM(W)||"disabled"),n(12,v=Qf(D)),n(13,S=Qf(G)),n(14,A=Qf($)),n(15,C=Qf(j))}catch{}}async function M(){n(10,g=!0);try{await I();const W=await R1e(u.api.doCall("/ai/status"),12e3);W&&W.grok&&(n(9,h=W),W.mode&&n(11,_=W.mode))}catch{n(9,h=null)}finally{n(10,g=!1)}}function L(W,D,G,$){return D&&D[W]&&D[W].state?D[W]:$?G?c:{state:"unreachable",detail:"Status check did not complete"}:d}function N(W,D,G,$,j){const Q=W&&W.mode||D||"disabled";return Q==="disabled"?{state:"disabled",detail:"Image filtering is off"}:Q==="grok"?G:Q==="chatgpt"?$:Q==="local"?j:d}function z(W){switch(W){case"ok":return a("Reachable");case"unauthorized":return a("Invalid key");case"unreachable":return a("Unreachable");case"not_configured":return a("Not configured");case"disabled":return a("Disabled");case"checking":return a("Checking…");default:return W}}return _n(async()=>{await I(),await M()}),t.$$.update=()=>{t.$$.dirty&5632&&n(2,i=L("grok",h,g,v)),t.$$.dirty&9728&&n(1,l=L("chatgpt",h,g,S)),t.$$.dirty&17920&&n(0,r=L("local",h,g,A)),t.$$.dirty&34304&&n(4,s=L("legacy",h,g,C)),t.$$.dirty&2567&&n(3,o=N(h,_,i,l,r))},[r,l,i,o,s,a,f,M,z,h,g,_,v,S,A,C]}class P1e extends De{constructor(e){super(),Re(this,e,D1e,I1e,Ie,{})}}function b6(t){let e,n,i,l;function r(o){t[7](o)}let s={shouldSubmitOnEnter:t[4],hasForm:t[3],modalHeading:t[2],primaryButtonDisabled:!0,$$slots:{default:[N1e]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),n=new gH({props:s}),ft.push(()=>Yt(n,"open",r)),n.$on("close",function(){$s(t[1].close)&&t[1].close.apply(this,arguments)}),{c(){e=R("div"),F(n.$$.fragment),P(e,"class","gatesentry-modal")},m(o,a){y(o,e,a),H(n,e,null),l=!0},p(o,a){t=o;const u={};a&16&&(u.shouldSubmitOnEnter=t[4]),a&8&&(u.hasForm=t[3]),a&4&&(u.modalHeading=t[2]),a&256&&(u.$$scope={dirty:a,ctx:t}),!i&&a&1&&(i=!0,u.open=t[0],jt(()=>i=!1)),n.$set(u)},i(o){l||(b(n.$$.fragment,o),l=!0)},o(o){k(n.$$.fragment,o),l=!1},d(o){o&&w(e),U(n)}}}function N1e(t){let e;const n=t[6].default,i=Ze(n,t,t[8],null);return{c(){i&&i.c()},m(l,r){i&&i.m(l,r),e=!0},p(l,r){i&&i.p&&(!e||r&256)&&Ke(i,n,l,l[8],e?Xe(n,l[8],r,null):$e(l[8]),null)},i(l){e||(b(i,l),e=!0)},o(l){k(i,l),e=!1},d(l){i&&i.d(l)}}}function B1e(t){let e,n,i=t[0]&&b6(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,[r]){l[0]?i?(i.p(l,r),r&1&&b(i,1)):(i=b6(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function z1e(t,e,n){let{$$slots:i={},$$scope:l}=e,{open:r=!1}=e,{on:s={close:()=>{}}}=e,{title:o=""}=e,{children:a=null}=e,{hasForm:u=!1}=e,{shouldSubmitOnEnter:f=!1}=e;function c(d){r=d,n(0,r)}return t.$$set=d=>{"open"in d&&n(0,r=d.open),"on"in d&&n(1,s=d.on),"title"in d&&n(2,o=d.title),"children"in d&&n(5,a=d.children),"hasForm"in d&&n(3,u=d.hasForm),"shouldSubmitOnEnter"in d&&n(4,f=d.shouldSubmitOnEnter),"$$scope"in d&&n(8,l=d.$$scope)},[r,s,o,u,f,a,i,c,l]}class H1e extends De{constructor(e){super(),Re(this,e,z1e,B1e,Ie,{open:0,on:1,title:2,children:5,hasForm:3,shouldSubmitOnEnter:4})}}function U1e(t){let e,n,i,l;return e=new mu({props:{value:"true",labelText:t[4]("Allow access")}}),i=new mu({props:{value:"false",labelText:t[4]("Deny access")}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&16&&(o.labelText=r[4]("Allow access")),e.$set(o);const a={};s&16&&(a.labelText=r[4]("Deny access")),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function F1e(t){let e,n;return e=new Rt({props:{type:"submit",$$slots:{default:[V1e]},$$scope:{ctx:t}}}),e.$on("click",t[5]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8208&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function G1e(t){let e,n;return e=new Rt({props:{type:"submit",$$slots:{default:[W1e]},$$scope:{ctx:t}}}),e.$on("click",t[5]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8208&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function V1e(t){let e=t[4]("Create User")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Create User")+"")&&Z(n,e)},d(i){i&&w(n)}}}function W1e(t){let e=t[4]("Save User")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Save User")+"")&&Z(n,e)},d(i){i&&w(n)}}}function q1e(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S;function A(G){t[7](G)}let C={id:"user",labelText:t[4]("User"),disabled:!!t[0]};t[1]!==void 0&&(C.value=t[1]),e=new Jn({props:C}),ft.push(()=>Yt(e,"value",A));function I(G){t[8](G)}let M={id:"password",labelText:t[4]("Password"),type:"password"};t[2]!==void 0&&(M.value=t[2]),s=new Jn({props:M}),ft.push(()=>Yt(s,"value",I));function L(G){t[9](G)}let N={legendText:"Allow internet access",$$slots:{default:[U1e]},$$scope:{ctx:t}};t[3]!==void 0&&(N.selected=t[3]),c=new UT({props:N}),ft.push(()=>Yt(c,"selected",L));const z=[G1e,F1e],W=[];function D(G,$){return G[0]?0:1}return _=D(t),v=W[_]=z[_](t),{c(){F(e.$$.fragment),i=B(),l=R("br"),r=B(),F(s.$$.fragment),a=B(),u=R("br"),f=B(),F(c.$$.fragment),h=B(),g=R("div"),v.c(),P(g,"class","content-right"),wt(g,"margin-top","10px")},m(G,$){H(e,G,$),y(G,i,$),y(G,l,$),y(G,r,$),H(s,G,$),y(G,a,$),y(G,u,$),y(G,f,$),H(c,G,$),y(G,h,$),y(G,g,$),W[_].m(g,null),S=!0},p(G,$){const j={};$&16&&(j.labelText=G[4]("User")),$&1&&(j.disabled=!!G[0]),!n&&$&2&&(n=!0,j.value=G[1],jt(()=>n=!1)),e.$set(j);const Q={};$&16&&(Q.labelText=G[4]("Password")),!o&&$&4&&(o=!0,Q.value=G[2],jt(()=>o=!1)),s.$set(Q);const le={};$&8208&&(le.$$scope={dirty:$,ctx:G}),!d&&$&8&&(d=!0,le.selected=G[3],jt(()=>d=!1)),c.$set(le);let oe=_;_=D(G),_===oe?W[_].p(G,$):(fe(),k(W[oe],1,1,()=>{W[oe]=null}),ce(),v=W[_],v?v.p(G,$):(v=W[_]=z[_](G),v.c()),b(v,1),v.m(g,null))},i(G){S||(b(e.$$.fragment,G),b(s.$$.fragment,G),b(c.$$.fragment,G),b(v),S=!0)},o(G){k(e.$$.fragment,G),k(s.$$.fragment,G),k(c.$$.fragment,G),k(v),S=!1},d(G){G&&(w(i),w(l),w(r),w(a),w(u),w(f),w(h),w(g)),U(e,G),U(s,G),U(c,G),W[_].d()}}}function j1e(t){let e,n;return e=new DT({props:{$$slots:{default:[q1e]},$$scope:{ctx:t}}}),e.$on("submit",t[5]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&8223&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Y1e(t,e,n){let i,l;Mt(t,An,v=>n(10,i=v)),Mt(t,ii,v=>n(4,l=v));const r=yn();let{showForm:s=!1}=e,{user:o=null}=e,a=(o==null?void 0:o.username)??"",u=(o==null?void 0:o.password)??"",f=o!=null&&o.allowaccess&&o.allowaccess==!0?"true":"false";Es(()=>{n(1,a=""),n(2,u=""),n(3,f="true")});const c=v=>{ci.add(ao({title:l("Error"),subtitle:l("Error : "+v)},l))},d=async v=>{v.preventDefault();try{if(o){const S=await i.api.updateUser({username:a,password:u,allowaccess:f=="true"});S.ok?r("updateuser",{username:a,password:u}):c(S.error);return}else{const S=await i.api.createUser({username:a,password:u,allowaccess:f=="true"});S.ok?r("createuser",{username:a,password:u}):c(S.error)}}catch(S){c(S.message)}};function h(v){a=v,n(1,a)}function g(v){u=v,n(2,u)}function _(v){f=v,n(3,f)}return t.$$set=v=>{"showForm"in v&&n(6,s=v.showForm),"user"in v&&n(0,o=v.user)},[o,a,u,f,l,d,s,h,g,_]}class Z1e extends De{constructor(e){super(),Re(this,e,Y1e,j1e,Ie,{showForm:6,user:0})}}function X1e(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function K1e(t){let e;return{c(){e=q("Users")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function $1e(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[X1e]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[K1e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&1048576&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1048576&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function v6(t){let e,n,i;return n=new K1({}),{c(){e=R("div"),F(n.$$.fragment)},m(l,r){y(l,e,r),H(n,e,null),i=!0},i(l){i||(b(n.$$.fragment,l),i=!0)},o(l){k(n.$$.fragment,l),i=!1},d(l){l&&w(e),U(n)}}}function J1e(t){let e,n;return e=new Z1e({props:{user:t[2]}}),e.$on("createuser",t[8]),e.$on("updateuser",t[9]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4&&(r.user=i[2]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function k6(t){var a;let e,n,i,l,r,s;n=new Rt({props:{size:"small",icon:zu,$$slots:{default:[Q1e]},$$scope:{ctx:t}}}),n.$on("click",t[13]);let o=t[1].length===0&&w6(t);return r=new Ol({props:{headers:[{key:"user",value:t[4]("Name")},{key:"dataconsumed",value:t[4]("Data Consumed")},{key:"allowaccess",value:t[4]("Allow Access")},{key:"actions",value:t[4]("Actions")}],rows:(a=t[1])==null?void 0:a.map(y6),$$slots:{cell:[a0e,({row:u,cell:f})=>({18:u,19:f}),({row:u,cell:f})=>(u?262144:0)|(f?524288:0)]},$$scope:{ctx:t}}}),{c(){e=R("div"),F(n.$$.fragment),i=B(),o&&o.c(),l=B(),F(r.$$.fragment),wt(e,"padding-bottom","10px"),P(e,"class","content-right")},m(u,f){y(u,e,f),H(n,e,null),y(u,i,f),o&&o.m(u,f),y(u,l,f),H(r,u,f),s=!0},p(u,f){var h;const c={};f&1048592&&(c.$$scope={dirty:f,ctx:u}),n.$set(c),u[1].length===0?o?o.p(u,f):(o=w6(u),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null);const d={};f&16&&(d.headers=[{key:"user",value:u[4]("Name")},{key:"dataconsumed",value:u[4]("Data Consumed")},{key:"allowaccess",value:u[4]("Allow Access")},{key:"actions",value:u[4]("Actions")}]),f&2&&(d.rows=(h=u[1])==null?void 0:h.map(y6)),f&1835032&&(d.$$scope={dirty:f,ctx:u}),r.$set(d)},i(u){s||(b(n.$$.fragment,u),b(r.$$.fragment,u),s=!0)},o(u){k(n.$$.fragment,u),k(r.$$.fragment,u),s=!1},d(u){u&&(w(e),w(i),w(l)),U(n),o&&o.d(u),U(r,u)}}}function Q1e(t){let e=t[4]("Add User")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Add User")+"")&&Z(n,e)},d(i){i&&w(n)}}}function w6(t){let e,n=t[4]("No users registered yet.")+"",i;return{c(){e=R("div"),i=q(n)},m(l,r){y(l,e,r),T(e,i)},p(l,r){r&16&&n!==(n=l[4]("No users registered yet.")+"")&&Z(i,n)},d(l){l&&w(e)}}}function x1e(t){let e=t[19].value+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&524288&&e!==(e=i[19].value+"")&&Z(n,e)},i:he,o:he,d(i){i&&w(n)}}}function e0e(t){let e=Pk(t[19].value)+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&524288&&e!==(e=Pk(i[19].value)+"")&&Z(n,e)},i:he,o:he,d(i){i&&w(n)}}}function t0e(t){let e,n,i,l,r,s,o,a;function u(){return t[14](t[18])}n=new Rt({props:{size:"small",icon:dd,iconDescription:t[4]("Delete"),$$slots:{default:[n0e]},$$scope:{ctx:t}}}),n.$on("click",u);function f(){return t[15](t[18])}l=new Rt({props:{size:"small",icon:xs,iconDescription:t[4]("Edit User"),$$slots:{default:[i0e]},$$scope:{ctx:t}}}),l.$on("click",f);const c=[r0e,l0e],d=[];function h(g,_){return g[18].allowaccess?0:1}return s=h(t),o=d[s]=c[s](t),{c(){e=R("div"),F(n.$$.fragment),i=B(),F(l.$$.fragment),r=B(),o.c(),wt(e,"float","right")},m(g,_){y(g,e,_),H(n,e,null),T(e,i),H(l,e,null),T(e,r),d[s].m(e,null),a=!0},p(g,_){t=g;const v={};_&16&&(v.iconDescription=t[4]("Delete")),_&1048592&&(v.$$scope={dirty:_,ctx:t}),n.$set(v);const S={};_&16&&(S.iconDescription=t[4]("Edit User")),_&1048592&&(S.$$scope={dirty:_,ctx:t}),l.$set(S);let A=s;s=h(t),s===A?d[s].p(t,_):(fe(),k(d[A],1,1,()=>{d[A]=null}),ce(),o=d[s],o?o.p(t,_):(o=d[s]=c[s](t),o.c()),b(o,1),o.m(e,null))},i(g){a||(b(n.$$.fragment,g),b(l.$$.fragment,g),b(o),a=!0)},o(g){k(n.$$.fragment,g),k(l.$$.fragment,g),k(o),a=!1},d(g){g&&w(e),U(n),U(l),d[s].d()}}}function n0e(t){let e=t[4]("Delete")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Delete")+"")&&Z(n,e)},d(i){i&&w(n)}}}function i0e(t){let e=t[4]("Edit User")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Edit User")+"")&&Z(n,e)},d(i){i&&w(n)}}}function l0e(t){let e,n;function i(){return t[17](t[18])}return e=new Rt({props:{size:"small",icon:$1,iconDescription:t[4]("Enable Internet Access"),$$slots:{default:[s0e]},$$scope:{ctx:t}}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&16&&(s.iconDescription=t[4]("Enable Internet Access")),r&1048592&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function r0e(t){let e,n;function i(){return t[16](t[18])}return e=new Rt({props:{size:"small",icon:Pq,iconDescription:t[4]("Disable Internet Access"),$$slots:{default:[o0e]},$$scope:{ctx:t}}}),e.$on("click",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r&16&&(s.iconDescription=t[4]("Disable Internet Access")),r&1048592&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function s0e(t){let e=t[4]("Enable Internet Access")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Enable Internet Access")+"")&&Z(n,e)},d(i){i&&w(n)}}}function o0e(t){let e=t[4]("Disable Internet Access")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&16&&e!==(e=i[4]("Disable Internet Access")+"")&&Z(n,e)},d(i){i&&w(n)}}}function a0e(t){let e,n,i,l;const r=[t0e,e0e,x1e],s=[];function o(a,u){return a[19].key==="actions"?0:a[19].key==="dataconsumed"?1:2}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function u0e(t){let e,n,i,l=t[4]("Users")+"",r,s,o,a,u,f,c,d,h,g,_,v;e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[$1e]},$$scope:{ctx:t}}});let S=!t[1]&&v6();function A(M){t[11](M)}let C={shouldSubmitOnEnter:!0,hasForm:!0,title:t[2]!=null?t[4]("Edit User"):t[4]("Add User"),$$slots:{default:[J1e]},$$scope:{ctx:t}};t[0]!==void 0&&(C.open=t[0]),f=new H1e({props:C}),ft.push(()=>Yt(f,"open",A)),f.$on("close",t[12]),h=new tr({props:{keyName:"EnableUsers",type:"radio",title:t[4]("Allow only registered users to access the proxy server"),labelText:t[4]("Allow only registered users to access the proxy server"),helperText:""}});let I=t[1]&&k6(t);return{c(){F(e.$$.fragment),n=B(),i=R("h2"),r=q(l),s=B(),o=R("br"),a=B(),S&&S.c(),u=B(),F(f.$$.fragment),d=B(),F(h.$$.fragment),g=B(),I&&I.c(),_=qe()},m(M,L){H(e,M,L),y(M,n,L),y(M,i,L),T(i,r),y(M,s,L),y(M,o,L),y(M,a,L),S&&S.m(M,L),y(M,u,L),H(f,M,L),y(M,d,L),H(h,M,L),y(M,g,L),I&&I.m(M,L),y(M,_,L),v=!0},p(M,[L]){const N={};L&1048576&&(N.$$scope={dirty:L,ctx:M}),e.$set(N),(!v||L&16)&&l!==(l=M[4]("Users")+"")&&Z(r,l),M[1]?S&&(fe(),k(S,1,1,()=>{S=null}),ce()):S?L&2&&b(S,1):(S=v6(),S.c(),b(S,1),S.m(u.parentNode,u));const z={};L&20&&(z.title=M[2]!=null?M[4]("Edit User"):M[4]("Add User")),L&1048580&&(z.$$scope={dirty:L,ctx:M}),!c&&L&1&&(c=!0,z.open=M[0],jt(()=>c=!1)),f.$set(z);const W={};L&16&&(W.title=M[4]("Allow only registered users to access the proxy server")),L&16&&(W.labelText=M[4]("Allow only registered users to access the proxy server")),h.$set(W),M[1]?I?(I.p(M,L),L&2&&b(I,1)):(I=k6(M),I.c(),b(I,1),I.m(_.parentNode,_)):I&&(fe(),k(I,1,1,()=>{I=null}),ce())},i(M){v||(b(e.$$.fragment,M),b(S),b(f.$$.fragment,M),b(h.$$.fragment,M),b(I),v=!0)},o(M){k(e.$$.fragment,M),k(S),k(f.$$.fragment,M),k(h.$$.fragment,M),k(I),v=!1},d(M){M&&(w(n),w(i),w(s),w(o),w(a),w(u),w(d),w(g),w(_)),U(e,M),S&&S.d(M),U(f,M),U(h,M),I&&I.d(M)}}}const y6=t=>({id:t.username,user:t.username,dataconsumed:t.dataconsumed,allowaccess:t.allowaccess});function f0e(t,e,n){let i,l;Mt(t,An,M=>n(3,i=M)),Mt(t,ii,M=>n(4,l=M));let r=!1,s=null,o=null;const a=async()=>{n(1,s=null),n(1,s=(await i.api.getUsers()).users??[])};_n(a);const u=M=>{n(2,o=s==null?void 0:s.find(L=>L.username===M)),n(0,r=!0)},f=async M=>{confirm(l("Are you sure you want to delete this user?"))&&(await i.api.deleteUser(M),await a())},c=async M=>{n(0,r=!1),await a()},d=async M=>{n(0,r=!1),await a()},h=()=>{n(2,o=null),n(0,r=!0)};function g(M){r=M,n(0,r)}return[r,s,o,i,l,a,u,f,c,d,h,g,()=>{n(0,r=!1),n(2,o=null)},()=>{h()},M=>f(M.id),M=>u(M.id),async M=>{await i.api.updateUser({username:M.id,password:"",allowaccess:!1}),a()},async M=>{await i.api.updateUser({username:M.id,password:"",allowaccess:!0}),a()}]}class c0e extends De{constructor(e){super(),Re(this,e,f0e,u0e,Ie,{})}}function d0e(t){let e,n,i,l;return e=new jZ({}),i=new cX({props:{userProfilePanelOpen:t[1]}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&2&&(o.userProfilePanelOpen=r[1]),i.$set(o)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function h0e(t){let e,n;return e=new $V({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function m0e(t){let e,n,i;function l(s){t[3](s)}let r={company:"Gatesentry",platformName:t[2],persistentHamburgerMenu:!0,$$slots:{"skip-to-content":[h0e],default:[d0e]},$$scope:{ctx:t}};return t[0]!==void 0&&(r.isSideNavOpen=t[0]),e=new RG({props:r}),ft.push(()=>Yt(e,"isSideNavOpen",l)),{c(){F(e.$$.fragment)},m(s,o){H(e,s,o),i=!0},p(s,[o]){const a={};o&4&&(a.platformName=s[2]),o&34&&(a.$$scope={dirty:o,ctx:s}),!n&&o&1&&(n=!0,a.isSideNavOpen=s[0],jt(()=>n=!1)),e.$set(a)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){U(e,s)}}}function g0e(t,e,n){let i;Mt(t,An,a=>n(4,i=a));let{isSideNavOpen:l=!1}=e,{userProfilePanelOpen:r=!1}=e,s="";_n(async()=>{const a=await i.api.doCall("/about");n(2,s=a.version)});function o(a){l=a,n(0,l)}return t.$$set=a=>{"isSideNavOpen"in a&&n(0,l=a.isSideNavOpen),"userProfilePanelOpen"in a&&n(1,r=a.userProfilePanelOpen)},[l,r,s,o]}class _0e extends De{constructor(e){super(),Re(this,e,g0e,m0e,Ie,{isSideNavOpen:0,userProfilePanelOpen:1})}}function T6(t,e,n){const i=t.slice();return i[7]=e[n],i}function S6(t){let e,n=t[7].description+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","category-note svelte-1orxodp")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r&1&&n!==(n=l[7].description+"")&&Z(i,n)},d(l){l&&w(e)}}}function E6(t,e){let n,i,l,r,s,o=M6(e[7])+"",a,u,f,c;function d(...g){return e[5](e[7],...g)}l=new TT({props:{labelText:e[7].name,checked:e[1].includes(e[7].id),disabled:e[2]}}),l.$on("check",d);let h=!e[3]&&S6(e);return{key:t,first:null,c(){n=R("div"),i=R("div"),F(l.$$.fragment),r=B(),s=R("span"),a=q(o),u=B(),h&&h.c(),f=B(),P(s,"class","category-count svelte-1orxodp"),P(i,"class","category-line svelte-1orxodp"),P(n,"class","category-item svelte-1orxodp"),this.first=n},m(g,_){y(g,n,_),T(n,i),H(l,i,null),T(i,r),T(i,s),T(s,a),T(n,u),h&&h.m(n,null),T(n,f),c=!0},p(g,_){e=g;const v={};_&1&&(v.labelText=e[7].name),_&3&&(v.checked=e[1].includes(e[7].id)),_&4&&(v.disabled=e[2]),l.$set(v),(!c||_&1)&&o!==(o=M6(e[7])+"")&&Z(a,o),e[3]?h&&(h.d(1),h=null):h?h.p(e,_):(h=S6(e),h.c(),h.m(n,f))},i(g){c||(b(l.$$.fragment,g),c=!0)},o(g){k(l.$$.fragment,g),c=!1},d(g){g&&w(n),U(l),h&&h.d()}}}function p0e(t){let e,n=[],i=new Map,l,r=ct(t[0]);const s=o=>o[7].id;for(let o=0;od!==f))}const u=(f,c)=>a(f.id,c.detail);return t.$$set=f=>{"categories"in f&&n(0,i=f.categories),"selection"in f&&n(1,l=f.selection),"disabled"in f&&n(2,r=f.disabled),"compact"in f&&n(3,s=f.compact)},[i,l,r,s,a,u]}class tg extends De{constructor(e){super(),Re(this,e,b0e,p0e,Ie,{categories:0,selection:1,disabled:2,compact:3})}}function O6(t,e,n){const i=t.slice();return i[10]=e[n],i}function v0e(t){let e;return{c(){e=q("Add")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function A6(t){let e,n=[],i=new Map,l,r=ct(t[0]);const s=o=>o[10];for(let o=0;oYt(n,"value",u)),n.$on("keydown",t[7]),r=new Rt({props:{size:"small",kind:"tertiary",$$slots:{default:[v0e]},$$scope:{ctx:t}}}),r.$on("click",t[4]);let c=t[0].length&&A6(t);return{c(){e=R("div"),F(n.$$.fragment),l=B(),F(r.$$.fragment),s=B(),c&&c.c(),o=qe(),P(e,"class","list-entry svelte-cz2jd")},m(d,h){y(d,e,h),H(n,e,null),T(e,l),H(r,e,null),y(d,s,h),c&&c.m(d,h),y(d,o,h),a=!0},p(d,[h]){const g={};h&2&&(g.labelText=d[1]),!i&&h&8&&(i=!0,g.value=d[3],jt(()=>i=!1)),n.$set(g);const _={};h&8192&&(_.$$scope={dirty:h,ctx:d}),r.$set(_),d[0].length?c?(c.p(d,h),h&1&&b(c,1)):(c=A6(d),c.c(),b(c,1),c.m(o.parentNode,o)):c&&(fe(),k(c,1,1,()=>{c=null}),ce())},i(d){a||(b(n.$$.fragment,d),b(r.$$.fragment,d),b(c),a=!0)},o(d){k(n.$$.fragment,d),k(r.$$.fragment,d),k(c),a=!1},d(d){d&&(w(e),w(s),w(o)),U(n),U(r),c&&c.d(d)}}}function y0e(t){let e=t.trim().toLowerCase();const n=e.indexOf("://");return n>=0&&(e=e.slice(n+3)),e=e.split(/[/?#]/)[0].replace(/:\d+$/,"").replace(/\.$/,""),e}function T0e(t,e,n){let{entries:i=[]}=e,{label:l="Domain"}=e,{tagType:r="outline"}=e;const s=yn();let o="";function a(){const h=o.split(/[\s,]+/).map(y0e).filter(Boolean),g=[...i];for(const _ of h)g.includes(_)||g.push(_);n(3,o=""),g.length!==i.length&&s("change",g)}function u(h){s("change",i.filter(g=>g!==h))}function f(h){o=h,n(3,o)}const c=h=>h.key==="Enter"&&a(),d=h=>u(h);return t.$$set=h=>{"entries"in h&&n(0,i=h.entries),"label"in h&&n(1,l=h.label),"tagType"in h&&n(2,r=h.tagType)},[i,l,r,o,a,u,f,c,d]}class ng extends De{constructor(e){super(),Re(this,e,T0e,w0e,Ie,{entries:0,label:1,tagType:2})}}const ol="default",RM=[{id:"0",text:"Sunday"},{id:"1",text:"Monday"},{id:"2",text:"Tuesday"},{id:"3",text:"Wednesday"},{id:"4",text:"Thursday"},{id:"5",text:"Friday"},{id:"6",text:"Saturday"}],S0e=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],V1="custom";function Rm(){return{id:"",name:"",description:"",blocked_categories:[],blocked_domains:[],allowed_domains:[],rules:[],safe_search:!1,users:[],priority:0}}function DM(){return{id:"",name:"",enabled:!0,action:"block",target:{all_traffic:!1,domains:[],categories:[]},url_regexes:[],blocked_content_types:[],schedule:null,users:[],domain_draft:"",url_draft:"",content_type_draft:""}}function E0e(t){return t?{timezone:t.timezone||"UTC",weekdays:[...t.weekdays||[]],windows:(t.windows||[]).map(e=>({from:e.from,to:e.to})),...t.preset?{preset:t.preset}:{}}:null}function M0e(t){var e,n,i;return{id:t.id||"",name:t.name||"",enabled:t.enabled!==!1,action:t.action==="allow"?"allow":"block",target:{all_traffic:!!((e=t.target)!=null&&e.all_traffic),domains:[...((n=t.target)==null?void 0:n.domains)||[]],categories:[...((i=t.target)==null?void 0:i.categories)||[]]},url_regexes:[...t.url_regexes||[]],blocked_content_types:[...t.blocked_content_types||[]],schedule:E0e(t.schedule),users:[...t.users||[]],domain_draft:"",url_draft:"",content_type_draft:""}}function xf(t){return{id:t.id||"",name:t.name||"",description:t.description||"",blocked_categories:[...t.blocked_categories||[]],blocked_domains:[...t.blocked_domains||[]],allowed_domains:[...t.allowed_domains||[]],rules:(t.rules||[]).map(M0e),safe_search:!!t.safe_search,users:[...t.users||[]],priority:t.priority||0}}function O0e(t){return{id:t.id,name:t.name.trim(),description:t.description,blocked_categories:t.blocked_categories,blocked_domains:t.blocked_domains,allowed_domains:t.allowed_domains,safe_search:t.safe_search,users:t.users,priority:t.priority,rules:t.rules.map(e=>({id:e.id,name:e.name.trim(),enabled:e.enabled,action:e.action,target:e.target,url_regexes:e.url_regexes,blocked_content_types:e.blocked_content_types,schedule:e.schedule,users:e.users}))}}function A0e(t){return!(t!=null&&t.length)||t.length>=7?"":[...t].sort((e,n)=>e-n).map(e=>S0e[e]).filter(Boolean).join(", ")}function sd(t){if(!t)return"Always";const e=(t.windows||[]).map(i=>i.from+"-"+i.to).join(", "),n=A0e(t.weekdays);return e+(n?" "+n:" every day")}function C0e(t,e){if(t.all_traffic)return"all traffic";const n=[...t.categories.map(e),...t.domains];return n.length?n.length>3?n.slice(0,3).join(", ")+" and "+(n.length-3)+" more":n.join(", "):"nothing yet"}function L6(t,e){let n=(t.action==="allow"?"Allow ":"Block ")+C0e(t.target,e);return t.url_regexes.length&&(n+=" when the URL matches "+t.url_regexes.join(" or ")),t.blocked_content_types.length&&(n+=(t.url_regexes.length?" or the response is ":" when the response is ")+t.blocked_content_types.join(", ")),t.schedule&&(n+=", "+sd(t.schedule)),t.users.length&&(n+=", for "+t.users.join(", ")),n}function I6(t){return t.url_regexes.length>0||t.blocked_content_types.length>0||t.users.length>0}function od(t){return t.action==="block"&&t.target.all_traffic&&!!t.schedule&&t.url_regexes.length===0&&t.blocked_content_types.length===0&&t.users.length===0}function L0e(t,e){var i;const n=DM();return n.name="Bedtime",n.target.all_traffic=!0,n.schedule={timezone:t,weekdays:e?[...e.weekdays]:[],windows:(i=e==null?void 0:e.windows)!=null&&i.length?e.windows.map(l=>({from:l.from,to:l.to})):[{from:"21:00",to:"07:00"}]},n}function I0e(t){const e=t.rules.filter(od);return t.users.length>0||t.rules.length>e.length||e.length>1}function R6(t,e){const n=[];if(t.blocked_categories.length){const r=t.blocked_categories.map(e);n.push("Blocks "+(r.length>3?r.slice(0,3).join(", ")+" and "+(r.length-3)+" more":r.join(", ")))}t.blocked_domains.length&&n.push(t.blocked_domains.length+" blocked site"+(t.blocked_domains.length===1?"":"s")),t.allowed_domains.length&&n.push(t.allowed_domains.length+" always-allowed site"+(t.allowed_domains.length===1?"":"s")),t.safe_search&&n.push("Safe search");const i=t.rules.find(r=>r.enabled&&od(r));i&&n.push("Bedtime "+sd(i.schedule));const l=t.rules.filter(r=>!od(r)).length;return l&&n.push(l+" custom rule"+(l===1?"":"s")),n.length?n.join(" · "):"Blocks nothing of its own"}function D6(t,e,n){const i=t.slice();return i[62]=e[n],i[63]=e,i[64]=n,i}function P6(t,e,n){const i=t.slice();return i[65]=e[n],i}function N6(t,e,n){const i=t.slice();return i[68]=e[n],i}function B6(t,e,n){const i=t.slice();return i[71]=e[n],i}function R0e(t){let e,n,i,l,r;return l=new ng({props:{label:"Block a domain",entries:t[0].blocked_domains,tagType:"red"}}),l.$on("change",t[30]),{c(){e=R("fieldset"),n=R("legend"),n.textContent="Blocked domains",i=B(),F(l.$$.fragment),P(n,"class","field-label svelte-k7r9rn"),P(e,"class","field svelte-k7r9rn")},m(s,o){y(s,e,o),T(e,n),T(e,i),H(l,e,null),r=!0},p(s,o){const a={};o[0]&1&&(a.entries=s[0].blocked_domains),l.$set(a)},i(s){r||(b(l.$$.fragment,s),r=!0)},o(s){k(l.$$.fragment,s),r=!1},d(s){s&&w(e),U(l)}}}function D0e(t){let e,n,i,l,r,s,o;return l=new ng({props:{label:"Allow a domain",entries:t[0].allowed_domains,tagType:"green"}}),l.$on("change",t[31]),{c(){e=R("fieldset"),n=R("legend"),n.textContent="Always allowed domains",i=B(),F(l.$$.fragment),r=B(),s=R("p"),s.textContent="Always reachable, even if a blocked category lists it.",P(n,"class","field-label svelte-k7r9rn"),P(s,"class","field-note svelte-k7r9rn"),P(e,"class","field svelte-k7r9rn")},m(a,u){y(a,e,u),T(e,n),T(e,i),H(l,e,null),T(e,r),T(e,s),o=!0},p(a,u){const f={};u[0]&1&&(f.entries=a[0].allowed_domains),l.$set(f)},i(a){o||(b(l.$$.fragment,a),o=!0)},o(a){k(l.$$.fragment,a),o=!1},d(a){a&&w(e),U(l)}}}function P0e(t){let e,n,i,l;return e=new zn({props:{sm:4,md:8,lg:8,$$slots:{default:[R0e]},$$scope:{ctx:t}}}),i=new zn({props:{sm:4,md:8,lg:8,$$slots:{default:[D0e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&1|s[2]&4096&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&4096&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function z6(t){var g,_;let e,n,i,l,r,s,o,a,u,f=(t[8].schedule.timezone||"UTC")+"",c,d,h;return n=new vc({props:{size:"sm",labelText:"From",placeholder:"HH:MM",pattern:ad,value:((g=t[8].schedule.windows[0])==null?void 0:g.from)||""}}),n.$on("change",t[34]),l=new vc({props:{size:"sm",labelText:"Until",placeholder:"HH:MM",pattern:ad,value:((_=t[8].schedule.windows[0])==null?void 0:_.to)||""}}),l.$on("change",t[35]),s=new cd({props:{size:"sm",titleText:"Nights",label:"Every night",items:RM,selectedIds:t[8].schedule.weekdays.map(String)}}),s.$on("select",t[36]),{c(){e=R("div"),F(n.$$.fragment),i=B(),F(l.$$.fragment),r=B(),F(s.$$.fragment),o=B(),a=R("p"),u=q("A night lasts until the next morning, in "),c=q(f),d=q("."),P(e,"class","window-row bedtime-row svelte-k7r9rn"),P(a,"class","field-note svelte-k7r9rn")},m(v,S){y(v,e,S),H(n,e,null),T(e,i),H(l,e,null),T(e,r),H(s,e,null),y(v,o,S),y(v,a,S),T(a,u),T(a,c),T(a,d),h=!0},p(v,S){var M,L;const A={};S[0]&256&&(A.value=((M=v[8].schedule.windows[0])==null?void 0:M.from)||""),n.$set(A);const C={};S[0]&256&&(C.value=((L=v[8].schedule.windows[0])==null?void 0:L.to)||""),l.$set(C);const I={};S[0]&256&&(I.selectedIds=v[8].schedule.weekdays.map(String)),s.$set(I),(!h||S[0]&256)&&f!==(f=(v[8].schedule.timezone||"UTC")+"")&&Z(c,f)},i(v){h||(b(n.$$.fragment,v),b(l.$$.fragment,v),b(s.$$.fragment,v),h=!0)},o(v){k(n.$$.fragment,v),k(l.$$.fragment,v),k(s.$$.fragment,v),h=!1},d(v){v&&(w(e),w(o),w(a)),U(n),U(l),U(s)}}}function H6(t){let e,n,i,l,r;return n=new cd({props:{titleText:"Proxy users on this policy",label:"Only devices assigned to it",items:t[2].map(x6),selectedIds:t[0].users}}),n.$on("select",t[38]),{c(){e=R("div"),F(n.$$.fragment),i=B(),l=R("p"),l.textContent="A signed-in proxy user gets this policy on any device.",P(l,"class","field-note svelte-k7r9rn"),P(e,"class","field svelte-k7r9rn")},m(s,o){y(s,e,o),H(n,e,null),T(e,i),T(e,l),r=!0},p(s,o){const a={};o[0]&4&&(a.items=s[2].map(x6)),o[0]&1&&(a.selectedIds=s[0].users),n.$set(a)},i(s){r||(b(n.$$.fragment,s),r=!0)},o(s){k(n.$$.fragment,s),r=!1},d(s){s&&w(e),U(n)}}}function U6(t){let e,n,i,l,r=t[64]+1+"",s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,L,N=J6(t[62]),z,W=I6(t[62]),D;function G(re){t[39](re,t[62])}let $={size:"sm",labelText:"Enabled",hideLabel:!0};t[62].enabled!==void 0&&($.toggled=t[62].enabled),u=new bc({props:$}),ft.push(()=>Yt(u,"toggled",G));function j(){return t[40](t[64])}d=new Rt({props:{size:"small",kind:"ghost",icon:UW,iconDescription:"Move rule up",disabled:t[64]===0}}),d.$on("click",j);function Q(){return t[41](t[64])}g=new Rt({props:{size:"small",kind:"ghost",icon:DW,iconDescription:"Move rule down",disabled:t[64]===t[0].rules.length-1}}),g.$on("click",Q);function le(){return t[42](t[64])}v=new Rt({props:{size:"small",kind:"danger-ghost",$$slots:{default:[N0e]},$$scope:{ctx:t}}}),v.$on("click",le),A=new dl({props:{$$slots:{default:[G0e]},$$scope:{ctx:t}}});let oe=!t[62].target.all_traffic&&F6(t);M=new dl({props:{$$slots:{default:[j0e]},$$scope:{ctx:t}}});let X=N&&q6(t),de=W&&K6();return{c(){e=R("div"),n=R("div"),i=R("h5"),l=q("Rule "),s=q(r),o=B(),a=R("div"),F(u.$$.fragment),c=B(),F(d.$$.fragment),h=B(),F(g.$$.fragment),_=B(),F(v.$$.fragment),S=B(),F(A.$$.fragment),C=B(),oe&&oe.c(),I=B(),F(M.$$.fragment),L=B(),X&&X.c(),z=B(),de&&de.c(),P(i,"class","svelte-k7r9rn"),P(a,"class","rule-head-controls svelte-k7r9rn"),P(n,"class","rule-head svelte-k7r9rn"),P(e,"class","rule svelte-k7r9rn")},m(re,x){y(re,e,x),T(e,n),T(n,i),T(i,l),T(i,s),T(n,o),T(n,a),H(u,a,null),T(a,c),H(d,a,null),T(a,h),H(g,a,null),T(a,_),H(v,a,null),T(e,S),H(A,e,null),T(e,C),oe&&oe.m(e,null),T(e,I),H(M,e,null),T(e,L),X&&X.m(e,null),T(e,z),de&&de.m(e,null),D=!0},p(re,x){t=re,(!D||x[0]&1)&&r!==(r=t[64]+1+"")&&Z(s,r);const me={};!f&&x[0]&1&&(f=!0,me.toggled=t[62].enabled,jt(()=>f=!1)),u.$set(me);const ee={};x[0]&1&&(ee.disabled=t[64]===0),d.$set(ee);const ke={};x[0]&1&&(ke.disabled=t[64]===t[0].rules.length-1),g.$set(ke);const pe={};x[2]&4096&&(pe.$$scope={dirty:x,ctx:t}),v.$set(pe);const Fe={};x[0]&1|x[2]&4096&&(Fe.$$scope={dirty:x,ctx:t}),A.$set(Fe),t[62].target.all_traffic?oe&&(fe(),k(oe,1,1,()=>{oe=null}),ce()):oe?(oe.p(t,x),x[0]&1&&b(oe,1)):(oe=F6(t),oe.c(),b(oe,1),oe.m(e,I));const Ve={};x[0]&13|x[2]&4096&&(Ve.$$scope={dirty:x,ctx:t}),M.$set(Ve),x[0]&1&&(N=J6(t[62])),N?X?(X.p(t,x),x[0]&1&&b(X,1)):(X=q6(t),X.c(),b(X,1),X.m(e,z)):X&&(fe(),k(X,1,1,()=>{X=null}),ce()),x[0]&1&&(W=I6(t[62])),W?de||(de=K6(),de.c(),de.m(e,null)):de&&(de.d(1),de=null)},i(re){D||(b(u.$$.fragment,re),b(d.$$.fragment,re),b(g.$$.fragment,re),b(v.$$.fragment,re),b(A.$$.fragment,re),b(oe),b(M.$$.fragment,re),b(X),D=!0)},o(re){k(u.$$.fragment,re),k(d.$$.fragment,re),k(g.$$.fragment,re),k(v.$$.fragment,re),k(A.$$.fragment,re),k(oe),k(M.$$.fragment,re),k(X),D=!1},d(re){re&&w(e),U(u),U(d),U(g),U(v),U(A),oe&&oe.d(),U(M),X&&X.d(),de&&de.d()}}}function N0e(t){let e;return{c(){e=q("Remove rule")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function B0e(t){let e,n,i;function l(s){t[43](s,t[62])}let r={labelText:"Name",placeholder:"Bedtime"};return t[62].name!==void 0&&(r.value=t[62].name),e=new Jn({props:r}),ft.push(()=>Yt(e,"value",l)),{c(){F(e.$$.fragment)},m(s,o){H(e,s,o),i=!0},p(s,o){t=s;const a={};!n&&o[0]&1&&(n=!0,a.value=t[62].name,jt(()=>n=!1)),e.$set(a)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){U(e,s)}}}function z0e(t){let e,n,i,l;return e=new Ln({props:{value:"block",text:"Block"}}),i=new Ln({props:{value:"allow",text:"Allow"}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p:he,i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function H0e(t){let e,n,i;function l(s){t[44](s,t[62])}let r={labelText:"Action",$$slots:{default:[z0e]},$$scope:{ctx:t}};return t[62].action!==void 0&&(r.selected=t[62].action),e=new wr({props:r}),ft.push(()=>Yt(e,"selected",l)),e.$on("change",t[14]),{c(){F(e.$$.fragment)},m(s,o){H(e,s,o),i=!0},p(s,o){t=s;const a={};o[2]&4096&&(a.$$scope={dirty:o,ctx:t}),!n&&o[0]&1&&(n=!0,a.selected=t[62].action,jt(()=>n=!1)),e.$set(a)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){U(e,s)}}}function U0e(t){let e,n,i,l;return e=new Ln({props:{value:"listed",text:"Selected categories and domains"}}),i=new Ln({props:{value:"all",text:"All traffic"}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p:he,i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function F0e(t){let e,n;function i(...l){return t[45](t[62],...l)}return e=new wr({props:{labelText:"Applies to",selected:t[62].target.all_traffic?"all":"listed",$$slots:{default:[U0e]},$$scope:{ctx:t}}}),e.$on("change",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&1&&(s.selected=t[62].target.all_traffic?"all":"listed"),r[2]&4096&&(s.$$scope={dirty:r,ctx:t}),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function G0e(t){let e,n,i,l,r,s;return e=new zn({props:{sm:4,md:4,lg:5,$$slots:{default:[B0e]},$$scope:{ctx:t}}}),i=new zn({props:{sm:4,md:4,lg:5,$$slots:{default:[H0e]},$$scope:{ctx:t}}}),r=new zn({props:{sm:4,md:8,lg:6,$$slots:{default:[F0e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(o,a){H(e,o,a),y(o,n,a),H(i,o,a),y(o,l,a),H(r,o,a),s=!0},p(o,a){const u={};a[0]&1|a[2]&4096&&(u.$$scope={dirty:a,ctx:o}),e.$set(u);const f={};a[0]&1|a[2]&4096&&(f.$$scope={dirty:a,ctx:o}),i.$set(f);const c={};a[0]&1|a[2]&4096&&(c.$$scope={dirty:a,ctx:o}),r.$set(c)},i(o){s||(b(e.$$.fragment,o),b(i.$$.fragment,o),b(r.$$.fragment,o),s=!0)},o(o){k(e.$$.fragment,o),k(i.$$.fragment,o),k(r.$$.fragment,o),s=!1},d(o){o&&(w(n),w(l)),U(e,o),U(i,o),U(r,o)}}}function F6(t){let e,n,i,l,r;function s(...a){return t[46](t[62],t[63],t[64],...a)}n=new tg({props:{categories:t[1],compact:!0,selection:t[62].target.categories}}),n.$on("change",s);function o(...a){return t[47](t[62],t[63],t[64],...a)}return l=new ng({props:{label:"Domain",entries:t[62].target.domains}}),l.$on("change",o),{c(){e=R("div"),F(n.$$.fragment),i=B(),F(l.$$.fragment),P(e,"class","rule-target svelte-k7r9rn")},m(a,u){y(a,e,u),H(n,e,null),T(e,i),H(l,e,null),r=!0},p(a,u){t=a;const f={};u[0]&2&&(f.categories=t[1]),u[0]&1&&(f.selection=t[62].target.categories),n.$set(f);const c={};u[0]&1&&(c.entries=t[62].target.domains),l.$set(c)},i(a){r||(b(n.$$.fragment,a),b(l.$$.fragment,a),r=!0)},o(a){k(n.$$.fragment,a),k(l.$$.fragment,a),r=!1},d(a){a&&w(e),U(n),U(l)}}}function G6(t,e){let n,i,l;return i=new Ln({props:{value:e[71].id,text:Q6(e[71])}}),{key:t,first:null,c(){n=qe(),F(i.$$.fragment),this.first=n},m(r,s){y(r,n,s),H(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&8&&(o.value=e[71].id),s[0]&8&&(o.text=Q6(e[71])),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(i,r)}}}function V0e(t){let e,n,i=[],l=new Map,r,s,o;e=new Ln({props:{value:"",text:"Always"}});let a=ct(t[3]);const u=f=>f[71].id;for(let f=0;f{s=null}),ce())},i(o){l||(b(e.$$.fragment,o),b(s),l=!0)},o(o){k(e.$$.fragment,o),k(s),l=!1},d(o){o&&(w(n),w(i)),U(e,o),s&&s.d(o)}}}function W6(t){let e,n;function i(...l){return t[52](t[62],...l)}return e=new cd({props:{titleText:"Only for proxy users",label:"Everyone on this policy",items:t[2].map(ey),selectedIds:t[62].users}}),e.$on("select",i),{c(){F(e.$$.fragment)},m(l,r){H(e,l,r),n=!0},p(l,r){t=l;const s={};r[0]&4&&(s.items=t[2].map(ey)),r[0]&1&&(s.selectedIds=t[62].users),e.$set(s)},i(l){n||(b(e.$$.fragment,l),n=!0)},o(l){k(e.$$.fragment,l),n=!1},d(l){U(e,l)}}}function q0e(t){let e,n,i=t[2].length&&W6(t);return{c(){i&&i.c(),e=qe()},m(l,r){i&&i.m(l,r),y(l,e,r),n=!0},p(l,r){l[2].length?i?(i.p(l,r),r[0]&4&&b(i,1)):(i=W6(l),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(l){n||(b(i),n=!0)},o(l){k(i),n=!1},d(l){l&&w(e),i&&i.d(l)}}}function j0e(t){let e,n,i,l;return e=new zn({props:{sm:4,md:8,lg:8,$$slots:{default:[W0e]},$$scope:{ctx:t}}}),i=new zn({props:{sm:4,md:8,lg:8,$$slots:{default:[q0e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&9|s[2]&4096&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&5|s[2]&4096&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function q6(t){let e,n,i,l,r,s;return l=new dl({props:{$$slots:{default:[Q0e]},$$scope:{ctx:t}}}),{c(){e=R("details"),n=R("summary"),n.textContent="Block only part of the site",i=B(),F(l.$$.fragment),P(n,"class","svelte-k7r9rn"),P(e,"class","advanced svelte-k7r9rn"),e.open=r=t[62].url_regexes.length>0||t[62].blocked_content_types.length>0},m(o,a){y(o,e,a),T(e,n),T(e,i),H(l,e,null),s=!0},p(o,a){const u={};a[0]&1|a[2]&4096&&(u.$$scope={dirty:a,ctx:o}),l.$set(u),(!s||a[0]&1&&r!==(r=o[62].url_regexes.length>0||o[62].blocked_content_types.length>0))&&(e.open=r)},i(o){s||(b(l.$$.fragment,o),s=!0)},o(o){k(l.$$.fragment,o),s=!1},d(o){o&&w(e),U(l)}}}function Y0e(t){let e;return{c(){e=q("Add pattern")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function j6(t){let e,n=[],i=new Map,l,r=ct(t[62].url_regexes);const s=o=>o[68];for(let o=0;oYt(n,"value",u)),n.$on("keydown",f);function d(){return t[55](t[62])}r=new Rt({props:{size:"small",kind:"tertiary",$$slots:{default:[Y0e]},$$scope:{ctx:t}}}),r.$on("click",d);let h=t[62].url_regexes.length&&j6(t);return{c(){e=R("div"),F(n.$$.fragment),l=B(),F(r.$$.fragment),s=B(),h&&h.c(),o=qe(),P(e,"class","list-entry svelte-k7r9rn")},m(g,_){y(g,e,_),H(n,e,null),T(e,l),H(r,e,null),y(g,s,_),h&&h.m(g,_),y(g,o,_),a=!0},p(g,_){t=g;const v={};!i&&_[0]&1&&(i=!0,v.value=t[62].url_draft,jt(()=>i=!1)),n.$set(v);const S={};_[2]&4096&&(S.$$scope={dirty:_,ctx:t}),r.$set(S),t[62].url_regexes.length?h?(h.p(t,_),_[0]&1&&b(h,1)):(h=j6(t),h.c(),b(h,1),h.m(o.parentNode,o)):h&&(fe(),k(h,1,1,()=>{h=null}),ce())},i(g){a||(b(n.$$.fragment,g),b(r.$$.fragment,g),b(h),a=!0)},o(g){k(n.$$.fragment,g),k(r.$$.fragment,g),k(h),a=!1},d(g){g&&(w(e),w(s),w(o)),U(n),U(r),h&&h.d(g)}}}function K0e(t){let e;return{c(){e=q("Add type")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Z6(t){let e,n=[],i=new Map,l,r=ct(t[62].blocked_content_types);const s=o=>o[65];for(let o=0;oYt(n,"value",u)),n.$on("keydown",f);function d(){return t[59](t[62])}r=new Rt({props:{size:"small",kind:"tertiary",$$slots:{default:[K0e]},$$scope:{ctx:t}}}),r.$on("click",d);let h=t[62].blocked_content_types.length&&Z6(t);return{c(){e=R("div"),F(n.$$.fragment),l=B(),F(r.$$.fragment),s=B(),h&&h.c(),o=qe(),P(e,"class","list-entry svelte-k7r9rn")},m(g,_){y(g,e,_),H(n,e,null),T(e,l),H(r,e,null),y(g,s,_),h&&h.m(g,_),y(g,o,_),a=!0},p(g,_){t=g;const v={};!i&&_[0]&1&&(i=!0,v.value=t[62].content_type_draft,jt(()=>i=!1)),n.$set(v);const S={};_[2]&4096&&(S.$$scope={dirty:_,ctx:t}),r.$set(S),t[62].blocked_content_types.length?h?(h.p(t,_),_[0]&1&&b(h,1)):(h=Z6(t),h.c(),b(h,1),h.m(o.parentNode,o)):h&&(fe(),k(h,1,1,()=>{h=null}),ce())},i(g){a||(b(n.$$.fragment,g),b(r.$$.fragment,g),b(h),a=!0)},o(g){k(n.$$.fragment,g),k(r.$$.fragment,g),k(h),a=!1},d(g){g&&(w(e),w(s),w(o)),U(n),U(r),h&&h.d(g)}}}function Q0e(t){let e,n,i,l;return e=new zn({props:{sm:4,md:8,lg:8,$$slots:{default:[X0e]},$$scope:{ctx:t}}}),i=new zn({props:{sm:4,md:8,lg:8,$$slots:{default:[J0e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&1|s[2]&4096&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&4096&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function K6(t){let e;return{c(){e=R("p"),e.textContent=`DNS cannot see URLs, response types, or proxy logins, so this rule is enforced by the proxy only. Devices + that use GateSentry for DNS alone are not affected by it.`,P(e,"class","field-note proxy-note svelte-k7r9rn")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function $6(t,e){let n,i,l,r=e[64]!==e[7]&&U6(e);return{key:t,first:null,c(){n=qe(),r&&r.c(),i=qe(),this.first=n},m(s,o){y(s,n,o),r&&r.m(s,o),y(s,i,o),l=!0},p(s,o){e=s,e[64]!==e[7]?r?(r.p(e,o),o[0]&129&&b(r,1)):(r=U6(e),r.c(),b(r,1),r.m(i.parentNode,i)):r&&(fe(),k(r,1,1,()=>{r=null}),ce())},i(s){l||(b(r),l=!0)},o(s){k(r),l=!1},d(s){s&&(w(n),w(i)),r&&r.d(s)}}}function x0e(t){let e;return{c(){e=q("Add rule")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function ege(t){let e;return{c(){e=q("Save policy")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function tge(t){let e;return{c(){e=q("Cancel")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function nge(t){var mt;let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,L,N,z,W,D,G,$,j,Q,le,oe,X,de,re,x,me=[],ee=new Map,ke,pe,Fe,Ve,Ee,We,ge,ve;function be(we){t[28](we)}let ue={labelText:"Name",placeholder:"Kids"};t[0].name!==void 0&&(ue.value=t[0].name),n=new Jn({props:ue}),ft.push(()=>Yt(n,"value",be)),f=new tg({props:{categories:t[1],selection:t[0].blocked_categories}}),f.$on("change",t[29]),d=new dl({props:{$$slots:{default:[P0e]},$$scope:{ctx:t}}});function nt(we){t[32](we)}let Oe={labelText:"Safe search",labelA:"Off",labelB:"Google, Bing, DuckDuckGo, and YouTube restricted mode"};t[0].safe_search!==void 0&&(Oe.toggled=t[0].safe_search),_=new bc({props:Oe}),ft.push(()=>Yt(_,"toggled",nt)),M=new bc({props:{labelText:"Bedtime",hideLabel:!0,labelA:"Off",labelB:"No internet during these hours",toggled:!!t[8]}}),M.$on("toggle",t[33]);let dt=((mt=t[8])==null?void 0:mt.schedule)&&z6(t);function yt(we){t[37](we)}let at={labelText:"Description",rows:1};t[0].description!==void 0&&(at.value=t[0].description),$=new GT({props:at}),ft.push(()=>Yt($,"value",yt));let ut=!t[9]&&t[2].length&&H6(t),At=ct(t[0].rules);const xe=we=>we[64];for(let we=0;wei=!1)),n.$set(It);const Ht={};gt[0]&2&&(Ht.categories=t[1]),gt[0]&1&&(Ht.selection=t[0].blocked_categories),f.$set(Ht);const Wt={};gt[0]&1|gt[2]&4096&&(Wt.$$scope={dirty:gt,ctx:t}),d.$set(Wt);const qt={};!v&>[0]&1&&(v=!0,qt.toggled=t[0].safe_search,jt(()=>v=!1)),_.$set(qt);const Xt={};gt[0]&256&&(Xt.toggled=!!t[8]),M.$set(Xt),(zt=t[8])!=null&&zt.schedule?dt?(dt.p(t,gt),gt[0]&256&&b(dt,1)):(dt=z6(t),dt.c(),b(dt,1),dt.m(A,null)):dt&&(fe(),k(dt,1,1,()=>{dt=null}),ce());const Ce={};!j&>[0]&1&&(j=!0,Ce.value=t[0].description,jt(()=>j=!1)),$.$set(Ce),!t[9]&&t[2].length?ut?(ut.p(t,gt),gt[0]&516&&b(ut,1)):(ut=H6(t),ut.c(),b(ut,1),ut.m(z,le)):ut&&(fe(),k(ut,1,1,()=>{ut=null}),ce()),gt[0]&67059855&&(At=ct(t[0].rules),fe(),me=Wn(me,gt,xe,1,t,At,ee,oe,Qn,$6,ke,D6),ce());const se={};gt[2]&4096&&(se.$$scope={dirty:gt,ctx:t}),pe.$set(se);const Le={};gt[0]&16&&(Le.disabled=t[4]),gt[2]&4096&&(Le.$$scope={dirty:gt,ctx:t}),Ee.$set(Le);const _t={};gt[2]&4096&&(_t.$$scope={dirty:gt,ctx:t}),ge.$set(_t)},i(we){if(!ve){b(n.$$.fragment,we),b(f.$$.fragment,we),b(d.$$.fragment,we),b(_.$$.fragment,we),b(M.$$.fragment,we),b(dt),b($.$$.fragment,we),b(ut);for(let gt=0;gt({id:t,text:t}),ey=t=>({id:t,text:t});function ige(t,e,n){let i,l,r,{draft:s}=e,{categories:o=[]}=e,{users:a=[]}=e,{schedulePresets:u=[]}=e,{timezone:f="UTC"}=e,{saving:c=!1}=e,{onSave:d=()=>{}}=e,{onCancel:h=()=>{}}=e;const g=I0e(s);function _(Ce){if(Ce&&!r){const se=u.find(Le=>Le.id==="bedtime");n(0,s.rules=[L0e(f,se),...s.rules],s)}else!Ce&&r&&I(l)}function v(Ce,se){r!=null&&r.schedule&&(n(8,r.schedule.windows[0][Ce]=se.target.value,r),n(8,r.schedule.preset=void 0,r),A())}function S(Ce){r!=null&&r.schedule&&(n(8,r.schedule.weekdays=Ce.map(Number).sort((se,Le)=>se-Le),r),n(8,r.schedule.preset=void 0,r),A())}function A(){n(0,s.rules=[...s.rules],s)}function C(){n(0,s.rules=[...s.rules,DM()],s)}function I(Ce){n(0,s.rules=s.rules.filter((se,Le)=>Le!==Ce),s)}function M(Ce,se){const Le=Ce+se;if(Le<0||Le>=s.rules.length)return;const _t=[...s.rules];[_t[Ce],_t[Le]]=[_t[Le],_t[Ce]],n(0,s.rules=_t,s)}function L(Ce,se){Ce.target.all_traffic=se.target.value==="all",A()}function N(Ce,se,Le,_t=!1){let zt=Ce[Le].trim();_t&&(zt=zt.toLowerCase()),!(!zt||Ce[se].includes(zt))&&(Ce[se]=[...Ce[se],zt],Ce[Le]="",A())}function z(Ce,se,Le){Ce[se]=Ce[se].filter(_t=>_t!==Le),A()}function W(Ce,se){Ce.users=se.map(String),A()}function D(Ce,se){Ce.schedule&&(Ce.schedule.weekdays=se.map(Number).sort((Le,_t)=>Le-_t),A())}function G(Ce){return Ce.schedule?Ce.schedule.preset||V1:""}function $(Ce,se){var _t,zt,Be;if(!se){Ce.schedule=null,A();return}if(se===V1){const Ot=((zt=(_t=Ce.schedule)==null?void 0:_t.windows)==null?void 0:zt[0])||{from:"20:00",to:"07:00"};Ce.schedule={timezone:f,weekdays:(Be=Ce.schedule)!=null&&Be.weekdays?[...Ce.schedule.weekdays]:[],windows:[{from:Ot.from,to:Ot.to}]},A();return}const Le=u.find(Ot=>Ot.id===se);Le&&(Ce.schedule={timezone:f,weekdays:[...Le.weekdays],windows:Le.windows.map(Ot=>({from:Ot.from,to:Ot.to})),preset:Le.id},A())}function j(Ce,se){$(Ce,se.target.value)}function Q(Ce,se,Le){var _t,zt;(zt=(_t=Ce.schedule)==null?void 0:_t.windows)!=null&&zt.length&&(Ce.schedule.windows[0][se]=Le.target.value,A())}function le(Ce){n(0,s.users=Ce.map(String),s)}function oe(Ce){t.$$.not_equal(s.name,Ce)&&(s.name=Ce,n(0,s))}const X=Ce=>n(0,s.blocked_categories=Ce.detail,s),de=Ce=>n(0,s.blocked_domains=Ce.detail,s),re=Ce=>n(0,s.allowed_domains=Ce.detail,s);function x(Ce){t.$$.not_equal(s.safe_search,Ce)&&(s.safe_search=Ce,n(0,s))}const me=Ce=>_(Ce.detail.toggled),ee=Ce=>v("from",Ce),ke=Ce=>v("to",Ce),pe=Ce=>S(Ce.detail.selectedIds);function Fe(Ce){t.$$.not_equal(s.description,Ce)&&(s.description=Ce,n(0,s))}const Ve=Ce=>le(Ce.detail.selectedIds);function Ee(Ce,se){t.$$.not_equal(se.enabled,Ce)&&(se.enabled=Ce,n(0,s))}const We=Ce=>M(Ce,-1),ge=Ce=>M(Ce,1),ve=Ce=>I(Ce);function be(Ce,se){t.$$.not_equal(se.name,Ce)&&(se.name=Ce,n(0,s))}function ue(Ce,se){t.$$.not_equal(se.action,Ce)&&(se.action=Ce,n(0,s))}const nt=(Ce,se)=>L(Ce,se),Oe=(Ce,se,Le,_t)=>{n(0,se[Le].target.categories=_t.detail,s),A()},dt=(Ce,se,Le,_t)=>{n(0,se[Le].target.domains=_t.detail,s),A()},yt=(Ce,se)=>j(Ce,se),at=(Ce,se)=>Q(Ce,"from",se),ut=(Ce,se)=>Q(Ce,"to",se),At=(Ce,se)=>D(Ce,se.detail.selectedIds),xe=(Ce,se)=>W(Ce,se.detail.selectedIds);function mt(Ce,se){t.$$.not_equal(se.url_draft,Ce)&&(se.url_draft=Ce,n(0,s))}const we=(Ce,se)=>se.key==="Enter"&&N(Ce,"url_regexes","url_draft"),gt=Ce=>N(Ce,"url_regexes","url_draft"),It=(Ce,se)=>z(Ce,"url_regexes",se);function Ht(Ce,se){t.$$.not_equal(se.content_type_draft,Ce)&&(se.content_type_draft=Ce,n(0,s))}const Wt=(Ce,se)=>se.key==="Enter"&&N(Ce,"blocked_content_types","content_type_draft",!0),qt=Ce=>N(Ce,"blocked_content_types","content_type_draft",!0),Xt=(Ce,se)=>z(Ce,"blocked_content_types",se);return t.$$set=Ce=>{"draft"in Ce&&n(0,s=Ce.draft),"categories"in Ce&&n(1,o=Ce.categories),"users"in Ce&&n(2,a=Ce.users),"schedulePresets"in Ce&&n(3,u=Ce.schedulePresets),"timezone"in Ce&&n(27,f=Ce.timezone),"saving"in Ce&&n(4,c=Ce.saving),"onSave"in Ce&&n(5,d=Ce.onSave),"onCancel"in Ce&&n(6,h=Ce.onCancel)},t.$$.update=()=>{t.$$.dirty[0]&1&&n(9,i=s.id===ol),t.$$.dirty[0]&1&&n(7,l=s.rules.findIndex(od)),t.$$.dirty[0]&129&&n(8,r=l>=0?s.rules[l]:null)},[s,o,a,u,c,d,h,l,r,i,g,_,v,S,A,C,I,M,L,N,z,W,D,G,j,Q,le,f,oe,X,de,re,x,me,ee,ke,pe,Fe,Ve,Ee,We,ge,ve,be,ue,nt,Oe,dt,yt,at,ut,At,xe,mt,we,gt,It,Ht,Wt,qt,Xt]}class PM extends De{constructor(e){super(),Re(this,e,ige,nge,Ie,{draft:0,categories:1,users:2,schedulePresets:3,timezone:27,saving:4,onSave:5,onCancel:6},null,[-1,-1,-1])}}const{Boolean:ud}=gT;function ty(t,e,n){const i=t.slice();return i[71]=e[n],i}function ny(t,e,n){const i=t.slice();return i[74]=e[n],i}function iy(t,e,n){const i=t.slice();return i[77]=e[n],i[78]=e,i[79]=n,i}function ly(t,e,n){const i=t.slice();return i[74]=e[n],i}function ry(t,e,n){const i=t.slice();return i[82]=e[n],i}function sy(t,e,n){const i=t.slice();return i[85]=e[n],i}function oy(t,e,n){const i=t.slice();return i[88]=e[n],i}function ay(t,e,n){const i=t.slice();return i[88]=e[n],i}function uy(t,e,n){const i=t.slice();return i[93]=e[n],i}function fy(t,e,n){const i=t.slice();return i[96]=e[n],i}function cy(t,e,n){const i=t.slice();return i[93]=e[n],i}function dy(t){let e,n;return e=new xi({props:{kind:"error",title:"Error",subtitle:t[11]}}),e.$on("close",t[42]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&2048&&(r.subtitle=i[11]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function hy(t){let e,n;return e=new xi({props:{kind:"success",title:"Done",subtitle:t[12]}}),e.$on("close",t[43]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&4096&&(r.subtitle=i[12]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function lge(t){let e,n,i,l,r,s,o,a,u,f,c=[],d=new Map,h,g,_,v,S,A,C,I,M,L,N,z,W,D,G,$,j,Q,le=t[24]&&my(t);o=new Rt({props:{size:"small",kind:"secondary",disabled:t[9],$$slots:{default:[oge]},$$scope:{ctx:t}}}),o.$on("click",t[27]);let oe=(!t[24]||t[22])&&gy(t),X=t[13]==="new"&&wy(t),de=ct(t[0]);const re=x=>x[77].id;for(let x=0;xPolicies',l=B(),r=R("div"),le&&le.c(),s=B(),F(o.$$.fragment),a=B(),oe&&oe.c(),u=B(),X&&X.c(),f=B();for(let x=0;xTest a site',v=B(),S=R("p"),S.textContent="Check whether a site is blocked for a device right now, and which setting decides it. Nothing is changed.",A=B(),F(C.$$.fragment),I=B(),M=R("details"),L=R("summary"),L.innerHTML='

        Gateway-wide categories

        ',N=B(),z=R("div"),W=R("div"),W.innerHTML=`

        Blocked for every device on every policy, like the global blocklist. A policy's always-allowed domains can + still exempt a site.

        `,D=B(),F(G.$$.fragment),$=B(),F(j.$$.fragment),P(r,"class","heading-actions svelte-5qb12c"),P(n,"class","section-heading svelte-5qb12c"),P(e,"class","section svelte-5qb12c"),P(_,"class","svelte-5qb12c"),P(S,"class","section-intro svelte-5qb12c"),P(g,"class","section fold svelte-5qb12c"),P(L,"class","svelte-5qb12c"),P(z,"class","section-heading svelte-5qb12c"),P(M,"class","section fold svelte-5qb12c")},m(x,me){y(x,e,me),T(e,n),T(n,i),T(n,l),T(n,r),le&&le.m(r,null),T(r,s),H(o,r,null),T(e,a),oe&&oe.m(e,null),T(e,u),X&&X.m(e,null),T(e,f);for(let ee=0;ee{le=null}),ce());const ee={};me[0]&512&&(ee.disabled=x[9]),me[3]&256&&(ee.$$scope={dirty:me,ctx:x}),o.$set(ee),!x[24]||x[22]?oe?(oe.p(x,me),me[0]&20971520&&b(oe,1)):(oe=gy(x),oe.c(),b(oe,1),oe.m(e,u)):oe&&(fe(),k(oe,1,1,()=>{oe=null}),ce()),x[13]==="new"?X?(X.p(x,me),me[0]&8192&&b(X,1)):(X=wy(x),X.c(),b(X,1),X.m(e,f)):X&&(fe(),k(X,1,1,()=>{X=null}),ce()),me[0]&1954603753|me[1]&47&&(de=ct(x[0]),fe(),c=Wn(c,me,re,1,x,de,d,e,Qn,Hy,null,iy),ce());const ke={};me[0]&37683200|me[3]&256&&(ke.$$scope={dirty:me,ctx:x}),C.$set(ke);const pe={};me[0]&1024&&(pe.disabled=x[10]),me[3]&256&&(pe.$$scope={dirty:me,ctx:x}),G.$set(pe);const Fe={};me[0]&8&&(Fe.categories=x[3]),me[0]&16&&(Fe.selection=x[4]),me[0]&1024&&(Fe.disabled=x[10]),j.$set(Fe)},i(x){if(!Q){b(le),b(o.$$.fragment,x),b(oe),b(X);for(let me=0;meg[96].id;for(let g=0;g{c=null}),ce()),_[0]&1073742338|_[1]&192&&(d=ct(g[1]),fe(),a=Wn(a,_,h,1,g,d,u,o,Qn,ky,null,fy),ce())},i(g){if(!f){b(c);for(let _=0;_k(l[s],1,1,()=>{l[s]=null});return{c(){e=R("div");for(let s=0;s{_=null}),ce()),(z=t[96].limitations)!=null&&z.length?v?v.p(t,M):(v=vy(t),v.c(),v.m(e,c)):v&&(v.d(1),v=null);const L={};M[0]&2&&(L.kind=t[38](t[96])?"ghost":"primary"),M[0]&514&&(L.disabled=t[9]||!t[96].available||t[38](t[96])),M[0]&2|M[3]&256&&(L.$$scope={dirty:M,ctx:t}),d.$set(L)},i(I){g||(b(_),b(d.$$.fragment,I),g=!0)},o(I){k(_),k(d.$$.fragment,I),g=!1},d(I){I&&(w(e),w(h)),_&&_.d(),v&&v.d(),U(d)}}}function ky(t,e){let n,i,l;return i=new Bu({props:{$$slots:{default:[fge]},$$scope:{ctx:e}}}),{key:t,first:null,c(){n=qe(),F(i.$$.fragment),this.first=n},m(r,s){y(r,n,s),H(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&514|s[3]&256&&(o.$$scope={dirty:s,ctx:e}),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(i,r)}}}function wy(t){let e,n,i;return n=new Bu({props:{$$slots:{default:[cge]},$$scope:{ctx:t}}}),{c(){e=R("div"),F(n.$$.fragment),P(e,"class","group-slot svelte-5qb12c")},m(l,r){y(l,e,r),H(n,e,null),i=!0},p(l,r){const s={};r[0]&17128|r[3]&256&&(s.$$scope={dirty:r,ctx:l}),n.$set(s)},i(l){i||(b(n.$$.fragment,l),i=!0)},o(l){k(n.$$.fragment,l),i=!1},d(l){l&&w(e),U(n)}}}function cge(t){let e,n,i,l;return i=new PM({props:{draft:t[14],categories:t[3],users:t[6],schedulePresets:t[5],timezone:t[7],saving:t[9],onSave:t[34],onCancel:t[29]}}),{c(){e=R("h4"),e.textContent="New policy",n=B(),F(i.$$.fragment),P(e,"class","svelte-5qb12c")},m(r,s){y(r,e,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[0]&16384&&(o.draft=r[14]),s[0]&8&&(o.categories=r[3]),s[0]&64&&(o.users=r[6]),s[0]&32&&(o.schedulePresets=r[5]),s[0]&128&&(o.timezone=r[7]),s[0]&512&&(o.saving=r[9]),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&(w(e),w(n)),U(i,r)}}}function dge(t){let e,n,i,l,r=t[77].name+"",s,o,a,u,f=(t[26][t[77].id]||[]).length+"",c,d,h=(t[26][t[77].id]||[]).length===1?"":"s",g,_=t[77].users.length?" · "+t[77].users.length+" proxy user"+(t[77].users.length===1?"":"s"):"",v,S,A,C=R6(t[77],t[30])+"",I,M,L,N,z=t[23][t[77].id]?"Hide details":"Details and devices",W,D,G,$=t[77].id!==ol&&t[32](t[77].id).length,j,Q,le,oe,X,de,re,x=t[77].id===ol&&yy(t);function me(ge,ve){if(ge[77].id===ol)return _ge;if(!(ge[26][ge[77].id]||[]).length&&!ge[77].users.length)return gge}let ee=me(t),ke=ee&&ee(t);function pe(){return t[46](t[77])}let Fe=t[23][t[77].id]&&Ty(t),Ve=$&&Ny(t);function Ee(){return t[50](t[77])}le=new Rt({props:{size:"small",kind:"ghost",disabled:t[9],$$slots:{default:[Mge]},$$scope:{ctx:t}}}),le.$on("click",Ee);let We=t[77].id!==ol&&zy(t);return{c(){e=R("div"),n=R("div"),i=R("div"),l=R("h4"),s=q(r),o=B(),x&&x.c(),a=B(),u=R("span"),c=q(f),d=q(" device"),g=q(h),v=q(_),S=B(),A=R("p"),I=q(C),M=B(),ke&&ke.c(),L=B(),N=R("button"),W=q(z),D=B(),Fe&&Fe.c(),G=B(),Ve&&Ve.c(),j=B(),Q=R("div"),F(le.$$.fragment),oe=B(),We&&We.c(),P(l,"class","svelte-5qb12c"),P(u,"class","device-count svelte-5qb12c"),P(i,"class","group-title svelte-5qb12c"),P(A,"class","summary-line svelte-5qb12c"),P(N,"type","button"),P(N,"class","link-button svelte-5qb12c"),P(n,"class","group-summary svelte-5qb12c"),P(Q,"class","group-actions svelte-5qb12c"),P(e,"class","group-row svelte-5qb12c")},m(ge,ve){y(ge,e,ve),T(e,n),T(n,i),T(i,l),T(l,s),T(i,o),x&&x.m(i,null),T(i,a),T(i,u),T(u,c),T(u,d),T(u,g),T(u,v),T(n,S),T(n,A),T(A,I),T(n,M),ke&&ke.m(n,null),T(n,L),T(n,N),T(N,W),T(n,D),Fe&&Fe.m(n,null),T(n,G),Ve&&Ve.m(n,null),T(e,j),T(e,Q),H(le,Q,null),T(Q,oe),We&&We.m(Q,null),X=!0,de||(re=J(N,"click",pe),de=!0)},p(ge,ve){t=ge,(!X||ve[0]&1)&&r!==(r=t[77].name+"")&&Z(s,r),t[77].id===ol?x?ve[0]&1&&b(x,1):(x=yy(t),x.c(),b(x,1),x.m(i,a)):x&&(fe(),k(x,1,1,()=>{x=null}),ce()),(!X||ve[0]&67108865)&&f!==(f=(t[26][t[77].id]||[]).length+"")&&Z(c,f),(!X||ve[0]&67108865)&&h!==(h=(t[26][t[77].id]||[]).length===1?"":"s")&&Z(g,h),(!X||ve[0]&1)&&_!==(_=t[77].users.length?" · "+t[77].users.length+" proxy user"+(t[77].users.length===1?"":"s"):"")&&Z(v,_),(!X||ve[0]&1)&&C!==(C=R6(t[77],t[30])+"")&&Z(I,C),ee!==(ee=me(t))&&(ke&&ke.d(1),ke=ee&&ee(t),ke&&(ke.c(),ke.m(n,L))),(!X||ve[0]&8388609)&&z!==(z=t[23][t[77].id]?"Hide details":"Details and devices")&&Z(W,z),t[23][t[77].id]?Fe?(Fe.p(t,ve),ve[0]&8388609&&b(Fe,1)):(Fe=Ty(t),Fe.c(),b(Fe,1),Fe.m(n,G)):Fe&&(fe(),k(Fe,1,1,()=>{Fe=null}),ce()),ve[0]&1&&($=t[77].id!==ol&&t[32](t[77].id).length),$?Ve?(Ve.p(t,ve),ve[0]&1&&b(Ve,1)):(Ve=Ny(t),Ve.c(),b(Ve,1),Ve.m(n,null)):Ve&&(fe(),k(Ve,1,1,()=>{Ve=null}),ce());const be={};ve[0]&512&&(be.disabled=t[9]),ve[3]&256&&(be.$$scope={dirty:ve,ctx:t}),le.$set(be),t[77].id!==ol?We?(We.p(t,ve),ve[0]&1&&b(We,1)):(We=zy(t),We.c(),b(We,1),We.m(Q,null)):We&&(fe(),k(We,1,1,()=>{We=null}),ce())},i(ge){X||(b(x),b(Fe),b(Ve),b(le.$$.fragment,ge),b(We),X=!0)},o(ge){k(x),k(Fe),k(Ve),k(le.$$.fragment,ge),k(We),X=!1},d(ge){ge&&w(e),x&&x.d(),ke&&ke.d(),Fe&&Fe.d(),Ve&&Ve.d(),U(le),We&&We.d(),de=!1,re()}}}function hge(t){let e,n,i=t[77].name+"",l,r,s,o;return s=new PM({props:{draft:t[14],categories:t[3],users:t[6],schedulePresets:t[5],timezone:t[7],saving:t[9],onSave:t[34],onCancel:t[29]}}),{c(){e=R("h4"),n=q("Edit "),l=q(i),r=B(),F(s.$$.fragment),P(e,"class","svelte-5qb12c")},m(a,u){y(a,e,u),T(e,n),T(e,l),y(a,r,u),H(s,a,u),o=!0},p(a,u){(!o||u[0]&1)&&i!==(i=a[77].name+"")&&Z(l,i);const f={};u[0]&16384&&(f.draft=a[14]),u[0]&8&&(f.categories=a[3]),u[0]&64&&(f.users=a[6]),u[0]&32&&(f.schedulePresets=a[5]),u[0]&128&&(f.timezone=a[7]),u[0]&512&&(f.saving=a[9]),s.$set(f)},i(a){o||(b(s.$$.fragment,a),o=!0)},o(a){k(s.$$.fragment,a),o=!1},d(a){a&&(w(e),w(r)),U(s,a)}}}function yy(t){let e,n;return e=new Vt({props:{size:"sm",type:"blue",$$slots:{default:[mge]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function mge(t){let e;return{c(){e=q("default")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function gge(t){let e;return{c(){e=R("p"),e.textContent="No devices yet, so this policy changes nothing until you add one.",P(e,"class","muted svelte-5qb12c")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function _ge(t){let e;return{c(){e=R("p"),e.textContent="Every device uses exactly one policy. Devices you haven't assigned use this one.",P(e,"class","muted svelte-5qb12c")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Ty(t){let e,n,i,l,r,s,o,a=(t[26][t[77].id]||[]).length+"",u,f,c,d,h,g=t[77].description&&Sy(t),_=(t[77].blocked_categories.length||t[77].blocked_domains.length)&&Ey(t),v=t[77].allowed_domains.length&&Ay(t),S=t[77].rules.length&&Ly(t),A=(t[26][t[77].id]||[]).length&&Ry(t),C=t[77].users.length&&Py(t);return{c(){g&&g.c(),e=B(),_&&_.c(),n=B(),v&&v.c(),i=B(),S&&S.c(),l=B(),r=R("div"),s=R("h5"),o=q("Devices on this policy ("),u=q(a),f=q(")"),c=B(),A&&A.c(),d=B(),C&&C.c(),P(s,"class","svelte-5qb12c"),P(r,"class","group-assignment svelte-5qb12c")},m(I,M){g&&g.m(I,M),y(I,e,M),_&&_.m(I,M),y(I,n,M),v&&v.m(I,M),y(I,i,M),S&&S.m(I,M),y(I,l,M),y(I,r,M),T(r,s),T(s,o),T(s,u),T(s,f),T(r,c),A&&A.m(r,null),T(r,d),C&&C.m(r,null),h=!0},p(I,M){I[77].description?g?g.p(I,M):(g=Sy(I),g.c(),g.m(e.parentNode,e)):g&&(g.d(1),g=null),I[77].blocked_categories.length||I[77].blocked_domains.length?_?(_.p(I,M),M[0]&1&&b(_,1)):(_=Ey(I),_.c(),b(_,1),_.m(n.parentNode,n)):_&&(fe(),k(_,1,1,()=>{_=null}),ce()),I[77].allowed_domains.length?v?(v.p(I,M),M[0]&1&&b(v,1)):(v=Ay(I),v.c(),b(v,1),v.m(i.parentNode,i)):v&&(fe(),k(v,1,1,()=>{v=null}),ce()),I[77].rules.length?S?S.p(I,M):(S=Ly(I),S.c(),S.m(l.parentNode,l)):S&&(S.d(1),S=null),(!h||M[0]&67108865)&&a!==(a=(I[26][I[77].id]||[]).length+"")&&Z(u,a),(I[26][I[77].id]||[]).length?A?(A.p(I,M),M[0]&67108865&&b(A,1)):(A=Ry(I),A.c(),b(A,1),A.m(r,d)):A&&(fe(),k(A,1,1,()=>{A=null}),ce()),I[77].users.length?C?C.p(I,M):(C=Py(I),C.c(),C.m(r,null)):C&&(C.d(1),C=null)},i(I){h||(b(_),b(v),b(A),h=!0)},o(I){k(_),k(v),k(A),h=!1},d(I){I&&(w(e),w(n),w(i),w(l),w(r)),g&&g.d(I),_&&_.d(I),v&&v.d(I),S&&S.d(I),A&&A.d(),C&&C.d()}}}function Sy(t){let e,n=t[77].description+"",i;return{c(){e=R("p"),i=q(n),P(e,"class","svelte-5qb12c")},m(l,r){y(l,e,r),T(e,i)},p(l,r){r[0]&1&&n!==(n=l[77].description+"")&&Z(i,n)},d(l){l&&w(e)}}}function Ey(t){let e,n,i,l,r,s=ct(t[77].blocked_categories),o=[];for(let d=0;dk(o[d],1,1,()=>{o[d]=null});let u=ct(t[77].blocked_domains),f=[];for(let d=0;dk(f[d],1,1,()=>{f[d]=null});return{c(){e=R("div"),n=R("span"),n.textContent="Blocks",i=B();for(let d=0;dk(s[a],1,1,()=>{s[a]=null});return{c(){e=R("div"),n=R("span"),n.textContent="Always allows",i=B();for(let a=0;as[85].id;for(let s=0;so[82];for(let o=0;o{a[d]=null}),ce(),l=a[i],l?l.p(e,c):(l=a[i]=o[i](e),l.c()),b(l,1),l.m(r.parentNode,r))},i(f){s||(b(l),s=!0)},o(f){k(l),s=!1},d(f){f&&(w(n),w(r)),a[i].d(f)}}}function Py(t){let e,n,i=t[77].users.join(", ")+"",l;return{c(){e=R("p"),n=q("Proxy users: "),l=q(i),P(e,"class","muted svelte-5qb12c")},m(r,s){y(r,e,s),T(e,n),T(e,l)},p(r,s){s[0]&1&&i!==(i=r[77].users.join(", ")+"")&&Z(l,i)},d(r){r&&w(e)}}}function Ny(t){let e,n,i,l,r,s;function o(f){t[48](f,t[77])}let a={size:"sm",hideLabel:!0,labelText:"Add a device",$$slots:{default:[Sge]},$$scope:{ctx:t}};t[15][t[77].id]!==void 0&&(a.selected=t[15][t[77].id]),n=new wr({props:a}),ft.push(()=>Yt(n,"selected",o));function u(){return t[49](t[77])}return r=new Rt({props:{size:"small",kind:"tertiary",disabled:t[9]||!t[15][t[77].id],$$slots:{default:[Ege]},$$scope:{ctx:t}}}),r.$on("click",u),{c(){e=R("div"),F(n.$$.fragment),l=B(),F(r.$$.fragment),P(e,"class","assign-row svelte-5qb12c")},m(f,c){y(f,e,c),H(n,e,null),T(e,l),H(r,e,null),s=!0},p(f,c){t=f;const d={};c[0]&1|c[3]&256&&(d.$$scope={dirty:c,ctx:t}),!i&&c[0]&32769&&(i=!0,d.selected=t[15][t[77].id],jt(()=>i=!1)),n.$set(d);const h={};c[0]&33281&&(h.disabled=t[9]||!t[15][t[77].id]),c[3]&256&&(h.$$scope={dirty:c,ctx:t}),r.$set(h)},i(f){s||(b(n.$$.fragment,f),b(r.$$.fragment,f),s=!0)},o(f){k(n.$$.fragment,f),k(r.$$.fragment,f),s=!1},d(f){f&&w(e),U(n),U(r)}}}function By(t,e){let n,i,l;return i=new Ln({props:{value:e[74].id,text:Ks(e[74])}}),{key:t,first:null,c(){n=qe(),F(i.$$.fragment),this.first=n},m(r,s){y(r,n,s),H(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&1&&(o.value=e[74].id),s[0]&1&&(o.text=Ks(e[74])),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(i,r)}}}function Sge(t){let e,n,i=[],l=new Map,r,s;e=new Ln({props:{value:"",text:"Add a device..."}});let o=ct(t[32](t[77].id));const a=u=>u[74].id;for(let u=0;u{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function Hy(t,e){let n,i,l,r;return i=new Bu({props:{$$slots:{default:[Age]},$$scope:{ctx:e}}}),{key:t,first:null,c(){n=R("div"),F(i.$$.fragment),l=B(),P(n,"class","group-slot svelte-5qb12c"),this.first=n},m(s,o){y(s,n,o),H(i,n,null),T(n,l),r=!0},p(s,o){e=s;const a={};o[0]&75555561|o[3]&256&&(a.$$scope={dirty:o,ctx:e}),i.$set(a)},i(s){r||(b(i.$$.fragment,s),r=!0)},o(s){k(i.$$.fragment,s),r=!1},d(s){s&&w(n),U(i)}}}function Uy(t,e){let n,i,l;return i=new Ln({props:{value:e[74].id,text:Ks(e[74])}}),{key:t,first:null,c(){n=qe(),F(i.$$.fragment),this.first=n},m(r,s){y(r,n,s),H(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&33554432&&(o.value=e[74].id),s[0]&33554432&&(o.text=Ks(e[74])),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(i,r)}}}function Cge(t){let e,n,i=[],l=new Map,r,s;e=new Ln({props:{value:"",text:"An unknown device (default policy)"}});let o=ct(t[25]);const a=u=>u[74].id;for(let u=0;uYt(n,"selected",S));function C(D){t[53](D)}let I={size:"sm",labelText:"Domain or URL",placeholder:"youtube.com/shorts/abc"};t[17]!==void 0&&(I.value=t[17]),r=new Jn({props:I}),ft.push(()=>Yt(r,"value",C)),r.$on("keydown",t[54]);function M(D){t[55](D)}let L={size:"sm",labelText:"Path",$$slots:{default:[Lge]},$$scope:{ctx:t}};t[18]!==void 0&&(L.selected=t[18]),a=new wr({props:L}),ft.push(()=>Yt(a,"selected",M)),c=new Rt({props:{size:"small",disabled:t[19]||!t[17].trim(),$$slots:{default:[Ige]},$$scope:{ctx:t}}}),c.$on("click",t[39]);let N=t[19]&&Fy(),z=t[21]&&Gy(t),W=t[20]&&Vy(t);return{c(){e=R("div"),F(n.$$.fragment),l=B(),F(r.$$.fragment),o=B(),F(a.$$.fragment),f=B(),F(c.$$.fragment),d=B(),N&&N.c(),h=B(),z&&z.c(),g=B(),W&&W.c(),_=qe(),P(e,"class","test-row svelte-5qb12c")},m(D,G){y(D,e,G),H(n,e,null),T(e,l),H(r,e,null),T(e,o),H(a,e,null),T(e,f),H(c,e,null),y(D,d,G),N&&N.m(D,G),y(D,h,G),z&&z.m(D,G),y(D,g,G),W&&W.m(D,G),y(D,_,G),v=!0},p(D,G){const $={};G[0]&33554432|G[3]&256&&($.$$scope={dirty:G,ctx:D}),!i&&G[0]&65536&&(i=!0,$.selected=D[16],jt(()=>i=!1)),n.$set($);const j={};!s&&G[0]&131072&&(s=!0,j.value=D[17],jt(()=>s=!1)),r.$set(j);const Q={};G[3]&256&&(Q.$$scope={dirty:G,ctx:D}),!u&&G[0]&262144&&(u=!0,Q.selected=D[18],jt(()=>u=!1)),a.$set(Q);const le={};G[0]&655360&&(le.disabled=D[19]||!D[17].trim()),G[3]&256&&(le.$$scope={dirty:G,ctx:D}),c.$set(le),D[19]?N?G[0]&524288&&b(N,1):(N=Fy(),N.c(),b(N,1),N.m(h.parentNode,h)):N&&(fe(),k(N,1,1,()=>{N=null}),ce()),D[21]?z?z.p(D,G):(z=Gy(D),z.c(),z.m(g.parentNode,g)):z&&(z.d(1),z=null),D[20]?W?(W.p(D,G),G[0]&1048576&&b(W,1)):(W=Vy(D),W.c(),b(W,1),W.m(_.parentNode,_)):W&&(fe(),k(W,1,1,()=>{W=null}),ce())},i(D){v||(b(n.$$.fragment,D),b(r.$$.fragment,D),b(a.$$.fragment,D),b(c.$$.fragment,D),b(N),b(W),v=!0)},o(D){k(n.$$.fragment,D),k(r.$$.fragment,D),k(a.$$.fragment,D),k(c.$$.fragment,D),k(N),k(W),v=!1},d(D){D&&(w(e),w(d),w(h),w(g),w(_)),U(n),U(r),U(a),U(c),N&&N.d(D),z&&z.d(D),W&&W.d(D)}}}function Pge(t){let e;return{c(){e=q("Save categories")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Nge(t){let e,n,i,l,r,s,o=t[11]&&dy(t),a=t[12]&&hy(t);const u=[rge,lge],f=[];function c(d,h){return d[8]?0:1}return i=c(t),l=f[i]=u[i](t),{c(){o&&o.c(),e=B(),a&&a.c(),n=B(),l.c(),r=qe()},m(d,h){o&&o.m(d,h),y(d,e,h),a&&a.m(d,h),y(d,n,h),f[i].m(d,h),y(d,r,h),s=!0},p(d,h){d[11]?o?(o.p(d,h),h[0]&2048&&b(o,1)):(o=dy(d),o.c(),b(o,1),o.m(e.parentNode,e)):o&&(fe(),k(o,1,1,()=>{o=null}),ce()),d[12]?a?(a.p(d,h),h[0]&4096&&b(a,1)):(a=hy(d),a.c(),b(a,1),a.m(n.parentNode,n)):a&&(fe(),k(a,1,1,()=>{a=null}),ce());let g=i;i=c(d),i===g?f[i].p(d,h):(fe(),k(f[g],1,1,()=>{f[g]=null}),ce(),l=f[i],l?l.p(d,h):(l=f[i]=u[i](d),l.c()),b(l,1),l.m(r.parentNode,r))},i(d){s||(b(o),b(a),b(l),s=!0)},o(d){k(o),k(a),k(l),s=!1},d(d){d&&(w(e),w(n),w(r)),o&&o.d(d),a&&a.d(d),f[i].d(d)}}}function Bge(){return localStorage.getItem("jwt")||""}function js(t=!1){const e={Authorization:"Bearer "+Bge()};return t&&(e["Content-Type"]="application/json"),e}async function Ys(t){const e=await t.text();try{const n=JSON.parse(e);if(n&&n.error)return n.error}catch{}return e||"Request failed ("+t.status+")"}async function Hr(t){const e=await fetch(t,{headers:js()});if(!e.ok)throw new Error(await Ys(e));return e.json()}function Ks(t){const e=t.display_name||(t.hostnames||[])[0]||t.ipv4||t.id;return t.ipv4&&e!==t.ipv4?e+" ("+t.ipv4+")":e}function fd(t){const e=t.active;return e.action==="block"||e.url_blocked?{text:"Blocked",type:"red"}:e.action==="allow"?{text:"Allowed by policy",type:"green"}:{text:"Not blocked by policy",type:"gray"}}function zge(t,e,n){let i,l,r;const s=ni()+"/api/policy/templates",o=ni()+"/api/policy/groups",a=ni()+"/api/policy/categories",u=ni()+"/api/policy/assignments",f=ni()+"/api/policy/preview",c=ni()+"/api/devices",d=ni()+"/api/policy/schedule-presets",h=ni()+"/api/users",g=ni()+"/api/settings/timezone";let _=[],v=[],S=[],A=[],C=[],I=[],M=[],L=[],N=[],z="UTC",W=!0,D=!1,G=!1,$="",j="",Q="",le=Rm(),oe={},X="",de="",re="dns",x=!1,me=null,ee="";async function ke(){try{n(5,L=(await Hr(d)).presets||[])}catch{n(5,L=[])}try{n(6,N=((await Hr(h)).users||[]).map(Ye=>Ye.username).filter(Boolean))}catch{n(6,N=[])}try{const Ye=await Hr(g);Ye.Value&&n(7,z=Ye.Value)}catch{}}async function pe(){n(8,W=!0),n(11,$="");try{const[Ye,ze,Qe,He,Tt]=await Promise.all([Hr(s),Hr(o),Hr(a),Hr(u),Hr(c),ke()]);n(1,_=Ye.templates||[]),n(2,v=Ye.shared_limitations||[]),n(0,S=(ze.groups||[]).map(xf)),n(3,A=Qe.categories||[]),n(40,C=He.assignments||[]),n(41,I=Tt.devices||[]),n(4,M=A.filter(Bt=>Bt.enabled).map(Bt=>Bt.id))}catch(Ye){n(11,$=Ye.message)}finally{n(8,W=!1)}}async function Fe(){n(40,C=(await Hr(u)).assignments||[])}function Ve(){n(13,Q="new"),n(14,le=Rm())}function Ee(Ye){n(13,Q=Ye.id),n(14,le=xf(Ye))}function We(){n(13,Q=""),n(14,le=Rm())}function ge(Ye){const ze=A.find(Qe=>Qe.id===Ye);return ze?ze.name:Ye}function ve(Ye,ze){var Tt;const Qe={[ol]:[]},He=new Set;for(const Bt of Ye)(Qe[Tt=Bt.group_id]||(Qe[Tt]=[])).push(Bt.device_id),He.add(Bt.device_id);for(const Bt of ze)He.has(Bt.id)||Qe[ol].push(Bt.id);return Qe}function be(Ye){const ze=I.find(Qe=>Qe.id===Ye);return ze?Ks(ze):Ye}function ue(Ye){const ze=new Set(i[Ye]||[]);return l.filter(Qe=>!ze.has(Qe.id))}async function nt(Ye,ze){if(Ye){n(9,D=!0),n(11,$=""),n(12,j="");try{const Qe=await fetch(c+"/"+Ye+"/assignment",{method:"PUT",headers:js(!0),body:JSON.stringify({group_id:ze===ol?"":ze})});if(!Qe.ok)throw new Error(await Ys(Qe));await Fe(),n(12,j=be(Ye)+" now uses "+Oe(ze)+".")}catch(Qe){n(11,$=Qe.message)}finally{n(9,D=!1)}}}function Oe(Ye){var ze;return((ze=S.find(Qe=>Qe.id===Ye))==null?void 0:ze.name)||Ye}async function dt(){if(!le.name.trim()){n(11,$="A policy needs a name.");return}n(9,D=!0),n(11,$=""),n(12,j="");try{const Ye=Q==="new",ze=Ye?o:o+"/"+Q,Qe=await fetch(ze,{method:Ye?"POST":"PUT",headers:js(!0),body:JSON.stringify(O0e(le))});if(!Qe.ok)throw new Error(await Ys(Qe));const He=xf((await Qe.json()).group);Ye?n(0,S=[...S,He]):n(0,S=S.map(Tt=>Tt.id===He.id?He:Tt)),n(12,j="Policy saved. It applies to new DNS lookups within a minute."),We()}catch(Ye){n(11,$=Ye.message)}finally{n(9,D=!1)}}async function yt(){n(10,G=!0),n(11,$=""),n(12,j="");try{const Ye=await fetch(a,{method:"PUT",headers:js(!0),body:JSON.stringify({categories:M})});if(!Ye.ok)throw new Error(await Ys(Ye));const ze=await Ye.json();n(3,A=ze.categories||[]),n(4,M=A.filter(Qe=>Qe.enabled).map(Qe=>Qe.id)),n(12,j=ze.refresh_scheduled?"Categories saved. The gateway is downloading the feeds now, so refresh in a moment to see the new counts.":"Categories saved. A download was already running, so the counts update when it finishes.")}catch(Ye){n(11,$=Ye.message)}finally{n(10,G=!1)}}async function at(Ye){if(confirm('Delete the policy "'+Ye.name+'"? Its devices move to the default policy.')){n(9,D=!0),n(11,$="");try{const ze=await fetch(o+"/"+Ye.id,{method:"DELETE",headers:js()});if(!ze.ok)throw new Error(await Ys(ze));n(0,S=S.filter(Qe=>Qe.id!==Ye.id)),await Fe(),n(12,j="Policy deleted; its devices now use the default policy.")}catch(ze){n(11,$=ze.message)}finally{n(9,D=!1)}}}async function ut(Ye){n(9,D=!0),n(11,$=""),n(12,j="");try{const ze=await fetch(s+"/"+Ye.id+"/apply",{method:"POST",headers:js()});if(!ze.ok)throw new Error(await Ys(ze));const Qe=await ze.json();n(0,S=[...S,xf(Qe.group)]),n(12,j=Ye.name+' was added as a policy. Assign devices to it under "Devices on this policy".')}catch(ze){n(11,$=ze.message)}finally{n(9,D=!1)}}function At(Ye){return S.some(ze=>ze.id===Ye.group_id)}async function xe(){const Ye=de.trim();if(!Ye)return;n(19,x=!0),n(21,ee=""),n(20,me=null);const ze=I.find(Bt=>Bt.id===X),Qe=Ye.includes("/"),He=Qe&&!Ye.includes("://")?"https://"+Ye:Ye,Tt={client_ip:(ze==null?void 0:ze.ipv4)||"",protocol:re};Qe?Tt.url=He:Tt.domain=Ye;try{const Bt=await fetch(f,{method:"POST",headers:js(!0),body:JSON.stringify(Tt)});if(!Bt.ok)throw new Error(await Ys(Bt));n(20,me=await Bt.json())}catch(Bt){n(21,ee=Bt.message)}finally{n(19,x=!1)}}let mt=!1,we={};_n(pe);const gt=()=>n(11,$=""),It=()=>n(12,j=""),Ht=()=>n(22,mt=!mt),Wt=Ye=>ut(Ye),qt=Ye=>n(23,we[Ye.id]=!we[Ye.id],we),Xt=Ye=>nt(Ye,ol);function Ce(Ye,ze){t.$$.not_equal(oe[ze.id],Ye)&&(oe[ze.id]=Ye,n(15,oe))}const se=Ye=>{nt(oe[Ye.id],Ye.id),n(15,oe[Ye.id]="",oe)},Le=Ye=>Ee(Ye),_t=Ye=>at(Ye);function zt(Ye){X=Ye,n(16,X)}function Be(Ye){de=Ye,n(17,de)}const Ot=Ye=>Ye.key==="Enter"&&xe();function kt(Ye){re=Ye,n(18,re)}const Pt=Ye=>n(4,M=Ye.detail);return t.$$.update=()=>{t.$$.dirty[1]&1536&&n(26,i=ve(C,I)),t.$$.dirty[1]&1024&&n(25,l=[...I].sort((Ye,ze)=>Ks(Ye).localeCompare(Ks(ze)))),t.$$.dirty[0]&1&&n(24,r=S.filter(Ye=>Ye.id!==ol).length)},[S,_,v,A,M,L,N,z,W,D,G,$,j,Q,le,oe,X,de,re,x,me,ee,mt,we,r,l,i,Ve,Ee,We,ge,be,ue,nt,dt,yt,at,ut,At,xe,C,I,gt,It,Ht,Wt,qt,Xt,Ce,se,Le,_t,zt,Be,Ot,kt,Pt]}class Hge extends De{constructor(e){super(),Re(this,e,zge,Nge,Ie,{},null,[-1,-1,-1,-1])}}function Uge(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Fge(t){let e;return{c(){e=q("Policies")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Gge(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[Uge]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[Fge]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Vge(t){let e,n,i,l,r,s,o,a;return e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[Gge]},$$scope:{ctx:t}}}),o=new Hge({}),{c(){F(e.$$.fragment),n=B(),i=R("h2"),i.textContent="Policies",l=B(),r=R("p"),r.textContent="Each device follows one policy. Pick what to block, turn on safe search or bedtime, and add devices to it.",s=B(),F(o.$$.fragment),P(r,"class","lead svelte-z5klpj")},m(u,f){H(e,u,f),y(u,n,f),y(u,i,f),y(u,l,f),y(u,r,f),y(u,s,f),H(o,u,f),a=!0},p(u,[f]){const c={};f&1&&(c.$$scope={dirty:f,ctx:u}),e.$set(c)},i(u){a||(b(e.$$.fragment,u),b(o.$$.fragment,u),a=!0)},o(u){k(e.$$.fragment,u),k(o.$$.fragment,u),a=!1},d(u){u&&(w(n),w(i),w(l),w(r),w(s)),U(e,u),U(o,u)}}}class Wge extends De{constructor(e){super(),Re(this,e,null,Vge,Ie,{})}}function Xy(t,e,n){const i=t.slice();return i[53]=e[n],i}function Ky(t,e,n){const i=t.slice();return i[56]=e[n],i}function $y(t,e,n){const i=t.slice();return i[59]=e[n],i}function Jy(t,e,n){const i=t.slice();return i[62]=e[n],i}function Qy(t,e,n){const i=t.slice();return i[62]=e[n],i}function xy(t,e,n){const i=t.slice();return i[67]=e[n],i}function e5(t,e,n){const i=t.slice();return i[70]=e[n],i}function t5(t,e,n){const i=t.slice();return i[73]=e[n],i}function n5(t,e,n){const i=t.slice();return i[59]=e[n],i}function i5(t,e,n){const i=t.slice();return i[73]=e[n],i}function l5(t,e,n){const i=t.slice();return i[73]=e[n],i}function r5(t,e,n){const i=t.slice();return i[59]=e[n],i}function s5(t,e,n){const i=t.slice();return i[84]=e[n],i}function o5(t,e,n){const i=t.slice();return i[87]=e[n],i}function a5(t){let e,n;return{c(){e=R("div"),n=q(t[6]),P(e,"class","error-message svelte-12fp22s")},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&64&&Z(n,i[6])},d(i){i&&w(e)}}}function qge(t){let e,n,i,l,r,s,o,a,u;function f(v){t[36](v)}let c={labelText:"Display Name",placeholder:"e.g., Vivienne's iPad"};t[2]!==void 0&&(c.value=t[2]),e=new Jn({props:c}),ft.push(()=>Yt(e,"value",f));function d(v){t[37](v)}let h={labelText:"Owner",helperText:"Descriptive label only — it does not change filtering.",placeholder:"e.g., Vivienne, Dad",style:"margin-top: 0.5rem;"};t[3]!==void 0&&(h.value=t[3]),l=new Jn({props:h}),ft.push(()=>Yt(l,"value",d));function g(v){t[38](v)}let _={labelText:"Category",helperText:"Descriptive label only — it does not change filtering.",placeholder:"e.g., kids, adults, iot",style:"margin-top: 0.5rem;"};return t[4]!==void 0&&(_.value=t[4]),o=new Jn({props:_}),ft.push(()=>Yt(o,"value",g)),{c(){F(e.$$.fragment),i=B(),F(l.$$.fragment),s=B(),F(o.$$.fragment)},m(v,S){H(e,v,S),y(v,i,S),H(l,v,S),y(v,s,S),H(o,v,S),u=!0},p(v,S){const A={};!n&&S[0]&4&&(n=!0,A.value=v[2],jt(()=>n=!1)),e.$set(A);const C={};!r&&S[0]&8&&(r=!0,C.value=v[3],jt(()=>r=!1)),l.$set(C);const I={};!a&&S[0]&16&&(a=!0,I.value=v[4],jt(()=>a=!1)),o.$set(I)},i(v){u||(b(e.$$.fragment,v),b(l.$$.fragment,v),b(o.$$.fragment,v),u=!0)},o(v){k(e.$$.fragment,v),k(l.$$.fragment,v),k(o.$$.fragment,v),u=!1},d(v){v&&(w(i),w(s)),U(e,v),U(l,v),U(o,v)}}}function u5(t){let e,n;return{c(){e=R("div"),n=q(t[13]),P(e,"class","error-message svelte-12fp22s")},m(i,l){y(i,e,l),T(e,n)},p(i,l){l[0]&8192&&Z(n,i[13])},d(i){i&&w(e)}}}function f5(t){let e;return{c(){e=R("div"),e.textContent="Policy saved.",P(e,"class","success-message svelte-12fp22s")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function c5(t,e){let n,i,l;return i=new Ln({props:{value:e[87].id,text:e[87].name||e[87].id}}),{key:t,first:null,c(){n=qe(),F(i.$$.fragment),this.first=n},m(r,s){y(r,n,s),H(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&1024&&(o.value=e[87].id),s[0]&1024&&(o.text=e[87].name||e[87].id),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(i,r)}}}function jge(t){let e,n,i=[],l=new Map,r,s;e=new Ln({props:{value:"",text:"Default policy"}});let o=ct(t[10].filter(nT));const a=u=>u[87].id;for(let u=0;u{u=null}),ce());let S=n;n=d(_),n===S?c[n].p(_,v):(fe(),k(c[S],1,1,()=>{c[S]=null}),ce(),i=c[n],i?i.p(_,v):(i=c[n]=f[n](_),i.c()),b(i,1),i.m(l.parentNode,l)),((C=_[15])==null?void 0:C.state)==="connected"?h?(h.p(_,v),v[0]&32768&&b(h,1)):(h=y5(_),h.c(),b(h,1),h.m(r.parentNode,r)):h&&(fe(),k(h,1,1,()=>{h=null}),ce());const A={};v[0]&2621440&&(A.disabled=_[21]||_[19]),v[2]&268435456&&(A.$$scope={dirty:v,ctx:_}),o.$set(A)},i(_){a||(b(u),b(i),b(h),b(o.$$.fragment,_),a=!0)},o(_){k(u),k(i),k(h),k(o.$$.fragment,_),a=!1},d(_){_&&(w(e),w(l),w(r),w(s)),u&&u.d(_),c[n].d(_),h&&h.d(_),U(o)}}}function Qge(t){let e,n;return e=new oo({props:{description:"Loading Tailscale peers..."}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function p5(t){let e,n;return e=new xi({props:{lowContrast:!0,hideCloseButton:!0,kind:$5(t[15].state),title:J5(t[15].state),subtitle:t[15].message||t[15].backend_state}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&32768&&(r.kind=$5(i[15].state)),l[0]&32768&&(r.title=J5(i[15].state)),l[0]&32768&&(r.subtitle=i[15].message||i[15].backend_state),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function xge(t){let e;return{c(){e=R("p"),e.textContent="No Tailscale peers are linked to this device.",P(e,"class","section-note svelte-12fp22s")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function e_e(t){let e,n=[],i=new Map,l,r=ct(t[16]);const s=o=>o[73].node_id;for(let o=0;ok(s[a],1,1,()=>{s[a]=null});return{c(){e=R("div"),n=R("span"),n.textContent="Informational WoL MAC:",i=B();for(let a=0;a{$=null}),ce())},i(le){W||(b(u.$$.fragment,le),b(c.$$.fragment,le),b($),W=!0)},o(le){k(u.$$.fragment,le),k(c.$$.fragment,le),k($),W=!1},d(le){le&&w(n),U(u),U(c),G&&G.d(),$&&$.d()}}}function y5(t){let e,n,i,l,r,s,o,a,u,f,c;function d(S){t[41](S)}let h={labelText:"Tailscale peer",helperText:"Choose an unlinked peer, then confirm the link.",disabled:t[21]||t[19],$$slots:{default:[l_e]},$$scope:{ctx:t}};t[18]!==void 0&&(h.selected=t[18]),i=new wr({props:h}),ft.push(()=>Yt(i,"selected",d)),s=new Rt({props:{kind:"primary",size:"field",disabled:t[21]||!t[18],$$slots:{default:[r_e]},$$scope:{ctx:t}}}),s.$on("click",t[29]);const g=[o_e,s_e],_=[];function v(S,A){return S[17].length?0:S[20]?1:-1}return~(a=v(t))&&(u=_[a]=g[a](t)),{c(){e=R("div"),n=R("div"),F(i.$$.fragment),r=B(),F(s.$$.fragment),o=B(),u&&u.c(),f=qe(),P(n,"class","assignment-select svelte-12fp22s"),P(e,"class","tailscale-link-row svelte-12fp22s")},m(S,A){y(S,e,A),T(e,n),H(i,n,null),T(e,r),H(s,e,null),y(S,o,A),~a&&_[a].m(S,A),y(S,f,A),c=!0},p(S,A){const C={};A[0]&2621440&&(C.disabled=S[21]||S[19]),A[0]&131072|A[2]&268435456&&(C.$$scope={dirty:A,ctx:S}),!l&&A[0]&262144&&(l=!0,C.selected=S[18],jt(()=>l=!1)),i.$set(C);const I={};A[0]&2359296&&(I.disabled=S[21]||!S[18]),A[0]&2097152|A[2]&268435456&&(I.$$scope={dirty:A,ctx:S}),s.$set(I);let M=a;a=v(S),a===M?~a&&_[a].p(S,A):(u&&(fe(),k(_[M],1,1,()=>{_[M]=null}),ce()),~a?(u=_[a],u?u.p(S,A):(u=_[a]=g[a](S),u.c()),b(u,1),u.m(f.parentNode,f)):u=null)},i(S){c||(b(i.$$.fragment,S),b(s.$$.fragment,S),b(u),c=!0)},o(S){k(i.$$.fragment,S),k(s.$$.fragment,S),k(u),c=!1},d(S){S&&(w(e),w(o),w(f)),U(i),U(s),~a&&_[a].d(S)}}}function T5(t,e){let n,i,l;return i=new Ln({props:{value:e[73].node_id,text:`${so(e[73])}${e[73].online?" (online)":" (offline)"}`}}),{key:t,first:null,c(){n=qe(),F(i.$$.fragment),this.first=n},m(r,s){y(r,n,s),H(i,r,s),l=!0},p(r,s){e=r;const o={};s[0]&131072&&(o.value=e[73].node_id),s[0]&131072&&(o.text=`${so(e[73])}${e[73].online?" (online)":" (offline)"}`),i.$set(o)},i(r){l||(b(i.$$.fragment,r),l=!0)},o(r){k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(i,r)}}}function l_e(t){let e,n,i=[],l=new Map,r,s;e=new Ln({props:{value:"",text:"Choose a peer"}});let o=ct(t[17]);const a=u=>u[73].node_id;for(let u=0;uo[73].node_id;for(let o=0;ok(s[a],1,1,()=>{s[a]=null});return{c(){e=R("div"),n=R("span"),n.textContent="Informational WoL MAC:",i=B();for(let a=0;a{z=null}),ce())},i(G){I||(b(a.$$.fragment,G),b(z),I=!0)},o(G){k(a.$$.fragment,G),k(z),I=!1},d(G){G&&w(n),U(a),M&&M.d(),L&&L.d(),N&&N.d(),z&&z.d()}}}function f_e(t){let e;return{c(){e=q("Refresh Tailscale status")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function c_e(t){let e;return{c(){e=q("Property")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function d_e(t){let e;return{c(){e=q("Value")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function h_e(t){let e,n,i,l;return e=new Zt({props:{head:!0,$$slots:{default:[c_e]},$$scope:{ctx:t}}}),i=new Zt({props:{head:!0,$$slots:{default:[d_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function m_e(t){let e,n;return e=new Zn({props:{head:!0,$$slots:{default:[h_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[2]&268435456&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function g_e(t){let e;return{c(){e=q("Policy Identity")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function __e(t){let e;return{c(){e=q("—")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function p_e(t){let e,n,i=(t[7].identity.explanation||"")+"",l,r;return e=new Vt({props:{size:"sm",type:"blue",$$slots:{default:[b_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),l=q(i)},m(s,o){H(e,s,o),y(s,n,o),y(s,l,o),r=!0},p(s,o){const a={};o[0]&128|o[2]&268435456&&(a.$$scope={dirty:o,ctx:s}),e.$set(a),(!r||o[0]&128)&&i!==(i=(s[7].identity.explanation||"")+"")&&Z(l,i)},i(s){r||(b(e.$$.fragment,s),r=!0)},o(s){k(e.$$.fragment,s),r=!1},d(s){s&&(w(n),w(l)),U(e,s)}}}function b_e(t){let e=t[7].identity.source+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].identity.source+"")&&Z(n,e)},d(i){i&&w(n)}}}function v_e(t){let e,n,i,l;const r=[p_e,__e],s=[];function o(a,u){var f;return(f=a[7])!=null&&f.identity?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function k_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[g_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[v_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function L5(t){let e,n;return e=new Zn({props:{$$slots:{default:[T_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&128|l[2]&268435456&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function w_e(t){let e;return{c(){e=q("Resolved Device")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function y_e(t){let e=t[7].identity.device_id+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].identity.device_id+"")&&Z(n,e)},d(i){i&&w(n)}}}function T_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[w_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[y_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function S_e(t){let e;return{c(){e=q("DNS Name")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function E_e(t){var i;let e=(((i=t[0])==null?void 0:i.dns_name)||"—")+"",n;return{c(){n=q(e)},m(l,r){y(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=(((s=l[0])==null?void 0:s.dns_name)||"—")+"")&&Z(n,e)},d(l){l&&w(n)}}}function M_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[S_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[E_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function O_e(t){let e;return{c(){e=q("Hostnames")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function A_e(t){let e;return{c(){e=q("—")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function C_e(t){let e,n,i=ct(t[0].hostnames),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function R_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[O_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[I_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function D_e(t){let e;return{c(){e=q("mDNS Names")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function P_e(t){let e;return{c(){e=q("—")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function N_e(t){let e,n,i=ct(t[0].mdns_names),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function H_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[D_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[z_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function U_e(t){let e;return{c(){e=q("IPv4")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function D5(t){let e,n,i=ct(t[7].addresses),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{r=null}),ce()),a[62].stale_observation?s?u[0]&128&&b(s,1):(s=B5(a),s.c(),b(s,1),s.m(n.parentNode,n)):s&&(fe(),k(s,1,1,()=>{s=null}),ce()),a[62].dns_resolves_device?o&&(fe(),k(o,1,1,()=>{o=null}),ce()):o?u[0]&128&&b(o,1):(o=z5(a),o.c(),b(o,1),o.m(i.parentNode,i))},i(a){l||(b(r),b(s),b(o),l=!0)},o(a){k(r),k(s),k(o),l=!1},d(a){a&&(w(e),w(n),w(i)),r&&r.d(a),s&&s.d(a),o&&o.d(a)}}}function N5(t){let e,n;return e=new Vt({props:{size:"sm",type:"magenta",$$slots:{default:[F_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function F_e(t){let e;return{c(){e=q("shared address")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function B5(t){let e,n;return e=new Vt({props:{size:"sm",type:"warm-gray",$$slots:{default:[G_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function G_e(t){let e;return{c(){e=q("stale observation")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function z5(t){let e,n;return e=new Vt({props:{size:"sm",type:"red",$$slots:{default:[V_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function V_e(t){let e;return{c(){e=q("DNS does not resolve to this device")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function H5(t){var l;let e,n,i=t[62].ip===((l=t[0])==null?void 0:l.ipv4)&&P5(t);return{c(){i&&i.c(),e=qe()},m(r,s){i&&i.m(r,s),y(r,e,s),n=!0},p(r,s){var o;r[62].ip===((o=r[0])==null?void 0:o.ipv4)?i?(i.p(r,s),s[0]&129&&b(i,1)):(i=P5(r),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(r){n||(b(i),n=!0)},o(r){k(i),n=!1},d(r){r&&w(e),i&&i.d(r)}}}function W_e(t){var o,a;let e=(((o=t[0])==null?void 0:o.ipv4)||"—")+"",n,i,l,r,s=((a=t[7])==null?void 0:a.addresses)&&D5(t);return{c(){n=q(e),i=B(),s&&s.c(),l=qe()},m(u,f){y(u,n,f),y(u,i,f),s&&s.m(u,f),y(u,l,f),r=!0},p(u,f){var c,d;(!r||f[0]&1)&&e!==(e=(((c=u[0])==null?void 0:c.ipv4)||"—")+"")&&Z(n,e),(d=u[7])!=null&&d.addresses?s?(s.p(u,f),f[0]&128&&b(s,1)):(s=D5(u),s.c(),b(s,1),s.m(l.parentNode,l)):s&&(fe(),k(s,1,1,()=>{s=null}),ce())},i(u){r||(b(s),r=!0)},o(u){k(s),r=!1},d(u){u&&(w(n),w(i),w(l)),s&&s.d(u)}}}function q_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[U_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[W_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&129|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function j_e(t){let e;return{c(){e=q("IPv6")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function U5(t){let e,n,i=ct(t[7].addresses),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{r=null}),ce()),a[62].stale_observation?s?u[0]&128&&b(s,1):(s=V5(a),s.c(),b(s,1),s.m(n.parentNode,n)):s&&(fe(),k(s,1,1,()=>{s=null}),ce()),a[62].dns_resolves_device?o&&(fe(),k(o,1,1,()=>{o=null}),ce()):o?u[0]&128&&b(o,1):(o=W5(a),o.c(),b(o,1),o.m(i.parentNode,i))},i(a){l||(b(r),b(s),b(o),l=!0)},o(a){k(r),k(s),k(o),l=!1},d(a){a&&(w(e),w(n),w(i)),r&&r.d(a),s&&s.d(a),o&&o.d(a)}}}function G5(t){let e,n;return e=new Vt({props:{size:"sm",type:"magenta",$$slots:{default:[Y_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Y_e(t){let e;return{c(){e=q("shared address")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function V5(t){let e,n;return e=new Vt({props:{size:"sm",type:"warm-gray",$$slots:{default:[Z_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Z_e(t){let e;return{c(){e=q("stale observation")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function W5(t){let e,n;return e=new Vt({props:{size:"sm",type:"red",$$slots:{default:[X_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function X_e(t){let e;return{c(){e=q("DNS does not resolve to this device")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function q5(t){var l,r;let e,n,i=t[62].ip===((l=t[0])==null?void 0:l.ipv6)&&((r=t[0])==null?void 0:r.ipv6)&&F5(t);return{c(){i&&i.c(),e=qe()},m(s,o){i&&i.m(s,o),y(s,e,o),n=!0},p(s,o){var a,u;s[62].ip===((a=s[0])==null?void 0:a.ipv6)&&((u=s[0])!=null&&u.ipv6)?i?(i.p(s,o),o[0]&129&&b(i,1)):(i=F5(s),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(s){n||(b(i),n=!0)},o(s){k(i),n=!1},d(s){s&&w(e),i&&i.d(s)}}}function K_e(t){var a,u;let e,n=(((a=t[0])==null?void 0:a.ipv6)||"—")+"",i,l,r,s,o=((u=t[7])==null?void 0:u.addresses)&&U5(t);return{c(){e=R("span"),i=q(n),l=B(),o&&o.c(),r=qe(),P(e,"class","ipv6-value svelte-12fp22s")},m(f,c){y(f,e,c),T(e,i),y(f,l,c),o&&o.m(f,c),y(f,r,c),s=!0},p(f,c){var d,h;(!s||c[0]&1)&&n!==(n=(((d=f[0])==null?void 0:d.ipv6)||"—")+"")&&Z(i,n),(h=f[7])!=null&&h.addresses?o?(o.p(f,c),c[0]&128&&b(o,1)):(o=U5(f),o.c(),b(o,1),o.m(r.parentNode,r)):o&&(fe(),k(o,1,1,()=>{o=null}),ce())},i(f){s||(b(o),s=!0)},o(f){k(o),s=!1},d(f){f&&(w(e),w(l),w(r)),o&&o.d(f)}}}function $_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[j_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[K_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&129|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function J_e(t){let e;return{c(){e=q("MAC Address(es)")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Q_e(t){let e;return{c(){e=q("—")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function x_e(t){let e,n,i=ct(t[0].macs),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function npe(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[J_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[tpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function ipe(t){var S,A;let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_;e=new Zn({props:{$$slots:{default:[k_e]},$$scope:{ctx:t}}});let v=((A=(S=t[7])==null?void 0:S.identity)==null?void 0:A.device_id)&&L5(t);return l=new Zn({props:{$$slots:{default:[M_e]},$$scope:{ctx:t}}}),s=new Zn({props:{$$slots:{default:[R_e]},$$scope:{ctx:t}}}),a=new Zn({props:{$$slots:{default:[H_e]},$$scope:{ctx:t}}}),f=new Zn({props:{$$slots:{default:[q_e]},$$scope:{ctx:t}}}),d=new Zn({props:{$$slots:{default:[$_e]},$$scope:{ctx:t}}}),g=new Zn({props:{$$slots:{default:[npe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),v&&v.c(),i=B(),F(l.$$.fragment),r=B(),F(s.$$.fragment),o=B(),F(a.$$.fragment),u=B(),F(f.$$.fragment),c=B(),F(d.$$.fragment),h=B(),F(g.$$.fragment)},m(C,I){H(e,C,I),y(C,n,I),v&&v.m(C,I),y(C,i,I),H(l,C,I),y(C,r,I),H(s,C,I),y(C,o,I),H(a,C,I),y(C,u,I),H(f,C,I),y(C,c,I),H(d,C,I),y(C,h,I),H(g,C,I),_=!0},p(C,I){var $,j;const M={};I[0]&128|I[2]&268435456&&(M.$$scope={dirty:I,ctx:C}),e.$set(M),(j=($=C[7])==null?void 0:$.identity)!=null&&j.device_id?v?(v.p(C,I),I[0]&128&&b(v,1)):(v=L5(C),v.c(),b(v,1),v.m(i.parentNode,i)):v&&(fe(),k(v,1,1,()=>{v=null}),ce());const L={};I[0]&1|I[2]&268435456&&(L.$$scope={dirty:I,ctx:C}),l.$set(L);const N={};I[0]&1|I[2]&268435456&&(N.$$scope={dirty:I,ctx:C}),s.$set(N);const z={};I[0]&1|I[2]&268435456&&(z.$$scope={dirty:I,ctx:C}),a.$set(z);const W={};I[0]&129|I[2]&268435456&&(W.$$scope={dirty:I,ctx:C}),f.$set(W);const D={};I[0]&129|I[2]&268435456&&(D.$$scope={dirty:I,ctx:C}),d.$set(D);const G={};I[0]&1|I[2]&268435456&&(G.$$scope={dirty:I,ctx:C}),g.$set(G)},i(C){_||(b(e.$$.fragment,C),b(v),b(l.$$.fragment,C),b(s.$$.fragment,C),b(a.$$.fragment,C),b(f.$$.fragment,C),b(d.$$.fragment,C),b(g.$$.fragment,C),_=!0)},o(C){k(e.$$.fragment,C),k(v),k(l.$$.fragment,C),k(s.$$.fragment,C),k(a.$$.fragment,C),k(f.$$.fragment,C),k(d.$$.fragment,C),k(g.$$.fragment,C),_=!1},d(C){C&&(w(n),w(i),w(r),w(o),w(u),w(c),w(h)),U(e,C),v&&v.d(C),U(l,C),U(s,C),U(a,C),U(f,C),U(d,C),U(g,C)}}}function lpe(t){let e,n,i,l;return e=new UT({props:{$$slots:{default:[m_e]},$$scope:{ctx:t}}}),i=new Nu({props:{$$slots:{default:[ipe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&129|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function rpe(t){let e;return{c(){e=q("Property")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function spe(t){let e;return{c(){e=q("Value")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function ope(t){let e,n,i,l;return e=new Zt({props:{head:!0,$$slots:{default:[rpe]},$$scope:{ctx:t}}}),i=new Zt({props:{head:!0,$$slots:{default:[spe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function ape(t){let e,n;return e=new Zn({props:{head:!0,$$slots:{default:[ope]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[2]&268435456&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function upe(t){let e;return{c(){e=q("Status")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function fpe(t){var s;let e,n,i,l=(s=t[0])!=null&&s.online?"Online":"Offline",r;return{c(){var o;e=R("span"),i=B(),r=q(l),P(e,"class",n="status-dot "+((o=t[0])!=null&&o.online?"online":"offline")+" svelte-12fp22s")},m(o,a){y(o,e,a),y(o,i,a),y(o,r,a)},p(o,a){var u,f;a[0]&1&&n!==(n="status-dot "+((u=o[0])!=null&&u.online?"online":"offline")+" svelte-12fp22s")&&P(e,"class",n),a[0]&1&&l!==(l=(f=o[0])!=null&&f.online?"Online":"Offline")&&Z(r,l)},d(o){o&&(w(e),w(i),w(r))}}}function cpe(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[upe]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[fpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function dpe(t){let e;return{c(){e=q("Primary Source")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function hpe(t){var i;let e=(((i=t[0])==null?void 0:i.source)||"—")+"",n;return{c(){n=q(e)},m(l,r){y(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=(((s=l[0])==null?void 0:s.source)||"—")+"")&&Z(n,e)},d(l){l&&w(n)}}}function mpe(t){var i,l,r,s;let e,n;return e=new Vt({props:{size:"sm",type:((i=t[0])==null?void 0:i.source)==="ddns"?"green":((l=t[0])==null?void 0:l.source)==="mdns"?"blue":((r=t[0])==null?void 0:r.source)==="passive"?"warm-gray":((s=t[0])==null?void 0:s.source)==="manual"?"purple":"gray",$$slots:{default:[hpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(o,a){H(e,o,a),n=!0},p(o,a){var f,c,d,h;const u={};a[0]&1&&(u.type=((f=o[0])==null?void 0:f.source)==="ddns"?"green":((c=o[0])==null?void 0:c.source)==="mdns"?"blue":((d=o[0])==null?void 0:d.source)==="passive"?"warm-gray":((h=o[0])==null?void 0:h.source)==="manual"?"purple":"gray"),a[0]&1|a[2]&268435456&&(u.$$scope={dirty:a,ctx:o}),e.$set(u)},i(o){n||(b(e.$$.fragment,o),n=!0)},o(o){k(e.$$.fragment,o),n=!1},d(o){U(e,o)}}}function gpe(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[dpe]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[mpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function _pe(t){let e;return{c(){e=q("All Sources")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function ppe(t){let e;return{c(){e=q("—")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function bpe(t){let e,n,i=ct(t[0].sources),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function wpe(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[_pe]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[kpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function ype(t){let e;return{c(){e=q("First Seen")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Tpe(t){var i;let e=Ts((i=t[0])==null?void 0:i.first_seen)+"",n;return{c(){n=q(e)},m(l,r){y(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=Ts((s=l[0])==null?void 0:s.first_seen)+"")&&Z(n,e)},d(l){l&&w(n)}}}function Spe(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[ype]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[Tpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Epe(t){let e;return{c(){e=q("Last Seen")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Mpe(t){var i;let e=Ts((i=t[0])==null?void 0:i.last_seen)+"",n;return{c(){n=q(e)},m(l,r){y(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=Ts((s=l[0])==null?void 0:s.last_seen)+"")&&Z(n,e)},d(l){l&&w(n)}}}function Ope(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[Epe]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[Mpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Ape(t){let e;return{c(){e=q("Device ID")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Cpe(t){var l;let e,n=(((l=t[0])==null?void 0:l.id)||"—")+"",i;return{c(){e=R("code"),i=q(n),wt(e,"font-size","0.75rem")},m(r,s){y(r,e,s),T(e,i)},p(r,s){var o;s[0]&1&&n!==(n=(((o=r[0])==null?void 0:o.id)||"—")+"")&&Z(i,n)},d(r){r&&w(e)}}}function Lpe(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[Ape]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[Cpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Ipe(t){let e,n,i,l,r,s,o,a,u,f,c,d;return e=new Zn({props:{$$slots:{default:[cpe]},$$scope:{ctx:t}}}),i=new Zn({props:{$$slots:{default:[gpe]},$$scope:{ctx:t}}}),r=new Zn({props:{$$slots:{default:[wpe]},$$scope:{ctx:t}}}),o=new Zn({props:{$$slots:{default:[Spe]},$$scope:{ctx:t}}}),u=new Zn({props:{$$slots:{default:[Ope]},$$scope:{ctx:t}}}),c=new Zn({props:{$$slots:{default:[Lpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment),s=B(),F(o.$$.fragment),a=B(),F(u.$$.fragment),f=B(),F(c.$$.fragment)},m(h,g){H(e,h,g),y(h,n,g),H(i,h,g),y(h,l,g),H(r,h,g),y(h,s,g),H(o,h,g),y(h,a,g),H(u,h,g),y(h,f,g),H(c,h,g),d=!0},p(h,g){const _={};g[0]&1|g[2]&268435456&&(_.$$scope={dirty:g,ctx:h}),e.$set(_);const v={};g[0]&1|g[2]&268435456&&(v.$$scope={dirty:g,ctx:h}),i.$set(v);const S={};g[0]&1|g[2]&268435456&&(S.$$scope={dirty:g,ctx:h}),r.$set(S);const A={};g[0]&1|g[2]&268435456&&(A.$$scope={dirty:g,ctx:h}),o.$set(A);const C={};g[0]&1|g[2]&268435456&&(C.$$scope={dirty:g,ctx:h}),u.$set(C);const I={};g[0]&1|g[2]&268435456&&(I.$$scope={dirty:g,ctx:h}),c.$set(I)},i(h){d||(b(e.$$.fragment,h),b(i.$$.fragment,h),b(r.$$.fragment,h),b(o.$$.fragment,h),b(u.$$.fragment,h),b(c.$$.fragment,h),d=!0)},o(h){k(e.$$.fragment,h),k(i.$$.fragment,h),k(r.$$.fragment,h),k(o.$$.fragment,h),k(u.$$.fragment,h),k(c.$$.fragment,h),d=!1},d(h){h&&(w(n),w(l),w(s),w(a),w(f)),U(e,h),U(i,h),U(r,h),U(o,h),U(u,h),U(c,h)}}}function Rpe(t){let e,n,i,l;return e=new UT({props:{$$slots:{default:[ape]},$$scope:{ctx:t}}}),i=new Nu({props:{$$slots:{default:[Ipe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Dpe(t){let e,n,i=ct(t[24]),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){e=R("ul");for(let s=0;sk(s[a],1,1,()=>{s[a]=null});return{c(){e=R("div"),n=R("span"),n.textContent="Informational WoL MAC:",i=B();for(let a=0;a{z=null}),ce())},i(G){I||(b(a.$$.fragment,G),b(z),I=!0)},o(G){k(a.$$.fragment,G),k(z),I=!1},d(G){G&&w(n),U(a),M&&M.d(),L&&L.d(),N&&N.d(),z&&z.d()}}}function f_e(t){let e;return{c(){e=q("Refresh Tailscale status")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function c_e(t){let e;return{c(){e=q("Property")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function d_e(t){let e;return{c(){e=q("Value")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function h_e(t){let e,n,i,l;return e=new Zt({props:{head:!0,$$slots:{default:[c_e]},$$scope:{ctx:t}}}),i=new Zt({props:{head:!0,$$slots:{default:[d_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function m_e(t){let e,n;return e=new Zn({props:{head:!0,$$slots:{default:[h_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[2]&268435456&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function g_e(t){let e;return{c(){e=q("Policy Identity")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function __e(t){let e;return{c(){e=q("—")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function p_e(t){let e,n,i=(t[7].identity.explanation||"")+"",l,r;return e=new Vt({props:{size:"sm",type:"blue",$$slots:{default:[b_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),l=q(i)},m(s,o){H(e,s,o),y(s,n,o),y(s,l,o),r=!0},p(s,o){const a={};o[0]&128|o[2]&268435456&&(a.$$scope={dirty:o,ctx:s}),e.$set(a),(!r||o[0]&128)&&i!==(i=(s[7].identity.explanation||"")+"")&&Z(l,i)},i(s){r||(b(e.$$.fragment,s),r=!0)},o(s){k(e.$$.fragment,s),r=!1},d(s){s&&(w(n),w(l)),U(e,s)}}}function b_e(t){let e=t[7].identity.source+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].identity.source+"")&&Z(n,e)},d(i){i&&w(n)}}}function v_e(t){let e,n,i,l;const r=[p_e,__e],s=[];function o(a,u){var f;return(f=a[7])!=null&&f.identity?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function k_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[g_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[v_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function L5(t){let e,n;return e=new Zn({props:{$$slots:{default:[T_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&128|l[2]&268435456&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function w_e(t){let e;return{c(){e=q("Resolved Device")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function y_e(t){let e=t[7].identity.device_id+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l[0]&128&&e!==(e=i[7].identity.device_id+"")&&Z(n,e)},d(i){i&&w(n)}}}function T_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[w_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[y_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&128|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function S_e(t){let e;return{c(){e=q("DNS Name")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function E_e(t){var i;let e=(((i=t[0])==null?void 0:i.dns_name)||"—")+"",n;return{c(){n=q(e)},m(l,r){y(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=(((s=l[0])==null?void 0:s.dns_name)||"—")+"")&&Z(n,e)},d(l){l&&w(n)}}}function M_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[S_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[E_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function O_e(t){let e;return{c(){e=q("Hostnames")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function A_e(t){let e;return{c(){e=q("—")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function C_e(t){let e,n,i=ct(t[0].hostnames),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function R_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[O_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[I_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function D_e(t){let e;return{c(){e=q("mDNS Names")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function P_e(t){let e;return{c(){e=q("—")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function N_e(t){let e,n,i=ct(t[0].mdns_names),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function H_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[D_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[z_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function U_e(t){let e;return{c(){e=q("IPv4")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function D5(t){let e,n,i=ct(t[7].addresses),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{r=null}),ce()),a[62].stale_observation?s?u[0]&128&&b(s,1):(s=B5(a),s.c(),b(s,1),s.m(n.parentNode,n)):s&&(fe(),k(s,1,1,()=>{s=null}),ce()),a[62].dns_resolves_device?o&&(fe(),k(o,1,1,()=>{o=null}),ce()):o?u[0]&128&&b(o,1):(o=z5(a),o.c(),b(o,1),o.m(i.parentNode,i))},i(a){l||(b(r),b(s),b(o),l=!0)},o(a){k(r),k(s),k(o),l=!1},d(a){a&&(w(e),w(n),w(i)),r&&r.d(a),s&&s.d(a),o&&o.d(a)}}}function N5(t){let e,n;return e=new Vt({props:{size:"sm",type:"magenta",$$slots:{default:[F_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function F_e(t){let e;return{c(){e=q("shared address")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function B5(t){let e,n;return e=new Vt({props:{size:"sm",type:"warm-gray",$$slots:{default:[G_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function G_e(t){let e;return{c(){e=q("stale observation")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function z5(t){let e,n;return e=new Vt({props:{size:"sm",type:"red",$$slots:{default:[V_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function V_e(t){let e;return{c(){e=q("DNS does not resolve to this device")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function H5(t){var l;let e,n,i=t[62].ip===((l=t[0])==null?void 0:l.ipv4)&&P5(t);return{c(){i&&i.c(),e=qe()},m(r,s){i&&i.m(r,s),y(r,e,s),n=!0},p(r,s){var o;r[62].ip===((o=r[0])==null?void 0:o.ipv4)?i?(i.p(r,s),s[0]&129&&b(i,1)):(i=P5(r),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(r){n||(b(i),n=!0)},o(r){k(i),n=!1},d(r){r&&w(e),i&&i.d(r)}}}function W_e(t){var o,a;let e=(((o=t[0])==null?void 0:o.ipv4)||"—")+"",n,i,l,r,s=((a=t[7])==null?void 0:a.addresses)&&D5(t);return{c(){n=q(e),i=B(),s&&s.c(),l=qe()},m(u,f){y(u,n,f),y(u,i,f),s&&s.m(u,f),y(u,l,f),r=!0},p(u,f){var c,d;(!r||f[0]&1)&&e!==(e=(((c=u[0])==null?void 0:c.ipv4)||"—")+"")&&Z(n,e),(d=u[7])!=null&&d.addresses?s?(s.p(u,f),f[0]&128&&b(s,1)):(s=D5(u),s.c(),b(s,1),s.m(l.parentNode,l)):s&&(fe(),k(s,1,1,()=>{s=null}),ce())},i(u){r||(b(s),r=!0)},o(u){k(s),r=!1},d(u){u&&(w(n),w(i),w(l)),s&&s.d(u)}}}function q_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[U_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[W_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&129|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function j_e(t){let e;return{c(){e=q("IPv6")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function U5(t){let e,n,i=ct(t[7].addresses),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{r=null}),ce()),a[62].stale_observation?s?u[0]&128&&b(s,1):(s=V5(a),s.c(),b(s,1),s.m(n.parentNode,n)):s&&(fe(),k(s,1,1,()=>{s=null}),ce()),a[62].dns_resolves_device?o&&(fe(),k(o,1,1,()=>{o=null}),ce()):o?u[0]&128&&b(o,1):(o=W5(a),o.c(),b(o,1),o.m(i.parentNode,i))},i(a){l||(b(r),b(s),b(o),l=!0)},o(a){k(r),k(s),k(o),l=!1},d(a){a&&(w(e),w(n),w(i)),r&&r.d(a),s&&s.d(a),o&&o.d(a)}}}function G5(t){let e,n;return e=new Vt({props:{size:"sm",type:"magenta",$$slots:{default:[Y_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Y_e(t){let e;return{c(){e=q("shared address")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function V5(t){let e,n;return e=new Vt({props:{size:"sm",type:"warm-gray",$$slots:{default:[Z_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Z_e(t){let e;return{c(){e=q("stale observation")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function W5(t){let e,n;return e=new Vt({props:{size:"sm",type:"red",$$slots:{default:[X_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function X_e(t){let e;return{c(){e=q("DNS does not resolve to this device")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function q5(t){var l,r;let e,n,i=t[62].ip===((l=t[0])==null?void 0:l.ipv6)&&((r=t[0])==null?void 0:r.ipv6)&&F5(t);return{c(){i&&i.c(),e=qe()},m(s,o){i&&i.m(s,o),y(s,e,o),n=!0},p(s,o){var a,u;s[62].ip===((a=s[0])==null?void 0:a.ipv6)&&((u=s[0])!=null&&u.ipv6)?i?(i.p(s,o),o[0]&129&&b(i,1)):(i=F5(s),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(fe(),k(i,1,1,()=>{i=null}),ce())},i(s){n||(b(i),n=!0)},o(s){k(i),n=!1},d(s){s&&w(e),i&&i.d(s)}}}function K_e(t){var a,u;let e,n=(((a=t[0])==null?void 0:a.ipv6)||"—")+"",i,l,r,s,o=((u=t[7])==null?void 0:u.addresses)&&U5(t);return{c(){e=R("span"),i=q(n),l=B(),o&&o.c(),r=qe(),P(e,"class","ipv6-value svelte-12fp22s")},m(f,c){y(f,e,c),T(e,i),y(f,l,c),o&&o.m(f,c),y(f,r,c),s=!0},p(f,c){var d,h;(!s||c[0]&1)&&n!==(n=(((d=f[0])==null?void 0:d.ipv6)||"—")+"")&&Z(i,n),(h=f[7])!=null&&h.addresses?o?(o.p(f,c),c[0]&128&&b(o,1)):(o=U5(f),o.c(),b(o,1),o.m(r.parentNode,r)):o&&(fe(),k(o,1,1,()=>{o=null}),ce())},i(f){s||(b(o),s=!0)},o(f){k(o),s=!1},d(f){f&&(w(e),w(l),w(r)),o&&o.d(f)}}}function $_e(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[j_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[K_e]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&129|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function J_e(t){let e;return{c(){e=q("MAC Address(es)")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Q_e(t){let e;return{c(){e=q("—")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function x_e(t){let e,n,i=ct(t[0].macs),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function npe(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[J_e]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[tpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function ipe(t){var S,A;let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_;e=new Zn({props:{$$slots:{default:[k_e]},$$scope:{ctx:t}}});let v=((A=(S=t[7])==null?void 0:S.identity)==null?void 0:A.device_id)&&L5(t);return l=new Zn({props:{$$slots:{default:[M_e]},$$scope:{ctx:t}}}),s=new Zn({props:{$$slots:{default:[R_e]},$$scope:{ctx:t}}}),a=new Zn({props:{$$slots:{default:[H_e]},$$scope:{ctx:t}}}),f=new Zn({props:{$$slots:{default:[q_e]},$$scope:{ctx:t}}}),d=new Zn({props:{$$slots:{default:[$_e]},$$scope:{ctx:t}}}),g=new Zn({props:{$$slots:{default:[npe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),v&&v.c(),i=B(),F(l.$$.fragment),r=B(),F(s.$$.fragment),o=B(),F(a.$$.fragment),u=B(),F(f.$$.fragment),c=B(),F(d.$$.fragment),h=B(),F(g.$$.fragment)},m(C,I){H(e,C,I),y(C,n,I),v&&v.m(C,I),y(C,i,I),H(l,C,I),y(C,r,I),H(s,C,I),y(C,o,I),H(a,C,I),y(C,u,I),H(f,C,I),y(C,c,I),H(d,C,I),y(C,h,I),H(g,C,I),_=!0},p(C,I){var $,j;const M={};I[0]&128|I[2]&268435456&&(M.$$scope={dirty:I,ctx:C}),e.$set(M),(j=($=C[7])==null?void 0:$.identity)!=null&&j.device_id?v?(v.p(C,I),I[0]&128&&b(v,1)):(v=L5(C),v.c(),b(v,1),v.m(i.parentNode,i)):v&&(fe(),k(v,1,1,()=>{v=null}),ce());const L={};I[0]&1|I[2]&268435456&&(L.$$scope={dirty:I,ctx:C}),l.$set(L);const N={};I[0]&1|I[2]&268435456&&(N.$$scope={dirty:I,ctx:C}),s.$set(N);const z={};I[0]&1|I[2]&268435456&&(z.$$scope={dirty:I,ctx:C}),a.$set(z);const W={};I[0]&129|I[2]&268435456&&(W.$$scope={dirty:I,ctx:C}),f.$set(W);const D={};I[0]&129|I[2]&268435456&&(D.$$scope={dirty:I,ctx:C}),d.$set(D);const G={};I[0]&1|I[2]&268435456&&(G.$$scope={dirty:I,ctx:C}),g.$set(G)},i(C){_||(b(e.$$.fragment,C),b(v),b(l.$$.fragment,C),b(s.$$.fragment,C),b(a.$$.fragment,C),b(f.$$.fragment,C),b(d.$$.fragment,C),b(g.$$.fragment,C),_=!0)},o(C){k(e.$$.fragment,C),k(v),k(l.$$.fragment,C),k(s.$$.fragment,C),k(a.$$.fragment,C),k(f.$$.fragment,C),k(d.$$.fragment,C),k(g.$$.fragment,C),_=!1},d(C){C&&(w(n),w(i),w(r),w(o),w(u),w(c),w(h)),U(e,C),v&&v.d(C),U(l,C),U(s,C),U(a,C),U(f,C),U(d,C),U(g,C)}}}function lpe(t){let e,n,i,l;return e=new FT({props:{$$slots:{default:[m_e]},$$scope:{ctx:t}}}),i=new Nu({props:{$$slots:{default:[ipe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&129|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function rpe(t){let e;return{c(){e=q("Property")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function spe(t){let e;return{c(){e=q("Value")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function ope(t){let e,n,i,l;return e=new Zt({props:{head:!0,$$slots:{default:[rpe]},$$scope:{ctx:t}}}),i=new Zt({props:{head:!0,$$slots:{default:[spe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function ape(t){let e,n;return e=new Zn({props:{head:!0,$$slots:{default:[ope]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[2]&268435456&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function upe(t){let e;return{c(){e=q("Status")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function fpe(t){var s;let e,n,i,l=(s=t[0])!=null&&s.online?"Online":"Offline",r;return{c(){var o;e=R("span"),i=B(),r=q(l),P(e,"class",n="status-dot "+((o=t[0])!=null&&o.online?"online":"offline")+" svelte-12fp22s")},m(o,a){y(o,e,a),y(o,i,a),y(o,r,a)},p(o,a){var u,f;a[0]&1&&n!==(n="status-dot "+((u=o[0])!=null&&u.online?"online":"offline")+" svelte-12fp22s")&&P(e,"class",n),a[0]&1&&l!==(l=(f=o[0])!=null&&f.online?"Online":"Offline")&&Z(r,l)},d(o){o&&(w(e),w(i),w(r))}}}function cpe(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[upe]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[fpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function dpe(t){let e;return{c(){e=q("Primary Source")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function hpe(t){var i;let e=(((i=t[0])==null?void 0:i.source)||"—")+"",n;return{c(){n=q(e)},m(l,r){y(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=(((s=l[0])==null?void 0:s.source)||"—")+"")&&Z(n,e)},d(l){l&&w(n)}}}function mpe(t){var i,l,r,s;let e,n;return e=new Vt({props:{size:"sm",type:((i=t[0])==null?void 0:i.source)==="ddns"?"green":((l=t[0])==null?void 0:l.source)==="mdns"?"blue":((r=t[0])==null?void 0:r.source)==="passive"?"warm-gray":((s=t[0])==null?void 0:s.source)==="manual"?"purple":"gray",$$slots:{default:[hpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(o,a){H(e,o,a),n=!0},p(o,a){var f,c,d,h;const u={};a[0]&1&&(u.type=((f=o[0])==null?void 0:f.source)==="ddns"?"green":((c=o[0])==null?void 0:c.source)==="mdns"?"blue":((d=o[0])==null?void 0:d.source)==="passive"?"warm-gray":((h=o[0])==null?void 0:h.source)==="manual"?"purple":"gray"),a[0]&1|a[2]&268435456&&(u.$$scope={dirty:a,ctx:o}),e.$set(u)},i(o){n||(b(e.$$.fragment,o),n=!0)},o(o){k(e.$$.fragment,o),n=!1},d(o){U(e,o)}}}function gpe(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[dpe]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[mpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function _pe(t){let e;return{c(){e=q("All Sources")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function ppe(t){let e;return{c(){e=q("—")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function bpe(t){let e,n,i=ct(t[0].sources),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){for(let s=0;s{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function wpe(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[_pe]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[kpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function ype(t){let e;return{c(){e=q("First Seen")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Tpe(t){var i;let e=Ts((i=t[0])==null?void 0:i.first_seen)+"",n;return{c(){n=q(e)},m(l,r){y(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=Ts((s=l[0])==null?void 0:s.first_seen)+"")&&Z(n,e)},d(l){l&&w(n)}}}function Spe(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[ype]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[Tpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Epe(t){let e;return{c(){e=q("Last Seen")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Mpe(t){var i;let e=Ts((i=t[0])==null?void 0:i.last_seen)+"",n;return{c(){n=q(e)},m(l,r){y(l,n,r)},p(l,r){var s;r[0]&1&&e!==(e=Ts((s=l[0])==null?void 0:s.last_seen)+"")&&Z(n,e)},d(l){l&&w(n)}}}function Ope(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[Epe]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[Mpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Ape(t){let e;return{c(){e=q("Device ID")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function Cpe(t){var l;let e,n=(((l=t[0])==null?void 0:l.id)||"—")+"",i;return{c(){e=R("code"),i=q(n),wt(e,"font-size","0.75rem")},m(r,s){y(r,e,s),T(e,i)},p(r,s){var o;s[0]&1&&n!==(n=(((o=r[0])==null?void 0:o.id)||"—")+"")&&Z(i,n)},d(r){r&&w(e)}}}function Lpe(t){let e,n,i,l;return e=new Zt({props:{$$slots:{default:[Ape]},$$scope:{ctx:t}}}),i=new Zt({props:{$$slots:{default:[Cpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Ipe(t){let e,n,i,l,r,s,o,a,u,f,c,d;return e=new Zn({props:{$$slots:{default:[cpe]},$$scope:{ctx:t}}}),i=new Zn({props:{$$slots:{default:[gpe]},$$scope:{ctx:t}}}),r=new Zn({props:{$$slots:{default:[wpe]},$$scope:{ctx:t}}}),o=new Zn({props:{$$slots:{default:[Spe]},$$scope:{ctx:t}}}),u=new Zn({props:{$$slots:{default:[Ope]},$$scope:{ctx:t}}}),c=new Zn({props:{$$slots:{default:[Lpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment),s=B(),F(o.$$.fragment),a=B(),F(u.$$.fragment),f=B(),F(c.$$.fragment)},m(h,g){H(e,h,g),y(h,n,g),H(i,h,g),y(h,l,g),H(r,h,g),y(h,s,g),H(o,h,g),y(h,a,g),H(u,h,g),y(h,f,g),H(c,h,g),d=!0},p(h,g){const _={};g[0]&1|g[2]&268435456&&(_.$$scope={dirty:g,ctx:h}),e.$set(_);const v={};g[0]&1|g[2]&268435456&&(v.$$scope={dirty:g,ctx:h}),i.$set(v);const S={};g[0]&1|g[2]&268435456&&(S.$$scope={dirty:g,ctx:h}),r.$set(S);const A={};g[0]&1|g[2]&268435456&&(A.$$scope={dirty:g,ctx:h}),o.$set(A);const C={};g[0]&1|g[2]&268435456&&(C.$$scope={dirty:g,ctx:h}),u.$set(C);const I={};g[0]&1|g[2]&268435456&&(I.$$scope={dirty:g,ctx:h}),c.$set(I)},i(h){d||(b(e.$$.fragment,h),b(i.$$.fragment,h),b(r.$$.fragment,h),b(o.$$.fragment,h),b(u.$$.fragment,h),b(c.$$.fragment,h),d=!0)},o(h){k(e.$$.fragment,h),k(i.$$.fragment,h),k(r.$$.fragment,h),k(o.$$.fragment,h),k(u.$$.fragment,h),k(c.$$.fragment,h),d=!1},d(h){h&&(w(n),w(l),w(s),w(a),w(f)),U(e,h),U(i,h),U(r,h),U(o,h),U(u,h),U(c,h)}}}function Rpe(t){let e,n,i,l;return e=new FT({props:{$$slots:{default:[ape]},$$scope:{ctx:t}}}),i=new Nu({props:{$$slots:{default:[Ipe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s[2]&268435456&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s[0]&1|s[2]&268435456&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Dpe(t){let e,n,i=ct(t[24]),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){e=R("ul");for(let s=0;s{C=null}),ce()),(!A||M[0]&16777216)&&f!==(f=I[53].url+"")&&Z(c,f),(!A||M[0]&16777216)&&_!==(_=I[53].ip+"")&&Z(v,_)},i(I){A||(b(s.$$.fragment,I),b(C),A=!0)},o(I){k(s.$$.fragment,I),k(C),A=!1},d(I){I&&w(e),U(s),C&&C.d()}}}function K5(t){let e,n,i;return{c(){e=R("div"),n=q("Live refresh unavailable: "),i=q(t[26]),P(e,"class","refresh-error svelte-12fp22s")},m(l,r){y(l,e,r),T(e,n),T(e,i)},p(l,r){r[0]&67108864&&Z(i,l[26])},d(l){l&&w(e)}}}function Hpe(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,L,N,z,W,D,G,$,j,Q,le,oe,X,de,re,x,me,ee,ke,pe,Fe,Ve,Ee,We,ge,ve,be,ue,nt=t[6]&&a5(t);n=new dz({props:{legendText:"Naming and metadata",$$slots:{default:[qge]},$$scope:{ctx:t}}});let Oe=t[13]&&u5(t),dt=t[14]&&f5();function yt(se){t[39](se)}let at={labelText:"Policy",helperText:"Applies to DNS immediately; proxy paths use it when identity resolves.",disabled:t[12],$$slots:{default:[jge]},$$scope:{ctx:t}};t[11]!==void 0&&(at.selected=t[11]),d=new wr({props:at}),ft.push(()=>Yt(d,"selected",yt)),_=new Rt({props:{kind:"primary",size:"field",disabled:t[12],$$slots:{default:[Yge]},$$scope:{ctx:t}}}),_.$on("click",t[32]);const ut=[Kge,Xge,Zge],At=[];function xe(se,Le){return se[8]&&!se[7]?0:se[9]&&!se[7]?1:se[7]?2:-1}~(C=xe(t))&&(I=At[C]=ut[C](t));let mt=t[22]&&g5(t),we=t[23]&&_5(t);const gt=[Qge,Jge],It=[];function Ht(se,Le){return se[19]&&!se[20]?0:1}Q=Ht(t),le=It[Q]=gt[Q](t),re=new gu({props:{condensed:!0,flush:!0,$$slots:{default:[lpe]},$$scope:{ctx:t}}}),ke=new gu({props:{condensed:!0,flush:!0,$$slots:{default:[Rpe]},$$scope:{ctx:t}}});const Wt=[Npe,Ppe,Dpe],qt=[];function Xt(se,Le){return se[25]&&!se[27]?0:se[24].length===0?1:2}Ee=Xt(t),We=qt[Ee]=Wt[Ee](t);let Ce=t[26]&&K5(t);return{c(){nt&&nt.c(),e=B(),F(n.$$.fragment),i=B(),l=R("h5"),l.textContent="Policy",r=B(),s=R("p"),s.textContent=`A device without a policy of its own uses the default policy. Owner and category above never change filtering.`,o=B(),Oe&&Oe.c(),a=B(),dt&&dt.c(),u=B(),f=R("div"),c=R("div"),F(d.$$.fragment),g=B(),F(_.$$.fragment),v=B(),S=R("h5"),S.textContent="Effective protection",A=B(),I&&I.c(),M=B(),L=R("h5"),L.textContent="Tailscale",N=B(),z=R("p"),z.textContent=`Linking is always manual. Suggestions are shown as hints only and never select or link a peer automatically.`,W=B(),D=R("p"),D.textContent=`Tailscale normally does not provide a hardware MAC address. Wake-on-LAN MAC addresses shown here are informational and are not used to match or - link devices.`,G=B(),mt&&mt.c(),$=B(),we&&we.c(),j=B(),le.c(),oe=B(),X=R("h5"),X.textContent="Identity",de=B(),F(re.$$.fragment),x=B(),me=R("h5"),me.textContent="Discovery",ee=B(),F(ke.$$.fragment),pe=B(),Fe=R("h5"),Fe.textContent="Recent activity (decision history)",Ve=B(),We.c(),ge=B(),Ce&&Ce.c(),ve=B(),be=R("p"),be.innerHTML=`View full decision history`,wt(l,"margin-top","1.5rem"),wt(l,"margin-bottom","0.5rem"),P(s,"class","section-note svelte-12fp22s"),P(c,"class","assignment-select svelte-12fp22s"),P(f,"class","assignment-row svelte-12fp22s"),wt(S,"margin-top","1.5rem"),wt(S,"margin-bottom","0.5rem"),wt(L,"margin-top","1.5rem"),wt(L,"margin-bottom","0.5rem"),P(z,"class","section-note svelte-12fp22s"),P(D,"class","section-note svelte-12fp22s"),wt(X,"margin-top","1.5rem"),wt(X,"margin-bottom","0.5rem"),wt(me,"margin-top","1.5rem"),wt(me,"margin-bottom","0.5rem"),wt(Fe,"margin-top","1.5rem"),wt(Fe,"margin-bottom","0.5rem"),P(be,"class","section-note svelte-12fp22s")},m(se,Le){nt&&nt.m(se,Le),y(se,e,Le),H(n,se,Le),y(se,i,Le),y(se,l,Le),y(se,r,Le),y(se,s,Le),y(se,o,Le),Oe&&Oe.m(se,Le),y(se,a,Le),dt&&dt.m(se,Le),y(se,u,Le),y(se,f,Le),T(f,c),H(d,c,null),T(f,g),H(_,f,null),y(se,v,Le),y(se,S,Le),y(se,A,Le),~C&&At[C].m(se,Le),y(se,M,Le),y(se,L,Le),y(se,N,Le),y(se,z,Le),y(se,W,Le),y(se,D,Le),y(se,G,Le),mt&&mt.m(se,Le),y(se,$,Le),we&&we.m(se,Le),y(se,j,Le),It[Q].m(se,Le),y(se,oe,Le),y(se,X,Le),y(se,de,Le),H(re,se,Le),y(se,x,Le),y(se,me,Le),y(se,ee,Le),H(ke,se,Le),y(se,pe,Le),y(se,Fe,Le),y(se,Ve,Le),qt[Ee].m(se,Le),y(se,ge,Le),Ce&&Ce.m(se,Le),y(se,ve,Le),y(se,be,Le),ue=!0},p(se,Le){se[6]?nt?nt.p(se,Le):(nt=a5(se),nt.c(),nt.m(e.parentNode,e)):nt&&(nt.d(1),nt=null);const _t={};Le[0]&28|Le[2]&268435456&&(_t.$$scope={dirty:Le,ctx:se}),n.$set(_t),se[13]?Oe?Oe.p(se,Le):(Oe=u5(se),Oe.c(),Oe.m(a.parentNode,a)):Oe&&(Oe.d(1),Oe=null),se[14]?dt||(dt=f5(),dt.c(),dt.m(u.parentNode,u)):dt&&(dt.d(1),dt=null);const zt={};Le[0]&4096&&(zt.disabled=se[12]),Le[0]&1024|Le[2]&268435456&&(zt.$$scope={dirty:Le,ctx:se}),!h&&Le[0]&2048&&(h=!0,zt.selected=se[11],jt(()=>h=!1)),d.$set(zt);const Be={};Le[0]&4096&&(Be.disabled=se[12]),Le[0]&4096|Le[2]&268435456&&(Be.$$scope={dirty:Le,ctx:se}),_.$set(Be);let Ot=C;C=xe(se),C===Ot?~C&&At[C].p(se,Le):(I&&(fe(),k(At[Ot],1,1,()=>{At[Ot]=null}),ce()),~C?(I=At[C],I?I.p(se,Le):(I=At[C]=ut[C](se),I.c()),b(I,1),I.m(M.parentNode,M)):I=null),se[22]?mt?mt.p(se,Le):(mt=g5(se),mt.c(),mt.m($.parentNode,$)):mt&&(mt.d(1),mt=null),se[23]?we?we.p(se,Le):(we=_5(se),we.c(),we.m(j.parentNode,j)):we&&(we.d(1),we=null);let kt=Q;Q=Ht(se),Q===kt?It[Q].p(se,Le):(fe(),k(It[kt],1,1,()=>{It[kt]=null}),ce(),le=It[Q],le?le.p(se,Le):(le=It[Q]=gt[Q](se),le.c()),b(le,1),le.m(oe.parentNode,oe));const Pt={};Le[0]&129|Le[2]&268435456&&(Pt.$$scope={dirty:Le,ctx:se}),re.$set(Pt);const Ye={};Le[0]&1|Le[2]&268435456&&(Ye.$$scope={dirty:Le,ctx:se}),ke.$set(Ye);let ze=Ee;Ee=Xt(se),Ee===ze?qt[Ee].p(se,Le):(fe(),k(qt[ze],1,1,()=>{qt[ze]=null}),ce(),We=qt[Ee],We?We.p(se,Le):(We=qt[Ee]=Wt[Ee](se),We.c()),b(We,1),We.m(ge.parentNode,ge)),se[26]?Ce?Ce.p(se,Le):(Ce=K5(se),Ce.c(),Ce.m(ve.parentNode,ve)):Ce&&(Ce.d(1),Ce=null)},i(se){ue||(b(n.$$.fragment,se),b(d.$$.fragment,se),b(_.$$.fragment,se),b(I),b(le),b(re.$$.fragment,se),b(ke.$$.fragment,se),b(We),ue=!0)},o(se){k(n.$$.fragment,se),k(d.$$.fragment,se),k(_.$$.fragment,se),k(I),k(le),k(re.$$.fragment,se),k(ke.$$.fragment,se),k(We),ue=!1},d(se){se&&(w(e),w(i),w(l),w(r),w(s),w(o),w(a),w(u),w(f),w(v),w(S),w(A),w(M),w(L),w(N),w(z),w(W),w(D),w(G),w($),w(j),w(oe),w(X),w(de),w(x),w(me),w(ee),w(pe),w(Fe),w(Ve),w(ge),w(ve),w(be)),nt&&nt.d(se),U(n,se),Oe&&Oe.d(se),dt&&dt.d(se),U(d),U(_),~C&&At[C].d(se),mt&&mt.d(se),we&&we.d(se),It[Q].d(se),U(re,se),U(ke,se),qt[Ee].d(se),Ce&&Ce.d(se)}}}function Upe(t){var o;let e,n,i,l,r,s;return e=new Ru({props:{title:"Device Details",label:((o=t[0])==null?void 0:o.display_name)||"Unknown Device"}}),i=new Du({props:{hasForm:!0,$$slots:{default:[Hpe]},$$scope:{ctx:t}}}),r=new Pu({props:{primaryButtonText:t[5]?"Saving...":"Save",primaryButtonDisabled:t[5],secondaryButtonText:"Cancel"}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(a,u){H(e,a,u),y(a,n,u),H(i,a,u),y(a,l,u),H(r,a,u),s=!0},p(a,u){var h;const f={};u[0]&1&&(f.label=((h=a[0])==null?void 0:h.display_name)||"Unknown Device"),e.$set(f);const c={};u[0]&268435421|u[2]&268435456&&(c.$$scope={dirty:u,ctx:a}),i.$set(c);const d={};u[0]&32&&(d.primaryButtonText=a[5]?"Saving...":"Save"),u[0]&32&&(d.primaryButtonDisabled=a[5]),r.$set(d)},i(a){s||(b(e.$$.fragment,a),b(i.$$.fragment,a),b(r.$$.fragment,a),s=!0)},o(a){k(e.$$.fragment,a),k(i.$$.fragment,a),k(r.$$.fragment,a),s=!1},d(a){a&&(w(n),w(l)),U(e,a),U(i,a),U(r,a)}}}function Fpe(t){let e,n;return e=new Iu({props:{open:t[1],size:"lg",$$slots:{default:[Upe]},$$scope:{ctx:t}}}),e.$on("close",t[33]),e.$on("submit",t[31]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&2&&(r.open=i[1]),l[0]&268435453|l[2]&268435456&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Gpe(){return localStorage.getItem("jwt")||""}function gs(t){const e={Authorization:"Bearer "+Gpe()};return t&&(e["Content-Type"]="application/json"),e}async function _s(t){const e=await t.text();try{const n=JSON.parse(e);if(n&&n.error)return n.error}catch{}return e||"Request failed ("+t.status+")"}function $5(t){return t==="connected"?"success":t==="degraded"||t==="connecting"?"warning":t==="unavailable"||t==="stopped"?"error":"info"}function J5(t){return t==="connected"?"Tailscale connected":t==="degraded"?"Tailscale data degraded":t==="unavailable"?"Tailscale unavailable":t==="connecting"?"Tailscale connecting":t==="disabled"?"Tailscale disabled":"Tailscale status"}function so(t){return t.name||t.dns_name||t.node_id}function Ts(t){return t?new Date(t).toLocaleString():"—"}function Q5(t){return t?new Date(t*1e3).toLocaleString():"—"}function x5(t){switch(t){case"high":return"green";case"medium":return"teal";case"low":return"magenta";default:return"red"}}function eT(t){switch(t){case"high":return"High confidence";case"medium":return"Medium confidence";case"low":return"Low confidence";default:return"No protection signal"}}function tT(t){var n,i,l;if(!t)return"";const e=[];return(n=t.blocked_categories)!=null&&n.length&&e.push(t.blocked_categories.length+" blocked categor"+(t.blocked_categories.length===1?"y":"ies")),(i=t.blocked_domains)!=null&&i.length&&e.push(t.blocked_domains.length+" blocked domain"+(t.blocked_domains.length===1?"":"s")),(l=t.allowed_domains)!=null&&l.length&&e.push(t.allowed_domains.length+" allowed domain"+(t.allowed_domains.length===1?"":"s")),t.rule_count&&e.push(t.rule_count+" rule"+(t.rule_count===1?"":"s")),t.safe_search&&e.push("safe search"),e.length?e.join(", "):"blocks nothing of its own"}const nT=t=>t.id!=="default";function Vpe(t,e,n){const i=ni()+"/api/devices",l=ni()+"/api/policy",r=ni()+"/api/tailscale",s=yn();let{device:o}=e,{open:a=!1}=e,u=(o==null?void 0:o.manual_name)||"",f=(o==null?void 0:o.owner)||"",c=(o==null?void 0:o.category)||"",d=!1,h="",g=null,_=!1,v="",S=[],A="",C=!1,I="",M=!1,L=[],N=null,z=(o==null?void 0:o.tailscale_nodes)||[],W=[],D="",G=!1,$=!1,j=!1,Q="",le="",oe=[],X=!1,de="",re=!1,x=null,me=null,ee=!1,ke=!1,pe="";async function Fe(){var xe;n(8,_=!0),n(9,v="");try{const mt=await fetch(i+"/"+o.id+"/policy",{headers:gs(!1)});if(!mt.ok)throw new Error(await _s(mt));n(7,g=await mt.json()),n(11,A=((xe=g==null?void 0:g.assignment)==null?void 0:xe.id)||"")}catch(mt){n(9,v=mt.message)}finally{n(8,_=!1)}}async function Ve(){try{const xe=await fetch(l+"/groups",{headers:gs(!1)});if(!xe.ok)throw new Error(await _s(xe));const mt=await xe.json();n(10,S=mt.groups||[])}catch(xe){n(9,v=v||xe.message)}}async function Ee(){n(19,G=!0),n(22,Q="");try{const xe=await fetch(r+"/peers",{headers:gs(!1)});if(!xe.ok)throw new Error(await _s(xe));const mt=await xe.json();n(15,N=mt),n(34,L=mt.state==="connected"?mt.peers||[]:[]),mt.state==="connected"&&n(16,z=L.filter(we=>we.mapped_device_id===o.id)),n(20,$=!0)}catch(xe){n(15,N=null),n(34,L=[]),n(22,Q=xe instanceof Error?xe.message:"Tailscale peers failed")}finally{n(19,G=!1)}}async function We(){if(D){n(21,j=!0),n(22,Q=""),n(23,le="");try{const xe=await fetch(i+"/"+o.id+"/tailscale",{method:"PUT",headers:gs(!0),body:JSON.stringify({node_id:D})});if(!xe.ok)throw new Error(await _s(xe));n(18,D=""),n(23,le="Tailscale peer linked."),await Ee(),s("tailscaleChanged")}catch(xe){n(22,Q=xe.message)}finally{n(21,j=!1)}}}async function ge(xe,mt){if(confirm(`Unlink Tailscale peer "${mt||xe}" from this device?`)){n(21,j=!0),n(22,Q=""),n(23,le="");try{const we=await fetch(i+"/"+o.id+"/tailscale/"+encodeURIComponent(xe),{method:"DELETE",headers:gs(!1)});if(!we.ok)throw new Error(await _s(we));n(16,z=z.filter(gt=>gt.node_id!==xe)),n(23,le="Tailscale peer unlinked."),await Ee(),s("tailscaleChanged")}catch(we){n(22,Q=we.message)}finally{n(21,j=!1)}}}async function ve(){if(!(ee||ke)){ee=!0,n(25,X=!re),n(26,de=""),me=new AbortController;try{const xe=await fetch(i+"/"+o.id+"/activity?since=86400&limit=100",{headers:gs(!1),signal:me.signal});if(!xe.ok)throw new Error(await _s(xe));const mt=await xe.json();ke||(n(24,oe=mt.items||[]),n(27,re=!0))}catch(xe){!ke&&(xe==null?void 0:xe.name)!=="AbortError"&&n(26,de=xe.message)}finally{ee=!1,n(25,X=!1),me=null,ke||(x=setTimeout(ve,5e3))}}}async function be(){n(5,d=!0),n(6,h="");try{const xe=await fetch(i+"/"+o.id+"/name",{method:"POST",headers:gs(!0),body:JSON.stringify({name:u,owner:f,category:c})});if(!xe.ok)throw new Error(await _s(xe));s("saved")}catch(xe){n(6,h=xe.message)}finally{n(5,d=!1)}}async function ue(){n(12,C=!0),n(13,I=""),n(14,M=!1);try{const xe=await fetch(i+"/"+o.id+"/assignment",{method:"PUT",headers:gs(!0),body:JSON.stringify({group_id:A})});if(!xe.ok)throw new Error(await _s(xe));await Fe(),n(14,M=!0),s("saved")}catch(xe){n(13,I=xe.message)}finally{n(12,C=!1)}}Es(()=>{ke=!0,x&&clearTimeout(x),me==null||me.abort()});function nt(){s("close")}function Oe(xe){u=xe,n(2,u)}function dt(xe){f=xe,n(3,f)}function yt(xe){c=xe,n(4,c)}function at(xe){A=xe,n(11,A)}const ut=xe=>ge(xe.node_id,so(xe));function At(xe){D=xe,n(18,D)}return t.$$set=xe=>{"device"in xe&&n(0,o=xe.device),"open"in xe&&n(1,a=xe.open)},t.$$.update=()=>{t.$$.dirty[1]&8&&n(17,W=L.filter(xe=>!xe.mapped_device_id)),t.$$.dirty[0]&3|t.$$.dirty[1]&16&&a&&o!=null&&o.id&&pe!==o.id&&(n(35,pe=o.id),Fe(),Ve(),Ee(),ve())},[o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,N,z,W,D,G,$,j,Q,le,oe,X,de,re,Ee,We,ge,be,ue,nt,L,pe,Oe,dt,yt,at,ut,At]}class Wpe extends De{constructor(e){super(),Re(this,e,Vpe,Fpe,Ie,{device:0,open:1},null,[-1,-1,-1])}}function iT(t,e,n){const i=t.slice();return i[24]=e[n],i}function lT(t){let e,n;return e=new xi({props:{kind:"error",title:"Error",subtitle:t[2]}}),e.$on("close",t[11]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4&&(r.subtitle=i[2]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function rT(t){let e,n;return e=new xi({props:{kind:"success",title:"Success",subtitle:t[3]}}),e.$on("close",t[12]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8&&(r.subtitle=i[3]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function qpe(t){let e,n,i,l=t[0].length+"",r,s,o=t[0].length!==1?"s":"",a,u,f=t[0].filter(fT).length+"",c,d,h;return e=new Ol({props:{sortable:!0,title:"Device Inventory",description:"Devices discovered on your network, including explicitly linked Tailscale peers.",headers:t[6],rows:t[0],$$slots:{cell:[obe,({row:g,cell:_})=>({22:g,23:_}),({row:g,cell:_})=>(g?4194304:0)|(_?8388608:0)],default:[Xpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),i=R("div"),r=q(l),s=q(" device"),a=q(o),u=q(" discovered · "),c=q(f),d=q(" online"),P(i,"class","device-summary svelte-smv1h4")},m(g,_){H(e,g,_),y(g,n,_),y(g,i,_),T(i,r),T(i,s),T(i,a),T(i,u),T(i,c),T(i,d),h=!0},p(g,_){const v={};_&1&&(v.rows=g[0]),_&146800640&&(v.$$scope={dirty:_,ctx:g}),e.$set(v),(!h||_&1)&&l!==(l=g[0].length+"")&&Z(r,l),(!h||_&1)&&o!==(o=g[0].length!==1?"s":"")&&Z(a,o),(!h||_&1)&&f!==(f=g[0].filter(fT).length+"")&&Z(c,f)},i(g){h||(b(e.$$.fragment,g),h=!0)},o(g){k(e.$$.fragment,g),h=!1},d(g){g&&(w(n),w(i)),U(e,g)}}}function jpe(t){let e,n;return e=new oo({props:{description:"Loading devices..."}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Ype(t){let e,n,i,l;return e=new LT({props:{persistent:!0,shouldFilterRows:!0,placeholder:"Search devices..."}}),i=new Rt({props:{kind:"ghost",icon:_q,iconDescription:"Refresh"}}),i.$on("click",t[7]),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p:he,i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Zpe(t){let e,n;return e=new X1({props:{$$slots:{default:[Ype]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&134217728&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Xpe(t){let e,n;return e=new Z1({props:{$$slots:{default:[Zpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&134217728&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Kpe(t){let e=(t[23].value||"—")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&8388608&&e!==(e=(i[23].value||"—")+"")&&Z(n,e)},i:he,o:he,d(i){i&&w(n)}}}function $pe(t){let e,n;return e=new FB({props:{flipped:!0,$$slots:{default:[tbe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&138412032&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Jpe(t){let e,n;return e=new Vt({props:{size:"sm",type:t[23].value==="ddns"?"green":t[23].value==="mdns"?"blue":t[23].value==="passive"?"warm-gray":t[23].value==="manual"?"purple":"gray",$$slots:{default:[nbe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8388608&&(r.type=i[23].value==="ddns"?"green":i[23].value==="mdns"?"blue":i[23].value==="passive"?"warm-gray":i[23].value==="manual"?"purple":"gray"),l&142606336&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Qpe(t){let e,n,i,l;const r=[lbe,ibe],s=[];function o(a,u){var f;return(f=a[22].tailscale_nodes)!=null&&f.length?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function xpe(t){let e,n=t[23].value+"",i,l,r,s,o,a;function u(){return t[13](t[22])}let f=!t[22].manual_name&&t[22].source!=="manual"&&oT(t);return{c(){e=R("button"),i=q(n),l=B(),f&&f.c(),r=qe(),P(e,"class","device-name-link svelte-smv1h4")},m(c,d){y(c,e,d),T(e,i),y(c,l,d),f&&f.m(c,d),y(c,r,d),s=!0,o||(a=J(e,"click",u),o=!0)},p(c,d){t=c,(!s||d&8388608)&&n!==(n=t[23].value+"")&&Z(i,n),!t[22].manual_name&&t[22].source!=="manual"?f?d&4194304&&b(f,1):(f=oT(t),f.c(),b(f,1),f.m(r.parentNode,r)):f&&(fe(),k(f,1,1,()=>{f=null}),ce())},i(c){s||(b(f),s=!0)},o(c){k(f),s=!1},d(c){c&&(w(e),w(l),w(r)),f&&f.d(c),o=!1,a()}}}function ebe(t){let e,n,i;return{c(){e=R("span"),P(e,"class",n="status-dot "+(t[22].online?"online":"offline")+" svelte-smv1h4"),P(e,"title",i=t[22].online?"Online":"Offline")},m(l,r){y(l,e,r)},p(l,r){r&4194304&&n!==(n="status-dot "+(l[22].online?"online":"offline")+" svelte-smv1h4")&&P(e,"class",n),r&4194304&&i!==(i=l[22].online?"Online":"Offline")&&P(e,"title",i)},i:he,o:he,d(l){l&&w(e)}}}function tbe(t){let e,n,i,l,r,s;function o(){return t[14](t[22])}e=new Xh({props:{text:"Edit / Name"}}),e.$on("click",o);function a(){return t[15](t[22])}i=new Xh({props:{text:"Manage Tailscale links"}}),i.$on("click",a);function u(){return t[16](t[22])}return r=new Xh({props:{danger:!0,text:"Remove"}}),r.$on("click",u),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(f,c){H(e,f,c),y(f,n,c),H(i,f,c),y(f,l,c),H(r,f,c),s=!0},p(f,c){t=f},i(f){s||(b(e.$$.fragment,f),b(i.$$.fragment,f),b(r.$$.fragment,f),s=!0)},o(f){k(e.$$.fragment,f),k(i.$$.fragment,f),k(r.$$.fragment,f),s=!1},d(f){f&&(w(n),w(l)),U(e,f),U(i,f),U(r,f)}}}function nbe(t){let e=t[23].value+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&8388608&&e!==(e=i[23].value+"")&&Z(n,e)},d(i){i&&w(n)}}}function ibe(t){let e;return{c(){e=q("—")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function lbe(t){let e,n,i=ct(t[22].tailscale_nodes),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){e=R("div");for(let s=0;s{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function aT(t){let e,n;return e=new Wpe({props:{device:t[4],open:t[5]}}),e.$on("close",t[17]),e.$on("saved",t[9]),e.$on("tailscaleChanged",t[7]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.device=i[4]),l&32&&(r.open=i[5]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function abe(t){let e,n,i,l,r,s,o,a=t[2]&&lT(t),u=t[3]&&rT(t);const f=[jpe,qpe],c=[];function d(g,_){return g[1]&&g[0].length===0?0:1}i=d(t),l=c[i]=f[i](t);let h=t[5]&&t[4]&&aT(t);return{c(){a&&a.c(),e=B(),u&&u.c(),n=B(),l.c(),r=B(),h&&h.c(),s=qe()},m(g,_){a&&a.m(g,_),y(g,e,_),u&&u.m(g,_),y(g,n,_),c[i].m(g,_),y(g,r,_),h&&h.m(g,_),y(g,s,_),o=!0},p(g,[_]){g[2]?a?(a.p(g,_),_&4&&b(a,1)):(a=lT(g),a.c(),b(a,1),a.m(e.parentNode,e)):a&&(fe(),k(a,1,1,()=>{a=null}),ce()),g[3]?u?(u.p(g,_),_&8&&b(u,1)):(u=rT(g),u.c(),b(u,1),u.m(n.parentNode,n)):u&&(fe(),k(u,1,1,()=>{u=null}),ce());let v=i;i=d(g),i===v?c[i].p(g,_):(fe(),k(c[v],1,1,()=>{c[v]=null}),ce(),l=c[i],l?l.p(g,_):(l=c[i]=f[i](g),l.c()),b(l,1),l.m(r.parentNode,r)),g[5]&&g[4]?h?(h.p(g,_),_&48&&b(h,1)):(h=aT(g),h.c(),b(h,1),h.m(s.parentNode,s)):h&&(fe(),k(h,1,1,()=>{h=null}),ce())},i(g){o||(b(a),b(u),b(l),b(h),o=!0)},o(g){k(a),k(u),k(l),k(h),o=!1},d(g){g&&(w(e),w(n),w(r),w(s)),a&&a.d(g),u&&u.d(g),c[i].d(g),h&&h.d(g)}}}function uT(){return localStorage.getItem("jwt")||""}function ube(t){var e,n;return{...t,id:t.id,status:t.online?"online":"offline",display_name:t.manual_name||t.display_name||t.dns_name||"Unknown",macs_display:(e=t.macs)!=null&&e.length?t.macs[0]:"—",tailscale_display:(n=t.tailscale_nodes)!=null&&n.length?t.tailscale_nodes.map(i=>i.name||i.dns_name).join(", "):"—",last_seen_display:fbe(t.last_seen)}}function fbe(t){if(!t)return"Never";const e=new Date(t),i=new Date().getTime()-e.getTime(),l=Math.floor(i/1e3);if(l<60)return"Just now";const r=Math.floor(l/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}const fT=t=>t.online;function cbe(t,e,n){const i=ni()+"/api/devices";let l=[],r=!1,s="",o="",a=null,u=!1,f;const c=[{key:"status",value:"Status"},{key:"display_name",value:"Name"},{key:"dns_name",value:"DNS Name"},{key:"tailscale_display",value:"Tailscale"},{key:"ipv4",value:"IPv4"},{key:"ipv6",value:"IPv6"},{key:"macs_display",value:"MAC"},{key:"source",value:"Via"},{key:"last_seen_display",value:"Last Seen"},{key:"actions",value:""}];async function d(){n(1,r=!0),n(2,s="");try{const W=uT();if(!W)throw new Error("Please login first to view devices");const D=await fetch(i,{headers:{Authorization:`Bearer ${W}`}});if(D.status===401)throw new Error("Authentication failed. Please login again");if(D.status===503){n(0,l=[]);return}if(!D.ok){const $=await D.text();throw new Error(`Failed to load devices: ${D.status} - ${$}`)}const G=await D.json();n(0,l=(G.devices||[]).map(ube))}catch(W){n(2,s=W.message)}finally{n(1,r=!1)}}function h(W){n(4,a=W),n(5,u=!0)}function g(W){h(W)}async function _(){n(5,u=!1),n(4,a=null),n(3,o="Device updated successfully"),setTimeout(()=>n(3,o=""),3e3),await d()}function v(W){return S(W)}async function S(W){if(confirm(`Remove "${W.display_name}" from the inventory?`))try{const D=uT(),G=await fetch(`${i}/${W.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${D}`}});if(!G.ok){const $=await G.text();throw new Error(`Failed to remove device: ${$}`)}n(3,o=`"${W.display_name}" removed`),setTimeout(()=>n(3,o=""),3e3),await d()}catch(D){n(2,s=D.message)}}return _n(()=>{d(),f=setInterval(d,3e4)}),Es(()=>{f&&clearInterval(f)}),[l,r,s,o,a,u,c,d,g,_,v,()=>n(2,s=""),()=>n(3,o=""),W=>g(W),W=>g(W),W=>g(W),W=>v(W),()=>{n(5,u=!1),n(4,a=null)}]}class dbe extends De{constructor(e){super(),Re(this,e,cbe,abe,Ie,{})}}function hbe(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function mbe(t){let e;return{c(){e=q("Devices")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function gbe(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[hbe]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[mbe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function _be(t){let e,n;return e=new dbe({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function pbe(t){let e,n;return e=new zn({props:{$$slots:{default:[_be]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function bbe(t){let e,n,i,l,r,s,o,a;return e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[gbe]},$$scope:{ctx:t}}}),o=new dl({props:{$$slots:{default:[pbe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),i=R("h2"),i.textContent="Network Devices",l=B(),r=R("br"),s=B(),F(o.$$.fragment)},m(u,f){H(e,u,f),y(u,n,f),y(u,i,f),y(u,l,f),y(u,r,f),y(u,s,f),H(o,u,f),a=!0},p(u,[f]){const c={};f&1&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};f&1&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(b(e.$$.fragment,u),b(o.$$.fragment,u),a=!0)},o(u){k(e.$$.fragment,u),k(o.$$.fragment,u),a=!1},d(u){u&&(w(n),w(i),w(l),w(r),w(s)),U(e,u),U(o,u)}}}class vbe extends De{constructor(e){super(),Re(this,e,null,bbe,Ie,{})}}function kbe(t){let e;return{c(){e=q("Error: Unable to load localization.")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function wbe(t){let e,n,i,l;const r=[Tbe,ybe],s=[];function o(a,u){return a[1]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function ybe(t){let e,n,i,l,r,s,o,a,u;function f(_){t[14](_)}function c(_){t[15](_)}let d={};t[2]!==void 0&&(d.isSideNavOpen=t[2]),t[3]!==void 0&&(d.userProfilePanelOpen=t[3]),e=new _0e({props:d}),ft.push(()=>Yt(e,"isSideNavOpen",f)),ft.push(()=>Yt(e,"userProfilePanelOpen",c));function h(_){t[16](_)}let g={rail:!0,$$slots:{default:[Sbe]},$$scope:{ctx:t}};return t[2]!==void 0&&(g.isOpen=t[2]),r=new EV({props:g}),ft.push(()=>Yt(r,"isOpen",h)),a=new jV({props:{$$slots:{default:[Bbe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),l=B(),F(r.$$.fragment),o=B(),F(a.$$.fragment)},m(_,v){H(e,_,v),y(_,l,v),H(r,_,v),y(_,o,v),H(a,_,v),u=!0},p(_,v){const S={};!n&&v&4&&(n=!0,S.isSideNavOpen=_[2],jt(()=>n=!1)),!i&&v&8&&(i=!0,S.userProfilePanelOpen=_[3],jt(()=>i=!1)),e.$set(S);const A={};v&524288&&(A.$$scope={dirty:v,ctx:_}),!s&&v&4&&(s=!0,A.isOpen=_[2],jt(()=>s=!1)),r.$set(A);const C={};v&524288&&(C.$$scope={dirty:v,ctx:_}),a.$set(C)},i(_){u||(b(e.$$.fragment,_),b(r.$$.fragment,_),b(a.$$.fragment,_),u=!0)},o(_){k(e.$$.fragment,_),k(r.$$.fragment,_),k(a.$$.fragment,_),u=!1},d(_){_&&(w(l),w(o)),U(e,_),U(r,_),U(a,_)}}}function Tbe(t){let e,n,i,l,r,s;return{c(){e=R("main"),n=R("p"),n.textContent="Unable to read GateSentry setup status.",i=B(),l=R("button"),l.textContent="Retry status check",P(n,"role","alert"),P(n,"class","svelte-1dqpn31"),P(l,"type","button"),P(e,"class","setup-status-error svelte-1dqpn31")},m(o,a){y(o,e,a),T(e,n),T(e,i),T(e,l),r||(s=J(l,"click",t[5]),r=!0)},p:he,i:he,o:he,d(o){o&&w(e),r=!1,s()}}}function Sbe(t){let e,n;return e=new QZ({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Ebe(t){let e,n;return e=new RK({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Mbe(t){let e,n;return e=new pd({props:{type:"blockedkeywords"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Obe(t){let e,n;return e=new pd({props:{type:"blockedfiletypes"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Abe(t){let e,n;return e=new pd({props:{type:"excludeurls"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Cbe(t){let e,n;return e=new pd({props:{type:"excludehosts"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Lbe(t){let e,n;return e=new zK({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Ibe(t){let e,n;return e=new Wge({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Rbe(t){let e,n;return e=new vbe({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Dbe(t){let e,n;return e=new S1e({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Pbe(t){let e,n;return e=new P1e({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Nbe(t){let e,n;return e=new c0e({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Bbe(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,L,N,z,W,D,G,$,j,Q,le,oe,X,de,re;return n=new zi({props:{path:"/login",component:iZ}}),l=new zi({props:{path:"/setup",component:mZ}}),s=new zi({props:{path:"/dns",component:TJ}}),a=new zi({props:{path:"/logs",component:HZ}}),f=new zi({props:{path:"/settings",$$slots:{default:[Ebe]},$$scope:{ctx:t}}}),d=new zi({props:{path:"/blockedkeywords",$$slots:{default:[Mbe]},$$scope:{ctx:t}}}),g=new zi({props:{path:"/blockedfiletypes",$$slots:{default:[Obe]},$$scope:{ctx:t}}}),v=new zi({props:{path:"/excludeurls",$$slots:{default:[Abe]},$$scope:{ctx:t}}}),A=new zi({props:{path:"/excludehosts",$$slots:{default:[Cbe]},$$scope:{ctx:t}}}),I=new zi({props:{path:"/services",$$slots:{default:[Lbe]},$$scope:{ctx:t}}}),L=new zi({props:{path:"/rules",$$slots:{default:[Ibe]},$$scope:{ctx:t}}}),z=new zi({props:{path:"/devices",$$slots:{default:[Rbe]},$$scope:{ctx:t}}}),D=new zi({props:{path:"/stats",$$slots:{default:[Dbe]},$$scope:{ctx:t}}}),$=new zi({props:{path:"/ai",$$slots:{default:[Pbe]},$$scope:{ctx:t}}}),Q=new zi({props:{path:"/users",$$slots:{default:[Nbe]},$$scope:{ctx:t}}}),oe=new zi({props:{path:"/",component:M$}}),de=new KX({}),{c(){e=R("div"),F(n.$$.fragment),i=B(),F(l.$$.fragment),r=B(),F(s.$$.fragment),o=B(),F(a.$$.fragment),u=B(),F(f.$$.fragment),c=B(),F(d.$$.fragment),h=B(),F(g.$$.fragment),_=B(),F(v.$$.fragment),S=B(),F(A.$$.fragment),C=B(),F(I.$$.fragment),M=B(),F(L.$$.fragment),N=B(),F(z.$$.fragment),W=B(),F(D.$$.fragment),G=B(),F($.$$.fragment),j=B(),F(Q.$$.fragment),le=B(),F(oe.$$.fragment),X=B(),F(de.$$.fragment)},m(x,me){y(x,e,me),H(n,e,null),T(e,i),H(l,e,null),T(e,r),H(s,e,null),T(e,o),H(a,e,null),T(e,u),H(f,e,null),T(e,c),H(d,e,null),T(e,h),H(g,e,null),T(e,_),H(v,e,null),T(e,S),H(A,e,null),T(e,C),H(I,e,null),T(e,M),H(L,e,null),T(e,N),H(z,e,null),T(e,W),H(D,e,null),T(e,G),H($,e,null),T(e,j),H(Q,e,null),T(e,le),H(oe,e,null),y(x,X,me),H(de,x,me),re=!0},p(x,me){const ee={};me&524288&&(ee.$$scope={dirty:me,ctx:x}),f.$set(ee);const ke={};me&524288&&(ke.$$scope={dirty:me,ctx:x}),d.$set(ke);const pe={};me&524288&&(pe.$$scope={dirty:me,ctx:x}),g.$set(pe);const Fe={};me&524288&&(Fe.$$scope={dirty:me,ctx:x}),v.$set(Fe);const Ve={};me&524288&&(Ve.$$scope={dirty:me,ctx:x}),A.$set(Ve);const Ee={};me&524288&&(Ee.$$scope={dirty:me,ctx:x}),I.$set(Ee);const We={};me&524288&&(We.$$scope={dirty:me,ctx:x}),L.$set(We);const ge={};me&524288&&(ge.$$scope={dirty:me,ctx:x}),z.$set(ge);const ve={};me&524288&&(ve.$$scope={dirty:me,ctx:x}),D.$set(ve);const be={};me&524288&&(be.$$scope={dirty:me,ctx:x}),$.$set(be);const ue={};me&524288&&(ue.$$scope={dirty:me,ctx:x}),Q.$set(ue)},i(x){re||(b(n.$$.fragment,x),b(l.$$.fragment,x),b(s.$$.fragment,x),b(a.$$.fragment,x),b(f.$$.fragment,x),b(d.$$.fragment,x),b(g.$$.fragment,x),b(v.$$.fragment,x),b(A.$$.fragment,x),b(I.$$.fragment,x),b(L.$$.fragment,x),b(z.$$.fragment,x),b(D.$$.fragment,x),b($.$$.fragment,x),b(Q.$$.fragment,x),b(oe.$$.fragment,x),b(de.$$.fragment,x),re=!0)},o(x){k(n.$$.fragment,x),k(l.$$.fragment,x),k(s.$$.fragment,x),k(a.$$.fragment,x),k(f.$$.fragment,x),k(d.$$.fragment,x),k(g.$$.fragment,x),k(v.$$.fragment,x),k(A.$$.fragment,x),k(I.$$.fragment,x),k(L.$$.fragment,x),k(z.$$.fragment,x),k(D.$$.fragment,x),k($.$$.fragment,x),k(Q.$$.fragment,x),k(oe.$$.fragment,x),k(de.$$.fragment,x),re=!1},d(x){x&&(w(e),w(X)),U(n),U(l),U(s),U(a),U(f),U(d),U(g),U(v),U(A),U(I),U(L),U(z),U(D),U($),U(Q),U(oe),U(de,x)}}}function zbe(t){let e;return{c(){e=q("Loading...")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function Hbe(t){let e,n,i={ctx:t,current:null,token:null,hasCatch:!0,pending:zbe,then:wbe,catch:kbe,error:18,blocks:[,,,]};return Nm(t[4],i),{c(){e=qe(),i.block.c()},m(l,r){y(l,e,r),i.block.m(l,i.anchor=r),i.mount=()=>e.parentNode,i.anchor=e,n=!0},p(l,r){t=l,vT(i,t,r)},i(l){n||(b(i.block),n=!0)},o(l){for(let r=0;r<3;r+=1){const s=i.blocks[r];k(s)}n=!1},d(l){l&&w(e),i.block.d(l),i.token=null,i=null}}}function Ube(t){let e,n;return e=new yW({props:{url:t[0],basepath:ni(),$$slots:{default:[Hbe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&1&&(r.url=i[0]),l&524302&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Fbe(t,e,n){let i,l;Mt(t,An,M=>n(13,l=M));let{url:r=""}=e,s=!1;async function o(){return mY("en",()=>yI(()=>import("./en-1d19a117.js"),[])),await Promise.allSettled([wY({initialLocale:"en",fallbackLocale:"en"})]),n(6,s=!0),!0}const a=o();let u=!1,f=!1,c=!1,d=!1,h=!1,g=!1,_=!1,v=!1;function S(){g||(n(1,_=!1),n(10,g=!0),fetch(ni()+"/api/setup/status").then(M=>{if(!M.ok)throw new Error("setup status failed");return M.json()}).then(M=>{n(11,v=!M.complete),n(9,h=!0),v&&(An.logout(),Vi("/setup"))}).catch(()=>{n(1,_=!0)}).finally(()=>n(10,g=!1)))}function A(M){u=M,n(2,u)}function C(M){f=M,n(3,f)}function I(M){u=M,n(2,u)}return t.$$set=M=>{"url"in M&&n(0,r=M.url)},t.$$.update=()=>{t.$$.dirty&8192&&n(12,i=l.api.loggedIn),t.$$.dirty&16322&&s&&(!h&&!g&&!_&&S(),h&&!v&&!c&&!d&&(n(8,d=!0),l.api.verifyToken().then(M=>{n(7,c=!0),M?An.refresh():h&&!v&&Vi("/login")}).finally(()=>n(8,d=!1))),h&&c&&!v&&!i&&Vi("/login"))},[r,_,u,f,a,S,s,c,d,h,g,v,i,l,A,C,I]}class Gbe extends De{constructor(e){super(),Re(this,e,Fbe,Ube,Ie,{url:0})}}new Gbe({target:document.getElementById("app")})});export default Vbe(); + link devices.`,G=B(),mt&&mt.c(),$=B(),we&&we.c(),j=B(),le.c(),oe=B(),X=R("h5"),X.textContent="Identity",de=B(),F(re.$$.fragment),x=B(),me=R("h5"),me.textContent="Discovery",ee=B(),F(ke.$$.fragment),pe=B(),Fe=R("h5"),Fe.textContent="Recent activity (decision history)",Ve=B(),We.c(),ge=B(),Ce&&Ce.c(),ve=B(),be=R("p"),be.innerHTML=`View full decision history`,wt(l,"margin-top","1.5rem"),wt(l,"margin-bottom","0.5rem"),P(s,"class","section-note svelte-12fp22s"),P(c,"class","assignment-select svelte-12fp22s"),P(f,"class","assignment-row svelte-12fp22s"),wt(S,"margin-top","1.5rem"),wt(S,"margin-bottom","0.5rem"),wt(L,"margin-top","1.5rem"),wt(L,"margin-bottom","0.5rem"),P(z,"class","section-note svelte-12fp22s"),P(D,"class","section-note svelte-12fp22s"),wt(X,"margin-top","1.5rem"),wt(X,"margin-bottom","0.5rem"),wt(me,"margin-top","1.5rem"),wt(me,"margin-bottom","0.5rem"),wt(Fe,"margin-top","1.5rem"),wt(Fe,"margin-bottom","0.5rem"),P(be,"class","section-note svelte-12fp22s")},m(se,Le){nt&&nt.m(se,Le),y(se,e,Le),H(n,se,Le),y(se,i,Le),y(se,l,Le),y(se,r,Le),y(se,s,Le),y(se,o,Le),Oe&&Oe.m(se,Le),y(se,a,Le),dt&&dt.m(se,Le),y(se,u,Le),y(se,f,Le),T(f,c),H(d,c,null),T(f,g),H(_,f,null),y(se,v,Le),y(se,S,Le),y(se,A,Le),~C&&At[C].m(se,Le),y(se,M,Le),y(se,L,Le),y(se,N,Le),y(se,z,Le),y(se,W,Le),y(se,D,Le),y(se,G,Le),mt&&mt.m(se,Le),y(se,$,Le),we&&we.m(se,Le),y(se,j,Le),It[Q].m(se,Le),y(se,oe,Le),y(se,X,Le),y(se,de,Le),H(re,se,Le),y(se,x,Le),y(se,me,Le),y(se,ee,Le),H(ke,se,Le),y(se,pe,Le),y(se,Fe,Le),y(se,Ve,Le),qt[Ee].m(se,Le),y(se,ge,Le),Ce&&Ce.m(se,Le),y(se,ve,Le),y(se,be,Le),ue=!0},p(se,Le){se[6]?nt?nt.p(se,Le):(nt=a5(se),nt.c(),nt.m(e.parentNode,e)):nt&&(nt.d(1),nt=null);const _t={};Le[0]&28|Le[2]&268435456&&(_t.$$scope={dirty:Le,ctx:se}),n.$set(_t),se[13]?Oe?Oe.p(se,Le):(Oe=u5(se),Oe.c(),Oe.m(a.parentNode,a)):Oe&&(Oe.d(1),Oe=null),se[14]?dt||(dt=f5(),dt.c(),dt.m(u.parentNode,u)):dt&&(dt.d(1),dt=null);const zt={};Le[0]&4096&&(zt.disabled=se[12]),Le[0]&1024|Le[2]&268435456&&(zt.$$scope={dirty:Le,ctx:se}),!h&&Le[0]&2048&&(h=!0,zt.selected=se[11],jt(()=>h=!1)),d.$set(zt);const Be={};Le[0]&4096&&(Be.disabled=se[12]),Le[0]&4096|Le[2]&268435456&&(Be.$$scope={dirty:Le,ctx:se}),_.$set(Be);let Ot=C;C=xe(se),C===Ot?~C&&At[C].p(se,Le):(I&&(fe(),k(At[Ot],1,1,()=>{At[Ot]=null}),ce()),~C?(I=At[C],I?I.p(se,Le):(I=At[C]=ut[C](se),I.c()),b(I,1),I.m(M.parentNode,M)):I=null),se[22]?mt?mt.p(se,Le):(mt=g5(se),mt.c(),mt.m($.parentNode,$)):mt&&(mt.d(1),mt=null),se[23]?we?we.p(se,Le):(we=_5(se),we.c(),we.m(j.parentNode,j)):we&&(we.d(1),we=null);let kt=Q;Q=Ht(se),Q===kt?It[Q].p(se,Le):(fe(),k(It[kt],1,1,()=>{It[kt]=null}),ce(),le=It[Q],le?le.p(se,Le):(le=It[Q]=gt[Q](se),le.c()),b(le,1),le.m(oe.parentNode,oe));const Pt={};Le[0]&129|Le[2]&268435456&&(Pt.$$scope={dirty:Le,ctx:se}),re.$set(Pt);const Ye={};Le[0]&1|Le[2]&268435456&&(Ye.$$scope={dirty:Le,ctx:se}),ke.$set(Ye);let ze=Ee;Ee=Xt(se),Ee===ze?qt[Ee].p(se,Le):(fe(),k(qt[ze],1,1,()=>{qt[ze]=null}),ce(),We=qt[Ee],We?We.p(se,Le):(We=qt[Ee]=Wt[Ee](se),We.c()),b(We,1),We.m(ge.parentNode,ge)),se[26]?Ce?Ce.p(se,Le):(Ce=K5(se),Ce.c(),Ce.m(ve.parentNode,ve)):Ce&&(Ce.d(1),Ce=null)},i(se){ue||(b(n.$$.fragment,se),b(d.$$.fragment,se),b(_.$$.fragment,se),b(I),b(le),b(re.$$.fragment,se),b(ke.$$.fragment,se),b(We),ue=!0)},o(se){k(n.$$.fragment,se),k(d.$$.fragment,se),k(_.$$.fragment,se),k(I),k(le),k(re.$$.fragment,se),k(ke.$$.fragment,se),k(We),ue=!1},d(se){se&&(w(e),w(i),w(l),w(r),w(s),w(o),w(a),w(u),w(f),w(v),w(S),w(A),w(M),w(L),w(N),w(z),w(W),w(D),w(G),w($),w(j),w(oe),w(X),w(de),w(x),w(me),w(ee),w(pe),w(Fe),w(Ve),w(ge),w(ve),w(be)),nt&&nt.d(se),U(n,se),Oe&&Oe.d(se),dt&&dt.d(se),U(d),U(_),~C&&At[C].d(se),mt&&mt.d(se),we&&we.d(se),It[Q].d(se),U(re,se),U(ke,se),qt[Ee].d(se),Ce&&Ce.d(se)}}}function Upe(t){var o;let e,n,i,l,r,s;return e=new Ru({props:{title:"Device Details",label:((o=t[0])==null?void 0:o.display_name)||"Unknown Device"}}),i=new Du({props:{hasForm:!0,$$slots:{default:[Hpe]},$$scope:{ctx:t}}}),r=new Pu({props:{primaryButtonText:t[5]?"Saving...":"Save",primaryButtonDisabled:t[5],secondaryButtonText:"Cancel"}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(a,u){H(e,a,u),y(a,n,u),H(i,a,u),y(a,l,u),H(r,a,u),s=!0},p(a,u){var h;const f={};u[0]&1&&(f.label=((h=a[0])==null?void 0:h.display_name)||"Unknown Device"),e.$set(f);const c={};u[0]&268435421|u[2]&268435456&&(c.$$scope={dirty:u,ctx:a}),i.$set(c);const d={};u[0]&32&&(d.primaryButtonText=a[5]?"Saving...":"Save"),u[0]&32&&(d.primaryButtonDisabled=a[5]),r.$set(d)},i(a){s||(b(e.$$.fragment,a),b(i.$$.fragment,a),b(r.$$.fragment,a),s=!0)},o(a){k(e.$$.fragment,a),k(i.$$.fragment,a),k(r.$$.fragment,a),s=!1},d(a){a&&(w(n),w(l)),U(e,a),U(i,a),U(r,a)}}}function Fpe(t){let e,n;return e=new Iu({props:{open:t[1],size:"lg",$$slots:{default:[Upe]},$$scope:{ctx:t}}}),e.$on("close",t[33]),e.$on("submit",t[31]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l[0]&2&&(r.open=i[1]),l[0]&268435453|l[2]&268435456&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Gpe(){return localStorage.getItem("jwt")||""}function gs(t){const e={Authorization:"Bearer "+Gpe()};return t&&(e["Content-Type"]="application/json"),e}async function _s(t){const e=await t.text();try{const n=JSON.parse(e);if(n&&n.error)return n.error}catch{}return e||"Request failed ("+t.status+")"}function $5(t){return t==="connected"?"success":t==="degraded"||t==="connecting"?"warning":t==="unavailable"||t==="stopped"?"error":"info"}function J5(t){return t==="connected"?"Tailscale connected":t==="degraded"?"Tailscale data degraded":t==="unavailable"?"Tailscale unavailable":t==="connecting"?"Tailscale connecting":t==="disabled"?"Tailscale disabled":"Tailscale status"}function so(t){return t.name||t.dns_name||t.node_id}function Ts(t){return t?new Date(t).toLocaleString():"—"}function Q5(t){return t?new Date(t*1e3).toLocaleString():"—"}function x5(t){switch(t){case"high":return"green";case"medium":return"teal";case"low":return"magenta";default:return"red"}}function eT(t){switch(t){case"high":return"High confidence";case"medium":return"Medium confidence";case"low":return"Low confidence";default:return"No protection signal"}}function tT(t){var n,i,l;if(!t)return"";const e=[];return(n=t.blocked_categories)!=null&&n.length&&e.push(t.blocked_categories.length+" blocked categor"+(t.blocked_categories.length===1?"y":"ies")),(i=t.blocked_domains)!=null&&i.length&&e.push(t.blocked_domains.length+" blocked domain"+(t.blocked_domains.length===1?"":"s")),(l=t.allowed_domains)!=null&&l.length&&e.push(t.allowed_domains.length+" allowed domain"+(t.allowed_domains.length===1?"":"s")),t.rule_count&&e.push(t.rule_count+" rule"+(t.rule_count===1?"":"s")),t.safe_search&&e.push("safe search"),e.length?e.join(", "):"blocks nothing of its own"}const nT=t=>t.id!=="default";function Vpe(t,e,n){const i=ni()+"/api/devices",l=ni()+"/api/policy",r=ni()+"/api/tailscale",s=yn();let{device:o}=e,{open:a=!1}=e,u=(o==null?void 0:o.manual_name)||"",f=(o==null?void 0:o.owner)||"",c=(o==null?void 0:o.category)||"",d=!1,h="",g=null,_=!1,v="",S=[],A="",C=!1,I="",M=!1,L=[],N=null,z=(o==null?void 0:o.tailscale_nodes)||[],W=[],D="",G=!1,$=!1,j=!1,Q="",le="",oe=[],X=!1,de="",re=!1,x=null,me=null,ee=!1,ke=!1,pe="";async function Fe(){var xe;n(8,_=!0),n(9,v="");try{const mt=await fetch(i+"/"+o.id+"/policy",{headers:gs(!1)});if(!mt.ok)throw new Error(await _s(mt));n(7,g=await mt.json()),n(11,A=((xe=g==null?void 0:g.assignment)==null?void 0:xe.id)||"")}catch(mt){n(9,v=mt.message)}finally{n(8,_=!1)}}async function Ve(){try{const xe=await fetch(l+"/groups",{headers:gs(!1)});if(!xe.ok)throw new Error(await _s(xe));const mt=await xe.json();n(10,S=mt.groups||[])}catch(xe){n(9,v=v||xe.message)}}async function Ee(){n(19,G=!0),n(22,Q="");try{const xe=await fetch(r+"/peers",{headers:gs(!1)});if(!xe.ok)throw new Error(await _s(xe));const mt=await xe.json();n(15,N=mt),n(34,L=mt.state==="connected"?mt.peers||[]:[]),mt.state==="connected"&&n(16,z=L.filter(we=>we.mapped_device_id===o.id)),n(20,$=!0)}catch(xe){n(15,N=null),n(34,L=[]),n(22,Q=xe instanceof Error?xe.message:"Tailscale peers failed")}finally{n(19,G=!1)}}async function We(){if(D){n(21,j=!0),n(22,Q=""),n(23,le="");try{const xe=await fetch(i+"/"+o.id+"/tailscale",{method:"PUT",headers:gs(!0),body:JSON.stringify({node_id:D})});if(!xe.ok)throw new Error(await _s(xe));n(18,D=""),n(23,le="Tailscale peer linked."),await Ee(),s("tailscaleChanged")}catch(xe){n(22,Q=xe.message)}finally{n(21,j=!1)}}}async function ge(xe,mt){if(confirm(`Unlink Tailscale peer "${mt||xe}" from this device?`)){n(21,j=!0),n(22,Q=""),n(23,le="");try{const we=await fetch(i+"/"+o.id+"/tailscale/"+encodeURIComponent(xe),{method:"DELETE",headers:gs(!1)});if(!we.ok)throw new Error(await _s(we));n(16,z=z.filter(gt=>gt.node_id!==xe)),n(23,le="Tailscale peer unlinked."),await Ee(),s("tailscaleChanged")}catch(we){n(22,Q=we.message)}finally{n(21,j=!1)}}}async function ve(){if(!(ee||ke)){ee=!0,n(25,X=!re),n(26,de=""),me=new AbortController;try{const xe=await fetch(i+"/"+o.id+"/activity?since=86400&limit=100",{headers:gs(!1),signal:me.signal});if(!xe.ok)throw new Error(await _s(xe));const mt=await xe.json();ke||(n(24,oe=mt.items||[]),n(27,re=!0))}catch(xe){!ke&&(xe==null?void 0:xe.name)!=="AbortError"&&n(26,de=xe.message)}finally{ee=!1,n(25,X=!1),me=null,ke||(x=setTimeout(ve,5e3))}}}async function be(){n(5,d=!0),n(6,h="");try{const xe=await fetch(i+"/"+o.id+"/name",{method:"POST",headers:gs(!0),body:JSON.stringify({name:u,owner:f,category:c})});if(!xe.ok)throw new Error(await _s(xe));s("saved")}catch(xe){n(6,h=xe.message)}finally{n(5,d=!1)}}async function ue(){n(12,C=!0),n(13,I=""),n(14,M=!1);try{const xe=await fetch(i+"/"+o.id+"/assignment",{method:"PUT",headers:gs(!0),body:JSON.stringify({group_id:A})});if(!xe.ok)throw new Error(await _s(xe));await Fe(),n(14,M=!0),s("saved")}catch(xe){n(13,I=xe.message)}finally{n(12,C=!1)}}Es(()=>{ke=!0,x&&clearTimeout(x),me==null||me.abort()});function nt(){s("close")}function Oe(xe){u=xe,n(2,u)}function dt(xe){f=xe,n(3,f)}function yt(xe){c=xe,n(4,c)}function at(xe){A=xe,n(11,A)}const ut=xe=>ge(xe.node_id,so(xe));function At(xe){D=xe,n(18,D)}return t.$$set=xe=>{"device"in xe&&n(0,o=xe.device),"open"in xe&&n(1,a=xe.open)},t.$$.update=()=>{t.$$.dirty[1]&8&&n(17,W=L.filter(xe=>!xe.mapped_device_id)),t.$$.dirty[0]&3|t.$$.dirty[1]&16&&a&&o!=null&&o.id&&pe!==o.id&&(n(35,pe=o.id),Fe(),Ve(),Ee(),ve())},[o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,N,z,W,D,G,$,j,Q,le,oe,X,de,re,Ee,We,ge,be,ue,nt,L,pe,Oe,dt,yt,at,ut,At]}class Wpe extends De{constructor(e){super(),Re(this,e,Vpe,Fpe,Ie,{device:0,open:1},null,[-1,-1,-1])}}const{Boolean:qpe}=gT;function iT(t,e,n){const i=t.slice();return i[24]=e[n],i}function lT(t){let e,n;return e=new xi({props:{kind:"error",title:"Error",subtitle:t[2]}}),e.$on("close",t[11]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&4&&(r.subtitle=i[2]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function rT(t){let e,n;return e=new xi({props:{kind:"success",title:"Success",subtitle:t[3]}}),e.$on("close",t[12]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8&&(r.subtitle=i[3]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function jpe(t){let e,n,i,l=t[0].length+"",r,s,o=t[0].length!==1?"s":"",a,u,f=t[0].filter(fT).length+"",c,d,h;return e=new Ol({props:{sortable:!0,title:"Device Inventory",description:"Devices discovered on your network, including explicitly linked Tailscale peers.",headers:t[6],rows:t[0],$$slots:{cell:[abe,({row:g,cell:_})=>({22:g,23:_}),({row:g,cell:_})=>(g?4194304:0)|(_?8388608:0)],default:[Kpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),i=R("div"),r=q(l),s=q(" device"),a=q(o),u=q(" discovered · "),c=q(f),d=q(" online"),P(i,"class","device-summary svelte-smv1h4")},m(g,_){H(e,g,_),y(g,n,_),y(g,i,_),T(i,r),T(i,s),T(i,a),T(i,u),T(i,c),T(i,d),h=!0},p(g,_){const v={};_&1&&(v.rows=g[0]),_&146800640&&(v.$$scope={dirty:_,ctx:g}),e.$set(v),(!h||_&1)&&l!==(l=g[0].length+"")&&Z(r,l),(!h||_&1)&&o!==(o=g[0].length!==1?"s":"")&&Z(a,o),(!h||_&1)&&f!==(f=g[0].filter(fT).length+"")&&Z(c,f)},i(g){h||(b(e.$$.fragment,g),h=!0)},o(g){k(e.$$.fragment,g),h=!1},d(g){g&&(w(n),w(i)),U(e,g)}}}function Ype(t){let e,n;return e=new oo({props:{description:"Loading devices..."}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Zpe(t){let e,n,i,l;return e=new IT({props:{persistent:!0,shouldFilterRows:!0,placeholder:"Search devices..."}}),i=new Rt({props:{kind:"ghost",icon:_q,iconDescription:"Refresh"}}),i.$on("click",t[7]),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p:he,i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function Xpe(t){let e,n;return e=new X1({props:{$$slots:{default:[Zpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&134217728&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Kpe(t){let e,n;return e=new Z1({props:{$$slots:{default:[Xpe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&134217728&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function $pe(t){let e=(t[23].value||"—")+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&8388608&&e!==(e=(i[23].value||"—")+"")&&Z(n,e)},i:he,o:he,d(i){i&&w(n)}}}function Jpe(t){let e,n;return e=new FB({props:{flipped:!0,$$slots:{default:[nbe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&138412032&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Qpe(t){let e,n;return e=new Vt({props:{size:"sm",type:t[23].value==="ddns"?"green":t[23].value==="mdns"?"blue":t[23].value==="passive"?"warm-gray":t[23].value==="manual"?"purple":"gray",$$slots:{default:[ibe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&8388608&&(r.type=i[23].value==="ddns"?"green":i[23].value==="mdns"?"blue":i[23].value==="passive"?"warm-gray":i[23].value==="manual"?"purple":"gray"),l&142606336&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function xpe(t){let e,n,i,l;const r=[rbe,lbe],s=[];function o(a,u){var f;return(f=a[22].tailscale_nodes)!=null&&f.length?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function ebe(t){let e,n=t[23].value+"",i,l,r,s,o,a;function u(){return t[13](t[22])}let f=!t[22].manual_name&&t[22].source!=="manual"&&oT(t);return{c(){e=R("button"),i=q(n),l=B(),f&&f.c(),r=qe(),P(e,"class","device-name-link svelte-smv1h4")},m(c,d){y(c,e,d),T(e,i),y(c,l,d),f&&f.m(c,d),y(c,r,d),s=!0,o||(a=J(e,"click",u),o=!0)},p(c,d){t=c,(!s||d&8388608)&&n!==(n=t[23].value+"")&&Z(i,n),!t[22].manual_name&&t[22].source!=="manual"?f?d&4194304&&b(f,1):(f=oT(t),f.c(),b(f,1),f.m(r.parentNode,r)):f&&(fe(),k(f,1,1,()=>{f=null}),ce())},i(c){s||(b(f),s=!0)},o(c){k(f),s=!1},d(c){c&&(w(e),w(l),w(r)),f&&f.d(c),o=!1,a()}}}function tbe(t){let e,n,i;return{c(){e=R("span"),P(e,"class",n="status-dot "+(t[22].online?"online":"offline")+" svelte-smv1h4"),P(e,"title",i=t[22].online?"Online":"Offline")},m(l,r){y(l,e,r)},p(l,r){r&4194304&&n!==(n="status-dot "+(l[22].online?"online":"offline")+" svelte-smv1h4")&&P(e,"class",n),r&4194304&&i!==(i=l[22].online?"Online":"Offline")&&P(e,"title",i)},i:he,o:he,d(l){l&&w(e)}}}function nbe(t){let e,n,i,l,r,s;function o(){return t[14](t[22])}e=new Xh({props:{text:"Edit / Name"}}),e.$on("click",o);function a(){return t[15](t[22])}i=new Xh({props:{text:"Manage Tailscale links"}}),i.$on("click",a);function u(){return t[16](t[22])}return r=new Xh({props:{danger:!0,text:"Remove"}}),r.$on("click",u),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment),l=B(),F(r.$$.fragment)},m(f,c){H(e,f,c),y(f,n,c),H(i,f,c),y(f,l,c),H(r,f,c),s=!0},p(f,c){t=f},i(f){s||(b(e.$$.fragment,f),b(i.$$.fragment,f),b(r.$$.fragment,f),s=!0)},o(f){k(e.$$.fragment,f),k(i.$$.fragment,f),k(r.$$.fragment,f),s=!1},d(f){f&&(w(n),w(l)),U(e,f),U(i,f),U(r,f)}}}function ibe(t){let e=t[23].value+"",n;return{c(){n=q(e)},m(i,l){y(i,n,l)},p(i,l){l&8388608&&e!==(e=i[23].value+"")&&Z(n,e)},d(i){i&&w(n)}}}function lbe(t){let e;return{c(){e=q("—")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function rbe(t){let e,n,i=ct(t[22].tailscale_nodes),l=[];for(let s=0;sk(l[s],1,1,()=>{l[s]=null});return{c(){e=R("div");for(let s=0;s{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function aT(t){let e,n;return e=new Wpe({props:{device:t[4],open:t[5]}}),e.$on("close",t[17]),e.$on("saved",t[9]),e.$on("tailscaleChanged",t[7]),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&16&&(r.device=i[4]),l&32&&(r.open=i[5]),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function ube(t){let e,n,i,l,r,s,o,a=t[2]&&lT(t),u=t[3]&&rT(t);const f=[Ype,jpe],c=[];function d(g,_){return g[1]&&g[0].length===0?0:1}i=d(t),l=c[i]=f[i](t);let h=t[5]&&t[4]&&aT(t);return{c(){a&&a.c(),e=B(),u&&u.c(),n=B(),l.c(),r=B(),h&&h.c(),s=qe()},m(g,_){a&&a.m(g,_),y(g,e,_),u&&u.m(g,_),y(g,n,_),c[i].m(g,_),y(g,r,_),h&&h.m(g,_),y(g,s,_),o=!0},p(g,[_]){g[2]?a?(a.p(g,_),_&4&&b(a,1)):(a=lT(g),a.c(),b(a,1),a.m(e.parentNode,e)):a&&(fe(),k(a,1,1,()=>{a=null}),ce()),g[3]?u?(u.p(g,_),_&8&&b(u,1)):(u=rT(g),u.c(),b(u,1),u.m(n.parentNode,n)):u&&(fe(),k(u,1,1,()=>{u=null}),ce());let v=i;i=d(g),i===v?c[i].p(g,_):(fe(),k(c[v],1,1,()=>{c[v]=null}),ce(),l=c[i],l?l.p(g,_):(l=c[i]=f[i](g),l.c()),b(l,1),l.m(r.parentNode,r)),g[5]&&g[4]?h?(h.p(g,_),_&48&&b(h,1)):(h=aT(g),h.c(),b(h,1),h.m(s.parentNode,s)):h&&(fe(),k(h,1,1,()=>{h=null}),ce())},i(g){o||(b(a),b(u),b(l),b(h),o=!0)},o(g){k(a),k(u),k(l),k(h),o=!1},d(g){g&&(w(e),w(n),w(r),w(s)),a&&a.d(g),u&&u.d(g),c[i].d(g),h&&h.d(g)}}}function uT(){return localStorage.getItem("jwt")||""}function fbe(t){var l,r;const e=(t.tailscale_nodes||[]).flatMap(s=>s.addresses||[]),n=Array.from(new Set([t.ipv4,...e.filter(s=>s.includes("."))])).filter(Boolean),i=Array.from(new Set([t.ipv6,...e.filter(s=>s.includes(":"))])).filter(Boolean);return{...t,id:t.id,status:t.online?"online":"offline",display_name:t.manual_name||t.display_name||t.dns_name||"Unknown",ipv4_display:n.join(", "),ipv6_display:i.join(", "),macs_display:(l=t.macs)!=null&&l.length?t.macs[0]:"—",tailscale_display:(r=t.tailscale_nodes)!=null&&r.length?t.tailscale_nodes.map(s=>s.name||s.dns_name).join(", "):"—",last_seen_display:cbe(t.last_seen)}}function cbe(t){if(!t)return"Never";const e=new Date(t),i=new Date().getTime()-e.getTime(),l=Math.floor(i/1e3);if(l<60)return"Just now";const r=Math.floor(l/60);if(r<60)return`${r}m ago`;const s=Math.floor(r/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`}const fT=t=>t.online;function dbe(t,e,n){const i=ni()+"/api/devices";let l=[],r=!1,s="",o="",a=null,u=!1,f;const c=[{key:"status",value:"Status"},{key:"display_name",value:"Name"},{key:"dns_name",value:"DNS Name"},{key:"tailscale_display",value:"Tailscale"},{key:"ipv4_display",value:"IPv4"},{key:"ipv6_display",value:"IPv6"},{key:"macs_display",value:"MAC"},{key:"source",value:"Via"},{key:"last_seen_display",value:"Last Seen"},{key:"actions",value:""}];async function d(){n(1,r=!0),n(2,s="");try{const W=uT();if(!W)throw new Error("Please login first to view devices");const D=await fetch(i,{headers:{Authorization:`Bearer ${W}`}});if(D.status===401)throw new Error("Authentication failed. Please login again");if(D.status===503){n(0,l=[]);return}if(!D.ok){const $=await D.text();throw new Error(`Failed to load devices: ${D.status} - ${$}`)}const G=await D.json();n(0,l=(G.devices||[]).map(fbe))}catch(W){n(2,s=W.message)}finally{n(1,r=!1)}}function h(W){n(4,a=W),n(5,u=!0)}function g(W){h(W)}async function _(){n(5,u=!1),n(4,a=null),n(3,o="Device updated successfully"),setTimeout(()=>n(3,o=""),3e3),await d()}function v(W){return S(W)}async function S(W){if(confirm(`Remove "${W.display_name}" from the inventory?`))try{const D=uT(),G=await fetch(`${i}/${W.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${D}`}});if(!G.ok){const $=await G.text();throw new Error(`Failed to remove device: ${$}`)}n(3,o=`"${W.display_name}" removed`),setTimeout(()=>n(3,o=""),3e3),await d()}catch(D){n(2,s=D.message)}}return _n(()=>{d(),f=setInterval(d,3e4)}),Es(()=>{f&&clearInterval(f)}),[l,r,s,o,a,u,c,d,g,_,v,()=>n(2,s=""),()=>n(3,o=""),W=>g(W),W=>g(W),W=>g(W),W=>v(W),()=>{n(5,u=!1),n(4,a=null)}]}class hbe extends De{constructor(e){super(),Re(this,e,dbe,ube,Ie,{})}}function mbe(t){let e;return{c(){e=q("Dashboard")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function gbe(t){let e;return{c(){e=q("Devices")},m(n,i){y(n,e,i)},d(n){n&&w(e)}}}function _be(t){let e,n,i,l;return e=new Si({props:{href:"/",$$slots:{default:[mbe]},$$scope:{ctx:t}}}),i=new Si({props:{$$slots:{default:[gbe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),F(i.$$.fragment)},m(r,s){H(e,r,s),y(r,n,s),H(i,r,s),l=!0},p(r,s){const o={};s&1&&(o.$$scope={dirty:s,ctx:r}),e.$set(o);const a={};s&1&&(a.$$scope={dirty:s,ctx:r}),i.$set(a)},i(r){l||(b(e.$$.fragment,r),b(i.$$.fragment,r),l=!0)},o(r){k(e.$$.fragment,r),k(i.$$.fragment,r),l=!1},d(r){r&&w(n),U(e,r),U(i,r)}}}function pbe(t){let e,n;return e=new hbe({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function bbe(t){let e,n;return e=new zn({props:{$$slots:{default:[pbe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,l){const r={};l&1&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function vbe(t){let e,n,i,l,r,s,o,a;return e=new Kr({props:{style:"margin-bottom: 10px;",$$slots:{default:[_be]},$$scope:{ctx:t}}}),o=new dl({props:{$$slots:{default:[bbe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),n=B(),i=R("h2"),i.textContent="Network Devices",l=B(),r=R("br"),s=B(),F(o.$$.fragment)},m(u,f){H(e,u,f),y(u,n,f),y(u,i,f),y(u,l,f),y(u,r,f),y(u,s,f),H(o,u,f),a=!0},p(u,[f]){const c={};f&1&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};f&1&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(b(e.$$.fragment,u),b(o.$$.fragment,u),a=!0)},o(u){k(e.$$.fragment,u),k(o.$$.fragment,u),a=!1},d(u){u&&(w(n),w(i),w(l),w(r),w(s)),U(e,u),U(o,u)}}}class kbe extends De{constructor(e){super(),Re(this,e,null,vbe,Ie,{})}}function wbe(t){let e;return{c(){e=q("Error: Unable to load localization.")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function ybe(t){let e,n,i,l;const r=[Sbe,Tbe],s=[];function o(a,u){return a[1]?0:1}return e=o(t),n=s[e]=r[e](t),{c(){n.c(),i=qe()},m(a,u){s[e].m(a,u),y(a,i,u),l=!0},p(a,u){let f=e;e=o(a),e===f?s[e].p(a,u):(fe(),k(s[f],1,1,()=>{s[f]=null}),ce(),n=s[e],n?n.p(a,u):(n=s[e]=r[e](a),n.c()),b(n,1),n.m(i.parentNode,i))},i(a){l||(b(n),l=!0)},o(a){k(n),l=!1},d(a){a&&w(i),s[e].d(a)}}}function Tbe(t){let e,n,i,l,r,s,o,a,u;function f(_){t[14](_)}function c(_){t[15](_)}let d={};t[2]!==void 0&&(d.isSideNavOpen=t[2]),t[3]!==void 0&&(d.userProfilePanelOpen=t[3]),e=new _0e({props:d}),ft.push(()=>Yt(e,"isSideNavOpen",f)),ft.push(()=>Yt(e,"userProfilePanelOpen",c));function h(_){t[16](_)}let g={rail:!0,$$slots:{default:[Ebe]},$$scope:{ctx:t}};return t[2]!==void 0&&(g.isOpen=t[2]),r=new EV({props:g}),ft.push(()=>Yt(r,"isOpen",h)),a=new jV({props:{$$slots:{default:[zbe]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment),l=B(),F(r.$$.fragment),o=B(),F(a.$$.fragment)},m(_,v){H(e,_,v),y(_,l,v),H(r,_,v),y(_,o,v),H(a,_,v),u=!0},p(_,v){const S={};!n&&v&4&&(n=!0,S.isSideNavOpen=_[2],jt(()=>n=!1)),!i&&v&8&&(i=!0,S.userProfilePanelOpen=_[3],jt(()=>i=!1)),e.$set(S);const A={};v&524288&&(A.$$scope={dirty:v,ctx:_}),!s&&v&4&&(s=!0,A.isOpen=_[2],jt(()=>s=!1)),r.$set(A);const C={};v&524288&&(C.$$scope={dirty:v,ctx:_}),a.$set(C)},i(_){u||(b(e.$$.fragment,_),b(r.$$.fragment,_),b(a.$$.fragment,_),u=!0)},o(_){k(e.$$.fragment,_),k(r.$$.fragment,_),k(a.$$.fragment,_),u=!1},d(_){_&&(w(l),w(o)),U(e,_),U(r,_),U(a,_)}}}function Sbe(t){let e,n,i,l,r,s;return{c(){e=R("main"),n=R("p"),n.textContent="Unable to read GateSentry setup status.",i=B(),l=R("button"),l.textContent="Retry status check",P(n,"role","alert"),P(n,"class","svelte-1dqpn31"),P(l,"type","button"),P(e,"class","setup-status-error svelte-1dqpn31")},m(o,a){y(o,e,a),T(e,n),T(e,i),T(e,l),r||(s=J(l,"click",t[5]),r=!0)},p:he,i:he,o:he,d(o){o&&w(e),r=!1,s()}}}function Ebe(t){let e,n;return e=new QZ({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Mbe(t){let e,n;return e=new RK({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Obe(t){let e,n;return e=new pd({props:{type:"blockedkeywords"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Abe(t){let e,n;return e=new pd({props:{type:"blockedfiletypes"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Cbe(t){let e,n;return e=new pd({props:{type:"excludeurls"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Lbe(t){let e,n;return e=new pd({props:{type:"excludehosts"}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p:he,i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Ibe(t){let e,n;return e=new zK({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Rbe(t){let e,n;return e=new Wge({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Dbe(t){let e,n;return e=new kbe({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Pbe(t){let e,n;return e=new S1e({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Nbe(t){let e,n;return e=new P1e({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Bbe(t){let e,n;return e=new c0e({}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function zbe(t){let e,n,i,l,r,s,o,a,u,f,c,d,h,g,_,v,S,A,C,I,M,L,N,z,W,D,G,$,j,Q,le,oe,X,de,re;return n=new zi({props:{path:"/login",component:iZ}}),l=new zi({props:{path:"/setup",component:mZ}}),s=new zi({props:{path:"/dns",component:TJ}}),a=new zi({props:{path:"/logs",component:HZ}}),f=new zi({props:{path:"/settings",$$slots:{default:[Mbe]},$$scope:{ctx:t}}}),d=new zi({props:{path:"/blockedkeywords",$$slots:{default:[Obe]},$$scope:{ctx:t}}}),g=new zi({props:{path:"/blockedfiletypes",$$slots:{default:[Abe]},$$scope:{ctx:t}}}),v=new zi({props:{path:"/excludeurls",$$slots:{default:[Cbe]},$$scope:{ctx:t}}}),A=new zi({props:{path:"/excludehosts",$$slots:{default:[Lbe]},$$scope:{ctx:t}}}),I=new zi({props:{path:"/services",$$slots:{default:[Ibe]},$$scope:{ctx:t}}}),L=new zi({props:{path:"/rules",$$slots:{default:[Rbe]},$$scope:{ctx:t}}}),z=new zi({props:{path:"/devices",$$slots:{default:[Dbe]},$$scope:{ctx:t}}}),D=new zi({props:{path:"/stats",$$slots:{default:[Pbe]},$$scope:{ctx:t}}}),$=new zi({props:{path:"/ai",$$slots:{default:[Nbe]},$$scope:{ctx:t}}}),Q=new zi({props:{path:"/users",$$slots:{default:[Bbe]},$$scope:{ctx:t}}}),oe=new zi({props:{path:"/",component:M$}}),de=new KX({}),{c(){e=R("div"),F(n.$$.fragment),i=B(),F(l.$$.fragment),r=B(),F(s.$$.fragment),o=B(),F(a.$$.fragment),u=B(),F(f.$$.fragment),c=B(),F(d.$$.fragment),h=B(),F(g.$$.fragment),_=B(),F(v.$$.fragment),S=B(),F(A.$$.fragment),C=B(),F(I.$$.fragment),M=B(),F(L.$$.fragment),N=B(),F(z.$$.fragment),W=B(),F(D.$$.fragment),G=B(),F($.$$.fragment),j=B(),F(Q.$$.fragment),le=B(),F(oe.$$.fragment),X=B(),F(de.$$.fragment)},m(x,me){y(x,e,me),H(n,e,null),T(e,i),H(l,e,null),T(e,r),H(s,e,null),T(e,o),H(a,e,null),T(e,u),H(f,e,null),T(e,c),H(d,e,null),T(e,h),H(g,e,null),T(e,_),H(v,e,null),T(e,S),H(A,e,null),T(e,C),H(I,e,null),T(e,M),H(L,e,null),T(e,N),H(z,e,null),T(e,W),H(D,e,null),T(e,G),H($,e,null),T(e,j),H(Q,e,null),T(e,le),H(oe,e,null),y(x,X,me),H(de,x,me),re=!0},p(x,me){const ee={};me&524288&&(ee.$$scope={dirty:me,ctx:x}),f.$set(ee);const ke={};me&524288&&(ke.$$scope={dirty:me,ctx:x}),d.$set(ke);const pe={};me&524288&&(pe.$$scope={dirty:me,ctx:x}),g.$set(pe);const Fe={};me&524288&&(Fe.$$scope={dirty:me,ctx:x}),v.$set(Fe);const Ve={};me&524288&&(Ve.$$scope={dirty:me,ctx:x}),A.$set(Ve);const Ee={};me&524288&&(Ee.$$scope={dirty:me,ctx:x}),I.$set(Ee);const We={};me&524288&&(We.$$scope={dirty:me,ctx:x}),L.$set(We);const ge={};me&524288&&(ge.$$scope={dirty:me,ctx:x}),z.$set(ge);const ve={};me&524288&&(ve.$$scope={dirty:me,ctx:x}),D.$set(ve);const be={};me&524288&&(be.$$scope={dirty:me,ctx:x}),$.$set(be);const ue={};me&524288&&(ue.$$scope={dirty:me,ctx:x}),Q.$set(ue)},i(x){re||(b(n.$$.fragment,x),b(l.$$.fragment,x),b(s.$$.fragment,x),b(a.$$.fragment,x),b(f.$$.fragment,x),b(d.$$.fragment,x),b(g.$$.fragment,x),b(v.$$.fragment,x),b(A.$$.fragment,x),b(I.$$.fragment,x),b(L.$$.fragment,x),b(z.$$.fragment,x),b(D.$$.fragment,x),b($.$$.fragment,x),b(Q.$$.fragment,x),b(oe.$$.fragment,x),b(de.$$.fragment,x),re=!0)},o(x){k(n.$$.fragment,x),k(l.$$.fragment,x),k(s.$$.fragment,x),k(a.$$.fragment,x),k(f.$$.fragment,x),k(d.$$.fragment,x),k(g.$$.fragment,x),k(v.$$.fragment,x),k(A.$$.fragment,x),k(I.$$.fragment,x),k(L.$$.fragment,x),k(z.$$.fragment,x),k(D.$$.fragment,x),k($.$$.fragment,x),k(Q.$$.fragment,x),k(oe.$$.fragment,x),k(de.$$.fragment,x),re=!1},d(x){x&&(w(e),w(X)),U(n),U(l),U(s),U(a),U(f),U(d),U(g),U(v),U(A),U(I),U(L),U(z),U(D),U($),U(Q),U(oe),U(de,x)}}}function Hbe(t){let e;return{c(){e=q("Loading...")},m(n,i){y(n,e,i)},p:he,i:he,o:he,d(n){n&&w(e)}}}function Ube(t){let e,n,i={ctx:t,current:null,token:null,hasCatch:!0,pending:Hbe,then:ybe,catch:wbe,error:18,blocks:[,,,]};return Nm(t[4],i),{c(){e=qe(),i.block.c()},m(l,r){y(l,e,r),i.block.m(l,i.anchor=r),i.mount=()=>e.parentNode,i.anchor=e,n=!0},p(l,r){t=l,kT(i,t,r)},i(l){n||(b(i.block),n=!0)},o(l){for(let r=0;r<3;r+=1){const s=i.blocks[r];k(s)}n=!1},d(l){l&&w(e),i.block.d(l),i.token=null,i=null}}}function Fbe(t){let e,n;return e=new yW({props:{url:t[0],basepath:ni(),$$slots:{default:[Ube]},$$scope:{ctx:t}}}),{c(){F(e.$$.fragment)},m(i,l){H(e,i,l),n=!0},p(i,[l]){const r={};l&1&&(r.url=i[0]),l&524302&&(r.$$scope={dirty:l,ctx:i}),e.$set(r)},i(i){n||(b(e.$$.fragment,i),n=!0)},o(i){k(e.$$.fragment,i),n=!1},d(i){U(e,i)}}}function Gbe(t,e,n){let i,l;Mt(t,An,M=>n(13,l=M));let{url:r=""}=e,s=!1;async function o(){return mY("en",()=>TI(()=>import("./en-1d19a117.js"),[])),await Promise.allSettled([wY({initialLocale:"en",fallbackLocale:"en"})]),n(6,s=!0),!0}const a=o();let u=!1,f=!1,c=!1,d=!1,h=!1,g=!1,_=!1,v=!1;function S(){g||(n(1,_=!1),n(10,g=!0),fetch(ni()+"/api/setup/status").then(M=>{if(!M.ok)throw new Error("setup status failed");return M.json()}).then(M=>{n(11,v=!M.complete),n(9,h=!0),v&&(An.logout(),Vi("/setup"))}).catch(()=>{n(1,_=!0)}).finally(()=>n(10,g=!1)))}function A(M){u=M,n(2,u)}function C(M){f=M,n(3,f)}function I(M){u=M,n(2,u)}return t.$$set=M=>{"url"in M&&n(0,r=M.url)},t.$$.update=()=>{t.$$.dirty&8192&&n(12,i=l.api.loggedIn),t.$$.dirty&16322&&s&&(!h&&!g&&!_&&S(),h&&!v&&!c&&!d&&(n(8,d=!0),l.api.verifyToken().then(M=>{n(7,c=!0),M?An.refresh():h&&!v&&Vi("/login")}).finally(()=>n(8,d=!1))),h&&c&&!v&&!i&&Vi("/login"))},[r,_,u,f,a,S,s,c,d,h,g,v,i,l,A,C,I]}class Vbe extends De{constructor(e){super(),Re(this,e,Gbe,Fbe,Ie,{url:0})}}new Vbe({target:document.getElementById("app")})});export default Wbe(); diff --git a/ui/src/components/__tests__/tailscale_ui.test.ts b/ui/src/components/__tests__/tailscale_ui.test.ts index 2f4d9b47..f8b9f8e3 100644 --- a/ui/src/components/__tests__/tailscale_ui.test.ts +++ b/ui/src/components/__tests__/tailscale_ui.test.ts @@ -38,4 +38,9 @@ test("device inventory exposes linked Tailscale peers and opens link management" expect(devices).toContain("Manage Tailscale links"); expect(devices).toContain("on:tailscaleChanged={loadDevices}"); expect(devices).toContain("setInterval(loadDevices, 30000)"); + expect(devices).toContain("node.addresses || []"); + expect(devices).toContain("ipv4_display"); + expect(devices).toContain("ipv6_display"); + expect(devices).toContain('tailscaleAddresses.filter((ip) => ip.includes("."))'); + expect(devices).toContain('tailscaleAddresses.filter((ip) => ip.includes(":"))'); }); diff --git a/ui/src/routes/devices/devicelist.svelte b/ui/src/routes/devices/devicelist.svelte index e8830b42..c414dcac 100644 --- a/ui/src/routes/devices/devicelist.svelte +++ b/ui/src/routes/devices/devicelist.svelte @@ -62,8 +62,8 @@ { key: "display_name", value: "Name" }, { key: "dns_name", value: "DNS Name" }, { key: "tailscale_display", value: "Tailscale" }, - { key: "ipv4", value: "IPv4" }, - { key: "ipv6", value: "IPv6" }, + { key: "ipv4_display", value: "IPv4" }, + { key: "ipv6_display", value: "IPv6" }, { key: "macs_display", value: "MAC" }, { key: "source", value: "Via" }, { key: "last_seen_display", value: "Last Seen" }, @@ -109,11 +109,23 @@ } function formatDevice(d: Device): Device & Record { + const tailscaleAddresses = (d.tailscale_nodes || []).flatMap( + (node) => node.addresses || [], + ); + const ipv4Addresses = Array.from( + new Set([d.ipv4, ...tailscaleAddresses.filter((ip) => ip.includes("."))]), + ).filter(Boolean); + const ipv6Addresses = Array.from( + new Set([d.ipv6, ...tailscaleAddresses.filter((ip) => ip.includes(":"))]), + ).filter(Boolean); + return { ...d, id: d.id, status: d.online ? "online" : "offline", display_name: d.manual_name || d.display_name || d.dns_name || "Unknown", + ipv4_display: ipv4Addresses.join(", "), + ipv6_display: ipv6Addresses.join(", "), macs_display: d.macs?.length ? d.macs[0] : "—", tailscale_display: d.tailscale_nodes?.length ? d.tailscale_nodes.map((node) => node.name || node.dns_name).join(", ") From 25ac7a03b924c044e306957b8a52f58e1590c017 Mon Sep 17 00:00:00 2001 From: fifthsegment <5513549+fifthsegment@users.noreply.github.com> Date: Thu, 24 Sep 2026 17:10:45 -0400 Subject: [PATCH 2/2] Persist devices with policy assignments Co-Authored-By: [CC] --- application/dns/discovery/persistence_test.go | 72 ++++++++++++ application/dns/discovery/store.go | 35 ++++++ .../endpoints/handler_device_policy.go | 13 +++ .../endpoints/handler_device_policy_test.go | 107 +++++++++++++++++ .../webserver/endpoints/handler_policy.go | 26 +++++ .../endpoints/handler_policy_test.go | 108 +++++++++++++++++- 6 files changed, 359 insertions(+), 2 deletions(-) diff --git a/application/dns/discovery/persistence_test.go b/application/dns/discovery/persistence_test.go index 1b575429..8de36f88 100644 --- a/application/dns/discovery/persistence_test.go +++ b/application/dns/discovery/persistence_test.go @@ -475,6 +475,32 @@ func TestDurableMutationFailuresLeaveInventoryAndDiskUnchanged(t *testing.T) { } } +func TestMarkDevicePersistentFailureLeavesInventoryAndDiskUnchanged(t *testing.T) { + store := &assignmentFailStore{} + ds := NewDeviceStore("local") + if err := ds.AttachPersistence(store); err != nil { + t.Fatal(err) + } + if _, err := ds.UpsertDeviceE(&Device{ID: "passive", IPv4: "192.0.2.10", Source: SourcePassive}); err != nil { + t.Fatal(err) + } + beforeDisk := store.rawValue() + store.setFailure(true) + + if _, ok, err := ds.MarkDevicePersistentE("passive"); err == nil || !ok { + t.Fatalf("mark persistent: ok=%v err=%v, want true/error", ok, err) + } + if got := ds.GetDevice("passive"); got == nil || got.Persistent { + t.Fatalf("failed retention changed RAM: %+v", got) + } + if store.rawValue() != beforeDisk { + t.Fatal("failed retention changed disk") + } + if _, ok, err := ds.MarkDevicePersistentE("missing"); err != nil || ok { + t.Fatalf("missing device: ok=%v err=%v, want false/nil", ok, err) + } +} + func TestApplyTailscaleSnapshotFailureRollsBackAllDevices(t *testing.T) { store := &assignmentFailStore{} ds := NewDeviceStore("local") @@ -751,3 +777,49 @@ func TestTransientPassiveAndMDNSDevicesAreNotPersisted(t *testing.T) { t.Fatalf("restored %d transient devices", restarted.DeviceCount()) } } + +func TestMarkDevicePersistentRestoresIdentityWithoutLANClaim(t *testing.T) { + store, _ := assignmentsStore(t) + ds := NewDeviceStore("local") + if err := ds.AttachPersistence(store); err != nil { + t.Fatal(err) + } + if _, err := ds.UpsertDeviceE(&Device{ + ID: "phone", IPv4: "192.0.2.10", MACs: []string{"aa:bb:cc:dd:ee:ff"}, + Source: SourcePassive, Sources: []DiscoverySource{SourcePassive}, + }); err != nil { + t.Fatal(err) + } + marked, ok, err := ds.MarkDevicePersistentE("phone") + if err != nil || !ok { + t.Fatalf("mark persistent: ok=%v err=%v", ok, err) + } + if !marked.Persistent || marked.IPv4 != "192.0.2.10" { + t.Fatalf("marked device = %+v", marked) + } + + restarted := NewDeviceStore("local") + if err := restarted.AttachPersistence(store); err != nil { + t.Fatal(err) + } + restored := restarted.GetDevice("phone") + if restored == nil || !restored.Persistent { + t.Fatalf("restored device = %+v", restored) + } + if restored.IPv4 != "" || restored.Online || !restored.LastSeen.IsZero() { + t.Fatalf("restored runtime observation = %+v", restored) + } + id, created, err := restarted.ObserveDevice(Device{ + IPv4: "192.0.2.44", MACs: []string{"aa:bb:cc:dd:ee:ff"}, + Source: SourcePassive, Sources: []DiscoverySource{SourcePassive}, + }) + if err != nil { + t.Fatal(err) + } + if created || id != "phone" { + t.Fatalf("rediscovery = id %q created=%v, want phone/false", id, created) + } + if got := restarted.GetDevice("phone"); got.IPv4 != "192.0.2.44" { + t.Fatalf("rediscovered device = %+v", got) + } +} diff --git a/application/dns/discovery/store.go b/application/dns/discovery/store.go index 2d5d86a5..bed8f66e 100644 --- a/application/dns/discovery/store.go +++ b/application/dns/discovery/store.go @@ -964,6 +964,41 @@ type ManualFieldsUpdate struct { SetCategory bool } +// MarkDevicePersistentE retains one canonical device across restarts without +// turning its current LAN address into durable identity. Policy assignment uses +// this before storing a device ID so the reference cannot outlive its target. +func (ds *DeviceStore) MarkDevicePersistentE(id string) (*Device, bool, error) { + ds.mutationMu.Lock() + defer ds.mutationMu.Unlock() + + ds.mu.Lock() + current := ds.devices[id] + if current == nil { + ds.mu.Unlock() + return nil, false, nil + } + original := cloneDevice(current) + updated := *cloneDevice(current) + updated.Persistent = true + persistence := ds.persistence + if persistence == nil { + ds.devices[id] = cloneDevice(&updated) + ds.rebuildIndexes() + ds.mu.Unlock() + return cloneDevice(&updated), true, nil + } + ds.mu.Unlock() + if err := persistence.persistIfChanged(updated); err != nil { + return original, true, err + } + + ds.mu.Lock() + ds.devices[id] = cloneDevice(&updated) + ds.rebuildIndexes() + ds.mu.Unlock() + return cloneDevice(&updated), true, nil +} + // UpdateManualFieldsE applies user-managed fields to one device. Discovery // remains the owner of observed identity: this method never changes addresses, // sources, last-seen, or online state. It returns the updated copy and any diff --git a/application/webserver/endpoints/handler_device_policy.go b/application/webserver/endpoints/handler_device_policy.go index 05899856..0f2a89c9 100644 --- a/application/webserver/endpoints/handler_device_policy.go +++ b/application/webserver/endpoints/handler_device_policy.go @@ -234,6 +234,19 @@ func GSApiDeviceAssignmentSet(w http.ResponseWriter, r *http.Request) { http.Error(w, `{"error":"Invalid JSON body"}`, http.StatusBadRequest) return } + if req.GroupID != "" && req.GroupID != gatesentryPolicy.DefaultGroupID { + if _, exists := svc.Snapshot().Groups[req.GroupID]; !exists { + http.Error(w, `{"error":"Unknown policy group id"}`, http.StatusBadRequest) + return + } + if _, ok, err := ds.MarkDevicePersistentE(id); err != nil { + http.Error(w, `{"error":"Unable to persist device identity"}`, http.StatusInternalServerError) + return + } else if !ok { + http.Error(w, `{"error":"Device not found"}`, http.StatusNotFound) + return + } + } if err := svc.SetDeviceAssignment(id, req.GroupID); err != nil { if errors.Is(err, gatesentryPolicy.ErrUnknownGroup) { http.Error(w, `{"error":"Unknown policy group id"}`, http.StatusBadRequest) diff --git a/application/webserver/endpoints/handler_device_policy_test.go b/application/webserver/endpoints/handler_device_policy_test.go index 95415524..54dcb38a 100644 --- a/application/webserver/endpoints/handler_device_policy_test.go +++ b/application/webserver/endpoints/handler_device_policy_test.go @@ -6,6 +6,7 @@ import ( "fmt" "net/http" "net/http/httptest" + "os" "testing" "time" @@ -13,6 +14,7 @@ import ( gatesentryDnsServer "bitbucket.org/abdullah_irfan/gatesentryf/dns/server" gatesentryLogger "bitbucket.org/abdullah_irfan/gatesentryf/logger" gatesentryPolicy "bitbucket.org/abdullah_irfan/gatesentryf/policy" + gatesentry2storage "bitbucket.org/abdullah_irfan/gatesentryf/storage" "github.com/gorilla/mux" "github.com/tidwall/buntdb" ) @@ -257,6 +259,9 @@ func TestDeviceAssignmentSetClearAndUnknownGroup(t *testing.T) { if _, exists := svc.Snapshot().Assignments["device-1"]; exists { t.Fatal("cleared assignment still in snapshot") } + if got := gatesentryDnsServer.GetDeviceStore().GetDevice("device-1"); got == nil || !got.Persistent { + t.Fatalf("clearing assignment discarded durable identity: %+v", got) + } recorder = put("missing-device", `{"group_id":"kids"}`) if recorder.Code != http.StatusNotFound { @@ -264,6 +269,108 @@ func TestDeviceAssignmentSetClearAndUnknownGroup(t *testing.T) { } } +type testDeviceResolver struct { + store *discovery.DeviceStore +} + +func (r testDeviceResolver) ResolveDeviceByIP(ip string) (string, bool, bool) { + deviceID, ambiguous, _, _ := r.store.ResolveIPClaim(ip) + return deviceID, ambiguous, false +} + +func TestDeviceAssignmentPersistsPassiveIdentityAcrossRestart(t *testing.T) { + _, cleanupPolicy := policyTestService(t) + defer cleanupPolicy() + svc := gatesentryDnsServer.GetPolicyService() + seedDevicePolicyGroup(t, svc) + devices, err := gatesentry2storage.OpenMapStore("GSDevices", true) + if err != nil { + t.Fatal(err) + } + ds := discovery.NewDeviceStore("local") + if err := ds.AttachPersistence(devices); err != nil { + t.Fatal(err) + } + if _, err := ds.UpsertDeviceE(&discovery.Device{ + ID: "phone", IPv4: "192.0.2.10", MACs: []string{"aa:bb:cc:dd:ee:ff"}, + Source: discovery.SourcePassive, Sources: []discovery.DiscoverySource{discovery.SourcePassive}, + }); err != nil { + t.Fatal(err) + } + gatesentryDnsServer.SetDeviceStoreForTests(ds) + + req, recorder := deviceRequest(http.MethodPut, "/api/devices/phone/assignment", "phone", "", `{"group_id":"kids"}`) + GSApiDeviceAssignmentSet(recorder, req) + if recorder.Code != http.StatusOK { + t.Fatalf("assignment status = %d, body = %s", recorder.Code, recorder.Body.String()) + } + + restarted := discovery.NewDeviceStore("local") + if err := restarted.AttachPersistence(devices); err != nil { + t.Fatal(err) + } + if got := restarted.GetDevice("phone"); got == nil || !got.Persistent || got.IPv4 != "" { + t.Fatalf("restored device = %+v", got) + } + id, created, err := restarted.ObserveDevice(discovery.Device{ + IPv4: "192.0.2.44", MACs: []string{"aa:bb:cc:dd:ee:ff"}, + Source: discovery.SourcePassive, Sources: []discovery.DiscoverySource{discovery.SourcePassive}, + }) + if err != nil || created || id != "phone" { + t.Fatalf("rediscovery = id %q created=%v err=%v", id, created, err) + } + if got := restarted.FindDeviceByIP("192.0.2.44"); got == nil || got.ID != "phone" { + t.Fatalf("address did not resolve to restored identity: %+v", got) + } + settings, err := gatesentry2storage.OpenMapStore("settings", false) + if err != nil { + t.Fatal(err) + } + restartedPolicy, err := gatesentryPolicy.NewService(settings, testDeviceResolver{store: restarted}) + if err != nil { + t.Fatal(err) + } + identity := restartedPolicy.ResolveIdentityForDNS("192.0.2.44", "") + if identity.DeviceID != "phone" || identity.GroupID != "kids" { + t.Fatalf("identity after restart = %+v", identity) + } +} + +func TestDeviceAssignmentPersistenceFailureDoesNotCommitPolicy(t *testing.T) { + _, cleanupPolicy := policyTestService(t) + base := gatesentry2storage.GSBASEDIR + defer cleanupPolicy() + svc := gatesentryDnsServer.GetPolicyService() + seedDevicePolicyGroup(t, svc) + devices, err := gatesentry2storage.OpenMapStore("GSDevices", true) + if err != nil { + t.Fatal(err) + } + ds := discovery.NewDeviceStore("local") + if err := ds.AttachPersistence(devices); err != nil { + t.Fatal(err) + } + if _, err := ds.UpsertDeviceE(&discovery.Device{ID: "phone", IPv4: "192.0.2.10", Source: discovery.SourcePassive}); err != nil { + t.Fatal(err) + } + gatesentryDnsServer.SetDeviceStoreForTests(ds) + if err := os.RemoveAll(base); err != nil { + t.Fatal(err) + } + + req, recorder := deviceRequest(http.MethodPut, "/api/devices/phone/assignment", "phone", "", `{"group_id":"kids"}`) + GSApiDeviceAssignmentSet(recorder, req) + if recorder.Code != http.StatusInternalServerError { + t.Fatalf("assignment status = %d, body = %s", recorder.Code, recorder.Body.String()) + } + if _, exists := svc.Snapshot().Assignments["phone"]; exists { + t.Fatal("policy assignment committed after device persistence failed") + } + if got := ds.GetDevice("phone"); got == nil || got.Persistent { + t.Fatalf("failed persistence changed device = %+v", got) + } +} + func insertDeviceActivity(t *testing.T, log *gatesentryLogger.Log, ip, url string) { t.Helper() at := time.Now().Unix() diff --git a/application/webserver/endpoints/handler_policy.go b/application/webserver/endpoints/handler_policy.go index ce347838..dec09d0b 100644 --- a/application/webserver/endpoints/handler_policy.go +++ b/application/webserver/endpoints/handler_policy.go @@ -333,6 +333,32 @@ func GSApiPolicyAssignmentsReplace(w http.ResponseWriter, r *http.Request) { return } } + ds := gatesentryDnsServer.GetDeviceStore() + if len(body.Assignments) > 0 { + if ds == nil { + deviceStoreOrError(w) + return + } + for _, assignment := range body.Assignments { + if ds.GetDevice(assignment.DeviceID) == nil { + http.Error(w, `{"error":"Device not found"}`, http.StatusNotFound) + return + } + } + } + // Device identity and policy are separate durable documents. Retain every + // referenced identity first so a failed device write cannot create an + // assignment whose canonical target disappears after restart. A later policy + // failure may leave a harmless retained device, but never a dangling mapping. + for _, assignment := range body.Assignments { + if _, ok, err := ds.MarkDevicePersistentE(assignment.DeviceID); err != nil { + http.Error(w, `{"error":"Unable to persist device identity"}`, http.StatusInternalServerError) + return + } else if !ok { + http.Error(w, `{"error":"Device not found"}`, http.StatusNotFound) + return + } + } if err := svc.SaveAssignments(body.Assignments); err != nil { http.Error(w, `{"error":"Unable to persist assignments"}`, http.StatusInternalServerError) return diff --git a/application/webserver/endpoints/handler_policy_test.go b/application/webserver/endpoints/handler_policy_test.go index b5e6df79..befb2dc6 100644 --- a/application/webserver/endpoints/handler_policy_test.go +++ b/application/webserver/endpoints/handler_policy_test.go @@ -9,6 +9,7 @@ import ( "strings" "testing" + "bitbucket.org/abdullah_irfan/gatesentryf/dns/discovery" gatesentryDnsServer "bitbucket.org/abdullah_irfan/gatesentryf/dns/server" gatesentryPolicy "bitbucket.org/abdullah_irfan/gatesentryf/policy" gatesentry2storage "bitbucket.org/abdullah_irfan/gatesentryf/storage" @@ -17,8 +18,9 @@ import ( func policyTestService(t *testing.T) (*gatesentryPolicy.Service, func()) { t.Helper() - // The DNS server package owns the singleton the handlers read. + // The DNS server package owns the singletons the handlers read. original := gatesentryDnsServer.GetPolicyService() + originalDevices := gatesentryDnsServer.GetDeviceStore() dir := t.TempDir() oldBase := gatesentry2storage.GSBASEDIR gatesentry2storage.SetBaseDir(dir + string(os.PathSeparator)) @@ -31,8 +33,16 @@ func policyTestService(t *testing.T) (*gatesentryPolicy.Service, func()) { if err != nil { t.Fatal(err) } + ds := discovery.NewDeviceStore("local") + if _, err := ds.UpsertDeviceE(&discovery.Device{ID: "device-1", IPv4: "192.0.2.10", Source: discovery.SourcePassive}); err != nil { + t.Fatal(err) + } + gatesentryDnsServer.SetDeviceStoreForTests(ds) gatesentryDnsServer.SetPolicyServiceForTests(svc) - return svc, func() { gatesentryDnsServer.SetPolicyServiceForTests(original) } + return svc, func() { + gatesentryDnsServer.SetDeviceStoreForTests(originalDevices) + gatesentryDnsServer.SetPolicyServiceForTests(original) + } } type staticResolver struct{} @@ -95,6 +105,100 @@ func TestPolicyAssignmentsRejectUnknownGroup(t *testing.T) { } } +func TestPolicyAssignmentsReplaceRetainsDeviceIdentity(t *testing.T) { + _, cleanup := policyTestService(t) + defer cleanup() + svc := gatesentryDnsServer.GetPolicyService() + if err := svc.SaveGroups([]gatesentryPolicy.PolicyGroup{{ID: "kids", Name: "Kids"}}); err != nil { + t.Fatal(err) + } + if err := svc.Reload(); err != nil { + t.Fatal(err) + } + ds := gatesentryDnsServer.GetDeviceStore() + devices, err := gatesentry2storage.OpenMapStore("GSDevices", true) + if err != nil { + t.Fatal(err) + } + if err := ds.AttachPersistence(devices); err != nil { + t.Fatal(err) + } + + req := httptest.NewRequest(http.MethodPut, "/api/policy/assignments", bytes.NewBufferString( + `{"assignments":[{"device_id":"device-1","group_id":"kids"}]}`)) + recorder := httptest.NewRecorder() + GSApiPolicyAssignmentsReplace(recorder, req) + if recorder.Code != http.StatusOK { + t.Fatalf("status = %d, body = %s", recorder.Code, recorder.Body.String()) + } + restarted := discovery.NewDeviceStore("local") + if err := restarted.AttachPersistence(devices); err != nil { + t.Fatal(err) + } + if got := restarted.GetDevice("device-1"); got == nil || !got.Persistent { + t.Fatalf("restored device = %+v", got) + } +} + +func TestPolicyAssignmentsReplaceRejectsMissingDevice(t *testing.T) { + svc, cleanup := policyTestService(t) + defer cleanup() + if err := svc.SaveGroups([]gatesentryPolicy.PolicyGroup{{ID: "kids", Name: "Kids"}}); err != nil { + t.Fatal(err) + } + if err := svc.Reload(); err != nil { + t.Fatal(err) + } + + req := httptest.NewRequest(http.MethodPut, "/api/policy/assignments", bytes.NewBufferString( + `{"assignments":[{"device_id":"missing","group_id":"kids"}]}`)) + recorder := httptest.NewRecorder() + GSApiPolicyAssignmentsReplace(recorder, req) + if recorder.Code != http.StatusNotFound { + t.Fatalf("status = %d, body = %s", recorder.Code, recorder.Body.String()) + } + if len(svc.Snapshot().Assignments) != 0 { + t.Fatalf("rejected assignments = %v", svc.Snapshot().Assignments) + } +} + +func TestPolicyAssignmentsReplaceDeviceWriteFailureDoesNotCommit(t *testing.T) { + svc, cleanup := policyTestService(t) + base := gatesentry2storage.GSBASEDIR + defer cleanup() + if err := svc.SaveGroups([]gatesentryPolicy.PolicyGroup{{ID: "kids", Name: "Kids"}}); err != nil { + t.Fatal(err) + } + if err := svc.Reload(); err != nil { + t.Fatal(err) + } + ds := gatesentryDnsServer.GetDeviceStore() + devices, err := gatesentry2storage.OpenMapStore("GSDevices", true) + if err != nil { + t.Fatal(err) + } + if err := ds.AttachPersistence(devices); err != nil { + t.Fatal(err) + } + if err := os.RemoveAll(base); err != nil { + t.Fatal(err) + } + + req := httptest.NewRequest(http.MethodPut, "/api/policy/assignments", bytes.NewBufferString( + `{"assignments":[{"device_id":"device-1","group_id":"kids"}]}`)) + recorder := httptest.NewRecorder() + GSApiPolicyAssignmentsReplace(recorder, req) + if recorder.Code != http.StatusInternalServerError { + t.Fatalf("status = %d, body = %s", recorder.Code, recorder.Body.String()) + } + if len(svc.Snapshot().Assignments) != 0 { + t.Fatalf("assignments committed after device write failure: %v", svc.Snapshot().Assignments) + } + if got := ds.GetDevice("device-1"); got == nil || got.Persistent { + t.Fatalf("failed persistence changed device = %+v", got) + } +} + func TestPolicyPreviewReportsInapplicableConditions(t *testing.T) { _, cleanup := policyTestService(t) defer cleanup()