From 38e1fbe3f992f59e122e573d51bb54cfc45b652f Mon Sep 17 00:00:00 2001 From: Joshua Mesilane Date: Mon, 6 Apr 2026 22:32:05 +1000 Subject: [PATCH 1/6] Changing from 'Global' Flood to 'Unscoped' flood as '*' doesn't actually mean wildcard, it means unscoped. Region keys should still only be forwaded if they're whitelisted. UI changes pending --- repeater/config.py | 9 ++++---- repeater/engine.py | 35 +++++++++++++++--------------- repeater/web/api_endpoints.py | 40 +++++++++++++++++------------------ 3 files changed, 43 insertions(+), 41 deletions(-) diff --git a/repeater/config.py b/repeater/config.py index 6ba716b..604a85f 100644 --- a/repeater/config.py +++ b/repeater/config.py @@ -152,12 +152,12 @@ def save_config(config_data: Dict[str, Any], config_path: Optional[str] = None) return False -def update_global_flood_policy(allow: bool, config_path: Optional[str] = None) -> bool: +def update_unscoped_flood_policy(allow: bool, config_path: Optional[str] = None) -> bool: """ - Update the global flood policy in the configuration. + Update the unscoped flood policy in the configuration. Args: - allow: True to allow flooding globally, False to deny + allow: True to allow unscoped flooding, False to deny config_path: Path to config file (uses default if None) Returns: @@ -173,12 +173,13 @@ def update_global_flood_policy(allow: bool, config_path: Optional[str] = None) - # Set global flood policy config["mesh"]["global_flood_allow"] = allow + config["mesh"]["unscoped_flood_allow"] = allow # Save updated config return save_config(config, config_path) except Exception as e: - logger.error(f"Failed to update global flood policy: {e}") + logger.error(f"Failed to update unscoped flood policy: {e}") return False diff --git a/repeater/engine.py b/repeater/engine.py index febcbaa..533c63f 100644 --- a/repeater/engine.py +++ b/repeater/engine.py @@ -623,10 +623,10 @@ class RepeaterHandler(BaseHandler): route_type = packet.header & PH_ROUTE_MASK if route_type == ROUTE_TYPE_FLOOD: - # Check if global flood policy blocked it - global_flood_allow = self.config.get("mesh", {}).get("global_flood_allow", True) - if not global_flood_allow: - return "Global flood policy disabled" + # Check if unscoped flood policy blocked it + unscoped_flood_allow = self.config.get("mesh", {}).get("unscoped_flood_allow", self.config.get("mesh", {}).get("global_flood_allow", True)) + if not unscoped_flood_allow: + return "Unscoped flood policy disabled" if route_type == ROUTE_TYPE_DIRECT: hash_size = packet.get_path_hash_size() @@ -800,19 +800,20 @@ class RepeaterHandler(BaseHandler): if not packet.drop_reason: packet.drop_reason = "Marked do not retransmit" return None + + # Check unscoped flood policy + unscoped_flood_allow = self.config.get("mesh", {}).get("unscoped_flood_allow", self.config.get("mesh", {}).get("global_flood_allow", True)) + route_type = packet.header & PH_ROUTE_MASK + if route_type == ROUTE_TYPE_FLOOD: + if not unscoped_flood_allow: + packet.drop_reason = "Unscoped flood policy disabled" + return None - # Check global flood policy - global_flood_allow = self.config.get("mesh", {}).get("global_flood_allow", True) - if not global_flood_allow: - route_type = packet.header & PH_ROUTE_MASK - if route_type == ROUTE_TYPE_FLOOD or route_type == ROUTE_TYPE_TRANSPORT_FLOOD: - - allowed, check_reason = self._check_transport_codes(packet) - if not allowed: - packet.drop_reason = check_reason - return None - else: - packet.drop_reason = "Global flood policy disabled" + #Check transport scopes flood policy + if route_type == ROUTE_TYPE_TRANSPORT_FLOOD: + allowed, check_reason = self._check_transport_codes(packet) + if not allowed: + packet.drop_reason = "Transport code not allowed to flood" return None mode = self._get_loop_detect_mode() @@ -1134,7 +1135,7 @@ class RepeaterHandler(BaseHandler): "web": self.config.get("web", {}), # Include web configuration "mesh": { "loop_detect": self.config.get("mesh", {}).get("loop_detect", "off"), - "global_flood_allow": self.config.get("mesh", {}).get("global_flood_allow", True), + "unscoped_flood_allow": self.config.get("mesh", {}).get("unscoped_flood_allow", self.config.get("mesh", {}).get("global_flood_allow", True)), "path_hash_mode": self.config.get("mesh", {}).get("path_hash_mode", 0), }, "letsmesh": self.config.get("letsmesh", {}), diff --git a/repeater/web/api_endpoints.py b/repeater/web/api_endpoints.py index 6a58c31..750109e 100644 --- a/repeater/web/api_endpoints.py +++ b/repeater/web/api_endpoints.py @@ -15,7 +15,7 @@ from repeater.companion.identity_resolve import ( find_companion_index, heal_companion_empty_names, ) -from repeater.config import update_global_flood_policy +from repeater.config import update_unscoped_flood_policy from .auth.middleware import require_auth from .auth_endpoints import AuthAPIEndpoints @@ -93,8 +93,8 @@ logger = logging.getLogger("HTTPServer") # DELETE /api/transport_key?key_id=X - Delete transport key # Network Policy -# GET /api/global_flood_policy - Get global flood policy -# POST /api/global_flood_policy - Update global flood policy +# GET /api/unscoped_flood_policy - Get unscoped flood policy +# POST /api/unscoped_flood_policy - Update unscoped flood policy # POST /api/ping_neighbor - Ping a neighbor node # Identity Management @@ -2153,57 +2153,57 @@ class APIEndpoints: @cherrypy.expose @cherrypy.tools.json_out() @cherrypy.tools.json_in() - def global_flood_policy(self): + def unscoped_flood_policy(self): """ - Update global flood policy configuration + Update unscoped flood policy configuration - POST /global_flood_policy - Body: {"global_flood_allow": true/false} + POST /unscoped_flood_policy + Body: {"unscoped_flood_allow": true/false} """ if cherrypy.request.method == "POST": try: data = cherrypy.request.json or {} - global_flood_allow = data.get("global_flood_allow") + unscoped_flood_allow = data.get("unscoped_flood_allow") - if global_flood_allow is None: - return self._error("Missing required field: global_flood_allow") + if unscoped_flood_allow is None: + return self._error("Missing required field: unscoped_flood_allow") - if not isinstance(global_flood_allow, bool): - return self._error("global_flood_allow must be a boolean value") + if not isinstance(unscoped_flood_allow, bool): + return self._error("unscoped_flood_allow must be a boolean value") # Update the running configuration first (like CAD settings) if "mesh" not in self.config: self.config["mesh"] = {} - self.config["mesh"]["global_flood_allow"] = global_flood_allow + self.config["mesh"]["unscoped_flood_allow"] = unscoped_flood_allow # Get the actual config path from daemon instance (same as CAD settings) config_path = getattr(self, "_config_path", "/etc/pymc_repeater/config.yaml") if self.daemon_instance and hasattr(self.daemon_instance, "config_path"): config_path = self.daemon_instance.config_path - logger.info(f"Using config path for global flood policy: {config_path}") + logger.info(f"Using config path for unscoped flood policy: {config_path}") # Update the configuration file using ConfigManager try: saved = self.config_manager.save_to_file() if saved: logger.info( - f"Updated running config and saved global flood policy to file: {'allow' if global_flood_allow else 'deny'}" + f"Updated running config and saved unscoped flood policy to file: {'allow' if unscoped_flood_allow else 'deny'}" ) else: - logger.error("Failed to save global flood policy to file") + logger.error("Failed to save unscoped flood policy to file") return self._error("Failed to save configuration to file") except Exception as e: - logger.error(f"Failed to save global flood policy to file: {e}") + logger.error(f"Failed to save unscoped flood policy to file: {e}") return self._error(f"Failed to save configuration to file: {e}") return self._success( - {"global_flood_allow": global_flood_allow}, - message=f"Global flood policy updated to {'allow' if global_flood_allow else 'deny'} (live and saved)", + {"unscoped_flood_allow": unscoped_flood_allow}, + message=f"Unscoped flood policy updated to {'allow' if unscoped_flood_allow else 'deny'} (live and saved)", ) except Exception as e: - logger.error(f"Error updating global flood policy: {e}") + logger.error(f"Error updating unscoped flood policy: {e}") return self._error(e) else: return self._error("Method not supported") From 7370cdc688aa581b6f9300492a6e99c5cf48ae24 Mon Sep 17 00:00:00 2001 From: Joshua Mesilane Date: Tue, 7 Apr 2026 16:28:49 +1000 Subject: [PATCH 2/6] Update openapi and fix the test script --- repeater/web/openapi.yaml | 6 +++--- tests/test_engine.py | 33 ++++++++++++++++----------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/repeater/web/openapi.yaml b/repeater/web/openapi.yaml index e6dce1b..a353b0f 100644 --- a/repeater/web/openapi.yaml +++ b/repeater/web/openapi.yaml @@ -1235,10 +1235,10 @@ paths: # ============================================================================ # Network Policy # ============================================================================ - /global_flood_policy: + /unscoped_flood_policy: get: tags: [Network Policy] - summary: Get global flood policy + summary: Get unscoped flood policy description: Retrieve current network flood policy configuration security: - BearerAuth: [] @@ -1252,7 +1252,7 @@ paths: type: object post: tags: [Network Policy] - summary: Update global flood policy + summary: Update unscoped flood policy description: Modify network flood policy settings security: - BearerAuth: [] diff --git a/tests/test_engine.py b/tests/test_engine.py index 6b309c5..060b88a 100644 --- a/tests/test_engine.py +++ b/tests/test_engine.py @@ -46,7 +46,7 @@ def _make_config(**overrides) -> dict: "node_name": "test-node", }, "mesh": { - "global_flood_allow": True, + "unscoped_flood_allow": True, "loop_detect": "off", }, "delays": { @@ -228,11 +228,10 @@ class TestFloodForward: assert result is None assert "do not retransmit" in pkt.drop_reason.lower() - def test_global_flood_deny_plain_flood(self, handler): - handler.config["mesh"]["global_flood_allow"] = False + def test_unscoped_flood_deny_plain_flood(self, handler): + handler.config["mesh"]["unscoped_flood_allow"] = False pkt = _make_flood_packet() - # When global_flood_allow=False, flood_forward calls _check_transport_codes - # which will fail because there are no transport codes on a plain flood + # When unscoped_flood_allow=False, flood_forward should fail on a packet type without a transport code defined result = handler.flood_forward(pkt) assert result is None @@ -656,26 +655,26 @@ class TestHashStabilityThroughForwarding: # =================================================================== -# 9. Global flood policy +# 9. unscoped flood policy # =================================================================== -class TestGlobalFloodPolicy: - """global_flood_allow=False blocks plain flood, transport checked.""" +class TestUnscopedFloodPolicy: + """unscoped_flood_allow=False blocks plain flood, transport checked.""" def test_flood_blocked_by_policy(self, handler): - handler.config["mesh"]["global_flood_allow"] = False + handler.config["mesh"]["unscoped_flood_allow"] = False pkt = _make_flood_packet() result = handler.flood_forward(pkt) assert result is None def test_direct_unaffected_by_flood_policy(self, handler): - handler.config["mesh"]["global_flood_allow"] = False + handler.config["mesh"]["unscoped_flood_allow"] = False pkt = _make_direct_packet() result = handler.direct_forward(pkt) assert result is not None # direct is not blocked by flood policy def test_transport_flood_checked_when_policy_off(self, handler): - handler.config["mesh"]["global_flood_allow"] = False + handler.config["mesh"]["unscoped_flood_allow"] = False pkt = _make_transport_flood_packet() # Will call _check_transport_codes which will fail (no storage keys) result = handler.flood_forward(pkt) @@ -812,7 +811,7 @@ class TestGetDropReason: assert "Path too long" in reason def test_flood_policy_reason(self, handler): - handler.config["mesh"]["global_flood_allow"] = False + handler.config["mesh"]["unscoped_flood_allow"] = False pkt = _make_flood_packet() reason = handler._get_drop_reason(pkt) assert "flood" in reason.lower() @@ -1202,7 +1201,7 @@ BAD_PACKETS = [ "no path"), ("bad_flood_policy_off", - "Plain flood when global_flood_allow=False (needs config override)", + "Plain flood when unscoped_flood_allow=False (needs config override)", lambda: _make_flood_packet(payload=b"\x01\x02"), "transport codes"), @@ -1323,9 +1322,9 @@ class TestBadPacketArray: BAD_PACKETS, ids=_bad_ids, ) def test_process_packet_drops(self, handler, name, desc, builder, expected_reason): - # Two entries need global_flood_allow=False + # Two entries need unscoped_flood_allow=False if "policy_off" in name: - handler.config["mesh"]["global_flood_allow"] = False + handler.config["mesh"]["unscoped_flood_allow"] = False pkt = builder() result = handler.process_packet(pkt, snr=5.0) @@ -1337,7 +1336,7 @@ class TestBadPacketArray: ) def test_drop_reason_set(self, handler, name, desc, builder, expected_reason): if "policy_off" in name: - handler.config["mesh"]["global_flood_allow"] = False + handler.config["mesh"]["unscoped_flood_allow"] = False pkt = builder() handler.process_packet(pkt, snr=5.0) @@ -1353,7 +1352,7 @@ class TestBadPacketArray: def test_bad_packet_not_marked_seen(self, handler, name, desc, builder, expected_reason): """Dropped packets must NOT pollute the seen cache.""" if "policy_off" in name: - handler.config["mesh"]["global_flood_allow"] = False + handler.config["mesh"]["unscoped_flood_allow"] = False pkt = builder() handler.process_packet(pkt, snr=5.0) From 2c95c0db0aaed23c419b0b325ac806af30f057db Mon Sep 17 00:00:00 2001 From: Joshua Mesilane Date: Thu, 9 Apr 2026 08:59:52 +1000 Subject: [PATCH 3/6] Update example config files --- config.yaml.example | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/config.yaml.example b/config.yaml.example index 46355e7..a8292b8 100644 --- a/config.yaml.example +++ b/config.yaml.example @@ -121,10 +121,9 @@ repeater: # Mesh Network Configuration mesh: - # Global flood policy - controls whether the repeater allows or denies flooding by default - # true = allow flooding globally, false = deny flooding globally - # Individual transport keys can override this setting - global_flood_allow: true + # Unscoped flood policy - controls whether the repeater allows or denies unscoped flooding + # true = allow unscoped flooding, false = deny flooding globally + unscoped_flood_allow: true # Path hash mode for flood packets (0-hop): per-hop hash size in path encoding # 0 = 1-byte hashes (legacy), 1 = 2-byte, 2 = 3-byte. Must match mesh convention. From 3851055b65f09dd39dcd466e0cb7a4a757986e43 Mon Sep 17 00:00:00 2001 From: Joshua Mesilane Date: Thu, 9 Apr 2026 09:03:02 +1000 Subject: [PATCH 4/6] Fix tests --- tests/test_flood_loop_dedup.py | 24 ++++++++++++------------ tests/test_path_hash_protocol.py | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/test_flood_loop_dedup.py b/tests/test_flood_loop_dedup.py index c595410..cb185aa 100644 --- a/tests/test_flood_loop_dedup.py +++ b/tests/test_flood_loop_dedup.py @@ -7,7 +7,7 @@ objects to verify: - Loop detection modes (off, minimal, moderate, strict) with real path bytes - Flood re-forwarding prevention (own hash already in path) - Multi-byte hash mode interaction with loop/dedup - - Global flood policy enforcement + - Unscoped flood policy enforcement - mark_seen / is_duplicate cache behaviour - do_not_retransmit flag handling """ @@ -50,7 +50,7 @@ def _make_handler( loop_detect="off", path_hash_mode=0, local_hash_bytes=None, - global_flood_allow=True, + unscoped_flood_allow=True, ): """Create a RepeaterHandler with real engine logic, mocking only hardware.""" lhb = local_hash_bytes or LOCAL_HASH_BYTES @@ -64,7 +64,7 @@ def _make_handler( "node_name": "test-node", }, "mesh": { - "global_flood_allow": global_flood_allow, + "unscoped_flood_allow": unscoped_flood_allow, "loop_detect": loop_detect, "path_hash_mode": path_hash_mode, }, @@ -398,29 +398,29 @@ class TestLoopDetectionMultiByte: # =================================================================== -# 5. Global flood policy +# 5. Unscoped flood policy # =================================================================== -class TestGlobalFloodPolicy: - """Test global_flood_allow=False blocks flood packets.""" +class TestUnscopedFloodPolicy: + """Test unscoped=False blocks flood packets.""" - def test_global_flood_disabled_drops_flood(self): - h = _make_handler(global_flood_allow=False) + def test_unscoped_flood_disabled_drops_flood(self): + h = _make_handler(unscoped_flood_allow=False) pkt = _make_flood_packet(payload=b"\x01\x02") result = h.flood_forward(pkt) assert result is None assert pkt.drop_reason is not None - def test_global_flood_enabled_allows_flood(self): - h = _make_handler(global_flood_allow=True) + def test_unscoped_flood_enabled_allows_flood(self): + h = _make_handler(unscoped_flood_allow=True) pkt = _make_flood_packet(payload=b"\x01\x02") result = h.flood_forward(pkt) assert result is not None def test_transport_flood_without_codes_drops(self): - """ROUTE_TYPE_TRANSPORT_FLOOD with global_flood_allow=False and no valid codes.""" - h = _make_handler(global_flood_allow=False) + """ROUTE_TYPE_TRANSPORT_FLOOD with unscoped_flood_allow=False and no valid codes.""" + h = _make_handler(unscoped_flood_allow=False) # Nullify the storage to ensure transport code check fails h.storage = None pkt = Packet() diff --git a/tests/test_path_hash_protocol.py b/tests/test_path_hash_protocol.py index d650ba0..2e7ead3 100644 --- a/tests/test_path_hash_protocol.py +++ b/tests/test_path_hash_protocol.py @@ -74,7 +74,7 @@ def _make_handler(path_hash_mode=0, local_hash_bytes=None): "node_name": "test-node", }, "mesh": { - "global_flood_allow": True, + "unscoped_flood_allow": True, "loop_detect": "off", "path_hash_mode": path_hash_mode, }, From 19e0f5d3dd8305c7d6c4dc07004ebbafcfd4adf1 Mon Sep 17 00:00:00 2001 From: Lloyd Date: Thu, 9 Apr 2026 09:16:43 +0100 Subject: [PATCH 5/6] build: update bundled web UI assets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rebuilt from pyMC-RepeaterUI dev branch — includes unscoped flood policy UI changes (rename from global flood, updated API endpoint and labels). --- .../html/assets/CADCalibration-CCeYRLvI.js | 1 - .../html/assets/CADCalibration-HkcF2-GW.js | 1 + ...mufMQ0.css => CADCalibration-gZQwotT3.css} | 2 +- .../web/html/assets/Companions-Cx-FcUOx.js | 1 + .../web/html/assets/Companions-dkXrpFyo.js | 1 - .../html/assets/Configuration-C4EmSQdM.css | 1 - .../web/html/assets/Configuration-COSqDNV7.js | 2 - .../html/assets/Configuration-DavFlb5x.css | 1 + .../web/html/assets/Configuration-Db8EsEJI.js | 2 + .../web/html/assets/ConfirmDialog-BRvNEHEy.js | 1 + ...ue_type_script_setup_true_lang-7siCLFWH.js | 1 - .../web/html/assets/Dashboard-CUPKHF02.css | 1 + .../web/html/assets/Dashboard-CtkpxqA5.js | 2 + .../web/html/assets/Dashboard-Cv42kxN_.js | 2 - .../web/html/assets/Dashboard-Ddg_Fz_R.css | 1 - repeater/web/html/assets/Help-1i4KzGWQ.js | 1 + repeater/web/html/assets/Help-xigBHw94.js | 1 - repeater/web/html/assets/Login-BTzcMhpV.css | 1 + repeater/web/html/assets/Login-BiyTDci2.css | 1 - repeater/web/html/assets/Login-Ci7Po_oi.js | 3 + repeater/web/html/assets/Login-D0PhxOgj.js | 1 - repeater/web/html/assets/Logs-Deot7VVG.js | 1 + repeater/web/html/assets/Logs-FrDrsrTw.js | 1 - .../web/html/assets/MessageDialog-CSjABYko.js | 1 + ...ue_type_script_setup_true_lang-SzTqrYUh.js | 1 - .../web/html/assets/Neighbors-CeQMbE6r.css | 1 - .../web/html/assets/Neighbors-Cfo189NY.css | 1 + .../web/html/assets/Neighbors-Iq3xu5XJ.js | 65 - .../web/html/assets/Neighbors-tK0iZybD.js | 65 + .../web/html/assets/RFNoiseFloor-D00K9PjZ.js | 1 + .../web/html/assets/RoomServers-CGLfVLxc.js | 1 - .../web/html/assets/RoomServers-CheebdAq.js | 1 + repeater/web/html/assets/Sessions-B4giR55K.js | 1 + repeater/web/html/assets/Sessions-rHkTsOlY.js | 1 - repeater/web/html/assets/Setup-DiRq9fgD.css | 1 + repeater/web/html/assets/Setup-Dq5DYqa_.js | 1 - repeater/web/html/assets/Setup-DxqfWs1P.css | 1 - repeater/web/html/assets/Setup-wQ-fEW9F.js | 1 + .../web/html/assets/Statistics-2MFwNAp1.css | 1 + .../web/html/assets/Statistics-C56LjnFt.css | 1 - .../web/html/assets/Statistics-Sn0kb5mJ.js | 1 - .../web/html/assets/Statistics-m6h9b_Wm.js | 1 + .../web/html/assets/SystemStats-B8-MXEai.css | 1 - .../web/html/assets/SystemStats-D99udK9A.js | 2 - .../web/html/assets/SystemStats-DE5yghoc.js | 2 + .../web/html/assets/SystemStats-Dnc1_s5j.css | 1 + repeater/web/html/assets/Terminal-CO_C7fq3.js | 184 - .../web/html/assets/Terminal-EJD8zfRC.css | 32 - repeater/web/html/assets/Terminal-G0FM7r0V.js | 198 + .../web/html/assets/Terminal-tmed9q5z.css | 1 + .../html/assets/_commonjsHelpers-CqkleIqs.js | 1 - .../_plugin-vue_export-helper-V-yks4gF.js | 1 + repeater/web/html/assets/api-CrUX-ZnK.js | 7 + repeater/web/html/assets/chart-B185MtDy.js | 18 - repeater/web/html/assets/chart-DdrINt9G.js | 3 + .../chartjs-adapter-date-fns-BqJ94ASW.css | 1 + .../chartjs-adapter-date-fns-kwjCs6JU.css | 1 - .../chartjs-adapter-date-fns.esm-CONKmChq.js | 1 + .../chartjs-adapter-date-fns.esm-DJ3p4DO2.js | 6 - repeater/web/html/assets/chunk-DECur_0Z.js | 1 + repeater/web/html/assets/index-C29IW84J.css | 2 + repeater/web/html/assets/index-CPWfwDmA.js | 3 + repeater/web/html/assets/index-p7qyPaY4.css | 1 - repeater/web/html/assets/index-xzvnOpJo.js | 35 - repeater/web/html/assets/leaflet-Dgihpmma.css | 1 - .../web/html/assets/leaflet-src-BtX0-WJ4.js | 1 + .../web/html/assets/leaflet-src-BtisrQHC.js | 4 - repeater/web/html/assets/leaflet-vh-t_kPv.css | 1 + repeater/web/html/assets/packets-BxrAyCoo.js | 1 + repeater/web/html/assets/pinia-BrpcNUEi.js | 1 + .../web/html/assets/plotly.min-Bnm7le34.js | 3790 ++++++++++++++++ .../web/html/assets/plotly.min-DO11Gp-n.js | 3858 ----------------- .../web/html/assets/preferences-DtwbSSgO.js | 1 - .../web/html/assets/preferences-N3Pls1rF.js | 1 + .../runtime-core.esm-bundler-IofF4kUm.js | 1 + repeater/web/html/assets/system-CCY_Ibb-.js | 1 + .../html/assets/useSignalQuality-DZXpd2l9.js | 1 - .../html/assets/useSignalQuality-hIA9BjQx.js | 1 + repeater/web/html/assets/useTheme-Dlt6-wEf.js | 1 + .../web/html/assets/vue-router-BsDVl_JC.js | 1 + repeater/web/html/index.html | 13 +- 81 files changed, 4122 insertions(+), 4235 deletions(-) delete mode 100644 repeater/web/html/assets/CADCalibration-CCeYRLvI.js create mode 100644 repeater/web/html/assets/CADCalibration-HkcF2-GW.js rename repeater/web/html/assets/{CADCalibration-DnmufMQ0.css => CADCalibration-gZQwotT3.css} (68%) create mode 100644 repeater/web/html/assets/Companions-Cx-FcUOx.js delete mode 100644 repeater/web/html/assets/Companions-dkXrpFyo.js delete mode 100644 repeater/web/html/assets/Configuration-C4EmSQdM.css delete mode 100644 repeater/web/html/assets/Configuration-COSqDNV7.js create mode 100644 repeater/web/html/assets/Configuration-DavFlb5x.css create mode 100644 repeater/web/html/assets/Configuration-Db8EsEJI.js create mode 100644 repeater/web/html/assets/ConfirmDialog-BRvNEHEy.js delete mode 100644 repeater/web/html/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-7siCLFWH.js create mode 100644 repeater/web/html/assets/Dashboard-CUPKHF02.css create mode 100644 repeater/web/html/assets/Dashboard-CtkpxqA5.js delete mode 100644 repeater/web/html/assets/Dashboard-Cv42kxN_.js delete mode 100644 repeater/web/html/assets/Dashboard-Ddg_Fz_R.css create mode 100644 repeater/web/html/assets/Help-1i4KzGWQ.js delete mode 100644 repeater/web/html/assets/Help-xigBHw94.js create mode 100644 repeater/web/html/assets/Login-BTzcMhpV.css delete mode 100644 repeater/web/html/assets/Login-BiyTDci2.css create mode 100644 repeater/web/html/assets/Login-Ci7Po_oi.js delete mode 100644 repeater/web/html/assets/Login-D0PhxOgj.js create mode 100644 repeater/web/html/assets/Logs-Deot7VVG.js delete mode 100644 repeater/web/html/assets/Logs-FrDrsrTw.js create mode 100644 repeater/web/html/assets/MessageDialog-CSjABYko.js delete mode 100644 repeater/web/html/assets/MessageDialog.vue_vue_type_script_setup_true_lang-SzTqrYUh.js delete mode 100644 repeater/web/html/assets/Neighbors-CeQMbE6r.css create mode 100644 repeater/web/html/assets/Neighbors-Cfo189NY.css delete mode 100644 repeater/web/html/assets/Neighbors-Iq3xu5XJ.js create mode 100644 repeater/web/html/assets/Neighbors-tK0iZybD.js create mode 100644 repeater/web/html/assets/RFNoiseFloor-D00K9PjZ.js delete mode 100644 repeater/web/html/assets/RoomServers-CGLfVLxc.js create mode 100644 repeater/web/html/assets/RoomServers-CheebdAq.js create mode 100644 repeater/web/html/assets/Sessions-B4giR55K.js delete mode 100644 repeater/web/html/assets/Sessions-rHkTsOlY.js create mode 100644 repeater/web/html/assets/Setup-DiRq9fgD.css delete mode 100644 repeater/web/html/assets/Setup-Dq5DYqa_.js delete mode 100644 repeater/web/html/assets/Setup-DxqfWs1P.css create mode 100644 repeater/web/html/assets/Setup-wQ-fEW9F.js create mode 100644 repeater/web/html/assets/Statistics-2MFwNAp1.css delete mode 100644 repeater/web/html/assets/Statistics-C56LjnFt.css delete mode 100644 repeater/web/html/assets/Statistics-Sn0kb5mJ.js create mode 100644 repeater/web/html/assets/Statistics-m6h9b_Wm.js delete mode 100644 repeater/web/html/assets/SystemStats-B8-MXEai.css delete mode 100644 repeater/web/html/assets/SystemStats-D99udK9A.js create mode 100644 repeater/web/html/assets/SystemStats-DE5yghoc.js create mode 100644 repeater/web/html/assets/SystemStats-Dnc1_s5j.css delete mode 100644 repeater/web/html/assets/Terminal-CO_C7fq3.js delete mode 100644 repeater/web/html/assets/Terminal-EJD8zfRC.css create mode 100644 repeater/web/html/assets/Terminal-G0FM7r0V.js create mode 100644 repeater/web/html/assets/Terminal-tmed9q5z.css delete mode 100644 repeater/web/html/assets/_commonjsHelpers-CqkleIqs.js create mode 100644 repeater/web/html/assets/_plugin-vue_export-helper-V-yks4gF.js create mode 100644 repeater/web/html/assets/api-CrUX-ZnK.js delete mode 100644 repeater/web/html/assets/chart-B185MtDy.js create mode 100644 repeater/web/html/assets/chart-DdrINt9G.js create mode 100644 repeater/web/html/assets/chartjs-adapter-date-fns-BqJ94ASW.css delete mode 100644 repeater/web/html/assets/chartjs-adapter-date-fns-kwjCs6JU.css create mode 100644 repeater/web/html/assets/chartjs-adapter-date-fns.esm-CONKmChq.js delete mode 100644 repeater/web/html/assets/chartjs-adapter-date-fns.esm-DJ3p4DO2.js create mode 100644 repeater/web/html/assets/chunk-DECur_0Z.js create mode 100644 repeater/web/html/assets/index-C29IW84J.css create mode 100644 repeater/web/html/assets/index-CPWfwDmA.js delete mode 100644 repeater/web/html/assets/index-p7qyPaY4.css delete mode 100644 repeater/web/html/assets/index-xzvnOpJo.js delete mode 100644 repeater/web/html/assets/leaflet-Dgihpmma.css create mode 100644 repeater/web/html/assets/leaflet-src-BtX0-WJ4.js delete mode 100644 repeater/web/html/assets/leaflet-src-BtisrQHC.js create mode 100644 repeater/web/html/assets/leaflet-vh-t_kPv.css create mode 100644 repeater/web/html/assets/packets-BxrAyCoo.js create mode 100644 repeater/web/html/assets/pinia-BrpcNUEi.js create mode 100644 repeater/web/html/assets/plotly.min-Bnm7le34.js delete mode 100644 repeater/web/html/assets/plotly.min-DO11Gp-n.js delete mode 100644 repeater/web/html/assets/preferences-DtwbSSgO.js create mode 100644 repeater/web/html/assets/preferences-N3Pls1rF.js create mode 100644 repeater/web/html/assets/runtime-core.esm-bundler-IofF4kUm.js create mode 100644 repeater/web/html/assets/system-CCY_Ibb-.js delete mode 100644 repeater/web/html/assets/useSignalQuality-DZXpd2l9.js create mode 100644 repeater/web/html/assets/useSignalQuality-hIA9BjQx.js create mode 100644 repeater/web/html/assets/useTheme-Dlt6-wEf.js create mode 100644 repeater/web/html/assets/vue-router-BsDVl_JC.js diff --git a/repeater/web/html/assets/CADCalibration-CCeYRLvI.js b/repeater/web/html/assets/CADCalibration-CCeYRLvI.js deleted file mode 100644 index b847de0..0000000 --- a/repeater/web/html/assets/CADCalibration-CCeYRLvI.js +++ /dev/null @@ -1 +0,0 @@ -import{a as G,M as K,c as Q,r as o,o as W,P as X,e as g,f as a,h as k,j as F,t as l,l as h,n as ee,L as T,Y as te,Z as ae,q as f,y as se}from"./index-xzvnOpJo.js";import{P as M}from"./plotly.min-DO11Gp-n.js";import"./_commonjsHelpers-CqkleIqs.js";const oe={class:"p-6 space-y-6"},re={class:"glass-card rounded-[15px] p-6"},le={class:"flex justify-center"},ne={class:"flex gap-4"},ie=["disabled"],ce=["disabled"],de={class:"glass-card rounded-[15px] p-6 space-y-4"},ue={class:"text-content-primary dark:text-content-primary"},ve={key:0,class:"p-4 bg-primary/10 border border-primary/30 rounded-lg"},pe={class:"text-content-primary dark:text-primary"},me={class:"space-y-2"},be={class:"w-full bg-white/10 rounded-full h-2"},ge={class:"text-content-secondary dark:text-content-muted text-sm"},fe={class:"grid grid-cols-2 md:grid-cols-4 gap-4"},xe={class:"glass-card rounded-[15px] p-4 text-center"},ye={class:"text-2xl font-bold text-primary"},_e={class:"glass-card rounded-[15px] p-4 text-center"},ke={class:"text-2xl font-bold text-primary"},he={class:"glass-card rounded-[15px] p-4 text-center"},Ce={class:"text-2xl font-bold text-primary"},we={class:"glass-card rounded-[15px] p-4 text-center"},Re={class:"text-2xl font-bold text-primary"},Se={key:0,class:"glass-card rounded-[15px] p-6 space-y-4"},De={key:0,class:"p-4 bg-accent-green/10 border border-accent-green/30 rounded-lg"},Ae={class:"text-content-primary dark:text-content-primary mb-4"},Be={key:1,class:"p-4 bg-secondary/20 border border-secondary/40 rounded-lg"},Ee=G({name:"CADCalibrationView",__name:"CADCalibration",setup(Fe){const m=K(),I=Q(()=>document.documentElement.classList.contains("dark")),P=()=>{const e=I.value;return{title:e?"#F9FAFB":"#111827",subtitle:e?"#9CA3AF":"#6B7280",axis:e?"#D1D5DB":"#374151",tick:e?"#9CA3AF":"#6B7280",grid:e?"rgba(148, 163, 184, 0.1)":"rgba(107, 114, 128, 0.15)",zeroline:e?"rgba(148, 163, 184, 0.2)":"rgba(107, 114, 128, 0.25)",line:e?"rgba(148, 163, 184, 0.3)":"rgba(107, 114, 128, 0.35)",colorbarBorder:e?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.15)",markerLine:e?"rgba(255,255,255,0.2)":"rgba(0,0,0,0.15)"}},u=o(!1),C=o(null),r=o(null),v=o({}),n=o(null),$=o([]),j=o({}),d=o("Ready to start calibration"),x=o(0),b=o(0),w=o(0),R=o(0),S=o(0),D=o(0),i=o(null),A=o(!1),B=o(!1),y=o(!1),_=o(!1);let c=null;const N={responsive:!0,displayModeBar:!0,modeBarButtonsToRemove:["pan2d","select2d","lasso2d","autoScale2d"],displaylogo:!1,toImageButtonOptions:{format:"png",filename:"cad-calibration-heatmap",height:600,width:800,scale:2}};function O(){const e=P(),t=[{x:[],y:[],z:[],mode:"markers",type:"scatter",marker:{size:12,color:[],colorscale:[[0,"rgba(75, 85, 99, 0.4)"],[.1,"rgba(6, 182, 212, 0.3)"],[.5,"rgba(6, 182, 212, 0.6)"],[1,"rgba(16, 185, 129, 0.9)"]],showscale:!0,colorbar:{title:{text:"Detection Rate (%)",font:{color:e.axis,size:14}},tickfont:{color:e.tick},bgcolor:"rgba(0,0,0,0)",bordercolor:e.colorbarBorder,borderwidth:1,thickness:15},line:{color:e.markerLine,width:1}},hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
",name:"Test Results"}],s={title:{text:`CAD Detection Rate
Channel Activity Detection Calibration`,font:{color:e.title,size:18},x:.5},xaxis:{title:{text:"CAD Peak Threshold",font:{color:e.axis,size:14}},tickfont:{color:e.tick},gridcolor:e.grid,zerolinecolor:e.zeroline,linecolor:e.line},yaxis:{title:{text:"CAD Min Threshold",font:{color:e.axis,size:14}},tickfont:{color:e.tick},gridcolor:e.grid,zerolinecolor:e.zeroline,linecolor:e.line},plot_bgcolor:"rgba(0, 0, 0, 0)",paper_bgcolor:"rgba(0, 0, 0, 0)",font:{color:e.title,family:"Inter, system-ui, sans-serif"},margin:{l:80,r:80,t:100,b:80},showlegend:!1};M.newPlot("plotly-chart",t,s,N)}function V(){if(Object.keys(v.value).length===0)return;const e=Object.values(v.value),t=[],s=[],p=[];for(const E of e)t.push(E.det_peak),s.push(E.det_min),p.push(E.detection_rate);const Z={x:[t],y:[s],"marker.color":[p],hovertemplate:"Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
Status: Tested
"};M.restyle("plotly-chart",Z,[0])}async function U(){try{const s=await T.post("/cad-calibration-start",{samples:10,delay_ms:50});if(s.success)u.value=!0,C.value=Date.now(),m.setCadCalibrationRunning(!0),v.value={},$.value=[],j.value={},n.value=null,A.value=!1,B.value=!1,y.value=!1,_.value=!1,w.value=0,R.value=0,S.value=0,D.value=0,x.value=0,b.value=0,c=setInterval(()=>{C.value&&(D.value=Math.floor((Date.now()-C.value)/1e3))},1e3),L();else throw new Error(s.error||"Failed to start calibration")}catch(s){d.value=`Error: ${s instanceof Error?s.message:"Unknown error"}`}}async function z(){try{(await T.post("/cad-calibration-stop")).success&&(u.value=!1,m.setCadCalibrationRunning(!1),r.value&&(r.value.close(),r.value=null),c&&(clearInterval(c),c=null))}catch(e){console.error("Failed to stop calibration:",e)}}function L(){r.value&&r.value.close();const e=te(),t=e?`?token=${encodeURIComponent(e)}`:"";r.value=new EventSource(`${ae}/api/cad-calibration-stream${t}`),r.value.onmessage=function(s){try{const p=JSON.parse(s.data);q(p)}catch(p){console.error("Failed to parse SSE data:",p)}},r.value.onerror=function(s){console.error("SSE connection error:",s),u.value||r.value&&(r.value.close(),r.value=null)}}function q(e){switch(e.type){case"status":d.value=e.message||"Status update",e.test_ranges&&(i.value=e.test_ranges,A.value=!0);break;case"progress":x.value=e.current||0,b.value=e.total||0,w.value=e.current||0;break;case"result":if(e.det_peak!==void 0&&e.det_min!==void 0&&e.detection_rate!==void 0&&e.detections!==void 0&&e.samples!==void 0){const t=`${e.det_peak}_${e.det_min}`;v.value[t]={det_peak:e.det_peak,det_min:e.det_min,detection_rate:e.detection_rate,detections:e.detections,samples:e.samples},V(),H()}break;case"complete":case"completed":u.value=!1,d.value=e.message||"Calibration completed",m.setCadCalibrationRunning(!1),J(),r.value&&(r.value.close(),r.value=null),c&&(clearInterval(c),c=null);break;case"error":d.value=`Error: ${e.message}`,m.setCadCalibrationRunning(!1),z();break}}function H(){const e=Object.values(v.value).map(t=>t.detection_rate);e.length!==0&&(R.value=Math.max(...e),S.value=e.reduce((t,s)=>t+s,0)/e.length)}function J(){B.value=!0;let e=null,t=0;for(const s of Object.values(v.value))s.detection_rate>t&&(t=s.detection_rate,e=s);n.value=e,e&&t>0?(y.value=!0,_.value=!1):(y.value=!1,_.value=!0)}async function Y(){if(!n.value){d.value="Error: No calibration results to save";return}try{const e=await T.post("/save_cad_settings",{peak:n.value.det_peak,min_val:n.value.det_min,detection_rate:n.value.detection_rate});if(e.success)d.value=`Settings saved! Peak=${n.value.det_peak}, Min=${n.value.det_min} applied to configuration.`;else throw new Error(e.error||"Failed to save settings")}catch(e){d.value=`Error: Failed to save settings: ${e instanceof Error?e.message:"Unknown error"}`}}return W(()=>{O()}),X(()=>{r.value&&r.value.close(),c&&clearInterval(c),m.setCadCalibrationRunning(!1),document.getElementById("plotly-chart")&&M.purge("plotly-chart")}),(e,t)=>(f(),g("div",oe,[t[14]||(t[14]=a("div",null,[a("h1",{class:"text-2xl font-bold text-content-primary dark:text-content-primary"},"CAD Calibration Tool"),a("p",{class:"text-content-secondary dark:text-content-muted mt-2"},"Channel Activity Detection calibration")],-1)),a("div",re,[a("div",le,[a("div",ne,[a("button",{onClick:U,disabled:u.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-green/10 hover:bg-accent-green/20 disabled:bg-gray-500/10 text-accent-green disabled:text-gray-400 rounded-lg border border-accent-green/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},t[0]||(t[0]=[F('
Start Calibration
Begin testing
',2)]),8,ie),a("button",{onClick:z,disabled:!u.value,class:"flex items-center gap-3 px-6 py-3 bg-accent-red/10 hover:bg-accent-red/20 disabled:bg-gray-500/10 text-accent-red disabled:text-gray-400 rounded-lg border border-accent-red/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed"},t[1]||(t[1]=[F('
Stop
Halt calibration
',2)]),8,ce)])])]),a("div",de,[a("div",ue,l(d.value),1),A.value&&i.value?(f(),g("div",ve,[a("div",pe,[t[2]||(t[2]=a("strong",null,"Configuration:",-1)),h(" SF"+l(i.value.spreading_factor)+" | Peak: "+l(i.value.peak_min)+" - "+l(i.value.peak_max)+" | Min: "+l(i.value.min_min)+" - "+l(i.value.min_max)+" | "+l((i.value.peak_max-i.value.peak_min+1)*(i.value.min_max-i.value.min_min+1))+" tests ",1)])])):k("",!0),a("div",me,[a("div",be,[a("div",{class:"bg-gradient-to-r from-primary to-accent-green h-2 rounded-full transition-all duration-300",style:ee({width:b.value>0?`${x.value/b.value*100}%`:"0%"})},null,4)]),a("div",ge,l(x.value)+" / "+l(b.value)+" tests completed",1)])]),a("div",fe,[a("div",xe,[a("div",ye,l(w.value),1),t[3]||(t[3]=a("div",{class:"text-content-secondary dark:text-content-muted text-sm"},"Tests Completed",-1))]),a("div",_e,[a("div",ke,l(R.value.toFixed(1))+"%",1),t[4]||(t[4]=a("div",{class:"text-content-secondary dark:text-content-muted text-sm"},"Best Detection Rate",-1))]),a("div",he,[a("div",Ce,l(S.value.toFixed(1))+"%",1),t[5]||(t[5]=a("div",{class:"text-content-secondary dark:text-content-muted text-sm"},"Average Rate",-1))]),a("div",we,[a("div",Re,l(D.value)+"s",1),t[6]||(t[6]=a("div",{class:"text-content-secondary dark:text-content-muted text-sm"},"Elapsed Time",-1))])]),t[15]||(t[15]=a("div",{class:"glass-card rounded-[15px] p-6"},[a("div",{id:"plotly-chart",class:"w-full h-96"})],-1)),B.value?(f(),g("div",Se,[t[13]||(t[13]=a("h3",{class:"text-xl font-bold text-content-primary dark:text-content-primary"},"Calibration Results",-1)),y.value&&n.value?(f(),g("div",De,[t[11]||(t[11]=a("h4",{class:"font-medium text-accent-green mb-2"},"Optimal Settings Found:",-1)),a("p",Ae,[t[7]||(t[7]=h(" Peak: ",-1)),a("strong",null,l(n.value.det_peak),1),t[8]||(t[8]=h(", Min: ",-1)),a("strong",null,l(n.value.det_min),1),t[9]||(t[9]=h(", Rate: ",-1)),a("strong",null,l(n.value.detection_rate.toFixed(1))+"%",1)]),a("div",{class:"flex justify-center"},[a("button",{onClick:Y,class:"flex items-center gap-3 px-6 py-3 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"},t[10]||(t[10]=[F('
Save Settings
Apply to configuration
',2)]))])])):k("",!0),_.value?(f(),g("div",Be,t[12]||(t[12]=[a("h4",{class:"font-medium text-secondary mb-2"},"No Optimal Settings Found",-1),a("p",{class:"text-content-secondary dark:text-content-muted"},"All tested combinations showed low detection rates. Consider running calibration again or adjusting test parameters.",-1)]))):k("",!0)])):k("",!0)]))}}),Ie=se(Ee,[["__scopeId","data-v-c30e5f38"]]);export{Ie as default}; diff --git a/repeater/web/html/assets/CADCalibration-HkcF2-GW.js b/repeater/web/html/assets/CADCalibration-HkcF2-GW.js new file mode 100644 index 0000000..0d436f3 --- /dev/null +++ b/repeater/web/html/assets/CADCalibration-HkcF2-GW.js @@ -0,0 +1 @@ +import{r as e}from"./chunk-DECur_0Z.js";import{C as t,S as n,dt as r,f as i,g as a,l as o,o as s,p as c,s as l,u,ut as d,w as f,z as p}from"./runtime-core.esm-bundler-IofF4kUm.js";import{s as m,t as h}from"./api-CrUX-ZnK.js";import{t as g}from"./system-CCY_Ibb-.js";import{t as _}from"./_plugin-vue_export-helper-V-yks4gF.js";import{t as v}from"./plotly.min-Bnm7le34.js";var y=e(v(),1),b={class:`p-6 space-y-6`},ee={class:`glass-card rounded-[15px] p-6`},te={class:`flex justify-center`},ne={class:`flex gap-4`},re=[`disabled`],ie=[`disabled`],ae={class:`glass-card rounded-[15px] p-6 space-y-4`},oe={class:`text-content-primary dark:text-content-primary`},se={key:0,class:`p-4 bg-primary/10 border border-primary/30 rounded-lg`},ce={class:`text-content-primary dark:text-primary`},le={class:`space-y-2`},ue={class:`w-full bg-white/10 rounded-full h-2`},de={class:`text-content-secondary dark:text-content-muted text-sm`},x={class:`grid grid-cols-2 md:grid-cols-4 gap-4`},fe={class:`glass-card rounded-[15px] p-4 text-center`},S={class:`text-2xl font-bold text-primary`},C={class:`glass-card rounded-[15px] p-4 text-center`},w={class:`text-2xl font-bold text-primary`},T={class:`glass-card rounded-[15px] p-4 text-center`},E={class:`text-2xl font-bold text-primary`},D={class:`glass-card rounded-[15px] p-4 text-center`},O={class:`text-2xl font-bold text-primary`},k={key:0,class:`glass-card rounded-[15px] p-6 space-y-4`},A={key:0,class:`p-4 bg-accent-green/10 border border-accent-green/30 rounded-lg`},j={class:`text-content-primary dark:text-content-primary mb-4`},M={key:1,class:`p-4 bg-secondary/20 border border-secondary/40 rounded-lg`},N=_(a({name:`CADCalibrationView`,__name:`CADCalibration`,setup(e){let a=g(),_=s(()=>document.documentElement.classList.contains(`dark`)),v=()=>{let e=_.value;return{title:e?`#F9FAFB`:`#111827`,subtitle:e?`#9CA3AF`:`#6B7280`,axis:e?`#D1D5DB`:`#374151`,tick:e?`#9CA3AF`:`#6B7280`,grid:e?`rgba(148, 163, 184, 0.1)`:`rgba(107, 114, 128, 0.15)`,zeroline:e?`rgba(148, 163, 184, 0.2)`:`rgba(107, 114, 128, 0.25)`,line:e?`rgba(148, 163, 184, 0.3)`:`rgba(107, 114, 128, 0.35)`,colorbarBorder:e?`rgba(255,255,255,0.2)`:`rgba(0,0,0,0.15)`,markerLine:e?`rgba(255,255,255,0.2)`:`rgba(0,0,0,0.15)`}},N=p(!1),P=p(null),F=p(null),I=p({}),L=p(null),R=p([]),z=p({}),B=p(`Ready to start calibration`),V=p(0),H=p(0),U=p(0),W=p(0),G=p(0),K=p(0),q=p(null),J=p(!1),Y=p(!1),X=p(!1),Z=p(!1),Q=null,pe={responsive:!0,displayModeBar:!0,modeBarButtonsToRemove:[`pan2d`,`select2d`,`lasso2d`,`autoScale2d`],displaylogo:!1,toImageButtonOptions:{format:`png`,filename:`cad-calibration-heatmap`,height:600,width:800,scale:2}};function me(){let e=v(),t=[{x:[],y:[],z:[],mode:`markers`,type:`scatter`,marker:{size:12,color:[],colorscale:[[0,`rgba(75, 85, 99, 0.4)`],[.1,`rgba(6, 182, 212, 0.3)`],[.5,`rgba(6, 182, 212, 0.6)`],[1,`rgba(16, 185, 129, 0.9)`]],showscale:!0,colorbar:{title:{text:`Detection Rate (%)`,font:{color:e.axis,size:14}},tickfont:{color:e.tick},bgcolor:`rgba(0,0,0,0)`,bordercolor:e.colorbarBorder,borderwidth:1,thickness:15},line:{color:e.markerLine,width:1}},hovertemplate:`Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
`,name:`Test Results`}],n={title:{text:`CAD Detection Rate
Channel Activity Detection Calibration`,font:{color:e.title,size:18},x:.5},xaxis:{title:{text:`CAD Peak Threshold`,font:{color:e.axis,size:14}},tickfont:{color:e.tick},gridcolor:e.grid,zerolinecolor:e.zeroline,linecolor:e.line},yaxis:{title:{text:`CAD Min Threshold`,font:{color:e.axis,size:14}},tickfont:{color:e.tick},gridcolor:e.grid,zerolinecolor:e.zeroline,linecolor:e.line},plot_bgcolor:`rgba(0, 0, 0, 0)`,paper_bgcolor:`rgba(0, 0, 0, 0)`,font:{color:e.title,family:`Inter, system-ui, sans-serif`},margin:{l:80,r:80,t:100,b:80},showlegend:!1};y.default.newPlot(`plotly-chart`,t,n,pe)}function he(){if(Object.keys(I.value).length===0)return;let e=Object.values(I.value),t=[],n=[],r=[];for(let i of e)t.push(i.det_peak),n.push(i.det_min),r.push(i.detection_rate);let i={x:[t],y:[n],"marker.color":[r],hovertemplate:`Peak: %{x}
Min: %{y}
Detection Rate: %{marker.color:.1f}%
Status: Tested
`};y.default.restyle(`plotly-chart`,i,[0])}async function ge(){try{let e=await h.post(`/cad-calibration-start`,{samples:10,delay_ms:50});if(e.success)N.value=!0,P.value=Date.now(),a.setCadCalibrationRunning(!0),I.value={},R.value=[],z.value={},L.value=null,J.value=!1,Y.value=!1,X.value=!1,Z.value=!1,U.value=0,W.value=0,G.value=0,K.value=0,V.value=0,H.value=0,Q=setInterval(()=>{P.value&&(K.value=Math.floor((Date.now()-P.value)/1e3))},1e3),_e();else throw Error(e.error||`Failed to start calibration`)}catch(e){B.value=`Error: ${e instanceof Error?e.message:`Unknown error`}`}}async function $(){try{(await h.post(`/cad-calibration-stop`)).success&&(N.value=!1,a.setCadCalibrationRunning(!1),F.value&&=(F.value.close(),null),Q&&=(clearInterval(Q),null))}catch(e){console.error(`Failed to stop calibration:`,e)}}function _e(){F.value&&F.value.close();let e=m(),t=e?`?token=${encodeURIComponent(e)}`:``;F.value=new EventSource(`/api/cad-calibration-stream${t}`),F.value.onmessage=function(e){try{ve(JSON.parse(e.data))}catch(e){console.error(`Failed to parse SSE data:`,e)}},F.value.onerror=function(e){console.error(`SSE connection error:`,e),N.value||(F.value&&=(F.value.close(),null))}}function ve(e){switch(e.type){case`status`:B.value=e.message||`Status update`,e.test_ranges&&(q.value=e.test_ranges,J.value=!0);break;case`progress`:V.value=e.current||0,H.value=e.total||0,U.value=e.current||0;break;case`result`:if(e.det_peak!==void 0&&e.det_min!==void 0&&e.detection_rate!==void 0&&e.detections!==void 0&&e.samples!==void 0){let t=`${e.det_peak}_${e.det_min}`;I.value[t]={det_peak:e.det_peak,det_min:e.det_min,detection_rate:e.detection_rate,detections:e.detections,samples:e.samples},he(),ye()}break;case`complete`:case`completed`:N.value=!1,B.value=e.message||`Calibration completed`,a.setCadCalibrationRunning(!1),be(),F.value&&=(F.value.close(),null),Q&&=(clearInterval(Q),null);break;case`error`:B.value=`Error: ${e.message}`,a.setCadCalibrationRunning(!1),$();break}}function ye(){let e=Object.values(I.value).map(e=>e.detection_rate);e.length!==0&&(W.value=Math.max(...e),G.value=e.reduce((e,t)=>e+t,0)/e.length)}function be(){Y.value=!0;let e=null,t=0;for(let n of Object.values(I.value))n.detection_rate>t&&(t=n.detection_rate,e=n);L.value=e,e&&t>0?(X.value=!0,Z.value=!1):(X.value=!1,Z.value=!0)}async function xe(){if(!L.value){B.value=`Error: No calibration results to save`;return}try{let e=await h.post(`/save_cad_settings`,{peak:L.value.det_peak,min_val:L.value.det_min,detection_rate:L.value.detection_rate});if(e.success)B.value=`Settings saved! Peak=${L.value.det_peak}, Min=${L.value.det_min} applied to configuration.`;else throw Error(e.error||`Failed to save settings`)}catch(e){B.value=`Error: Failed to save settings: ${e instanceof Error?e.message:`Unknown error`}`}}return n(()=>{me()}),t(()=>{F.value&&F.value.close(),Q&&clearInterval(Q),a.setCadCalibrationRunning(!1),document.getElementById(`plotly-chart`)&&y.default.purge(`plotly-chart`)}),(e,t)=>(f(),u(`div`,b,[t[14]||=l(`div`,null,[l(`h1`,{class:`text-2xl font-bold text-content-primary dark:text-content-primary`},` CAD Calibration Tool `),l(`p`,{class:`text-content-secondary dark:text-content-muted mt-2`},` Channel Activity Detection calibration `)],-1),l(`div`,ee,[l(`div`,te,[l(`div`,ne,[l(`button`,{onClick:ge,disabled:N.value,class:`flex items-center gap-3 px-6 py-3 bg-accent-green/10 hover:bg-accent-green/20 disabled:bg-gray-500/10 text-accent-green disabled:text-gray-400 rounded-lg border border-accent-green/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed`},[...t[0]||=[i(`
Start Calibration
Begin testing
`,2)]],8,re),l(`button`,{onClick:$,disabled:!N.value,class:`flex items-center gap-3 px-6 py-3 bg-accent-red/10 hover:bg-accent-red/20 disabled:bg-gray-500/10 text-accent-red disabled:text-gray-400 rounded-lg border border-accent-red/30 disabled:border-gray-500/20 transition-colors disabled:cursor-not-allowed`},[...t[1]||=[i(`
Stop
Halt calibration
`,2)]],8,ie)])])]),l(`div`,ae,[l(`div`,oe,r(B.value),1),J.value&&q.value?(f(),u(`div`,se,[l(`div`,ce,[t[2]||=l(`strong`,null,`Configuration:`,-1),c(` SF`+r(q.value.spreading_factor)+` | Peak: `+r(q.value.peak_min)+` - `+r(q.value.peak_max)+` | Min: `+r(q.value.min_min)+` - `+r(q.value.min_max)+` | `+r((q.value.peak_max-q.value.peak_min+1)*(q.value.min_max-q.value.min_min+1))+` tests `,1)])])):o(``,!0),l(`div`,le,[l(`div`,ue,[l(`div`,{class:`bg-gradient-to-r from-primary to-accent-green h-2 rounded-full transition-all duration-300`,style:d({width:H.value>0?`${V.value/H.value*100}%`:`0%`})},null,4)]),l(`div`,de,r(V.value)+` / `+r(H.value)+` tests completed `,1)])]),l(`div`,x,[l(`div`,fe,[l(`div`,S,r(U.value),1),t[3]||=l(`div`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Tests Completed`,-1)]),l(`div`,C,[l(`div`,w,r(W.value.toFixed(1))+`%`,1),t[4]||=l(`div`,{class:`text-content-secondary dark:text-content-muted text-sm`},` Best Detection Rate `,-1)]),l(`div`,T,[l(`div`,E,r(G.value.toFixed(1))+`%`,1),t[5]||=l(`div`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Average Rate`,-1)]),l(`div`,D,[l(`div`,O,r(K.value)+`s`,1),t[6]||=l(`div`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Elapsed Time`,-1)])]),t[15]||=l(`div`,{class:`glass-card rounded-[15px] p-6`},[l(`div`,{id:`plotly-chart`,class:`w-full h-96`})],-1),Y.value?(f(),u(`div`,k,[t[13]||=l(`h3`,{class:`text-xl font-bold text-content-primary dark:text-content-primary`},` Calibration Results `,-1),X.value&&L.value?(f(),u(`div`,A,[t[11]||=l(`h4`,{class:`font-medium text-accent-green mb-2`},`Optimal Settings Found:`,-1),l(`p`,j,[t[7]||=c(` Peak: `,-1),l(`strong`,null,r(L.value.det_peak),1),t[8]||=c(`, Min: `,-1),l(`strong`,null,r(L.value.det_min),1),t[9]||=c(`, Rate: `,-1),l(`strong`,null,r(L.value.detection_rate.toFixed(1))+`%`,1)]),l(`div`,{class:`flex justify-center`},[l(`button`,{onClick:xe,class:`flex items-center gap-3 px-6 py-3 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors`},[...t[10]||=[i(`
Save Settings
Apply to configuration
`,2)]])])])):o(``,!0),Z.value?(f(),u(`div`,M,[...t[12]||=[l(`h4`,{class:`font-medium text-secondary mb-2`},`No Optimal Settings Found`,-1),l(`p`,{class:`text-content-secondary dark:text-content-muted`},` All tested combinations showed low detection rates. Consider running calibration again or adjusting test parameters. `,-1)]])):o(``,!0)])):o(``,!0)]))}}),[[`__scopeId`,`data-v-60d82848`]]);export{N as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/CADCalibration-DnmufMQ0.css b/repeater/web/html/assets/CADCalibration-gZQwotT3.css similarity index 68% rename from repeater/web/html/assets/CADCalibration-DnmufMQ0.css rename to repeater/web/html/assets/CADCalibration-gZQwotT3.css index d158fa0..2fe46cd 100644 --- a/repeater/web/html/assets/CADCalibration-DnmufMQ0.css +++ b/repeater/web/html/assets/CADCalibration-gZQwotT3.css @@ -1 +1 @@ -.glass-card[data-v-c30e5f38]{background:var(--color-glass-bg);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid var(--color-glass-border);box-shadow:var(--color-glass-shadow)} +.glass-card[data-v-60d82848]{background:var(--color-glass-bg);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid var(--color-glass-border);box-shadow:var(--color-glass-shadow)} diff --git a/repeater/web/html/assets/Companions-Cx-FcUOx.js b/repeater/web/html/assets/Companions-Cx-FcUOx.js new file mode 100644 index 0000000..817847a --- /dev/null +++ b/repeater/web/html/assets/Companions-Cx-FcUOx.js @@ -0,0 +1 @@ +import{E as e,S as t,W as n,b as r,dt as i,f as a,g as o,j as s,k as c,l,lt as u,m as d,o as f,p,r as m,s as h,u as g,w as _,z as v}from"./runtime-core.esm-bundler-IofF4kUm.js";import{t as y}from"./api-CrUX-ZnK.js";import{c as b,d as x,l as S,m as C}from"./index-CPWfwDmA.js";import{t as w}from"./ConfirmDialog-BRvNEHEy.js";import{t as T}from"./MessageDialog-CSjABYko.js";var E={id:`import-modal-description`,class:`text-content-secondary dark:text-content-muted text-sm mb-4`},D={class:`mb-4`},O={class:`flex items-center gap-2 mb-2`},k={key:0,class:`text-content-muted dark:text-content-muted text-xs mb-2`},A={key:1,class:`flex flex-wrap gap-3 ml-6`},j=[`value`],M={class:`text-content-primary dark:text-content-primary text-sm capitalize`},N={class:`border-t border-stroke-subtle dark:border-white/10 pt-4 mt-4 mb-4`},P={class:`flex flex-wrap gap-3 mb-2`},F=[`value`],ee={class:`text-content-primary dark:text-content-primary text-sm`},te={class:`flex flex-wrap items-center gap-2 mt-2`},ne={class:`flex items-center gap-2`},I={key:1,class:`text-content-muted dark:text-content-muted text-sm`},L={class:`border-t border-stroke-subtle dark:border-white/10 pt-4 mt-4 mb-4`},R={class:`flex flex-wrap items-center gap-2`},z={key:0,role:`alert`,class:`mb-4 p-3 rounded-lg bg-accent-red/10 dark:bg-accent-red/20 border border-accent-red/30 text-accent-red text-sm`},B={key:1,class:`text-content-muted dark:text-content-muted text-sm mb-4`},V={class:`flex justify-end gap-3`},H=[`disabled`],U=[`disabled`],W=o({name:`ImportRepeaterContactsModal`,__name:`ImportRepeaterContactsModal`,props:{isOpen:{type:Boolean},companionName:{}},emits:[`close`,`imported`],setup(t,{emit:a}){let o=[`companion`,`repeater`,`room_server`,`sensor`],u=[{label:`All time`,value:null},{label:`Last 24 hours`,value:24},{label:`Last 7 days`,value:168},{label:`Last 30 days`,value:720},{label:`Custom`,value:`custom`}].slice(0,4),d=t,w=a,T=v(!1),W=v(null),G=v(!0),K=v([]),q=v(null),J=v(``),Y=v(``),X=v(null),Z=v(null);function Q(){let e=q.value;if(e===null||e===`custom`){if(e===`custom`){let e=J.value;if(e===``||e===null)return;let t=Number(e);return Number.isInteger(t)&&t>=1?t:void 0}return}return e}function $(){let e=Y.value;if(e===``||e===null)return;let t=Number(e);return Number.isInteger(t)&&t>=1?t:void 0}function re(){G.value=!0,K.value=[],q.value=null,J.value=``,Y.value=``,W.value=null}c(()=>d.isOpen,e=>{e&&(re(),r(()=>{Z.value?.focus()}))}),c(q,e=>{e===`custom`&&r(()=>{X.value?.focus()})});let ie=f(()=>{let e=G.value?`All types`:K.value.map(e=>e.replace(`_`,` `)).join(`, `),t,n=q.value;if(n===null)t=`all time`;else if(n===`custom`){let e=Q();t=e===void 0?`custom`:`last ${e} hours`}else t=n===24?`last 24 hours`:n===168?`last 7 days`:n===720?`last 30 days`:`all time`;let r=$(),i=r===void 0?`no limit`:`max ${r} contacts`;return`Import: ${e}, ${t}, ${i}.`});function ae(){if(q.value===`custom`){let e=Q();if(e===void 0||e<1)return`Custom recency must be at least 1 hour.`}let e=$();if(Y.value!==``&&(e===void 0||e<1))return`Limit must be at least 1.`;if(!G.value&&K.value.length===0)return`Select at least one contact type or use All types.`;if(!G.value){let e=K.value.filter(e=>!o.includes(e));if(e.length>0)return`Invalid contact type: ${e.join(`, `)}`}return null}async function oe(){W.value=null;let e=ae();if(e){W.value=e;return}let t={companion_name:d.companionName};!G.value&&K.value.length>0&&(t.contact_types=[...K.value]);let n=Q();n!==void 0&&(t.hours=n);let r=$();r!==void 0&&(t.limit=r),T.value=!0;try{let e=await y.importRepeaterContacts(t);e.success&&e.data?(w(`imported`,e.data.imported),w(`close`)):W.value=e.error||`Import failed.`}catch(e){W.value=e instanceof Error?e.message:`Import failed.`}finally{T.value=!1}}function se(e){e.target===e.currentTarget&&w(`close`)}function ce(e){e.key===`Escape`&&w(`close`)}return(r,a)=>t.isOpen?(_(),g(`div`,{key:0,class:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`,onClick:se,onKeydown:ce},[h(`div`,{role:`dialog`,"aria-describedby":`import-modal-description`,class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-lg w-full max-h-[90vh] overflow-y-auto`,onClick:a[7]||=C(()=>{},[`stop`])},[a[18]||=h(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary mb-4`},` Import repeater contacts `,-1),h(`p`,E,[a[8]||=p(` Seed `,-1),h(`strong`,null,i(t.companionName),1),a[9]||=p(` with contacts from the repeater's adverts. Results are ordered by most recent first. `,-1)]),h(`div`,D,[a[11]||=h(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},` Contact types `,-1),h(`label`,O,[s(h(`input`,{ref_key:`firstFocusRef`,ref:Z,"onUpdate:modelValue":a[0]||=e=>G.value=e,type:`checkbox`,class:`rounded border-stroke-subtle dark:border-stroke/20 text-primary focus:ring-primary/50`},null,512),[[b,G.value]]),a[10]||=h(`span`,{class:`text-content-primary dark:text-content-primary text-sm`},`All types`,-1)]),G.value?(_(),g(`p`,k,` Uncheck to filter by type (repeater, companion, room server, sensor). `)):l(``,!0),G.value?l(``,!0):(_(),g(`div`,A,[(_(),g(m,null,e(o,e=>h(`label`,{key:e,class:`flex items-center gap-2`},[s(h(`input`,{"onUpdate:modelValue":a[1]||=e=>K.value=e,type:`checkbox`,value:e,class:`rounded border-stroke-subtle dark:border-stroke/20 text-primary focus:ring-primary/50`},null,8,j),[[b,K.value]]),h(`span`,M,i(e.replace(`_`,` `)),1)])),64))]))]),h(`div`,N,[a[13]||=h(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},` Recency `,-1),h(`div`,P,[(_(!0),g(m,null,e(n(u),e=>(_(),g(`label`,{key:e.label,class:`flex items-center gap-2`},[s(h(`input`,{"onUpdate:modelValue":a[2]||=e=>q.value=e,type:`radio`,value:e.value,class:`border-stroke-subtle dark:border-stroke/20 text-primary focus:ring-primary/50`},null,8,F),[[S,q.value]]),h(`span`,ee,i(e.label),1)]))),128))]),h(`div`,te,[h(`label`,ne,[s(h(`input`,{"onUpdate:modelValue":a[3]||=e=>q.value=e,type:`radio`,value:`custom`,class:`border-stroke-subtle dark:border-stroke/20 text-primary focus:ring-primary/50`},null,512),[[S,q.value]]),a[12]||=h(`span`,{class:`text-content-primary dark:text-content-primary text-sm`},`Custom:`,-1)]),q.value===`custom`?s((_(),g(`input`,{key:0,ref_key:`customHoursInputRef`,ref:X,"onUpdate:modelValue":a[4]||=e=>J.value=e,type:`number`,min:`1`,placeholder:`e.g. 48`,class:`w-24 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-3 py-1.5 text-content-primary dark:text-content-primary text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50`},null,512)),[[x,J.value,void 0,{number:!0}]]):l(``,!0),q.value===`custom`?(_(),g(`span`,I,`hours`)):l(``,!0)])]),h(`div`,L,[a[16]||=h(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},` Max contacts (optional) `,-1),h(`div`,R,[a[14]||=h(`span`,{class:`text-content-muted dark:text-content-muted text-sm`},`Import at most`,-1),s(h(`input`,{"onUpdate:modelValue":a[5]||=e=>Y.value=e,type:`number`,inputmode:`numeric`,min:`1`,placeholder:`No limit`,class:`w-32 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50`},null,512),[[x,Y.value,void 0,{number:!0}]]),a[15]||=h(`span`,{class:`text-content-muted dark:text-content-muted text-sm`},`contacts`,-1)]),a[17]||=h(`p`,{class:`text-content-muted dark:text-content-muted text-xs mt-1`},` Leave empty for no cap. Server caps at companion max. `,-1)]),W.value?(_(),g(`div`,z,i(W.value),1)):l(``,!0),W.value?l(``,!0):(_(),g(`p`,B,i(ie.value),1)),h(`div`,V,[h(`button`,{type:`button`,disabled:T.value,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors disabled:opacity-50`,onClick:a[6]||=e=>w(`close`)},` Cancel `,8,H),h(`button`,{type:`button`,disabled:T.value,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors disabled:opacity-50`,onClick:oe},i(T.value?`Importing…`:`Import`),9,U)])])],32)):l(``,!0)}}),G={class:`p-6 space-y-6`},K={key:0,class:`grid grid-cols-1 md:grid-cols-2 gap-4`},q={class:`group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5`},J={class:`relative flex items-center justify-between`},Y={class:`text-3xl font-bold text-content-primary dark:text-content-primary`},X={class:`glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6`},Z={key:0,class:`flex items-center justify-center py-12`},Q={key:1,class:`flex items-center justify-center py-12`},$={class:`text-center`},re={class:`text-content-secondary dark:text-content-muted text-sm mb-4`},ie={key:2,class:`space-y-4`},ae={class:`relative flex items-start justify-between`},oe={class:`flex-1`},se={class:`flex items-center gap-3 mb-4`},ce={class:`relative`},le={key:0,class:`absolute inset-0 bg-accent-green/50 rounded-full animate-ping`},ue={class:`text-xl font-bold text-content-primary dark:text-content-primary`},de={key:0,class:`text-content-muted dark:text-content-muted text-sm`},fe={class:`grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3`},pe={class:`text-content-primary dark:text-content-primary/90 ml-2`},me={class:`text-content-primary dark:text-content-primary/90 ml-2`},he={class:`text-content-primary dark:text-content-primary/90 ml-2`},ge={class:`flex items-center gap-2`},_e={key:0,class:`text-content-primary dark:text-content-primary/90 font-mono ml-2 text-xs`},ve={key:1,class:`text-content-muted dark:text-content-muted ml-2 text-xs`},ye=[`onClick`],be={class:`text-xs text-content-muted dark:text-content-muted`},xe={key:0,class:`ml-2 font-mono text-content-primary dark:text-content-primary/90 break-all`},Se={key:1,class:`ml-2 text-content-muted dark:text-content-muted`},Ce={class:`ml-4 flex flex-wrap gap-2`},we=[`onClick`],Te=[`onClick`],Ee=[`onClick`],De={key:3,class:`text-center py-12 text-content-secondary dark:text-content-muted`},Oe={key:1,class:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`},ke={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto`},Ae={class:`space-y-4`},je={class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},Me={key:0},Ne={key:1,class:`text-content-secondary dark:text-content-muted text-sm`},Pe={class:`grid grid-cols-2 gap-4`},Fe={key:2,class:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`},Ie={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto`},Le={class:`space-y-4`},Re=[`value`],ze={class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},Be={key:0},Ve={class:`grid grid-cols-2 gap-4`},He=5050,Ue=1,We=65535,Ge=o({name:`CompanionsView`,__name:`Companions`,setup(n){let r=v(!1),o=v(null),c=v(null),f=v(!1),b=v(!1),S=v(null),C=v(!1),E=v(!1),D=v(new Set),O=v(!1),k=v(``),A=v(!1),j=v(``),M=v(!1),N=v({message:``,variant:`success`}),P=v({name:``,identity_key:``,type:`companion`,settings:{node_name:``,tcp_port:5e3,bind_address:`0.0.0.0`}});t(async()=>{await F()});async function F(){r.value=!0,o.value=null;try{let e=await y.getIdentities();e.success?c.value=e.data:o.value=e.error||`Failed to load identities`}catch(e){o.value=e instanceof Error?e.message:`Failed to load identities`}finally{r.value=!1}}async function ee(){try{let e=await y.createIdentity({...P.value,settings:{node_name:P.value.settings.node_name||P.value.name,tcp_port:P.value.settings.tcp_port??5e3,bind_address:P.value.settings.bind_address||`0.0.0.0`}});e.success?(f.value=!1,z(),await F(),L(e.message||`Companion created successfully!`,`success`)):L(`Failed to create companion: ${e.error}`,`error`)}catch(e){L(`Error creating companion: ${e}`,`error`)}}async function te(){try{let e=await y.updateIdentity({name:S.value.name,new_name:S.value.new_name,identity_key:S.value.identity_key,type:`companion`,settings:{node_name:S.value.settings?.node_name,tcp_port:S.value.settings?.tcp_port,bind_address:S.value.settings?.bind_address}});e.success?(b.value=!1,S.value=null,await F(),L(e.message||`Companion updated successfully!`,`success`)):L(`Failed to update companion: ${e.error}`,`error`)}catch(e){L(`Error updating companion: ${e}`,`error`)}}function ne(e){k.value=e,O.value=!0}async function I(){let e=k.value;O.value=!1;try{let t=await y.deleteIdentity(e,`companion`);t.success?(await F(),L(t.message||`Companion deleted successfully!`,`success`)):L(`Failed to delete companion: ${t.error}`,`error`)}catch(e){L(`Error deleting companion: ${e}`,`error`)}finally{k.value=``}}function L(e,t){N.value={message:e,variant:t},M.value=!0}function R(e){S.value=JSON.parse(JSON.stringify(e)),S.value.settings||(S.value.settings={node_name:``,tcp_port:5e3,bind_address:`0.0.0.0`}),S.value.new_name=``,E.value=!1,b.value=!0}function z(){P.value={name:``,identity_key:``,type:`companion`,settings:{node_name:``,tcp_port:5e3,bind_address:`0.0.0.0`}},C.value=!1}function B(){f.value=!1,b.value=!1,S.value=null,C.value=!1,E.value=!1,z()}function V(e){D.value.has(e)?D.value.delete(e):D.value.add(e)}let H=()=>c.value?.configured_companions??[],U=()=>c.value?.total_configured_companions??0;function Ge(){let e=H();if(e.length===0)return He;let t=e.map(e=>e.settings?.tcp_port??5e3),n=Math.max(...t)+1;return Math.min(We,Math.max(Ue,n))}function Ke(){z(),P.value.settings.tcp_port=Ge(),f.value=!0}function qe(e){j.value=e,A.value=!0}function Je(){A.value=!1,j.value=``}function Ye(e){L(`Imported ${e} contact${e===1?``:`s`}.`,`success`),Je()}return(t,n)=>(_(),g(m,null,[h(`div`,G,[h(`div`,{class:`relative overflow-hidden rounded-[20px] p-6 mb-6 glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10`},[n[16]||=h(`div`,{class:`absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50`},null,-1),n[17]||=h(`div`,{class:`absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse`},null,-1),h(`div`,{class:`relative flex items-center justify-between`},[n[15]||=a(`

Companions

Manage companion identities (TCP frame server)

`,1),h(`button`,{onClick:Ke,class:`group relative px-6 py-3 bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary rounded-[12px] border border-primary/50 transition-all hover:scale-105 hover:shadow-lg hover:shadow-primary/20`},[...n[14]||=[h(`span`,{class:`flex items-center gap-2`},[h(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})]),p(` Add Companion `)],-1)]])])]),c.value&&U()>0?(_(),g(`div`,K,[h(`div`,q,[h(`div`,J,[h(`div`,null,[n[18]||=h(`div`,{class:`text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide`},` Total Configured `,-1),h(`div`,Y,i(U()),1)])])])])):l(``,!0),h(`div`,X,[r.value?(_(),g(`div`,Z,[...n[19]||=[h(`div`,{class:`text-center`},[h(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4`}),h(`div`,{class:`text-content-secondary dark:text-content-primary/70`},` Loading companions... `)],-1)]])):o.value?(_(),g(`div`,Q,[h(`div`,$,[n[20]||=h(`div`,{class:`text-red-600 dark:text-red-400 mb-2`},`Failed to load companions`,-1),h(`div`,re,i(o.value),1),h(`button`,{onClick:F,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors`},` Retry `)])])):c.value&&H().length>0?(_(),g(`div`,ie,[(_(!0),g(m,null,e(H(),e=>(_(),g(`div`,{key:e.name,class:`group relative overflow-hidden glass-card backdrop-blur-xl rounded-[15px] p-5 border border-stroke-subtle dark:border-white/10 hover:border-primary/30 transition-all duration-300`},[h(`div`,ae,[h(`div`,oe,[h(`div`,se,[h(`div`,ce,[e.registered?(_(),g(`div`,le)):l(``,!0),h(`div`,{class:u([`relative w-3 h-3 rounded-full`,e.registered?`bg-accent-green`:`bg-accent-red`])},null,2)]),h(`h3`,ue,i(e.name),1),h(`span`,{class:u([`px-3 py-1 text-xs font-semibold rounded-full`,e.registered?`bg-accent-green/20 text-accent-green border border-accent-green/30`:`bg-accent-red/20 text-accent-red border border-accent-red/30`])},i(e.registered?`● Active`:`○ Inactive`),3),e.hash?(_(),g(`span`,de,i(e.hash),1)):l(``,!0)]),h(`div`,fe,[h(`div`,null,[n[21]||=h(`span`,{class:`text-content-muted dark:text-content-muted`},`Node Name:`,-1),h(`span`,pe,i(e.settings?.node_name||e.name),1)]),h(`div`,null,[n[22]||=h(`span`,{class:`text-content-muted dark:text-content-muted`},`TCP Port:`,-1),h(`span`,me,i(e.settings?.tcp_port??5e3),1)]),h(`div`,null,[n[23]||=h(`span`,{class:`text-content-muted dark:text-content-muted`},`Bind Address:`,-1),h(`span`,he,i(e.settings?.bind_address||`0.0.0.0`),1)]),h(`div`,ge,[n[24]||=h(`span`,{class:`text-content-muted dark:text-content-muted`},`Identity Key:`,-1),D.value.has(e.name)?(_(),g(`span`,_e,i(e.identity_key),1)):(_(),g(`span`,ve,`••••••••••••••••`)),h(`button`,{onClick:t=>V(e.name),class:`text-primary/70 hover:text-primary text-xs underline`},i(D.value.has(e.name)?`Hide`:`Show`),9,ye)])]),h(`div`,be,[n[25]||=h(`span`,{class:`text-content-muted dark:text-content-muted`},`Public Key:`,-1),e.public_key?(_(),g(`span`,xe,i(e.public_key),1)):(_(),g(`span`,Se,`—`))])]),h(`div`,Ce,[h(`button`,{onClick:t=>qe(e.name),class:`px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors`},` Import contacts `,8,we),h(`button`,{onClick:t=>R(e),class:`px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors`},` Edit `,8,Te),h(`button`,{onClick:t=>ne(e.name),class:`px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors`},` Delete `,8,Ee)])])]))),128))])):(_(),g(`div`,De,[n[26]||=h(`svg`,{class:`w-16 h-16 mx-auto mb-4 text-content-muted dark:text-content-muted/60`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[h(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z`})],-1),n[27]||=h(`p`,{class:`text-lg mb-2`},`No companions configured`,-1),n[28]||=h(`p`,{class:`text-sm mb-4`},` Add a companion to run a TCP frame server for firmware or other clients `,-1),h(`button`,{onClick:Ke,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors`},` + Add Companion `)]))]),f.value?(_(),g(`div`,Oe,[h(`div`,ke,[n[35]||=h(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary mb-4`},` Add Companion `,-1),h(`div`,Ae,[h(`div`,null,[n[29]||=h(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Name *`,-1),s(h(`input`,{"onUpdate:modelValue":n[0]||=e=>P.value.name=e,type:`text`,placeholder:`e.g., TestCompanion`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[x,P.value.name]])]),h(`div`,null,[h(`label`,je,[n[30]||=p(` Identity Key (Optional) `,-1),h(`button`,{onClick:n[1]||=e=>C.value=!C.value,type:`button`,class:`ml-2 text-primary/70 hover:text-primary text-xs underline`},i(C.value?`Hide`:`Show/Edit`),1)]),C.value?(_(),g(`div`,Me,[s(h(`input`,{"onUpdate:modelValue":n[2]||=e=>P.value.identity_key=e,type:`text`,placeholder:`Leave empty to auto-generate (32 bytes hex)`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[x,P.value.identity_key]]),n[31]||=h(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` 32 or 64 bytes hex. Leave empty to auto-generate. `,-1)])):(_(),g(`div`,Ne,` Will be auto-generated if not provided `))]),h(`div`,null,[n[32]||=h(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Node Name`,-1),s(h(`input`,{"onUpdate:modelValue":n[3]||=e=>P.value.settings.node_name=e,type:`text`,placeholder:`Display name (defaults to Name)`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[x,P.value.settings.node_name]])]),h(`div`,Pe,[h(`div`,null,[n[33]||=h(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`TCP Port`,-1),s(h(`input`,{"onUpdate:modelValue":n[4]||=e=>P.value.settings.tcp_port=e,type:`number`,min:`1`,max:`65535`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[x,P.value.settings.tcp_port,void 0,{number:!0}]])]),h(`div`,null,[n[34]||=h(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Bind Address`,-1),s(h(`input`,{"onUpdate:modelValue":n[5]||=e=>P.value.settings.bind_address=e,type:`text`,placeholder:`0.0.0.0`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[x,P.value.settings.bind_address]])])])]),h(`div`,{class:`flex justify-end gap-3 mt-6`},[h(`button`,{onClick:B,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors`},` Cancel `),h(`button`,{onClick:ee,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors`},` Create `)])])])):l(``,!0),b.value&&S.value?(_(),g(`div`,Fe,[h(`div`,Ie,[n[42]||=h(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary mb-4`},` Edit Companion `,-1),h(`div`,Le,[h(`div`,null,[n[36]||=h(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Current Name`,-1),h(`input`,{value:S.value.name,disabled:``,type:`text`,class:`w-full bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-muted dark:text-content-muted cursor-not-allowed`},null,8,Re)]),h(`div`,null,[n[37]||=h(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`New Name (optional)`,-1),s(h(`input`,{"onUpdate:modelValue":n[6]||=e=>S.value.new_name=e,type:`text`,placeholder:`Leave empty to keep current name`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[x,S.value.new_name]])]),h(`div`,null,[h(`label`,ze,[n[38]||=p(` Identity Key (Optional) `,-1),h(`button`,{onClick:n[7]||=e=>E.value=!E.value,type:`button`,class:`ml-2 text-primary/70 hover:text-primary text-xs underline`},i(E.value?`Hide`:`Show/Edit`),1)]),E.value?(_(),g(`div`,Be,[s(h(`input`,{"onUpdate:modelValue":n[8]||=e=>S.value.identity_key=e,type:`text`,placeholder:`Leave empty to keep current key`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[x,S.value.identity_key]])])):l(``,!0)]),h(`div`,null,[n[39]||=h(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Node Name`,-1),s(h(`input`,{"onUpdate:modelValue":n[9]||=e=>S.value.settings.node_name=e,type:`text`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[x,S.value.settings.node_name]])]),h(`div`,Ve,[h(`div`,null,[n[40]||=h(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`TCP Port`,-1),s(h(`input`,{"onUpdate:modelValue":n[10]||=e=>S.value.settings.tcp_port=e,type:`number`,min:`1`,max:`65535`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[x,S.value.settings.tcp_port,void 0,{number:!0}]])]),h(`div`,null,[n[41]||=h(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Bind Address`,-1),s(h(`input`,{"onUpdate:modelValue":n[11]||=e=>S.value.settings.bind_address=e,type:`text`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[x,S.value.settings.bind_address]])])])]),h(`div`,{class:`flex justify-end gap-3 mt-6`},[h(`button`,{onClick:B,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors`},` Cancel `),h(`button`,{onClick:te,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors`},` Update `)])])])):l(``,!0)]),d(W,{"is-open":A.value,"companion-name":j.value,onClose:Je,onImported:Ye},null,8,[`is-open`,`companion-name`]),d(w,{show:O.value,title:`Delete Companion`,message:`Are you sure you want to delete '${k.value}'? Restart required to fully remove.`,"confirm-text":`Delete`,"cancel-text":`Cancel`,variant:`danger`,onClose:n[12]||=e=>O.value=!1,onConfirm:I},null,8,[`show`,`message`]),d(T,{show:M.value,message:N.value.message,variant:N.value.variant,onClose:n[13]||=e=>M.value=!1},null,8,[`show`,`message`,`variant`])],64))}});export{Ge as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/Companions-dkXrpFyo.js b/repeater/web/html/assets/Companions-dkXrpFyo.js deleted file mode 100644 index d6b97ca..0000000 --- a/repeater/web/html/assets/Companions-dkXrpFyo.js +++ /dev/null @@ -1 +0,0 @@ -import{a as ee,r as u,E as J,c as oe,e as d,h as g,f as e,l as j,t as p,w as b,$ as X,F as L,i as z,u as ne,W as G,v as _,x as se,L as A,q as i,H as Q,o as ae,g as K,j as le,k as Z}from"./index-xzvnOpJo.js";import{_ as de}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-7siCLFWH.js";import{_ as ie}from"./MessageDialog.vue_vue_type_script_setup_true_lang-SzTqrYUh.js";const ue={id:"import-modal-description",class:"text-content-secondary dark:text-content-muted text-sm mb-4"},ce={class:"mb-4"},pe={class:"flex items-center gap-2 mb-2"},me={key:0,class:"text-content-muted dark:text-content-muted text-xs mb-2"},be={key:1,class:"flex flex-wrap gap-3 ml-6"},ve=["value"],xe={class:"text-content-primary dark:text-content-primary text-sm capitalize"},ye={class:"border-t border-stroke-subtle dark:border-white/10 pt-4 mt-4 mb-4"},ke={class:"flex flex-wrap gap-3 mb-2"},ge=["value"],fe={class:"text-content-primary dark:text-content-primary text-sm"},we={class:"flex flex-wrap items-center gap-2 mt-2"},he={class:"flex items-center gap-2"},_e={key:1,class:"text-content-muted dark:text-content-muted text-sm"},Ce={class:"border-t border-stroke-subtle dark:border-white/10 pt-4 mt-4 mb-4"},$e={class:"flex flex-wrap items-center gap-2"},Ie={key:0,role:"alert",class:"mb-4 p-3 rounded-lg bg-accent-red/10 dark:bg-accent-red/20 border border-accent-red/30 text-accent-red text-sm"},Me={key:1,class:"text-content-muted dark:text-content-muted text-sm mb-4"},Ne={class:"flex justify-end gap-3"},Ee=["disabled"],Ve=["disabled"],Se=ee({name:"ImportRepeaterContactsModal",__name:"ImportRepeaterContactsModal",props:{isOpen:{type:Boolean},companionName:{}},emits:["close","imported"],setup(Y,{emit:P}){const I=["companion","repeater","room_server","sensor"],V=[{label:"All time",value:null},{label:"Last 24 hours",value:24},{label:"Last 7 days",value:168},{label:"Last 30 days",value:720},{label:"Custom",value:"custom"}].slice(0,4),N=Y,l=P,f=u(!1),v=u(null),x=u(!0),y=u([]),m=u(null),M=u(""),C=u(""),S=u(null),T=u(null);function c(){const a=m.value;if(a===null||a==="custom"){if(a==="custom"){const r=M.value;if(r===""||r===null)return;const s=Number(r);return Number.isInteger(s)&&s>=1?s:void 0}return}return a}function $(){const a=C.value;if(a===""||a===null)return;const r=Number(a);return Number.isInteger(r)&&r>=1?r:void 0}function D(){x.value=!0,y.value=[],m.value=null,M.value="",C.value="",v.value=null}J(()=>N.isOpen,a=>{a&&(D(),Q(()=>{T.value?.focus()}))}),J(m,a=>{a==="custom"&&Q(()=>{S.value?.focus()})});const O=oe(()=>{const a=x.value?"All types":y.value.map(R=>R.replace("_"," ")).join(", ");let r;const s=m.value;if(s===null)r="all time";else if(s==="custom"){const R=c();r=R!==void 0?`last ${R} hours`:"custom"}else s===24?r="last 24 hours":s===168?r="last 7 days":s===720?r="last 30 days":r="all time";const k=$(),h=k!==void 0?`max ${k} contacts`:"no limit";return`Import: ${a}, ${r}, ${h}.`});function F(){if(m.value==="custom"){const r=c();if(r===void 0||r<1)return"Custom recency must be at least 1 hour."}const a=$();if(C.value!==""&&(a===void 0||a<1))return"Limit must be at least 1.";if(!x.value&&y.value.length===0)return"Select at least one contact type or use All types.";if(!x.value){const r=y.value.filter(s=>!I.includes(s));if(r.length>0)return`Invalid contact type: ${r.join(", ")}`}return null}async function H(){v.value=null;const a=F();if(a){v.value=a;return}const r={companion_name:N.companionName};!x.value&&y.value.length>0&&(r.contact_types=[...y.value]);const s=c();s!==void 0&&(r.hours=s);const k=$();k!==void 0&&(r.limit=k),f.value=!0;try{const h=await A.importRepeaterContacts(r);h.success&&h.data?(l("imported",h.data.imported),l("close")):v.value=h.error||"Import failed."}catch(h){v.value=h instanceof Error?h.message:"Import failed."}finally{f.value=!1}}function w(a){a.target===a.currentTarget&&l("close")}function B(a){a.key==="Escape"&&l("close")}return(a,r)=>a.isOpen?(i(),d("div",{key:0,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4",onClick:w,onKeydown:B},[e("div",{role:"dialog","aria-describedby":"import-modal-description",class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-lg w-full max-h-[90vh] overflow-y-auto",onClick:r[7]||(r[7]=se(()=>{},["stop"]))},[r[18]||(r[18]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"}," Import repeater contacts ",-1)),e("p",ue,[r[8]||(r[8]=j(" Seed ",-1)),e("strong",null,p(a.companionName),1),r[9]||(r[9]=j(" with contacts from the repeater's adverts. Results are ordered by most recent first. ",-1))]),e("div",ce,[r[11]||(r[11]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"}," Contact types ",-1)),e("label",pe,[b(e("input",{ref_key:"firstFocusRef",ref:T,"onUpdate:modelValue":r[0]||(r[0]=s=>x.value=s),type:"checkbox",class:"rounded border-stroke-subtle dark:border-stroke/20 text-primary focus:ring-primary/50"},null,512),[[X,x.value]]),r[10]||(r[10]=e("span",{class:"text-content-primary dark:text-content-primary text-sm"},"All types",-1))]),x.value?(i(),d("p",me," Uncheck to filter by type (repeater, companion, room server, sensor). ")):g("",!0),x.value?g("",!0):(i(),d("div",be,[(i(),d(L,null,z(I,s=>e("label",{key:s,class:"flex items-center gap-2"},[b(e("input",{"onUpdate:modelValue":r[1]||(r[1]=k=>y.value=k),type:"checkbox",value:s,class:"rounded border-stroke-subtle dark:border-stroke/20 text-primary focus:ring-primary/50"},null,8,ve),[[X,y.value]]),e("span",xe,p(s.replace("_"," ")),1)])),64))]))]),e("div",ye,[r[13]||(r[13]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"}," Recency ",-1)),e("div",ke,[(i(!0),d(L,null,z(ne(V),s=>(i(),d("label",{key:s.label,class:"flex items-center gap-2"},[b(e("input",{"onUpdate:modelValue":r[2]||(r[2]=k=>m.value=k),type:"radio",value:s.value,class:"border-stroke-subtle dark:border-stroke/20 text-primary focus:ring-primary/50"},null,8,ge),[[G,m.value]]),e("span",fe,p(s.label),1)]))),128))]),e("div",we,[e("label",he,[b(e("input",{"onUpdate:modelValue":r[3]||(r[3]=s=>m.value=s),type:"radio",value:"custom",class:"border-stroke-subtle dark:border-stroke/20 text-primary focus:ring-primary/50"},null,512),[[G,m.value]]),r[12]||(r[12]=e("span",{class:"text-content-primary dark:text-content-primary text-sm"},"Custom:",-1))]),m.value==="custom"?b((i(),d("input",{key:0,ref_key:"customHoursInputRef",ref:S,"onUpdate:modelValue":r[4]||(r[4]=s=>M.value=s),type:"number",min:"1",placeholder:"e.g. 48",class:"w-24 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-3 py-1.5 text-content-primary dark:text-content-primary text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50"},null,512)),[[_,M.value,void 0,{number:!0}]]):g("",!0),m.value==="custom"?(i(),d("span",_e,"hours")):g("",!0)])]),e("div",Ce,[r[16]||(r[16]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"}," Max contacts (optional) ",-1)),e("div",$e,[r[14]||(r[14]=e("span",{class:"text-content-muted dark:text-content-muted text-sm"},"Import at most",-1)),b(e("input",{"onUpdate:modelValue":r[5]||(r[5]=s=>C.value=s),type:"number",inputmode:"numeric",min:"1",placeholder:"No limit",class:"w-32 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50"},null,512),[[_,C.value,void 0,{number:!0}]]),r[15]||(r[15]=e("span",{class:"text-content-muted dark:text-content-muted text-sm"},"contacts",-1))]),r[17]||(r[17]=e("p",{class:"text-content-muted dark:text-content-muted text-xs mt-1"},"Leave empty for no cap. Server caps at companion max.",-1))]),v.value?(i(),d("div",Ie,p(v.value),1)):g("",!0),v.value?g("",!0):(i(),d("p",Me,p(O.value),1)),e("div",Ne,[e("button",{type:"button",disabled:f.value,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors disabled:opacity-50",onClick:r[6]||(r[6]=s=>l("close"))}," Cancel ",8,Ee),e("button",{type:"button",disabled:f.value,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors disabled:opacity-50",onClick:H},p(f.value?"Importing…":"Import"),9,Ve)])])],32)):g("",!0)}}),Te={class:"p-6 space-y-6"},Re={key:0,class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Pe={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5"},Ue={class:"relative flex items-center justify-between"},Ae={class:"text-3xl font-bold text-content-primary dark:text-content-primary"},je={class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6"},Le={key:0,class:"flex items-center justify-center py-12"},De={key:1,class:"flex items-center justify-center py-12"},Oe={class:"text-center"},Fe={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},He={key:2,class:"space-y-4"},Be={class:"relative flex items-start justify-between"},Ke={class:"flex-1"},ze={class:"flex items-center gap-3 mb-4"},Ye={class:"relative"},We={key:0,class:"absolute inset-0 bg-accent-green/50 rounded-full animate-ping"},qe={class:"text-xl font-bold text-content-primary dark:text-content-primary"},Je={key:0,class:"text-content-muted dark:text-content-muted text-sm"},Xe={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3"},Ge={class:"text-content-primary dark:text-content-primary/90 ml-2"},Qe={class:"text-content-primary dark:text-content-primary/90 ml-2"},Ze={class:"text-content-primary dark:text-content-primary/90 ml-2"},et={class:"flex items-center gap-2"},tt={key:0,class:"text-content-primary dark:text-content-primary/90 font-mono ml-2 text-xs"},rt={key:1,class:"text-content-muted dark:text-content-muted ml-2 text-xs"},ot=["onClick"],nt={class:"text-xs text-content-muted dark:text-content-muted"},st={key:0,class:"ml-2 font-mono text-content-primary dark:text-content-primary/90 break-all"},at={key:1,class:"ml-2 text-content-muted dark:text-content-muted"},lt={class:"ml-4 flex flex-wrap gap-2"},dt=["onClick"],it=["onClick"],ut=["onClick"],ct={key:3,class:"text-center py-12 text-content-secondary dark:text-content-muted"},pt={key:1,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},mt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},bt={class:"space-y-4"},vt={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},xt={key:0},yt={key:1,class:"text-content-secondary dark:text-content-muted text-sm"},kt={class:"grid grid-cols-2 gap-4"},gt={key:2,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},ft={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},wt={class:"space-y-4"},ht=["value"],_t={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},Ct={key:0},$t={class:"grid grid-cols-2 gap-4"},It=5050,Mt=1,Nt=65535,Tt=ee({name:"CompanionsView",__name:"Companions",setup(Y){const P=u(!1),I=u(null),E=u(null),V=u(!1),N=u(!1),l=u(null),f=u(!1),v=u(!1),x=u(new Set),y=u(!1),m=u(""),M=u(!1),C=u(""),S=u(!1),T=u({message:"",variant:"success"}),c=u({name:"",identity_key:"",type:"companion",settings:{node_name:"",tcp_port:5e3,bind_address:"0.0.0.0"}});ae(async()=>{await $()});async function $(){P.value=!0,I.value=null;try{const n=await A.getIdentities();n.success?E.value=n.data:I.value=n.error||"Failed to load identities"}catch(n){I.value=n instanceof Error?n.message:"Failed to load identities"}finally{P.value=!1}}async function D(){try{const n=await A.createIdentity({...c.value,settings:{node_name:c.value.settings.node_name||c.value.name,tcp_port:c.value.settings.tcp_port??5e3,bind_address:c.value.settings.bind_address||"0.0.0.0"}});n.success?(V.value=!1,a(),await $(),w(n.message||"Companion created successfully!","success")):w(`Failed to create companion: ${n.error}`,"error")}catch(n){w(`Error creating companion: ${n}`,"error")}}async function O(){try{const n=await A.updateIdentity({name:l.value.name,new_name:l.value.new_name,identity_key:l.value.identity_key,type:"companion",settings:{node_name:l.value.settings?.node_name,tcp_port:l.value.settings?.tcp_port,bind_address:l.value.settings?.bind_address}});n.success?(N.value=!1,l.value=null,await $(),w(n.message||"Companion updated successfully!","success")):w(`Failed to update companion: ${n.error}`,"error")}catch(n){w(`Error updating companion: ${n}`,"error")}}function F(n){m.value=n,y.value=!0}async function H(){const n=m.value;y.value=!1;try{const t=await A.deleteIdentity(n,"companion");t.success?(await $(),w(t.message||"Companion deleted successfully!","success")):w(`Failed to delete companion: ${t.error}`,"error")}catch(t){w(`Error deleting companion: ${t}`,"error")}finally{m.value=""}}function w(n,t){T.value={message:n,variant:t},S.value=!0}function B(n){l.value=JSON.parse(JSON.stringify(n)),l.value.settings||(l.value.settings={node_name:"",tcp_port:5e3,bind_address:"0.0.0.0"}),l.value.new_name="",v.value=!1,N.value=!0}function a(){c.value={name:"",identity_key:"",type:"companion",settings:{node_name:"",tcp_port:5e3,bind_address:"0.0.0.0"}},f.value=!1}function r(){V.value=!1,N.value=!1,l.value=null,f.value=!1,v.value=!1,a()}function s(n){x.value.has(n)?x.value.delete(n):x.value.add(n)}const k=()=>E.value?.configured_companions??[],h=()=>E.value?.total_configured_companions??0;function R(){const n=k();if(n.length===0)return It;const t=n.map(U=>U.settings?.tcp_port??5e3),o=Math.max(...t)+1;return Math.min(Nt,Math.max(Mt,o))}function W(){a(),c.value.settings.tcp_port=R(),V.value=!0}function te(n){C.value=n,M.value=!0}function q(){M.value=!1,C.value=""}function re(n){w(`Imported ${n} contact${n===1?"":"s"}.`,"success"),q()}return(n,t)=>(i(),d(L,null,[e("div",Te,[e("div",{class:"relative overflow-hidden rounded-[20px] p-6 mb-6 glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10"},[t[16]||(t[16]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50"},null,-1)),t[17]||(t[17]=e("div",{class:"absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse"},null,-1)),e("div",{class:"relative flex items-center justify-between"},[t[15]||(t[15]=le('

Companions

Manage companion identities (TCP frame server)

',1)),e("button",{onClick:W,class:"group relative px-6 py-3 bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary rounded-[12px] border border-primary/50 transition-all hover:scale-105 hover:shadow-lg hover:shadow-primary/20"},t[14]||(t[14]=[e("span",{class:"flex items-center gap-2"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})]),j(" Add Companion ")],-1)]))])]),E.value&&h()>0?(i(),d("div",Re,[e("div",Pe,[e("div",Ue,[e("div",null,[t[18]||(t[18]=e("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Total Configured",-1)),e("div",Ae,p(h()),1)])])])])):g("",!0),e("div",je,[P.value?(i(),d("div",Le,t[19]||(t[19]=[e("div",{class:"text-center"},[e("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),e("div",{class:"text-content-secondary dark:text-content-primary/70"},"Loading companions...")],-1)]))):I.value?(i(),d("div",De,[e("div",Oe,[t[20]||(t[20]=e("div",{class:"text-red-600 dark:text-red-400 mb-2"},"Failed to load companions",-1)),e("div",Fe,p(I.value),1),e("button",{onClick:$,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):E.value&&k().length>0?(i(),d("div",He,[(i(!0),d(L,null,z(k(),o=>(i(),d("div",{key:o.name,class:"group relative overflow-hidden glass-card backdrop-blur-xl rounded-[15px] p-5 border border-stroke-subtle dark:border-white/10 hover:border-primary/30 transition-all duration-300"},[e("div",Be,[e("div",Ke,[e("div",ze,[e("div",Ye,[o.registered?(i(),d("div",We)):g("",!0),e("div",{class:Z(["relative w-3 h-3 rounded-full",o.registered?"bg-accent-green":"bg-accent-red"])},null,2)]),e("h3",qe,p(o.name),1),e("span",{class:Z(["px-3 py-1 text-xs font-semibold rounded-full",o.registered?"bg-accent-green/20 text-accent-green border border-accent-green/30":"bg-accent-red/20 text-accent-red border border-accent-red/30"])},p(o.registered?"● Active":"○ Inactive"),3),o.hash?(i(),d("span",Je,p(o.hash),1)):g("",!0)]),e("div",Xe,[e("div",null,[t[21]||(t[21]=e("span",{class:"text-content-muted dark:text-content-muted"},"Node Name:",-1)),e("span",Ge,p(o.settings?.node_name||o.name),1)]),e("div",null,[t[22]||(t[22]=e("span",{class:"text-content-muted dark:text-content-muted"},"TCP Port:",-1)),e("span",Qe,p(o.settings?.tcp_port??5e3),1)]),e("div",null,[t[23]||(t[23]=e("span",{class:"text-content-muted dark:text-content-muted"},"Bind Address:",-1)),e("span",Ze,p(o.settings?.bind_address||"0.0.0.0"),1)]),e("div",et,[t[24]||(t[24]=e("span",{class:"text-content-muted dark:text-content-muted"},"Identity Key:",-1)),x.value.has(o.name)?(i(),d("span",tt,p(o.identity_key),1)):(i(),d("span",rt,"••••••••••••••••")),e("button",{onClick:U=>s(o.name),class:"text-primary/70 hover:text-primary text-xs underline"},p(x.value.has(o.name)?"Hide":"Show"),9,ot)])]),e("div",nt,[t[25]||(t[25]=e("span",{class:"text-content-muted dark:text-content-muted"},"Public Key:",-1)),o.public_key?(i(),d("span",st,p(o.public_key),1)):(i(),d("span",at,"—"))])]),e("div",lt,[e("button",{onClick:U=>te(o.name),class:"px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors"}," Import contacts ",8,dt),e("button",{onClick:U=>B(o),class:"px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors"}," Edit ",8,it),e("button",{onClick:U=>F(o.name),class:"px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors"}," Delete ",8,ut)])])]))),128))])):(i(),d("div",ct,[t[26]||(t[26]=e("svg",{class:"w-16 h-16 mx-auto mb-4 text-content-muted dark:text-content-muted/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})],-1)),t[27]||(t[27]=e("p",{class:"text-lg mb-2"},"No companions configured",-1)),t[28]||(t[28]=e("p",{class:"text-sm mb-4"},"Add a companion to run a TCP frame server for firmware or other clients",-1)),e("button",{onClick:W,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," + Add Companion ")]))]),V.value?(i(),d("div",pt,[e("div",mt,[t[35]||(t[35]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Add Companion",-1)),e("div",bt,[e("div",null,[t[29]||(t[29]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Name *",-1)),b(e("input",{"onUpdate:modelValue":t[0]||(t[0]=o=>c.value.name=o),type:"text",placeholder:"e.g., TestCompanion",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[_,c.value.name]])]),e("div",null,[e("label",vt,[t[30]||(t[30]=j(" Identity Key (Optional) ",-1)),e("button",{onClick:t[1]||(t[1]=o=>f.value=!f.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},p(f.value?"Hide":"Show/Edit"),1)]),f.value?(i(),d("div",xt,[b(e("input",{"onUpdate:modelValue":t[2]||(t[2]=o=>c.value.identity_key=o),type:"text",placeholder:"Leave empty to auto-generate (32 bytes hex)",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[_,c.value.identity_key]]),t[31]||(t[31]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"32 or 64 bytes hex. Leave empty to auto-generate.",-1))])):(i(),d("div",yt," Will be auto-generated if not provided "))]),e("div",null,[t[32]||(t[32]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),b(e("input",{"onUpdate:modelValue":t[3]||(t[3]=o=>c.value.settings.node_name=o),type:"text",placeholder:"Display name (defaults to Name)",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[_,c.value.settings.node_name]])]),e("div",kt,[e("div",null,[t[33]||(t[33]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"TCP Port",-1)),b(e("input",{"onUpdate:modelValue":t[4]||(t[4]=o=>c.value.settings.tcp_port=o),type:"number",min:"1",max:"65535",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[_,c.value.settings.tcp_port,void 0,{number:!0}]])]),e("div",null,[t[34]||(t[34]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Bind Address",-1)),b(e("input",{"onUpdate:modelValue":t[5]||(t[5]=o=>c.value.settings.bind_address=o),type:"text",placeholder:"0.0.0.0",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[_,c.value.settings.bind_address]])])])]),e("div",{class:"flex justify-end gap-3 mt-6"},[e("button",{onClick:r,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),e("button",{onClick:D,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Create ")])])])):g("",!0),N.value&&l.value?(i(),d("div",gt,[e("div",ft,[t[42]||(t[42]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Edit Companion",-1)),e("div",wt,[e("div",null,[t[36]||(t[36]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Current Name",-1)),e("input",{value:l.value.name,disabled:"",type:"text",class:"w-full bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-muted dark:text-content-muted cursor-not-allowed"},null,8,ht)]),e("div",null,[t[37]||(t[37]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"New Name (optional)",-1)),b(e("input",{"onUpdate:modelValue":t[6]||(t[6]=o=>l.value.new_name=o),type:"text",placeholder:"Leave empty to keep current name",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[_,l.value.new_name]])]),e("div",null,[e("label",_t,[t[38]||(t[38]=j(" Identity Key (Optional) ",-1)),e("button",{onClick:t[7]||(t[7]=o=>v.value=!v.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},p(v.value?"Hide":"Show/Edit"),1)]),v.value?(i(),d("div",Ct,[b(e("input",{"onUpdate:modelValue":t[8]||(t[8]=o=>l.value.identity_key=o),type:"text",placeholder:"Leave empty to keep current key",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[_,l.value.identity_key]])])):g("",!0)]),e("div",null,[t[39]||(t[39]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),b(e("input",{"onUpdate:modelValue":t[9]||(t[9]=o=>l.value.settings.node_name=o),type:"text",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[_,l.value.settings.node_name]])]),e("div",$t,[e("div",null,[t[40]||(t[40]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"TCP Port",-1)),b(e("input",{"onUpdate:modelValue":t[10]||(t[10]=o=>l.value.settings.tcp_port=o),type:"number",min:"1",max:"65535",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[_,l.value.settings.tcp_port,void 0,{number:!0}]])]),e("div",null,[t[41]||(t[41]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Bind Address",-1)),b(e("input",{"onUpdate:modelValue":t[11]||(t[11]=o=>l.value.settings.bind_address=o),type:"text",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[_,l.value.settings.bind_address]])])])]),e("div",{class:"flex justify-end gap-3 mt-6"},[e("button",{onClick:r,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),e("button",{onClick:O,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Update ")])])])):g("",!0)]),K(Se,{"is-open":M.value,"companion-name":C.value,onClose:q,onImported:re},null,8,["is-open","companion-name"]),K(de,{show:y.value,title:"Delete Companion",message:`Are you sure you want to delete '${m.value}'? Restart required to fully remove.`,"confirm-text":"Delete","cancel-text":"Cancel",variant:"danger",onClose:t[12]||(t[12]=o=>y.value=!1),onConfirm:H},null,8,["show","message"]),K(ie,{show:S.value,message:T.value.message,variant:T.value.variant,onClose:t[13]||(t[13]=o=>S.value=!1)},null,8,["show","message","variant"])],64))}});export{Tt as default}; diff --git a/repeater/web/html/assets/Configuration-C4EmSQdM.css b/repeater/web/html/assets/Configuration-C4EmSQdM.css deleted file mode 100644 index 36daa2b..0000000 --- a/repeater/web/html/assets/Configuration-C4EmSQdM.css +++ /dev/null @@ -1 +0,0 @@ -.leaflet-pane[data-v-186d3c86],.leaflet-tile[data-v-186d3c86],.leaflet-marker-icon[data-v-186d3c86],.leaflet-marker-shadow[data-v-186d3c86],.leaflet-tile-container[data-v-186d3c86],.leaflet-pane>svg[data-v-186d3c86],.leaflet-pane>canvas[data-v-186d3c86],.leaflet-zoom-box[data-v-186d3c86],.leaflet-image-layer[data-v-186d3c86],.leaflet-layer[data-v-186d3c86]{position:absolute;left:0;top:0}.leaflet-container[data-v-186d3c86]{overflow:hidden}.leaflet-tile[data-v-186d3c86],.leaflet-marker-icon[data-v-186d3c86],.leaflet-marker-shadow[data-v-186d3c86]{-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile[data-v-186d3c86]::-moz-selection{background:transparent}.leaflet-tile[data-v-186d3c86]::selection{background:transparent}.leaflet-safari .leaflet-tile[data-v-186d3c86]{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container[data-v-186d3c86]{width:1600px;height:1600px;-webkit-transform-origin:0 0}.leaflet-marker-icon[data-v-186d3c86],.leaflet-marker-shadow[data-v-186d3c86]{display:block}.leaflet-container .leaflet-overlay-pane svg[data-v-186d3c86]{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img[data-v-186d3c86],.leaflet-container .leaflet-shadow-pane img[data-v-186d3c86],.leaflet-container .leaflet-tile-pane img[data-v-186d3c86],.leaflet-container img.leaflet-image-layer[data-v-186d3c86],.leaflet-container .leaflet-tile[data-v-186d3c86]{max-width:none!important;max-height:none!important;width:auto;padding:0}.leaflet-container img.leaflet-tile[data-v-186d3c86]{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom[data-v-186d3c86]{touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag[data-v-186d3c86]{touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom[data-v-186d3c86]{touch-action:none}.leaflet-container[data-v-186d3c86]{-webkit-tap-highlight-color:transparent}.leaflet-container a[data-v-186d3c86]{-webkit-tap-highlight-color:rgba(51,181,229,.4)}.leaflet-tile[data-v-186d3c86]{filter:inherit;visibility:hidden}.leaflet-tile-loaded[data-v-186d3c86]{visibility:inherit}.leaflet-zoom-box[data-v-186d3c86]{width:0;height:0;box-sizing:border-box;z-index:800}.leaflet-overlay-pane svg[data-v-186d3c86]{-moz-user-select:none}.leaflet-pane[data-v-186d3c86]{z-index:400}.leaflet-tile-pane[data-v-186d3c86]{z-index:200}.leaflet-overlay-pane[data-v-186d3c86]{z-index:400}.leaflet-shadow-pane[data-v-186d3c86]{z-index:500}.leaflet-marker-pane[data-v-186d3c86]{z-index:600}.leaflet-tooltip-pane[data-v-186d3c86]{z-index:650}.leaflet-popup-pane[data-v-186d3c86]{z-index:700}.leaflet-map-pane canvas[data-v-186d3c86]{z-index:100}.leaflet-map-pane svg[data-v-186d3c86]{z-index:200}.leaflet-vml-shape[data-v-186d3c86]{width:1px;height:1px}.lvml[data-v-186d3c86]{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control[data-v-186d3c86]{position:relative;z-index:800;pointer-events:visiblePainted;pointer-events:auto}.leaflet-top[data-v-186d3c86],.leaflet-bottom[data-v-186d3c86]{position:absolute;z-index:1000;pointer-events:none}.leaflet-top[data-v-186d3c86]{top:0}.leaflet-right[data-v-186d3c86]{right:0}.leaflet-bottom[data-v-186d3c86]{bottom:0}.leaflet-left[data-v-186d3c86]{left:0}.leaflet-control[data-v-186d3c86]{float:left;clear:both}.leaflet-right .leaflet-control[data-v-186d3c86]{float:right}.leaflet-top .leaflet-control[data-v-186d3c86]{margin-top:10px}.leaflet-bottom .leaflet-control[data-v-186d3c86]{margin-bottom:10px}.leaflet-left .leaflet-control[data-v-186d3c86]{margin-left:10px}.leaflet-right .leaflet-control[data-v-186d3c86]{margin-right:10px}.leaflet-fade-anim .leaflet-popup[data-v-186d3c86]{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup[data-v-186d3c86]{opacity:1}.leaflet-zoom-animated[data-v-186d3c86]{transform-origin:0 0}svg.leaflet-zoom-animated[data-v-186d3c86]{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated[data-v-186d3c86]{transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile[data-v-186d3c86],.leaflet-pan-anim .leaflet-tile[data-v-186d3c86]{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide[data-v-186d3c86]{visibility:hidden}.leaflet-interactive[data-v-186d3c86]{cursor:pointer}.leaflet-grab[data-v-186d3c86]{cursor:grab}.leaflet-crosshair[data-v-186d3c86],.leaflet-crosshair .leaflet-interactive[data-v-186d3c86]{cursor:crosshair}.leaflet-popup-pane[data-v-186d3c86],.leaflet-control[data-v-186d3c86]{cursor:auto}.leaflet-dragging .leaflet-grab[data-v-186d3c86],.leaflet-dragging .leaflet-grab .leaflet-interactive[data-v-186d3c86],.leaflet-dragging .leaflet-marker-draggable[data-v-186d3c86]{cursor:move;cursor:grabbing}.leaflet-marker-icon[data-v-186d3c86],.leaflet-marker-shadow[data-v-186d3c86],.leaflet-image-layer[data-v-186d3c86],.leaflet-pane>svg path[data-v-186d3c86],.leaflet-tile-container[data-v-186d3c86]{pointer-events:none}.leaflet-marker-icon.leaflet-interactive[data-v-186d3c86],.leaflet-image-layer.leaflet-interactive[data-v-186d3c86],.leaflet-pane>svg path.leaflet-interactive[data-v-186d3c86],svg.leaflet-image-layer.leaflet-interactive path[data-v-186d3c86]{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container[data-v-186d3c86]{background:#ddd;outline-offset:1px}.leaflet-container a[data-v-186d3c86]{color:#0078a8}.leaflet-zoom-box[data-v-186d3c86]{border:2px dotted #38f;background:#ffffff80}.leaflet-container[data-v-186d3c86]{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:12px;font-size:.75rem;line-height:1.5}.leaflet-bar[data-v-186d3c86]{box-shadow:0 1px 5px #000000a6;border-radius:4px}.leaflet-bar a[data-v-186d3c86]{background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;display:block;text-align:center;text-decoration:none;color:#000}.leaflet-bar a[data-v-186d3c86],.leaflet-control-layers-toggle[data-v-186d3c86]{background-position:50% 50%;background-repeat:no-repeat;display:block}.leaflet-bar a[data-v-186d3c86]:hover,.leaflet-bar a[data-v-186d3c86]:focus{background-color:#f4f4f4}.leaflet-bar a[data-v-186d3c86]:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a[data-v-186d3c86]:last-child{border-bottom-left-radius:4px;border-bottom-right-radius:4px;border-bottom:none}.leaflet-bar a.leaflet-disabled[data-v-186d3c86]{cursor:default;background-color:#f4f4f4;color:#bbb}.leaflet-touch .leaflet-bar a[data-v-186d3c86]{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a[data-v-186d3c86]:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a[data-v-186d3c86]:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.leaflet-control-zoom-in[data-v-186d3c86],.leaflet-control-zoom-out[data-v-186d3c86]{font:700 18px Lucida Console,Monaco,monospace;text-indent:1px}.leaflet-touch .leaflet-control-zoom-in[data-v-186d3c86],.leaflet-touch .leaflet-control-zoom-out[data-v-186d3c86]{font-size:22px}.leaflet-control-layers[data-v-186d3c86]{box-shadow:0 1px 5px #0006;background:#fff;border-radius:5px}.leaflet-control-layers-toggle[data-v-186d3c86]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle[data-v-186d3c86]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle[data-v-186d3c86]{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list[data-v-186d3c86],.leaflet-control-layers-expanded .leaflet-control-layers-toggle[data-v-186d3c86]{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list[data-v-186d3c86]{display:block;position:relative}.leaflet-control-layers-expanded[data-v-186d3c86]{padding:6px 10px 6px 6px;color:#333;background:#fff}.leaflet-control-layers-scrollbar[data-v-186d3c86]{overflow-y:scroll;overflow-x:hidden;padding-right:5px}.leaflet-control-layers-selector[data-v-186d3c86]{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label[data-v-186d3c86]{display:block;font-size:13px;font-size:1.08333em}.leaflet-control-layers-separator[data-v-186d3c86]{height:0;border-top:1px solid #ddd;margin:5px -10px 5px -6px}.leaflet-default-icon-path[data-v-186d3c86]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution[data-v-186d3c86]{background:#fff;background:#fffc;margin:0}.leaflet-control-attribution[data-v-186d3c86],.leaflet-control-scale-line[data-v-186d3c86]{padding:0 5px;color:#333;line-height:1.4}.leaflet-control-attribution a[data-v-186d3c86]{text-decoration:none}.leaflet-control-attribution a[data-v-186d3c86]:hover,.leaflet-control-attribution a[data-v-186d3c86]:focus{text-decoration:underline}.leaflet-attribution-flag[data-v-186d3c86]{display:inline!important;vertical-align:baseline!important;width:1em;height:.6669em}.leaflet-left .leaflet-control-scale[data-v-186d3c86]{margin-left:5px}.leaflet-bottom .leaflet-control-scale[data-v-186d3c86]{margin-bottom:5px}.leaflet-control-scale-line[data-v-186d3c86]{border:2px solid #777;border-top:none;line-height:1.1;padding:2px 5px 1px;white-space:nowrap;box-sizing:border-box;background:#fffc;text-shadow:1px 1px #fff}.leaflet-control-scale-line[data-v-186d3c86]:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line[data-v-186d3c86]:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution[data-v-186d3c86],.leaflet-touch .leaflet-control-layers[data-v-186d3c86],.leaflet-touch .leaflet-bar[data-v-186d3c86]{box-shadow:none}.leaflet-touch .leaflet-control-layers[data-v-186d3c86],.leaflet-touch .leaflet-bar[data-v-186d3c86]{border:2px solid rgba(0,0,0,.2);background-clip:padding-box}.leaflet-popup[data-v-186d3c86]{position:absolute;text-align:center;margin-bottom:20px}.leaflet-popup-content-wrapper[data-v-186d3c86]{padding:1px;text-align:left;border-radius:12px}.leaflet-popup-content[data-v-186d3c86]{margin:13px 24px 13px 20px;line-height:1.3;font-size:13px;font-size:1.08333em;min-height:1px}.leaflet-popup-content p[data-v-186d3c86]{margin:1.3em 0}.leaflet-popup-tip-container[data-v-186d3c86]{width:40px;height:20px;position:absolute;left:50%;margin-top:-1px;margin-left:-20px;overflow:hidden;pointer-events:none}.leaflet-popup-tip[data-v-186d3c86]{width:17px;height:17px;padding:1px;margin:-10px auto 0;pointer-events:auto;transform:rotate(45deg)}.leaflet-popup-content-wrapper[data-v-186d3c86],.leaflet-popup-tip[data-v-186d3c86]{background:#fff;color:#333;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button[data-v-186d3c86]{position:absolute;top:0;right:0;border:none;text-align:center;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;color:#757575;text-decoration:none;background:transparent}.leaflet-container a.leaflet-popup-close-button[data-v-186d3c86]:hover,.leaflet-container a.leaflet-popup-close-button[data-v-186d3c86]:focus{color:#585858}.leaflet-popup-scrolled[data-v-186d3c86]{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper[data-v-186d3c86]{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip[data-v-186d3c86]{width:24px;margin:0 auto;-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";filter:progid:DXImageTransform.Microsoft.Matrix(M11=.70710678,M12=.70710678,M21=-.70710678,M22=.70710678)}.leaflet-oldie .leaflet-control-zoom[data-v-186d3c86],.leaflet-oldie .leaflet-control-layers[data-v-186d3c86],.leaflet-oldie .leaflet-popup-content-wrapper[data-v-186d3c86],.leaflet-oldie .leaflet-popup-tip[data-v-186d3c86]{border:1px solid #999}.leaflet-div-icon[data-v-186d3c86]{background:#fff;border:1px solid #666}.leaflet-tooltip[data-v-186d3c86]{position:absolute;padding:6px;background-color:#fff;border:1px solid #fff;border-radius:3px;color:#222;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:none;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive[data-v-186d3c86]{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top[data-v-186d3c86]:before,.leaflet-tooltip-bottom[data-v-186d3c86]:before,.leaflet-tooltip-left[data-v-186d3c86]:before,.leaflet-tooltip-right[data-v-186d3c86]:before{position:absolute;pointer-events:none;border:6px solid transparent;background:transparent;content:""}.leaflet-tooltip-bottom[data-v-186d3c86]{margin-top:6px}.leaflet-tooltip-top[data-v-186d3c86]{margin-top:-6px}.leaflet-tooltip-bottom[data-v-186d3c86]:before,.leaflet-tooltip-top[data-v-186d3c86]:before{left:50%;margin-left:-6px}.leaflet-tooltip-top[data-v-186d3c86]:before{bottom:0;margin-bottom:-12px;border-top-color:#fff}.leaflet-tooltip-bottom[data-v-186d3c86]:before{top:0;margin-top:-12px;margin-left:-6px;border-bottom-color:#fff}.leaflet-tooltip-left[data-v-186d3c86]{margin-left:-6px}.leaflet-tooltip-right[data-v-186d3c86]{margin-left:6px}.leaflet-tooltip-left[data-v-186d3c86]:before,.leaflet-tooltip-right[data-v-186d3c86]:before{top:50%;margin-top:-6px}.leaflet-tooltip-left[data-v-186d3c86]:before{right:0;margin-right:-12px;border-left-color:#fff}.leaflet-tooltip-right[data-v-186d3c86]:before{left:0;margin-left:-12px;border-right-color:#fff}@media print{.leaflet-control[data-v-186d3c86]{-webkit-print-color-adjust:exact;print-color-adjust:exact}}.ml-0[data-v-59e9974c]{margin-left:0rem}.ml-4[data-v-59e9974c]{margin-left:1rem}.ml-8[data-v-59e9974c]{margin-left:2rem}.ml-12[data-v-59e9974c]{margin-left:3rem}.ml-16[data-v-59e9974c]{margin-left:4rem}.ml-20[data-v-59e9974c]{margin-left:5rem}.ml-24[data-v-59e9974c]{margin-left:6rem}.ml-28[data-v-59e9974c]{margin-left:7rem}.ml-32[data-v-59e9974c]{margin-left:8rem}.dropdown-enter-active[data-v-ae27fe35],.dropdown-leave-active[data-v-ae27fe35]{transition:opacity .12s ease,transform .12s ease}.dropdown-enter-from[data-v-ae27fe35],.dropdown-leave-to[data-v-ae27fe35]{opacity:0;transform:translateY(-4px)}.tab-fade-left[data-v-06241a19]{background:linear-gradient(to right,var(--color-surface) 30%,transparent)}.tab-fade-right[data-v-06241a19]{background:linear-gradient(to left,var(--color-surface) 30%,transparent)}.tab-fade-enter-active[data-v-06241a19],.tab-fade-leave-active[data-v-06241a19]{transition:opacity .2s ease}.tab-fade-enter-from[data-v-06241a19],.tab-fade-leave-to[data-v-06241a19]{opacity:0} diff --git a/repeater/web/html/assets/Configuration-COSqDNV7.js b/repeater/web/html/assets/Configuration-COSqDNV7.js deleted file mode 100644 index 4db3a40..0000000 --- a/repeater/web/html/assets/Configuration-COSqDNV7.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/leaflet-src-BtisrQHC.js","assets/_commonjsHelpers-CqkleIqs.js"])))=>i.map(i=>d[i]); -import{a as re,M as be,c as V,r as l,E as me,e as r,h as C,f as e,t as s,F as W,w as R,v as K,i as ee,s as pe,l as E,L as Q,q as t,P as Ee,x as le,H as fe,S as Ae,y as we,b as Be,g as X,N as Me,k as q,O as Le,z as ke,d as Ne,U as Ce,m as ge,V as Se,T as he,j as ae,W as ye,o as ve,u as ce,X as Pe,Q as ie}from"./index-xzvnOpJo.js";/* empty css */import{_ as Fe}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-7siCLFWH.js";import{g as Ie,s as Re}from"./preferences-DtwbSSgO.js";const ze={class:"space-y-4"},Ve={key:0,class:"bg-green-100 dark:bg-green-500/20 border border-green-500/50 rounded-lg p-3"},De={class:"text-green-600 dark:text-green-400 text-sm"},He={key:1,class:"bg-red-100 dark:bg-red-500/20 border border-red-500/50 rounded-lg p-3"},Ue={class:"text-red-600 dark:text-red-400 text-sm"},Oe={class:"flex justify-end gap-2"},Ke=["disabled"],qe=["disabled"],We={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},Ge={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Je={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Ye={key:1,class:"flex items-center gap-2"},Qe={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Xe={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Ze={key:1},et=["value"],tt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},rt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},ot={key:1},st=["value"],nt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},at={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},lt={key:1,class:"flex items-center gap-2"},dt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},it={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},ut={key:1},ct={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1"},mt={class:"text-content-primary dark:text-content-primary font-mono text-sm"},pt={key:2,class:"bg-yellow-500/10 dark:bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3"},bt=re({__name:"RadioSettings",setup(G){const L=be(),m=V(()=>L.stats?.config?.radio||{}),g=l(!1),y=l(!1),v=l(null),x=l(null),u=l(0),k=l(0),A=l(0),j=l(0),T=l(0),c=l(0),F=[{value:7.8,label:"7.8 kHz"},{value:10.4,label:"10.4 kHz"},{value:15.6,label:"15.6 kHz"},{value:20.8,label:"20.8 kHz"},{value:31.25,label:"31.25 kHz"},{value:41.7,label:"41.7 kHz"},{value:62.5,label:"62.5 kHz"},{value:125,label:"125 kHz"},{value:250,label:"250 kHz"},{value:500,label:"500 kHz"}];me(m,N=>{N&&!g.value&&(u.value=N.frequency?Number((N.frequency/1e6).toFixed(3)):0,k.value=N.spreading_factor??0,A.value=N.bandwidth?Number((N.bandwidth/1e3).toFixed(1)):0,j.value=N.tx_power??0,T.value=N.coding_rate??0,c.value=N.preamble_length??0)},{immediate:!0});const n=V(()=>{const N=m.value.frequency;return N?(N/1e6).toFixed(3)+" MHz":"Not set"}),o=V(()=>{const N=m.value.bandwidth;return N?(N/1e3).toFixed(1)+" kHz":"Not set"}),d=V(()=>{const N=m.value.tx_power;return N!==void 0?N+" dBm":"Not set"}),P=V(()=>{const N=m.value.coding_rate;return N?"4/"+N:"Not set"}),_=V(()=>{const N=m.value.preamble_length;return N?N+" symbols":"Not set"}),a=V(()=>m.value.spreading_factor??"Not set"),i=()=>{g.value=!0,v.value=null,x.value=null},I=()=>{g.value=!1,v.value=null;const N=m.value;u.value=N.frequency?Number((N.frequency/1e6).toFixed(3)):0,k.value=N.spreading_factor??0,A.value=N.bandwidth?Number((N.bandwidth/1e3).toFixed(1)):0,j.value=N.tx_power??0,T.value=N.coding_rate??0,c.value=N.preamble_length??0},J=async()=>{y.value=!0,v.value=null,x.value=null;try{const N={};u.value&&(N.frequency=u.value*1e6),k.value&&(N.spreading_factor=k.value),A.value&&(N.bandwidth=A.value*1e3),j.value&&(N.tx_power=j.value),T.value&&(N.coding_rate=T.value);const H=(await Q.post("/update_radio_config",N)).data;H.message||H.persisted?(x.value=H.message||"Settings saved successfully",g.value=!1,await L.fetchStats(),setTimeout(()=>{x.value=null},3e3)):H.error?v.value=H.error:v.value="Unknown response from server"}catch(N){console.error("Failed to update radio settings:",N);const D=N;v.value=D.response?.data?.error||"Failed to update settings"}finally{y.value=!1}};return(N,D)=>(t(),r("div",ze,[x.value?(t(),r("div",Ve,[e("p",De,s(x.value),1)])):C("",!0),v.value?(t(),r("div",He,[e("p",Ue,s(v.value),1)])):C("",!0),e("div",Oe,[g.value?(t(),r(W,{key:1},[e("button",{onClick:I,disabled:y.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,Ke),e("button",{onClick:J,disabled:y.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},s(y.value?"Saving...":"Save Changes"),9,qe)],64)):(t(),r("button",{key:0,onClick:i,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),e("div",We,[e("div",Ge,[D[6]||(D[6]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Frequency",-1)),g.value?(t(),r("div",Ye,[R(e("input",{"onUpdate:modelValue":D[0]||(D[0]=H=>u.value=H),type:"number",step:"0.001",min:"100",max:"1000",class:"w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[K,u.value,void 0,{number:!0}]]),D[5]||(D[5]=e("span",{class:"text-content-muted dark:text-content-muted text-sm"},"MHz",-1))])):(t(),r("div",Je,s(n.value),1))]),e("div",Qe,[D[7]||(D[7]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Spreading Factor",-1)),g.value?(t(),r("div",Ze,[R(e("select",{"onUpdate:modelValue":D[1]||(D[1]=H=>k.value=H),class:"px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},[(t(),r(W,null,ee([5,6,7,8,9,10,11,12],H=>e("option",{key:H,value:H},s(H),9,et)),64))],512),[[pe,k.value,void 0,{number:!0}]])])):(t(),r("div",Xe,s(a.value),1))]),e("div",tt,[D[8]||(D[8]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Bandwidth",-1)),g.value?(t(),r("div",ot,[R(e("select",{"onUpdate:modelValue":D[2]||(D[2]=H=>A.value=H),class:"px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},[(t(),r(W,null,ee(F,H=>e("option",{key:H.value,value:H.value},s(H.label),9,st)),64))],512),[[pe,A.value,void 0,{number:!0}]])])):(t(),r("div",rt,s(o.value),1))]),e("div",nt,[D[10]||(D[10]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"TX Power",-1)),g.value?(t(),r("div",lt,[R(e("input",{"onUpdate:modelValue":D[3]||(D[3]=H=>j.value=H),type:"number",min:"2",max:"30",class:"w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[K,j.value,void 0,{number:!0}]]),D[9]||(D[9]=e("span",{class:"text-content-muted dark:text-content-muted text-sm"},"dBm",-1))])):(t(),r("div",at,s(d.value),1))]),e("div",dt,[D[12]||(D[12]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Coding Rate",-1)),g.value?(t(),r("div",ut,[R(e("select",{"onUpdate:modelValue":D[4]||(D[4]=H=>T.value=H),class:"px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},D[11]||(D[11]=[e("option",{value:5},"4/5",-1),e("option",{value:6},"4/6",-1),e("option",{value:7},"4/7",-1),e("option",{value:8},"4/8",-1)]),512),[[pe,T.value,void 0,{number:!0}]])])):(t(),r("div",it,s(P.value),1))]),e("div",ct,[D[13]||(D[13]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Preamble Length",-1)),e("span",mt,s(_.value),1)])]),g.value?(t(),r("div",pt,D[14]||(D[14]=[e("p",{class:"text-yellow-700 dark:text-yellow-400 text-xs"},[e("strong",null,"Note:"),E(" Radio hardware changes (frequency, bandwidth, spreading factor, coding rate) may require a service restart to apply. ")],-1)]))):C("",!0)]))}}),xt={class:"glass-card border border-stroke-subtle dark:border-white/20 rounded-[15px] w-full max-w-3xl max-h-[90vh] flex flex-col shadow-2xl"},vt={class:"flex-1 relative min-h-[400px]"},kt={class:"p-6 border-t border-stroke-subtle dark:border-stroke/10 space-y-4"},gt={class:"grid grid-cols-2 gap-4"},yt=re({__name:"LocationPicker",props:{isOpen:{type:Boolean},latitude:{},longitude:{}},emits:["close","select"],setup(G,{emit:L}){const m=G,g=L,y=l(null),v=l(m.latitude||0),x=l(m.longitude||0);let u=null,k=null;const A=async()=>{if(y.value){j();try{const n=(await Ae(async()=>{const{default:_}=await import("./leaflet-src-BtisrQHC.js").then(a=>a.l);return{default:_}},__vite__mapDeps([0,1]))).default;delete n.Icon.Default.prototype._getIconUrl,n.Icon.Default.mergeOptions({iconRetinaUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png",iconUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png",shadowUrl:"https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png"}),await fe();const o=v.value||0,d=x.value||0,P=o===0&&d===0?2:13;u=n.map(y.value).setView([o,d],P);try{const _=n.tileLayer("https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:'© OpenStreetMap contributors © CARTO',errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}),a=n.tileLayer("https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png",{maxZoom:19,attribution:"",errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="});_.addTo(u),a.addTo(u)}catch(_){console.warn("Error loading tiles:",_)}(o!==0||d!==0)&&(k=n.marker([o,d]).addTo(u)),u.on("click",_=>{v.value=_.latlng.lat,x.value=_.latlng.lng,k?k.setLatLng(_.latlng):k=n.marker(_.latlng).addTo(u)}),setTimeout(()=>{u?.invalidateSize()},200)}catch(n){console.error("Failed to initialize map:",n)}}},j=()=>{u&&(u.remove(),u=null,k=null)};me(()=>m.isOpen,async n=>{n?(await fe(),await A()):j()}),me(()=>[m.latitude,m.longitude],([n,o])=>{v.value=n,x.value=o});const T=()=>{g("select",{latitude:v.value,longitude:x.value}),g("close")},c=()=>{g("close")},F=()=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(async n=>{if(v.value=n.coords.latitude,x.value=n.coords.longitude,u){u.setView([v.value,x.value],13);const o=(await Ae(async()=>{const{default:d}=await import("./leaflet-src-BtisrQHC.js").then(P=>P.l);return{default:d}},__vite__mapDeps([0,1]))).default;k?k.setLatLng([v.value,x.value]):k=o.marker([v.value,x.value]).addTo(u)}},n=>{console.error("Error getting location:",n),alert("Unable to get current location. Please check browser permissions.")}):alert("Geolocation is not supported by this browser.")};return Ee(()=>{j()}),(n,o)=>n.isOpen?(t(),r("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:le(c,["self"])},[e("div",xt,[e("div",{class:"flex items-center justify-between p-6 border-b border-stroke-subtle dark:border-stroke/10"},[o[3]||(o[3]=e("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Select Location",-1)),e("button",{onClick:c,class:"text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},o[2]||(o[2]=[e("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),e("div",vt,[e("div",{ref_key:"mapContainer",ref:y,class:"absolute inset-0 rounded-b-[15px] overflow-hidden"},null,512)]),e("div",kt,[e("div",gt,[e("div",null,[o[4]||(o[4]=e("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-muted mb-2"},"Latitude",-1)),R(e("input",{"onUpdate:modelValue":o[0]||(o[0]=d=>v.value=d),type:"number",step:"0.000001",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary focus:outline-none focus:border-primary",readonly:""},null,512),[[K,v.value,void 0,{number:!0}]])]),e("div",null,[o[5]||(o[5]=e("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-muted mb-2"},"Longitude",-1)),R(e("input",{"onUpdate:modelValue":o[1]||(o[1]=d=>x.value=d),type:"number",step:"0.000001",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary focus:outline-none focus:border-primary",readonly:""},null,512),[[K,x.value,void 0,{number:!0}]])])]),e("div",{class:"flex gap-3"},[e("button",{onClick:F,class:"flex-1 px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm flex items-center justify-center gap-2"},o[6]||(o[6]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})],-1),E(" Use Current Location ",-1)])),e("button",{onClick:c,class:"px-6 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm"}," Cancel "),e("button",{onClick:T,class:"px-6 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Select Location ")]),o[7]||(o[7]=e("p",{class:"text-content-muted dark:text-content-muted text-xs text-center"},"Click on the map to select a location",-1))])])])):C("",!0)}}),ft=we(yt,[["__scopeId","data-v-186d3c86"]]),ht={class:"space-y-4"},wt={key:0,class:"bg-green-100 dark:bg-green-500/10 border border-green-300 dark:border-green-500/30 rounded-lg p-3"},_t={class:"text-green-700 dark:text-green-400 text-sm"},$t={key:1,class:"bg-red-100 dark:bg-red-500/10 border border-red-300 dark:border-red-500/30 rounded-lg p-3"},Ct={class:"text-red-700 dark:text-red-400 text-sm"},Mt={class:"flex justify-end gap-2"},At=["disabled"],St=["disabled"],jt={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},Tt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Et={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm break-all"},Bt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Lt={class:"text-content-primary dark:text-content-primary font-mono text-xs break-all"},Nt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Pt={class:"flex flex-col items-end gap-1"},Ft={class:"text-content-primary dark:text-content-primary font-mono text-xs break-all sm:text-right sm:max-w-xs"},It={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Rt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},zt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Vt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Dt={key:0,class:"flex justify-end"},Ht={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Ut={class:"text-content-primary dark:text-content-primary font-mono text-sm"},Ot={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Kt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},qt={class:"flex flex-col py-2 gap-2"},Wt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},Gt={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm sm:ml-4"},Jt={key:1,class:"flex items-center gap-2"},Yt={class:"bg-surface dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke/20 rounded-[15px] shadow-2xl w-full max-w-md p-6 space-y-4"},Qt={class:"block text-sm font-medium text-content-secondary dark:text-content-muted mb-2"},Xt=["maxlength","disabled"],Zt={key:0,class:"text-red-500 text-xs mt-1"},er={key:1,class:"text-content-muted dark:text-content-muted text-xs mt-1"},tr=["disabled"],rr={key:0,class:"mt-2 bg-amber-500/10 border border-amber-500/30 rounded-lg p-3"},or={key:0,class:"flex items-center gap-3 bg-blue-500/10 border border-blue-500/30 rounded-lg p-3"},sr={class:"text-blue-700 dark:text-blue-400 text-xs font-medium"},nr={class:"text-blue-600 dark:text-blue-500 text-xs mt-0.5"},ar={key:1,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-3"},lr={class:"text-red-600 dark:text-red-400 text-sm"},dr={key:2,class:"bg-green-500/10 border border-green-600/40 dark:border-green-500/30 rounded-lg p-3 space-y-2"},ir={class:"text-green-600 dark:text-green-400 text-sm font-medium"},ur={class:"font-mono text-xs break-all text-content-primary dark:text-content-primary"},cr={key:3,class:"bg-amber-500/10 border border-amber-500/30 rounded-lg p-3"},mr={class:"flex gap-2 mt-3"},pr=["disabled"],br=["disabled"],xr={class:"flex justify-end gap-3 mt-6"},vr=["disabled"],kr=["disabled"],gr=re({__name:"RepeaterSettings",setup(G){const L=be(),m=V(()=>L.stats?.config||{}),g=V(()=>m.value.repeater||{}),y=V(()=>L.stats),v=l(!1),x=l(!1),u=l(null),k=l(null),A=l(!1),j=l(""),T=l(0),c=l(0),F=l(0),n=l(1),o=V(()=>m.value.mesh||{});me([m,g,o],()=>{if(!v.value){j.value=m.value.node_name||"",T.value=g.value.latitude||0,c.value=g.value.longitude||0,F.value=g.value.send_advert_interval_hours||0;const M=o.value.path_hash_mode;n.value=M===0||M===1||M===2?M+1:1}},{immediate:!0});const d=V(()=>m.value.node_name||"Not set"),P=V(()=>y.value?.local_hash||"Not available"),_=V(()=>{const M=y.value?.public_key;return!M||M==="Not set"?"Not set":M}),a=V(()=>{const M=g.value.latitude;return M&&M!==0?M.toFixed(6):"Not set"}),i=V(()=>{const M=g.value.longitude;return M&&M!==0?M.toFixed(6):"Not set"}),I=V(()=>{const M=g.value.mode;return M?M==="no_tx"?"No TX":M.charAt(0).toUpperCase()+M.slice(1):"Not set"}),J=V(()=>{const M=g.value.send_advert_interval_hours;return M===void 0?"Not set":M===0?"Disabled":M+" hour"+(M!==1?"s":"")}),N=V(()=>{const M=o.value.path_hash_mode;return M===0||M===1||M===2?M+1+(M===0?" byte":" bytes"):"Not set"}),D=()=>{v.value=!0,u.value=null,k.value=null},H=()=>{v.value=!1,u.value=null,j.value=m.value.node_name||"",T.value=g.value.latitude||0,c.value=g.value.longitude||0,F.value=g.value.send_advert_interval_hours||0;const M=o.value.path_hash_mode;n.value=M===0||M===1||M===2?M+1:1},se=async()=>{x.value=!0,u.value=null,k.value=null;try{const M={};j.value&&(M.node_name=j.value),M.latitude=T.value,M.longitude=c.value,M.flood_advert_interval_hours=F.value,M.path_hash_mode=n.value-1;const Y=(await Q.post("/update_radio_config",M)).data;Y.message||Y.persisted?(k.value=Y.message||"Settings saved successfully",v.value=!1,await L.fetchStats(),setTimeout(()=>{k.value=null},3e3)):Y.error?u.value=Y.error:u.value="Unknown response from server"}catch(M){console.error("Failed to update repeater settings:",M);const S=M;u.value=S.response?.data?.error||"Failed to update settings"}finally{x.value=!1}},oe=()=>{A.value=!0},z=M=>{T.value=M.latitude,c.value=M.longitude},f=l(!1),$=l(""),w=l(!1),U=l(null),O=l(null),ne=l(!1),ue=l(!1),de=l(!1),xe=l(0);let Z=null;const b=V(()=>de.value?8:4),h=V(()=>{const M=$.value.trim();return!M||M.length>b.value?!1:/^[0-9a-fA-F]+$/.test(M)}),p=V(()=>{const M=$.value.trim().length;return M===0?"":M===1?"Very fast — ~16 attempts on average":M===2?"Fast — ~256 attempts on average":M===3?"Moderate — ~4,096 attempts, a few seconds":M===4?"Slow — ~65,536 attempts, may take 10-30 seconds":M===5?"Very slow — ~1 million attempts, could take minutes":M===6?"Extremely slow — ~16 million attempts, could take a very long time":M===7?"Extreme — ~268 million attempts, may not complete":"Extreme — ~4 billion attempts, extremely unlikely to complete"}),B=()=>{xe.value=0,Z=setInterval(()=>{xe.value++},1e3)},te=()=>{Z&&(clearInterval(Z),Z=null)};Be(()=>te());const _e=()=>{$.value="",U.value=null,O.value=null,ne.value=!1,de.value=!1,f.value=!0},$e=async()=>{w.value=!0,O.value=null,U.value=null,B();try{const M=await Q.generateVanityKey($.value.trim());M.success&&M.data?U.value=M.data:O.value=M.error||"Generation failed"}catch(M){const S=M;O.value=S.response?.data?.error||S.message||"Generation failed"}finally{te(),w.value=!1}},Te=async()=>{if(U.value){ue.value=!0,O.value=null;try{const M=await Q.generateVanityKey($.value.trim(),!0);M.success&&M.data?(U.value=M.data,ne.value=!1,f.value=!1,k.value="New identity key applied. Restart the repeater for the change to take effect.",await L.fetchStats(),setTimeout(()=>{k.value=null},8e3)):O.value=M.error||"Failed to apply key"}catch(M){const S=M;O.value=S.response?.data?.error||S.message||"Failed to apply key"}finally{ue.value=!1}}};return(M,S)=>(t(),r("div",ht,[k.value?(t(),r("div",wt,[e("p",_t,s(k.value),1)])):C("",!0),u.value?(t(),r("div",$t,[e("p",Ct,s(u.value),1)])):C("",!0),e("div",Mt,[v.value?(t(),r(W,{key:1},[e("button",{onClick:H,disabled:x.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,At),e("button",{onClick:se,disabled:x.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},s(x.value?"Saving...":"Save Changes"),9,St)],64)):(t(),r("button",{key:0,onClick:D,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),e("div",jt,[e("div",Tt,[S[13]||(S[13]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Node Name",-1)),v.value?R((t(),r("input",{key:1,"onUpdate:modelValue":S[0]||(S[0]=Y=>j.value=Y),type:"text",maxlength:"50",class:"w-full sm:w-64 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary",placeholder:"Enter node name"},null,512)),[[K,j.value]]):(t(),r("div",Et,s(d.value),1))]),e("div",Bt,[S[14]||(S[14]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Local Hash",-1)),e("span",Lt,s(P.value),1)]),e("div",Nt,[S[15]||(S[15]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm flex-shrink-0"},"Public Key",-1)),e("div",Pt,[e("span",Ft,s(_.value),1),e("button",{onClick:_e,class:"px-2 py-1 text-xs bg-primary/10 hover:bg-primary/20 text-content-secondary dark:text-content-muted rounded border border-primary/30 transition-colors"}," Generate New Key ")])]),e("div",It,[S[16]||(S[16]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Latitude",-1)),v.value?R((t(),r("input",{key:1,"onUpdate:modelValue":S[1]||(S[1]=Y=>T.value=Y),type:"number",step:"0.000001",min:"-90",max:"90",class:"w-full sm:w-48 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[K,T.value,void 0,{number:!0}]]):(t(),r("div",Rt,s(a.value),1))]),e("div",zt,[S[17]||(S[17]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Longitude",-1)),v.value?R((t(),r("input",{key:1,"onUpdate:modelValue":S[2]||(S[2]=Y=>c.value=Y),type:"number",step:"0.000001",min:"-180",max:"180",class:"w-full sm:w-48 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[K,c.value,void 0,{number:!0}]]):(t(),r("div",Vt,s(i.value),1))]),v.value?(t(),r("div",Dt,[e("button",{onClick:oe,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm flex items-center gap-2",title:"Pick location on map"},S[18]||(S[18]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})],-1),E(" Pick Location on Map ",-1)]))])):C("",!0),e("div",Ht,[S[19]||(S[19]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Mode",-1)),e("span",Ut,s(I.value),1)]),e("div",Ot,[S[21]||(S[21]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Path hash length",-1)),v.value?R((t(),r("select",{key:1,"onUpdate:modelValue":S[3]||(S[3]=Y=>n.value=Y),class:"w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},S[20]||(S[20]=[e("option",{value:1},"1 byte",-1),e("option",{value:2},"2 bytes",-1),e("option",{value:3},"3 bytes",-1)]),512)),[[pe,n.value,void 0,{number:!0}]]):(t(),r("div",Kt,s(N.value),1))]),e("div",qt,[e("div",Wt,[S[23]||(S[23]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Periodic Advertisement Interval",-1)),v.value?(t(),r("div",Jt,[R(e("input",{"onUpdate:modelValue":S[4]||(S[4]=Y=>F.value=Y),type:"number",min:"0",max:"48",class:"w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[K,F.value,void 0,{number:!0}]]),S[22]||(S[22]=e("span",{class:"text-content-muted dark:text-content-muted text-sm"},"hours",-1))])):(t(),r("div",Gt,s(J.value),1))]),S[24]||(S[24]=e("span",{class:"text-content-muted dark:text-content-muted text-xs"},"How often the repeater sends an advertisement packet (0 = disabled, 3-48 hours)",-1))])]),X(ft,{"is-open":A.value,latitude:T.value,longitude:c.value,onClose:S[5]||(S[5]=Y=>A.value=!1),onSelect:z},null,8,["is-open","latitude","longitude"]),(t(),Me(Le,{to:"body"},[f.value?(t(),r("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:S[12]||(S[12]=le(Y=>f.value=!1,["self"]))},[e("div",Yt,[S[32]||(S[32]=e("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Generate Vanity Identity Key",-1)),S[33]||(S[33]=e("p",{class:"text-xs text-content-muted dark:text-content-muted"}," Generate a new Ed25519 identity key whose public key starts with your chosen hex prefix (0-9, A-F). Longer prefixes take more time to find. ",-1)),e("div",null,[e("label",Qt,"Hex Prefix (1-"+s(b.value)+" characters)",1),R(e("input",{"onUpdate:modelValue":S[6]||(S[6]=Y=>$.value=Y),type:"text",maxlength:b.value,placeholder:"e.g. F8A1",disabled:w.value,class:"w-full px-4 py-2 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-400 dark:placeholder-white/40 font-mono text-sm uppercase focus:outline-none focus:border-primary transition-colors disabled:opacity-50"},null,8,Xt),[[K,$.value]]),$.value&&!h.value?(t(),r("p",Zt,"Enter 1-"+s(b.value)+" valid hex characters (0-9, A-F)",1)):p.value?(t(),r("p",er,s(p.value),1)):C("",!0)]),e("div",null,[e("button",{onClick:S[7]||(S[7]=Y=>de.value=!de.value),disabled:w.value,class:"text-xs text-content-muted dark:text-content-muted hover:text-content-secondary dark:hover:text-content-secondary transition-colors disabled:opacity-50 flex items-center gap-1"},[(t(),r("svg",{class:q(["w-3 h-3 transition-transform",{"rotate-90":de.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},S[25]||(S[25]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]),2)),S[26]||(S[26]=E(" Advanced ",-1))],8,tr),de.value?(t(),r("div",rr,S[27]||(S[27]=[e("p",{class:"text-amber-600 dark:text-amber-400 text-xs font-medium"},"Extended prefix mode (up to 8 characters)",-1),e("p",{class:"text-amber-600 dark:text-amber-500 text-xs mt-1"}," Prefixes longer than 4 characters require exponentially more attempts and can take a very long time or may not complete at all. The request may time out. ",-1)]))):C("",!0)]),w.value?(t(),r("div",or,[S[28]||(S[28]=e("svg",{class:"animate-spin h-5 w-5 text-blue-500 flex-shrink-0",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})],-1)),e("div",null,[e("p",sr,'Searching for key with prefix "'+s($.value.toUpperCase())+'"...',1),e("p",nr,"Elapsed: "+s(xe.value)+"s",1)])])):C("",!0),O.value?(t(),r("div",ar,[e("p",lr,s(O.value),1)])):C("",!0),U.value?(t(),r("div",dr,[e("p",ir,"Key found in "+s(U.value.attempts.toLocaleString())+" attempts",1),e("div",null,[S[29]||(S[29]=e("span",{class:"text-xs text-content-muted dark:text-content-muted"},"Public Key:",-1)),e("p",ur,s(U.value.public_hex),1)])])):C("",!0),ne.value&&U.value?(t(),r("div",cr,[S[30]||(S[30]=e("p",{class:"text-amber-600 dark:text-amber-400 text-sm font-medium"},"Warning: This will replace your current identity key.",-1)),S[31]||(S[31]=e("p",{class:"text-amber-600 dark:text-amber-500 text-xs mt-1"},"Your node address and public key will change. Other nodes will need to re-discover you. This cannot be undone unless you have a backup.",-1)),e("div",mr,[e("button",{onClick:Te,disabled:ue.value,class:"px-3 py-1.5 bg-red-600 hover:bg-red-700 text-white rounded-lg text-xs transition-colors disabled:opacity-50"},s(ue.value?"Applying...":"Confirm Replace Key"),9,pr),e("button",{onClick:S[8]||(S[8]=Y=>ne.value=!1),disabled:ue.value,class:"px-3 py-1.5 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 text-xs transition-colors"}," Cancel ",8,br)])])):C("",!0),e("div",xr,[e("button",{onClick:S[9]||(S[9]=Y=>f.value=!1),disabled:w.value,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/10 transition-colors"}," Close ",8,vr),U.value?(t(),r(W,{key:1},[e("button",{onClick:S[10]||(S[10]=Y=>{U.value=null,O.value=null}),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 text-sm transition-colors"}," Try Again "),ne.value?C("",!0):(t(),r("button",{key:0,onClick:S[11]||(S[11]=Y=>ne.value=!0),class:"px-4 py-2 bg-red-600/20 hover:bg-red-600/30 text-red-600 dark:text-red-400 rounded-lg border border-red-500/50 text-sm transition-colors"}," Apply Key "))],64)):(t(),r("button",{key:0,onClick:$e,disabled:!h.value||w.value,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 text-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},s(w.value?"Generating...":"Generate"),9,kr))])])])):C("",!0)]))]))}}),yr={class:"space-y-4"},fr={key:0,class:"bg-green-100 dark:bg-green-500/20 border border-green-500 dark:border-green-500/50 rounded-lg p-3 text-green-700 dark:text-green-400 text-sm"},hr={key:1,class:"bg-red-100 dark:bg-red-500/20 border border-red-500 dark:border-red-500/50 rounded-lg p-3 text-red-700 dark:text-red-400 text-sm"},wr={class:"flex justify-end gap-2"},_r=["disabled"],$r=["disabled"],Cr={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},Mr={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Ar={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Sr={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1"},jr={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Tr=re({__name:"DutyCycle",setup(G){const L=be(),m=V(()=>L.stats?.config?.duty_cycle||{}),g=V(()=>{const n=m.value.max_airtime_percent;return typeof n=="number"?n.toFixed(1)+"%":n&&typeof n=="object"&&"parsedValue"in n?(n.parsedValue||0).toFixed(1)+"%":"Not set"}),y=V(()=>m.value.enforcement_enabled?"Enabled":"Disabled"),v=l(!1),x=l(!1),u=l(""),k=l(""),A=l(0),j=l(!0),T=()=>{const n=m.value.max_airtime_percent;typeof n=="number"?A.value=n:n&&typeof n=="object"&&"parsedValue"in n?A.value=n.parsedValue||0:A.value=6,j.value=m.value.enforcement_enabled!==!1,v.value=!0,u.value="",k.value=""},c=()=>{v.value=!1,u.value="",k.value=""},F=async()=>{x.value=!0,k.value="",u.value="";try{const o=(await ke.post("/api/update_duty_cycle_config",{max_airtime_percent:A.value,enforcement_enabled:j.value})).data;o.message||o.persisted?(u.value=o.message||"Settings saved successfully",v.value=!1,await L.fetchStats(),setTimeout(()=>{u.value=""},3e3)):k.value="Failed to save settings"}catch(n){console.error("Failed to save duty cycle settings:",n),k.value=n.response?.data?.error||"Failed to save settings"}finally{x.value=!1}};return(n,o)=>(t(),r("div",yr,[u.value?(t(),r("div",fr,s(u.value),1)):C("",!0),k.value?(t(),r("div",hr,s(k.value),1)):C("",!0),e("div",wr,[v.value?(t(),r(W,{key:1},[e("button",{onClick:c,disabled:x.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,_r),e("button",{onClick:F,disabled:x.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},s(x.value?"Saving...":"Save Changes"),9,$r)],64)):(t(),r("button",{key:0,onClick:T,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),e("div",Cr,[e("div",Mr,[o[2]||(o[2]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Max Airtime %",-1)),v.value?R((t(),r("input",{key:1,"onUpdate:modelValue":o[0]||(o[0]=d=>A.value=d),type:"number",step:"0.1",min:"0.1",max:"100",class:"w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[K,A.value,void 0,{number:!0}]]):(t(),r("div",Ar,s(g.value),1))]),e("div",Sr,[o[4]||(o[4]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Enforcement",-1)),v.value?R((t(),r("select",{key:1,"onUpdate:modelValue":o[1]||(o[1]=d=>j.value=d),class:"w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},o[3]||(o[3]=[e("option",{value:!0},"Enabled",-1),e("option",{value:!1},"Disabled",-1)]),512)),[[pe,j.value]]):(t(),r("div",jr,s(y.value),1))])])]))}}),Er={class:"space-y-4"},Br={key:0,class:"bg-green-100 dark:bg-green-500/20 border border-green-500 dark:border-green-500/50 rounded-lg p-3 text-green-700 dark:text-green-400 text-sm"},Lr={key:1,class:"bg-red-100 dark:bg-red-500/20 border border-red-500 dark:border-red-500/50 rounded-lg p-3 text-red-700 dark:text-red-400 text-sm"},Nr={class:"flex justify-end gap-2"},Pr=["disabled"],Fr=["disabled"],Ir={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},Rr={class:"flex flex-col py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-2"},zr={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},Vr={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm sm:ml-4"},Dr={class:"flex flex-col py-2 gap-2"},Hr={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1"},Ur={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm sm:ml-4"},Or=re({__name:"TransmissionDelays",setup(G){const L=be(),m=V(()=>L.stats?.config?.delays||{}),g=V(()=>{const n=m.value.tx_delay_factor;if(n&&typeof n=="object"&&n!==null&&"parsedValue"in n){const o=n.parsedValue;if(typeof o=="number")return o.toFixed(2)+"x"}return"Not set"}),y=V(()=>{const n=m.value.direct_tx_delay_factor;return typeof n=="number"?n.toFixed(2)+"s":"Not set"}),v=l(!1),x=l(!1),u=l(""),k=l(""),A=l(0),j=l(0),T=()=>{const n=m.value.tx_delay_factor;n&&typeof n=="object"&&"parsedValue"in n?A.value=n.parsedValue||1:typeof n=="number"?A.value=n:A.value=1;const o=m.value.direct_tx_delay_factor;j.value=typeof o=="number"?o:.5,v.value=!0,u.value="",k.value=""},c=()=>{v.value=!1,u.value="",k.value=""},F=async()=>{x.value=!0,k.value="",u.value="";try{const o=(await ke.post("/api/update_radio_config",{tx_delay_factor:A.value,direct_tx_delay_factor:j.value})).data;o.message||o.persisted?(u.value=o.message||"Settings saved successfully",v.value=!1,await L.fetchStats(),setTimeout(()=>{u.value=""},3e3)):k.value="Failed to save settings"}catch(n){console.error("Failed to save delay settings:",n),k.value=n.response?.data?.error||"Failed to save settings"}finally{x.value=!1}};return(n,o)=>(t(),r("div",Er,[u.value?(t(),r("div",Br,s(u.value),1)):C("",!0),k.value?(t(),r("div",Lr,s(k.value),1)):C("",!0),e("div",Nr,[v.value?(t(),r(W,{key:1},[e("button",{onClick:c,disabled:x.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,Pr),e("button",{onClick:F,disabled:x.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},s(x.value?"Saving...":"Save Changes"),9,Fr)],64)):(t(),r("button",{key:0,onClick:T,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))]),e("div",Ir,[e("div",Rr,[e("div",zr,[o[2]||(o[2]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Flood TX Delay Factor",-1)),v.value?R((t(),r("input",{key:1,"onUpdate:modelValue":o[0]||(o[0]=d=>A.value=d),type:"number",step:"0.1",min:"0",max:"5",class:"w-full sm:w-32 px-3 py-1.5 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[K,A.value,void 0,{number:!0}]]):(t(),r("div",Vr,s(g.value),1))]),o[3]||(o[3]=e("span",{class:"text-content-muted dark:text-content-muted text-xs"},"Multiplier for flood packet transmission delays (collision avoidance)",-1))]),e("div",Dr,[e("div",Hr,[o[4]||(o[4]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Direct TX Delay Factor",-1)),v.value?R((t(),r("input",{key:1,"onUpdate:modelValue":o[1]||(o[1]=d=>j.value=d),type:"number",step:"0.1",min:"0",max:"5",class:"w-full sm:w-32 px-3 py-1.5 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[K,j.value,void 0,{number:!0}]]):(t(),r("div",Ur,s(y.value),1))]),o[5]||(o[5]=e("span",{class:"text-content-muted dark:text-content-muted text-xs"},"Base delay for direct-routed packet transmission (seconds)",-1))])])]))}}),je=Ne("treeState",()=>{const G=Ce(new Set),L=Ce({value:null}),m=u=>{G.add(u)},g=u=>{G.delete(u)};return{expandedNodes:G,selectedNodeId:L,addExpandedNode:m,removeExpandedNode:g,isNodeExpanded:u=>G.has(u),setSelectedNode:u=>{L.value=u},toggleExpanded:u=>{G.has(u)?g(u):m(u)}}}),Kr={class:"select-none"},qr={class:"flex-shrink-0"},Wr={key:0,class:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Gr={key:1,class:"w-3.5 h-3.5 sm:w-4 sm:h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Jr={key:0,class:"hidden sm:flex items-center gap-1 ml-2"},Yr={class:"relative group"},Qr=["title"],Xr={key:0,class:"text-xs font-mono text-white/50 bg-white/5 px-1.5 py-0.5 rounded border border-white/10"},Zr={class:"flex justify-between items-start mb-4"},eo={class:"bg-black/20 border border-white/10 rounded-md p-4 mb-4"},to={class:"text-sm font-mono text-white/80 break-all leading-relaxed"},ro={class:"flex items-center gap-1 sm:gap-2 ml-auto flex-shrink-0"},oo={key:0,class:"hidden sm:flex items-center gap-1"},so=["title"],no={key:1,class:"hidden sm:flex items-center gap-1"},ao={key:2,class:"hidden sm:inline-block px-2 py-1 bg-white/10 text-white/60 text-xs rounded-full ml-1"},lo={key:0,class:"space-y-1"},io=re({__name:"TreeNode",props:{node:{},selectedNodeId:{},level:{},disabled:{type:Boolean}},emits:["select"],setup(G,{emit:L}){const m=G,g=L,y=je(),v=l(!1),x=V({get:()=>y.isNodeExpanded(m.node.id),set:o=>{o?y.addExpandedNode(m.node.id):y.removeExpandedNode(m.node.id)}}),u=V(()=>m.node.children.length>0);function k(o){if(!o)return"Never";const P=new Date().getTime()-o.getTime(),_=Math.floor(P/(1e3*60)),a=Math.floor(P/(1e3*60*60)),i=Math.floor(P/(1e3*60*60*24)),I=Math.floor(i/365);return _<60?`${_}m ago`:a<24?`${a}h ago`:i<365?`${i}d ago`:`${I}y ago`}function A(o){return o?o.length<=16?o:`${o.slice(0,8)}...${o.slice(-8)}`:"No key"}function j(){if(u.value){const o=!x.value;x.value=o}}function T(){g("select",m.node.id)}function c(o){g("select",o)}function F(o){o.stopPropagation(),v.value=!v.value}function n(o){o.stopPropagation(),m.node.transport_key&&window.navigator?.clipboard&&window.navigator.clipboard.writeText(m.node.transport_key)}return(o,d)=>{const P=Se("TreeNode",!0);return t(),r("div",Kr,[e("div",{class:q(["flex flex-wrap sm:flex-nowrap items-start sm:items-center gap-1 sm:gap-2 py-2 px-2 sm:px-3 rounded-lg cursor-pointer transition-all duration-200",m.disabled?"opacity-50 cursor-not-allowed":"hover:bg-white/5",o.selectedNodeId===o.node.id&&!m.disabled?"bg-primary/20 text-primary":"text-white/80 hover:text-white",`ml-${o.level*4}`]),onClick:d[3]||(d[3]=_=>!m.disabled&&T())},[e("div",{class:"flex-shrink-0 w-3 h-3 sm:w-4 sm:h-4 flex items-center justify-center",onClick:le(j,["stop"])},[u.value?(t(),r("svg",{key:0,class:q(["w-2.5 h-2.5 sm:w-3 sm:h-3 transition-transform duration-200",x.value?"rotate-90":"rotate-0"]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},d[4]||(d[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]),2)):C("",!0)]),e("div",qr,[m.node.name.startsWith("#")?(t(),r("svg",Wr,d[5]||(d[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(t(),r("svg",Gr,d[6]||(d[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)])))]),e("span",{class:q(["font-mono text-xs sm:text-sm transition-colors duration-200 break-all",o.selectedNodeId===o.node.id?"text-primary font-medium":""])},s(o.node.name),3),o.node.transport_key?(t(),r("div",Jr,[e("div",Yr,[e("button",{onClick:F,class:"p-1 rounded hover:bg-white/10 transition-colors",title:v.value?"Hide full key":"Show full key"},d[7]||(d[7]=[e("svg",{class:"w-3 h-3 text-white/60 hover:text-white/80",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})],-1)]),8,Qr),v.value?C("",!0):(t(),r("span",Xr,s(A(o.node.transport_key)),1)),v.value?(t(),r("div",{key:1,class:"fixed inset-0 z-[9998] flex items-center justify-center bg-black/70 backdrop-blur-md",onClick:d[2]||(d[2]=_=>v.value=!1)},[e("div",{class:"bg-black/20 border border-white/20 rounded-lg shadow-lg p-6 max-w-2xl w-full mx-4",onClick:d[1]||(d[1]=le(()=>{},["stop"]))},[e("div",Zr,[d[9]||(d[9]=e("h3",{class:"text-lg font-semibold text-white"},"Transport Key",-1)),e("button",{onClick:d[0]||(d[0]=_=>v.value=!1),class:"text-white/60 hover:text-white transition-colors"},d[8]||(d[8]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),e("div",eo,[e("div",to,s(o.node.transport_key),1)]),e("div",{class:"flex justify-end"},[e("button",{onClick:n,class:"px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green rounded-lg transition-colors flex items-center gap-2",title:"Copy to clipboard"},d[10]||(d[10]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),E(" Copy Key ",-1)]))])])])):C("",!0)])])):C("",!0),e("div",ro,[o.node.last_used?(t(),r("div",oo,[d[11]||(d[11]=e("svg",{class:"w-3 h-3 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e("span",{class:"text-xs text-white/50",title:o.node.last_used.toLocaleString()},s(k(o.node.last_used)),9,so)])):(t(),r("div",no,d[12]||(d[12]=[e("svg",{class:"w-3 h-3 text-white/30",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),e("span",{class:"text-xs text-white/30 italic"},"Never",-1)]))),e("span",{class:q(["px-1.5 sm:px-2 py-0.5 text-[10px] sm:text-xs font-medium rounded-md transition-colors",o.node.floodPolicy==="allow"?"bg-accent-green/10 text-accent-green/90 border border-accent-green/20":"bg-accent-red/10 text-accent-red/90 border border-accent-red/20"])},s(o.node.floodPolicy==="allow"?"ALLOW":"DENY"),3),u.value?(t(),r("span",ao," > "+s(o.node.children.length),1)):C("",!0)])],2),X(he,{"enter-active-class":"transition-all duration-300 ease-out","enter-from-class":"opacity-0 max-h-0 overflow-hidden","enter-to-class":"opacity-100 max-h-screen overflow-visible","leave-active-class":"transition-all duration-300 ease-in","leave-from-class":"opacity-100 max-h-screen overflow-visible","leave-to-class":"opacity-0 max-h-0 overflow-hidden"},{default:ge(()=>[x.value&&o.node.children.length>0?(t(),r("div",lo,[(t(!0),r(W,null,ee(o.node.children,_=>(t(),Me(P,{key:_.id,node:_,"selected-node-id":o.selectedNodeId,level:o.level+1,disabled:m.disabled,onSelect:c},null,8,["node","selected-node-id","level","disabled"]))),128))])):C("",!0)]),_:1})])}}}),uo=we(io,[["__scopeId","data-v-59e9974c"]]),co={class:"flex items-center justify-between mb-6"},mo={class:"text-content-secondary dark:text-content-muted text-sm mt-1"},po={key:0},bo={class:"text-primary font-mono"},xo={key:1},vo={for:"keyName",class:"block text-sm font-medium text-white mb-2"},ko={class:"flex items-center gap-2"},go={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},yo={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},fo={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},ho={class:"flex items-center gap-3 mb-2"},wo={class:"flex items-center gap-2"},_o={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},$o={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Co={class:"text-content-secondary dark:text-content-muted text-sm"},Mo={class:"grid grid-cols-2 gap-3"},Ao={class:"relative cursor-pointer group"},So={class:"relative cursor-pointer group"},jo={class:"flex gap-3 pt-4"},To=["disabled"],Eo=re({__name:"AddKeyModal",props:{show:{type:Boolean},selectedNodeName:{},selectedNodeId:{}},emits:["close","add"],setup(G,{emit:L}){const m=G,g=L,y=l(""),v=l(""),x=l("allow"),u=V(()=>y.value.startsWith("#")),k=V(()=>({type:u.value?"Region":"Private Key",description:u.value?"Regional organizational key":"Individual assigned key"}));me(u,F=>{F?v.value="This will create a new region for organizing keys":v.value="This will create a new private key entry"},{immediate:!0});const A=V(()=>y.value.trim().length>0),j=()=>{A.value&&(g("add",{name:y.value.trim(),floodPolicy:x.value,parentId:m.selectedNodeId}),y.value="",v.value="",x.value="allow")},T=()=>{y.value="",v.value="",x.value="allow",g("close")},c=F=>{F.target===F.currentTarget&&T()};return(F,n)=>F.show?(t(),r("div",{key:0,onClick:c,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[e("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:n[3]||(n[3]=le(()=>{},["stop"]))},[e("div",co,[e("div",null,[n[5]||(n[5]=e("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Add New Entry",-1)),e("p",mo,[m.selectedNodeName?(t(),r("span",po,[n[4]||(n[4]=E(" Add to: ",-1)),e("span",bo,s(m.selectedNodeName),1)])):(t(),r("span",xo," Add to root level (#uk) "))])]),e("button",{onClick:T,class:"text-white/60 hover:text-white transition-colors"},n[6]||(n[6]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),e("form",{onSubmit:le(j,["prevent"]),class:"space-y-4"},[e("div",null,[e("label",vo,[e("div",ko,[u.value?(t(),r("svg",go,n[7]||(n[7]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(t(),r("svg",yo,n[8]||(n[8]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))),n[9]||(n[9]=E(" Region/Key Name ",-1))])]),R(e("input",{id:"keyName","onUpdate:modelValue":n[0]||(n[0]=o=>y.value=o),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[K,y.value]])]),e("div",fo,[e("div",ho,[e("div",wo,[u.value?(t(),r("svg",_o,n[10]||(n[10]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(t(),r("svg",$o,n[11]||(n[11]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1221 9z"},null,-1)]))),e("span",{class:q([u.value?"text-secondary":"text-accent-green","font-medium"])},s(k.value.type),3)]),e("div",{class:q(["flex-1 h-px",u.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),e("p",Co,s(k.value.description),1)]),e("div",null,[n[14]||(n[14]=e("label",{class:"block text-sm font-medium text-content-primary dark:text-content-primary mb-3"},[e("div",{class:"flex items-center gap-2"},[e("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),E(" Flood Policy ")])],-1)),e("div",Mo,[e("label",Ao,[R(e("input",{type:"radio","onUpdate:modelValue":n[1]||(n[1]=o=>x.value=o),value:"allow",class:"sr-only"},null,512),[[ye,x.value]]),n[12]||(n[12]=ae('
Allow

Permit flooding

',1))]),e("label",So,[R(e("input",{type:"radio","onUpdate:modelValue":n[2]||(n[2]=o=>x.value=o),value:"deny",class:"sr-only"},null,512),[[ye,x.value]]),n[13]||(n[13]=ae('
Deny

Block flooding

',1))])])]),e("div",jo,[e("button",{type:"button",onClick:T,class:"flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),e("button",{type:"submit",disabled:!A.value,class:q(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",A.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-background-mute dark:bg-stroke/5 border border-stroke-subtle dark:border-stroke/20 text-content-muted dark:text-content-muted cursor-not-allowed"])}," Add "+s(k.value.type),11,To)])],32)])])):C("",!0)}}),Bo={class:"flex items-center justify-between mb-6"},Lo={class:"text-content-secondary dark:text-content-muted text-sm mt-1"},No={class:"text-primary font-mono"},Po={for:"keyName",class:"block text-sm font-medium text-content-secondary dark:text-content-primary mb-2"},Fo={class:"flex items-center gap-2"},Io={key:0,class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ro={key:1,class:"w-4 h-4 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},zo={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},Vo={class:"flex items-center gap-3 mb-2"},Do={class:"flex items-center gap-2"},Ho={key:0,class:"w-5 h-5 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Uo={key:1,class:"w-5 h-5 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Oo={class:"text-content-secondary dark:text-content-muted text-sm"},Ko={key:0,class:"space-y-4"},qo={key:0,class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},Wo={class:"bg-background-mute dark:bg-black/20 border border-stroke-subtle dark:border-stroke/10 rounded-md p-3"},Go={class:"text-xs font-mono text-content-primary dark:text-content-primary/80 break-all"},Jo={key:1,class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},Yo={class:"flex items-center justify-between"},Qo={class:"text-sm text-content-secondary dark:text-content-muted"},Xo={class:"text-xs text-content-muted dark:text-content-muted"},Zo={class:"grid grid-cols-2 gap-3"},es={class:"relative cursor-pointer group"},ts={class:"relative cursor-pointer group"},rs={class:"flex gap-3 pt-4"},os=["disabled"],ss=re({__name:"EditKeyModal",props:{show:{type:Boolean},node:{}},emits:["close","save","request-delete"],setup(G,{emit:L}){const m=G,g=L,y=l(""),v=l("allow"),x=V(()=>y.value.startsWith("#")),u=V(()=>({type:x.value?"Region":"Private Key",description:x.value?"Regional organizational key":"Individual assigned key"}));me(()=>m.node,o=>{o?(y.value=o.name,v.value=o.floodPolicy):(y.value="",v.value="allow")},{immediate:!0});const k=V(()=>y.value.trim().length>0&&m.node),A=o=>{const P=new Date().getTime()-o.getTime(),_=Math.floor(P/(1e3*60)),a=Math.floor(P/(1e3*60*60)),i=Math.floor(P/(1e3*60*60*24)),I=Math.floor(i/365);return _<60?`${_}m ago`:a<24?`${a}h ago`:i<365?`${i}d ago`:`${I}y ago`},j=o=>{window.navigator?.clipboard&&window.navigator.clipboard.writeText(o)},T=()=>{!k.value||!m.node||(g("save",{id:m.node.id,name:y.value.trim(),floodPolicy:v.value}),F())},c=()=>{m.node&&(g("request-delete",m.node),F())},F=()=>{g("close")},n=o=>{o.target===o.currentTarget&&F()};return(o,d)=>o.show?(t(),r("div",{key:0,onClick:n,class:"fixed inset-0 bg-black/50 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[e("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-lg border border-stroke-subtle dark:border-white/10",onClick:d[4]||(d[4]=le(()=>{},["stop"]))},[e("div",Bo,[e("div",null,[d[6]||(d[6]=e("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Edit Entry",-1)),e("p",Lo,[d[5]||(d[5]=E(" Modify ",-1)),e("span",No,s(o.node?.name),1)])]),e("button",{onClick:F,class:"text-white/60 hover:text-white transition-colors"},d[7]||(d[7]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),e("form",{onSubmit:le(T,["prevent"]),class:"space-y-4"},[e("div",null,[e("label",Po,[e("div",Fo,[x.value?(t(),r("svg",Io,d[8]||(d[8]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(t(),r("svg",Ro,d[9]||(d[9]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),d[10]||(d[10]=E(" Region/Key Name ",-1))])]),R(e("input",{id:"keyName","onUpdate:modelValue":d[0]||(d[0]=P=>y.value=P),type:"text",placeholder:"Enter name (prefix with # for regions)",class:"w-full px-4 py-3 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors",autocomplete:"off"},null,512),[[K,y.value]])]),e("div",zo,[e("div",Vo,[e("div",Do,[x.value?(t(),r("svg",Ho,d[11]||(d[11]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(t(),r("svg",Uo,d[12]||(d[12]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),e("span",{class:q([x.value?"text-secondary":"text-accent-green","font-medium"])},s(u.value.type),3)]),e("div",{class:q(["flex-1 h-px",x.value?"bg-secondary/20":"bg-accent-green/20"])},null,2)]),e("p",Oo,s(u.value.description),1)]),o.node?(t(),r("div",Ko,[o.node.transport_key?(t(),r("div",qo,[d[14]||(d[14]=ae('
Transport Key
',1)),e("div",Wo,[e("div",Go,s(o.node.transport_key),1),e("button",{onClick:d[1]||(d[1]=P=>j(o.node.transport_key||"")),class:"mt-2 text-xs text-accent-green hover:text-accent-green/80 flex items-center gap-1",title:"Copy to clipboard"},d[13]||(d[13]=[e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),E(" Copy Key ",-1)]))])])):C("",!0),o.node.last_used?(t(),r("div",Jo,[d[15]||(d[15]=e("div",{class:"flex items-center gap-2 mb-3"},[e("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})]),e("span",{class:"text-sm font-medium text-content-primary dark:text-content-primary"},"Last Used")],-1)),e("div",Yo,[e("div",Qo,s(o.node.last_used.toLocaleDateString())+" at "+s(o.node.last_used.toLocaleTimeString()),1),e("div",Xo,s(A(o.node.last_used)),1)])])):C("",!0)])):C("",!0),e("div",null,[d[18]||(d[18]=e("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-primary mb-3"},[e("div",{class:"flex items-center gap-2"},[e("svg",{class:"w-4 h-4 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})]),E(" Flood Policy ")])],-1)),e("div",Zo,[e("label",es,[R(e("input",{type:"radio","onUpdate:modelValue":d[2]||(d[2]=P=>v.value=P),value:"allow",class:"sr-only"},null,512),[[ye,v.value]]),d[16]||(d[16]=ae('
Allow

Permit flooding

',1))]),e("label",ts,[R(e("input",{type:"radio","onUpdate:modelValue":d[3]||(d[3]=P=>v.value=P),value:"deny",class:"sr-only"},null,512),[[ye,v.value]]),d[17]||(d[17]=ae('
Deny

Block flooding

',1))])])]),e("div",rs,[e("button",{type:"button",onClick:c,class:"px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors"}," Delete "),e("button",{type:"button",onClick:F,class:"flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),e("button",{type:"submit",disabled:!k.value,class:q(["flex-1 px-4 py-3 rounded-lg transition-colors font-medium",k.value?"bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green":"bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 text-content-muted dark:text-content-muted/70 cursor-not-allowed"])}," Save Changes ",10,os)])],32)])])):C("",!0)}}),ns={class:"flex items-center gap-3 mb-6"},as={class:"text-content-secondary dark:text-content-muted text-sm mt-1"},ls={class:"text-accent-red font-mono"},ds={key:0,class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},is={class:"flex items-start gap-3"},us={class:"flex-1"},cs={class:"text-accent-red font-medium text-sm mb-2"},ms={class:"space-y-1 max-h-32 overflow-y-auto"},ps={key:0,class:"w-3 h-3 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},bs={key:1,class:"w-3 h-3 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},xs={class:"font-mono"},vs={key:0,class:"text-content-secondary dark:text-content-muted text-xs"},ks={key:1,class:"mb-6"},gs={class:"mb-3"},ys={class:"relative"},fs={class:"space-y-2 max-h-40 overflow-y-auto border border-stroke-subtle dark:border-stroke/20 rounded-lg p-3 bg-gray-50 dark:bg-white/5"},hs={key:0,class:"text-center py-4 text-content-secondary dark:text-content-muted text-sm"},ws={class:"relative"},_s=["value"],$s={class:"flex items-center gap-2 flex-1"},Cs={class:"text-content-primary dark:text-content-primary font-mono text-sm"},Ms={key:0,class:"ml-auto px-2 py-0.5 bg-background-mute dark:bg-stroke/10 text-content-secondary dark:text-content-muted text-xs rounded-full"},As={class:"flex gap-3"},Ss=re({__name:"DeleteConfirmModal",props:{show:{type:Boolean},node:{},allNodes:{}},emits:["close","delete-all","move-children"],setup(G,{emit:L}){const m=G,g=L,y=l(null),v=l(""),x=n=>{const o=[],d=P=>{for(const _ of P.children)o.push(_),d(_)};return d(n),o},u=V(()=>m.node?x(m.node):[]),k=V(()=>{if(!m.node)return[];const n=new Set([m.node.id,...u.value.map(d=>d.id)]),o=d=>{const P=[];for(const _ of d)_.name.startsWith("#")&&!n.has(_.id)&&P.push(_),_.children.length>0&&P.push(...o(_.children));return P};return o(m.allNodes)}),A=V(()=>{if(!v.value.trim())return k.value;const n=v.value.toLowerCase();return k.value.filter(o=>o.name.toLowerCase().includes(n))}),j=()=>{m.node&&(g("delete-all",m.node.id),c())},T=()=>{!m.node||!y.value||(g("move-children",{nodeId:m.node.id,targetParentId:y.value}),c())},c=()=>{y.value=null,v.value="",g("close")},F=n=>{n.target===n.currentTarget&&c()};return(n,o)=>n.show&&n.node?(t(),r("div",{key:0,onClick:F,class:"fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[e("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-lg border border-stroke-subtle dark:border-white/10",onClick:o[2]||(o[2]=le(()=>{},["stop"]))},[e("div",ns,[o[6]||(o[6]=e("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),e("div",null,[o[4]||(o[4]=e("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Confirm Deletion",-1)),e("p",as,[o[3]||(o[3]=E(" Deleting ",-1)),e("span",ls,s(n.node?.name),1)])]),e("button",{onClick:c,class:"ml-auto text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},o[5]||(o[5]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),u.value.length>0?(t(),r("div",ds,[e("div",is,[o[9]||(o[9]=e("svg",{class:"w-5 h-5 text-accent-red flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),e("div",us,[e("h4",cs," This will affect "+s(u.value.length)+" child "+s(u.value.length===1?"entry":"entries")+": ",1),e("div",ms,[(t(!0),r(W,null,ee(u.value.slice(0,10),d=>(t(),r("div",{key:d.id,class:"flex items-center gap-2 text-xs text-content-secondary dark:text-content-primary/80"},[d.name.startsWith("#")?(t(),r("svg",ps,o[7]||(o[7]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"},null,-1)]))):(t(),r("svg",bs,o[8]||(o[8]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z"},null,-1)]))),e("span",xs,s(d.name),1),e("span",{class:q(["px-1 py-0.5 text-xs rounded",d.floodPolicy==="allow"?"bg-accent-green/20 text-accent-green":"bg-accent-red/20 text-accent-red"])},s(d.floodPolicy),3)]))),128)),u.value.length>10?(t(),r("div",vs," ...and "+s(u.value.length-10)+" more ",1)):C("",!0)])])])])):C("",!0),u.value.length>0&&k.value.length>0?(t(),r("div",ks,[o[13]||(o[13]=e("h4",{class:"text-content-primary dark:text-content-primary font-medium text-sm mb-3"},"Move children to another region:",-1)),e("div",gs,[e("div",ys,[o[10]||(o[10]=e("svg",{class:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-content-muted dark:text-content-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1)),R(e("input",{"onUpdate:modelValue":o[0]||(o[0]=d=>v.value=d),type:"text",placeholder:"Search regions...",class:"w-full pl-9 pr-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors text-sm"},null,512),[[K,v.value]])])]),e("div",fs,[A.value.length===0?(t(),r("div",hs,s(v.value?"No regions match your search":"No available regions"),1)):C("",!0),(t(!0),r(W,null,ee(A.value,d=>(t(),r("label",{key:d.id,class:"flex items-center gap-3 p-2 rounded cursor-pointer hover:bg-stroke-subtle dark:hover:bg-white/10 transition-colors group"},[e("div",ws,[R(e("input",{type:"radio",value:d.id,"onUpdate:modelValue":o[1]||(o[1]=P=>y.value=P),class:"sr-only peer"},null,8,_s),[[ye,y.value]]),o[11]||(o[11]=e("div",{class:"w-4 h-4 border-2 border-stroke dark:border-stroke/30 rounded-full group-hover:border-stroke dark:group-hover:border-stroke/50 peer-checked:border-primary peer-checked:bg-primary/20 transition-all"},[e("div",{class:"w-2 h-2 rounded-full bg-primary scale-0 peer-checked:scale-100 transition-transform absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"})],-1))]),e("div",$s,[o[12]||(o[12]=e("svg",{class:"w-4 h-4 text-secondary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 20l4-16m2 16l4-16M6 9h14M4 15h14"})],-1)),e("span",Cs,s(d.name),1),d.children.length>0?(t(),r("span",Ms,s(d.children.length),1)):C("",!0)])]))),128))])])):C("",!0),e("div",As,[e("button",{onClick:c,class:"flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),u.value.length>0&&y.value?(t(),r("button",{key:0,onClick:T,class:"flex-1 px-4 py-3 bg-primary/20 hover:bg-primary/30 border border-primary/50 text-primary rounded-lg transition-colors"}," Move & Delete ")):C("",!0),e("button",{onClick:j,class:"flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium"},s(u.value.length>0?"Delete All":"Delete"),1)])])])):C("",!0)}}),js={class:"space-y-4 sm:space-y-6"},Ts={class:"flex flex-col sm:flex-row sm:justify-between sm:items-start gap-3"},Es={class:"flex gap-2 flex-wrap"},Bs=["disabled"],Ls=["disabled"],Ns={class:"glass-card rounded-[15px] p-3 sm:p-4 border border-stroke-subtle dark:border-stroke/10 bg-background-mute dark:bg-white/5"},Ps={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},Fs={class:"flex items-center gap-2 sm:gap-3"},Is={class:"flex bg-background-mute dark:bg-stroke/5 rounded-lg border border-stroke-subtle dark:border-stroke/20 p-0.5 sm:p-1"},Rs={class:"glass-card rounded-[15px] p-3 sm:p-6 border border-stroke-subtle dark:border-stroke/10"},zs={key:0,class:"flex items-center justify-center py-8"},Vs={key:1,class:"text-center py-8"},Ds={class:"text-content-secondary dark:text-content-muted text-sm"},Hs={key:2,class:"text-center py-8"},Us={key:3,class:"space-y-2"},Os=re({name:"TransportKeys",__name:"TransportKeys",setup(G){const L=je(),m=be(),g=l(!1),y=l(!1),v=l(!1),x=l(null),u=l(null),k=l("deny"),A=V(()=>m.stats?.config?.mesh?.global_flood_allow??null);me(A,$=>{$!==null&&(k.value=$?"allow":"deny")},{immediate:!0});const j=l([]),T=l(!1),c=l(null),F=$=>{const w=new Map,U=[];return $.forEach(O=>{const ne={id:O.id,name:O.name,floodPolicy:O.flood_policy,transport_key:O.transport_key,last_used:O.last_used?new Date(O.last_used*1e3):void 0,parent_id:O.parent_id,children:[]};w.set(O.id,ne)}),w.forEach(O=>{O.parent_id&&w.has(O.parent_id)?w.get(O.parent_id).children.push(O):U.push(O)}),U},n=async()=>{try{T.value=!0,c.value=null;const $=await Q.getTransportKeys();$.success&&$.data?j.value=F($.data):c.value=$.error||"Failed to load transport keys"}catch($){c.value=$ instanceof Error?$.message:"Unknown error occurred",console.error("Error loading transport keys:",$)}finally{T.value=!1}};ve(()=>{n()});function o($,w){for(const U of $){if(U.id===w)return U;if(U.children){const O=o(U.children,w);if(O)return O}}return null}function d(){const $=L.selectedNodeId.value;return $?o(j.value,$)?.name:void 0}function P($){L.setSelectedNode($)}function _(){g.value=!0}function a(){if(L.selectedNodeId.value){const $=o(j.value,L.selectedNodeId.value);$&&(u.value=$,v.value=!0)}}function i(){if(L.selectedNodeId.value){const $=o(j.value,L.selectedNodeId.value);$&&(x.value=$,y.value=!0)}}const I=async $=>{try{const w=await Q.createTransportKey($.name,$.floodPolicy,void 0,$.parentId,void 0);w.success?await n():(console.error("Failed to add transport key:",w.error),c.value=w.error||"Failed to add transport key")}catch(w){console.error("Error adding transport key:",w),c.value=w instanceof Error?w.message:"Unknown error occurred"}finally{g.value=!1}};function J(){g.value=!1}async function N($){try{const w=$==="allow",U=await Q.updateGlobalFloodPolicy(w);U.success?(k.value=$,await m.fetchStats()):(console.error("Failed to update global flood policy:",U.error),c.value=U.error||"Failed to update global flood policy")}catch(w){console.error("Error updating global flood policy:",w),c.value=w instanceof Error?w.message:"Failed to update global flood policy"}}function D(){y.value=!1,x.value=null}async function H($){try{const w=await Q.updateTransportKey($.id,$.name,$.floodPolicy);w.success?await n():(console.error("Failed to update transport key:",w.error),c.value=w.error||"Failed to update transport key")}catch(w){console.error("Error updating transport key:",w),c.value=w instanceof Error?w.message:"Unknown error occurred"}finally{D()}}function se($){y.value=!1,x.value=null,u.value=$,v.value=!0}function oe(){v.value=!1,u.value=null}async function z($){try{const w=await Q.deleteTransportKey($);w.success?(await n(),L.setSelectedNode(null)):(console.error("Failed to delete transport key:",w.error),c.value=w.error||"Failed to delete transport key")}catch(w){console.error("Error deleting transport key:",w),c.value=w instanceof Error?w.message:"Unknown error occurred"}finally{oe()}}async function f($){try{const w=await Q.deleteTransportKey($.nodeId);w.success?(await n(),L.setSelectedNode(null)):(console.error("Failed to delete transport key:",w.error),c.value=w.error||"Failed to delete transport key")}catch(w){console.error("Error deleting transport key:",w),c.value=w instanceof Error?w.message:"Unknown error occurred"}finally{oe()}}return($,w)=>(t(),r("div",js,[e("div",Ts,[w[3]||(w[3]=e("div",null,[e("h3",{class:"text-base sm:text-lg font-semibold text-content-primary dark:text-content-primary mb-1 sm:mb-2"},"Regions/Keys"),e("p",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Manage regional key hierarchy")],-1)),e("div",Es,[e("button",{onClick:_,class:"flex items-center gap-1.5 sm:gap-2 px-2.5 sm:px-3 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm bg-accent-green/10 hover:bg-accent-green/20 text-accent-green border-accent-green/30"},w[2]||(w[2]=[e("svg",{class:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),E(" Add ",-1)])),e("button",{onClick:i,disabled:!ce(L).selectedNodeId.value,class:q(["px-2.5 sm:px-4 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",ce(L).selectedNodeId.value?"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border-accent-green/50":"bg-background-mute dark:bg-stroke/10 text-content-muted dark:text-content-muted/70 border-stroke-subtle dark:border-stroke/20 cursor-not-allowed"])}," Edit ",10,Bs),e("button",{onClick:a,disabled:!ce(L).selectedNodeId.value,class:q(["px-2.5 sm:px-4 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm",ce(L).selectedNodeId.value?"bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border-accent-red/50":"bg-background-mute dark:bg-stroke/10 text-content-muted dark:text-content-muted/70 border-stroke-subtle dark:border-stroke/20 cursor-not-allowed"])}," Delete ",10,Ls)])]),e("div",Ns,[e("div",Ps,[w[4]||(w[4]=e("div",null,[e("h4",{class:"text-xs sm:text-sm font-medium text-content-primary dark:text-content-primary mb-1"},"Global Flood Policy (*)"),e("p",{class:"text-content-secondary dark:text-content-muted text-[10px] sm:text-xs"},"Master control for repeater flooding")],-1)),e("div",Fs,[e("div",Is,[e("button",{onClick:w[0]||(w[0]=U=>N("deny")),class:q(["px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium rounded transition-colors",k.value==="deny"?"bg-accent-red/20 text-accent-red border border-accent-red/50":"text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-secondary"])}," DENY ",2),e("button",{onClick:w[1]||(w[1]=U=>N("allow")),class:q(["px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium rounded transition-colors",k.value==="allow"?"bg-accent-green/20 text-accent-green border border-accent-green/50":"text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-secondary"])}," ALLOW ",2)])])])]),e("div",Rs,[T.value?(t(),r("div",zs,w[5]||(w[5]=[e("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-accent-green"},null,-1),e("span",{class:"ml-2 text-content-secondary dark:text-content-muted"},"Loading transport keys...",-1)]))):c.value?(t(),r("div",Vs,[w[6]||(w[6]=e("div",{class:"text-accent-red mb-2"},"⚠️ Error loading transport keys",-1)),e("div",Ds,s(c.value),1),e("button",{onClick:n,class:"mt-4 px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded-lg transition-colors"}," Retry ")])):j.value.length===0?(t(),r("div",Hs,w[7]||(w[7]=[e("div",{class:"text-content-muted dark:text-content-muted mb-2"},"📝 No transport keys found",-1),e("div",{class:"text-content-muted dark:text-content-muted/60 text-sm"},"Add your first transport key to get started",-1)]))):(t(),r("div",Us,[(t(!0),r(W,null,ee(j.value,U=>(t(),Me(uo,{key:U.id,node:U,"selected-node-id":ce(L).selectedNodeId.value,level:0,onSelect:P},null,8,["node","selected-node-id"]))),128))]))]),X(Eo,{show:g.value,"selected-node-name":d(),"selected-node-id":ce(L).selectedNodeId.value||void 0,onClose:J,onAdd:I},null,8,["show","selected-node-name","selected-node-id"]),X(ss,{show:y.value,node:x.value,onClose:D,onSave:H,onRequestDelete:se},null,8,["show","node"]),X(Ss,{show:v.value,node:u.value,"all-nodes":j.value,onClose:oe,onDeleteAll:z,onMoveChildren:f},null,8,["show","node","all-nodes"])]))}}),Ks={class:"space-y-4 sm:space-y-6"},qs={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},Ws={key:0,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-4"},Gs={class:"flex items-center gap-2 text-red-600 dark:text-red-400"},Js={key:1,class:"flex items-center justify-center py-12"},Ys={key:2,class:"space-y-3"},Qs={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3"},Xs={class:"flex-1"},Zs={class:"flex items-center gap-2 sm:gap-3"},en={class:"min-w-0 flex-1"},tn={class:"text-content-primary dark:text-content-primary font-medium text-sm sm:text-base break-all"},rn={class:"flex flex-col sm:flex-row sm:items-center sm:gap-4 mt-1 text-xs text-content-secondary dark:text-content-muted"},on={class:"truncate"},sn={class:"truncate"},nn=["onClick","disabled"],an={key:3,class:"text-center py-12"},ln={class:"bg-surface dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke/20 rounded-[15px] p-6 max-w-md w-full shadow-2xl"},dn={class:"space-y-4"},un={class:"flex justify-end gap-3 mt-6"},cn=["disabled"],mn=["disabled"],pn={class:"bg-surface dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke/20 rounded-[15px] p-6 max-w-lg w-full shadow-2xl"},bn={class:"space-y-4"},xn={class:"flex gap-2"},vn=["value"],kn={class:"bg-blue-500/10 border border-blue-500/30 rounded-lg p-4"},gn={class:"block bg-blue-500/20 px-3 py-2 rounded text-xs text-blue-100 font-mono overflow-x-auto"},yn=re({name:"APITokens",__name:"APITokens",setup(G){const L=l([]),m=l(!1),g=l(null),y=l(!1),v=l(""),x=l(null),u=l(!1),k=l(!1),A=l(null),j=async()=>{m.value=!0,g.value=null;try{const a=await Q.get("/auth/tokens"),i=a.data||a;L.value=i.tokens||[]}catch(a){console.error("Failed to fetch API tokens:",a),g.value=a instanceof Error?a.message:"Failed to fetch tokens"}finally{m.value=!1}},T=async()=>{if(!v.value.trim()){g.value="Token name is required";return}m.value=!0,g.value=null;try{const a=await Q.post("/auth/tokens",{name:v.value.trim()}),i=a.data||a;x.value=i.token||null,y.value=!1,u.value=!0,v.value="",await j()}catch(a){console.error("Failed to create API token:",a),g.value=a instanceof Error?a.message:"Failed to create token"}finally{m.value=!1}},c=(a,i)=>{A.value={id:a,name:i},k.value=!0},F=async()=>{if(A.value){m.value=!0,g.value=null;try{await Q.delete(`/auth/tokens/${A.value.id}`),await j(),k.value=!1,A.value=null}catch(a){console.error("Failed to revoke API token:",a),g.value=a instanceof Error?a.message:"Failed to revoke token"}finally{m.value=!1}}},n=()=>{y.value=!1,v.value="",g.value=null},o=()=>{u.value=!1,x.value=null},d=()=>{x.value&&navigator.clipboard.writeText(x.value)},P=a=>a?new Date(a*1e3).toLocaleString():"Never",_=V(()=>`${window.location.origin}/api/stats`);return ve(()=>{j()}),(a,i)=>(t(),r(W,null,[e("div",Ks,[e("div",qs,[i[5]||(i[5]=e("div",null,[e("h2",{class:"text-lg sm:text-xl font-semibold text-content-primary dark:text-content-primary"},"API Tokens"),e("p",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm mt-1"},"Manage API tokens for machine-to-machine authentication")],-1)),e("button",{onClick:i[0]||(i[0]=I=>y.value=!0),class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors flex items-center justify-center gap-2 text-sm sm:text-base"},i[4]||(i[4]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),E(" Create Token ",-1)]))]),i[20]||(i[20]=ae('

API tokens are used for machine-to-machine authentication. Include the token in the X-API-Key header when making API requests.

Tokens are only shown once at creation. Store them securely.

',1)),g.value?(t(),r("div",Ws,[e("div",Gs,[i[6]||(i[6]=e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),E(" "+s(g.value),1)])])):C("",!0),m.value&&L.value.length===0?(t(),r("div",Js,i[7]||(i[7]=[e("div",{class:"text-center"},[e("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),e("div",{class:"text-content-secondary dark:text-content-muted"},"Loading tokens...")],-1)]))):L.value.length>0?(t(),r("div",Ys,[(t(!0),r(W,null,ee(L.value,I=>(t(),r("div",{key:I.id,class:"bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-3 sm:p-4 hover:bg-stroke-subtle dark:hover:bg-white/10 transition-colors"},[e("div",Qs,[e("div",Xs,[e("div",Zs,[i[8]||(i[8]=e("svg",{class:"w-4 h-4 sm:w-5 sm:h-5 text-primary flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1)),e("div",en,[e("h3",tn,s(I.name),1),e("div",rn,[e("span",on,"Created: "+s(P(I.created_at)),1),e("span",sn,"Last used: "+s(P(I.last_used)),1)])])])]),e("button",{onClick:J=>c(I.id,I.name),disabled:m.value,class:"w-full sm:w-auto px-3 py-1.5 bg-red-100 dark:bg-red-500/20 hover:bg-red-500/30 text-red-600 dark:text-red-400 rounded-lg border border-red-500/50 transition-colors disabled:opacity-50 text-sm"}," Revoke ",8,nn)])]))),128))])):(t(),r("div",an,[i[9]||(i[9]=e("svg",{class:"w-16 h-16 text-content-muted dark:text-content-muted/40 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})],-1)),i[10]||(i[10]=e("h3",{class:"text-content-primary dark:text-content-primary font-medium mb-2"},"No API Tokens",-1)),i[11]||(i[11]=e("p",{class:"text-content-secondary dark:text-content-muted text-sm mb-4"},"Create a token to enable API access",-1)),e("button",{onClick:i[1]||(i[1]=I=>y.value=!0),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Create Your First Token ")])),y.value?(t(),r("div",{key:4,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:le(n,["self"])},[e("div",ln,[i[14]||(i[14]=e("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary mb-4"},"Create API Token",-1)),e("div",dn,[e("div",null,[i[12]||(i[12]=e("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-muted mb-2"},"Token Name",-1)),R(e("input",{"onUpdate:modelValue":i[2]||(i[2]=I=>v.value=I),type:"text",placeholder:"e.g., Production Server, CI/CD Pipeline",class:"w-full px-4 py-2 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-400 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors",onKeydown:Pe(T,["enter"])},null,544),[[K,v.value]]),i[13]||(i[13]=e("p",{class:"text-xs text-content-muted dark:text-content-muted mt-1"},"Give your token a descriptive name to identify its purpose",-1))]),e("div",un,[e("button",{onClick:n,disabled:m.value,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/10 transition-colors disabled:opacity-50"}," Cancel ",8,cn),e("button",{onClick:T,disabled:m.value||!v.value.trim(),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors disabled:opacity-50"},s(m.value?"Creating...":"Create Token"),9,mn)])])])])):C("",!0),u.value&&x.value?(t(),r("div",{key:5,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:le(o,["self"])},[e("div",pn,[i[19]||(i[19]=e("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary mb-4"},"Token Created Successfully",-1)),e("div",bn,[i[18]||(i[18]=ae('
Save this token now! For security reasons, it will not be shown again.
',1)),e("div",null,[i[16]||(i[16]=e("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-muted mb-2"},"Your API Token",-1)),e("div",xn,[e("input",{value:x.value,readonly:"",class:"flex-1 px-4 py-2 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary font-mono text-sm"},null,8,vn),e("button",{onClick:d,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors flex items-center gap-2",title:"Copy to clipboard"},i[15]||(i[15]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1),E(" Copy ",-1)]))])]),e("div",kn,[i[17]||(i[17]=e("p",{class:"text-sm text-blue-200 mb-2"},[e("strong",null,"Usage Example:")],-1)),e("code",gn,' curl -H "X-API-Key: '+s(x.value)+'" '+s(_.value),1)]),e("div",{class:"flex justify-end mt-6"},[e("button",{onClick:o,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Done ")])])])])):C("",!0)]),X(Fe,{show:k.value,title:"Revoke API Token",message:`Are you sure you want to revoke the token '${A.value?.name}'? This action cannot be undone.`,"confirm-text":"Revoke","cancel-text":"Cancel",variant:"danger",onConfirm:F,onClose:i[3]||(i[3]=I=>k.value=!1)},null,8,["show","message"])],64))}}),fn={class:"space-y-6"},hn={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},wn={class:"space-y-4"},_n={class:"flex items-center justify-between"},$n=["disabled"],Cn={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},Mn={class:"space-y-4"},An={class:"space-y-3"},Sn=["checked","disabled"],jn=["checked","disabled"],Tn={class:"flex items-start gap-3"},En={key:0,class:"w-5 h-5 text-green-600 dark:text-green-400 flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Bn={key:1,class:"w-5 h-5 text-accent-cyan flex-shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Ln={class:"flex-1"},Nn={class:"text-sm font-medium text-content-primary dark:text-content-primary"},Pn={key:0,class:"text-xs text-green-600 dark:text-green-400 mt-1"},Fn={key:1,class:"p-4 bg-amber-500/10 border border-amber-500/30 rounded-lg"},In={class:"flex items-start justify-between gap-3"},Rn=["disabled"],zn={key:0,class:"animate-spin h-4 w-4",fill:"none",viewBox:"0 0 24 24"},Vn={key:1,class:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Dn={class:"flex items-center space-x-2"},Hn={key:0,class:"w-5 h-5 text-green-600 dark:text-green-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},Un={key:1,class:"w-5 h-5 text-red-600 dark:text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},On=re({name:"WebSettings",__name:"WebSettings",setup(G){const L=l(!1),m=l(""),g=l(!1),y=l(!1),v=l(!1),x=l(!1),u=l(!0),k=Ce({cors_enabled:!1,use_default_frontend:!0}),A=V(()=>g.value?"bg-green-500/10 border-green-600/40 dark:border-green-500/30":"bg-red-500/10 border-red-500/30");async function j(){try{u.value=!0;const _=await Q.get("/check_pymc_console");_.success&&_.data&&(x.value=_.data.exists,console.log("PyMC Console exists:",x.value))}catch(_){console.error("Failed to check PyMC Console:",_),x.value=!1}finally{u.value=!1}}async function T(){try{const _=await Q.get("/stats");console.log("WebSettings: Full response:",_);let a=null;if(_.success&&_.data?a=_.data:_&&"version"in _&&(a=_),a){const i=a.config?.web||{};console.log("WebSettings: webConfig:",i),k.cors_enabled=i.cors_enabled===!0,console.log("WebSettings: Set cors_enabled to:",k.cors_enabled);const I=i.web_path;k.use_default_frontend=!I||I==="",console.log("WebSettings: Set use_default_frontend to:",k.use_default_frontend,"from web_path:",I)}}catch(_){console.error("Failed to load web settings:",_),d("Failed to load settings",!1)}}async function c(){L.value=!0,m.value="";try{const _={web:{cors_enabled:k.cors_enabled}};k.use_default_frontend?_.web.web_path=null:_.web.web_path="/opt/pymc_console/web/html";const a=await Q.post("/update_web_config",_);a.success?(d("Settings saved successfully",!0),y.value=!0):d(a.error||"Failed to save settings",!1)}catch(_){console.error("Failed to save web settings:",_),d(_.message||"Failed to save settings",!1)}finally{L.value=!1}}async function F(){k.cors_enabled=!k.cors_enabled,await c()}async function n(){k.use_default_frontend=!0,await c()}async function o(){k.use_default_frontend=!1,await c()}function d(_,a){m.value=_,g.value=a,setTimeout(()=>{m.value=""},5e3)}async function P(){v.value=!0,m.value="";try{const _=await Q.post("/restart_service",{});_.success?(d("Service restart initiated. Page will reload...",!0),y.value=!1,setTimeout(()=>{window.location.reload()},2e3)):d(_.error||"Failed to restart service",!1)}catch(_){_.code==="ERR_NETWORK"||_.message?.includes("Network error")?(d("Service restarting... Page will reload",!0),y.value=!1,setTimeout(()=>{window.location.reload()},3e3)):(console.error("Failed to restart service:",_),d(_.message||"Failed to restart service",!1))}finally{v.value=!1}}return ve(()=>{T(),j()}),(_,a)=>(t(),r("div",fn,[e("div",hn,[a[1]||(a[1]=e("div",{class:"flex items-start justify-between mb-4"},[e("div",null,[e("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-1"},"CORS Settings"),e("p",{class:"text-sm text-content-secondary dark:text-content-muted"},"Control cross-origin resource sharing for API access")])],-1)),e("div",wn,[e("div",_n,[a[0]||(a[0]=e("div",null,[e("label",{class:"text-sm font-medium text-content-primary dark:text-content-primary"},"Enable CORS"),e("p",{class:"text-xs text-content-secondary dark:text-content-muted mt-1"},"Allow web frontends from different origins to access the API")],-1)),e("button",{onClick:F,disabled:L.value,class:q(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors border-2",k.cors_enabled?"bg-cyan-600 dark:bg-teal-500 border-cyan-600 dark:border-teal-500":"bg-gray-400 dark:bg-gray-600 border-gray-400 dark:border-gray-600",L.value?"opacity-50 cursor-not-allowed":"cursor-pointer"])},[e("span",{class:q(["inline-block h-4 w-4 transform rounded-full bg-white transition-transform shadow-lg",k.cors_enabled?"translate-x-5":"translate-x-0.5"])},null,2)],10,$n)])])]),e("div",Cn,[a[11]||(a[11]=e("div",{class:"flex items-start justify-between mb-4"},[e("div",null,[e("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-1"},"Web Frontend"),e("p",{class:"text-sm text-content-secondary dark:text-content-muted"},"Choose which web interface to use")])],-1)),e("div",Mn,[e("div",An,[e("label",{class:q(["flex items-start space-x-3 p-4 bg-background-mute dark:bg-background/30 rounded-lg border-2 cursor-pointer transition-all",k.use_default_frontend?"border-accent-cyan bg-accent-cyan/10":"border-stroke-subtle dark:border-stroke/10 hover:border-accent-cyan/50"])},[e("input",{type:"radio",name:"frontend",checked:k.use_default_frontend,onChange:n,disabled:L.value,class:"mt-1 h-4 w-4 text-accent-cyan focus:ring-accent-cyan focus:ring-offset-background"},null,40,Sn),a[2]||(a[2]=e("div",{class:"flex-1"},[e("div",{class:"text-sm font-medium text-content-primary dark:text-content-primary"},"Default Frontend"),e("div",{class:"text-xs text-content-secondary dark:text-content-muted mt-1"},"Built-in pyMC Repeater web interface"),e("div",{class:"text-xs text-content-muted dark:text-content-muted/60 mt-1 font-mono"},"Built-in")],-1))],2),e("label",{class:q(["flex items-start space-x-3 p-4 bg-background-mute dark:bg-background/30 rounded-lg border-2 cursor-pointer transition-all",k.use_default_frontend?"border-stroke-subtle dark:border-stroke/10 hover:border-accent-cyan/50":"border-accent-cyan bg-accent-cyan/10"])},[e("input",{type:"radio",name:"frontend",checked:!k.use_default_frontend,onChange:o,disabled:L.value,class:"mt-1 h-4 w-4 text-accent-cyan focus:ring-accent-cyan focus:ring-offset-background"},null,40,jn),a[3]||(a[3]=ae('
PyMC Console
@Treehouse⚡
Alternative web interface for pyMC Repeater
/opt/pymc_console/web/html
',1))],2)]),u.value?C("",!0):(t(),r("div",{key:0,class:q(["p-4 rounded-lg border",x.value?"bg-green-500/5 border-green-500/20":"bg-accent-cyan/5 border-accent-cyan/20"])},[e("div",Tn,[x.value?(t(),r("svg",En,a[4]||(a[4]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):(t(),r("svg",Bn,a[5]||(a[5]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))),e("div",Ln,[e("h4",Nn,s(x.value?"PyMC Console has been detected":"PyMC Console Not Installed"),1),x.value?(t(),r("p",Pn,a[6]||(a[6]=[E(" PyMC Console is installed at ",-1),e("code",{class:"text-green-700 dark:text-green-300"},"/opt/pymc_console/web/html",-1)]))):(t(),r(W,{key:1},[a[7]||(a[7]=ae('

PyMC Console must be installed at /opt/pymc_console/web/html before selecting this option.

PyMC Console Install Instructions ',2))],64))])])],2)),y.value?(t(),r("div",Fn,[e("div",In,[a[10]||(a[10]=ae('

Service restart required

Web frontend changes will take effect after restarting the pymc-repeater service.

',1)),e("button",{onClick:P,disabled:v.value,class:"px-4 py-2 bg-amber-500 hover:bg-amber-600 disabled:bg-amber-500/50 text-white font-medium rounded-lg transition-colors disabled:cursor-not-allowed flex items-center gap-2 whitespace-nowrap"},[v.value?(t(),r("svg",zn,a[8]||(a[8]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"},null,-1)]))):(t(),r("svg",Vn,a[9]||(a[9]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]))),E(" "+s(v.value?"Restarting...":"Restart Now"),1)],8,Rn)])])):C("",!0)])]),m.value?(t(),r("div",{key:0,class:q(["p-4 rounded-lg border",A.value])},[e("div",Dn,[g.value?(t(),r("svg",Hn,a[12]||(a[12]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):(t(),r("svg",Un,a[13]||(a[13]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))),e("span",{class:q(g.value?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400")},s(m.value),3)])],2)):C("",!0)]))}}),Kn={class:"space-y-4"},qn={key:0,class:"bg-green-100 dark:bg-green-500/20 border border-green-500 dark:border-green-500/50 rounded-lg p-3 text-green-700 dark:text-green-400 text-sm"},Wn={key:1,class:"bg-red-100 dark:bg-red-500/20 border border-red-500 dark:border-red-500/50 rounded-lg p-3 text-red-700 dark:text-red-400 text-sm"},Gn={class:"flex justify-between items-center"},Jn={class:"flex gap-2"},Yn=["disabled"],Qn={class:"flex gap-2"},Xn=["disabled"],Zn=["disabled"],ea={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},ta={key:0,class:"flex items-center justify-center py-4"},ra={key:1,class:"text-center py-4"},oa={class:"grid grid-cols-2 sm:grid-cols-4 gap-3"},sa={class:"text-center p-2 bg-white dark:bg-white/5 rounded-lg"},na={class:"text-center p-2 bg-white dark:bg-white/5 rounded-lg"},aa={class:"text-lg font-mono text-content-primary dark:text-content-primary"},la={class:"text-center p-2 bg-white dark:bg-white/5 rounded-lg"},da={class:"text-lg font-mono text-green-600 dark:text-green-400"},ia={class:"text-center p-2 bg-white dark:bg-white/5 rounded-lg"},ua={class:"text-lg font-mono text-red-600 dark:text-red-400"},ca={key:0,class:"mt-2 p-2 bg-red-50 dark:bg-red-500/10 rounded-lg border border-red-200 dark:border-red-500/30"},ma={key:1,class:"mt-2 p-2 bg-orange-50 dark:bg-orange-500/10 rounded-lg border border-orange-200 dark:border-orange-500/30"},pa={class:"font-medium"},ba={class:"font-mono text-[10px] opacity-70"},xa={class:"text-[10px]"},va={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},ka={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},ga={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},ya={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},fa={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},ha={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},wa={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},_a={key:1,class:"flex items-center gap-2"},$a={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1"},Ca={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Ma={key:1,class:"flex items-center gap-2"},Aa={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},Sa={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},ja={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Ta={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Ea={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Ba={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},La={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Na={key:1,class:"flex items-center gap-2"},Pa={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Fa={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Ia={key:1,class:"flex items-center gap-2"},Ra={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1"},za={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Va={key:1,class:"flex items-center gap-2"},Da={class:"bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3"},Ha={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Ua={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},Oa={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1"},Ka={key:0,class:"text-content-primary dark:text-content-primary font-mono text-sm"},qa={key:1,class:"flex items-center gap-2"},Wa={class:"py-2"},Ga={class:"grid grid-cols-3 gap-2 mt-2"},Ja={class:"text-center p-2 bg-white dark:bg-white/5 rounded-lg"},Ya={key:0,class:"font-mono text-sm text-content-primary dark:text-content-primary"},Qa={class:"text-center p-2 bg-white dark:bg-white/5 rounded-lg"},Xa={key:0,class:"font-mono text-sm text-content-primary dark:text-content-primary"},Za={class:"text-center p-2 bg-white dark:bg-white/5 rounded-lg"},el={key:0,class:"font-mono text-sm text-content-primary dark:text-content-primary"},tl={class:"p-6 space-y-4"},rl={class:"flex justify-between items-start"},ol={class:"flex justify-end pt-4 border-t border-stroke-subtle dark:border-stroke/20"},sl=re({__name:"AdvertSettings",setup(G){const L=be(),m=V(()=>L.stats?.config?.repeater||{}),g=V(()=>m.value.advert_rate_limit||{}),y=V(()=>m.value.advert_penalty_box||{}),v=V(()=>m.value.advert_adaptive||{}),x=V(()=>v.value.thresholds||{}),u=l(!1),k=l(!1),A=l(""),j=l(""),T=l(!1),c=l(!1),F=l(null),n=l(!0),o=l(2),d=l(1),P=l(10),_=l(60),a=l(!0),i=l(2),I=l(12),J=l(6),N=l(2),D=l(24),H=l(!0),se=l(.1),oe=l(5),z=l(.05),f=l(.2),$=l(.5),w=async()=>{c.value=!0;try{const Z=await ke.get("/api/advert_rate_limit_stats");Z.data?.success&&(F.value=Z.data.data)}catch(Z){console.error("Failed to fetch rate limit stats:",Z)}finally{c.value=!1}};me([g,y,v],()=>{console.log("[AdvertSettings] Watch triggered, isEditing:",u.value),u.value?console.log("[AdvertSettings] Watch skipped (editing mode)"):(console.log("[AdvertSettings] Watch loading values from store"),console.log("[AdvertSettings] rateLimitConfig:",g.value),console.log("[AdvertSettings] penaltyConfig:",y.value),console.log("[AdvertSettings] adaptiveConfig:",v.value),n.value=g.value.enabled??!1,o.value=g.value.bucket_capacity??2,d.value=g.value.refill_tokens??1,P.value=Math.round((g.value.refill_interval_seconds??36e3)/3600),_.value=Math.round((g.value.min_interval_seconds??0)/60),a.value=y.value.enabled??!1,i.value=y.value.violation_threshold??2,I.value=Math.round((y.value.violation_decay_seconds??43200)/3600),J.value=Math.round((y.value.base_penalty_seconds??21600)/3600),N.value=y.value.penalty_multiplier??2,D.value=Math.round((y.value.max_penalty_seconds??86400)/3600),H.value=v.value.enabled??!1,se.value=v.value.ewma_alpha??.1,oe.value=Math.round((v.value.hysteresis_seconds??300)/60),z.value=x.value.quiet_max??.05,f.value=x.value.normal_max??.2,$.value=x.value.busy_max??.5,console.log("[AdvertSettings] Watch loaded values:"),console.log(" rateLimitEnabled:",n.value),console.log(" minIntervalMinutes:",_.value))},{immediate:!0}),ve(()=>{w()});const U=()=>{console.log("[AdvertSettings] reloadFormValues called"),console.log("[AdvertSettings] rateLimitConfig:",g.value),console.log("[AdvertSettings] penaltyConfig:",y.value),console.log("[AdvertSettings] adaptiveConfig:",v.value),n.value=g.value.enabled??!1,o.value=g.value.bucket_capacity??2,d.value=g.value.refill_tokens??1,P.value=Math.round((g.value.refill_interval_seconds??36e3)/3600),_.value=Math.round((g.value.min_interval_seconds??0)/60),a.value=y.value.enabled??!1,i.value=y.value.violation_threshold??2,I.value=Math.round((y.value.violation_decay_seconds??43200)/3600),J.value=Math.round((y.value.base_penalty_seconds??21600)/3600),N.value=y.value.penalty_multiplier??2,D.value=Math.round((y.value.max_penalty_seconds??86400)/3600),H.value=v.value.enabled??!1,se.value=v.value.ewma_alpha??.1,oe.value=Math.round((v.value.hysteresis_seconds??300)/60),z.value=x.value.quiet_max??.05,f.value=x.value.normal_max??.2,$.value=x.value.busy_max??.5,console.log("[AdvertSettings] Form values after reload:"),console.log(" rateLimitEnabled:",n.value),console.log(" minIntervalMinutes:",_.value),console.log(" penaltyEnabled:",a.value),console.log(" adaptiveEnabled:",H.value)},O=()=>{u.value=!0,A.value="",j.value=""},ne=()=>{u.value=!1,A.value="",j.value="",U()},ue=async()=>{k.value=!0,j.value="",A.value="";try{const Z={rate_limit_enabled:n.value,bucket_capacity:o.value,refill_tokens:d.value,refill_interval_seconds:P.value*3600,min_interval_seconds:_.value*60,penalty_enabled:a.value,violation_threshold:i.value,violation_decay_seconds:I.value*3600,base_penalty_seconds:J.value*3600,penalty_multiplier:N.value,max_penalty_seconds:D.value*3600,adaptive_enabled:H.value,ewma_alpha:se.value,hysteresis_seconds:oe.value*60,quiet_max:z.value,normal_max:f.value,busy_max:$.value};console.log("[AdvertSettings] Sending save request with payload:",Z);const h=(await ke.post("/api/update_advert_rate_limit_config",Z)).data;console.log("[AdvertSettings] API response:",h),h.success?(A.value=h.data?.message||"Settings saved successfully",console.log("[AdvertSettings] Save successful, fetching updated config..."),await L.fetchStats(),console.log("[AdvertSettings] systemStore.fetchStats() complete"),console.log("[AdvertSettings] rateLimitConfig after fetchStats:",g.value),await w(),console.log("[AdvertSettings] fetchStats() complete"),await fe(),console.log("[AdvertSettings] nextTick() complete, calling reloadFormValues()"),U(),console.log("[AdvertSettings] reloadFormValues() complete, exiting edit mode"),u.value=!1,setTimeout(()=>{A.value=""},3e3)):(j.value=h.error||"Failed to save settings",console.error("[AdvertSettings] Save failed:",h.error))}catch(Z){console.error("Failed to save advert settings:",Z),j.value=Z.response?.data?.error||"Failed to save settings"}finally{k.value=!1}},de=V(()=>F.value?.adaptive?.current_tier||"unknown"),xe=V(()=>{switch(de.value){case"quiet":return"bg-green-100 dark:bg-green-500/20 text-green-700 dark:text-green-400 border-green-500";case"normal":return"bg-blue-100 dark:bg-blue-500/20 text-blue-700 dark:text-blue-400 border-blue-500";case"busy":return"bg-yellow-100 dark:bg-yellow-500/20 text-yellow-700 dark:text-yellow-400 border-yellow-500";case"congested":return"bg-red-100 dark:bg-red-500/20 text-red-700 dark:text-red-400 border-red-500";default:return"bg-gray-100 dark:bg-gray-500/20 text-gray-700 dark:text-gray-400 border-gray-500"}});return(Z,b)=>(t(),r("div",Kn,[A.value?(t(),r("div",qn,s(A.value),1)):C("",!0),j.value?(t(),r("div",Wn,s(j.value),1)):C("",!0),e("div",Gn,[e("div",Jn,[e("button",{onClick:w,disabled:c.value,class:"px-3 py-1.5 text-xs bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-secondary dark:text-content-muted rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors disabled:opacity-50"},s(c.value?"Loading...":"Refresh Stats"),9,Yn),e("button",{onClick:b[0]||(b[0]=h=>T.value=!0),class:"px-3 py-1.5 text-xs bg-blue-100 dark:bg-blue-500/20 hover:bg-blue-200 dark:hover:bg-blue-500/30 text-blue-700 dark:text-blue-400 rounded-lg border border-blue-500/50 transition-colors",title:"How rate limiting works"},b[19]||(b[19]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)]))]),e("div",Qn,[u.value?(t(),r(W,{key:1},[e("button",{onClick:ne,disabled:k.value,class:"px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"}," Cancel ",8,Xn),e("button",{onClick:ue,disabled:k.value,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},s(k.value?"Saving...":"Save Changes"),9,Zn)],64)):(t(),r("button",{key:0,onClick:O,class:"px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm"}," Edit Settings "))])]),e("div",ea,[b[28]||(b[28]=e("h3",{class:"text-sm font-medium text-content-primary dark:text-content-primary"},"Current Status",-1)),c.value&&!F.value?(t(),r("div",ta,b[20]||(b[20]=[e("div",{class:"animate-spin w-5 h-5 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full"},null,-1),e("span",{class:"ml-2 text-sm text-content-muted"},"Loading stats...",-1)]))):F.value?(t(),r(W,{key:2},[e("div",oa,[e("div",sa,[b[22]||(b[22]=e("div",{class:"text-xs text-content-muted dark:text-content-muted"},"Mesh Tier",-1)),e("div",{class:q(["mt-1 px-2 py-0.5 rounded border text-xs font-medium inline-block",xe.value])},s(de.value.toUpperCase()),3)]),e("div",na,[b[23]||(b[23]=e("div",{class:"text-xs text-content-muted dark:text-content-muted"},"Adverts/min",-1)),e("div",aa,s(F.value.metrics?.adverts_per_min_ewma?.toFixed(2)||"0.00"),1)]),e("div",la,[b[24]||(b[24]=e("div",{class:"text-xs text-content-muted dark:text-content-muted"},"Allowed",-1)),e("div",da,s(F.value.stats?.adverts_allowed||0),1)]),e("div",ia,[b[25]||(b[25]=e("div",{class:"text-xs text-content-muted dark:text-content-muted"},"Dropped",-1)),e("div",ua,s(F.value.stats?.adverts_dropped||0),1)])]),Object.keys(F.value.active_penalties||{}).length>0?(t(),r("div",ca,[b[26]||(b[26]=e("div",{class:"text-xs font-medium text-red-700 dark:text-red-400 mb-1"},"Active Penalties",-1)),(t(!0),r(W,null,ee(F.value.active_penalties,(h,p)=>(t(),r("div",{key:p,class:"text-xs font-mono text-red-600 dark:text-red-400"},s(p)+"... - "+s(Math.round(h))+"s remaining ",1))),128))])):C("",!0),F.value.recent_drops&&F.value.recent_drops.length>0?(t(),r("div",ma,[b[27]||(b[27]=e("div",{class:"text-xs font-medium text-orange-700 dark:text-orange-400 mb-1"},"Recently Dropped Adverts",-1)),(t(!0),r(W,null,ee(F.value.recent_drops,(h,p)=>(t(),r("div",{key:p,class:"text-xs text-orange-600 dark:text-orange-400 py-0.5"},[e("span",pa,s(h.name),1),e("span",ba,"("+s(h.pubkey)+"...)",1),e("span",xa," - "+s(h.reason)+" ("+s(h.seconds_ago)+"s ago)",1)]))),128))])):C("",!0)],64)):(t(),r("div",ra,b[21]||(b[21]=[e("p",{class:"text-xs text-content-muted dark:text-content-muted"},' Stats not available. Click "Refresh Stats" to load. ',-1)])))]),e("div",va,[b[36]||(b[36]=e("h3",{class:"text-sm font-medium text-content-primary dark:text-content-primary flex items-center gap-2"},[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})]),E(" Token Bucket Rate Limiting ")],-1)),b[37]||(b[37]=e("p",{class:"text-xs text-content-muted dark:text-content-muted"},"Controls how many adverts each pubkey can send in a given time period.",-1)),e("div",ka,[b[30]||(b[30]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Rate Limiting",-1)),u.value?R((t(),r("select",{key:1,"onUpdate:modelValue":b[1]||(b[1]=h=>n.value=h),class:"w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},b[29]||(b[29]=[e("option",{value:!0},"Enabled",-1),e("option",{value:!1},"Disabled",-1)]),512)),[[pe,n.value]]):(t(),r("div",ga,s(n.value?"Enabled":"Disabled"),1))]),e("div",ya,[b[31]||(b[31]=e("div",null,[e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Bucket Capacity"),e("p",{class:"text-xs text-content-muted dark:text-content-muted"},"Max burst size (adverts)")],-1)),u.value?R((t(),r("input",{key:1,"onUpdate:modelValue":b[2]||(b[2]=h=>o.value=h),type:"number",min:"1",max:"10",class:"w-full sm:w-24 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[K,o.value,void 0,{number:!0}]]):(t(),r("div",fa,s(o.value),1))]),e("div",ha,[b[33]||(b[33]=e("div",null,[e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Refill Interval"),e("p",{class:"text-xs text-content-muted dark:text-content-muted"},"Time between token refills")],-1)),u.value?(t(),r("div",_a,[R(e("input",{"onUpdate:modelValue":b[3]||(b[3]=h=>P.value=h),type:"number",min:"1",max:"48",class:"w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[K,P.value,void 0,{number:!0}]]),b[32]||(b[32]=e("span",{class:"text-content-muted text-sm"},"hours",-1))])):(t(),r("div",wa,s(P.value)+" hours",1))]),e("div",$a,[b[35]||(b[35]=e("div",null,[e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Minimum Interval"),e("p",{class:"text-xs text-content-muted dark:text-content-muted"},"Hard minimum between adverts")],-1)),u.value?(t(),r("div",Ma,[R(e("input",{"onUpdate:modelValue":b[4]||(b[4]=h=>_.value=h),type:"number",min:"0",max:"1440",class:"w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[K,_.value,void 0,{number:!0}]]),b[34]||(b[34]=e("span",{class:"text-content-muted text-sm"},"min",-1))])):(t(),r("div",Ca,s(_.value)+" min",1))])]),e("div",Aa,[b[47]||(b[47]=e("h3",{class:"text-sm font-medium text-content-primary dark:text-content-primary flex items-center gap-2"},[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636"})]),E(" Penalty Box (Repeat Offenders) ")],-1)),b[48]||(b[48]=e("p",{class:"text-xs text-content-muted dark:text-content-muted"},"Applies escalating cooldowns to pubkeys that repeatedly violate limits.",-1)),e("div",Sa,[b[39]||(b[39]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Penalty Box",-1)),u.value?R((t(),r("select",{key:1,"onUpdate:modelValue":b[5]||(b[5]=h=>a.value=h),class:"w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},b[38]||(b[38]=[e("option",{value:!0},"Enabled",-1),e("option",{value:!1},"Disabled",-1)]),512)),[[pe,a.value]]):(t(),r("div",ja,s(a.value?"Enabled":"Disabled"),1))]),e("div",Ta,[b[40]||(b[40]=e("div",null,[e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Violation Threshold"),e("p",{class:"text-xs text-content-muted dark:text-content-muted"},"Violations before penalty")],-1)),u.value?R((t(),r("input",{key:1,"onUpdate:modelValue":b[6]||(b[6]=h=>i.value=h),type:"number",min:"1",max:"10",class:"w-full sm:w-24 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512)),[[K,i.value,void 0,{number:!0}]]):(t(),r("div",Ea,s(i.value),1))]),e("div",Ba,[b[42]||(b[42]=e("div",null,[e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Base Penalty Duration"),e("p",{class:"text-xs text-content-muted dark:text-content-muted"},"First penalty duration")],-1)),u.value?(t(),r("div",Na,[R(e("input",{"onUpdate:modelValue":b[7]||(b[7]=h=>J.value=h),type:"number",min:"1",max:"48",class:"w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[K,J.value,void 0,{number:!0}]]),b[41]||(b[41]=e("span",{class:"text-content-muted text-sm"},"hours",-1))])):(t(),r("div",La,s(J.value)+" hours",1))]),e("div",Pa,[b[44]||(b[44]=e("div",null,[e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Penalty Multiplier"),e("p",{class:"text-xs text-content-muted dark:text-content-muted"},"Escalation factor")],-1)),u.value?(t(),r("div",Ia,[R(e("input",{"onUpdate:modelValue":b[8]||(b[8]=h=>N.value=h),type:"number",min:"1",max:"5",step:"0.5",class:"w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[K,N.value,void 0,{number:!0}]]),b[43]||(b[43]=e("span",{class:"text-content-muted text-sm"},"x",-1))])):(t(),r("div",Fa,s(N.value)+"x",1))]),e("div",Ra,[b[46]||(b[46]=e("div",null,[e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Max Penalty Duration"),e("p",{class:"text-xs text-content-muted dark:text-content-muted"},"Maximum cooldown cap")],-1)),u.value?(t(),r("div",Va,[R(e("input",{"onUpdate:modelValue":b[9]||(b[9]=h=>D.value=h),type:"number",min:"1",max:"168",class:"w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[K,D.value,void 0,{number:!0}]]),b[45]||(b[45]=e("span",{class:"text-content-muted text-sm"},"hours",-1))])):(t(),r("div",za,s(D.value)+" hours",1))])]),e("div",Da,[b[58]||(b[58]=ae('

Adaptive Rate Limiting

How the three systems work together: Each layer can be enabled/disabled independently and the others will still function.

  • Rate Limiting OFF: All limiting disabled — adverts pass through freely
  • Adaptive OFF: Token bucket uses fixed limits (no tier scaling), penalty box still works
  • Penalty Box OFF: Token bucket still applies, but no escalating cooldowns for repeat offenders

Decision flow when all enabled: Adaptive tier check → Penalty box check → Token bucket check → Violation recording (triggers penalty box)

Activity tiers:Quiet (bypass limiting) → Normal (lighter: 0.5x intervals) → Busy (base: 1.0x intervals) → Congested (stricter: 2.0x intervals)

Note: Adaptive mode scales refill/min-interval timing; bucket capacity stays at the configured base value.

',2)),e("div",Ha,[b[50]||(b[50]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Adaptive Mode",-1)),u.value?R((t(),r("select",{key:1,"onUpdate:modelValue":b[10]||(b[10]=h=>H.value=h),class:"w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},b[49]||(b[49]=[e("option",{value:!0},"Enabled",-1),e("option",{value:!1},"Disabled",-1)]),512)),[[pe,H.value]]):(t(),r("div",Ua,s(H.value?"Enabled":"Disabled"),1))]),e("div",Oa,[b[52]||(b[52]=e("div",null,[e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Tier Change Delay"),e("p",{class:"text-xs text-content-muted dark:text-content-muted"},"Prevents tier flapping")],-1)),u.value?(t(),r("div",qa,[R(e("input",{"onUpdate:modelValue":b[11]||(b[11]=h=>oe.value=h),type:"number",min:"0",max:"60",class:"w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary"},null,512),[[K,oe.value,void 0,{number:!0}]]),b[51]||(b[51]=e("span",{class:"text-content-muted text-sm"},"min",-1))])):(t(),r("div",Ka,s(oe.value)+" min",1))]),e("div",Wa,[b[56]||(b[56]=e("span",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm mb-2 block"},"Activity Tier Thresholds (adverts/min)",-1)),e("div",Ga,[e("div",Ja,[b[53]||(b[53]=e("div",{class:"text-xs text-green-600 dark:text-green-400 mb-1"},"Quiet Max",-1)),u.value?R((t(),r("input",{key:1,"onUpdate:modelValue":b[12]||(b[12]=h=>z.value=h),type:"number",min:"0",max:"1",step:"0.01",class:"w-full px-2 py-1 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded text-content-primary dark:text-content-primary text-sm text-center focus:outline-none focus:border-primary"},null,512)),[[K,z.value,void 0,{number:!0}]]):(t(),r("div",Ya,s(z.value),1))]),e("div",Qa,[b[54]||(b[54]=e("div",{class:"text-xs text-blue-600 dark:text-blue-400 mb-1"},"Normal Max",-1)),u.value?R((t(),r("input",{key:1,"onUpdate:modelValue":b[13]||(b[13]=h=>f.value=h),type:"number",min:"0",max:"5",step:"0.01",class:"w-full px-2 py-1 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded text-content-primary dark:text-content-primary text-sm text-center focus:outline-none focus:border-primary"},null,512)),[[K,f.value,void 0,{number:!0}]]):(t(),r("div",Xa,s(f.value),1))]),e("div",Za,[b[55]||(b[55]=e("div",{class:"text-xs text-yellow-600 dark:text-yellow-400 mb-1"},"Busy Max",-1)),u.value?R((t(),r("input",{key:1,"onUpdate:modelValue":b[14]||(b[14]=h=>$.value=h),type:"number",min:"0",max:"10",step:"0.01",class:"w-full px-2 py-1 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded text-content-primary dark:text-content-primary text-sm text-center focus:outline-none focus:border-primary"},null,512)),[[K,$.value,void 0,{number:!0}]]):(t(),r("div",el,s($.value),1))])]),b[57]||(b[57]=e("p",{class:"text-xs text-content-muted dark:text-content-muted mt-2"},"Above Busy Max = Congested tier (strictest limiting)",-1))])]),T.value?(t(),r("div",{key:2,class:"fixed inset-0 bg-black/50 flex items-start justify-center z-50 p-4 overflow-y-auto",onClick:b[18]||(b[18]=le(h=>T.value=!1,["self"]))},[e("div",{class:"bg-background dark:bg-background-dark rounded-lg shadow-xl max-w-3xl w-full my-8",onClick:b[17]||(b[17]=le(()=>{},["stop"]))},[e("div",tl,[e("div",rl,[b[60]||(b[60]=e("h2",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"How Advert Rate Limiting Works",-1)),e("button",{onClick:b[15]||(b[15]=h=>T.value=!1),class:"text-content-muted hover:text-content-primary dark:text-content-muted dark:hover:text-content-primary"},b[59]||(b[59]=[e("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),b[61]||(b[61]=ae('

Why you may see the same advert more than once

Mesh traffic can reach your repeater through different paths, so duplicate advert packets are expected.

  • First copy arrives and is forwarded
  • Second copy arrives through another repeater path
  • Later copies may be dropped once limits are hit

This is normal behavior and helps prevent repeated rebroadcasts from flooding the mesh.

Token Bucket Rate Limiting

Each sender has a token bucket. Every forwarded advert uses one token.

  • Bucket Capacity: How many adverts can pass in a burst.
  • Refill Rate: How quickly tokens come back over time.
  • Min Interval: Optional gap between adverts from the same sender (usually set to 0).
Example (capacity 2):
- Copy 1 forwarded (2 → 1 tokens)
- Copy 2 forwarded (1 → 0 tokens)
- Copy 3 dropped (no tokens left)

Penalty Box (Repeat Offenders)

If a sender keeps hitting the limit, it is temporarily blocked.

  • Violation Threshold: How many hits before penalty starts.
  • Base Penalty: First block duration.
  • Multiplier: Repeated penalties get longer.
  • Decay Time: Violations age out after stable behavior.

Adaptive Mesh Activity Tiers

Adaptive mode adjusts limits based on recent advert activity.

How Congestion is Measured:
  • What is counted: Advert packets only (not chat/data traffic)
  • Smoothing: 60-second EWMA to avoid reacting to short spikes
  • Score: Tier is based on adverts per minute
  • Hysteresis: Tier changes must hold for 5 minutes
QUIET
Activity < 0.05/min
No rate limiting
NORMAL
Activity 0.05-0.20/min
Light limiting (50%)
BUSY
Activity 0.20-0.50/min
Standard limiting (100%)
CONGESTED
Activity > 0.50/min
Aggressive (200%)
Quick examples:
- 0.02 adverts/min → QUIET (bypass)
- 0.35 adverts/min → BUSY (tighter limits)
- 0.68 adverts/min → CONGESTED (strict limits)

Recommended starting settings

  • Min Interval: 0 (disabled), let adaptive mode do the work
  • Bucket Capacity: 2-3 tokens for normal mesh propagation
  • Adaptive Mode: On
  • Penalty Box: On
',5)),e("div",ol,[e("button",{onClick:b[16]||(b[16]=h=>T.value=!1),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Got it! ")])])])])):C("",!0)]))}}),nl={class:"space-y-6"},al={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},ll={class:"flex items-center justify-between mb-4"},dl=["disabled"],il={key:0},ul={key:1},cl={key:0,class:"text-sm text-content-secondary dark:text-content-muted"},ml={key:1,class:"space-y-3"},pl={class:"flex items-center gap-2"},bl={key:0,class:"space-y-2"},xl=["title"],vl={key:1,class:"text-sm text-content-muted dark:text-content-muted/60 italic"},kl={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},gl={class:"flex items-start justify-between mb-6"},yl={key:0,class:"space-y-4"},fl={class:"grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-3"},hl={class:"mt-1 text-sm text-content-primary dark:text-content-primary"},wl={class:"mt-1 text-sm text-content-primary dark:text-content-primary font-mono"},_l={class:"mt-1 text-sm text-content-primary dark:text-content-primary"},$l={class:"mt-1 text-sm text-content-primary dark:text-content-primary"},Cl={class:"mt-1 text-sm text-content-primary dark:text-content-primary"},Ml={class:"mt-1 text-sm text-content-primary dark:text-content-primary"},Al={key:0,class:"mt-2 text-sm text-content-muted dark:text-content-muted/60 italic"},Sl={key:1,class:"mt-2 space-y-1.5"},jl={class:"min-w-0 flex-1"},Tl={class:"text-sm font-medium text-content-primary dark:text-content-primary"},El={class:"text-xs text-content-secondary dark:text-content-muted ml-2 font-mono"},Bl=["title"],Ll={class:"mt-2 flex flex-wrap gap-1.5"},Nl={key:0,class:"text-sm text-content-muted dark:text-content-muted/60 italic"},Pl={key:1,class:"space-y-5"},Fl={class:"flex items-center justify-between p-4 rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/10"},Il={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},Rl=["value"],zl={class:"grid grid-cols-1 sm:grid-cols-2 gap-4"},Vl={class:"flex items-start justify-between mb-3 gap-3"},Dl={class:"flex items-center gap-2 flex-shrink-0"},Hl={class:"relative"},Ul={key:0,class:"absolute right-0 top-full mt-1 z-20 w-64 rounded-lg shadow-lg border border-stroke-subtle dark:border-stroke/20 bg-white dark:bg-[var(--color-surface)] overflow-hidden"},Ol={class:"py-1"},Kl=["onClick"],ql={class:"min-w-0 flex-1"},Wl={class:"text-sm font-medium text-content-primary dark:text-content-primary group-hover:text-cyan-700 dark:group-hover:text-primary transition-colors"},Gl={class:"text-xs text-content-secondary dark:text-content-muted"},Jl=["href"],Yl={key:0,class:"flex flex-col items-center justify-center py-7 rounded-lg border-2 border-dashed border-stroke-subtle dark:border-stroke/20 text-content-secondary dark:text-content-muted"},Ql={key:1,class:"space-y-2"},Xl={key:0,class:"flex items-center gap-3 px-4 py-2.5"},Zl={class:"min-w-0 flex-1"},ed={class:"text-sm font-medium text-content-primary dark:text-content-primary"},td={class:"text-xs font-mono text-content-secondary dark:text-content-muted ml-2"},rd={key:0,class:"ml-2 text-xs text-red-500 dark:text-red-400"},od={class:"flex items-center gap-0.5 flex-shrink-0"},sd=["onClick"],nd=["onClick"],ad={key:1,class:"p-4 space-y-3 bg-background-mute/60 dark:bg-background/20"},ld={class:"grid grid-cols-1 sm:grid-cols-2 gap-3"},dd={class:"flex items-center gap-2 pt-1"},id=["disabled"],ud=["onClick"],cd={class:"flex flex-wrap gap-2"},md=["onClick"],pd={key:0,class:"p-3 rounded-lg bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-700/30 text-green-700 dark:text-green-400 text-sm"},bd={key:1,class:"p-3 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-700/30 text-red-700 dark:text-red-400 text-sm"},xd={class:"flex items-center gap-3 pt-2"},vd=["disabled"],kd={key:0},gd={key:1},yd=["disabled"],fd=re({__name:"LetsMeshSettings",setup(G){const L=be(),m=V(()=>L.stats?.config?.letsmesh||{}),g=["REQ","RESPONSE","TXT_MSG","ACK","ADVERT","GRP_TXT","GRP_DATA","ANON_REQ","PATH","TRACE","RAW_CUSTOM"],y=[{value:0,label:"Europe only (EU v1)"},{value:1,label:"US West only (US v1)"},{value:-1,label:"All built-in brokers (EU + US)"},{value:-2,label:"Custom brokers only"}],v=[{name:"MeshMapper",website:"https://meshmapper.net",brokers:[{name:"MeshMapper",host:"mqtt.meshmapper.cc",port:443,audience:"mqtt.meshmapper.cc"}]}],x=l(!1),u=l(!1),k=l(""),A=l(""),j=l(!1),T=l(""),c=l(0),F=l(300),n=l(""),o=l(""),d=l([]),P=l([]),_=l(null),a=l({_id:0,name:"",host:"",port:443,audience:""}),i=l(!1);function I(h){i.value=!1,_.value!==null&&z(),h.brokers.forEach(p=>{const B=N(p);P.value.push(B)})}let J=1;function N(h={}){return{_id:J++,name:h.name??"",host:h.host??"",port:h.port??443,audience:h.audience??""}}function D(){const h=N();P.value.push(h),a.value={...h},_.value=h._id}function H(h){P.value=P.value.filter(p=>p._id!==h),_.value===h&&(_.value=null)}function se(h){a.value={...h},_.value=h._id}function oe(){_.value=null}function z(){const h=a.value;if(!h.name.trim()||!h.host.trim()||!h.audience.trim())return;const p=P.value.findIndex(B=>B._id===h._id);p!==-1&&P.value.splice(p,1,{...h}),_.value=null}function f(){const h=a.value,p=P.value.find(B=>B._id===h._id);(!h.audience||h.audience===(p?.host??""))&&(h.audience=h.host)}const $=V(()=>{const h={};return P.value.forEach(p=>{p.name.trim()?p.host.trim()?p.audience.trim()?(p.port<1||p.port>65535)&&(h[p._id]="Port must be 1–65535"):h[p._id]="Audience required":h[p._id]="Host required":h[p._id]="Name required"}),h}),w=V(()=>Object.keys($.value).length>0),U=l(null),O=l(!1);async function ne(){O.value=!0;try{const h=await ke.get("/api/letsmesh_status");h.data?.success&&(U.value=h.data.data)}catch{}finally{O.value=!1}}function ue(){const h=m.value;j.value=h.enabled??!1,T.value=h.iata_code??"",c.value=h.broker_index??0,F.value=h.status_interval??300,n.value=h.owner??"",o.value=h.email??"",d.value=Array.isArray(h.disallowed_packet_types)?[...h.disallowed_packet_types]:[],P.value=Array.isArray(h.additional_brokers)?h.additional_brokers.map(p=>N(p)):[]}me(m,()=>{x.value||ue()},{immediate:!0});function de(){ue(),_.value=null,x.value=!0,k.value="",A.value=""}function xe(){_.value=null,x.value=!1,k.value="",A.value=""}function Z(h){const p=d.value.indexOf(h);p===-1?d.value.push(h):d.value.splice(p,1)}async function b(){if(_.value!==null&&z(),w.value){A.value="Please fix broker errors before saving.";return}u.value=!0,A.value="",k.value="";try{const p=(await ke.post("/api/update_letsmesh_config",{enabled:j.value,iata_code:T.value,broker_index:c.value,status_interval:F.value,owner:n.value,email:o.value,disallowed_packet_types:d.value,additional_brokers:P.value.map(({name:B,host:te,port:_e,audience:$e})=>({name:B,host:te,port:_e,audience:$e}))})).data;p?.success?(k.value=p.data?.message||"Settings saved",x.value=!1,await L.fetchStats(),await ne(),setTimeout(()=>{k.value=""},5e3)):A.value=p?.error||"Save failed"}catch(h){const p=h;A.value=p?.response?.data?.error||p?.message||"Request failed"}finally{u.value=!1}}return ve(ne),(h,p)=>(t(),r("div",nl,[e("div",al,[e("div",ll,[p[13]||(p[13]=e("div",null,[e("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-1"},"Observer Status"),e("p",{class:"text-sm text-content-secondary dark:text-content-muted"},"Live LetsMesh broker connection state")],-1)),e("button",{onClick:ne,disabled:O.value,class:"px-3 py-1.5 text-xs rounded-lg bg-cyan-500/10 dark:bg-primary/10 hover:bg-cyan-500/20 dark:hover:bg-primary/20 text-cyan-700 dark:text-primary border border-cyan-400/30 dark:border-primary/30 transition-colors disabled:opacity-50"},[O.value?(t(),r("span",il,"Refreshing…")):(t(),r("span",ul,"↻ Refresh"))],8,dl)]),U.value?(t(),r("div",ml,[e("div",pl,[p[14]||(p[14]=e("span",{class:"text-sm text-content-secondary dark:text-content-muted w-36"},"Handler",-1)),e("span",{class:q(["inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium",U.value.handler_active?"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400":"bg-gray-100 dark:bg-gray-800/50 text-gray-500 dark:text-gray-400"])},[e("span",{class:q(["w-1.5 h-1.5 rounded-full",U.value.handler_active?"bg-green-500":"bg-gray-400"])},null,2),E(" "+s(U.value.handler_active?"Active":"Inactive"),1)],2)]),U.value.brokers.length?(t(),r("div",bl,[(t(!0),r(W,null,ee(U.value.brokers,B=>(t(),r("div",{key:B.host,class:"flex items-center gap-2"},[e("span",{class:"text-sm text-content-secondary dark:text-content-muted w-36 truncate",title:B.name},s(B.name),9,xl),e("span",{class:q(["inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium",B.connected?"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400":B.reconnecting?"bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400":"bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400"])},[e("span",{class:q(["w-1.5 h-1.5 rounded-full",B.connected?"bg-green-500":B.reconnecting?"bg-amber-500":"bg-red-500"])},null,2),E(" "+s(B.connected?"Connected":B.reconnecting?"Reconnecting…":"Disconnected"),1)],2)]))),128))])):(t(),r("div",vl," No broker connections configured. "))])):(t(),r("div",cl," Status unavailable — service may not be running. "))]),e("div",kl,[e("div",gl,[p[15]||(p[15]=e("div",null,[e("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-1"},"Observer Configuration"),e("p",{class:"text-sm text-content-secondary dark:text-content-muted"},"Configure LetsMesh MQTT observer settings")],-1)),x.value?C("",!0):(t(),r("button",{key:0,onClick:de,class:"px-4 py-2 text-sm rounded-lg bg-cyan-500/10 dark:bg-primary/10 hover:bg-cyan-500/20 dark:hover:bg-primary/20 text-cyan-700 dark:text-primary border border-cyan-400/30 dark:border-primary/30 transition-colors"}," Edit "))]),x.value?(t(),r("div",Pl,[e("div",Fl,[p[24]||(p[24]=e("div",null,[e("label",{class:"text-sm font-medium text-content-primary dark:text-content-primary"},"Enable LetsMesh Observer"),e("p",{class:"text-xs text-content-secondary dark:text-content-muted mt-0.5"},"Publish mesh packets to the LetsMesh MQTT network")],-1)),e("button",{onClick:p[0]||(p[0]=B=>j.value=!j.value),class:q(["relative inline-flex h-6 w-11 items-center rounded-full transition-colors border-2",j.value?"bg-cyan-600 dark:bg-teal-500 border-cyan-600 dark:border-teal-500":"bg-gray-400 dark:bg-gray-600 border-gray-400 dark:border-gray-600"])},[e("span",{class:q(["inline-block h-4 w-4 transform rounded-full bg-white transition-transform shadow-lg",j.value?"translate-x-5":"translate-x-0.5"])},null,2)],2)]),e("div",Il,[e("div",null,[p[25]||(p[25]=e("label",{class:"block text-sm font-medium text-content-primary dark:text-content-primary mb-1.5"},[E(" IATA Code "),e("span",{class:"text-content-secondary dark:text-content-muted font-normal text-xs ml-1"},"(e.g. SFO, LHR)")],-1)),R(e("input",{"onUpdate:modelValue":p[1]||(p[1]=B=>T.value=B),type:"text",maxlength:"10",placeholder:"TEST",class:"w-full px-3 py-2 text-sm rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40 font-mono"},null,512),[[K,T.value]])]),e("div",null,[p[26]||(p[26]=e("label",{class:"block text-sm font-medium text-content-primary dark:text-content-primary mb-1.5"},"Broker Mode",-1)),R(e("select",{"onUpdate:modelValue":p[2]||(p[2]=B=>c.value=B),class:"w-full px-3 py-2 text-sm rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40"},[(t(),r(W,null,ee(y,B=>e("option",{key:B.value,value:B.value},s(B.label),9,Rl)),64))],512),[[pe,c.value,void 0,{number:!0}]])])]),e("div",zl,[e("div",null,[p[27]||(p[27]=e("label",{class:"block text-sm font-medium text-content-primary dark:text-content-primary mb-1.5"},"Owner / Callsign",-1)),R(e("input",{"onUpdate:modelValue":p[3]||(p[3]=B=>n.value=B),type:"text",placeholder:"Optional",class:"w-full px-3 py-2 text-sm rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40"},null,512),[[K,n.value]])]),e("div",null,[p[28]||(p[28]=e("label",{class:"block text-sm font-medium text-content-primary dark:text-content-primary mb-1.5"},"Email",-1)),R(e("input",{"onUpdate:modelValue":p[4]||(p[4]=B=>o.value=B),type:"email",placeholder:"Optional",class:"w-full px-3 py-2 text-sm rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40"},null,512),[[K,o.value]])])]),e("div",null,[p[29]||(p[29]=e("label",{class:"block text-sm font-medium text-content-primary dark:text-content-primary mb-1.5"},[E(" Status Heartbeat Interval "),e("span",{class:"text-content-secondary dark:text-content-muted font-normal text-xs ml-1"},"(seconds, min 60)")],-1)),R(e("input",{"onUpdate:modelValue":p[5]||(p[5]=B=>F.value=B),type:"number",min:"60",max:"3600",class:"w-32 px-3 py-2 text-sm rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40 font-mono"},null,512),[[K,F.value,void 0,{number:!0}]])]),e("div",null,[e("div",Vl,[p[36]||(p[36]=e("div",{class:"min-w-0"},[e("label",{class:"text-sm font-medium text-content-primary dark:text-content-primary"},"Custom Brokers"),e("p",{class:"text-xs text-content-secondary dark:text-content-muted mt-0.5"}," Additional MQTT/WebSocket brokers alongside or instead of built-in ones ")],-1)),e("div",Dl,[e("div",Hl,[e("button",{onClick:p[6]||(p[6]=B=>i.value=!i.value),class:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg bg-background-mute dark:bg-background/30 hover:bg-stroke-subtle dark:hover:bg-stroke/10 text-content-secondary dark:text-content-muted border border-stroke-subtle dark:border-stroke/20 transition-colors"},[p[31]||(p[31]=e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0l-4-4m4 4l-4 4"})],-1)),p[32]||(p[32]=E(" From Template ",-1)),(t(),r("svg",{class:q(["w-3 h-3 ml-0.5 transition-transform",i.value?"rotate-180":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},p[30]||(p[30]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"},null,-1)]),2))]),X(he,{name:"dropdown"},{default:ge(()=>[i.value?(t(),r("div",Ul,[p[34]||(p[34]=e("div",{class:"px-3 py-2 border-b border-stroke-subtle dark:border-stroke/10"},[e("p",{class:"text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Known Networks")],-1)),e("div",Ol,[(t(),r(W,null,ee(v,B=>e("div",{key:B.name,class:"flex items-center gap-2 px-3 py-2.5 hover:bg-background-mute dark:hover:bg-background/30 cursor-pointer group",onClick:te=>I(B)},[e("div",ql,[e("p",Wl,s(B.name),1),e("p",Gl,s(B.brokers.length)+" broker"+s(B.brokers.length!==1?"s":""),1)]),e("a",{href:B.website,target:"_blank",rel:"noopener noreferrer",title:"Visit website",class:"flex-shrink-0 p-1 rounded hover:bg-cyan-500/10 dark:hover:bg-primary/10 text-content-secondary dark:text-content-muted hover:text-cyan-700 dark:hover:text-primary transition-colors",onClick:p[7]||(p[7]=le(()=>{},["stop"]))},p[33]||(p[33]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})],-1)]),8,Jl)],8,Kl)),64))])])):C("",!0)]),_:1}),i.value?(t(),r("div",{key:0,class:"fixed inset-0 z-10",onClick:p[8]||(p[8]=B=>i.value=!1)})):C("",!0)]),e("button",{onClick:D,class:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg bg-cyan-500/10 dark:bg-primary/10 hover:bg-cyan-500/20 dark:hover:bg-primary/20 text-cyan-700 dark:text-primary border border-cyan-400/30 dark:border-primary/30 transition-colors"},p[35]||(p[35]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})],-1),E(" Add ",-1)]))])]),P.value.length?(t(),r("div",Ql,[(t(!0),r(W,null,ee(P.value,B=>(t(),r("div",{key:B._id,class:q(["rounded-lg border overflow-hidden transition-colors",$.value[B._id]?"border-red-300 dark:border-red-700/50":"border-stroke-subtle dark:border-stroke/10"])},[_.value!==B._id?(t(),r("div",Xl,[e("div",Zl,[e("span",ed,s(B.name||"(unnamed)"),1),e("span",td,s(B.host||"—")+":"+s(B.port),1),$.value[B._id]?(t(),r("span",rd,s($.value[B._id]),1)):C("",!0)]),e("div",od,[e("button",{onClick:te=>se(B),title:"Edit",class:"p-1.5 rounded hover:bg-cyan-500/10 dark:hover:bg-primary/10 text-content-secondary dark:text-content-muted hover:text-cyan-700 dark:hover:text-primary transition-colors"},p[38]||(p[38]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})],-1)]),8,sd),e("button",{onClick:te=>H(B._id),title:"Remove",class:"p-1.5 rounded hover:bg-red-500/10 dark:hover:bg-red-900/20 text-content-secondary dark:text-content-muted hover:text-red-600 dark:hover:text-red-400 transition-colors"},p[39]||(p[39]=[e("svg",{class:"w-3.5 h-3.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,nd)])])):(t(),r("div",ad,[e("div",ld,[e("div",null,[p[40]||(p[40]=e("label",{class:"block text-xs font-medium text-content-secondary dark:text-content-muted mb-1"},[E(" Name "),e("span",{class:"text-red-500"},"*")],-1)),R(e("input",{"onUpdate:modelValue":p[9]||(p[9]=te=>a.value.name=te),type:"text",placeholder:"My Private Broker",class:"w-full px-3 py-1.5 text-sm rounded-md bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40"},null,512),[[K,a.value.name]])]),e("div",null,[p[41]||(p[41]=e("label",{class:"block text-xs font-medium text-content-secondary dark:text-content-muted mb-1"},[E(" Port "),e("span",{class:"text-red-500"},"*")],-1)),R(e("input",{"onUpdate:modelValue":p[10]||(p[10]=te=>a.value.port=te),type:"number",min:"1",max:"65535",placeholder:"443",class:"w-full px-3 py-1.5 text-sm rounded-md bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40 font-mono"},null,512),[[K,a.value.port,void 0,{number:!0}]])]),e("div",null,[p[42]||(p[42]=e("label",{class:"block text-xs font-medium text-content-secondary dark:text-content-muted mb-1"},[E(" Host "),e("span",{class:"text-red-500"},"*")],-1)),R(e("input",{"onUpdate:modelValue":p[11]||(p[11]=te=>a.value.host=te),type:"text",placeholder:"mqtt.myserver.com",onInput:f,class:"w-full px-3 py-1.5 text-sm rounded-md bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40 font-mono"},null,544),[[K,a.value.host]])]),e("div",null,[p[43]||(p[43]=e("label",{class:"block text-xs font-medium text-content-secondary dark:text-content-muted mb-1"},[E(" Audience "),e("span",{class:"text-red-500"},"*"),e("span",{class:"font-normal text-content-muted dark:text-content-muted/60 ml-1"},"(JWT aud — usually same as host)")],-1)),R(e("input",{"onUpdate:modelValue":p[12]||(p[12]=te=>a.value.audience=te),type:"text",placeholder:"mqtt.myserver.com",class:"w-full px-3 py-1.5 text-sm rounded-md bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40 font-mono"},null,512),[[K,a.value.audience]])])]),e("div",dd,[e("button",{onClick:z,disabled:!a.value.name.trim()||!a.value.host.trim()||!a.value.audience.trim(),class:"px-3 py-1.5 text-xs font-medium rounded-md bg-cyan-600 dark:bg-teal-600 hover:bg-cyan-700 dark:hover:bg-teal-700 text-white transition-colors disabled:opacity-40 disabled:cursor-not-allowed"},"Done",8,id),e("button",{onClick:oe,class:"px-3 py-1.5 text-xs rounded-md border border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-stroke/10 text-content-secondary dark:text-content-muted transition-colors"},"Cancel"),e("button",{onClick:te=>H(B._id),class:"ml-auto px-3 py-1.5 text-xs rounded-md border border-red-300/60 dark:border-red-700/30 hover:bg-red-50 dark:hover:bg-red-900/20 text-red-600 dark:text-red-400 transition-colors"},"Remove",8,ud)])]))],2))),128))])):(t(),r("div",Yl,p[37]||(p[37]=[e("svg",{class:"w-7 h-7 mb-2 opacity-40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M5 12h14M5 12l4-4m-4 4l4 4"})],-1),e("p",{class:"text-sm"},"No custom brokers",-1),e("p",{class:"text-xs mt-0.5 opacity-70"},"Built-in brokers will be used based on the mode above",-1)]))),p[44]||(p[44]=e("p",{class:"mt-2 text-xs text-content-secondary dark:text-content-muted"},[E(" Set "),e("span",{class:"font-medium"},"Broker Mode"),E(" to "),e("em",null,"Custom brokers only"),E(" to use exclusively these servers, or leave it on any other mode to use them alongside the built-in ones. ")],-1))]),e("div",null,[p[45]||(p[45]=e("label",{class:"block text-sm font-medium text-content-primary dark:text-content-primary mb-2"},[E(" Block Packet Types "),e("span",{class:"text-content-secondary dark:text-content-muted font-normal text-xs ml-1"},"(prevent publishing to LetsMesh)")],-1)),e("div",cd,[(t(),r(W,null,ee(g,B=>e("button",{key:B,onClick:te=>Z(B),class:q(["px-2.5 py-1 rounded text-xs font-mono font-medium border transition-colors",d.value.includes(B)?"bg-red-100 dark:bg-red-900/30 border-red-300 dark:border-red-700/50 text-red-700 dark:text-red-400":"bg-background-mute dark:bg-background/30 border-stroke-subtle dark:border-stroke/20 text-content-secondary dark:text-content-muted hover:border-cyan-400/50 dark:hover:border-primary/40"])},s(B),11,md)),64))]),p[46]||(p[46]=e("p",{class:"mt-1.5 text-xs text-content-secondary dark:text-content-muted"},[e("span",{class:"text-red-600 dark:text-red-400 font-medium"},"Red = blocked."),E(" Leave all unselected to publish all packet types. ")],-1))]),p[47]||(p[47]=e("div",{class:"flex items-start gap-2 p-3 rounded-lg bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-700/30 text-amber-700 dark:text-amber-400 text-xs"},[e("svg",{class:"w-4 h-4 mt-0.5 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})]),E(" A service restart is required for LetsMesh changes to take effect. ")],-1)),k.value?(t(),r("div",pd,s(k.value),1)):C("",!0),A.value?(t(),r("div",bd,s(A.value),1)):C("",!0),e("div",xd,[e("button",{onClick:b,disabled:u.value||w.value,class:"px-5 py-2 text-sm font-medium rounded-lg bg-cyan-600 dark:bg-teal-600 hover:bg-cyan-700 dark:hover:bg-teal-700 text-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed"},[u.value?(t(),r("span",kd,"Saving…")):(t(),r("span",gd,"Save Settings"))],8,vd),e("button",{onClick:xe,disabled:u.value,class:"px-4 py-2 text-sm rounded-lg bg-background-mute dark:bg-background/30 hover:bg-stroke-subtle dark:hover:bg-stroke/10 text-content-secondary dark:text-content-muted border border-stroke-subtle dark:border-stroke/20 transition-colors disabled:opacity-50"}," Cancel ",8,yd)])])):(t(),r("div",yl,[e("div",fl,[e("div",null,[p[16]||(p[16]=e("span",{class:"text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Enabled",-1)),e("p",hl,[e("span",{class:q(["inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium",m.value.enabled?"bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400":"bg-gray-100 dark:bg-gray-800/50 text-gray-500 dark:text-gray-400"])},s(m.value.enabled?"Yes":"No"),3)])]),e("div",null,[p[17]||(p[17]=e("span",{class:"text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide"},"IATA Code",-1)),e("p",wl,s(m.value.iata_code||"—"),1)]),e("div",null,[p[18]||(p[18]=e("span",{class:"text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Broker Mode",-1)),e("p",_l,s(y.find(B=>B.value===m.value.broker_index)?.label??`Index ${m.value.broker_index??0}`),1)]),e("div",null,[p[19]||(p[19]=e("span",{class:"text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Status Interval",-1)),e("p",$l,s(m.value.status_interval??300)+"s",1)]),e("div",null,[p[20]||(p[20]=e("span",{class:"text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Owner",-1)),e("p",Cl,s(m.value.owner||"—"),1)]),e("div",null,[p[21]||(p[21]=e("span",{class:"text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Email",-1)),e("p",Ml,s(m.value.email||"—"),1)])]),e("div",null,[p[22]||(p[22]=e("span",{class:"text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Custom Brokers",-1)),m.value.additional_brokers?.length?(t(),r("div",Sl,[(t(!0),r(W,null,ee(m.value.additional_brokers,B=>(t(),r("div",{key:B.host,class:"flex items-center gap-3 px-3 py-2 rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/10"},[e("div",jl,[e("span",Tl,s(B.name),1),e("span",El,s(B.host)+":"+s(B.port),1)]),e("span",{class:"text-xs text-content-secondary dark:text-content-muted font-mono truncate max-w-[140px]",title:B.audience},s(B.audience),9,Bl)]))),128))])):(t(),r("div",Al,"None configured"))]),e("div",null,[p[23]||(p[23]=e("span",{class:"text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Blocked Packet Types",-1)),e("div",Ll,[m.value.disallowed_packet_types?.length?C("",!0):(t(),r("span",Nl,"All types allowed")),(t(!0),r(W,null,ee(m.value.disallowed_packet_types,B=>(t(),r("span",{key:B,class:"px-2 py-0.5 rounded text-xs font-mono bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400"},s(B),1))),128))])])]))])]))}}),hd=we(fd,[["__scopeId","data-v-ae27fe35"]]),wd={class:"space-y-6"},_d={key:0,class:"rounded-lg border-2 border-red-500/50 dark:border-red-400/40 bg-red-100 dark:bg-red-500/10 p-4"},$d={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},Cd=["disabled"],Md={key:0,class:"flex items-center gap-2"},Ad={key:1,class:"flex items-center gap-2"},Sd={key:0,class:"text-xs text-green-600 dark:text-green-400 mt-2"},jd={key:1,class:"text-xs text-red-500 dark:text-red-400 mt-2"},Td={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},Ed={key:0},Bd={key:1,class:"rounded-lg border-2 border-red-500/50 dark:border-red-400/40 bg-red-50 dark:bg-red-500/10 p-4"},Ld={class:"flex items-start gap-3"},Nd={class:"flex-1"},Pd={class:"text-xs text-red-600 dark:text-red-400/80 mt-1"},Fd={class:"flex gap-2 mt-3"},Id=["disabled"],Rd=["disabled"],zd={key:2,class:"text-xs text-green-600 dark:text-green-400 mt-2"},Vd={key:3,class:"text-xs text-red-500 dark:text-red-400 mt-2"},Dd={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},Hd={class:"space-y-3"},Ud={class:"flex items-center gap-3 cursor-pointer px-4 py-3 bg-background-mute dark:bg-background/30 rounded-lg border-2 border-dashed border-stroke-subtle dark:border-stroke/20 hover:border-cyan-500/50 dark:hover:border-primary/50 transition-colors"},Od={class:"text-sm text-content-secondary dark:text-content-muted"},Kd={key:0,class:"bg-background-mute dark:bg-background/30 rounded-lg p-4 border border-stroke-subtle dark:border-stroke/10"},qd={key:0,class:"text-xs text-content-secondary dark:text-content-muted space-y-1 mb-3"},Wd={class:"font-mono"},Gd={class:"font-mono"},Jd={key:0,class:"text-amber-600 dark:text-amber-400 font-medium"},Yd={key:1,class:"text-content-muted"},Qd={class:"text-xs text-content-secondary dark:text-content-muted"},Xd={class:"font-mono"},Zd={key:1},ei={key:2,class:"rounded-lg border-2 border-amber-500/50 dark:border-amber-400/40 bg-amber-50 dark:bg-amber-500/10 p-4"},ti={class:"flex items-start gap-3"},ri={class:"flex-1"},oi={class:"text-xs text-amber-700 dark:text-amber-300/80 mt-1"},si={class:"flex gap-2 mt-3"},ni=["disabled"],ai=["disabled"],li={key:3,class:"text-xs text-green-600 dark:text-green-400 mt-2"},di={key:4,class:"text-xs text-red-500 dark:text-red-400 mt-2"},ii={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},ui={key:0},ci={key:1,class:"rounded-lg border-2 border-red-500/50 dark:border-red-400/40 bg-red-50 dark:bg-red-500/10 p-4"},mi={class:"flex items-start gap-3"},pi={class:"flex-1"},bi={class:"text-xs text-red-600 dark:text-red-400/80 mt-1"},xi={class:"flex gap-2 mt-3"},vi=["disabled"],ki=["disabled"],gi={key:2,class:"bg-background-mute dark:bg-background/30 rounded-lg p-4 border border-stroke-subtle dark:border-stroke/10 space-y-2"},yi={class:"flex items-center justify-between"},fi={class:"text-xs text-content-secondary dark:text-content-muted space-y-1"},hi={class:"font-mono"},wi={key:0},_i={class:"font-mono"},$i={key:1},Ci={class:"font-mono text-[10px] break-all"},Mi={key:3,class:"text-xs text-red-500 dark:text-red-400 mt-2"},Ai=re({__name:"BackupRestore",setup(G){const L=V(()=>window.location.protocol==="http:"),m=l(!1),g=l(""),y=l("");async function v(){m.value=!0,g.value="",y.value="";try{const z=await Q.exportConfig(!1);if(!z.success||!z.data){y.value=z.error||"Export failed";return}const f=new Blob([JSON.stringify(z.data,null,2)],{type:"application/json"}),$=URL.createObjectURL(f),w=document.createElement("a");w.href=$;const U=(z.data.meta?.exported_at||new Date().toISOString()).replace(/[:.]/g,"-");w.download=`pymc-repeater-settings-${U}.json`,document.body.appendChild(w),w.click(),document.body.removeChild(w),URL.revokeObjectURL($),g.value="Settings exported successfully (secrets redacted)."}catch(z){y.value=z instanceof Error?z.message:"Export failed"}finally{m.value=!1}}const x=l(!1),u=l(!1),k=l(""),A=l("");async function j(){u.value=!0,k.value="",A.value="";try{const z=await Q.exportConfig(!0);if(!z.success||!z.data){A.value=z.error||"Export failed";return}const f=new Blob([JSON.stringify(z.data,null,2)],{type:"application/json"}),$=URL.createObjectURL(f),w=document.createElement("a");w.href=$;const U=(z.data.meta?.exported_at||new Date().toISOString()).replace(/[:.]/g,"-");w.download=`pymc-repeater-full-backup-${U}.json`,document.body.appendChild(w),w.click(),document.body.removeChild(w),URL.revokeObjectURL($),k.value="Full backup exported (includes all secrets).",x.value=!1}catch(z){A.value=z instanceof Error?z.message:"Export failed"}finally{u.value=!1}}const T=l(null),c=l(null),F=l(!1),n=l(!1),o=l(""),d=l(""),P=l(null),_=V(()=>c.value?.config?Object.keys(c.value.config).join(", "):""),a=V(()=>{const z=c.value?.meta?.includes_secrets;return z===!0||z==="true"});function i(z){const $=z.target.files?.[0];if(!$)return;T.value=$,c.value=null,F.value=!1,o.value="",d.value="";const w=new FileReader;w.onload=U=>{try{const O=JSON.parse(U.target?.result);O.config&&typeof O.config=="object"?c.value={meta:O.meta,config:O.config}:typeof O=="object"&&!Array.isArray(O)?c.value={config:O}:d.value="Invalid file format — expected a JSON config object."}catch{d.value="Invalid JSON file."}},w.readAsText($)}function I(){F.value=!1,c.value=null,T.value=null,P.value&&(P.value.value="")}async function J(){if(c.value?.config){n.value=!0,o.value="",d.value="";try{const z=await Q.importConfig(c.value.config);if(z.success){const f=z.data;let $=z.message||f?.message||"Configuration imported.";f?.restart_required&&($+=" A service restart is required for radio changes to take effect."),o.value=$,F.value=!1,c.value=null,T.value=null,P.value&&(P.value.value="")}else d.value=z.error||"Import failed"}catch(z){d.value=z instanceof Error?z.message:"Import failed"}finally{n.value=!1}}}const N=l(!1),D=l(!1),H=l(null),se=l("");async function oe(){D.value=!0,se.value="";try{const z=await Q.exportIdentityKey();if(!z.success||!z.data){se.value=z.error||"Export failed";return}H.value=z.data;const f=new Blob([z.data.identity_key_hex],{type:"text/plain"}),$=URL.createObjectURL(f),w=document.createElement("a");w.href=$,w.download=`pymc-identity-${z.data.node_address||"key"}.hex`,document.body.appendChild(w),w.click(),document.body.removeChild(w),URL.revokeObjectURL($)}catch(z){se.value=z instanceof Error?z.message:"Export failed"}finally{D.value=!1}}return(z,f)=>(t(),r("div",wd,[L.value?(t(),r("div",_d,f[6]||(f[6]=[ae('

Unencrypted Connection

This page is served over HTTP, not HTTPS. Exported data (including identity keys) will be transmitted in plain text. Only use these features on a trusted local network.

',1)]))):C("",!0),e("div",$d,[f[9]||(f[9]=e("div",{class:"flex items-start justify-between mb-4"},[e("div",null,[e("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-1"},"Export Settings"),e("p",{class:"text-sm text-content-secondary dark:text-content-muted"},[E(" Download the current configuration as a JSON file. Passwords, JWT secrets, and identity keys are "),e("strong",null,"redacted"),E(". Safe to share or use as a template for other devices. ")])])],-1)),e("button",{onClick:v,disabled:m.value,class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed text-sm"},[m.value?(t(),r("span",Md,f[7]||(f[7]=[e("span",{class:"animate-spin w-4 h-4 border-2 border-current border-t-transparent rounded-full inline-block"},null,-1),E(" Exporting… ",-1)]))):(t(),r("span",Ad,f[8]||(f[8]=[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1),E(" Export Settings ",-1)])))],8,Cd),g.value?(t(),r("p",Sd,s(g.value),1)):C("",!0),y.value?(t(),r("p",jd,s(y.value),1)):C("",!0)]),e("div",Td,[f[15]||(f[15]=ae('

Full Backup

Download a complete backup including all passwords, JWT secrets, and identity keys. Required for restoring to a new device or recovering from a failed SD card.

Contains sensitive data. The backup file will include plain-text passwords and private keys. Store it securely and never share it.

',2)),x.value?C("",!0):(t(),r("div",Ed,[e("button",{onClick:f[0]||(f[0]=$=>x.value=!0),class:"px-4 py-2 bg-red-500/20 dark:bg-red-400/20 hover:bg-red-500/30 dark:hover:bg-red-400/30 text-red-900 dark:text-red-200 rounded-lg border border-red-500/50 dark:border-red-400/40 transition-colors text-sm"},f[10]||(f[10]=[e("span",{class:"flex items-center gap-2"},[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})]),E(" Full Backup ")],-1)]))])),x.value?(t(),r("div",Bd,[e("div",Ld,[f[14]||(f[14]=e("svg",{class:"w-5 h-5 text-red-600 dark:text-red-400 shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),e("div",Nd,[f[13]||(f[13]=e("h4",{class:"text-sm font-semibold text-red-700 dark:text-red-400"},"Confirm Full Backup",-1)),e("p",Pd,[f[11]||(f[11]=E(" This will export ",-1)),f[12]||(f[12]=e("strong",null,"all secrets in plain text",-1)),E(" including admin/guest passwords, JWT secret, and your repeater's private identity key"+s(L.value?" over an unencrypted HTTP connection":"")+". ",1)]),e("div",Fd,[e("button",{onClick:j,disabled:u.value,class:"px-4 py-2 bg-red-600 hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600 text-white rounded-lg transition-colors text-sm disabled:opacity-50"},s(u.value?"Exporting…":"Yes, Export Full Backup"),9,Id),e("button",{onClick:f[1]||(f[1]=$=>x.value=!1),disabled:u.value,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors text-sm"}," Cancel ",8,Rd)])])])])):C("",!0),k.value?(t(),r("p",zd,s(k.value),1)):C("",!0),A.value?(t(),r("p",Vd,s(A.value),1)):C("",!0)]),e("div",Dd,[f[29]||(f[29]=e("div",{class:"flex items-start justify-between mb-4"},[e("div",null,[e("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-1"},"Import Configuration"),e("p",{class:"text-sm text-content-secondary dark:text-content-muted"},[E(" Restore configuration from a previously exported JSON file. Importing a "),e("strong",null,"full backup"),E(" will also restore passwords and identity keys. Importing a "),e("strong",null,"settings export"),E(" will only update non-sensitive settings. ")])])],-1)),e("div",Hd,[e("label",Ud,[f[16]||(f[16]=e("svg",{class:"w-5 h-5 text-content-secondary dark:text-content-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})],-1)),e("span",Od,s(T.value?T.value.name:"Choose a config JSON file…"),1),e("input",{ref_key:"fileInputRef",ref:P,type:"file",accept:".json,application/json",class:"hidden",onChange:i},null,544)]),c.value?(t(),r("div",Kd,[f[20]||(f[20]=e("h4",{class:"text-sm font-medium text-content-primary dark:text-content-primary mb-2"},"Import Preview",-1)),c.value.meta?(t(),r("div",qd,[e("p",null,[f[17]||(f[17]=E("Exported: ",-1)),e("span",Wd,s(c.value.meta.exported_at),1)]),e("p",null,[f[18]||(f[18]=E("Version: ",-1)),e("span",Gd,s(c.value.meta.version),1)]),c.value.meta.includes_secrets==="true"||c.value.meta.includes_secrets===!0?(t(),r("p",Jd," ⚠ Full backup — will restore passwords and identity keys ")):(t(),r("p",Yd," Settings only — existing secrets will not be changed "))])):C("",!0),e("p",Qd,[f[19]||(f[19]=E(" Sections: ",-1)),e("span",Xd,s(_.value),1)])])):C("",!0),c.value&&!F.value?(t(),r("div",Zd,[e("button",{onClick:f[2]||(f[2]=$=>F.value=!0),class:"px-4 py-2 bg-amber-500/20 dark:bg-amber-400/20 hover:bg-amber-500/30 dark:hover:bg-amber-400/30 text-amber-900 dark:text-amber-200 rounded-lg border border-amber-500/50 dark:border-amber-400/40 transition-colors text-sm"}," Review & Import ")])):C("",!0),F.value?(t(),r("div",ei,[e("div",ti,[f[28]||(f[28]=e("svg",{class:"w-5 h-5 text-amber-600 dark:text-amber-400 shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),e("div",ri,[f[27]||(f[27]=e("h4",{class:"text-sm font-semibold text-amber-800 dark:text-amber-300"},"Confirm Import",-1)),e("p",oi,[f[24]||(f[24]=E(" This will overwrite current settings for: ",-1)),e("strong",null,s(_.value),1),f[25]||(f[25]=E(". ",-1)),a.value?(t(),r(W,{key:0},[f[21]||(f[21]=E(" This is a full backup — ",-1)),f[22]||(f[22]=e("strong",null,"passwords, JWT secrets, and identity keys will also be overwritten",-1)),f[23]||(f[23]=E(". ",-1))],64)):(t(),r(W,{key:1},[E(" Passwords and identity keys will not be changed. ")],64)),f[26]||(f[26]=E(" Some changes (radio settings) require a service restart. ",-1))]),e("div",si,[e("button",{onClick:J,disabled:n.value,class:"px-4 py-2 bg-amber-600 hover:bg-amber-700 dark:bg-amber-500 dark:hover:bg-amber-600 text-white rounded-lg transition-colors text-sm disabled:opacity-50"},s(n.value?"Importing…":"Yes, Import"),9,ni),e("button",{onClick:I,disabled:n.value,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors text-sm"}," Cancel ",8,ai)])])])])):C("",!0),o.value?(t(),r("p",li,s(o.value),1)):C("",!0),d.value?(t(),r("p",di,s(d.value),1)):C("",!0)])]),e("div",ii,[f[38]||(f[38]=ae('

Export Identity Key

Download the repeater's private identity key for backup. This key determines the node's address and cryptographic identity on the mesh.

Sensitive data. The identity key is the repeater's private key. Anyone with this key can impersonate your node. Store the exported file securely and never share it.

',2)),N.value?C("",!0):(t(),r("div",ui,[e("button",{onClick:f[3]||(f[3]=$=>N.value=!0),class:"px-4 py-2 bg-red-500/20 dark:bg-red-400/20 hover:bg-red-500/30 dark:hover:bg-red-400/30 text-red-900 dark:text-red-200 rounded-lg border border-red-500/50 dark:border-red-400/40 transition-colors text-sm"},f[30]||(f[30]=[e("span",{class:"flex items-center gap-2"},[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})]),E(" Export Identity Key ")],-1)]))])),N.value&&!H.value?(t(),r("div",ci,[e("div",mi,[f[32]||(f[32]=e("svg",{class:"w-5 h-5 text-red-600 dark:text-red-400 shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),e("div",pi,[f[31]||(f[31]=e("h4",{class:"text-sm font-semibold text-red-700 dark:text-red-400"},"Are you sure?",-1)),e("p",bi," This will transmit your private key "+s(L.value?"over an unencrypted HTTP connection. ":"")+" and download it as a file. ",1),e("div",xi,[e("button",{onClick:oe,disabled:D.value,class:"px-4 py-2 bg-red-600 hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600 text-white rounded-lg transition-colors text-sm disabled:opacity-50"},s(D.value?"Exporting…":"Yes, Export Key"),9,vi),e("button",{onClick:f[4]||(f[4]=$=>N.value=!1),disabled:D.value,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors text-sm"}," Cancel ",8,ki)])])])])):C("",!0),H.value?(t(),r("div",gi,[e("div",yi,[f[33]||(f[33]=e("h4",{class:"text-sm font-medium text-content-primary dark:text-content-primary"},"Key Exported",-1)),e("button",{onClick:f[5]||(f[5]=$=>{H.value=null,N.value=!1}),class:"text-xs text-content-muted hover:text-content-secondary transition-colors"}," Dismiss ")]),e("div",fi,[e("p",null,[f[34]||(f[34]=E("Key length: ",-1)),e("span",hi,s(H.value.key_length_bytes)+" bytes",1)]),H.value.node_address?(t(),r("p",wi,[f[35]||(f[35]=E("Node address: ",-1)),e("span",_i,s(H.value.node_address),1)])):C("",!0),H.value.public_key_hex?(t(),r("p",$i,[f[36]||(f[36]=E("Public key: ",-1)),e("span",Ci,s(H.value.public_key_hex),1)])):C("",!0)]),f[37]||(f[37]=e("p",{class:"text-xs text-green-600 dark:text-green-400"},"File downloaded successfully.",-1))])):C("",!0),se.value?(t(),r("p",Mi,s(se.value),1)):C("",!0)])]))}}),Si={class:"space-y-6"},ji={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},Ti={class:"flex items-start justify-between mb-4"},Ei=["disabled"],Bi={key:0,class:"flex items-center gap-1.5"},Li={key:1},Ni={key:0,class:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-6"},Pi={class:"bg-background-mute dark:bg-background/30 rounded-lg p-3 border border-stroke-subtle dark:border-stroke/10"},Fi={class:"text-lg font-semibold text-content-primary dark:text-content-primary font-mono"},Ii={class:"bg-background-mute dark:bg-background/30 rounded-lg p-3 border border-stroke-subtle dark:border-stroke/10"},Ri={class:"text-lg font-semibold text-content-primary dark:text-content-primary font-mono"},zi={class:"bg-background-mute dark:bg-background/30 rounded-lg p-3 border border-stroke-subtle dark:border-stroke/10"},Vi={class:"text-lg font-semibold text-content-primary dark:text-content-primary font-mono"},Di={class:"bg-background-mute dark:bg-background/30 rounded-lg p-3 border border-stroke-subtle dark:border-stroke/10"},Hi={class:"text-lg font-semibold text-content-primary dark:text-content-primary font-mono"},Ui={key:1,class:"flex items-center justify-center py-12"},Oi={key:2,class:"rounded-lg border border-red-500/30 dark:border-red-400/30 bg-red-50 dark:bg-red-500/10 p-3 mb-4"},Ki={class:"text-xs text-red-700 dark:text-red-400"},qi={key:3},Wi={class:"overflow-x-auto"},Gi={class:"w-full text-sm"},Ji={class:"py-2.5 pr-4"},Yi={class:"font-mono text-content-primary dark:text-content-primary"},Qi={class:"py-2.5 pr-4 text-right"},Xi={class:"font-mono text-content-secondary dark:text-content-muted"},Zi={class:"py-2.5 pr-4 text-right hidden sm:table-cell"},eu={key:0,class:"text-xs text-content-muted"},tu={class:"text-content-muted/60 ml-1"},ru={key:1,class:"text-xs text-content-muted/50"},ou={key:2,class:"text-xs text-content-muted/50"},su={class:"py-2.5 text-right"},nu=["onClick","disabled"],au={key:0,class:"flex items-center gap-1"},lu={key:1},du={key:1,class:"text-xs text-content-muted/50"},iu={key:0,class:"glass-card rounded-lg border-2 border-red-500/50 dark:border-red-400/40 bg-red-50 dark:bg-red-500/10 p-6"},uu={class:"flex items-start gap-3"},cu={class:"flex-1"},mu={class:"text-sm font-semibold text-red-700 dark:text-red-400"},pu={class:"text-xs text-red-600 dark:text-red-400/80 mt-1"},bu={class:"flex gap-2 mt-3"},xu=["disabled"],vu=["disabled"],ku={class:"glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6"},gu={class:"flex flex-wrap gap-3"},yu=["disabled"],fu=["disabled"],hu={class:"flex items-center gap-2"},wu={key:0,class:"text-xs text-green-600 dark:text-green-400 mt-3"},_u={key:1,class:"text-xs text-green-600 dark:text-green-400 mt-3"},$u=re({__name:"DatabaseManagement",setup(G){const L=new Set(["packets","adverts","noise_floor","crc_errors","room_messages","room_client_sync","companion_contacts","companion_channels","companion_messages","companion_prefs"]),m=l(!1),g=l(""),y=l(null),v=l({}),x=l(null),u=l(""),k=l(!1),A=l(""),j=V(()=>y.value?y.value.tables.reduce((a,i)=>a+i.row_count,0):0);function T(a){return L.has(a)}function c(a){if(a===0)return"0 B";const i=["B","KB","MB","GB"],I=Math.min(Math.floor(Math.log(a)/Math.log(1024)),i.length-1),J=a/Math.pow(1024,I);return`${J<10?J.toFixed(1):Math.round(J)} ${i[I]}`}function F(a){return a?new Date(a*1e3).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}):"—"}function n(a,i){return!a||!i?0:Math.max(1,Math.round((i-a)/86400))}async function o(){m.value=!0,g.value="";try{const a=await Q.getDbStats();a.success&&a.data?y.value=a.data:g.value=a.error||"Failed to load database stats"}catch(a){g.value=a instanceof Error?a.message:"Failed to load database stats"}finally{m.value=!1}}function d(a,i){u.value="",x.value={table:a,rowCount:i,executing:!1}}async function P(){if(!x.value)return;const{table:a}=x.value;x.value.executing=!0,u.value="";try{const i=a==="all"?"all":[a];a!=="all"&&(v.value[a]=!0);const I=await Q.purgeTable(i);if(I.success){const J=I.data||{},N=Object.values(J).reduce((D,H)=>D+(H.deleted||0),0);u.value=`Deleted ${N.toLocaleString()} rows${a==="all"?" from all tables":` from ${a}`}.`,x.value=null,await o()}else g.value=I.error||"Purge failed",x.value=null}catch(i){g.value=i instanceof Error?i.message:"Purge failed",x.value=null}finally{a!=="all"&&(v.value[a]=!1)}}async function _(){k.value=!0,A.value="",g.value="";try{const a=await Q.vacuumDb();if(a.success&&a.data){const i=a.data.freed_bytes;A.value=i>0?`Compacted database — freed ${c(i)} (${c(a.data.size_before)} → ${c(a.data.size_after)}).`:`Database already compact (${c(a.data.size_after)}).`,await o()}else g.value=a.error||"Vacuum failed"}catch(a){g.value=a instanceof Error?a.message:"Vacuum failed"}finally{k.value=!1}}return ve(o),(a,i)=>(t(),r("div",Si,[e("div",ji,[e("div",Ti,[i[3]||(i[3]=e("div",null,[e("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-1"},"Database Overview"),e("p",{class:"text-sm text-content-secondary dark:text-content-muted"}," Storage usage and table statistics for the repeater database. ")],-1)),e("button",{onClick:o,disabled:m.value,class:"px-3 py-1.5 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors text-sm disabled:opacity-50"},[m.value?(t(),r("span",Bi,i[2]||(i[2]=[e("span",{class:"animate-spin w-3.5 h-3.5 border-2 border-current border-t-transparent rounded-full inline-block"},null,-1),E(" Loading… ",-1)]))):(t(),r("span",Li,"Refresh"))],8,Ei)]),y.value?(t(),r("div",Ni,[e("div",Pi,[i[4]||(i[4]=e("p",{class:"text-xs text-content-muted mb-1"},"Database Size",-1)),e("p",Fi,s(c(y.value.database_size_bytes)),1)]),e("div",Ii,[i[5]||(i[5]=e("p",{class:"text-xs text-content-muted mb-1"},"RRD Metrics",-1)),e("p",Ri,s(c(y.value.rrd_size_bytes)),1)]),e("div",zi,[i[6]||(i[6]=e("p",{class:"text-xs text-content-muted mb-1"},"Total Size",-1)),e("p",Vi,s(c(y.value.database_size_bytes+y.value.rrd_size_bytes)),1)]),e("div",Di,[i[7]||(i[7]=e("p",{class:"text-xs text-content-muted mb-1"},"Total Rows",-1)),e("p",Hi,s(j.value.toLocaleString()),1)])])):C("",!0),m.value&&!y.value?(t(),r("div",Ui,i[8]||(i[8]=[e("div",{class:"text-center"},[e("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4"}),e("div",{class:"text-content-secondary dark:text-content-muted"},"Loading database info…")],-1)]))):C("",!0),g.value?(t(),r("div",Oi,[e("p",Ki,s(g.value),1)])):C("",!0),y.value&&y.value.tables.length>0?(t(),r("div",qi,[e("div",Wi,[e("table",Gi,[i[10]||(i[10]=e("thead",null,[e("tr",{class:"border-b border-stroke-subtle dark:border-stroke/10"},[e("th",{class:"text-left py-2 pr-4 text-xs font-medium text-content-muted uppercase tracking-wider"},"Table"),e("th",{class:"text-right py-2 pr-4 text-xs font-medium text-content-muted uppercase tracking-wider"},"Rows"),e("th",{class:"text-right py-2 pr-4 text-xs font-medium text-content-muted uppercase tracking-wider hidden sm:table-cell"},"Date Range"),e("th",{class:"text-right py-2 text-xs font-medium text-content-muted uppercase tracking-wider"},"Actions")])],-1)),e("tbody",null,[(t(!0),r(W,null,ee(y.value.tables,I=>(t(),r("tr",{key:I.name,class:"border-b border-stroke-subtle/50 dark:border-stroke/5"},[e("td",Ji,[e("span",Yi,s(I.name),1)]),e("td",Qi,[e("span",Xi,s(I.row_count.toLocaleString()),1)]),e("td",Zi,[I.has_timestamp&&I.row_count>0?(t(),r("span",eu,[E(s(F(I.oldest_timestamp))+" — "+s(F(I.newest_timestamp))+" ",1),e("span",tu,"("+s(n(I.oldest_timestamp,I.newest_timestamp))+"d)",1)])):I.row_count===0?(t(),r("span",ru,"—")):(t(),r("span",ou,"n/a"))]),e("td",su,[T(I.name)&&I.row_count>0?(t(),r("button",{key:0,onClick:J=>d(I.name,I.row_count),disabled:v.value[I.name],class:"px-2.5 py-1 bg-red-500/10 dark:bg-red-400/10 hover:bg-red-500/20 dark:hover:bg-red-400/20 text-red-700 dark:text-red-400 rounded border border-red-500/30 dark:border-red-400/20 transition-colors text-xs disabled:opacity-50"},[v.value[I.name]?(t(),r("span",au,i[9]||(i[9]=[e("span",{class:"animate-spin w-3 h-3 border border-current border-t-transparent rounded-full inline-block"},null,-1),E(" Purging… ",-1)]))):(t(),r("span",lu,"Empty"))],8,nu)):T(I.name)?C("",!0):(t(),r("span",du,"—"))])]))),128))])])])])):C("",!0)]),x.value?(t(),r("div",iu,[e("div",uu,[i[16]||(i[16]=e("svg",{class:"w-5 h-5 text-red-600 dark:text-red-400 shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),e("div",cu,[e("h4",mu,s(x.value.table==="all"?"Confirm Purge All Tables":`Confirm Purge "${x.value.table}"`),1),e("p",pu,[x.value.table==="all"?(t(),r(W,{key:0},[i[11]||(i[11]=E(" This will permanently delete ",-1)),i[12]||(i[12]=e("strong",null,"all data",-1)),E(" from every data table ("+s(j.value.toLocaleString())+" rows total). This cannot be undone. ",1)],64)):(t(),r(W,{key:1},[i[13]||(i[13]=E(" This will permanently delete ",-1)),e("strong",null,s(x.value.rowCount.toLocaleString())+" rows",1),i[14]||(i[14]=E(" from ",-1)),e("strong",null,s(x.value.table),1),i[15]||(i[15]=E(". This cannot be undone. ",-1))],64))]),e("div",bu,[e("button",{onClick:P,disabled:x.value.executing,class:"px-4 py-2 bg-red-600 hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600 text-white rounded-lg transition-colors text-sm disabled:opacity-50"},s(x.value.executing?"Purging…":"Yes, Delete Data"),9,xu),e("button",{onClick:i[0]||(i[0]=I=>x.value=null),disabled:x.value.executing,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors text-sm"}," Cancel ",8,vu)])])])])):C("",!0),e("div",ku,[i[19]||(i[19]=e("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4"},"Maintenance",-1)),e("div",gu,[e("button",{onClick:i[1]||(i[1]=I=>d("all",j.value)),disabled:!y.value||j.value===0,class:"px-4 py-2 bg-red-500/20 dark:bg-red-400/20 hover:bg-red-500/30 dark:hover:bg-red-400/30 text-red-900 dark:text-red-200 rounded-lg border border-red-500/50 dark:border-red-400/40 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},i[17]||(i[17]=[e("span",{class:"flex items-center gap-2"},[e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})]),E(" Purge All Data ")],-1)]),8,yu),e("button",{onClick:_,disabled:k.value||!y.value,class:"px-4 py-2 bg-amber-500/20 dark:bg-amber-400/20 hover:bg-amber-500/30 dark:hover:bg-amber-400/30 text-amber-900 dark:text-amber-200 rounded-lg border border-amber-500/50 dark:border-amber-400/40 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed"},[e("span",hu,[i[18]||(i[18]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})],-1)),E(" "+s(k.value?"Compacting…":"Compact Database"),1)])],8,fu)]),A.value?(t(),r("p",wu,s(A.value),1)):C("",!0),u.value?(t(),r("p",_u,s(u.value),1)):C("",!0)])]))}}),Cu={class:"p-3 sm:p-6 space-y-4 sm:space-y-6"},Mu={class:"glass-card rounded-[15px] z-10 p-3 sm:p-4 border border-cyan-400 dark:border-primary/30 bg-cyan-500/10 dark:bg-primary/10"},Au={class:"text-cyan-700 dark:text-primary text-sm sm:text-base"},Su={class:"mt-1 sm:mt-2 text-cyan-600 dark:text-primary/80"},ju={class:"glass-card rounded-[15px] p-3 sm:p-6"},Tu={class:"relative -mx-3 sm:mx-0 mb-4 sm:mb-6"},Eu={key:0,class:"absolute left-0 top-0 bottom-[1px] w-12 z-10 flex items-center"},Bu={key:0,class:"absolute right-0 top-0 bottom-[1px] w-12 z-10 flex items-center justify-end"},Lu=["onClick"],Nu={class:"flex items-center gap-1 sm:gap-2"},Pu={key:0,class:"w-3.5 h-3.5 sm:w-4 sm:h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Fu={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Iu={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ru={key:3,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},zu={key:4,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Vu={key:5,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Du={key:6,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Hu={key:7,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Uu={key:8,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ou={key:9,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ku={key:10,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},qu={class:"min-h-[400px]"},Wu={key:0,class:"flex items-center justify-center py-12"},Gu={key:1,class:"flex items-center justify-center py-12"},Ju={class:"text-center"},Yu={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},Qu={key:2},Xu=re({name:"ConfigurationView",__name:"Configuration",setup(G){const L=be(),m=l(Ie("configuration_activeTab","radio")),g=l(!1),y=l(null),v=l(!1),x=l(!1);function u(){if(!y.value)return;const T=y.value;x.value=T.scrollLeft>4,v.value=T.scrollLeftRe("configuration_activeTab",T));const A=[{id:"radio",label:"Radio Settings",icon:"radio"},{id:"repeater",label:"Repeater Settings",icon:"repeater"},{id:"advert",label:"Advert Limits",icon:"advert"},{id:"duty",label:"Duty Cycle",icon:"duty"},{id:"delays",label:"TX Delays",icon:"delays"},{id:"transport",label:"Regions/Keys",icon:"keys"},{id:"api-tokens",label:"API Tokens",icon:"tokens"},{id:"web",label:"Web Options",icon:"web"},{id:"observer",label:"Observer",icon:"observer"},{id:"backup",label:"Backup",icon:"backup"},{id:"database",label:"Database",icon:"database"}];ve(async()=>{try{await L.fetchStats(),g.value=!0}catch(T){console.error("Failed to load configuration data:",T),g.value=!0}fe(()=>u())});function j(T){m.value=T}return(T,c)=>{const F=Se("router-link");return t(),r("div",Cu,[c[23]||(c[23]=e("div",null,[e("h1",{class:"text-xl sm:text-2xl font-bold text-content-primary dark:text-content-primary"},"Configuration"),e("p",{class:"text-content-secondary dark:text-content-muted mt-1 sm:mt-2 text-sm sm:text-base"},"System configuration and settings")],-1)),e("div",Mu,[e("div",Au,[c[5]||(c[5]=e("strong",null,"CAD Calibration Tool Available",-1)),e("p",Su,[c[4]||(c[4]=E(" Optimize your Channel Activity Detection settings. ",-1)),X(F,{to:"/cad-calibration",class:"underline hover:text-cyan-800 dark:hover:text-primary transition-colors"},{default:ge(()=>c[3]||(c[3]=[E(" Launch CAD Calibration Tool → ",-1)])),_:1,__:[3]})])])]),e("div",ju,[e("div",Tu,[X(he,{name:"tab-fade"},{default:ge(()=>[x.value?(t(),r("div",Eu,[c[7]||(c[7]=e("div",{class:"tab-fade-left absolute inset-0 pointer-events-none"},null,-1)),e("button",{onClick:c[0]||(c[0]=n=>k("left")),class:"relative z-10 ml-1.5 w-6 h-6 flex items-center justify-center rounded-full bg-white dark:bg-zinc-900 shadow-md border border-gray-200 dark:border-white/10 text-gray-500 dark:text-gray-300"},c[6]||(c[6]=[e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M15 19l-7-7 7-7"})],-1)]))])):C("",!0)]),_:1}),X(he,{name:"tab-fade"},{default:ge(()=>[v.value?(t(),r("div",Bu,[c[9]||(c[9]=e("div",{class:"tab-fade-right absolute inset-0 pointer-events-none"},null,-1)),e("button",{onClick:c[1]||(c[1]=n=>k("right")),class:"relative z-10 mr-1.5 w-6 h-6 flex items-center justify-center rounded-full bg-white dark:bg-zinc-900 shadow-md border border-gray-200 dark:border-white/10 text-gray-500 dark:text-gray-300"},c[8]||(c[8]=[e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M9 5l7 7-7 7"})],-1)]))])):C("",!0)]),_:1}),e("div",{ref_key:"tabsContainer",ref:y,onScroll:u,class:"flex overflow-x-auto border-b border-stroke-subtle dark:border-stroke/10 px-3 sm:px-0 scrollbar-hide"},[(t(),r(W,null,ee(A,n=>e("button",{key:n.id,onClick:o=>j(n.id),class:q(["px-3 sm:px-4 py-2 text-xs sm:text-sm font-medium transition-colors duration-200 border-b-2 mr-3 sm:mr-6 whitespace-nowrap flex-shrink-0",m.value===n.id?"text-cyan-500 dark:text-primary border-cyan-500 dark:border-primary":"text-content-secondary dark:text-content-muted border-transparent hover:text-content-primary dark:hover:text-content-primary hover:border-stroke-subtle dark:hover:border-stroke/30"])},[e("div",Nu,[n.icon==="radio"?(t(),r("svg",Pu,c[10]||(c[10]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.822c5.716-5.716 14.976-5.716 20.692 0"},null,-1)]))):n.icon==="repeater"?(t(),r("svg",Fu,c[11]||(c[11]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 12h14M5 12l4-4m-4 4l4 4"},null,-1)]))):n.icon==="advert"?(t(),r("svg",Iu,c[12]||(c[12]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},null,-1)]))):n.icon==="duty"?(t(),r("svg",Ru,c[13]||(c[13]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):n.icon==="delays"?(t(),r("svg",zu,c[14]||(c[14]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):n.icon==="keys"?(t(),r("svg",Vu,c[15]||(c[15]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"},null,-1)]))):n.icon==="tokens"?(t(),r("svg",Du,c[16]||(c[16]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"},null,-1)]))):n.icon==="web"?(t(),r("svg",Hu,c[17]||(c[17]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"},null,-1)]))):n.icon==="observer"?(t(),r("svg",Uu,c[18]||(c[18]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):n.icon==="backup"?(t(),r("svg",Ou,c[19]||(c[19]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"},null,-1)]))):n.icon==="database"?(t(),r("svg",Ku,c[20]||(c[20]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4"},null,-1)]))):C("",!0),E(" "+s(n.label),1)])],10,Lu)),64))],544)]),e("div",qu,[!g.value&&ce(L).isLoading?(t(),r("div",Wu,c[21]||(c[21]=[e("div",{class:"text-center"},[e("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4"}),e("div",{class:"text-content-secondary dark:text-content-muted"},"Loading configuration...")],-1)]))):ce(L).error&&!g.value?(t(),r("div",Gu,[e("div",Ju,[c[22]||(c[22]=e("div",{class:"text-red-500 dark:text-red-400 mb-2"},"Failed to load configuration",-1)),e("div",Yu,s(ce(L).error),1),e("button",{onClick:c[2]||(c[2]=n=>ce(L).fetchStats()),class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors"}," Retry ")])])):(t(),r("div",Qu,[R(e("div",null,[X(bt,{key:"radio-settings"})],512),[[ie,m.value==="radio"]]),R(e("div",null,[X(gr,{key:"repeater-settings"})],512),[[ie,m.value==="repeater"]]),R(e("div",null,[X(sl,{key:"advert-settings"})],512),[[ie,m.value==="advert"]]),R(e("div",null,[X(Tr,{key:"duty-cycle"})],512),[[ie,m.value==="duty"]]),R(e("div",null,[X(Or,{key:"transmission-delays"})],512),[[ie,m.value==="delays"]]),R(e("div",null,[X(Os,{key:"transport-keys"})],512),[[ie,m.value==="transport"]]),R(e("div",null,[X(yn,{key:"api-tokens"})],512),[[ie,m.value==="api-tokens"]]),R(e("div",null,[X(On,{key:"web-settings"})],512),[[ie,m.value==="web"]]),R(e("div",null,[X(hd,{key:"letsmesh-settings"})],512),[[ie,m.value==="observer"]]),R(e("div",null,[X(Ai,{key:"backup-restore"})],512),[[ie,m.value==="backup"]]),R(e("div",null,[X($u,{key:"database-management"})],512),[[ie,m.value==="database"]])]))])])])}}}),oc=we(Xu,[["__scopeId","data-v-06241a19"]]);export{oc as default}; diff --git a/repeater/web/html/assets/Configuration-DavFlb5x.css b/repeater/web/html/assets/Configuration-DavFlb5x.css new file mode 100644 index 0000000..479da28 --- /dev/null +++ b/repeater/web/html/assets/Configuration-DavFlb5x.css @@ -0,0 +1 @@ +.leaflet-pane[data-v-fd94857e],.leaflet-tile[data-v-fd94857e],.leaflet-marker-icon[data-v-fd94857e],.leaflet-marker-shadow[data-v-fd94857e],.leaflet-tile-container[data-v-fd94857e],.leaflet-pane>svg[data-v-fd94857e],.leaflet-pane>canvas[data-v-fd94857e],.leaflet-zoom-box[data-v-fd94857e],.leaflet-image-layer[data-v-fd94857e],.leaflet-layer[data-v-fd94857e]{position:absolute;top:0;left:0}.leaflet-container[data-v-fd94857e]{overflow:hidden}.leaflet-tile[data-v-fd94857e],.leaflet-marker-icon[data-v-fd94857e],.leaflet-marker-shadow[data-v-fd94857e]{-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.leaflet-tile[data-v-fd94857e]::selection{background:0 0}.leaflet-safari .leaflet-tile[data-v-fd94857e]{image-rendering:-webkit-optimize-contrast}.leaflet-safari .leaflet-tile-container[data-v-fd94857e]{-webkit-transform-origin:0 0;width:1600px;height:1600px}.leaflet-marker-icon[data-v-fd94857e],.leaflet-marker-shadow[data-v-fd94857e]{display:block}.leaflet-container .leaflet-overlay-pane svg[data-v-fd94857e]{max-width:none!important;max-height:none!important}.leaflet-container .leaflet-marker-pane img[data-v-fd94857e],.leaflet-container .leaflet-shadow-pane img[data-v-fd94857e],.leaflet-container .leaflet-tile-pane img[data-v-fd94857e],.leaflet-container img.leaflet-image-layer[data-v-fd94857e],.leaflet-container .leaflet-tile[data-v-fd94857e]{width:auto;padding:0;max-width:none!important;max-height:none!important}.leaflet-container img.leaflet-tile[data-v-fd94857e]{mix-blend-mode:plus-lighter}.leaflet-container.leaflet-touch-zoom[data-v-fd94857e]{-ms-touch-action:pan-x pan-y;touch-action:pan-x pan-y}.leaflet-container.leaflet-touch-drag[data-v-fd94857e]{-ms-touch-action:pinch-zoom;touch-action:none;touch-action:pinch-zoom}.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom[data-v-fd94857e]{-ms-touch-action:none;touch-action:none}.leaflet-container[data-v-fd94857e]{-webkit-tap-highlight-color:transparent}.leaflet-container a[data-v-fd94857e]{-webkit-tap-highlight-color:#33b5e566}.leaflet-tile[data-v-fd94857e]{filter:inherit;visibility:hidden}.leaflet-tile-loaded[data-v-fd94857e]{visibility:inherit}.leaflet-zoom-box[data-v-fd94857e]{box-sizing:border-box;z-index:800;width:0;height:0}.leaflet-overlay-pane svg[data-v-fd94857e]{-moz-user-select:none}.leaflet-pane[data-v-fd94857e]{z-index:400}.leaflet-tile-pane[data-v-fd94857e]{z-index:200}.leaflet-overlay-pane[data-v-fd94857e]{z-index:400}.leaflet-shadow-pane[data-v-fd94857e]{z-index:500}.leaflet-marker-pane[data-v-fd94857e]{z-index:600}.leaflet-tooltip-pane[data-v-fd94857e]{z-index:650}.leaflet-popup-pane[data-v-fd94857e]{z-index:700}.leaflet-map-pane canvas[data-v-fd94857e]{z-index:100}.leaflet-map-pane svg[data-v-fd94857e]{z-index:200}.leaflet-vml-shape[data-v-fd94857e]{width:1px;height:1px}.lvml[data-v-fd94857e]{behavior:url(#default#VML);display:inline-block;position:absolute}.leaflet-control[data-v-fd94857e]{z-index:800;pointer-events:visiblePainted;pointer-events:auto;position:relative}.leaflet-top[data-v-fd94857e],.leaflet-bottom[data-v-fd94857e]{z-index:1000;pointer-events:none;position:absolute}.leaflet-top[data-v-fd94857e]{top:0}.leaflet-right[data-v-fd94857e]{right:0}.leaflet-bottom[data-v-fd94857e]{bottom:0}.leaflet-left[data-v-fd94857e]{left:0}.leaflet-control[data-v-fd94857e]{float:left;clear:both}.leaflet-right .leaflet-control[data-v-fd94857e]{float:right}.leaflet-top .leaflet-control[data-v-fd94857e]{margin-top:10px}.leaflet-bottom .leaflet-control[data-v-fd94857e]{margin-bottom:10px}.leaflet-left .leaflet-control[data-v-fd94857e]{margin-left:10px}.leaflet-right .leaflet-control[data-v-fd94857e]{margin-right:10px}.leaflet-fade-anim .leaflet-popup[data-v-fd94857e]{opacity:0;transition:opacity .2s linear}.leaflet-fade-anim .leaflet-map-pane .leaflet-popup[data-v-fd94857e]{opacity:1}.leaflet-zoom-animated[data-v-fd94857e]{transform-origin:0 0}svg.leaflet-zoom-animated[data-v-fd94857e]{will-change:transform}.leaflet-zoom-anim .leaflet-zoom-animated[data-v-fd94857e]{-webkit-transition:-webkit-transform .25s cubic-bezier(0,0,.25,1);-moz-transition:-moz-transform .25s cubic-bezier(0,0,.25,1);transition:transform .25s cubic-bezier(0,0,.25,1)}.leaflet-zoom-anim .leaflet-tile[data-v-fd94857e],.leaflet-pan-anim .leaflet-tile[data-v-fd94857e]{transition:none}.leaflet-zoom-anim .leaflet-zoom-hide[data-v-fd94857e]{visibility:hidden}.leaflet-interactive[data-v-fd94857e]{cursor:pointer}.leaflet-grab[data-v-fd94857e]{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.leaflet-crosshair[data-v-fd94857e],.leaflet-crosshair .leaflet-interactive[data-v-fd94857e]{cursor:crosshair}.leaflet-popup-pane[data-v-fd94857e],.leaflet-control[data-v-fd94857e]{cursor:auto}.leaflet-dragging .leaflet-grab[data-v-fd94857e],.leaflet-dragging .leaflet-grab .leaflet-interactive[data-v-fd94857e],.leaflet-dragging .leaflet-marker-draggable[data-v-fd94857e]{cursor:move;cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.leaflet-marker-icon[data-v-fd94857e],.leaflet-marker-shadow[data-v-fd94857e],.leaflet-image-layer[data-v-fd94857e],.leaflet-pane>svg path[data-v-fd94857e],.leaflet-tile-container[data-v-fd94857e]{pointer-events:none}.leaflet-marker-icon.leaflet-interactive[data-v-fd94857e],.leaflet-image-layer.leaflet-interactive[data-v-fd94857e],.leaflet-pane>svg path.leaflet-interactive[data-v-fd94857e],svg.leaflet-image-layer.leaflet-interactive path[data-v-fd94857e]{pointer-events:visiblePainted;pointer-events:auto}.leaflet-container[data-v-fd94857e]{outline-offset:1px;background:#ddd}.leaflet-container a[data-v-fd94857e]{color:#0078a8}.leaflet-zoom-box[data-v-fd94857e]{background:#ffffff80;border:2px dotted #38f}.leaflet-container[data-v-fd94857e]{font-family:Helvetica Neue,Arial,Helvetica,sans-serif;font-size:.75rem;line-height:1.5}.leaflet-bar[data-v-fd94857e]{border-radius:4px;box-shadow:0 1px 5px #000000a6}.leaflet-bar a[data-v-fd94857e]{text-align:center;color:#000;background-color:#fff;border-bottom:1px solid #ccc;width:26px;height:26px;line-height:26px;text-decoration:none;display:block}.leaflet-bar a[data-v-fd94857e],.leaflet-control-layers-toggle[data-v-fd94857e]{background-position:50%;background-repeat:no-repeat;display:block}.leaflet-bar a[data-v-fd94857e]:hover,.leaflet-bar a[data-v-fd94857e]:focus{background-color:#f4f4f4}.leaflet-bar a[data-v-fd94857e]:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.leaflet-bar a[data-v-fd94857e]:last-child{border-bottom:none;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.leaflet-bar a.leaflet-disabled[data-v-fd94857e]{cursor:default;color:#bbb;background-color:#f4f4f4}.leaflet-touch .leaflet-bar a[data-v-fd94857e]{width:30px;height:30px;line-height:30px}.leaflet-touch .leaflet-bar a[data-v-fd94857e]:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.leaflet-touch .leaflet-bar a[data-v-fd94857e]:last-child{border-bottom-right-radius:2px;border-bottom-left-radius:2px}.leaflet-control-zoom-in[data-v-fd94857e],.leaflet-control-zoom-out[data-v-fd94857e]{text-indent:1px;font:700 18px Lucida Console,Monaco,monospace}.leaflet-touch .leaflet-control-zoom-in[data-v-fd94857e],.leaflet-touch .leaflet-control-zoom-out[data-v-fd94857e]{font-size:22px}.leaflet-control-layers[data-v-fd94857e]{background:#fff;border-radius:5px;box-shadow:0 1px 5px #0006}.leaflet-control-layers-toggle[data-v-fd94857e]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAQAAAADQ4RFAAACf0lEQVR4AY1UM3gkARTePdvdoTxXKc+qTl3aU5U6b2Kbkz3Gtq3Zw6ziLGNPzrYx7946Tr6/ee/XeCQ4D3ykPtL5tHno4n0d/h3+xfuWHGLX81cn7r0iTNzjr7LrlxCqPtkbTQEHeqOrTy4Yyt3VCi/IOB0v7rVC7q45Q3Gr5K6jt+3Gl5nCoDD4MtO+j96Wu8atmhGqcNGHObuf8OM/x3AMx38+4Z2sPqzCxRFK2aF2e5Jol56XTLyggAMTL56XOMoS1W4pOyjUcGGQdZxU6qRh7B9Zp+PfpOFlqt0zyDZckPi1ttmIp03jX8gyJ8a/PG2yutpS/Vol7peZIbZcKBAEEheEIAgFbDkz5H6Zrkm2hVWGiXKiF4Ycw0RWKdtC16Q7qe3X4iOMxruonzegJzWaXFrU9utOSsLUmrc0YjeWYjCW4PDMADElpJSSQ0vQvA1Tm6/JlKnqFs1EGyZiFCqnRZTEJJJiKRYzVYzJck2Rm6P4iH+cmSY0YzimYa8l0EtTODFWhcMIMVqdsI2uiTvKmTisIDHJ3od5GILVhBCarCfVRmo4uTjkhrhzkiBV7SsaqS+TzrzM1qpGGUFt28pIySQHR6h7F6KSwGWm97ay+Z+ZqMcEjEWebE7wxCSQwpkhJqoZA5ivCdZDjJepuJ9IQjGGUmuXJdBFUygxVqVsxFsLMbDe8ZbDYVCGKxs+W080max1hFCarCfV+C1KATwcnvE9gRRuMP2prdbWGowm1KB1y+zwMMENkM755cJ2yPDtqhTI6ED1M/82yIDtC/4j4BijjeObflpO9I9MwXTCsSX8jWAFeHr05WoLTJ5G8IQVS/7vwR6ohirYM7f6HzYpogfS3R2OAAAAAElFTkSuQmCC);width:36px;height:36px}.leaflet-retina .leaflet-control-layers-toggle[data-v-fd94857e]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAQAAABvcdNgAAAEsklEQVR4AWL4TydIhpZK1kpWOlg0w3ZXP6D2soBtG42jeI6ZmQTHzAxiTbSJsYLjO9HhP+WOmcuhciVnmHVQcJnp7DFvScowZorad/+V/fVzMdMT2g9Cv9guXGv/7pYOrXh2U+RRR3dSd9JRx6bIFc/ekqHI29JC6pJ5ZEh1yWkhkbcFeSjxgx3L2m1cb1C7bceyxA+CNjT/Ifff+/kDk2u/w/33/IeCMOSaWZ4glosqT3DNnNZQ7Cs58/3Ce5HL78iZH/vKVIaYlqzfdLu8Vi7dnvUbEza5Idt36tquZFldl6N5Z/POLof0XLK61mZCmJSWjVF9tEjUluu74IUXvgttuVIHE7YxSkaYhJZam7yiM9Pv82JYfl9nptxZaxMJE4YSPty+vF0+Y2up9d3wwijfjZbabqm/3bZ9ecKHsiGmRflnn1MW4pjHf9oLufyn2z3y1D6n8g8TZhxyzipLNPnAUpsOiuWimg52psrTZYnOWYNDTMuWBWa0tJb4rgq1UvmutpaYEbZlwU3CLJm/ayYjHW5/h7xWLn9Hh1vepDkyf7dE7MtT5LR4e7yYpHrkhOUpEfssBLq2pPhAqoSWKUkk7EDqkmK6RrCEzqDjhNDWNE+XSMvkJRDWlZTmCW0l0PHQGRZY5t1L83kT0Y3l2SItk5JAWHl2dCOBm+fPu3fo5/3v61RMCO9Jx2EEYYhb0rmNQMX/vm7gqOEJLcXTGw3CAuRNeyaPWwjR8PRqKQ1PDA/dpv+on9Shox52WFnx0KY8onHayrJzm87i5h9xGw/tfkev0jGsQizqezUKjk12hBMKJ4kbCqGPVNXudyyrShovGw5CgxsRICxF6aRmSjlBnHRzg7Gx8fKqEubI2rahQYdR1YgDIRQO7JvQyD52hoIQx0mxa0ODtW2Iozn1le2iIRdzwWewedyZzewidueOGqlsn1MvcnQpuVwLGG3/IR1hIKxCjelIDZ8ldqWz25jWAsnldEnK0Zxro19TGVb2ffIZEsIO89EIEDvKMPrzmBOQcKQ+rroye6NgRRxqR4U8EAkz0CL6uSGOm6KQCdWjvjRiSP1BPalCRS5iQYiEIvxuBMJEWgzSoHADcVMuN7IuqqTeyUPq22qFimFtxDyBBJEwNyt6TM88blFHao/6tWWhuuOM4SAK4EI4QmFHA+SEyWlp4EQoJ13cYGzMu7yszEIBOm2rVmHUNqwAIQabISNMRstmdhNWcFLsSm+0tjJH1MdRxO5Nx0WDMhCtgD6OKgZeljJqJKc9po8juskR9XN0Y1lZ3mWjLR9JCO1jRDMd0fpYC2VnvjBSEFg7wBENc0R9HFlb0xvF1+TBEpF68d+DHR6IOWVv2BECtxo46hOFUBd/APU57WIoEwJhIi2CdpyZX0m93BZicktMj1AS9dClteUFAUNUIEygRZCtik5zSxI9MubTBH1GOiHsiLJ3OCoSZkILa9PxiN0EbvhsAo8tdAf9Seepd36lGWHmtNANTv5Jd0z4QYyeo/UEJqxKRpg5LZx6btLPsOaEmdMyxYdlc8LMaJnikDlhclqmPiQnTEpLUIZEwkRagjYkEibQErwhkTAKCLQEbUgkzJQWc/0PstHHcfEdQ+UAAAAASUVORK5CYII=);background-size:26px 26px}.leaflet-touch .leaflet-control-layers-toggle[data-v-fd94857e]{width:44px;height:44px}.leaflet-control-layers .leaflet-control-layers-list[data-v-fd94857e],.leaflet-control-layers-expanded .leaflet-control-layers-toggle[data-v-fd94857e]{display:none}.leaflet-control-layers-expanded .leaflet-control-layers-list[data-v-fd94857e]{display:block;position:relative}.leaflet-control-layers-expanded[data-v-fd94857e]{color:#333;background:#fff;padding:6px 10px 6px 6px}.leaflet-control-layers-scrollbar[data-v-fd94857e]{padding-right:5px;overflow:hidden scroll}.leaflet-control-layers-selector[data-v-fd94857e]{margin-top:2px;position:relative;top:1px}.leaflet-control-layers label[data-v-fd94857e]{font-size:1.08333em;display:block}.leaflet-control-layers-separator[data-v-fd94857e]{border-top:1px solid #ddd;height:0;margin:5px -10px 5px -6px}.leaflet-default-icon-path[data-v-fd94857e]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=)}.leaflet-container .leaflet-control-attribution[data-v-fd94857e]{background:#fffc;margin:0}.leaflet-control-attribution[data-v-fd94857e],.leaflet-control-scale-line[data-v-fd94857e]{color:#333;padding:0 5px;line-height:1.4}.leaflet-control-attribution a[data-v-fd94857e]{text-decoration:none}.leaflet-control-attribution a[data-v-fd94857e]:hover,.leaflet-control-attribution a[data-v-fd94857e]:focus{text-decoration:underline}.leaflet-attribution-flag[data-v-fd94857e]{width:1em;height:.6669em;vertical-align:baseline!important;display:inline!important}.leaflet-left .leaflet-control-scale[data-v-fd94857e]{margin-left:5px}.leaflet-bottom .leaflet-control-scale[data-v-fd94857e]{margin-bottom:5px}.leaflet-control-scale-line[data-v-fd94857e]{white-space:nowrap;box-sizing:border-box;text-shadow:1px 1px #fff;background:#fffc;border:2px solid #777;border-top:none;padding:2px 5px 1px;line-height:1.1}.leaflet-control-scale-line[data-v-fd94857e]:not(:first-child){border-top:2px solid #777;border-bottom:none;margin-top:-2px}.leaflet-control-scale-line[data-v-fd94857e]:not(:first-child):not(:last-child){border-bottom:2px solid #777}.leaflet-touch .leaflet-control-attribution[data-v-fd94857e],.leaflet-touch .leaflet-control-layers[data-v-fd94857e],.leaflet-touch .leaflet-bar[data-v-fd94857e]{box-shadow:none}.leaflet-touch .leaflet-control-layers[data-v-fd94857e],.leaflet-touch .leaflet-bar[data-v-fd94857e]{background-clip:padding-box;border:2px solid #0003}.leaflet-popup[data-v-fd94857e]{text-align:center;margin-bottom:20px;position:absolute}.leaflet-popup-content-wrapper[data-v-fd94857e]{text-align:left;border-radius:12px;padding:1px}.leaflet-popup-content[data-v-fd94857e]{min-height:1px;margin:13px 24px 13px 20px;font-size:1.08333em;line-height:1.3}.leaflet-popup-content p[data-v-fd94857e]{margin:1.3em 0}.leaflet-popup-tip-container[data-v-fd94857e]{pointer-events:none;width:40px;height:20px;margin-top:-1px;margin-left:-20px;position:absolute;left:50%;overflow:hidden}.leaflet-popup-tip[data-v-fd94857e]{pointer-events:auto;width:17px;height:17px;margin:-10px auto 0;padding:1px;transform:rotate(45deg)}.leaflet-popup-content-wrapper[data-v-fd94857e],.leaflet-popup-tip[data-v-fd94857e]{color:#333;background:#fff;box-shadow:0 3px 14px #0006}.leaflet-container a.leaflet-popup-close-button[data-v-fd94857e]{text-align:center;color:#757575;background:0 0;border:none;width:24px;height:24px;font:16px/24px Tahoma,Verdana,sans-serif;text-decoration:none;position:absolute;top:0;right:0}.leaflet-container a.leaflet-popup-close-button[data-v-fd94857e]:hover,.leaflet-container a.leaflet-popup-close-button[data-v-fd94857e]:focus{color:#585858}.leaflet-popup-scrolled[data-v-fd94857e]{overflow:auto}.leaflet-oldie .leaflet-popup-content-wrapper[data-v-fd94857e]{-ms-zoom:1}.leaflet-oldie .leaflet-popup-tip[data-v-fd94857e]{-ms-filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";width:24px;filter:progid:DXImageTransform.Microsoft.Matrix(M11=.707107, M12=.707107, M21=-.707107, M22=.707107);margin:0 auto}.leaflet-oldie .leaflet-control-zoom[data-v-fd94857e],.leaflet-oldie .leaflet-control-layers[data-v-fd94857e],.leaflet-oldie .leaflet-popup-content-wrapper[data-v-fd94857e],.leaflet-oldie .leaflet-popup-tip[data-v-fd94857e]{border:1px solid #999}.leaflet-div-icon[data-v-fd94857e]{background:#fff;border:1px solid #666}.leaflet-tooltip[data-v-fd94857e]{color:#222;white-space:nowrap;-webkit-user-select:none;user-select:none;pointer-events:none;background-color:#fff;border:1px solid #fff;border-radius:3px;padding:6px;position:absolute;box-shadow:0 1px 3px #0006}.leaflet-tooltip.leaflet-interactive[data-v-fd94857e]{cursor:pointer;pointer-events:auto}.leaflet-tooltip-top[data-v-fd94857e]:before,.leaflet-tooltip-bottom[data-v-fd94857e]:before,.leaflet-tooltip-left[data-v-fd94857e]:before,.leaflet-tooltip-right[data-v-fd94857e]:before{pointer-events:none;content:"";background:0 0;border:6px solid #0000;position:absolute}.leaflet-tooltip-bottom[data-v-fd94857e]{margin-top:6px}.leaflet-tooltip-top[data-v-fd94857e]{margin-top:-6px}.leaflet-tooltip-bottom[data-v-fd94857e]:before,.leaflet-tooltip-top[data-v-fd94857e]:before{margin-left:-6px;left:50%}.leaflet-tooltip-top[data-v-fd94857e]:before{border-top-color:#fff;margin-bottom:-12px;bottom:0}.leaflet-tooltip-bottom[data-v-fd94857e]:before{border-bottom-color:#fff;margin-top:-12px;margin-left:-6px;top:0}.leaflet-tooltip-left[data-v-fd94857e]{margin-left:-6px}.leaflet-tooltip-right[data-v-fd94857e]{margin-left:6px}.leaflet-tooltip-left[data-v-fd94857e]:before,.leaflet-tooltip-right[data-v-fd94857e]:before{margin-top:-6px;top:50%}.leaflet-tooltip-left[data-v-fd94857e]:before{border-left-color:#fff;margin-right:-12px;right:0}.leaflet-tooltip-right[data-v-fd94857e]:before{border-right-color:#fff;margin-left:-12px;left:0}@media print{.leaflet-control[data-v-fd94857e]{-webkit-print-color-adjust:exact;print-color-adjust:exact}}.ml-0[data-v-ed9c8a11]{margin-left:0}.ml-4[data-v-ed9c8a11]{margin-left:1rem}.ml-8[data-v-ed9c8a11]{margin-left:2rem}.ml-12[data-v-ed9c8a11]{margin-left:3rem}.ml-16[data-v-ed9c8a11]{margin-left:4rem}.ml-20[data-v-ed9c8a11]{margin-left:5rem}.ml-24[data-v-ed9c8a11]{margin-left:6rem}.ml-28[data-v-ed9c8a11]{margin-left:7rem}.ml-32[data-v-ed9c8a11]{margin-left:8rem}.dropdown-enter-active[data-v-a170107f],.dropdown-leave-active[data-v-a170107f]{transition:opacity .12s,transform .12s}.dropdown-enter-from[data-v-a170107f],.dropdown-leave-to[data-v-a170107f]{opacity:0;transform:translateY(-4px)}.tab-fade-left[data-v-f5e6ec18]{background:linear-gradient(to right, var(--color-surface) 30%, transparent)}.tab-fade-right[data-v-f5e6ec18]{background:linear-gradient(to left, var(--color-surface) 30%, transparent)}.tab-fade-enter-active[data-v-f5e6ec18],.tab-fade-leave-active[data-v-f5e6ec18]{transition:opacity .2s}.tab-fade-enter-from[data-v-f5e6ec18],.tab-fade-leave-to[data-v-f5e6ec18]{opacity:0} diff --git a/repeater/web/html/assets/Configuration-Db8EsEJI.js b/repeater/web/html/assets/Configuration-Db8EsEJI.js new file mode 100644 index 0000000..8bd9268 --- /dev/null +++ b/repeater/web/html/assets/Configuration-Db8EsEJI.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/leaflet-src-BtX0-WJ4.js","assets/chunk-DECur_0Z.js"])))=>i.map(i=>d[i]); +import{r as e}from"./chunk-DECur_0Z.js";import{A as t,C as n,D as r,E as i,R as a,S as o,W as s,b as c,c as l,dt as u,f as d,g as f,i as p,j as m,k as h,l as g,lt as _,m as v,o as y,p as b,r as x,s as S,u as C,w,x as T,z as E}from"./runtime-core.esm-bundler-IofF4kUm.js";import{n as D}from"./pinia-BrpcNUEi.js";import{i as O,n as k,t as A}from"./api-CrUX-ZnK.js";import{t as j}from"./system-CCY_Ibb-.js";import{t as M}from"./_plugin-vue_export-helper-V-yks4gF.js";import{d as N,f as P,l as F,m as I,p as L,s as R,u as z}from"./index-CPWfwDmA.js";import{t as B}from"./ConfirmDialog-BRvNEHEy.js";/* empty css */import{n as V,t as H}from"./preferences-N3Pls1rF.js";var U={class:`space-y-4`},W={key:0,class:`bg-green-100 dark:bg-green-500/20 border border-green-500/50 rounded-lg p-3`},G={class:`text-green-600 dark:text-green-400 text-sm`},ee={key:1,class:`bg-red-100 dark:bg-red-500/20 border border-red-500/50 rounded-lg p-3`},te={class:`text-red-600 dark:text-red-400 text-sm`},ne={class:`flex justify-end gap-2`},re=[`disabled`],K=[`disabled`],q={class:`bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3`},J={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Y={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},X={key:1,class:`flex items-center gap-2`},Z={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Q={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},$={key:1},ie=[`value`],ae={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},oe={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},se={key:1},ce=[`value`],le={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},ue={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},de={key:1,class:`flex items-center gap-2`},fe={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},pe={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},me={key:1},he={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1`},ge={class:`text-content-primary dark:text-content-primary font-mono text-sm`},_e={key:2,class:`bg-yellow-500/10 dark:bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3`},ve=f({__name:`RadioSettings`,setup(e){let t=j(),n=y(()=>t.stats?.config?.radio||{}),r=E(!1),a=E(!1),o=E(null),s=E(null),c=E(0),l=E(0),d=E(0),f=E(0),p=E(0),_=E(0),v=[{value:7.8,label:`7.8 kHz`},{value:10.4,label:`10.4 kHz`},{value:15.6,label:`15.6 kHz`},{value:20.8,label:`20.8 kHz`},{value:31.25,label:`31.25 kHz`},{value:41.7,label:`41.7 kHz`},{value:62.5,label:`62.5 kHz`},{value:125,label:`125 kHz`},{value:250,label:`250 kHz`},{value:500,label:`500 kHz`}];h(n,e=>{e&&!r.value&&(c.value=e.frequency?Number((e.frequency/1e6).toFixed(3)):0,l.value=e.spreading_factor??0,d.value=e.bandwidth?Number((e.bandwidth/1e3).toFixed(1)):0,f.value=e.tx_power??0,p.value=e.coding_rate??0,_.value=e.preamble_length??0)},{immediate:!0});let T=y(()=>{let e=n.value.frequency;return e?(e/1e6).toFixed(3)+` MHz`:`Not set`}),D=y(()=>{let e=n.value.bandwidth;return e?(e/1e3).toFixed(1)+` kHz`:`Not set`}),O=y(()=>{let e=n.value.tx_power;return e===void 0?`Not set`:e+` dBm`}),k=y(()=>{let e=n.value.coding_rate;return e?`4/`+e:`Not set`}),M=y(()=>{let e=n.value.preamble_length;return e?e+` symbols`:`Not set`}),P=y(()=>n.value.spreading_factor??`Not set`),F=()=>{r.value=!0,o.value=null,s.value=null},I=()=>{r.value=!1,o.value=null;let e=n.value;c.value=e.frequency?Number((e.frequency/1e6).toFixed(3)):0,l.value=e.spreading_factor??0,d.value=e.bandwidth?Number((e.bandwidth/1e3).toFixed(1)):0,f.value=e.tx_power??0,p.value=e.coding_rate??0,_.value=e.preamble_length??0},L=async()=>{a.value=!0,o.value=null,s.value=null;try{let e={};c.value&&(e.frequency=c.value*1e6),l.value&&(e.spreading_factor=l.value),d.value&&(e.bandwidth=d.value*1e3),f.value&&(e.tx_power=f.value),p.value&&(e.coding_rate=p.value);let n=(await A.post(`/update_radio_config`,e)).data;n.message||n.persisted?(s.value=n.message||`Settings saved successfully`,r.value=!1,await t.fetchStats(),setTimeout(()=>{s.value=null},3e3)):n.error?o.value=n.error:o.value=`Unknown response from server`}catch(e){console.error(`Failed to update radio settings:`,e),o.value=e.response?.data?.error||`Failed to update settings`}finally{a.value=!1}};return(e,t)=>(w(),C(`div`,U,[s.value?(w(),C(`div`,W,[S(`p`,G,u(s.value),1)])):g(``,!0),o.value?(w(),C(`div`,ee,[S(`p`,te,u(o.value),1)])):g(``,!0),S(`div`,ne,[r.value?(w(),C(x,{key:1},[S(`button`,{onClick:I,disabled:a.value,class:`px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed`},` Cancel `,8,re),S(`button`,{onClick:L,disabled:a.value,class:`px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed`},u(a.value?`Saving...`:`Save Changes`),9,K)],64)):(w(),C(`button`,{key:0,onClick:F,class:`px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm`},` Edit Settings `))]),S(`div`,q,[S(`div`,J,[t[6]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Frequency`,-1),r.value?(w(),C(`div`,X,[m(S(`input`,{"onUpdate:modelValue":t[0]||=e=>c.value=e,type:`number`,step:`0.001`,min:`100`,max:`1000`,class:`w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512),[[N,c.value,void 0,{number:!0}]]),t[5]||=S(`span`,{class:`text-content-muted dark:text-content-muted text-sm`},`MHz`,-1)])):(w(),C(`div`,Y,u(T.value),1))]),S(`div`,Z,[t[7]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Spreading Factor`,-1),r.value?(w(),C(`div`,$,[m(S(`select`,{"onUpdate:modelValue":t[1]||=e=>l.value=e,class:`px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},[(w(),C(x,null,i([5,6,7,8,9,10,11,12],e=>S(`option`,{key:e,value:e},u(e),9,ie)),64))],512),[[z,l.value,void 0,{number:!0}]])])):(w(),C(`div`,Q,u(P.value),1))]),S(`div`,ae,[t[8]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Bandwidth`,-1),r.value?(w(),C(`div`,se,[m(S(`select`,{"onUpdate:modelValue":t[2]||=e=>d.value=e,class:`px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},[(w(),C(x,null,i(v,e=>S(`option`,{key:e.value,value:e.value},u(e.label),9,ce)),64))],512),[[z,d.value,void 0,{number:!0}]])])):(w(),C(`div`,oe,u(D.value),1))]),S(`div`,le,[t[10]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`TX Power`,-1),r.value?(w(),C(`div`,de,[m(S(`input`,{"onUpdate:modelValue":t[3]||=e=>f.value=e,type:`number`,min:`2`,max:`30`,class:`w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512),[[N,f.value,void 0,{number:!0}]]),t[9]||=S(`span`,{class:`text-content-muted dark:text-content-muted text-sm`},`dBm`,-1)])):(w(),C(`div`,ue,u(O.value),1))]),S(`div`,fe,[t[12]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Coding Rate`,-1),r.value?(w(),C(`div`,me,[m(S(`select`,{"onUpdate:modelValue":t[4]||=e=>p.value=e,class:`px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},[...t[11]||=[S(`option`,{value:5},`4/5`,-1),S(`option`,{value:6},`4/6`,-1),S(`option`,{value:7},`4/7`,-1),S(`option`,{value:8},`4/8`,-1)]],512),[[z,p.value,void 0,{number:!0}]])])):(w(),C(`div`,pe,u(k.value),1))]),S(`div`,he,[t[13]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Preamble Length`,-1),S(`span`,ge,u(M.value),1)])]),r.value?(w(),C(`div`,_e,[...t[14]||=[S(`p`,{class:`text-yellow-700 dark:text-yellow-400 text-xs`},[S(`strong`,null,`Note:`),b(` Radio hardware changes (frequency, bandwidth, spreading factor, coding rate) may require a service restart to apply. `)],-1)]])):g(``,!0)]))}}),ye={class:`glass-card border border-stroke-subtle dark:border-white/20 rounded-[15px] w-full max-w-3xl max-h-[90vh] flex flex-col shadow-2xl`},be={class:`flex-1 relative min-h-[400px]`},xe={class:`p-6 border-t border-stroke-subtle dark:border-stroke/10 space-y-4`},Se={class:`grid grid-cols-2 gap-4`},Ce=M(f({__name:`LocationPicker`,props:{isOpen:{type:Boolean},latitude:{},longitude:{}},emits:[`close`,`select`],setup(t,{emit:r}){let i=t,a=r,o=E(null),s=E(i.latitude||0),l=E(i.longitude||0),u=null,d=null,f=async()=>{if(o.value){p();try{let t=(await O(async()=>{let{default:t}=await import(`./leaflet-src-BtX0-WJ4.js`).then(t=>e(t.t(),1));return{default:t}},__vite__mapDeps([0,1]))).default;delete t.Icon.Default.prototype._getIconUrl,t.Icon.Default.mergeOptions({iconRetinaUrl:`https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon-2x.png`,iconUrl:`https://unpkg.com/leaflet@1.9.4/dist/images/marker-icon.png`,shadowUrl:`https://unpkg.com/leaflet@1.9.4/dist/images/marker-shadow.png`}),await c();let n=s.value||0,r=l.value||0,i=n===0&&r===0?2:13;u=t.map(o.value).setView([n,r],i);try{let e=t.tileLayer(`https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png`,{maxZoom:19,attribution:`© OpenStreetMap contributors © CARTO`,errorTileUrl:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==`}),n=t.tileLayer(`https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png`,{maxZoom:19,attribution:``,errorTileUrl:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==`});e.addTo(u),n.addTo(u)}catch(e){console.warn(`Error loading tiles:`,e)}(n!==0||r!==0)&&(d=t.marker([n,r]).addTo(u)),u.on(`click`,e=>{s.value=e.latlng.lat,l.value=e.latlng.lng,d?d.setLatLng(e.latlng):d=t.marker(e.latlng).addTo(u)}),setTimeout(()=>{u?.invalidateSize()},200)}catch(e){console.error(`Failed to initialize map:`,e)}}},p=()=>{u&&(u.remove(),u=null,d=null)};h(()=>i.isOpen,async e=>{e?(await c(),await f()):p()}),h(()=>[i.latitude,i.longitude],([e,t])=>{s.value=e,l.value=t});let _=()=>{a(`select`,{latitude:s.value,longitude:l.value}),a(`close`)},v=()=>{a(`close`)},y=()=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(async t=>{if(s.value=t.coords.latitude,l.value=t.coords.longitude,u){u.setView([s.value,l.value],13);let t=(await O(async()=>{let{default:t}=await import(`./leaflet-src-BtX0-WJ4.js`).then(t=>e(t.t(),1));return{default:t}},__vite__mapDeps([0,1]))).default;d?d.setLatLng([s.value,l.value]):d=t.marker([s.value,l.value]).addTo(u)}},e=>{console.error(`Error getting location:`,e),alert(`Unable to get current location. Please check browser permissions.`)}):alert(`Geolocation is not supported by this browser.`)};return n(()=>{p()}),(e,n)=>t.isOpen?(w(),C(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm`,onClick:I(v,[`self`])},[S(`div`,ye,[S(`div`,{class:`flex items-center justify-between p-6 border-b border-stroke-subtle dark:border-stroke/10`},[n[3]||=S(`h3`,{class:`text-xl font-semibold text-content-primary dark:text-content-primary`},` Select Location `,-1),S(`button`,{onClick:v,class:`text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors`},[...n[2]||=[S(`svg`,{class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),S(`div`,be,[S(`div`,{ref_key:`mapContainer`,ref:o,class:`absolute inset-0 rounded-b-[15px] overflow-hidden`},null,512)]),S(`div`,xe,[S(`div`,Se,[S(`div`,null,[n[4]||=S(`label`,{class:`block text-sm font-medium text-content-secondary dark:text-content-muted mb-2`},`Latitude`,-1),m(S(`input`,{"onUpdate:modelValue":n[0]||=e=>s.value=e,type:`number`,step:`0.000001`,class:`w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary focus:outline-none focus:border-primary`,readonly:``},null,512),[[N,s.value,void 0,{number:!0}]])]),S(`div`,null,[n[5]||=S(`label`,{class:`block text-sm font-medium text-content-secondary dark:text-content-muted mb-2`},`Longitude`,-1),m(S(`input`,{"onUpdate:modelValue":n[1]||=e=>l.value=e,type:`number`,step:`0.000001`,class:`w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary focus:outline-none focus:border-primary`,readonly:``},null,512),[[N,l.value,void 0,{number:!0}]])])]),S(`div`,{class:`flex gap-3`},[S(`button`,{onClick:y,class:`flex-1 px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm flex items-center justify-center gap-2`},[...n[6]||=[S(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z`}),S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 11a3 3 0 11-6 0 3 3 0 016 0z`})],-1),b(` Use Current Location `,-1)]]),S(`button`,{onClick:v,class:`px-6 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm`},` Cancel `),S(`button`,{onClick:_,class:`px-6 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm`},` Select Location `)]),n[7]||=S(`p`,{class:`text-content-muted dark:text-content-muted text-xs text-center`},` Click on the map to select a location `,-1)])])])):g(``,!0)}}),[[`__scopeId`,`data-v-fd94857e`]]),we={class:`space-y-4`},Te={key:0,class:`bg-green-100 dark:bg-green-500/10 border border-green-300 dark:border-green-500/30 rounded-lg p-3`},Ee={class:`text-green-700 dark:text-green-400 text-sm`},De={key:1,class:`bg-red-100 dark:bg-red-500/10 border border-red-300 dark:border-red-500/30 rounded-lg p-3`},Oe={class:`text-red-700 dark:text-red-400 text-sm`},ke={class:`flex justify-end gap-2`},Ae=[`disabled`],je=[`disabled`],Me={class:`bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3`},Ne={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Pe={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm break-all`},Fe={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Ie={class:`text-content-primary dark:text-content-primary font-mono text-xs break-all`},Le={class:`flex flex-col sm:flex-row sm:justify-between sm:items-start py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Re={class:`flex flex-col items-end gap-1`},ze={class:`text-content-primary dark:text-content-primary font-mono text-xs break-all sm:text-right sm:max-w-xs`},Be={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Ve={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},He={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Ue={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},We={key:0,class:`flex justify-end`},Ge={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Ke={class:`text-content-primary dark:text-content-primary font-mono text-sm`},qe={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Je={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},Ye={class:`flex flex-col py-2 gap-2`},Xe={class:`flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1`},Ze={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm sm:ml-4`},Qe={key:1,class:`flex items-center gap-2`},$e={class:`bg-surface dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke/20 rounded-[15px] shadow-2xl w-full max-w-md p-6 space-y-4`},et={class:`block text-sm font-medium text-content-secondary dark:text-content-muted mb-2`},tt=[`maxlength`,`disabled`],nt={key:0,class:`text-red-500 text-xs mt-1`},rt={key:1,class:`text-content-muted dark:text-content-muted text-xs mt-1`},it=[`disabled`],at={key:0,class:`mt-2 bg-amber-500/10 border border-amber-500/30 rounded-lg p-3`},ot={key:0,class:`flex items-center gap-3 bg-blue-500/10 border border-blue-500/30 rounded-lg p-3`},st={class:`text-blue-700 dark:text-blue-400 text-xs font-medium`},ct={class:`text-blue-600 dark:text-blue-500 text-xs mt-0.5`},lt={key:1,class:`bg-red-500/10 border border-red-500/30 rounded-lg p-3`},ut={class:`text-red-600 dark:text-red-400 text-sm`},dt={key:2,class:`bg-green-500/10 border border-green-600/40 dark:border-green-500/30 rounded-lg p-3 space-y-2`},ft={class:`text-green-600 dark:text-green-400 text-sm font-medium`},pt={class:`font-mono text-xs break-all text-content-primary dark:text-content-primary`},mt={key:3,class:`bg-amber-500/10 border border-amber-500/30 rounded-lg p-3`},ht={class:`flex gap-2 mt-3`},gt=[`disabled`],_t=[`disabled`],vt={class:`flex justify-end gap-3 mt-6`},yt=[`disabled`],bt=[`disabled`],xt=f({__name:`RepeaterSettings`,setup(e){let t=j(),n=y(()=>t.stats?.config||{}),r=y(()=>n.value.repeater||{}),i=y(()=>t.stats),a=E(!1),o=E(!1),s=E(null),c=E(null),d=E(!1),f=E(``),D=E(0),O=E(0),k=E(0),M=E(1),P=y(()=>n.value.mesh||{});h([n,r,P],()=>{if(!a.value){f.value=n.value.node_name||``,D.value=r.value.latitude||0,O.value=r.value.longitude||0,k.value=r.value.send_advert_interval_hours||0;let e=P.value.path_hash_mode;M.value=e===0||e===1||e===2?e+1:1}},{immediate:!0});let F=y(()=>n.value.node_name||`Not set`),L=y(()=>i.value?.local_hash||`Not available`),R=y(()=>{let e=i.value?.public_key;return!e||e===`Not set`?`Not set`:e}),B=y(()=>{let e=r.value.latitude;return e&&e!==0?e.toFixed(6):`Not set`}),V=y(()=>{let e=r.value.longitude;return e&&e!==0?e.toFixed(6):`Not set`}),H=y(()=>{let e=r.value.mode;return e?e===`no_tx`?`No TX`:e.charAt(0).toUpperCase()+e.slice(1):`Not set`}),U=y(()=>{let e=r.value.send_advert_interval_hours;return e===void 0?`Not set`:e===0?`Disabled`:e+` hour`+(e===1?``:`s`)}),W=y(()=>{let e=P.value.path_hash_mode;return e===0||e===1||e===2?e+1+(e===0?` byte`:` bytes`):`Not set`}),G=()=>{a.value=!0,s.value=null,c.value=null},ee=()=>{a.value=!1,s.value=null,f.value=n.value.node_name||``,D.value=r.value.latitude||0,O.value=r.value.longitude||0,k.value=r.value.send_advert_interval_hours||0;let e=P.value.path_hash_mode;M.value=e===0||e===1||e===2?e+1:1},te=async()=>{o.value=!0,s.value=null,c.value=null;try{let e={};f.value&&(e.node_name=f.value),e.latitude=D.value,e.longitude=O.value,e.flood_advert_interval_hours=k.value,e.path_hash_mode=M.value-1;let n=(await A.post(`/update_radio_config`,e)).data;n.message||n.persisted?(c.value=n.message||`Settings saved successfully`,a.value=!1,await t.fetchStats(),setTimeout(()=>{c.value=null},3e3)):n.error?s.value=n.error:s.value=`Unknown response from server`}catch(e){console.error(`Failed to update repeater settings:`,e),s.value=e.response?.data?.error||`Failed to update settings`}finally{o.value=!1}},ne=()=>{d.value=!0},re=e=>{D.value=e.latitude,O.value=e.longitude},K=E(!1),q=E(``),J=E(!1),Y=E(null),X=E(null),Z=E(!1),Q=E(!1),$=E(!1),ie=E(0),ae=null,oe=y(()=>$.value?8:4),se=y(()=>{let e=q.value.trim();return!e||e.length>oe.value?!1:/^[0-9a-fA-F]+$/.test(e)}),ce=y(()=>{let e=q.value.trim().length;return e===0?``:e===1?`Very fast — ~16 attempts on average`:e===2?`Fast — ~256 attempts on average`:e===3?`Moderate — ~4,096 attempts, a few seconds`:e===4?`Slow — ~65,536 attempts, may take 10-30 seconds`:e===5?`Very slow — ~1 million attempts, could take minutes`:e===6?`Extremely slow — ~16 million attempts, could take a very long time`:e===7?`Extreme — ~268 million attempts, may not complete`:`Extreme — ~4 billion attempts, extremely unlikely to complete`}),le=()=>{ie.value=0,ae=setInterval(()=>{ie.value++},1e3)},ue=()=>{ae&&=(clearInterval(ae),null)};T(()=>ue());let de=()=>{q.value=``,Y.value=null,X.value=null,Z.value=!1,$.value=!1,K.value=!0},fe=async()=>{J.value=!0,X.value=null,Y.value=null,le();try{let e=await A.generateVanityKey(q.value.trim());e.success&&e.data?Y.value=e.data:X.value=e.error||`Generation failed`}catch(e){let t=e;X.value=t.response?.data?.error||t.message||`Generation failed`}finally{ue(),J.value=!1}},pe=async()=>{if(Y.value){Q.value=!0,X.value=null;try{let e=await A.generateVanityKey(q.value.trim(),!0);e.success&&e.data?(Y.value=e.data,Z.value=!1,K.value=!1,c.value=`New identity key applied. Restart the repeater for the change to take effect.`,await t.fetchStats(),setTimeout(()=>{c.value=null},8e3)):X.value=e.error||`Failed to apply key`}catch(e){let t=e;X.value=t.response?.data?.error||t.message||`Failed to apply key`}finally{Q.value=!1}}};return(e,t)=>(w(),C(`div`,we,[c.value?(w(),C(`div`,Te,[S(`p`,Ee,u(c.value),1)])):g(``,!0),s.value?(w(),C(`div`,De,[S(`p`,Oe,u(s.value),1)])):g(``,!0),S(`div`,ke,[a.value?(w(),C(x,{key:1},[S(`button`,{onClick:ee,disabled:o.value,class:`px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed`},` Cancel `,8,Ae),S(`button`,{onClick:te,disabled:o.value,class:`px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed`},u(o.value?`Saving...`:`Save Changes`),9,je)],64)):(w(),C(`button`,{key:0,onClick:G,class:`px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm`},` Edit Settings `))]),S(`div`,Me,[S(`div`,Ne,[t[13]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Node Name`,-1),a.value?m((w(),C(`input`,{key:1,"onUpdate:modelValue":t[0]||=e=>f.value=e,type:`text`,maxlength:`50`,class:`w-full sm:w-64 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`,placeholder:`Enter node name`},null,512)),[[N,f.value]]):(w(),C(`div`,Pe,u(F.value),1))]),S(`div`,Fe,[t[14]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Local Hash`,-1),S(`span`,Ie,u(L.value),1)]),S(`div`,Le,[t[15]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm flex-shrink-0`},`Public Key`,-1),S(`div`,Re,[S(`span`,ze,u(R.value),1),S(`button`,{onClick:de,class:`px-2 py-1 text-xs bg-primary/10 hover:bg-primary/20 text-content-secondary dark:text-content-muted rounded border border-primary/30 transition-colors`},` Generate New Key `)])]),S(`div`,Be,[t[16]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Latitude`,-1),a.value?m((w(),C(`input`,{key:1,"onUpdate:modelValue":t[1]||=e=>D.value=e,type:`number`,step:`0.000001`,min:`-90`,max:`90`,class:`w-full sm:w-48 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512)),[[N,D.value,void 0,{number:!0}]]):(w(),C(`div`,Ve,u(B.value),1))]),S(`div`,He,[t[17]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Longitude`,-1),a.value?m((w(),C(`input`,{key:1,"onUpdate:modelValue":t[2]||=e=>O.value=e,type:`number`,step:`0.000001`,min:`-180`,max:`180`,class:`w-full sm:w-48 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512)),[[N,O.value,void 0,{number:!0}]]):(w(),C(`div`,Ue,u(V.value),1))]),a.value?(w(),C(`div`,We,[S(`button`,{onClick:ne,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm flex items-center gap-2`,title:`Pick location on map`},[...t[18]||=[S(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z`}),S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 11a3 3 0 11-6 0 3 3 0 016 0z`})],-1),b(` Pick Location on Map `,-1)]])])):g(``,!0),S(`div`,Ge,[t[19]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Mode`,-1),S(`span`,Ke,u(H.value),1)]),S(`div`,qe,[t[21]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Path hash length`,-1),a.value?m((w(),C(`select`,{key:1,"onUpdate:modelValue":t[3]||=e=>M.value=e,class:`w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},[...t[20]||=[S(`option`,{value:1},`1 byte`,-1),S(`option`,{value:2},`2 bytes`,-1),S(`option`,{value:3},`3 bytes`,-1)]],512)),[[z,M.value,void 0,{number:!0}]]):(w(),C(`div`,Je,u(W.value),1))]),S(`div`,Ye,[S(`div`,Xe,[t[23]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Periodic Advertisement Interval`,-1),a.value?(w(),C(`div`,Qe,[m(S(`input`,{"onUpdate:modelValue":t[4]||=e=>k.value=e,type:`number`,min:`0`,max:`48`,class:`w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512),[[N,k.value,void 0,{number:!0}]]),t[22]||=S(`span`,{class:`text-content-muted dark:text-content-muted text-sm`},`hours`,-1)])):(w(),C(`div`,Ze,u(U.value),1))]),t[24]||=S(`span`,{class:`text-content-muted dark:text-content-muted text-xs`},`How often the repeater sends an advertisement packet (0 = disabled, 3-48 hours)`,-1)])]),v(Ce,{"is-open":d.value,latitude:D.value,longitude:O.value,onClose:t[5]||=e=>d.value=!1,onSelect:re},null,8,[`is-open`,`latitude`,`longitude`]),(w(),l(p,{to:`body`},[K.value?(w(),C(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm`,onClick:t[12]||=I(e=>K.value=!1,[`self`])},[S(`div`,$e,[t[32]||=S(`h3`,{class:`text-xl font-semibold text-content-primary dark:text-content-primary`},` Generate Vanity Identity Key `,-1),t[33]||=S(`p`,{class:`text-xs text-content-muted dark:text-content-muted`},` Generate a new Ed25519 identity key whose public key starts with your chosen hex prefix (0-9, A-F). Longer prefixes take more time to find. `,-1),S(`div`,null,[S(`label`,et,`Hex Prefix (1-`+u(oe.value)+` characters)`,1),m(S(`input`,{"onUpdate:modelValue":t[6]||=e=>q.value=e,type:`text`,maxlength:oe.value,placeholder:`e.g. F8A1`,disabled:J.value,class:`w-full px-4 py-2 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-400 dark:placeholder-white/40 font-mono text-sm uppercase focus:outline-none focus:border-primary transition-colors disabled:opacity-50`},null,8,tt),[[N,q.value]]),q.value&&!se.value?(w(),C(`p`,nt,` Enter 1-`+u(oe.value)+` valid hex characters (0-9, A-F) `,1)):ce.value?(w(),C(`p`,rt,u(ce.value),1)):g(``,!0)]),S(`div`,null,[S(`button`,{onClick:t[7]||=e=>$.value=!$.value,disabled:J.value,class:`text-xs text-content-muted dark:text-content-muted hover:text-content-secondary dark:hover:text-content-secondary transition-colors disabled:opacity-50 flex items-center gap-1`},[(w(),C(`svg`,{class:_([`w-3 h-3 transition-transform`,{"rotate-90":$.value}]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...t[25]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 5l7 7-7 7`},null,-1)]],2)),t[26]||=b(` Advanced `,-1)],8,it),$.value?(w(),C(`div`,at,[...t[27]||=[S(`p`,{class:`text-amber-600 dark:text-amber-400 text-xs font-medium`},` Extended prefix mode (up to 8 characters) `,-1),S(`p`,{class:`text-amber-600 dark:text-amber-500 text-xs mt-1`},` Prefixes longer than 4 characters require exponentially more attempts and can take a very long time or may not complete at all. The request may time out. `,-1)]])):g(``,!0)]),J.value?(w(),C(`div`,ot,[t[28]||=S(`svg`,{class:`animate-spin h-5 w-5 text-blue-500 flex-shrink-0`,xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`},[S(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`}),S(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})],-1),S(`div`,null,[S(`p`,st,` Searching for key with prefix "`+u(q.value.toUpperCase())+`"... `,1),S(`p`,ct,` Elapsed: `+u(ie.value)+`s `,1)])])):g(``,!0),X.value?(w(),C(`div`,lt,[S(`p`,ut,u(X.value),1)])):g(``,!0),Y.value?(w(),C(`div`,dt,[S(`p`,ft,` Key found in `+u(Y.value.attempts.toLocaleString())+` attempts `,1),S(`div`,null,[t[29]||=S(`span`,{class:`text-xs text-content-muted dark:text-content-muted`},`Public Key:`,-1),S(`p`,pt,u(Y.value.public_hex),1)])])):g(``,!0),Z.value&&Y.value?(w(),C(`div`,mt,[t[30]||=S(`p`,{class:`text-amber-600 dark:text-amber-400 text-sm font-medium`},` Warning: This will replace your current identity key. `,-1),t[31]||=S(`p`,{class:`text-amber-600 dark:text-amber-500 text-xs mt-1`},` Your node address and public key will change. Other nodes will need to re-discover you. This cannot be undone unless you have a backup. `,-1),S(`div`,ht,[S(`button`,{onClick:pe,disabled:Q.value,class:`px-3 py-1.5 bg-red-600 hover:bg-red-700 text-white rounded-lg text-xs transition-colors disabled:opacity-50`},u(Q.value?`Applying...`:`Confirm Replace Key`),9,gt),S(`button`,{onClick:t[8]||=e=>Z.value=!1,disabled:Q.value,class:`px-3 py-1.5 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 text-xs transition-colors`},` Cancel `,8,_t)])])):g(``,!0),S(`div`,vt,[S(`button`,{onClick:t[9]||=e=>K.value=!1,disabled:J.value,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/10 transition-colors`},` Close `,8,yt),Y.value?(w(),C(x,{key:1},[S(`button`,{onClick:t[10]||=e=>{Y.value=null,X.value=null},class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 text-sm transition-colors`},` Try Again `),Z.value?g(``,!0):(w(),C(`button`,{key:0,onClick:t[11]||=e=>Z.value=!0,class:`px-4 py-2 bg-red-600/20 hover:bg-red-600/30 text-red-600 dark:text-red-400 rounded-lg border border-red-500/50 text-sm transition-colors`},` Apply Key `))],64)):(w(),C(`button`,{key:0,onClick:fe,disabled:!se.value||J.value,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 text-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed`},u(J.value?`Generating...`:`Generate`),9,bt))])])])):g(``,!0)]))]))}}),St={class:`space-y-4`},Ct={key:0,class:`bg-green-100 dark:bg-green-500/20 border border-green-500 dark:border-green-500/50 rounded-lg p-3 text-green-700 dark:text-green-400 text-sm`},wt={key:1,class:`bg-red-100 dark:bg-red-500/20 border border-red-500 dark:border-red-500/50 rounded-lg p-3 text-red-700 dark:text-red-400 text-sm`},Tt={class:`flex justify-end gap-2`},Et=[`disabled`],Dt=[`disabled`],Ot={class:`bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3`},kt={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},At={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},jt={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1`},Mt={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},Nt=f({__name:`DutyCycle`,setup(e){let t=j(),n=y(()=>t.stats?.config?.duty_cycle||{}),r=y(()=>{let e=n.value.max_airtime_percent;return typeof e==`number`?e.toFixed(1)+`%`:e&&typeof e==`object`&&`parsedValue`in e?(e.parsedValue||0).toFixed(1)+`%`:`Not set`}),i=y(()=>n.value.enforcement_enabled?`Enabled`:`Disabled`),a=E(!1),o=E(!1),s=E(``),c=E(``),l=E(0),d=E(!0),f=()=>{let e=n.value.max_airtime_percent;typeof e==`number`?l.value=e:e&&typeof e==`object`&&`parsedValue`in e?l.value=e.parsedValue||0:l.value=6,d.value=n.value.enforcement_enabled!==!1,a.value=!0,s.value=``,c.value=``},p=()=>{a.value=!1,s.value=``,c.value=``},h=async()=>{o.value=!0,c.value=``,s.value=``;try{let e=(await k.post(`/api/update_duty_cycle_config`,{max_airtime_percent:l.value,enforcement_enabled:d.value})).data;e.message||e.persisted?(s.value=e.message||`Settings saved successfully`,a.value=!1,await t.fetchStats(),setTimeout(()=>{s.value=``},3e3)):c.value=`Failed to save settings`}catch(e){console.error(`Failed to save duty cycle settings:`,e),c.value=e.response?.data?.error||`Failed to save settings`}finally{o.value=!1}};return(e,t)=>(w(),C(`div`,St,[s.value?(w(),C(`div`,Ct,u(s.value),1)):g(``,!0),c.value?(w(),C(`div`,wt,u(c.value),1)):g(``,!0),S(`div`,Tt,[a.value?(w(),C(x,{key:1},[S(`button`,{onClick:p,disabled:o.value,class:`px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed`},` Cancel `,8,Et),S(`button`,{onClick:h,disabled:o.value,class:`px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed`},u(o.value?`Saving...`:`Save Changes`),9,Dt)],64)):(w(),C(`button`,{key:0,onClick:f,class:`px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm`},` Edit Settings `))]),S(`div`,Ot,[S(`div`,kt,[t[2]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Max Airtime %`,-1),a.value?m((w(),C(`input`,{key:1,"onUpdate:modelValue":t[0]||=e=>l.value=e,type:`number`,step:`0.1`,min:`0.1`,max:`100`,class:`w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512)),[[N,l.value,void 0,{number:!0}]]):(w(),C(`div`,At,u(r.value),1))]),S(`div`,jt,[t[4]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Enforcement`,-1),a.value?m((w(),C(`select`,{key:1,"onUpdate:modelValue":t[1]||=e=>d.value=e,class:`w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},[...t[3]||=[S(`option`,{value:!0},`Enabled`,-1),S(`option`,{value:!1},`Disabled`,-1)]],512)),[[z,d.value]]):(w(),C(`div`,Mt,u(i.value),1))])])]))}}),Pt={class:`space-y-4`},Ft={key:0,class:`bg-green-100 dark:bg-green-500/20 border border-green-500 dark:border-green-500/50 rounded-lg p-3 text-green-700 dark:text-green-400 text-sm`},It={key:1,class:`bg-red-100 dark:bg-red-500/20 border border-red-500 dark:border-red-500/50 rounded-lg p-3 text-red-700 dark:text-red-400 text-sm`},Lt={class:`flex justify-end gap-2`},Rt=[`disabled`],zt=[`disabled`],Bt={class:`bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3`},Vt={class:`flex flex-col py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-2`},Ht={class:`flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1`},Ut={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm sm:ml-4`},Wt={class:`flex flex-col py-2 gap-2`},Gt={class:`flex flex-col sm:flex-row sm:justify-between sm:items-start gap-1`},Kt={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm sm:ml-4`},qt=f({__name:`TransmissionDelays`,setup(e){let t=j(),n=y(()=>t.stats?.config?.delays||{}),r=y(()=>{let e=n.value.tx_delay_factor;if(e&&typeof e==`object`&&e&&`parsedValue`in e){let t=e.parsedValue;if(typeof t==`number`)return t.toFixed(2)+`x`}return`Not set`}),i=y(()=>{let e=n.value.direct_tx_delay_factor;return typeof e==`number`?e.toFixed(2)+`s`:`Not set`}),a=E(!1),o=E(!1),s=E(``),c=E(``),l=E(0),d=E(0),f=()=>{let e=n.value.tx_delay_factor;e&&typeof e==`object`&&`parsedValue`in e?l.value=e.parsedValue||1:typeof e==`number`?l.value=e:l.value=1;let t=n.value.direct_tx_delay_factor;d.value=typeof t==`number`?t:.5,a.value=!0,s.value=``,c.value=``},p=()=>{a.value=!1,s.value=``,c.value=``},h=async()=>{o.value=!0,c.value=``,s.value=``;try{let e=(await k.post(`/api/update_radio_config`,{tx_delay_factor:l.value,direct_tx_delay_factor:d.value})).data;e.message||e.persisted?(s.value=e.message||`Settings saved successfully`,a.value=!1,await t.fetchStats(),setTimeout(()=>{s.value=``},3e3)):c.value=`Failed to save settings`}catch(e){console.error(`Failed to save delay settings:`,e),c.value=e.response?.data?.error||`Failed to save settings`}finally{o.value=!1}};return(e,t)=>(w(),C(`div`,Pt,[s.value?(w(),C(`div`,Ft,u(s.value),1)):g(``,!0),c.value?(w(),C(`div`,It,u(c.value),1)):g(``,!0),S(`div`,Lt,[a.value?(w(),C(x,{key:1},[S(`button`,{onClick:p,disabled:o.value,class:`px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed`},` Cancel `,8,Rt),S(`button`,{onClick:h,disabled:o.value,class:`px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed`},u(o.value?`Saving...`:`Save Changes`),9,zt)],64)):(w(),C(`button`,{key:0,onClick:f,class:`px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm`},` Edit Settings `))]),S(`div`,Bt,[S(`div`,Vt,[S(`div`,Ht,[t[2]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Flood TX Delay Factor`,-1),a.value?m((w(),C(`input`,{key:1,"onUpdate:modelValue":t[0]||=e=>l.value=e,type:`number`,step:`0.1`,min:`0`,max:`5`,class:`w-full sm:w-32 px-3 py-1.5 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512)),[[N,l.value,void 0,{number:!0}]]):(w(),C(`div`,Ut,u(r.value),1))]),t[3]||=S(`span`,{class:`text-content-muted dark:text-content-muted text-xs`},`Multiplier for flood packet transmission delays (collision avoidance)`,-1)]),S(`div`,Wt,[S(`div`,Gt,[t[4]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Direct TX Delay Factor`,-1),a.value?m((w(),C(`input`,{key:1,"onUpdate:modelValue":t[1]||=e=>d.value=e,type:`number`,step:`0.1`,min:`0`,max:`5`,class:`w-full sm:w-32 px-3 py-1.5 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512)),[[N,d.value,void 0,{number:!0}]]):(w(),C(`div`,Kt,u(i.value),1))]),t[5]||=S(`span`,{class:`text-content-muted dark:text-content-muted text-xs`},`Base delay for direct-routed packet transmission (seconds)`,-1)])])]))}}),Jt=D(`treeState`,()=>{let e=a(new Set),t=a({value:null}),n=t=>{e.add(t)},r=t=>{e.delete(t)};return{expandedNodes:e,selectedNodeId:t,addExpandedNode:n,removeExpandedNode:r,isNodeExpanded:t=>e.has(t),setSelectedNode:e=>{t.value=e},toggleExpanded:t=>{e.has(t)?r(t):n(t)}}}),Yt={class:`select-none`},Xt={class:`flex-shrink-0`},Zt={key:0,class:`w-3.5 h-3.5 sm:w-4 sm:h-4 text-secondary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Qt={key:1,class:`w-3.5 h-3.5 sm:w-4 sm:h-4 text-accent-green`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},$t={key:0,class:`hidden sm:flex items-center gap-1 ml-2`},en={class:`relative group`},tn=[`title`],nn={key:0,class:`text-xs font-mono text-white/50 bg-white/5 px-1.5 py-0.5 rounded border border-white/10`},rn={class:`flex justify-between items-start mb-4`},an={class:`bg-black/20 border border-white/10 rounded-md p-4 mb-4`},on={class:`text-sm font-mono text-white/80 break-all leading-relaxed`},sn={class:`flex items-center gap-1 sm:gap-2 ml-auto flex-shrink-0`},cn={key:0,class:`hidden sm:flex items-center gap-1`},ln=[`title`],un={key:1,class:`hidden sm:flex items-center gap-1`},dn={key:2,class:`hidden sm:inline-block px-2 py-1 bg-white/10 text-white/60 text-xs rounded-full ml-1`},fn={key:0,class:`space-y-1`},pn=M(f({__name:`TreeNode`,props:{node:{},selectedNodeId:{},level:{},disabled:{type:Boolean}},emits:[`select`],setup(e,{emit:n}){let a=e,o=n,s=Jt(),c=E(!1),d=y({get:()=>s.isNodeExpanded(a.node.id),set:e=>{e?s.addExpandedNode(a.node.id):s.removeExpandedNode(a.node.id)}}),f=y(()=>a.node.children.length>0);function p(e){if(!e)return`Never`;let t=new Date().getTime()-e.getTime(),n=Math.floor(t/(1e3*60)),r=Math.floor(t/(1e3*60*60)),i=Math.floor(t/(1e3*60*60*24)),a=Math.floor(i/365);return n<60?`${n}m ago`:r<24?`${r}h ago`:i<365?`${i}d ago`:`${a}y ago`}function m(e){return e?e.length<=16?e:`${e.slice(0,8)}...${e.slice(-8)}`:`No key`}function h(){f.value&&(d.value=!d.value)}function T(){o(`select`,a.node.id)}function D(e){o(`select`,e)}function O(e){e.stopPropagation(),c.value=!c.value}function k(e){e.stopPropagation(),a.node.transport_key&&window.navigator?.clipboard&&window.navigator.clipboard.writeText(a.node.transport_key)}return(n,o)=>{let s=r(`TreeNode`,!0);return w(),C(`div`,Yt,[S(`div`,{class:_([`flex flex-wrap sm:flex-nowrap items-start sm:items-center gap-1 sm:gap-2 py-2 px-2 sm:px-3 rounded-lg cursor-pointer transition-all duration-200`,a.disabled?`opacity-50 cursor-not-allowed`:`hover:bg-white/5`,e.selectedNodeId===e.node.id&&!a.disabled?`bg-primary/20 text-primary`:`text-white/80 hover:text-white`,`ml-${e.level*4}`]),onClick:o[3]||=e=>!a.disabled&&T()},[S(`div`,{class:`flex-shrink-0 w-3 h-3 sm:w-4 sm:h-4 flex items-center justify-center`,onClick:I(h,[`stop`])},[f.value?(w(),C(`svg`,{key:0,class:_([`w-2.5 h-2.5 sm:w-3 sm:h-3 transition-transform duration-200`,d.value?`rotate-90`:`rotate-0`]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...o[4]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 5l7 7-7 7`},null,-1)]],2)):g(``,!0)]),S(`div`,Xt,[a.node.name.startsWith(`#`)?(w(),C(`svg`,Zt,[...o[5]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M7 20l4-16m2 16l4-16M6 9h14M4 15h14`},null,-1)]])):(w(),C(`svg`,Qt,[...o[6]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z`},null,-1)]]))]),S(`span`,{class:_([`font-mono text-xs sm:text-sm transition-colors duration-200 break-all`,e.selectedNodeId===e.node.id?`text-primary font-medium`:``])},u(e.node.name),3),e.node.transport_key?(w(),C(`div`,$t,[S(`div`,en,[S(`button`,{onClick:O,class:`p-1 rounded hover:bg-white/10 transition-colors`,title:c.value?`Hide full key`:`Show full key`},[...o[7]||=[S(`svg`,{class:`w-3 h-3 text-white/60 hover:text-white/80`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 12a3 3 0 11-6 0 3 3 0 016 0z`}),S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z`})],-1)]],8,tn),c.value?g(``,!0):(w(),C(`span`,nn,u(m(e.node.transport_key)),1)),c.value?(w(),C(`div`,{key:1,class:`fixed inset-0 z-[9998] flex items-center justify-center bg-black/70 backdrop-blur-md`,onClick:o[2]||=e=>c.value=!1},[S(`div`,{class:`bg-black/20 border border-white/20 rounded-lg shadow-lg p-6 max-w-2xl w-full mx-4`,onClick:o[1]||=I(()=>{},[`stop`])},[S(`div`,rn,[o[9]||=S(`h3`,{class:`text-lg font-semibold text-white`},`Transport Key`,-1),S(`button`,{onClick:o[0]||=e=>c.value=!1,class:`text-white/60 hover:text-white transition-colors`},[...o[8]||=[S(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),S(`div`,an,[S(`div`,on,u(e.node.transport_key),1)]),S(`div`,{class:`flex justify-end`},[S(`button`,{onClick:k,class:`px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green rounded-lg transition-colors flex items-center gap-2`,title:`Copy to clipboard`},[...o[10]||=[S(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z`})],-1),b(` Copy Key `,-1)]])])])])):g(``,!0)])])):g(``,!0),S(`div`,sn,[e.node.last_used?(w(),C(`div`,cn,[o[11]||=S(`svg`,{class:`w-3 h-3 text-white/40`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})],-1),S(`span`,{class:`text-xs text-white/50`,title:e.node.last_used.toLocaleString()},u(p(e.node.last_used)),9,ln)])):(w(),C(`div`,un,[...o[12]||=[S(`svg`,{class:`w-3 h-3 text-white/30`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})],-1),S(`span`,{class:`text-xs text-white/30 italic`},`Never`,-1)]])),S(`span`,{class:_([`px-1.5 sm:px-2 py-0.5 text-[10px] sm:text-xs font-medium rounded-md transition-colors`,e.node.floodPolicy===`allow`?`bg-accent-green/10 text-accent-green/90 border border-accent-green/20`:`bg-accent-red/10 text-accent-red/90 border border-accent-red/20`])},u(e.node.floodPolicy===`allow`?`ALLOW`:`DENY`),3),f.value?(w(),C(`span`,dn,` > `+u(e.node.children.length),1)):g(``,!0)])],2),v(R,{"enter-active-class":`transition-all duration-300 ease-out`,"enter-from-class":`opacity-0 max-h-0 overflow-hidden`,"enter-to-class":`opacity-100 max-h-screen overflow-visible`,"leave-active-class":`transition-all duration-300 ease-in`,"leave-from-class":`opacity-100 max-h-screen overflow-visible`,"leave-to-class":`opacity-0 max-h-0 overflow-hidden`},{default:t(()=>[d.value&&e.node.children.length>0?(w(),C(`div`,fn,[(w(!0),C(x,null,i(e.node.children,t=>(w(),l(s,{key:t.id,node:t,"selected-node-id":e.selectedNodeId,level:e.level+1,disabled:a.disabled,onSelect:D},null,8,[`node`,`selected-node-id`,`level`,`disabled`]))),128))])):g(``,!0)]),_:1})])}}}),[[`__scopeId`,`data-v-ed9c8a11`]]),mn={class:`flex items-center justify-between mb-6`},hn={class:`text-content-secondary dark:text-content-muted text-sm mt-1`},gn={key:0},_n={class:`text-primary font-mono`},vn={key:1},yn={for:`keyName`,class:`block text-sm font-medium text-white mb-2`},bn={class:`flex items-center gap-2`},xn={key:0,class:`w-4 h-4 text-secondary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Sn={key:1,class:`w-4 h-4 text-accent-green`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Cn={class:`bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4`},wn={class:`flex items-center gap-3 mb-2`},Tn={class:`flex items-center gap-2`},En={key:0,class:`w-5 h-5 text-secondary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Dn={key:1,class:`w-5 h-5 text-accent-green`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},On={class:`text-content-secondary dark:text-content-muted text-sm`},kn={class:`grid grid-cols-2 gap-3`},An={class:`relative cursor-pointer group`},jn={class:`relative cursor-pointer group`},Mn={class:`flex gap-3 pt-4`},Nn=[`disabled`],Pn=f({__name:`AddKeyModal`,props:{show:{type:Boolean},selectedNodeName:{},selectedNodeId:{}},emits:[`close`,`add`],setup(e,{emit:t}){let n=e,r=t,i=E(``),a=E(``),o=E(`allow`),s=y(()=>i.value.startsWith(`#`)),c=y(()=>({type:s.value?`Region`:`Private Key`,description:s.value?`Regional organizational key`:`Individual assigned key`}));h(s,e=>{e?a.value=`This will create a new region for organizing keys`:a.value=`This will create a new private key entry`},{immediate:!0});let l=y(()=>i.value.trim().length>0),f=()=>{l.value&&(r(`add`,{name:i.value.trim(),floodPolicy:o.value,parentId:n.selectedNodeId}),i.value=``,a.value=``,o.value=`allow`)},p=()=>{i.value=``,a.value=``,o.value=`allow`,r(`close`)},v=e=>{e.target===e.currentTarget&&p()};return(t,r)=>e.show?(w(),C(`div`,{key:0,onClick:v,class:`fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4`,style:{"backdrop-filter":`blur(8px) saturate(180%)`,position:`fixed`,top:`0`,left:`0`,right:`0`,bottom:`0`}},[S(`div`,{class:`bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10`,onClick:r[3]||=I(()=>{},[`stop`])},[S(`div`,mn,[S(`div`,null,[r[5]||=S(`h3`,{class:`text-xl font-semibold text-content-primary dark:text-content-primary`},` Add New Entry `,-1),S(`p`,hn,[n.selectedNodeName?(w(),C(`span`,gn,[r[4]||=b(` Add to: `,-1),S(`span`,_n,u(n.selectedNodeName),1)])):(w(),C(`span`,vn,` Add to root level (#uk) `))])]),S(`button`,{onClick:p,class:`text-white/60 hover:text-white transition-colors`},[...r[6]||=[S(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),S(`form`,{onSubmit:I(f,[`prevent`]),class:`space-y-4`},[S(`div`,null,[S(`label`,yn,[S(`div`,bn,[s.value?(w(),C(`svg`,xn,[...r[7]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M7 20l4-16m2 16l4-16M6 9h14M4 15h14`},null,-1)]])):(w(),C(`svg`,Sn,[...r[8]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z`},null,-1)]])),r[9]||=b(` Region/Key Name `,-1)])]),m(S(`input`,{id:`keyName`,"onUpdate:modelValue":r[0]||=e=>i.value=e,type:`text`,placeholder:`Enter name (prefix with # for regions)`,class:`w-full px-4 py-3 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors`,autocomplete:`off`},null,512),[[N,i.value]])]),S(`div`,Cn,[S(`div`,wn,[S(`div`,Tn,[s.value?(w(),C(`svg`,En,[...r[10]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M7 20l4-16m2 16l4-16M6 9h14M4 15h14`},null,-1)]])):(w(),C(`svg`,Dn,[...r[11]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1221 9z`},null,-1)]])),S(`span`,{class:_([s.value?`text-secondary`:`text-accent-green`,`font-medium`])},u(c.value.type),3)]),S(`div`,{class:_([`flex-1 h-px`,s.value?`bg-secondary/20`:`bg-accent-green/20`])},null,2)]),S(`p`,On,u(c.value.description),1)]),S(`div`,null,[r[14]||=S(`label`,{class:`block text-sm font-medium text-content-primary dark:text-content-primary mb-3`},[S(`div`,{class:`flex items-center gap-2`},[S(`svg`,{class:`w-4 h-4 text-primary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})]),b(` Flood Policy `)])],-1),S(`div`,kn,[S(`label`,An,[m(S(`input`,{type:`radio`,"onUpdate:modelValue":r[1]||=e=>o.value=e,value:`allow`,class:`sr-only`},null,512),[[F,o.value]]),r[12]||=d(`
Allow

Permit flooding

`,1)]),S(`label`,jn,[m(S(`input`,{type:`radio`,"onUpdate:modelValue":r[2]||=e=>o.value=e,value:`deny`,class:`sr-only`},null,512),[[F,o.value]]),r[13]||=d(`
Deny

Block flooding

`,1)])])]),S(`div`,Mn,[S(`button`,{type:`button`,onClick:p,class:`flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors`},` Cancel `),S(`button`,{type:`submit`,disabled:!l.value,class:_([`flex-1 px-4 py-3 rounded-lg transition-colors font-medium`,l.value?`bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green`:`bg-background-mute dark:bg-stroke/5 border border-stroke-subtle dark:border-stroke/20 text-content-muted dark:text-content-muted cursor-not-allowed`])},` Add `+u(c.value.type),11,Nn)])],32)])])):g(``,!0)}}),Fn={class:`flex items-center justify-between mb-6`},In={class:`text-content-secondary dark:text-content-muted text-sm mt-1`},Ln={class:`text-primary font-mono`},Rn={for:`keyName`,class:`block text-sm font-medium text-content-secondary dark:text-content-primary mb-2`},zn={class:`flex items-center gap-2`},Bn={key:0,class:`w-4 h-4 text-secondary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Vn={key:1,class:`w-4 h-4 text-accent-green`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Hn={class:`bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4`},Un={class:`flex items-center gap-3 mb-2`},Wn={class:`flex items-center gap-2`},Gn={key:0,class:`w-5 h-5 text-secondary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Kn={key:1,class:`w-5 h-5 text-accent-green`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},qn={class:`text-content-secondary dark:text-content-muted text-sm`},Jn={key:0,class:`space-y-4`},Yn={key:0,class:`bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4`},Xn={class:`bg-background-mute dark:bg-black/20 border border-stroke-subtle dark:border-stroke/10 rounded-md p-3`},Zn={class:`text-xs font-mono text-content-primary dark:text-content-primary/80 break-all`},Qn={key:1,class:`bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4`},$n={class:`flex items-center justify-between`},er={class:`text-sm text-content-secondary dark:text-content-muted`},tr={class:`text-xs text-content-muted dark:text-content-muted`},nr={class:`grid grid-cols-2 gap-3`},rr={class:`relative cursor-pointer group`},ir={class:`relative cursor-pointer group`},ar={class:`flex gap-3 pt-4`},or=[`disabled`],sr=f({__name:`EditKeyModal`,props:{show:{type:Boolean},node:{}},emits:[`close`,`save`,`request-delete`],setup(e,{emit:t}){let n=e,r=t,i=E(``),a=E(`allow`),o=y(()=>i.value.startsWith(`#`)),s=y(()=>({type:o.value?`Region`:`Private Key`,description:o.value?`Regional organizational key`:`Individual assigned key`}));h(()=>n.node,e=>{e?(i.value=e.name,a.value=e.floodPolicy):(i.value=``,a.value=`allow`)},{immediate:!0});let c=y(()=>i.value.trim().length>0&&n.node),l=e=>{let t=new Date().getTime()-e.getTime(),n=Math.floor(t/(1e3*60)),r=Math.floor(t/(1e3*60*60)),i=Math.floor(t/(1e3*60*60*24)),a=Math.floor(i/365);return n<60?`${n}m ago`:r<24?`${r}h ago`:i<365?`${i}d ago`:`${a}y ago`},f=e=>{window.navigator?.clipboard&&window.navigator.clipboard.writeText(e)},p=()=>{!c.value||!n.node||(r(`save`,{id:n.node.id,name:i.value.trim(),floodPolicy:a.value}),x())},v=()=>{n.node&&(r(`request-delete`,n.node),x())},x=()=>{r(`close`)},T=e=>{e.target===e.currentTarget&&x()};return(t,n)=>e.show?(w(),C(`div`,{key:0,onClick:T,class:`fixed inset-0 bg-black/50 backdrop-blur-lg z-[99999] flex items-center justify-center p-4`,style:{"backdrop-filter":`blur(8px) saturate(180%)`,position:`fixed`,top:`0`,left:`0`,right:`0`,bottom:`0`}},[S(`div`,{class:`bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-lg border border-stroke-subtle dark:border-white/10`,onClick:n[4]||=I(()=>{},[`stop`])},[S(`div`,Fn,[S(`div`,null,[n[6]||=S(`h3`,{class:`text-xl font-semibold text-content-primary dark:text-content-primary`},` Edit Entry `,-1),S(`p`,In,[n[5]||=b(` Modify `,-1),S(`span`,Ln,u(e.node?.name),1)])]),S(`button`,{onClick:x,class:`text-white/60 hover:text-white transition-colors`},[...n[7]||=[S(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),S(`form`,{onSubmit:I(p,[`prevent`]),class:`space-y-4`},[S(`div`,null,[S(`label`,Rn,[S(`div`,zn,[o.value?(w(),C(`svg`,Bn,[...n[8]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M7 20l4-16m2 16l4-16M6 9h14M4 15h14`},null,-1)]])):(w(),C(`svg`,Vn,[...n[9]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z`},null,-1)]])),n[10]||=b(` Region/Key Name `,-1)])]),m(S(`input`,{id:`keyName`,"onUpdate:modelValue":n[0]||=e=>i.value=e,type:`text`,placeholder:`Enter name (prefix with # for regions)`,class:`w-full px-4 py-3 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors`,autocomplete:`off`},null,512),[[N,i.value]])]),S(`div`,Hn,[S(`div`,Un,[S(`div`,Wn,[o.value?(w(),C(`svg`,Gn,[...n[11]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M7 20l4-16m2 16l4-16M6 9h14M4 15h14`},null,-1)]])):(w(),C(`svg`,Kn,[...n[12]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z`},null,-1)]])),S(`span`,{class:_([o.value?`text-secondary`:`text-accent-green`,`font-medium`])},u(s.value.type),3)]),S(`div`,{class:_([`flex-1 h-px`,o.value?`bg-secondary/20`:`bg-accent-green/20`])},null,2)]),S(`p`,qn,u(s.value.description),1)]),e.node?(w(),C(`div`,Jn,[e.node.transport_key?(w(),C(`div`,Yn,[n[14]||=d(`
Transport Key
`,1),S(`div`,Xn,[S(`div`,Zn,u(e.node.transport_key),1),S(`button`,{onClick:n[1]||=t=>f(e.node.transport_key||``),class:`mt-2 text-xs text-accent-green hover:text-accent-green/80 flex items-center gap-1`,title:`Copy to clipboard`},[...n[13]||=[S(`svg`,{class:`w-3 h-3`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z`})],-1),b(` Copy Key `,-1)]])])])):g(``,!0),e.node.last_used?(w(),C(`div`,Qn,[n[15]||=S(`div`,{class:`flex items-center gap-2 mb-3`},[S(`svg`,{class:`w-4 h-4 text-primary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})]),S(`span`,{class:`text-sm font-medium text-content-primary dark:text-content-primary`},`Last Used`)],-1),S(`div`,$n,[S(`div`,er,u(e.node.last_used.toLocaleDateString())+` at `+u(e.node.last_used.toLocaleTimeString()),1),S(`div`,tr,u(l(e.node.last_used)),1)])])):g(``,!0)])):g(``,!0),S(`div`,null,[n[18]||=S(`label`,{class:`block text-sm font-medium text-content-secondary dark:text-content-primary mb-3`},[S(`div`,{class:`flex items-center gap-2`},[S(`svg`,{class:`w-4 h-4 text-primary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`})]),b(` Flood Policy `)])],-1),S(`div`,nr,[S(`label`,rr,[m(S(`input`,{type:`radio`,"onUpdate:modelValue":n[2]||=e=>a.value=e,value:`allow`,class:`sr-only`},null,512),[[F,a.value]]),n[16]||=d(`
Allow

Permit flooding

`,1)]),S(`label`,ir,[m(S(`input`,{type:`radio`,"onUpdate:modelValue":n[3]||=e=>a.value=e,value:`deny`,class:`sr-only`},null,512),[[F,a.value]]),n[17]||=d(`
Deny

Block flooding

`,1)])])]),S(`div`,ar,[S(`button`,{type:`button`,onClick:v,class:`px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors`},` Delete `),S(`button`,{type:`button`,onClick:x,class:`flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors`},` Cancel `),S(`button`,{type:`submit`,disabled:!c.value,class:_([`flex-1 px-4 py-3 rounded-lg transition-colors font-medium`,c.value?`bg-accent-green/20 hover:bg-accent-green/30 border border-accent-green/50 text-accent-green`:`bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 text-content-muted dark:text-content-muted/70 cursor-not-allowed`])},` Save Changes `,10,or)])],32)])])):g(``,!0)}}),cr={class:`flex items-center gap-3 mb-6`},lr={class:`text-content-secondary dark:text-content-muted text-sm mt-1`},ur={class:`text-accent-red font-mono`},dr={key:0,class:`bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6`},fr={class:`flex items-start gap-3`},pr={class:`flex-1`},mr={class:`text-accent-red font-medium text-sm mb-2`},hr={class:`space-y-1 max-h-32 overflow-y-auto`},gr={key:0,class:`w-3 h-3 text-secondary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},_r={key:1,class:`w-3 h-3 text-accent-green`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},vr={class:`font-mono`},yr={key:0,class:`text-content-secondary dark:text-content-muted text-xs`},br={key:1,class:`mb-6`},xr={class:`mb-3`},Sr={class:`relative`},Cr={class:`space-y-2 max-h-40 overflow-y-auto border border-stroke-subtle dark:border-stroke/20 rounded-lg p-3 bg-gray-50 dark:bg-white/5`},wr={key:0,class:`text-center py-4 text-content-secondary dark:text-content-muted text-sm`},Tr={class:`relative`},Er=[`value`],Dr={class:`flex items-center gap-2 flex-1`},Or={class:`text-content-primary dark:text-content-primary font-mono text-sm`},kr={key:0,class:`ml-auto px-2 py-0.5 bg-background-mute dark:bg-stroke/10 text-content-secondary dark:text-content-muted text-xs rounded-full`},Ar={class:`flex gap-3`},jr=f({__name:`DeleteConfirmModal`,props:{show:{type:Boolean},node:{},allNodes:{}},emits:[`close`,`delete-all`,`move-children`],setup(e,{emit:t}){let n=e,r=t,a=E(null),o=E(``),s=e=>{let t=[],n=e=>{for(let r of e.children)t.push(r),n(r)};return n(e),t},c=y(()=>n.node?s(n.node):[]),l=y(()=>{if(!n.node)return[];let e=new Set([n.node.id,...c.value.map(e=>e.id)]),t=n=>{let r=[];for(let i of n)i.name.startsWith(`#`)&&!e.has(i.id)&&r.push(i),i.children.length>0&&r.push(...t(i.children));return r};return t(n.allNodes)}),d=y(()=>{if(!o.value.trim())return l.value;let e=o.value.toLowerCase();return l.value.filter(t=>t.name.toLowerCase().includes(e))}),f=()=>{n.node&&(r(`delete-all`,n.node.id),h())},p=()=>{!n.node||!a.value||(r(`move-children`,{nodeId:n.node.id,targetParentId:a.value}),h())},h=()=>{a.value=null,o.value=``,r(`close`)},v=e=>{e.target===e.currentTarget&&h()};return(t,n)=>e.show&&e.node?(w(),C(`div`,{key:0,onClick:v,class:`fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4`,style:{"backdrop-filter":`blur(8px) saturate(180%)`,position:`fixed`,top:`0`,left:`0`,right:`0`,bottom:`0`}},[S(`div`,{class:`bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-lg border border-stroke-subtle dark:border-white/10`,onClick:n[2]||=I(()=>{},[`stop`])},[S(`div`,cr,[n[6]||=S(`svg`,{class:`w-6 h-6 text-accent-red`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z`})],-1),S(`div`,null,[n[4]||=S(`h3`,{class:`text-xl font-semibold text-content-primary dark:text-content-primary`},` Confirm Deletion `,-1),S(`p`,lr,[n[3]||=b(` Deleting `,-1),S(`span`,ur,u(e.node?.name),1)])]),S(`button`,{onClick:h,class:`ml-auto text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors`},[...n[5]||=[S(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),c.value.length>0?(w(),C(`div`,dr,[S(`div`,fr,[n[9]||=S(`svg`,{class:`w-5 h-5 text-accent-red flex-shrink-0 mt-0.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})],-1),S(`div`,pr,[S(`h4`,mr,` This will affect `+u(c.value.length)+` child `+u(c.value.length===1?`entry`:`entries`)+`: `,1),S(`div`,hr,[(w(!0),C(x,null,i(c.value.slice(0,10),e=>(w(),C(`div`,{key:e.id,class:`flex items-center gap-2 text-xs text-content-secondary dark:text-content-primary/80`},[e.name.startsWith(`#`)?(w(),C(`svg`,gr,[...n[7]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M7 20l4-16m2 16l4-16M6 9h14M4 15h14`},null,-1)]])):(w(),C(`svg`,_r,[...n[8]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1721 9z`},null,-1)]])),S(`span`,vr,u(e.name),1),S(`span`,{class:_([`px-1 py-0.5 text-xs rounded`,e.floodPolicy===`allow`?`bg-accent-green/20 text-accent-green`:`bg-accent-red/20 text-accent-red`])},u(e.floodPolicy),3)]))),128)),c.value.length>10?(w(),C(`div`,yr,` ...and `+u(c.value.length-10)+` more `,1)):g(``,!0)])])])])):g(``,!0),c.value.length>0&&l.value.length>0?(w(),C(`div`,br,[n[13]||=S(`h4`,{class:`text-content-primary dark:text-content-primary font-medium text-sm mb-3`},` Move children to another region: `,-1),S(`div`,xr,[S(`div`,Sr,[n[10]||=S(`svg`,{class:`absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-content-muted dark:text-content-muted`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`})],-1),m(S(`input`,{"onUpdate:modelValue":n[0]||=e=>o.value=e,type:`text`,placeholder:`Search regions...`,class:`w-full pl-9 pr-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/20 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/50 focus:outline-none focus:border-primary focus:ring-2 focus:ring-primary/20 transition-colors text-sm`},null,512),[[N,o.value]])])]),S(`div`,Cr,[d.value.length===0?(w(),C(`div`,wr,u(o.value?`No regions match your search`:`No available regions`),1)):g(``,!0),(w(!0),C(x,null,i(d.value,e=>(w(),C(`label`,{key:e.id,class:`flex items-center gap-3 p-2 rounded cursor-pointer hover:bg-stroke-subtle dark:hover:bg-white/10 transition-colors group`},[S(`div`,Tr,[m(S(`input`,{type:`radio`,value:e.id,"onUpdate:modelValue":n[1]||=e=>a.value=e,class:`sr-only peer`},null,8,Er),[[F,a.value]]),n[11]||=S(`div`,{class:`w-4 h-4 border-2 border-stroke dark:border-stroke/30 rounded-full group-hover:border-stroke dark:group-hover:border-stroke/50 peer-checked:border-primary peer-checked:bg-primary/20 transition-all`},[S(`div`,{class:`w-2 h-2 rounded-full bg-primary scale-0 peer-checked:scale-100 transition-transform absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2`})],-1)]),S(`div`,Dr,[n[12]||=S(`svg`,{class:`w-4 h-4 text-secondary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M7 20l4-16m2 16l4-16M6 9h14M4 15h14`})],-1),S(`span`,Or,u(e.name),1),e.children.length>0?(w(),C(`span`,kr,u(e.children.length),1)):g(``,!0)])]))),128))])])):g(``,!0),S(`div`,Ar,[S(`button`,{onClick:h,class:`flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors`},` Cancel `),c.value.length>0&&a.value?(w(),C(`button`,{key:0,onClick:p,class:`flex-1 px-4 py-3 bg-primary/20 hover:bg-primary/30 border border-primary/50 text-primary rounded-lg transition-colors`},` Move & Delete `)):g(``,!0),S(`button`,{onClick:f,class:`flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium`},u(c.value.length>0?`Delete All`:`Delete`),1)])])])):g(``,!0)}}),Mr={class:`space-y-4 sm:space-y-6`},Nr={class:`flex flex-col sm:flex-row sm:justify-between sm:items-start gap-3`},Pr={class:`flex gap-2 flex-wrap`},Fr=[`disabled`],Ir=[`disabled`],Lr={class:`glass-card rounded-[15px] p-3 sm:p-4 border border-stroke-subtle dark:border-stroke/10 bg-background-mute dark:bg-white/5`},Rr={class:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3`},zr={class:`flex items-center gap-2 sm:gap-3`},Br={class:`flex bg-background-mute dark:bg-stroke/5 rounded-lg border border-stroke-subtle dark:border-stroke/20 p-0.5 sm:p-1`},Vr={class:`glass-card rounded-[15px] p-3 sm:p-6 border border-stroke-subtle dark:border-stroke/10`},Hr={key:0,class:`flex items-center justify-center py-8`},Ur={key:1,class:`text-center py-8`},Wr={class:`text-content-secondary dark:text-content-muted text-sm`},Gr={key:2,class:`text-center py-8`},Kr={key:3,class:`space-y-2`},qr=f({name:`TransportKeys`,__name:`TransportKeys`,setup(e){let t=Jt(),n=j(),r=E(!1),a=E(!1),c=E(!1),d=E(null),f=E(null),p=E(`deny`);h(y(()=>n.stats?.config?.mesh?.unscoped_flood_allow??null),e=>{e!==null&&(p.value=e?`allow`:`deny`)},{immediate:!0});let m=E([]),g=E(!1),T=E(null),D=e=>{let t=new Map,n=[];return e.forEach(e=>{let n={id:e.id,name:e.name,floodPolicy:e.flood_policy,transport_key:e.transport_key,last_used:e.last_used?new Date(e.last_used*1e3):void 0,parent_id:e.parent_id,children:[]};t.set(e.id,n)}),t.forEach(e=>{e.parent_id&&t.has(e.parent_id)?t.get(e.parent_id).children.push(e):n.push(e)}),n},O=async()=>{try{g.value=!0,T.value=null;let e=await A.getTransportKeys();e.success&&e.data?m.value=D(e.data):T.value=e.error||`Failed to load transport keys`}catch(e){T.value=e instanceof Error?e.message:`Unknown error occurred`,console.error(`Error loading transport keys:`,e)}finally{g.value=!1}};o(()=>{O()});function k(e,t){for(let n of e){if(n.id===t)return n;if(n.children){let e=k(n.children,t);if(e)return e}}return null}function M(){let e=t.selectedNodeId.value;if(e)return k(m.value,e)?.name}function N(e){t.setSelectedNode(e)}function P(){r.value=!0}function F(){if(t.selectedNodeId.value){let e=k(m.value,t.selectedNodeId.value);e&&(f.value=e,c.value=!0)}}function I(){if(t.selectedNodeId.value){let e=k(m.value,t.selectedNodeId.value);e&&(d.value=e,a.value=!0)}}let L=async e=>{try{let t=await A.createTransportKey(e.name,e.floodPolicy,void 0,e.parentId,void 0);t.success?await O():(console.error(`Failed to add transport key:`,t.error),T.value=t.error||`Failed to add transport key`)}catch(e){console.error(`Error adding transport key:`,e),T.value=e instanceof Error?e.message:`Unknown error occurred`}finally{r.value=!1}};function R(){r.value=!1}async function z(e){try{let t=e===`allow`,r=await A.updateUnscopedFloodPolicy(t);r.success?(p.value=e,await n.fetchStats()):(console.error(`Failed to update unscoped flood policy:`,r.error),T.value=r.error||`Failed to update unscoped flood policy`)}catch(e){console.error(`Error updating unscoped flood policy:`,e),T.value=e instanceof Error?e.message:`Failed to update unscoped flood policy`}}function B(){a.value=!1,d.value=null}async function V(e){try{let t=await A.updateTransportKey(e.id,e.name,e.floodPolicy);t.success?await O():(console.error(`Failed to update transport key:`,t.error),T.value=t.error||`Failed to update transport key`)}catch(e){console.error(`Error updating transport key:`,e),T.value=e instanceof Error?e.message:`Unknown error occurred`}finally{B()}}function H(e){a.value=!1,d.value=null,f.value=e,c.value=!0}function U(){c.value=!1,f.value=null}async function W(e){try{let n=await A.deleteTransportKey(e);n.success?(await O(),t.setSelectedNode(null)):(console.error(`Failed to delete transport key:`,n.error),T.value=n.error||`Failed to delete transport key`)}catch(e){console.error(`Error deleting transport key:`,e),T.value=e instanceof Error?e.message:`Unknown error occurred`}finally{U()}}async function G(e){try{let n=await A.deleteTransportKey(e.nodeId);n.success?(await O(),t.setSelectedNode(null)):(console.error(`Failed to delete transport key:`,n.error),T.value=n.error||`Failed to delete transport key`)}catch(e){console.error(`Error deleting transport key:`,e),T.value=e instanceof Error?e.message:`Unknown error occurred`}finally{U()}}return(e,n)=>(w(),C(`div`,Mr,[S(`div`,Nr,[n[3]||=S(`div`,null,[S(`h3`,{class:`text-base sm:text-lg font-semibold text-content-primary dark:text-content-primary mb-1 sm:mb-2`},` Regions/Keys `),S(`p`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},` Manage regional key hierarchy `)],-1),S(`div`,Pr,[S(`button`,{onClick:P,class:`flex items-center gap-1.5 sm:gap-2 px-2.5 sm:px-3 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm bg-accent-green/10 hover:bg-accent-green/20 text-accent-green border-accent-green/30`},[...n[2]||=[S(`svg`,{class:`w-3.5 h-3.5 sm:w-4 sm:h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})],-1),b(` Add `,-1)]]),S(`button`,{onClick:I,disabled:!s(t).selectedNodeId.value,class:_([`px-2.5 sm:px-4 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm`,s(t).selectedNodeId.value?`bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border-accent-green/50`:`bg-background-mute dark:bg-stroke/10 text-content-muted dark:text-content-muted/70 border-stroke-subtle dark:border-stroke/20 cursor-not-allowed`])},` Edit `,10,Fr),S(`button`,{onClick:F,disabled:!s(t).selectedNodeId.value,class:_([`px-2.5 sm:px-4 py-1.5 sm:py-2 rounded-lg border transition-colors text-xs sm:text-sm`,s(t).selectedNodeId.value?`bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border-accent-red/50`:`bg-background-mute dark:bg-stroke/10 text-content-muted dark:text-content-muted/70 border-stroke-subtle dark:border-stroke/20 cursor-not-allowed`])},` Delete `,10,Ir)])]),S(`div`,Lr,[S(`div`,Rr,[n[4]||=S(`div`,null,[S(`h4`,{class:`text-xs sm:text-sm font-medium text-content-primary dark:text-content-primary mb-1`},` Unscoped Flood Policy (*) `),S(`p`,{class:`text-content-secondary dark:text-content-muted text-[10px] sm:text-xs`},` Allow or Deny unscoped flood packets `)],-1),S(`div`,zr,[S(`div`,Br,[S(`button`,{onClick:n[0]||=e=>z(`deny`),class:_([`px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium rounded transition-colors`,p.value===`deny`?`bg-accent-red/20 text-accent-red border border-accent-red/50`:`text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-secondary`])},` DENY `,2),S(`button`,{onClick:n[1]||=e=>z(`allow`),class:_([`px-2 sm:px-3 py-1 text-[10px] sm:text-xs font-medium rounded transition-colors`,p.value===`allow`?`bg-accent-green/20 text-accent-green border border-accent-green/50`:`text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-secondary`])},` ALLOW `,2)])])])]),S(`div`,Vr,[g.value?(w(),C(`div`,Hr,[...n[5]||=[S(`div`,{class:`animate-spin rounded-full h-8 w-8 border-b-2 border-accent-green`},null,-1),S(`span`,{class:`ml-2 text-content-secondary dark:text-content-muted`},`Loading transport keys...`,-1)]])):T.value?(w(),C(`div`,Ur,[n[6]||=S(`div`,{class:`text-accent-red mb-2`},`⚠️ Error loading transport keys`,-1),S(`div`,Wr,u(T.value),1),S(`button`,{onClick:O,class:`mt-4 px-4 py-2 bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded-lg transition-colors`},` Retry `)])):m.value.length===0?(w(),C(`div`,Gr,[...n[7]||=[S(`div`,{class:`text-content-muted dark:text-content-muted mb-2`},` 📝 No transport keys found `,-1),S(`div`,{class:`text-content-muted dark:text-content-muted/60 text-sm`},` Add your first transport key to get started `,-1)]])):(w(),C(`div`,Kr,[(w(!0),C(x,null,i(m.value,e=>(w(),l(pn,{key:e.id,node:e,"selected-node-id":s(t).selectedNodeId.value,level:0,onSelect:N},null,8,[`node`,`selected-node-id`]))),128))]))]),v(Pn,{show:r.value,"selected-node-name":M(),"selected-node-id":s(t).selectedNodeId.value||void 0,onClose:R,onAdd:L},null,8,[`show`,`selected-node-name`,`selected-node-id`]),v(sr,{show:a.value,node:d.value,onClose:B,onSave:V,onRequestDelete:H},null,8,[`show`,`node`]),v(jr,{show:c.value,node:f.value,"all-nodes":m.value,onClose:U,onDeleteAll:W,onMoveChildren:G},null,8,[`show`,`node`,`all-nodes`])]))}}),Jr={class:`space-y-4 sm:space-y-6`},Yr={class:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3`},Xr={key:0,class:`bg-red-500/10 border border-red-500/30 rounded-lg p-4`},Zr={class:`flex items-center gap-2 text-red-600 dark:text-red-400`},Qr={key:1,class:`flex items-center justify-center py-12`},$r={key:2,class:`space-y-3`},ei={class:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3`},ti={class:`flex-1`},ni={class:`flex items-center gap-2 sm:gap-3`},ri={class:`min-w-0 flex-1`},ii={class:`text-content-primary dark:text-content-primary font-medium text-sm sm:text-base break-all`},ai={class:`flex flex-col sm:flex-row sm:items-center sm:gap-4 mt-1 text-xs text-content-secondary dark:text-content-muted`},oi={class:`truncate`},si={class:`truncate`},ci=[`onClick`,`disabled`],li={key:3,class:`text-center py-12`},ui={class:`bg-surface dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke/20 rounded-[15px] p-6 max-w-md w-full shadow-2xl`},di={class:`space-y-4`},fi={class:`flex justify-end gap-3 mt-6`},pi=[`disabled`],mi=[`disabled`],hi={class:`bg-surface dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke/20 rounded-[15px] p-6 max-w-lg w-full shadow-2xl`},gi={class:`space-y-4`},_i={class:`flex gap-2`},vi=[`value`],yi={class:`bg-blue-500/10 border border-blue-500/30 rounded-lg p-4`},bi={class:`block bg-blue-500/20 px-3 py-2 rounded text-xs text-blue-100 font-mono overflow-x-auto`},xi=f({name:`APITokens`,__name:`APITokens`,setup(e){let t=E([]),n=E(!1),r=E(null),a=E(!1),s=E(``),c=E(null),l=E(!1),f=E(!1),p=E(null),h=async()=>{n.value=!0,r.value=null;try{let e=await A.get(`/auth/tokens`);t.value=(e.data||e).tokens||[]}catch(e){console.error(`Failed to fetch API tokens:`,e),r.value=e instanceof Error?e.message:`Failed to fetch tokens`}finally{n.value=!1}},_=async()=>{if(!s.value.trim()){r.value=`Token name is required`;return}n.value=!0,r.value=null;try{let e=await A.post(`/auth/tokens`,{name:s.value.trim()});c.value=(e.data||e).token||null,a.value=!1,l.value=!0,s.value=``,await h()}catch(e){console.error(`Failed to create API token:`,e),r.value=e instanceof Error?e.message:`Failed to create token`}finally{n.value=!1}},T=(e,t)=>{p.value={id:e,name:t},f.value=!0},D=async()=>{if(p.value){n.value=!0,r.value=null;try{await A.delete(`/auth/tokens/${p.value.id}`),await h(),f.value=!1,p.value=null}catch(e){console.error(`Failed to revoke API token:`,e),r.value=e instanceof Error?e.message:`Failed to revoke token`}finally{n.value=!1}}},O=()=>{a.value=!1,s.value=``,r.value=null},k=()=>{l.value=!1,c.value=null},j=()=>{c.value&&navigator.clipboard.writeText(c.value)},M=e=>e?new Date(e*1e3).toLocaleString():`Never`,P=y(()=>`${window.location.origin}/api/stats`);return o(()=>{h()}),(e,o)=>(w(),C(x,null,[S(`div`,Jr,[S(`div`,Yr,[o[5]||=S(`div`,null,[S(`h2`,{class:`text-lg sm:text-xl font-semibold text-content-primary dark:text-content-primary`},` API Tokens `),S(`p`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm mt-1`},` Manage API tokens for machine-to-machine authentication `)],-1),S(`button`,{onClick:o[0]||=e=>a.value=!0,class:`px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors flex items-center justify-center gap-2 text-sm sm:text-base`},[...o[4]||=[S(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})],-1),b(` Create Token `,-1)]])]),o[20]||=d(`

API tokens are used for machine-to-machine authentication. Include the token in the X-API-Key header when making API requests.

Tokens are only shown once at creation. Store them securely.

`,1),r.value?(w(),C(`div`,Xr,[S(`div`,Zr,[o[6]||=S(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})],-1),b(` `+u(r.value),1)])])):g(``,!0),n.value&&t.value.length===0?(w(),C(`div`,Qr,[...o[7]||=[S(`div`,{class:`text-center`},[S(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4`}),S(`div`,{class:`text-content-secondary dark:text-content-muted`},`Loading tokens...`)],-1)]])):t.value.length>0?(w(),C(`div`,$r,[(w(!0),C(x,null,i(t.value,e=>(w(),C(`div`,{key:e.id,class:`bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-3 sm:p-4 hover:bg-stroke-subtle dark:hover:bg-white/10 transition-colors`},[S(`div`,ei,[S(`div`,ti,[S(`div`,ni,[o[8]||=S(`svg`,{class:`w-4 h-4 sm:w-5 sm:h-5 text-primary flex-shrink-0`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z`})],-1),S(`div`,ri,[S(`h3`,ii,u(e.name),1),S(`div`,ai,[S(`span`,oi,`Created: `+u(M(e.created_at)),1),S(`span`,si,`Last used: `+u(M(e.last_used)),1)])])])]),S(`button`,{onClick:t=>T(e.id,e.name),disabled:n.value,class:`w-full sm:w-auto px-3 py-1.5 bg-red-100 dark:bg-red-500/20 hover:bg-red-500/30 text-red-600 dark:text-red-400 rounded-lg border border-red-500/50 transition-colors disabled:opacity-50 text-sm`},` Revoke `,8,ci)])]))),128))])):(w(),C(`div`,li,[o[9]||=S(`svg`,{class:`w-16 h-16 text-content-muted dark:text-content-muted/40 mx-auto mb-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z`})],-1),o[10]||=S(`h3`,{class:`text-content-primary dark:text-content-primary font-medium mb-2`},`No API Tokens`,-1),o[11]||=S(`p`,{class:`text-content-secondary dark:text-content-muted text-sm mb-4`},` Create a token to enable API access `,-1),S(`button`,{onClick:o[1]||=e=>a.value=!0,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors`},` Create Your First Token `)])),a.value?(w(),C(`div`,{key:4,class:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm`,onClick:I(O,[`self`])},[S(`div`,ui,[o[14]||=S(`h3`,{class:`text-xl font-semibold text-content-primary dark:text-content-primary mb-4`},` Create API Token `,-1),S(`div`,di,[S(`div`,null,[o[12]||=S(`label`,{class:`block text-sm font-medium text-content-secondary dark:text-content-muted mb-2`},`Token Name`,-1),m(S(`input`,{"onUpdate:modelValue":o[2]||=e=>s.value=e,type:`text`,placeholder:`e.g., Production Server, CI/CD Pipeline`,class:`w-full px-4 py-2 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-400 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors`,onKeydown:L(_,[`enter`])},null,544),[[N,s.value]]),o[13]||=S(`p`,{class:`text-xs text-content-muted dark:text-content-muted mt-1`},` Give your token a descriptive name to identify its purpose `,-1)]),S(`div`,fi,[S(`button`,{onClick:O,disabled:n.value,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/10 transition-colors disabled:opacity-50`},` Cancel `,8,pi),S(`button`,{onClick:_,disabled:n.value||!s.value.trim(),class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors disabled:opacity-50`},u(n.value?`Creating...`:`Create Token`),9,mi)])])])])):g(``,!0),l.value&&c.value?(w(),C(`div`,{key:5,class:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm`,onClick:I(k,[`self`])},[S(`div`,hi,[o[19]||=S(`h3`,{class:`text-xl font-semibold text-content-primary dark:text-content-primary mb-4`},` Token Created Successfully `,-1),S(`div`,gi,[o[18]||=d(`
Save this token now! For security reasons, it will not be shown again.
`,1),S(`div`,null,[o[16]||=S(`label`,{class:`block text-sm font-medium text-content-secondary dark:text-content-muted mb-2`},`Your API Token`,-1),S(`div`,_i,[S(`input`,{value:c.value,readonly:``,class:`flex-1 px-4 py-2 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary font-mono text-sm`},null,8,vi),S(`button`,{onClick:j,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors flex items-center gap-2`,title:`Copy to clipboard`},[...o[15]||=[S(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z`})],-1),b(` Copy `,-1)]])])]),S(`div`,yi,[o[17]||=S(`p`,{class:`text-sm text-blue-200 mb-2`},[S(`strong`,null,`Usage Example:`)],-1),S(`code`,bi,` curl -H "X-API-Key: `+u(c.value)+`" `+u(P.value),1)]),S(`div`,{class:`flex justify-end mt-6`},[S(`button`,{onClick:k,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors`},` Done `)])])])])):g(``,!0)]),v(B,{show:f.value,title:`Revoke API Token`,message:`Are you sure you want to revoke the token '${p.value?.name}'? This action cannot be undone.`,"confirm-text":`Revoke`,"cancel-text":`Cancel`,variant:`danger`,onConfirm:D,onClose:o[3]||=e=>f.value=!1},null,8,[`show`,`message`])],64))}}),Si={class:`space-y-6`},Ci={class:`glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6`},wi={class:`space-y-4`},Ti={class:`flex items-center justify-between`},Ei=[`disabled`],Di={class:`glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6`},Oi={class:`space-y-4`},ki={class:`space-y-3`},Ai=[`checked`,`disabled`],ji=[`checked`,`disabled`],Mi={class:`flex items-start gap-3`},Ni={key:0,class:`w-5 h-5 text-green-600 dark:text-green-400 flex-shrink-0 mt-0.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},Pi={key:1,class:`w-5 h-5 text-accent-cyan flex-shrink-0 mt-0.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},Fi={class:`flex-1`},Ii={class:`text-sm font-medium text-content-primary dark:text-content-primary`},Li={key:0,class:`text-xs text-green-600 dark:text-green-400 mt-1`},Ri={key:1,class:`p-4 bg-amber-500/10 border border-amber-500/30 rounded-lg`},zi={class:`flex items-start justify-between gap-3`},Bi=[`disabled`],Vi={key:0,class:`animate-spin h-4 w-4`,fill:`none`,viewBox:`0 0 24 24`},Hi={key:1,class:`w-4 h-4`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},Ui={class:`flex items-center space-x-2`},Wi={key:0,class:`w-5 h-5 text-green-600 dark:text-green-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},Gi={key:1,class:`w-5 h-5 text-red-600 dark:text-red-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},Ki=f({name:`WebSettings`,__name:`WebSettings`,setup(e){let t=E(!1),n=E(``),r=E(!1),i=E(!1),s=E(!1),c=E(!1),l=E(!0),f=a({cors_enabled:!1,use_default_frontend:!0}),p=y(()=>r.value?`bg-green-500/10 border-green-600/40 dark:border-green-500/30`:`bg-red-500/10 border-red-500/30`);async function m(){try{l.value=!0;let e=await A.get(`/check_pymc_console`);e.success&&e.data&&(c.value=e.data.exists,console.log(`PyMC Console exists:`,c.value))}catch(e){console.error(`Failed to check PyMC Console:`,e),c.value=!1}finally{l.value=!1}}async function h(){try{let e=await A.get(`/stats`);console.log(`WebSettings: Full response:`,e);let t=null;if(e.success&&e.data?t=e.data:e&&`version`in e&&(t=e),t){let e=t.config?.web||{};console.log(`WebSettings: webConfig:`,e),f.cors_enabled=e.cors_enabled===!0,console.log(`WebSettings: Set cors_enabled to:`,f.cors_enabled);let n=e.web_path;f.use_default_frontend=!n||n===``,console.log(`WebSettings: Set use_default_frontend to:`,f.use_default_frontend,`from web_path:`,n)}}catch(e){console.error(`Failed to load web settings:`,e),k(`Failed to load settings`,!1)}}async function v(){t.value=!0,n.value=``;try{let e={web:{cors_enabled:f.cors_enabled}};f.use_default_frontend?e.web.web_path=null:e.web.web_path=`/opt/pymc_console/web/html`;let t=await A.post(`/update_web_config`,e);t.success?(k(`Settings saved successfully`,!0),i.value=!0):k(t.error||`Failed to save settings`,!1)}catch(e){console.error(`Failed to save web settings:`,e),k(e.message||`Failed to save settings`,!1)}finally{t.value=!1}}async function T(){f.cors_enabled=!f.cors_enabled,await v()}async function D(){f.use_default_frontend=!0,await v()}async function O(){f.use_default_frontend=!1,await v()}function k(e,t){n.value=e,r.value=t,setTimeout(()=>{n.value=``},5e3)}async function j(){s.value=!0,n.value=``;try{let e=await A.post(`/restart_service`,{});e.success?(k(`Service restart initiated. Page will reload...`,!0),i.value=!1,setTimeout(()=>{window.location.reload()},2e3)):k(e.error||`Failed to restart service`,!1)}catch(e){e.code===`ERR_NETWORK`||e.message?.includes(`Network error`)?(k(`Service restarting... Page will reload`,!0),i.value=!1,setTimeout(()=>{window.location.reload()},3e3)):(console.error(`Failed to restart service:`,e),k(e.message||`Failed to restart service`,!1))}finally{s.value=!1}}return o(()=>{h(),m()}),(e,a)=>(w(),C(`div`,Si,[S(`div`,Ci,[a[1]||=S(`div`,{class:`flex items-start justify-between mb-4`},[S(`div`,null,[S(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-1`},` CORS Settings `),S(`p`,{class:`text-sm text-content-secondary dark:text-content-muted`},` Control cross-origin resource sharing for API access `)])],-1),S(`div`,wi,[S(`div`,Ti,[a[0]||=S(`div`,null,[S(`label`,{class:`text-sm font-medium text-content-primary dark:text-content-primary`},`Enable CORS`),S(`p`,{class:`text-xs text-content-secondary dark:text-content-muted mt-1`},` Allow web frontends from different origins to access the API `)],-1),S(`button`,{onClick:T,disabled:t.value,class:_([`relative inline-flex h-6 w-11 items-center rounded-full transition-colors border-2`,f.cors_enabled?`bg-cyan-600 dark:bg-teal-500 border-cyan-600 dark:border-teal-500`:`bg-gray-400 dark:bg-gray-600 border-gray-400 dark:border-gray-600`,t.value?`opacity-50 cursor-not-allowed`:`cursor-pointer`])},[S(`span`,{class:_([`inline-block h-4 w-4 transform rounded-full bg-white transition-transform shadow-lg`,f.cors_enabled?`translate-x-5`:`translate-x-0.5`])},null,2)],10,Ei)])])]),S(`div`,Di,[a[11]||=S(`div`,{class:`flex items-start justify-between mb-4`},[S(`div`,null,[S(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-1`},` Web Frontend `),S(`p`,{class:`text-sm text-content-secondary dark:text-content-muted`},` Choose which web interface to use `)])],-1),S(`div`,Oi,[S(`div`,ki,[S(`label`,{class:_([`flex items-start space-x-3 p-4 bg-background-mute dark:bg-background/30 rounded-lg border-2 cursor-pointer transition-all`,f.use_default_frontend?`border-accent-cyan bg-accent-cyan/10`:`border-stroke-subtle dark:border-stroke/10 hover:border-accent-cyan/50`])},[S(`input`,{type:`radio`,name:`frontend`,checked:f.use_default_frontend,onChange:D,disabled:t.value,class:`mt-1 h-4 w-4 text-accent-cyan focus:ring-accent-cyan focus:ring-offset-background`},null,40,Ai),a[2]||=S(`div`,{class:`flex-1`},[S(`div`,{class:`text-sm font-medium text-content-primary dark:text-content-primary`},` Default Frontend `),S(`div`,{class:`text-xs text-content-secondary dark:text-content-muted mt-1`},` Built-in pyMC Repeater web interface `),S(`div`,{class:`text-xs text-content-muted dark:text-content-muted/60 mt-1 font-mono`},` Built-in `)],-1)],2),S(`label`,{class:_([`flex items-start space-x-3 p-4 bg-background-mute dark:bg-background/30 rounded-lg border-2 cursor-pointer transition-all`,f.use_default_frontend?`border-stroke-subtle dark:border-stroke/10 hover:border-accent-cyan/50`:`border-accent-cyan bg-accent-cyan/10`])},[S(`input`,{type:`radio`,name:`frontend`,checked:!f.use_default_frontend,onChange:O,disabled:t.value,class:`mt-1 h-4 w-4 text-accent-cyan focus:ring-accent-cyan focus:ring-offset-background`},null,40,ji),a[3]||=d(`
PyMC Console
@Treehouse⚡
Alternative web interface for pyMC Repeater
/opt/pymc_console/web/html
`,1)],2)]),l.value?g(``,!0):(w(),C(`div`,{key:0,class:_([`p-4 rounded-lg border`,c.value?`bg-green-500/5 border-green-500/20`:`bg-accent-cyan/5 border-accent-cyan/20`])},[S(`div`,Mi,[c.value?(w(),C(`svg`,Ni,[...a[4]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`},null,-1)]])):(w(),C(`svg`,Pi,[...a[5]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`},null,-1)]])),S(`div`,Fi,[S(`h4`,Ii,u(c.value?`PyMC Console has been detected`:`PyMC Console Not Installed`),1),c.value?(w(),C(`p`,Li,[...a[6]||=[b(` PyMC Console is installed at `,-1),S(`code`,{class:`text-green-700 dark:text-green-300`},`/opt/pymc_console/web/html`,-1)]])):(w(),C(x,{key:1},[a[7]||=d(`

PyMC Console must be installed at /opt/pymc_console/web/html before selecting this option.

PyMC Console Install Instructions `,2)],64))])])],2)),i.value?(w(),C(`div`,Ri,[S(`div`,zi,[a[10]||=d(`

Service restart required

Web frontend changes will take effect after restarting the pymc-repeater service.

`,1),S(`button`,{onClick:j,disabled:s.value,class:`px-4 py-2 bg-amber-500 hover:bg-amber-600 disabled:bg-amber-500/50 text-white font-medium rounded-lg transition-colors disabled:cursor-not-allowed flex items-center gap-2 whitespace-nowrap`},[s.value?(w(),C(`svg`,Vi,[...a[8]||=[S(`circle`,{class:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,"stroke-width":`4`},null,-1),S(`path`,{class:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`},null,-1)]])):(w(),C(`svg`,Hi,[...a[9]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`},null,-1)]])),b(` `+u(s.value?`Restarting...`:`Restart Now`),1)],8,Bi)])])):g(``,!0)])]),n.value?(w(),C(`div`,{key:0,class:_([`p-4 rounded-lg border`,p.value])},[S(`div`,Ui,[r.value?(w(),C(`svg`,Wi,[...a[12]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 13l4 4L19 7`},null,-1)]])):(w(),C(`svg`,Gi,[...a[13]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`},null,-1)]])),S(`span`,{class:_(r.value?`text-green-600 dark:text-green-400`:`text-red-600 dark:text-red-400`)},u(n.value),3)])],2)):g(``,!0)]))}}),qi={class:`space-y-4`},Ji={key:0,class:`bg-green-100 dark:bg-green-500/20 border border-green-500 dark:border-green-500/50 rounded-lg p-3 text-green-700 dark:text-green-400 text-sm`},Yi={key:1,class:`bg-red-100 dark:bg-red-500/20 border border-red-500 dark:border-red-500/50 rounded-lg p-3 text-red-700 dark:text-red-400 text-sm`},Xi={class:`flex justify-between items-center`},Zi={class:`flex gap-2`},Qi=[`disabled`],$i={class:`flex gap-2`},ea=[`disabled`],ta=[`disabled`],na={class:`bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3`},ra={key:0,class:`flex items-center justify-center py-4`},ia={key:1,class:`text-center py-4`},aa={class:`grid grid-cols-2 sm:grid-cols-4 gap-3`},oa={class:`text-center p-2 bg-white dark:bg-white/5 rounded-lg`},sa={class:`text-center p-2 bg-white dark:bg-white/5 rounded-lg`},ca={class:`text-lg font-mono text-content-primary dark:text-content-primary`},la={class:`text-center p-2 bg-white dark:bg-white/5 rounded-lg`},ua={class:`text-lg font-mono text-green-600 dark:text-green-400`},da={class:`text-center p-2 bg-white dark:bg-white/5 rounded-lg`},fa={class:`text-lg font-mono text-red-600 dark:text-red-400`},pa={key:0,class:`mt-2 p-2 bg-red-50 dark:bg-red-500/10 rounded-lg border border-red-200 dark:border-red-500/30`},ma={key:1,class:`mt-2 p-2 bg-orange-50 dark:bg-orange-500/10 rounded-lg border border-orange-200 dark:border-orange-500/30`},ha={class:`font-medium`},ga={class:`font-mono text-[10px] opacity-70`},_a={class:`text-[10px]`},va={class:`bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3`},ya={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},ba={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},xa={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Sa={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},Ca={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},wa={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},Ta={key:1,class:`flex items-center gap-2`},Ea={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1`},Da={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},Oa={key:1,class:`flex items-center gap-2`},ka={class:`bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3`},Aa={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},ja={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},Ma={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Na={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},Pa={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Fa={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},Ia={key:1,class:`flex items-center gap-2`},La={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Ra={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},za={key:1,class:`flex items-center gap-2`},Ba={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 gap-1`},Va={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},Ha={key:1,class:`flex items-center gap-2`},Ua={class:`bg-background-mute dark:bg-white/5 rounded-lg p-3 sm:p-4 space-y-3`},Wa={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},Ga={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},Ka={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center py-2 border-b border-stroke-subtle dark:border-stroke/10 gap-1`},qa={key:0,class:`text-content-primary dark:text-content-primary font-mono text-sm`},Ja={key:1,class:`flex items-center gap-2`},Ya={class:`py-2`},Xa={class:`grid grid-cols-3 gap-2 mt-2`},Za={class:`text-center p-2 bg-white dark:bg-white/5 rounded-lg`},Qa={key:0,class:`font-mono text-sm text-content-primary dark:text-content-primary`},$a={class:`text-center p-2 bg-white dark:bg-white/5 rounded-lg`},eo={key:0,class:`font-mono text-sm text-content-primary dark:text-content-primary`},to={class:`text-center p-2 bg-white dark:bg-white/5 rounded-lg`},no={key:0,class:`font-mono text-sm text-content-primary dark:text-content-primary`},ro={class:`p-6 space-y-4`},io={class:`flex justify-between items-start`},ao={class:`flex justify-end pt-4 border-t border-stroke-subtle dark:border-stroke/20`},oo=f({__name:`AdvertSettings`,setup(e){let t=j(),n=y(()=>t.stats?.config?.repeater||{}),r=y(()=>n.value.advert_rate_limit||{}),a=y(()=>n.value.advert_penalty_box||{}),s=y(()=>n.value.advert_adaptive||{}),l=y(()=>s.value.thresholds||{}),f=E(!1),p=E(!1),v=E(``),T=E(``),D=E(!1),O=E(!1),A=E(null),M=E(!0),P=E(2),F=E(1),L=E(10),R=E(60),B=E(!0),V=E(2),H=E(12),U=E(6),W=E(2),G=E(24),ee=E(!0),te=E(.1),ne=E(5),re=E(.05),K=E(.2),q=E(.5),J=async()=>{O.value=!0;try{let e=await k.get(`/api/advert_rate_limit_stats`);e.data?.success&&(A.value=e.data.data)}catch(e){console.error(`Failed to fetch rate limit stats:`,e)}finally{O.value=!1}};h([r,a,s],()=>{f.value||(M.value=r.value.enabled??!1,P.value=r.value.bucket_capacity??2,F.value=r.value.refill_tokens??1,L.value=Math.round((r.value.refill_interval_seconds??36e3)/3600),R.value=Math.round((r.value.min_interval_seconds??0)/60),B.value=a.value.enabled??!1,V.value=a.value.violation_threshold??2,H.value=Math.round((a.value.violation_decay_seconds??43200)/3600),U.value=Math.round((a.value.base_penalty_seconds??21600)/3600),W.value=a.value.penalty_multiplier??2,G.value=Math.round((a.value.max_penalty_seconds??86400)/3600),ee.value=s.value.enabled??!1,te.value=s.value.ewma_alpha??.1,ne.value=Math.round((s.value.hysteresis_seconds??300)/60),re.value=l.value.quiet_max??.05,K.value=l.value.normal_max??.2,q.value=l.value.busy_max??.5)},{immediate:!0}),o(()=>{J()});let Y=()=>{M.value=r.value.enabled??!1,P.value=r.value.bucket_capacity??2,F.value=r.value.refill_tokens??1,L.value=Math.round((r.value.refill_interval_seconds??36e3)/3600),R.value=Math.round((r.value.min_interval_seconds??0)/60),B.value=a.value.enabled??!1,V.value=a.value.violation_threshold??2,H.value=Math.round((a.value.violation_decay_seconds??43200)/3600),U.value=Math.round((a.value.base_penalty_seconds??21600)/3600),W.value=a.value.penalty_multiplier??2,G.value=Math.round((a.value.max_penalty_seconds??86400)/3600),ee.value=s.value.enabled??!1,te.value=s.value.ewma_alpha??.1,ne.value=Math.round((s.value.hysteresis_seconds??300)/60),re.value=l.value.quiet_max??.05,K.value=l.value.normal_max??.2,q.value=l.value.busy_max??.5},X=()=>{f.value=!0,v.value=``,T.value=``},Z=()=>{f.value=!1,v.value=``,T.value=``,Y()},Q=async()=>{p.value=!0,T.value=``,v.value=``;try{let e={rate_limit_enabled:M.value,bucket_capacity:P.value,refill_tokens:F.value,refill_interval_seconds:L.value*3600,min_interval_seconds:R.value*60,penalty_enabled:B.value,violation_threshold:V.value,violation_decay_seconds:H.value*3600,base_penalty_seconds:U.value*3600,penalty_multiplier:W.value,max_penalty_seconds:G.value*3600,adaptive_enabled:ee.value,ewma_alpha:te.value,hysteresis_seconds:ne.value*60,quiet_max:re.value,normal_max:K.value,busy_max:q.value},n=(await k.post(`/api/update_advert_rate_limit_config`,e)).data;n.success?(v.value=n.data?.message||`Settings saved successfully`,await t.fetchStats(),await J(),await c(),Y(),f.value=!1,setTimeout(()=>{v.value=``},3e3)):(T.value=n.error||`Failed to save settings`,console.error(`[AdvertSettings] Save failed:`,n.error))}catch(e){console.error(`Failed to save advert settings:`,e),T.value=e.response?.data?.error||`Failed to save settings`}finally{p.value=!1}},$=y(()=>A.value?.adaptive?.current_tier||`unknown`),ie=y(()=>{switch($.value){case`quiet`:return`bg-green-100 dark:bg-green-500/20 text-green-700 dark:text-green-400 border-green-500`;case`normal`:return`bg-blue-100 dark:bg-blue-500/20 text-blue-700 dark:text-blue-400 border-blue-500`;case`busy`:return`bg-yellow-100 dark:bg-yellow-500/20 text-yellow-700 dark:text-yellow-400 border-yellow-500`;case`congested`:return`bg-red-100 dark:bg-red-500/20 text-red-700 dark:text-red-400 border-red-500`;default:return`bg-gray-100 dark:bg-gray-500/20 text-gray-700 dark:text-gray-400 border-gray-500`}});return(e,t)=>(w(),C(`div`,qi,[v.value?(w(),C(`div`,Ji,u(v.value),1)):g(``,!0),T.value?(w(),C(`div`,Yi,u(T.value),1)):g(``,!0),S(`div`,Xi,[S(`div`,Zi,[S(`button`,{onClick:J,disabled:O.value,class:`px-3 py-1.5 text-xs bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-secondary dark:text-content-muted rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors disabled:opacity-50`},u(O.value?`Loading...`:`Refresh Stats`),9,Qi),S(`button`,{onClick:t[0]||=e=>D.value=!0,class:`px-3 py-1.5 text-xs bg-blue-100 dark:bg-blue-500/20 hover:bg-blue-200 dark:hover:bg-blue-500/30 text-blue-700 dark:text-blue-400 rounded-lg border border-blue-500/50 transition-colors`,title:`How rate limiting works`},[...t[19]||=[S(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})],-1)]])]),S(`div`,$i,[f.value?(w(),C(x,{key:1},[S(`button`,{onClick:Z,disabled:p.value,class:`px-3 sm:px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/20 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed`},` Cancel `,8,ea),S(`button`,{onClick:Q,disabled:p.value,class:`px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed`},u(p.value?`Saving...`:`Save Changes`),9,ta)],64)):(w(),C(`button`,{key:0,onClick:X,class:`px-3 sm:px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors text-sm`},` Edit Settings `))])]),S(`div`,na,[t[28]||=S(`h3`,{class:`text-sm font-medium text-content-primary dark:text-content-primary`},` Current Status `,-1),O.value&&!A.value?(w(),C(`div`,ra,[...t[20]||=[S(`div`,{class:`animate-spin w-5 h-5 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full`},null,-1),S(`span`,{class:`ml-2 text-sm text-content-muted`},`Loading stats...`,-1)]])):A.value?(w(),C(x,{key:2},[S(`div`,aa,[S(`div`,oa,[t[22]||=S(`div`,{class:`text-xs text-content-muted dark:text-content-muted`},`Mesh Tier`,-1),S(`div`,{class:_([`mt-1 px-2 py-0.5 rounded border text-xs font-medium inline-block`,ie.value])},u($.value.toUpperCase()),3)]),S(`div`,sa,[t[23]||=S(`div`,{class:`text-xs text-content-muted dark:text-content-muted`},`Adverts/min`,-1),S(`div`,ca,u(A.value.metrics?.adverts_per_min_ewma?.toFixed(2)||`0.00`),1)]),S(`div`,la,[t[24]||=S(`div`,{class:`text-xs text-content-muted dark:text-content-muted`},`Allowed`,-1),S(`div`,ua,u(A.value.stats?.adverts_allowed||0),1)]),S(`div`,da,[t[25]||=S(`div`,{class:`text-xs text-content-muted dark:text-content-muted`},`Dropped`,-1),S(`div`,fa,u(A.value.stats?.adverts_dropped||0),1)])]),Object.keys(A.value.active_penalties||{}).length>0?(w(),C(`div`,pa,[t[26]||=S(`div`,{class:`text-xs font-medium text-red-700 dark:text-red-400 mb-1`},` Active Penalties `,-1),(w(!0),C(x,null,i(A.value.active_penalties,(e,t)=>(w(),C(`div`,{key:t,class:`text-xs font-mono text-red-600 dark:text-red-400`},u(t)+`... - `+u(Math.round(e))+`s remaining `,1))),128))])):g(``,!0),A.value.recent_drops&&A.value.recent_drops.length>0?(w(),C(`div`,ma,[t[27]||=S(`div`,{class:`text-xs font-medium text-orange-700 dark:text-orange-400 mb-1`},` Recently Dropped Adverts `,-1),(w(!0),C(x,null,i(A.value.recent_drops,(e,t)=>(w(),C(`div`,{key:t,class:`text-xs text-orange-600 dark:text-orange-400 py-0.5`},[S(`span`,ha,u(e.name),1),S(`span`,ga,`(`+u(e.pubkey)+`...)`,1),S(`span`,_a,` - `+u(e.reason)+` (`+u(e.seconds_ago)+`s ago)`,1)]))),128))])):g(``,!0)],64)):(w(),C(`div`,ia,[...t[21]||=[S(`p`,{class:`text-xs text-content-muted dark:text-content-muted`},` Stats not available. Click "Refresh Stats" to load. `,-1)]]))]),S(`div`,va,[t[36]||=S(`h3`,{class:`text-sm font-medium text-content-primary dark:text-content-primary flex items-center gap-2`},[S(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})]),b(` Token Bucket Rate Limiting `)],-1),t[37]||=S(`p`,{class:`text-xs text-content-muted dark:text-content-muted`},` Controls how many adverts each pubkey can send in a given time period. `,-1),S(`div`,ya,[t[30]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Rate Limiting`,-1),f.value?m((w(),C(`select`,{key:1,"onUpdate:modelValue":t[1]||=e=>M.value=e,class:`w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},[...t[29]||=[S(`option`,{value:!0},`Enabled`,-1),S(`option`,{value:!1},`Disabled`,-1)]],512)),[[z,M.value]]):(w(),C(`div`,ba,u(M.value?`Enabled`:`Disabled`),1))]),S(`div`,xa,[t[31]||=S(`div`,null,[S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Bucket Capacity`),S(`p`,{class:`text-xs text-content-muted dark:text-content-muted`},`Max burst size (adverts)`)],-1),f.value?m((w(),C(`input`,{key:1,"onUpdate:modelValue":t[2]||=e=>P.value=e,type:`number`,min:`1`,max:`10`,class:`w-full sm:w-24 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512)),[[N,P.value,void 0,{number:!0}]]):(w(),C(`div`,Sa,u(P.value),1))]),S(`div`,Ca,[t[33]||=S(`div`,null,[S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Refill Interval`),S(`p`,{class:`text-xs text-content-muted dark:text-content-muted`},` Time between token refills `)],-1),f.value?(w(),C(`div`,Ta,[m(S(`input`,{"onUpdate:modelValue":t[3]||=e=>L.value=e,type:`number`,min:`1`,max:`48`,class:`w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512),[[N,L.value,void 0,{number:!0}]]),t[32]||=S(`span`,{class:`text-content-muted text-sm`},`hours`,-1)])):(w(),C(`div`,wa,u(L.value)+` hours `,1))]),S(`div`,Ea,[t[35]||=S(`div`,null,[S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Minimum Interval`),S(`p`,{class:`text-xs text-content-muted dark:text-content-muted`},` Hard minimum between adverts `)],-1),f.value?(w(),C(`div`,Oa,[m(S(`input`,{"onUpdate:modelValue":t[4]||=e=>R.value=e,type:`number`,min:`0`,max:`1440`,class:`w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512),[[N,R.value,void 0,{number:!0}]]),t[34]||=S(`span`,{class:`text-content-muted text-sm`},`min`,-1)])):(w(),C(`div`,Da,u(R.value)+` min `,1))])]),S(`div`,ka,[t[47]||=S(`h3`,{class:`text-sm font-medium text-content-primary dark:text-content-primary flex items-center gap-2`},[S(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636`})]),b(` Penalty Box (Repeat Offenders) `)],-1),t[48]||=S(`p`,{class:`text-xs text-content-muted dark:text-content-muted`},` Applies escalating cooldowns to pubkeys that repeatedly violate limits. `,-1),S(`div`,Aa,[t[39]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Penalty Box`,-1),f.value?m((w(),C(`select`,{key:1,"onUpdate:modelValue":t[5]||=e=>B.value=e,class:`w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},[...t[38]||=[S(`option`,{value:!0},`Enabled`,-1),S(`option`,{value:!1},`Disabled`,-1)]],512)),[[z,B.value]]):(w(),C(`div`,ja,u(B.value?`Enabled`:`Disabled`),1))]),S(`div`,Ma,[t[40]||=S(`div`,null,[S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Violation Threshold`),S(`p`,{class:`text-xs text-content-muted dark:text-content-muted`},` Violations before penalty `)],-1),f.value?m((w(),C(`input`,{key:1,"onUpdate:modelValue":t[6]||=e=>V.value=e,type:`number`,min:`1`,max:`10`,class:`w-full sm:w-24 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512)),[[N,V.value,void 0,{number:!0}]]):(w(),C(`div`,Na,u(V.value),1))]),S(`div`,Pa,[t[42]||=S(`div`,null,[S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Base Penalty Duration`),S(`p`,{class:`text-xs text-content-muted dark:text-content-muted`},`First penalty duration`)],-1),f.value?(w(),C(`div`,Ia,[m(S(`input`,{"onUpdate:modelValue":t[7]||=e=>U.value=e,type:`number`,min:`1`,max:`48`,class:`w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512),[[N,U.value,void 0,{number:!0}]]),t[41]||=S(`span`,{class:`text-content-muted text-sm`},`hours`,-1)])):(w(),C(`div`,Fa,u(U.value)+` hours `,1))]),S(`div`,La,[t[44]||=S(`div`,null,[S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Penalty Multiplier`),S(`p`,{class:`text-xs text-content-muted dark:text-content-muted`},`Escalation factor`)],-1),f.value?(w(),C(`div`,za,[m(S(`input`,{"onUpdate:modelValue":t[8]||=e=>W.value=e,type:`number`,min:`1`,max:`5`,step:`0.5`,class:`w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512),[[N,W.value,void 0,{number:!0}]]),t[43]||=S(`span`,{class:`text-content-muted text-sm`},`x`,-1)])):(w(),C(`div`,Ra,u(W.value)+`x `,1))]),S(`div`,Ba,[t[46]||=S(`div`,null,[S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Max Penalty Duration`),S(`p`,{class:`text-xs text-content-muted dark:text-content-muted`},`Maximum cooldown cap`)],-1),f.value?(w(),C(`div`,Ha,[m(S(`input`,{"onUpdate:modelValue":t[9]||=e=>G.value=e,type:`number`,min:`1`,max:`168`,class:`w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512),[[N,G.value,void 0,{number:!0}]]),t[45]||=S(`span`,{class:`text-content-muted text-sm`},`hours`,-1)])):(w(),C(`div`,Va,u(G.value)+` hours `,1))])]),S(`div`,Ua,[t[58]||=d(`

Adaptive Rate Limiting

How the three systems work together: Each layer can be enabled/disabled independently and the others will still function.

  • Rate Limiting OFF: All limiting disabled — adverts pass through freely
  • Adaptive OFF: Token bucket uses fixed limits (no tier scaling), penalty box still works
  • Penalty Box OFF: Token bucket still applies, but no escalating cooldowns for repeat offenders

Decision flow when all enabled: Adaptive tier check → Penalty box check → Token bucket check → Violation recording (triggers penalty box)

Activity tiers:Quiet (bypass limiting) → Normal (lighter: 0.5x intervals) → Busy (base: 1.0x intervals) → Congested (stricter: 2.0x intervals)

Note: Adaptive mode scales refill/min-interval timing; bucket capacity stays at the configured base value.

`,2),S(`div`,Wa,[t[50]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Adaptive Mode`,-1),f.value?m((w(),C(`select`,{key:1,"onUpdate:modelValue":t[10]||=e=>ee.value=e,class:`w-full sm:w-32 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},[...t[49]||=[S(`option`,{value:!0},`Enabled`,-1),S(`option`,{value:!1},`Disabled`,-1)]],512)),[[z,ee.value]]):(w(),C(`div`,Ga,u(ee.value?`Enabled`:`Disabled`),1))]),S(`div`,Ka,[t[52]||=S(`div`,null,[S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Tier Change Delay`),S(`p`,{class:`text-xs text-content-muted dark:text-content-muted`},`Prevents tier flapping`)],-1),f.value?(w(),C(`div`,Ja,[m(S(`input`,{"onUpdate:modelValue":t[11]||=e=>ne.value=e,type:`number`,min:`0`,max:`60`,class:`w-20 px-3 py-1.5 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary`},null,512),[[N,ne.value,void 0,{number:!0}]]),t[51]||=S(`span`,{class:`text-content-muted text-sm`},`min`,-1)])):(w(),C(`div`,qa,u(ne.value)+` min `,1))]),S(`div`,Ya,[t[56]||=S(`span`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm mb-2 block`},`Activity Tier Thresholds (adverts/min)`,-1),S(`div`,Xa,[S(`div`,Za,[t[53]||=S(`div`,{class:`text-xs text-green-600 dark:text-green-400 mb-1`},`Quiet Max`,-1),f.value?m((w(),C(`input`,{key:1,"onUpdate:modelValue":t[12]||=e=>re.value=e,type:`number`,min:`0`,max:`1`,step:`0.01`,class:`w-full px-2 py-1 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded text-content-primary dark:text-content-primary text-sm text-center focus:outline-none focus:border-primary`},null,512)),[[N,re.value,void 0,{number:!0}]]):(w(),C(`div`,Qa,u(re.value),1))]),S(`div`,$a,[t[54]||=S(`div`,{class:`text-xs text-blue-600 dark:text-blue-400 mb-1`},`Normal Max`,-1),f.value?m((w(),C(`input`,{key:1,"onUpdate:modelValue":t[13]||=e=>K.value=e,type:`number`,min:`0`,max:`5`,step:`0.01`,class:`w-full px-2 py-1 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded text-content-primary dark:text-content-primary text-sm text-center focus:outline-none focus:border-primary`},null,512)),[[N,K.value,void 0,{number:!0}]]):(w(),C(`div`,eo,u(K.value),1))]),S(`div`,to,[t[55]||=S(`div`,{class:`text-xs text-yellow-600 dark:text-yellow-400 mb-1`},`Busy Max`,-1),f.value?m((w(),C(`input`,{key:1,"onUpdate:modelValue":t[14]||=e=>q.value=e,type:`number`,min:`0`,max:`10`,step:`0.01`,class:`w-full px-2 py-1 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded text-content-primary dark:text-content-primary text-sm text-center focus:outline-none focus:border-primary`},null,512)),[[N,q.value,void 0,{number:!0}]]):(w(),C(`div`,no,u(q.value),1))])]),t[57]||=S(`p`,{class:`text-xs text-content-muted dark:text-content-muted mt-2`},` Above Busy Max = Congested tier (strictest limiting) `,-1)])]),D.value?(w(),C(`div`,{key:2,class:`fixed inset-0 bg-black/50 flex items-start justify-center z-50 p-4 overflow-y-auto`,onClick:t[18]||=I(e=>D.value=!1,[`self`])},[S(`div`,{class:`bg-background dark:bg-background-dark rounded-lg shadow-xl max-w-3xl w-full my-8`,onClick:t[17]||=I(()=>{},[`stop`])},[S(`div`,ro,[S(`div`,io,[t[60]||=S(`h2`,{class:`text-xl font-semibold text-content-primary dark:text-content-primary`},` How Advert Rate Limiting Works `,-1),S(`button`,{onClick:t[15]||=e=>D.value=!1,class:`text-content-muted hover:text-content-primary dark:text-content-muted dark:hover:text-content-primary`},[...t[59]||=[S(`svg`,{class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),t[61]||=d(`

Why you may see the same advert more than once

Mesh traffic can reach your repeater through different paths, so duplicate advert packets are expected.

  • First copy arrives and is forwarded
  • Second copy arrives through another repeater path
  • Later copies may be dropped once limits are hit

This is normal behavior and helps prevent repeated rebroadcasts from flooding the mesh.

Token Bucket Rate Limiting

Each sender has a token bucket. Every forwarded advert uses one token.

  • Bucket Capacity: How many adverts can pass in a burst.
  • Refill Rate: How quickly tokens come back over time.
  • Min Interval: Optional gap between adverts from the same sender (usually set to 0).
Example (capacity 2):
- Copy 1 forwarded (2 → 1 tokens)
- Copy 2 forwarded (1 → 0 tokens)
- Copy 3 dropped (no tokens left)

Penalty Box (Repeat Offenders)

If a sender keeps hitting the limit, it is temporarily blocked.

  • Violation Threshold: How many hits before penalty starts.
  • Base Penalty: First block duration.
  • Multiplier: Repeated penalties get longer.
  • Decay Time: Violations age out after stable behavior.

Adaptive Mesh Activity Tiers

Adaptive mode adjusts limits based on recent advert activity.

How Congestion is Measured:
  • What is counted: Advert packets only (not chat/data traffic)
  • Smoothing: 60-second EWMA to avoid reacting to short spikes
  • Score: Tier is based on adverts per minute
  • Hysteresis: Tier changes must hold for 5 minutes
QUIET
Activity < 0.05/min
No rate limiting
NORMAL
Activity 0.05-0.20/min
Light limiting (50%)
BUSY
Activity 0.20-0.50/min
Standard limiting (100%)
CONGESTED
Activity > 0.50/min
Aggressive (200%)
Quick examples:
- 0.02 adverts/min → QUIET (bypass)
- 0.35 adverts/min → BUSY (tighter limits)
- 0.68 adverts/min → CONGESTED (strict limits)

Recommended starting settings

  • Min Interval: 0 (disabled), let adaptive mode do the work
  • Bucket Capacity: 2-3 tokens for normal mesh propagation
  • Adaptive Mode: On
  • Penalty Box: On
`,5),S(`div`,ao,[S(`button`,{onClick:t[16]||=e=>D.value=!1,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors`},` Got it! `)])])])])):g(``,!0)]))}}),so={class:`space-y-6`},co={class:`glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6`},lo={class:`flex items-center justify-between mb-4`},uo=[`disabled`],fo={key:0},po={key:1},mo={key:0,class:`text-sm text-content-secondary dark:text-content-muted`},ho={key:1,class:`space-y-3`},go={class:`flex items-center gap-2`},_o={key:0,class:`space-y-2`},vo=[`title`],yo={key:1,class:`text-sm text-content-muted dark:text-content-muted/60 italic`},bo={class:`glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6`},xo={class:`flex items-start justify-between mb-6`},So={key:0,class:`space-y-4`},Co={class:`grid grid-cols-1 sm:grid-cols-2 gap-x-8 gap-y-3`},wo={class:`mt-1 text-sm text-content-primary dark:text-content-primary`},To={class:`mt-1 text-sm text-content-primary dark:text-content-primary font-mono`},Eo={class:`mt-1 text-sm text-content-primary dark:text-content-primary`},Do={class:`mt-1 text-sm text-content-primary dark:text-content-primary`},Oo={class:`mt-1 text-sm text-content-primary dark:text-content-primary`},ko={class:`mt-1 text-sm text-content-primary dark:text-content-primary`},Ao={key:0,class:`mt-2 text-sm text-content-muted dark:text-content-muted/60 italic`},jo={key:1,class:`mt-2 space-y-1.5`},Mo={class:`min-w-0 flex-1`},No={class:`text-sm font-medium text-content-primary dark:text-content-primary`},Po={class:`text-xs text-content-secondary dark:text-content-muted ml-2 font-mono`},Fo=[`title`],Io={class:`mt-2 flex flex-wrap gap-1.5`},Lo={key:0,class:`text-sm text-content-muted dark:text-content-muted/60 italic`},Ro={key:1,class:`space-y-5`},zo={class:`flex items-center justify-between p-4 rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/10`},Bo={class:`grid grid-cols-1 sm:grid-cols-2 gap-4`},Vo=[`value`],Ho={class:`grid grid-cols-1 sm:grid-cols-2 gap-4`},Uo={class:`flex items-start justify-between mb-3 gap-3`},Wo={class:`flex items-center gap-2 flex-shrink-0`},Go={class:`relative`},Ko={key:0,class:`absolute right-0 top-full mt-1 z-20 w-64 rounded-lg shadow-lg border border-stroke-subtle dark:border-stroke/20 bg-white dark:bg-[var(--color-surface)] overflow-hidden`},qo={class:`py-1`},Jo=[`onClick`],Yo={class:`min-w-0 flex-1`},Xo={class:`text-sm font-medium text-content-primary dark:text-content-primary group-hover:text-cyan-700 dark:group-hover:text-primary transition-colors`},Zo={class:`text-xs text-content-secondary dark:text-content-muted`},Qo=[`href`],$o={key:0,class:`flex flex-col items-center justify-center py-7 rounded-lg border-2 border-dashed border-stroke-subtle dark:border-stroke/20 text-content-secondary dark:text-content-muted`},es={key:1,class:`space-y-2`},ts={key:0,class:`flex items-center gap-3 px-4 py-2.5`},ns={class:`min-w-0 flex-1`},rs={class:`text-sm font-medium text-content-primary dark:text-content-primary`},is={class:`text-xs font-mono text-content-secondary dark:text-content-muted ml-2`},as={key:0,class:`ml-2 text-xs text-red-500 dark:text-red-400`},os={class:`flex items-center gap-0.5 flex-shrink-0`},ss=[`onClick`],cs=[`onClick`],ls={key:1,class:`p-4 space-y-3 bg-background-mute/60 dark:bg-background/20`},us={class:`grid grid-cols-1 sm:grid-cols-2 gap-3`},ds={class:`flex items-center gap-2 pt-1`},fs=[`disabled`],ps=[`onClick`],ms={class:`flex flex-wrap gap-2`},hs=[`onClick`],gs={key:0,class:`p-3 rounded-lg bg-green-50 dark:bg-green-900/20 border border-green-200 dark:border-green-700/30 text-green-700 dark:text-green-400 text-sm`},_s={key:1,class:`p-3 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-700/30 text-red-700 dark:text-red-400 text-sm`},vs={class:`flex items-center gap-3 pt-2`},ys=[`disabled`],bs={key:0},xs={key:1},Ss=[`disabled`],Cs=M(f({__name:`LetsMeshSettings`,setup(e){let n=j(),r=y(()=>n.stats?.config?.letsmesh||{}),a=[`REQ`,`RESPONSE`,`TXT_MSG`,`ACK`,`ADVERT`,`GRP_TXT`,`GRP_DATA`,`ANON_REQ`,`PATH`,`TRACE`,`RAW_CUSTOM`],s=[{value:0,label:`Letsmesh Europe only (EU v1)`},{value:1,label:`Letsmesh US West only (US v1)`},{value:-1,label:`All built-in brokers (EU + US)`},{value:-2,label:`Custom brokers only`}],c=[{name:`waev.app`,website:`https://waev.app`,brokers:[{name:`waev.app (Primary)`,host:`mqtt-a.waev.app`,port:443,audience:`mqtt.waev.app`},{name:`waev.app (Secondary)`,host:`mqtt-b.waev.app`,port:443,audience:`mqtt.waev.app`}]},{name:`MeshMapper`,website:`https://meshmapper.net`,brokers:[{name:`MeshMapper`,host:`mqtt.meshmapper.cc`,port:443,audience:`mqtt.meshmapper.cc`}]}],l=E(!1),d=E(!1),f=E(``),p=E(``),T=E(!1),D=E(``),O=E(0),A=E(300),M=E(``),P=E(``),F=E([]),L=E([]),B=E(null),V=E({_id:0,name:``,host:``,port:443,audience:``}),H=E(!1);function U(e){H.value=!1,B.value!==null&&K(),e.brokers.forEach(e=>{let t=G(e);L.value.push(t)})}let W=1;function G(e={}){return{_id:W++,name:e.name??``,host:e.host??``,port:e.port??443,audience:e.audience??``}}function ee(){let e=G();L.value.push(e),V.value={...e},B.value=e._id}function te(e){L.value=L.value.filter(t=>t._id!==e),B.value===e&&(B.value=null)}function ne(e){V.value={...e},B.value=e._id}function re(){B.value=null}function K(){let e=V.value;if(!e.name.trim()||!e.host.trim()||!e.audience.trim())return;let t=L.value.findIndex(t=>t._id===e._id);t!==-1&&L.value.splice(t,1,{...e}),B.value=null}function q(){let e=V.value,t=L.value.find(t=>t._id===e._id);(!e.audience||e.audience===(t?.host??``))&&(e.audience=e.host)}let J=y(()=>{let e={};return L.value.forEach(t=>{t.name.trim()?t.host.trim()?t.audience.trim()?(t.port<1||t.port>65535)&&(e[t._id]=`Port must be 1–65535`):e[t._id]=`Audience required`:e[t._id]=`Host required`:e[t._id]=`Name required`}),e}),Y=y(()=>Object.keys(J.value).length>0),X=E(null),Z=E(!1);async function Q(){Z.value=!0;try{let e=await k.get(`/api/letsmesh_status`);e.data?.success&&(X.value=e.data.data)}catch{}finally{Z.value=!1}}function $(){let e=r.value;T.value=e.enabled??!1,D.value=e.iata_code??``,O.value=e.broker_index??0,A.value=e.status_interval??300,M.value=e.owner??``,P.value=e.email??``,F.value=Array.isArray(e.disallowed_packet_types)?[...e.disallowed_packet_types]:[],L.value=Array.isArray(e.additional_brokers)?e.additional_brokers.map(e=>G(e)):[]}h(r,()=>{l.value||$()},{immediate:!0});function ie(){$(),B.value=null,l.value=!0,f.value=``,p.value=``}function ae(){B.value=null,l.value=!1,f.value=``,p.value=``}function oe(e){let t=F.value.indexOf(e);t===-1?F.value.push(e):F.value.splice(t,1)}async function se(){if(B.value!==null&&K(),Y.value){p.value=`Please fix broker errors before saving.`;return}d.value=!0,p.value=``,f.value=``;try{let e=(await k.post(`/api/update_letsmesh_config`,{enabled:T.value,iata_code:D.value,broker_index:O.value,status_interval:A.value,owner:M.value,email:P.value,disallowed_packet_types:F.value,additional_brokers:L.value.map(({name:e,host:t,port:n,audience:r})=>({name:e,host:t,port:n,audience:r}))})).data;e?.success?(f.value=e.data?.message||`Settings saved`,l.value=!1,await n.fetchStats(),await Q(),setTimeout(()=>{f.value=``},5e3)):p.value=e?.error||`Save failed`}catch(e){let t=e;p.value=t?.response?.data?.error||t?.message||`Request failed`}finally{d.value=!1}}return o(Q),(e,n)=>(w(),C(`div`,so,[S(`div`,co,[S(`div`,lo,[n[13]||=S(`div`,null,[S(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-1`},` Observer Status `),S(`p`,{class:`text-sm text-content-secondary dark:text-content-muted`},` Live broker connection state `)],-1),S(`button`,{onClick:Q,disabled:Z.value,class:`px-3 py-1.5 text-xs rounded-lg bg-cyan-500/10 dark:bg-primary/10 hover:bg-cyan-500/20 dark:hover:bg-primary/20 text-cyan-700 dark:text-primary border border-cyan-400/30 dark:border-primary/30 transition-colors disabled:opacity-50`},[Z.value?(w(),C(`span`,fo,`Refreshing…`)):(w(),C(`span`,po,`↻ Refresh`))],8,uo)]),X.value?(w(),C(`div`,ho,[S(`div`,go,[n[14]||=S(`span`,{class:`text-sm text-content-secondary dark:text-content-muted w-36`},`Handler`,-1),S(`span`,{class:_([`inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium`,X.value.handler_active?`bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400`:`bg-gray-100 dark:bg-gray-800/50 text-gray-500 dark:text-gray-400`])},[S(`span`,{class:_([`w-1.5 h-1.5 rounded-full`,X.value.handler_active?`bg-green-500`:`bg-gray-400`])},null,2),b(` `+u(X.value.handler_active?`Active`:`Inactive`),1)],2)]),X.value.brokers.length?(w(),C(`div`,_o,[(w(!0),C(x,null,i(X.value.brokers,e=>(w(),C(`div`,{key:e.host,class:`flex items-center gap-2`},[S(`span`,{class:`text-sm text-content-secondary dark:text-content-muted w-36 truncate`,title:e.name},u(e.name),9,vo),S(`span`,{class:_([`inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium`,e.connected?`bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400`:e.reconnecting?`bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400`:`bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400`])},[S(`span`,{class:_([`w-1.5 h-1.5 rounded-full`,e.connected?`bg-green-500`:e.reconnecting?`bg-amber-500`:`bg-red-500`])},null,2),b(` `+u(e.connected?`Connected`:e.reconnecting?`Reconnecting…`:`Disconnected`),1)],2)]))),128))])):(w(),C(`div`,yo,` No broker connections configured. `))])):(w(),C(`div`,mo,` Status unavailable — service may not be running. `))]),S(`div`,bo,[S(`div`,xo,[n[15]||=S(`div`,null,[S(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-1`},` Observer Configuration `),S(`p`,{class:`text-sm text-content-secondary dark:text-content-muted`},` Configure MQTT observer settings `)],-1),l.value?g(``,!0):(w(),C(`button`,{key:0,onClick:ie,class:`px-4 py-2 text-sm rounded-lg bg-cyan-500/10 dark:bg-primary/10 hover:bg-cyan-500/20 dark:hover:bg-primary/20 text-cyan-700 dark:text-primary border border-cyan-400/30 dark:border-primary/30 transition-colors`},` Edit `))]),l.value?(w(),C(`div`,Ro,[S(`div`,zo,[n[24]||=S(`div`,null,[S(`label`,{class:`text-sm font-medium text-content-primary dark:text-content-primary`},`Enable Observer`),S(`p`,{class:`text-xs text-content-secondary dark:text-content-muted mt-0.5`},` Publish mesh packets to the MQTT networks `)],-1),S(`button`,{onClick:n[0]||=e=>T.value=!T.value,class:_([`relative inline-flex h-6 w-11 items-center rounded-full transition-colors border-2`,T.value?`bg-cyan-600 dark:bg-teal-500 border-cyan-600 dark:border-teal-500`:`bg-gray-400 dark:bg-gray-600 border-gray-400 dark:border-gray-600`])},[S(`span`,{class:_([`inline-block h-4 w-4 transform rounded-full bg-white transition-transform shadow-lg`,T.value?`translate-x-5`:`translate-x-0.5`])},null,2)],2)]),S(`div`,Bo,[S(`div`,null,[n[25]||=S(`label`,{class:`block text-sm font-medium text-content-primary dark:text-content-primary mb-1.5`},[b(` IATA Code `),S(`span`,{class:`text-content-secondary dark:text-content-muted font-normal text-xs ml-1`},`(e.g. SFO, LHR)`)],-1),m(S(`input`,{"onUpdate:modelValue":n[1]||=e=>D.value=e,type:`text`,maxlength:`10`,placeholder:`TEST`,class:`w-full px-3 py-2 text-sm rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40 font-mono`},null,512),[[N,D.value]])]),S(`div`,null,[n[26]||=S(`label`,{class:`block text-sm font-medium text-content-primary dark:text-content-primary mb-1.5`},`Broker Mode`,-1),m(S(`select`,{"onUpdate:modelValue":n[2]||=e=>O.value=e,class:`w-full px-3 py-2 text-sm rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40`},[(w(),C(x,null,i(s,e=>S(`option`,{key:e.value,value:e.value},u(e.label),9,Vo)),64))],512),[[z,O.value,void 0,{number:!0}]])])]),S(`div`,Ho,[S(`div`,null,[n[27]||=S(`label`,{class:`block text-sm font-medium text-content-primary dark:text-content-primary mb-1.5`},`Owner / Callsign`,-1),m(S(`input`,{"onUpdate:modelValue":n[3]||=e=>M.value=e,type:`text`,placeholder:`Optional`,class:`w-full px-3 py-2 text-sm rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40`},null,512),[[N,M.value]])]),S(`div`,null,[n[28]||=S(`label`,{class:`block text-sm font-medium text-content-primary dark:text-content-primary mb-1.5`},`Email`,-1),m(S(`input`,{"onUpdate:modelValue":n[4]||=e=>P.value=e,type:`email`,placeholder:`Optional`,class:`w-full px-3 py-2 text-sm rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40`},null,512),[[N,P.value]])])]),S(`div`,null,[n[29]||=S(`label`,{class:`block text-sm font-medium text-content-primary dark:text-content-primary mb-1.5`},[b(` Status Heartbeat Interval `),S(`span`,{class:`text-content-secondary dark:text-content-muted font-normal text-xs ml-1`},`(seconds, min 60)`)],-1),m(S(`input`,{"onUpdate:modelValue":n[5]||=e=>A.value=e,type:`number`,min:`60`,max:`3600`,class:`w-32 px-3 py-2 text-sm rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40 font-mono`},null,512),[[N,A.value,void 0,{number:!0}]])]),S(`div`,null,[S(`div`,Uo,[n[36]||=S(`div`,{class:`min-w-0`},[S(`label`,{class:`text-sm font-medium text-content-primary dark:text-content-primary`},`Custom Brokers`),S(`p`,{class:`text-xs text-content-secondary dark:text-content-muted mt-0.5`},` Additional MQTT/WebSocket brokers alongside or instead of built-in ones `)],-1),S(`div`,Wo,[S(`div`,Go,[S(`button`,{onClick:n[6]||=e=>H.value=!H.value,class:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg bg-background-mute dark:bg-background/30 hover:bg-stroke-subtle dark:hover:bg-stroke/10 text-content-secondary dark:text-content-muted border border-stroke-subtle dark:border-stroke/20 transition-colors`},[n[31]||=S(`svg`,{class:`w-3.5 h-3.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 11H5m14 0l-4-4m4 4l-4 4`})],-1),n[32]||=b(` From Template `,-1),(w(),C(`svg`,{class:_([`w-3 h-3 ml-0.5 transition-transform`,H.value?`rotate-180`:``]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...n[30]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 9l-7 7-7-7`},null,-1)]],2))]),v(R,{name:`dropdown`},{default:t(()=>[H.value?(w(),C(`div`,Ko,[n[34]||=S(`div`,{class:`px-3 py-2 border-b border-stroke-subtle dark:border-stroke/10`},[S(`p`,{class:`text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide`},` Known Networks `)],-1),S(`div`,qo,[(w(),C(x,null,i(c,e=>S(`div`,{key:e.name,class:`flex items-center gap-2 px-3 py-2.5 hover:bg-background-mute dark:hover:bg-background/30 cursor-pointer group`,onClick:t=>U(e)},[S(`div`,Yo,[S(`p`,Xo,u(e.name),1),S(`p`,Zo,u(e.brokers.length)+` broker`+u(e.brokers.length===1?``:`s`),1)]),S(`a`,{href:e.website,target:`_blank`,rel:`noopener noreferrer`,title:`Visit website`,class:`flex-shrink-0 p-1 rounded hover:bg-cyan-500/10 dark:hover:bg-primary/10 text-content-secondary dark:text-content-muted hover:text-cyan-700 dark:hover:text-primary transition-colors`,onClick:n[7]||=I(()=>{},[`stop`])},[...n[33]||=[S(`svg`,{class:`w-3.5 h-3.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14`})],-1)]],8,Qo)],8,Jo)),64))])])):g(``,!0)]),_:1}),H.value?(w(),C(`div`,{key:0,class:`fixed inset-0 z-10`,onClick:n[8]||=e=>H.value=!1})):g(``,!0)]),S(`button`,{onClick:ee,class:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium rounded-lg bg-cyan-500/10 dark:bg-primary/10 hover:bg-cyan-500/20 dark:hover:bg-primary/20 text-cyan-700 dark:text-primary border border-cyan-400/30 dark:border-primary/30 transition-colors`},[...n[35]||=[S(`svg`,{class:`w-3.5 h-3.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})],-1),b(` Add `,-1)]])])]),L.value.length?(w(),C(`div`,es,[(w(!0),C(x,null,i(L.value,e=>(w(),C(`div`,{key:e._id,class:_([`rounded-lg border overflow-hidden transition-colors`,J.value[e._id]?`border-red-300 dark:border-red-700/50`:`border-stroke-subtle dark:border-stroke/10`])},[B.value===e._id?(w(),C(`div`,ls,[S(`div`,us,[S(`div`,null,[n[40]||=S(`label`,{class:`block text-xs font-medium text-content-secondary dark:text-content-muted mb-1`},[b(` Name `),S(`span`,{class:`text-red-500`},`*`)],-1),m(S(`input`,{"onUpdate:modelValue":n[9]||=e=>V.value.name=e,type:`text`,placeholder:`My Private Broker`,class:`w-full px-3 py-1.5 text-sm rounded-md bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40`},null,512),[[N,V.value.name]])]),S(`div`,null,[n[41]||=S(`label`,{class:`block text-xs font-medium text-content-secondary dark:text-content-muted mb-1`},[b(` Port `),S(`span`,{class:`text-red-500`},`*`)],-1),m(S(`input`,{"onUpdate:modelValue":n[10]||=e=>V.value.port=e,type:`number`,min:`1`,max:`65535`,placeholder:`443`,class:`w-full px-3 py-1.5 text-sm rounded-md bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40 font-mono`},null,512),[[N,V.value.port,void 0,{number:!0}]])]),S(`div`,null,[n[42]||=S(`label`,{class:`block text-xs font-medium text-content-secondary dark:text-content-muted mb-1`},[b(` Host `),S(`span`,{class:`text-red-500`},`*`)],-1),m(S(`input`,{"onUpdate:modelValue":n[11]||=e=>V.value.host=e,type:`text`,placeholder:`mqtt.myserver.com`,onInput:q,class:`w-full px-3 py-1.5 text-sm rounded-md bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40 font-mono`},null,544),[[N,V.value.host]])]),S(`div`,null,[n[43]||=S(`label`,{class:`block text-xs font-medium text-content-secondary dark:text-content-muted mb-1`},[b(` Audience `),S(`span`,{class:`text-red-500`},`*`),S(`span`,{class:`font-normal text-content-muted dark:text-content-muted/60 ml-1`},`(JWT aud — usually same as host)`)],-1),m(S(`input`,{"onUpdate:modelValue":n[12]||=e=>V.value.audience=e,type:`text`,placeholder:`mqtt.myserver.com`,class:`w-full px-3 py-1.5 text-sm rounded-md bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary placeholder-content-muted dark:placeholder-content-muted/50 focus:outline-none focus:ring-2 focus:ring-cyan-500/40 dark:focus:ring-primary/40 font-mono`},null,512),[[N,V.value.audience]])])]),S(`div`,ds,[S(`button`,{onClick:K,disabled:!V.value.name.trim()||!V.value.host.trim()||!V.value.audience.trim(),class:`px-3 py-1.5 text-xs font-medium rounded-md bg-cyan-600 dark:bg-teal-600 hover:bg-cyan-700 dark:hover:bg-teal-700 text-white transition-colors disabled:opacity-40 disabled:cursor-not-allowed`},` Done `,8,fs),S(`button`,{onClick:re,class:`px-3 py-1.5 text-xs rounded-md border border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-stroke/10 text-content-secondary dark:text-content-muted transition-colors`},` Cancel `),S(`button`,{onClick:t=>te(e._id),class:`ml-auto px-3 py-1.5 text-xs rounded-md border border-red-300/60 dark:border-red-700/30 hover:bg-red-50 dark:hover:bg-red-900/20 text-red-600 dark:text-red-400 transition-colors`},` Remove `,8,ps)])])):(w(),C(`div`,ts,[S(`div`,ns,[S(`span`,rs,u(e.name||`(unnamed)`),1),S(`span`,is,u(e.host||`—`)+`:`+u(e.port),1),J.value[e._id]?(w(),C(`span`,as,u(J.value[e._id]),1)):g(``,!0)]),S(`div`,os,[S(`button`,{onClick:t=>ne(e),title:`Edit`,class:`p-1.5 rounded hover:bg-cyan-500/10 dark:hover:bg-primary/10 text-content-secondary dark:text-content-muted hover:text-cyan-700 dark:hover:text-primary transition-colors`},[...n[38]||=[S(`svg`,{class:`w-3.5 h-3.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z`})],-1)]],8,ss),S(`button`,{onClick:t=>te(e._id),title:`Remove`,class:`p-1.5 rounded hover:bg-red-500/10 dark:hover:bg-red-900/20 text-content-secondary dark:text-content-muted hover:text-red-600 dark:hover:text-red-400 transition-colors`},[...n[39]||=[S(`svg`,{class:`w-3.5 h-3.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})],-1)]],8,cs)])]))],2))),128))])):(w(),C(`div`,$o,[...n[37]||=[S(`svg`,{class:`w-7 h-7 mb-2 opacity-40`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`1.5`,d:`M5 12h14M5 12l4-4m-4 4l4 4`})],-1),S(`p`,{class:`text-sm`},`No custom brokers`,-1),S(`p`,{class:`text-xs mt-0.5 opacity-70`},` Built-in brokers will be used based on the mode above `,-1)]])),n[44]||=S(`p`,{class:`mt-2 text-xs text-content-secondary dark:text-content-muted`},[b(` Set `),S(`span`,{class:`font-medium`},`Broker Mode`),b(` to `),S(`em`,null,`Custom brokers only`),b(` to use exclusively these servers, or leave it on any other mode to use them alongside the built-in ones. `)],-1)]),S(`div`,null,[n[45]||=S(`label`,{class:`block text-sm font-medium text-content-primary dark:text-content-primary mb-2`},[b(` Block Packet Types `),S(`span`,{class:`text-content-secondary dark:text-content-muted font-normal text-xs ml-1`},`(prevent publishing to LetsMesh)`)],-1),S(`div`,ms,[(w(),C(x,null,i(a,e=>S(`button`,{key:e,onClick:t=>oe(e),class:_([`px-2.5 py-1 rounded text-xs font-mono font-medium border transition-colors`,F.value.includes(e)?`bg-red-100 dark:bg-red-900/30 border-red-300 dark:border-red-700/50 text-red-700 dark:text-red-400`:`bg-background-mute dark:bg-background/30 border-stroke-subtle dark:border-stroke/20 text-content-secondary dark:text-content-muted hover:border-cyan-400/50 dark:hover:border-primary/40`])},u(e),11,hs)),64))]),n[46]||=S(`p`,{class:`mt-1.5 text-xs text-content-secondary dark:text-content-muted`},[S(`span`,{class:`text-red-600 dark:text-red-400 font-medium`},`Red = blocked.`),b(` Leave all unselected to publish all packet types. `)],-1)]),n[47]||=S(`div`,{class:`flex items-start gap-2 p-3 rounded-lg bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-700/30 text-amber-700 dark:text-amber-400 text-xs`},[S(`svg`,{class:`w-4 h-4 mt-0.5 flex-shrink-0`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z`})]),b(` A service restart is required for changes to take effect. `)],-1),f.value?(w(),C(`div`,gs,u(f.value),1)):g(``,!0),p.value?(w(),C(`div`,_s,u(p.value),1)):g(``,!0),S(`div`,vs,[S(`button`,{onClick:se,disabled:d.value||Y.value,class:`px-5 py-2 text-sm font-medium rounded-lg bg-cyan-600 dark:bg-teal-600 hover:bg-cyan-700 dark:hover:bg-teal-700 text-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed`},[d.value?(w(),C(`span`,bs,`Saving…`)):(w(),C(`span`,xs,`Save Settings`))],8,ys),S(`button`,{onClick:ae,disabled:d.value,class:`px-4 py-2 text-sm rounded-lg bg-background-mute dark:bg-background/30 hover:bg-stroke-subtle dark:hover:bg-stroke/10 text-content-secondary dark:text-content-muted border border-stroke-subtle dark:border-stroke/20 transition-colors disabled:opacity-50`},` Cancel `,8,Ss)])])):(w(),C(`div`,So,[S(`div`,Co,[S(`div`,null,[n[16]||=S(`span`,{class:`text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide`},`Enabled`,-1),S(`p`,wo,[S(`span`,{class:_([`inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-medium`,r.value.enabled?`bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400`:`bg-gray-100 dark:bg-gray-800/50 text-gray-500 dark:text-gray-400`])},u(r.value.enabled?`Yes`:`No`),3)])]),S(`div`,null,[n[17]||=S(`span`,{class:`text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide`},`IATA Code`,-1),S(`p`,To,u(r.value.iata_code||`—`),1)]),S(`div`,null,[n[18]||=S(`span`,{class:`text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide`},`Broker Mode`,-1),S(`p`,Eo,u(s.find(e=>e.value===r.value.broker_index)?.label??`Index ${r.value.broker_index??0}`),1)]),S(`div`,null,[n[19]||=S(`span`,{class:`text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide`},`Status Interval`,-1),S(`p`,Do,u(r.value.status_interval??300)+`s `,1)]),S(`div`,null,[n[20]||=S(`span`,{class:`text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide`},`Owner`,-1),S(`p`,Oo,u(r.value.owner||`—`),1)]),S(`div`,null,[n[21]||=S(`span`,{class:`text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide`},`Email`,-1),S(`p`,ko,u(r.value.email||`—`),1)])]),S(`div`,null,[n[22]||=S(`span`,{class:`text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide`},`Custom Brokers`,-1),r.value.additional_brokers?.length?(w(),C(`div`,jo,[(w(!0),C(x,null,i(r.value.additional_brokers,e=>(w(),C(`div`,{key:e.host,class:`flex items-center gap-3 px-3 py-2 rounded-lg bg-background-mute dark:bg-background/30 border border-stroke-subtle dark:border-stroke/10`},[S(`div`,Mo,[S(`span`,No,u(e.name),1),S(`span`,Po,u(e.host)+`:`+u(e.port),1)]),S(`span`,{class:`text-xs text-content-secondary dark:text-content-muted font-mono truncate max-w-[140px]`,title:e.audience},u(e.audience),9,Fo)]))),128))])):(w(),C(`div`,Ao,` None configured `))]),S(`div`,null,[n[23]||=S(`span`,{class:`text-xs font-medium text-content-secondary dark:text-content-muted uppercase tracking-wide`},`Blocked Packet Types`,-1),S(`div`,Io,[r.value.disallowed_packet_types?.length?g(``,!0):(w(),C(`span`,Lo,`All types allowed`)),(w(!0),C(x,null,i(r.value.disallowed_packet_types,e=>(w(),C(`span`,{key:e,class:`px-2 py-0.5 rounded text-xs font-mono bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400`},u(e),1))),128))])])]))])]))}}),[[`__scopeId`,`data-v-a170107f`]]),ws={class:`space-y-6`},Ts={key:0,class:`rounded-lg border-2 border-red-500/50 dark:border-red-400/40 bg-red-100 dark:bg-red-500/10 p-4`},Es={class:`glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6`},Ds=[`disabled`],Os={key:0,class:`flex items-center gap-2`},ks={key:1,class:`flex items-center gap-2`},As={key:0,class:`text-xs text-green-600 dark:text-green-400 mt-2`},js={key:1,class:`text-xs text-red-500 dark:text-red-400 mt-2`},Ms={class:`glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6`},Ns={key:0},Ps={key:1,class:`rounded-lg border-2 border-red-500/50 dark:border-red-400/40 bg-red-50 dark:bg-red-500/10 p-4`},Fs={class:`flex items-start gap-3`},Is={class:`flex-1`},Ls={class:`text-xs text-red-600 dark:text-red-400/80 mt-1`},Rs={class:`flex gap-2 mt-3`},zs=[`disabled`],Bs=[`disabled`],Vs={key:2,class:`text-xs text-green-600 dark:text-green-400 mt-2`},Hs={key:3,class:`text-xs text-red-500 dark:text-red-400 mt-2`},Us={class:`glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6`},Ws={class:`space-y-3`},Gs={class:`flex items-center gap-3 cursor-pointer px-4 py-3 bg-background-mute dark:bg-background/30 rounded-lg border-2 border-dashed border-stroke-subtle dark:border-stroke/20 hover:border-cyan-500/50 dark:hover:border-primary/50 transition-colors`},Ks={class:`text-sm text-content-secondary dark:text-content-muted`},qs={key:0,class:`bg-background-mute dark:bg-background/30 rounded-lg p-4 border border-stroke-subtle dark:border-stroke/10`},Js={key:0,class:`text-xs text-content-secondary dark:text-content-muted space-y-1 mb-3`},Ys={class:`font-mono`},Xs={class:`font-mono`},Zs={key:0,class:`text-amber-600 dark:text-amber-400 font-medium`},Qs={key:1,class:`text-content-muted`},$s={class:`text-xs text-content-secondary dark:text-content-muted`},ec={class:`font-mono`},tc={key:1},nc={key:2,class:`rounded-lg border-2 border-amber-500/50 dark:border-amber-400/40 bg-amber-50 dark:bg-amber-500/10 p-4`},rc={class:`flex items-start gap-3`},ic={class:`flex-1`},ac={class:`text-xs text-amber-700 dark:text-amber-300/80 mt-1`},oc={class:`flex gap-2 mt-3`},sc=[`disabled`],cc=[`disabled`],lc={key:3,class:`text-xs text-green-600 dark:text-green-400 mt-2`},uc={key:4,class:`text-xs text-red-500 dark:text-red-400 mt-2`},dc={class:`glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6`},fc={key:0},pc={key:1,class:`rounded-lg border-2 border-red-500/50 dark:border-red-400/40 bg-red-50 dark:bg-red-500/10 p-4`},mc={class:`flex items-start gap-3`},hc={class:`flex-1`},gc={class:`text-xs text-red-600 dark:text-red-400/80 mt-1`},_c={class:`flex gap-2 mt-3`},vc=[`disabled`],yc=[`disabled`],bc={key:2,class:`bg-background-mute dark:bg-background/30 rounded-lg p-4 border border-stroke-subtle dark:border-stroke/10 space-y-2`},xc={class:`flex items-center justify-between`},Sc={class:`text-xs text-content-secondary dark:text-content-muted space-y-1`},Cc={class:`font-mono`},wc={key:0},Tc={class:`font-mono`},Ec={key:1},Dc={class:`font-mono text-[10px] break-all`},Oc={key:3,class:`text-xs text-red-500 dark:text-red-400 mt-2`},kc=f({__name:`BackupRestore`,setup(e){let t=y(()=>window.location.protocol===`http:`),n=E(!1),r=E(``),i=E(``);async function a(){n.value=!0,r.value=``,i.value=``;try{let e=await A.exportConfig(!1);if(!e.success||!e.data){i.value=e.error||`Export failed`;return}let t=new Blob([JSON.stringify(e.data,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),a=document.createElement(`a`);a.href=n,a.download=`pymc-repeater-settings-${(e.data.meta?.exported_at||new Date().toISOString()).replace(/[:.]/g,`-`)}.json`,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(n),r.value=`Settings exported successfully (secrets redacted).`}catch(e){i.value=e instanceof Error?e.message:`Export failed`}finally{n.value=!1}}let o=E(!1),s=E(!1),c=E(``),l=E(``);async function f(){s.value=!0,c.value=``,l.value=``;try{let e=await A.exportConfig(!0);if(!e.success||!e.data){l.value=e.error||`Export failed`;return}let t=new Blob([JSON.stringify(e.data,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`pymc-repeater-full-backup-${(e.data.meta?.exported_at||new Date().toISOString()).replace(/[:.]/g,`-`)}.json`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n),c.value=`Full backup exported (includes all secrets).`,o.value=!1}catch(e){l.value=e instanceof Error?e.message:`Export failed`}finally{s.value=!1}}let p=E(null),m=E(null),h=E(!1),_=E(!1),v=E(``),T=E(``),D=E(null),O=y(()=>m.value?.config?Object.keys(m.value.config).join(`, `):``),k=y(()=>{let e=m.value?.meta?.includes_secrets;return e===!0||e===`true`});function j(e){let t=e.target.files?.[0];if(!t)return;p.value=t,m.value=null,h.value=!1,v.value=``,T.value=``;let n=new FileReader;n.onload=e=>{try{let t=JSON.parse(e.target?.result);t.config&&typeof t.config==`object`?m.value={meta:t.meta,config:t.config}:typeof t==`object`&&!Array.isArray(t)?m.value={config:t}:T.value=`Invalid file format — expected a JSON config object.`}catch{T.value=`Invalid JSON file.`}},n.readAsText(t)}function M(){h.value=!1,m.value=null,p.value=null,D.value&&(D.value.value=``)}async function N(){if(m.value?.config){_.value=!0,v.value=``,T.value=``;try{let e=await A.importConfig(m.value.config);if(e.success){let t=e.data,n=e.message||t?.message||`Configuration imported.`;t?.restart_required&&(n+=` A service restart is required for radio changes to take effect.`),v.value=n,h.value=!1,m.value=null,p.value=null,D.value&&(D.value.value=``)}else T.value=e.error||`Import failed`}catch(e){T.value=e instanceof Error?e.message:`Import failed`}finally{_.value=!1}}}let P=E(!1),F=E(!1),I=E(null),L=E(``);async function R(){F.value=!0,L.value=``;try{let e=await A.exportIdentityKey();if(!e.success||!e.data){L.value=e.error||`Export failed`;return}I.value=e.data;let t=new Blob([e.data.identity_key_hex],{type:`text/plain`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`pymc-identity-${e.data.node_address||`key`}.hex`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}catch(e){L.value=e instanceof Error?e.message:`Export failed`}finally{F.value=!1}}return(e,y)=>(w(),C(`div`,ws,[t.value?(w(),C(`div`,Ts,[...y[6]||=[d(`

Unencrypted Connection

This page is served over HTTP, not HTTPS. Exported data (including identity keys) will be transmitted in plain text. Only use these features on a trusted local network.

`,1)]])):g(``,!0),S(`div`,Es,[y[9]||=S(`div`,{class:`flex items-start justify-between mb-4`},[S(`div`,null,[S(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-1`},` Export Settings `),S(`p`,{class:`text-sm text-content-secondary dark:text-content-muted`},[b(` Download the current configuration as a JSON file. Passwords, JWT secrets, and identity keys are `),S(`strong`,null,`redacted`),b(`. Safe to share or use as a template for other devices. `)])])],-1),S(`button`,{onClick:a,disabled:n.value,class:`px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed text-sm`},[n.value?(w(),C(`span`,Os,[...y[7]||=[S(`span`,{class:`animate-spin w-4 h-4 border-2 border-current border-t-transparent rounded-full inline-block`},null,-1),b(` Exporting… `,-1)]])):(w(),C(`span`,ks,[...y[8]||=[S(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4`})],-1),b(` Export Settings `,-1)]]))],8,Ds),r.value?(w(),C(`p`,As,u(r.value),1)):g(``,!0),i.value?(w(),C(`p`,js,u(i.value),1)):g(``,!0)]),S(`div`,Ms,[y[15]||=d(`

Full Backup

Download a complete backup including all passwords, JWT secrets, and identity keys. Required for restoring to a new device or recovering from a failed SD card.

Contains sensitive data. The backup file will include plain-text passwords and private keys. Store it securely and never share it.

`,2),o.value?g(``,!0):(w(),C(`div`,Ns,[S(`button`,{onClick:y[0]||=e=>o.value=!0,class:`px-4 py-2 bg-red-500/20 dark:bg-red-400/20 hover:bg-red-500/30 dark:hover:bg-red-400/30 text-red-900 dark:text-red-200 rounded-lg border border-red-500/50 dark:border-red-400/40 transition-colors text-sm`},[...y[10]||=[S(`span`,{class:`flex items-center gap-2`},[S(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z`})]),b(` Full Backup `)],-1)]])])),o.value?(w(),C(`div`,Ps,[S(`div`,Fs,[y[14]||=S(`svg`,{class:`w-5 h-5 text-red-600 dark:text-red-400 shrink-0 mt-0.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z`})],-1),S(`div`,Is,[y[13]||=S(`h4`,{class:`text-sm font-semibold text-red-700 dark:text-red-400`},` Confirm Full Backup `,-1),S(`p`,Ls,[y[11]||=b(` This will export `,-1),y[12]||=S(`strong`,null,`all secrets in plain text`,-1),b(` including admin/guest passwords, JWT secret, and your repeater's private identity key`+u(t.value?` over an unencrypted HTTP connection`:``)+`. `,1)]),S(`div`,Rs,[S(`button`,{onClick:f,disabled:s.value,class:`px-4 py-2 bg-red-600 hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600 text-white rounded-lg transition-colors text-sm disabled:opacity-50`},u(s.value?`Exporting…`:`Yes, Export Full Backup`),9,zs),S(`button`,{onClick:y[1]||=e=>o.value=!1,disabled:s.value,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors text-sm`},` Cancel `,8,Bs)])])])])):g(``,!0),c.value?(w(),C(`p`,Vs,u(c.value),1)):g(``,!0),l.value?(w(),C(`p`,Hs,u(l.value),1)):g(``,!0)]),S(`div`,Us,[y[29]||=S(`div`,{class:`flex items-start justify-between mb-4`},[S(`div`,null,[S(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-1`},` Import Configuration `),S(`p`,{class:`text-sm text-content-secondary dark:text-content-muted`},[b(` Restore configuration from a previously exported JSON file. Importing a `),S(`strong`,null,`full backup`),b(` will also restore passwords and identity keys. Importing a `),S(`strong`,null,`settings export`),b(` will only update non-sensitive settings. `)])])],-1),S(`div`,Ws,[S(`label`,Gs,[y[16]||=S(`svg`,{class:`w-5 h-5 text-content-secondary dark:text-content-muted`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12`})],-1),S(`span`,Ks,u(p.value?p.value.name:`Choose a config JSON file…`),1),S(`input`,{ref_key:`fileInputRef`,ref:D,type:`file`,accept:`.json,application/json`,class:`hidden`,onChange:j},null,544)]),m.value?(w(),C(`div`,qs,[y[20]||=S(`h4`,{class:`text-sm font-medium text-content-primary dark:text-content-primary mb-2`},` Import Preview `,-1),m.value.meta?(w(),C(`div`,Js,[S(`p`,null,[y[17]||=b(` Exported: `,-1),S(`span`,Ys,u(m.value.meta.exported_at),1)]),S(`p`,null,[y[18]||=b(` Version: `,-1),S(`span`,Xs,u(m.value.meta.version),1)]),m.value.meta.includes_secrets===`true`||m.value.meta.includes_secrets===!0?(w(),C(`p`,Zs,` ⚠ Full backup — will restore passwords and identity keys `)):(w(),C(`p`,Qs,` Settings only — existing secrets will not be changed `))])):g(``,!0),S(`p`,$s,[y[19]||=b(` Sections: `,-1),S(`span`,ec,u(O.value),1)])])):g(``,!0),m.value&&!h.value?(w(),C(`div`,tc,[S(`button`,{onClick:y[2]||=e=>h.value=!0,class:`px-4 py-2 bg-amber-500/20 dark:bg-amber-400/20 hover:bg-amber-500/30 dark:hover:bg-amber-400/30 text-amber-900 dark:text-amber-200 rounded-lg border border-amber-500/50 dark:border-amber-400/40 transition-colors text-sm`},` Review & Import `)])):g(``,!0),h.value?(w(),C(`div`,nc,[S(`div`,rc,[y[28]||=S(`svg`,{class:`w-5 h-5 text-amber-600 dark:text-amber-400 shrink-0 mt-0.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z`})],-1),S(`div`,ic,[y[27]||=S(`h4`,{class:`text-sm font-semibold text-amber-800 dark:text-amber-300`},` Confirm Import `,-1),S(`p`,ac,[y[24]||=b(` This will overwrite current settings for: `,-1),S(`strong`,null,u(O.value),1),y[25]||=b(`. `,-1),k.value?(w(),C(x,{key:0},[y[21]||=b(` This is a full backup — `,-1),y[22]||=S(`strong`,null,`passwords, JWT secrets, and identity keys will also be overwritten`,-1),y[23]||=b(`. `,-1)],64)):(w(),C(x,{key:1},[b(` Passwords and identity keys will not be changed. `)],64)),y[26]||=b(` Some changes (radio settings) require a service restart. `,-1)]),S(`div`,oc,[S(`button`,{onClick:N,disabled:_.value,class:`px-4 py-2 bg-amber-600 hover:bg-amber-700 dark:bg-amber-500 dark:hover:bg-amber-600 text-white rounded-lg transition-colors text-sm disabled:opacity-50`},u(_.value?`Importing…`:`Yes, Import`),9,sc),S(`button`,{onClick:M,disabled:_.value,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors text-sm`},` Cancel `,8,cc)])])])])):g(``,!0),v.value?(w(),C(`p`,lc,u(v.value),1)):g(``,!0),T.value?(w(),C(`p`,uc,u(T.value),1)):g(``,!0)])]),S(`div`,dc,[y[38]||=d(`

Export Identity Key

Download the repeater's private identity key for backup. This key determines the node's address and cryptographic identity on the mesh.

Sensitive data. The identity key is the repeater's private key. Anyone with this key can impersonate your node. Store the exported file securely and never share it.

`,2),P.value?g(``,!0):(w(),C(`div`,fc,[S(`button`,{onClick:y[3]||=e=>P.value=!0,class:`px-4 py-2 bg-red-500/20 dark:bg-red-400/20 hover:bg-red-500/30 dark:hover:bg-red-400/30 text-red-900 dark:text-red-200 rounded-lg border border-red-500/50 dark:border-red-400/40 transition-colors text-sm`},[...y[30]||=[S(`span`,{class:`flex items-center gap-2`},[S(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z`})]),b(` Export Identity Key `)],-1)]])])),P.value&&!I.value?(w(),C(`div`,pc,[S(`div`,mc,[y[32]||=S(`svg`,{class:`w-5 h-5 text-red-600 dark:text-red-400 shrink-0 mt-0.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z`})],-1),S(`div`,hc,[y[31]||=S(`h4`,{class:`text-sm font-semibold text-red-700 dark:text-red-400`},`Are you sure?`,-1),S(`p`,gc,` This will transmit your private key `+u(t.value?`over an unencrypted HTTP connection. `:``)+` and download it as a file. `,1),S(`div`,_c,[S(`button`,{onClick:R,disabled:F.value,class:`px-4 py-2 bg-red-600 hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600 text-white rounded-lg transition-colors text-sm disabled:opacity-50`},u(F.value?`Exporting…`:`Yes, Export Key`),9,vc),S(`button`,{onClick:y[4]||=e=>P.value=!1,disabled:F.value,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors text-sm`},` Cancel `,8,yc)])])])])):g(``,!0),I.value?(w(),C(`div`,bc,[S(`div`,xc,[y[33]||=S(`h4`,{class:`text-sm font-medium text-content-primary dark:text-content-primary`},` Key Exported `,-1),S(`button`,{onClick:y[5]||=e=>{I.value=null,P.value=!1},class:`text-xs text-content-muted hover:text-content-secondary transition-colors`},` Dismiss `)]),S(`div`,Sc,[S(`p`,null,[y[34]||=b(` Key length: `,-1),S(`span`,Cc,u(I.value.key_length_bytes)+` bytes`,1)]),I.value.node_address?(w(),C(`p`,wc,[y[35]||=b(` Node address: `,-1),S(`span`,Tc,u(I.value.node_address),1)])):g(``,!0),I.value.public_key_hex?(w(),C(`p`,Ec,[y[36]||=b(` Public key: `,-1),S(`span`,Dc,u(I.value.public_key_hex),1)])):g(``,!0)]),y[37]||=S(`p`,{class:`text-xs text-green-600 dark:text-green-400`},`File downloaded successfully.`,-1)])):g(``,!0),L.value?(w(),C(`p`,Oc,u(L.value),1)):g(``,!0)])]))}}),Ac={class:`space-y-6`},jc={class:`glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6`},Mc={class:`flex items-start justify-between mb-4`},Nc=[`disabled`],Pc={key:0,class:`flex items-center gap-1.5`},Fc={key:1},Ic={key:0,class:`grid grid-cols-2 sm:grid-cols-4 gap-3 mb-6`},Lc={class:`bg-background-mute dark:bg-background/30 rounded-lg p-3 border border-stroke-subtle dark:border-stroke/10`},Rc={class:`text-lg font-semibold text-content-primary dark:text-content-primary font-mono`},zc={class:`bg-background-mute dark:bg-background/30 rounded-lg p-3 border border-stroke-subtle dark:border-stroke/10`},Bc={class:`text-lg font-semibold text-content-primary dark:text-content-primary font-mono`},Vc={class:`bg-background-mute dark:bg-background/30 rounded-lg p-3 border border-stroke-subtle dark:border-stroke/10`},Hc={class:`text-lg font-semibold text-content-primary dark:text-content-primary font-mono`},Uc={class:`bg-background-mute dark:bg-background/30 rounded-lg p-3 border border-stroke-subtle dark:border-stroke/10`},Wc={class:`text-lg font-semibold text-content-primary dark:text-content-primary font-mono`},Gc={key:1,class:`flex items-center justify-center py-12`},Kc={key:2,class:`rounded-lg border border-red-500/30 dark:border-red-400/30 bg-red-50 dark:bg-red-500/10 p-3 mb-4`},qc={class:`text-xs text-red-700 dark:text-red-400`},Jc={key:3},Yc={class:`overflow-x-auto`},Xc={class:`w-full text-sm`},Zc={class:`py-2.5 pr-4`},Qc={class:`font-mono text-content-primary dark:text-content-primary`},$c={class:`py-2.5 pr-4 text-right`},el={class:`font-mono text-content-secondary dark:text-content-muted`},tl={class:`py-2.5 pr-4 text-right hidden sm:table-cell`},nl={key:0,class:`text-xs text-content-muted`},rl={class:`text-content-muted/60 ml-1`},il={key:1,class:`text-xs text-content-muted/50`},al={key:2,class:`text-xs text-content-muted/50`},ol={class:`py-2.5 text-right`},sl=[`onClick`,`disabled`],cl={key:0,class:`flex items-center gap-1`},ll={key:1},ul={key:1,class:`text-xs text-content-muted/50`},dl={key:0,class:`glass-card rounded-lg border-2 border-red-500/50 dark:border-red-400/40 bg-red-50 dark:bg-red-500/10 p-6`},fl={class:`flex items-start gap-3`},pl={class:`flex-1`},ml={class:`text-sm font-semibold text-red-700 dark:text-red-400`},hl={class:`text-xs text-red-600 dark:text-red-400/80 mt-1`},gl={class:`flex gap-2 mt-3`},_l=[`disabled`],vl=[`disabled`],yl={class:`glass-card rounded-lg border border-stroke-subtle dark:border-stroke/10 p-6`},bl={class:`flex flex-wrap gap-3`},xl=[`disabled`],Sl=[`disabled`],Cl={class:`flex items-center gap-2`},wl={key:0,class:`text-xs text-green-600 dark:text-green-400 mt-3`},Tl={key:1,class:`text-xs text-green-600 dark:text-green-400 mt-3`},El=f({__name:`DatabaseManagement`,setup(e){let t=new Set([`packets`,`adverts`,`noise_floor`,`crc_errors`,`room_messages`,`room_client_sync`,`companion_contacts`,`companion_channels`,`companion_messages`,`companion_prefs`]),n=E(!1),r=E(``),a=E(null),s=E({}),c=E(null),l=E(``),d=E(!1),f=E(``),p=y(()=>a.value?a.value.tables.reduce((e,t)=>e+t.row_count,0):0);function m(e){return t.has(e)}function h(e){if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`],n=Math.min(Math.floor(Math.log(e)/Math.log(1024)),t.length-1),r=e/1024**n;return`${r<10?r.toFixed(1):Math.round(r)} ${t[n]}`}function _(e){return e?new Date(e*1e3).toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`}):`—`}function v(e,t){return!e||!t?0:Math.max(1,Math.round((t-e)/86400))}async function T(){n.value=!0,r.value=``;try{let e=await A.getDbStats();e.success&&e.data?a.value=e.data:r.value=e.error||`Failed to load database stats`}catch(e){r.value=e instanceof Error?e.message:`Failed to load database stats`}finally{n.value=!1}}function D(e,t){l.value=``,c.value={table:e,rowCount:t,executing:!1}}async function O(){if(!c.value)return;let{table:e}=c.value;c.value.executing=!0,l.value=``;try{let t=e===`all`?`all`:[e];e!==`all`&&(s.value[e]=!0);let n=await A.purgeTable(t);if(n.success){let t=n.data||{};l.value=`Deleted ${Object.values(t).reduce((e,t)=>e+(t.deleted||0),0).toLocaleString()} rows${e===`all`?` from all tables`:` from ${e}`}.`,c.value=null,await T()}else r.value=n.error||`Purge failed`,c.value=null}catch(e){r.value=e instanceof Error?e.message:`Purge failed`,c.value=null}finally{e!==`all`&&(s.value[e]=!1)}}async function k(){d.value=!0,f.value=``,r.value=``;try{let e=await A.vacuumDb();if(e.success&&e.data){let t=e.data.freed_bytes;f.value=t>0?`Compacted database — freed ${h(t)} (${h(e.data.size_before)} → ${h(e.data.size_after)}).`:`Database already compact (${h(e.data.size_after)}).`,await T()}else r.value=e.error||`Vacuum failed`}catch(e){r.value=e instanceof Error?e.message:`Vacuum failed`}finally{d.value=!1}}return o(T),(e,t)=>(w(),C(`div`,Ac,[S(`div`,jc,[S(`div`,Mc,[t[3]||=S(`div`,null,[S(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-1`},` Database Overview `),S(`p`,{class:`text-sm text-content-secondary dark:text-content-muted`},` Storage usage and table statistics for the repeater database. `)],-1),S(`button`,{onClick:T,disabled:n.value,class:`px-3 py-1.5 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors text-sm disabled:opacity-50`},[n.value?(w(),C(`span`,Pc,[...t[2]||=[S(`span`,{class:`animate-spin w-3.5 h-3.5 border-2 border-current border-t-transparent rounded-full inline-block`},null,-1),b(` Loading… `,-1)]])):(w(),C(`span`,Fc,`Refresh`))],8,Nc)]),a.value?(w(),C(`div`,Ic,[S(`div`,Lc,[t[4]||=S(`p`,{class:`text-xs text-content-muted mb-1`},`Database Size`,-1),S(`p`,Rc,u(h(a.value.database_size_bytes)),1)]),S(`div`,zc,[t[5]||=S(`p`,{class:`text-xs text-content-muted mb-1`},`RRD Metrics`,-1),S(`p`,Bc,u(h(a.value.rrd_size_bytes)),1)]),S(`div`,Vc,[t[6]||=S(`p`,{class:`text-xs text-content-muted mb-1`},`Total Size`,-1),S(`p`,Hc,u(h(a.value.database_size_bytes+a.value.rrd_size_bytes)),1)]),S(`div`,Uc,[t[7]||=S(`p`,{class:`text-xs text-content-muted mb-1`},`Total Rows`,-1),S(`p`,Wc,u(p.value.toLocaleString()),1)])])):g(``,!0),n.value&&!a.value?(w(),C(`div`,Gc,[...t[8]||=[S(`div`,{class:`text-center`},[S(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4`}),S(`div`,{class:`text-content-secondary dark:text-content-muted`},`Loading database info…`)],-1)]])):g(``,!0),r.value?(w(),C(`div`,Kc,[S(`p`,qc,u(r.value),1)])):g(``,!0),a.value&&a.value.tables.length>0?(w(),C(`div`,Jc,[S(`div`,Yc,[S(`table`,Xc,[t[10]||=S(`thead`,null,[S(`tr`,{class:`border-b border-stroke-subtle dark:border-stroke/10`},[S(`th`,{class:`text-left py-2 pr-4 text-xs font-medium text-content-muted uppercase tracking-wider`},` Table `),S(`th`,{class:`text-right py-2 pr-4 text-xs font-medium text-content-muted uppercase tracking-wider`},` Rows `),S(`th`,{class:`text-right py-2 pr-4 text-xs font-medium text-content-muted uppercase tracking-wider hidden sm:table-cell`},` Date Range `),S(`th`,{class:`text-right py-2 text-xs font-medium text-content-muted uppercase tracking-wider`},` Actions `)])],-1),S(`tbody`,null,[(w(!0),C(x,null,i(a.value.tables,e=>(w(),C(`tr`,{key:e.name,class:`border-b border-stroke-subtle/50 dark:border-stroke/5`},[S(`td`,Zc,[S(`span`,Qc,u(e.name),1)]),S(`td`,$c,[S(`span`,el,u(e.row_count.toLocaleString()),1)]),S(`td`,tl,[e.has_timestamp&&e.row_count>0?(w(),C(`span`,nl,[b(u(_(e.oldest_timestamp))+` — `+u(_(e.newest_timestamp))+` `,1),S(`span`,rl,`(`+u(v(e.oldest_timestamp,e.newest_timestamp))+`d)`,1)])):e.row_count===0?(w(),C(`span`,il,`—`)):(w(),C(`span`,al,`n/a`))]),S(`td`,ol,[m(e.name)&&e.row_count>0?(w(),C(`button`,{key:0,onClick:t=>D(e.name,e.row_count),disabled:s.value[e.name],class:`px-2.5 py-1 bg-red-500/10 dark:bg-red-400/10 hover:bg-red-500/20 dark:hover:bg-red-400/20 text-red-700 dark:text-red-400 rounded border border-red-500/30 dark:border-red-400/20 transition-colors text-xs disabled:opacity-50`},[s.value[e.name]?(w(),C(`span`,cl,[...t[9]||=[S(`span`,{class:`animate-spin w-3 h-3 border border-current border-t-transparent rounded-full inline-block`},null,-1),b(` Purging… `,-1)]])):(w(),C(`span`,ll,`Empty`))],8,sl)):m(e.name)?g(``,!0):(w(),C(`span`,ul,`—`))])]))),128))])])])])):g(``,!0)]),c.value?(w(),C(`div`,dl,[S(`div`,fl,[t[16]||=S(`svg`,{class:`w-5 h-5 text-red-600 dark:text-red-400 shrink-0 mt-0.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z`})],-1),S(`div`,pl,[S(`h4`,ml,u(c.value.table===`all`?`Confirm Purge All Tables`:`Confirm Purge "${c.value.table}"`),1),S(`p`,hl,[c.value.table===`all`?(w(),C(x,{key:0},[t[11]||=b(` This will permanently delete `,-1),t[12]||=S(`strong`,null,`all data`,-1),b(` from every data table (`+u(p.value.toLocaleString())+` rows total). This cannot be undone. `,1)],64)):(w(),C(x,{key:1},[t[13]||=b(` This will permanently delete `,-1),S(`strong`,null,u(c.value.rowCount.toLocaleString())+` rows`,1),t[14]||=b(` from `,-1),S(`strong`,null,u(c.value.table),1),t[15]||=b(`. This cannot be undone. `,-1)],64))]),S(`div`,gl,[S(`button`,{onClick:O,disabled:c.value.executing,class:`px-4 py-2 bg-red-600 hover:bg-red-700 dark:bg-red-500 dark:hover:bg-red-600 text-white rounded-lg transition-colors text-sm disabled:opacity-50`},u(c.value.executing?`Purging…`:`Yes, Delete Data`),9,_l),S(`button`,{onClick:t[0]||=e=>c.value=null,disabled:c.value.executing,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors text-sm`},` Cancel `,8,vl)])])])])):g(``,!0),S(`div`,yl,[t[19]||=S(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-4`},` Maintenance `,-1),S(`div`,bl,[S(`button`,{onClick:t[1]||=e=>D(`all`,p.value),disabled:!a.value||p.value===0,class:`px-4 py-2 bg-red-500/20 dark:bg-red-400/20 hover:bg-red-500/30 dark:hover:bg-red-400/30 text-red-900 dark:text-red-200 rounded-lg border border-red-500/50 dark:border-red-400/40 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed`},[...t[17]||=[S(`span`,{class:`flex items-center gap-2`},[S(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})]),b(` Purge All Data `)],-1)]],8,xl),S(`button`,{onClick:k,disabled:d.value||!a.value,class:`px-4 py-2 bg-amber-500/20 dark:bg-amber-400/20 hover:bg-amber-500/30 dark:hover:bg-amber-400/30 text-amber-900 dark:text-amber-200 rounded-lg border border-amber-500/50 dark:border-amber-400/40 transition-colors text-sm disabled:opacity-50 disabled:cursor-not-allowed`},[S(`span`,Cl,[t[18]||=S(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`})],-1),b(` `+u(d.value?`Compacting…`:`Compact Database`),1)])],8,Sl)]),f.value?(w(),C(`p`,wl,u(f.value),1)):g(``,!0),l.value?(w(),C(`p`,Tl,u(l.value),1)):g(``,!0)])]))}}),Dl={class:`p-3 sm:p-6 space-y-4 sm:space-y-6`},Ol={class:`glass-card rounded-[15px] z-10 p-3 sm:p-4 border border-cyan-400 dark:border-primary/30 bg-cyan-500/10 dark:bg-primary/10`},kl={class:`text-cyan-700 dark:text-primary text-sm sm:text-base`},Al={class:`mt-1 sm:mt-2 text-cyan-600 dark:text-primary/80`},jl={class:`glass-card rounded-[15px] p-3 sm:p-6`},Ml={class:`relative -mx-3 sm:mx-0 mb-4 sm:mb-6`},Nl={key:0,class:`absolute left-0 top-0 bottom-[1px] w-12 z-10 flex items-center`},Pl={key:0,class:`absolute right-0 top-0 bottom-[1px] w-12 z-10 flex items-center justify-end`},Fl=[`onClick`],Il={class:`flex items-center gap-1 sm:gap-2`},Ll={key:0,class:`w-3.5 h-3.5 sm:w-4 sm:h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Rl={key:1,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},zl={key:2,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Bl={key:3,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Vl={key:4,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Hl={key:5,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Ul={key:6,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Wl={key:7,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Gl={key:8,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Kl={key:9,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},ql={key:10,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Jl={class:`min-h-[400px]`},Yl={key:0,class:`flex items-center justify-center py-12`},Xl={key:1,class:`flex items-center justify-center py-12`},Zl={class:`text-center`},Ql={class:`text-content-secondary dark:text-content-muted text-sm mb-4`},$l={key:2},eu=M(f({name:`ConfigurationView`,__name:`Configuration`,setup(e){let n=j(),a=E(H(`configuration_activeTab`,`radio`)),l=E(!1),d=E(null),f=E(!1),p=E(!1);function y(){if(!d.value)return;let e=d.value;p.value=e.scrollLeft>4,f.value=e.scrollLeftV(`configuration_activeTab`,e));let D=[{id:`radio`,label:`Radio Settings`,icon:`radio`},{id:`repeater`,label:`Repeater Settings`,icon:`repeater`},{id:`advert`,label:`Advert Limits`,icon:`advert`},{id:`duty`,label:`Duty Cycle`,icon:`duty`},{id:`delays`,label:`TX Delays`,icon:`delays`},{id:`transport`,label:`Regions/Keys`,icon:`keys`},{id:`api-tokens`,label:`API Tokens`,icon:`tokens`},{id:`web`,label:`Web Options`,icon:`web`},{id:`observer`,label:`Observer`,icon:`observer`},{id:`backup`,label:`Backup`,icon:`backup`},{id:`database`,label:`Database`,icon:`database`}];o(async()=>{try{await n.fetchStats(),l.value=!0}catch(e){console.error(`Failed to load configuration data:`,e),l.value=!0}c(()=>y())});function O(e){a.value=e}return(e,o)=>{let c=r(`router-link`);return w(),C(`div`,Dl,[o[23]||=S(`div`,null,[S(`h1`,{class:`text-xl sm:text-2xl font-bold text-content-primary dark:text-content-primary`},` Configuration `),S(`p`,{class:`text-content-secondary dark:text-content-muted mt-1 sm:mt-2 text-sm sm:text-base`},` System configuration and settings `)],-1),S(`div`,Ol,[S(`div`,kl,[o[5]||=S(`strong`,null,`CAD Calibration Tool Available`,-1),S(`p`,Al,[o[4]||=b(` Optimize your Channel Activity Detection settings. `,-1),v(c,{to:`/cad-calibration`,class:`underline hover:text-cyan-800 dark:hover:text-primary transition-colors`},{default:t(()=>[...o[3]||=[b(` Launch CAD Calibration Tool → `,-1)]]),_:1})])])]),S(`div`,jl,[S(`div`,Ml,[v(R,{name:`tab-fade`},{default:t(()=>[p.value?(w(),C(`div`,Nl,[o[7]||=S(`div`,{class:`tab-fade-left absolute inset-0 pointer-events-none`},null,-1),S(`button`,{onClick:o[0]||=e=>T(`left`),class:`relative z-10 ml-1.5 w-6 h-6 flex items-center justify-center rounded-full bg-white dark:bg-zinc-900 shadow-md border border-gray-200 dark:border-white/10 text-gray-500 dark:text-gray-300`},[...o[6]||=[S(`svg`,{class:`w-3 h-3`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2.5`,d:`M15 19l-7-7 7-7`})],-1)]])])):g(``,!0)]),_:1}),v(R,{name:`tab-fade`},{default:t(()=>[f.value?(w(),C(`div`,Pl,[o[9]||=S(`div`,{class:`tab-fade-right absolute inset-0 pointer-events-none`},null,-1),S(`button`,{onClick:o[1]||=e=>T(`right`),class:`relative z-10 mr-1.5 w-6 h-6 flex items-center justify-center rounded-full bg-white dark:bg-zinc-900 shadow-md border border-gray-200 dark:border-white/10 text-gray-500 dark:text-gray-300`},[...o[8]||=[S(`svg`,{class:`w-3 h-3`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2.5`,d:`M9 5l7 7-7 7`})],-1)]])])):g(``,!0)]),_:1}),S(`div`,{ref_key:`tabsContainer`,ref:d,onScroll:y,class:`flex overflow-x-auto border-b border-stroke-subtle dark:border-stroke/10 px-3 sm:px-0 scrollbar-hide`},[(w(),C(x,null,i(D,e=>S(`button`,{key:e.id,onClick:t=>O(e.id),class:_([`px-3 sm:px-4 py-2 text-xs sm:text-sm font-medium transition-colors duration-200 border-b-2 mr-3 sm:mr-6 whitespace-nowrap flex-shrink-0`,a.value===e.id?`text-cyan-500 dark:text-primary border-cyan-500 dark:border-primary`:`text-content-secondary dark:text-content-muted border-transparent hover:text-content-primary dark:hover:text-content-primary hover:border-stroke-subtle dark:hover:border-stroke/30`])},[S(`div`,Il,[e.icon===`radio`?(w(),C(`svg`,Ll,[...o[10]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.822c5.716-5.716 14.976-5.716 20.692 0`},null,-1)]])):e.icon===`repeater`?(w(),C(`svg`,Rl,[...o[11]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 12h14M5 12l4-4m-4 4l4 4`},null,-1)]])):e.icon===`advert`?(w(),C(`svg`,zl,[...o[12]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z`},null,-1)]])):e.icon===`duty`?(w(),C(`svg`,Bl,[...o[13]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`},null,-1)]])):e.icon===`delays`?(w(),C(`svg`,Vl,[...o[14]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z`},null,-1)]])):e.icon===`keys`?(w(),C(`svg`,Hl,[...o[15]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z`},null,-1)]])):e.icon===`tokens`?(w(),C(`svg`,Ul,[...o[16]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z`},null,-1)]])):e.icon===`web`?(w(),C(`svg`,Wl,[...o[17]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9`},null,-1)]])):e.icon===`observer`?(w(),C(`svg`,Gl,[...o[18]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z`},null,-1)]])):e.icon===`backup`?(w(),C(`svg`,Kl,[...o[19]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4`},null,-1)]])):e.icon===`database`?(w(),C(`svg`,ql,[...o[20]||=[S(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4`},null,-1)]])):g(``,!0),b(` `+u(e.label),1)])],10,Fl)),64))],544)]),S(`div`,Jl,[!l.value&&s(n).isLoading?(w(),C(`div`,Yl,[...o[21]||=[S(`div`,{class:`text-center`},[S(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4`}),S(`div`,{class:`text-content-secondary dark:text-content-muted`},` Loading configuration... `)],-1)]])):s(n).error&&!l.value?(w(),C(`div`,Xl,[S(`div`,Zl,[o[22]||=S(`div`,{class:`text-red-500 dark:text-red-400 mb-2`},`Failed to load configuration`,-1),S(`div`,Ql,u(s(n).error),1),S(`button`,{onClick:o[2]||=e=>s(n).fetchStats(),class:`px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors`},` Retry `)])])):(w(),C(`div`,$l,[m(S(`div`,null,[v(ve,{key:`radio-settings`})],512),[[P,a.value===`radio`]]),m(S(`div`,null,[v(xt,{key:`repeater-settings`})],512),[[P,a.value===`repeater`]]),m(S(`div`,null,[v(oo,{key:`advert-settings`})],512),[[P,a.value===`advert`]]),m(S(`div`,null,[v(Nt,{key:`duty-cycle`})],512),[[P,a.value===`duty`]]),m(S(`div`,null,[v(qt,{key:`transmission-delays`})],512),[[P,a.value===`delays`]]),m(S(`div`,null,[v(qr,{key:`transport-keys`})],512),[[P,a.value===`transport`]]),m(S(`div`,null,[v(xi,{key:`api-tokens`})],512),[[P,a.value===`api-tokens`]]),m(S(`div`,null,[v(Ki,{key:`web-settings`})],512),[[P,a.value===`web`]]),m(S(`div`,null,[v(Cs,{key:`letsmesh-settings`})],512),[[P,a.value===`observer`]]),m(S(`div`,null,[v(kc,{key:`backup-restore`})],512),[[P,a.value===`backup`]]),m(S(`div`,null,[v(El,{key:`database-management`})],512),[[P,a.value===`database`]])]))])])])}}}),[[`__scopeId`,`data-v-f5e6ec18`]]);export{eu as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/ConfirmDialog-BRvNEHEy.js b/repeater/web/html/assets/ConfirmDialog-BRvNEHEy.js new file mode 100644 index 0000000..739dee3 --- /dev/null +++ b/repeater/web/html/assets/ConfirmDialog-BRvNEHEy.js @@ -0,0 +1 @@ +import{dt as e,g as t,l as n,lt as r,s as i,u as a,w as o}from"./runtime-core.esm-bundler-IofF4kUm.js";import{m as s}from"./index-CPWfwDmA.js";var c={class:`flex items-center justify-between mb-4`},l={class:`text-xl font-semibold text-content-primary dark:text-content-primary`},u={class:`mb-6`},d={key:0,class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},f={key:1,class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},p={key:2,class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},m={class:`text-content-secondary dark:text-content-primary/80 text-base leading-relaxed`},h={class:`flex gap-3`},g=t({__name:`ConfirmDialog`,props:{show:{type:Boolean},title:{default:`Confirm Action`},message:{},confirmText:{default:`Confirm`},cancelText:{default:`Cancel`},variant:{default:`warning`}},emits:[`close`,`confirm`],setup(t,{emit:g}){let _=t,v=g,y=e=>{e.target===e.currentTarget&&v(`close`)},b={danger:`bg-red-100 dark:bg-red-500/20 border-red-500/30 text-red-600 dark:text-red-400`,warning:`bg-yellow-100 dark:bg-yellow-500/20 border-yellow-500/30 text-yellow-600 dark:text-yellow-400`,info:`bg-blue-500/20 border-blue-500/30 text-blue-600 dark:text-blue-400`},x={danger:`bg-red-500 hover:bg-red-600`,warning:`bg-yellow-500 hover:bg-yellow-600`,info:`bg-blue-500 hover:bg-blue-600`};return(t,g)=>_.show?(o(),a(`div`,{key:0,onClick:y,class:`fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4`,style:{"backdrop-filter":`blur(8px) saturate(180%)`,position:`fixed`,top:`0`,left:`0`,right:`0`,bottom:`0`}},[i(`div`,{class:`bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10`,onClick:g[3]||=s(()=>{},[`stop`])},[i(`div`,c,[i(`h3`,l,e(_.title),1),i(`button`,{onClick:g[0]||=e=>v(`close`),class:`text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors`},[...g[4]||=[i(`svg`,{class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[i(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),i(`div`,u,[i(`div`,{class:r([`inline-flex p-3 rounded-xl mb-4`,b[_.variant]])},[_.variant===`danger`?(o(),a(`svg`,d,[...g[5]||=[i(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`},null,-1)]])):_.variant===`warning`?(o(),a(`svg`,f,[...g[6]||=[i(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z`},null,-1)]])):(o(),a(`svg`,p,[...g[7]||=[i(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`},null,-1)]]))],2),i(`p`,m,e(_.message),1)]),i(`div`,h,[i(`button`,{onClick:g[1]||=e=>v(`close`),class:`flex-1 px-4 py-3 rounded-xl bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary transition-all duration-200 border border-stroke-subtle dark:border-stroke/10`},e(_.cancelText),1),i(`button`,{onClick:g[2]||=e=>v(`confirm`),class:r([`flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200`,x[_.variant]])},e(_.confirmText),3)])])])):n(``,!0)}});export{g as t}; \ No newline at end of file diff --git a/repeater/web/html/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-7siCLFWH.js b/repeater/web/html/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-7siCLFWH.js deleted file mode 100644 index 3c49098..0000000 --- a/repeater/web/html/assets/ConfirmDialog.vue_vue_type_script_setup_true_lang-7siCLFWH.js +++ /dev/null @@ -1 +0,0 @@ -import{a as m,e as n,h as p,f as t,x as g,t as s,k as d,q as l}from"./index-xzvnOpJo.js";const f={class:"flex items-center justify-between mb-4"},w={class:"text-xl font-semibold text-content-primary dark:text-content-primary"},v={class:"mb-6"},h={key:0,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},y={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},C={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},B={class:"text-content-secondary dark:text-content-primary/80 text-base leading-relaxed"},M={class:"flex gap-3"},j=m({__name:"ConfirmDialog",props:{show:{type:Boolean},title:{default:"Confirm Action"},message:{},confirmText:{default:"Confirm"},cancelText:{default:"Cancel"},variant:{default:"warning"}},emits:["close","confirm"],setup(c,{emit:b}){const o=c,r=b,k=i=>{i.target===i.currentTarget&&r("close")},u={danger:"bg-red-100 dark:bg-red-500/20 border-red-500/30 text-red-600 dark:text-red-400",warning:"bg-yellow-100 dark:bg-yellow-500/20 border-yellow-500/30 text-yellow-600 dark:text-yellow-400",info:"bg-blue-500/20 border-blue-500/30 text-blue-600 dark:text-blue-400"},x={danger:"bg-red-500 hover:bg-red-600",warning:"bg-yellow-500 hover:bg-yellow-600",info:"bg-blue-500 hover:bg-blue-600"};return(i,e)=>o.show?(l(),n("div",{key:0,onClick:k,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[t("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:e[3]||(e[3]=g(()=>{},["stop"]))},[t("div",f,[t("h3",w,s(o.title),1),t("button",{onClick:e[0]||(e[0]=a=>r("close")),class:"text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},e[4]||(e[4]=[t("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),t("div",v,[t("div",{class:d(["inline-flex p-3 rounded-xl mb-4",u[o.variant]])},[o.variant==="danger"?(l(),n("svg",h,e[5]||(e[5]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)]))):o.variant==="warning"?(l(),n("svg",y,e[6]||(e[6]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"},null,-1)]))):(l(),n("svg",C,e[7]||(e[7]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2),t("p",B,s(o.message),1)]),t("div",M,[t("button",{onClick:e[1]||(e[1]=a=>r("close")),class:"flex-1 px-4 py-3 rounded-xl bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary transition-all duration-200 border border-stroke-subtle dark:border-stroke/10"},s(o.cancelText),1),t("button",{onClick:e[2]||(e[2]=a=>r("confirm")),class:d(["flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200",x[o.variant]])},s(o.confirmText),3)])])])):p("",!0)}});export{j as _}; diff --git a/repeater/web/html/assets/Dashboard-CUPKHF02.css b/repeater/web/html/assets/Dashboard-CUPKHF02.css new file mode 100644 index 0000000..95d908e --- /dev/null +++ b/repeater/web/html/assets/Dashboard-CUPKHF02.css @@ -0,0 +1 @@ +.sparkline-card[data-v-d5c09182]{-webkit-backdrop-filter:blur(50px);backdrop-filter:blur(50px);background:#ffffffbf;border:1px solid #0000000f;border-radius:12px;padding:12px 14px;transition:background .3s,border-color .3s,box-shadow .3s;overflow:hidden;box-shadow:0 4px 16px #0000000a,0 1px 3px #00000005}.dark .sparkline-card[data-v-d5c09182]{background:#0006;border:1px solid #ffffff0d;box-shadow:0 4px 16px #0003}.card-header[data-v-d5c09182]{justify-content:space-between;align-items:baseline;margin-bottom:8px;display:flex}.card-title[data-v-d5c09182]{color:#4b5563b3;text-transform:uppercase;letter-spacing:.05em;font-size:11px;font-weight:500;transition:color .3s}.dark .card-title[data-v-d5c09182]{color:#fff9}.card-value[data-v-d5c09182]{font-variant-numeric:tabular-nums;font-size:22px;font-weight:700;line-height:1}.card-values[data-v-d5c09182]{align-items:baseline;gap:6px;display:flex}.card-secondary-value[data-v-d5c09182]{font-variant-numeric:tabular-nums;opacity:.85;font-size:13px;font-weight:600;line-height:1}.card-chart[data-v-d5c09182]{width:100%;height:28px;overflow:hidden}.card-chart canvas[data-v-d5c09182]{width:100%!important;height:100%!important}@media (width>=1024px){.sparkline-card[data-v-d5c09182]{padding:14px 16px}.card-header[data-v-d5c09182]{margin-bottom:10px}.card-title[data-v-d5c09182]{font-size:12px}.card-value[data-v-d5c09182]{font-size:26px}.card-chart[data-v-d5c09182]{height:32px}}.stats-cards-container[data-v-7b4043f7]{will-change:auto;contain:layout}.stat-card[data-v-7b4043f7]{transition:opacity .3s ease-out}.stat-card[data-v-7b4043f7] .text-lg,.stat-card[data-v-7b4043f7] .text-\[30px\]{transition:color .2s ease-out}canvas[data-v-501b1337]{width:100%;height:100%}.modal-enter-active[data-v-c8711b75]{transition:all .3s cubic-bezier(.4,0,.2,1)}.modal-leave-active[data-v-c8711b75]{transition:all .2s ease-in}.modal-enter-from[data-v-c8711b75]{opacity:0;transform:scale(.95)translateY(-10px)}.modal-leave-to[data-v-c8711b75]{opacity:0;transform:scale(1.05)}.custom-scrollbar[data-v-c8711b75]{scrollbar-width:thin;scrollbar-color:#ffffff4d transparent}.custom-scrollbar[data-v-c8711b75]::-webkit-scrollbar{width:6px}.custom-scrollbar[data-v-c8711b75]::-webkit-scrollbar-track{background:#ffffff1a;border-radius:3px}.custom-scrollbar[data-v-c8711b75]::-webkit-scrollbar-thumb{background:#ffffff4d;border-radius:3px}.custom-scrollbar[data-v-c8711b75]::-webkit-scrollbar-thumb:hover{background:#fff6}.glass-card[data-v-c8711b75]{-webkit-backdrop-filter:blur(50px);backdrop-filter:blur(50px)}.fade-enter-active[data-v-d807275b],.fade-leave-active[data-v-d807275b]{transition:opacity .3s ease-out,transform .3s ease-out}.fade-enter-from[data-v-d807275b],.fade-leave-to[data-v-d807275b]{opacity:0;transform:translateY(-10px)}@keyframes spin-d807275b{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin[data-v-d807275b]{animation:.8s linear infinite spin-d807275b}.packet-list-enter-active[data-v-d807275b],.packet-list-leave-active[data-v-d807275b],.packet-list-move[data-v-d807275b]{transition:all .4s ease-out}.packet-list-enter-from[data-v-d807275b]{opacity:0;transform:translateY(-30px)scale(.98)}.packet-list-enter-to[data-v-d807275b],.packet-list-leave-from[data-v-d807275b]{opacity:1;transform:translateY(0)scale(1)}.packet-list-leave-to[data-v-d807275b]{opacity:0;transform:translateY(-20px)scale(.95)}.packet-row[data-v-d807275b]{transition:all .3s;position:relative}.packet-list-enter-active .packet-row[data-v-d807275b]{background:linear-gradient(90deg,#4ec9b01a 0%,#4ec9b00d 50%,#0000 100%);border-left:3px solid #4ec9b099;border-radius:8px;padding-left:12px;box-shadow:0 0 20px #4ec9b033}.packet-row[data-v-d807275b]:hover{background:#ffffff05;border-radius:8px;transition:background .2s}@media (width<=1023px){.filter-container[data-v-d807275b]{flex-direction:column;align-items:stretch;gap:1rem}.header-info[data-v-d807275b]{flex-direction:column;align-items:flex-start;gap:.5rem}.packet-count[data-v-d807275b]{order:1}.live-mode-badge[data-v-d807275b]{order:2;align-self:flex-start}.loading-indicator[data-v-d807275b],.error-indicator[data-v-d807275b]{order:3;align-self:flex-start}.filter-controls[data-v-d807275b]{flex-direction:column;grid-template-columns:1fr 1fr;gap:.75rem;display:grid!important}.filter-controls .flex.flex-col[data-v-d807275b]{flex-direction:column;align-items:stretch;gap:.25rem}.filter-controls .flex.flex-col label[data-v-d807275b]{margin-bottom:0;font-size:.75rem}.reset-container[data-v-d807275b]{justify-content:center;margin-top:.5rem;display:flex;grid-column:span 2!important}.pagination-container[data-v-d807275b]{flex-direction:column;align-items:stretch;gap:1rem}.pagination-info[data-v-d807275b]{text-align:center;flex-direction:column;justify-content:center;gap:.5rem}.load-more-section[data-v-d807275b]{justify-content:center}.load-more-count[data-v-d807275b]{display:none}.pagination-controls[data-v-d807275b]{justify-content:center}.page-numbers[data-v-d807275b]{scrollbar-width:none;-ms-overflow-style:none;max-width:200px;overflow-x:auto}.page-numbers[data-v-d807275b]::-webkit-scrollbar{display:none}.ellipsis[data-v-d807275b]{display:none}.page-number[data-v-d807275b]{flex-shrink:0;min-width:40px}}@media (width<=640px){.filter-controls[data-v-d807275b]{gap:.75rem;grid-template-columns:1fr!important}.reset-container[data-v-d807275b]{grid-column:span 1!important}.header-info h3[data-v-d807275b]{font-size:1.125rem}.packet-count[data-v-d807275b]{font-size:.75rem}.live-mode-badge[data-v-d807275b]{padding:.25rem .5rem;font-size:.75rem}.pagination-info span[data-v-d807275b]{font-size:.75rem}.prev-next-btn[data-v-d807275b]{min-width:40px;padding:.5rem}.page-numbers[data-v-d807275b]{gap:.25rem;max-width:150px}.page-number[data-v-d807275b]{min-width:36px;padding:.5rem .25rem;font-size:.75rem}.load-more-section button[data-v-d807275b]{padding:.375rem .75rem;font-size:.6rem}} diff --git a/repeater/web/html/assets/Dashboard-CtkpxqA5.js b/repeater/web/html/assets/Dashboard-CtkpxqA5.js new file mode 100644 index 0000000..0a6861b --- /dev/null +++ b/repeater/web/html/assets/Dashboard-CtkpxqA5.js @@ -0,0 +1,2 @@ +import{A as e,E as t,I as n,S as r,W as i,b as a,c as o,dt as s,f as c,g as l,i as u,j as d,k as f,l as p,lt as m,m as h,o as g,p as _,r as v,s as y,u as b,ut as x,w as S,x as C,z as w}from"./runtime-core.esm-bundler-IofF4kUm.js";import{t as T}from"./api-CrUX-ZnK.js";import{t as E}from"./system-CCY_Ibb-.js";import{t as D}from"./packets-BxrAyCoo.js";import{t as O}from"./_plugin-vue_export-helper-V-yks4gF.js";import{a as k,m as A,s as j,u as M}from"./index-CPWfwDmA.js";import{n as N,t as P}from"./preferences-N3Pls1rF.js";import{a as F,c as I,i as L,l as R,m as ee,s as te,u as z}from"./chart-DdrINt9G.js";import{t as ne}from"./useSignalQuality-hIA9BjQx.js";var B={class:`sparkline-card`},re={class:`card-header`},ie={class:`card-title`},ae={class:`card-values`},oe={class:`card-chart`},V=O(l({name:`ChartSparkline`,__name:`ChartSparkline`,props:{title:{},value:{},color:{},data:{default:()=>[]},showChart:{type:Boolean,default:!0},secondaryValue:{default:void 0},secondaryLabel:{default:``},secondaryColor:{default:``},secondaryData:{default:()=>[]}},setup(e){F.register(L,R,z,I,te,ee);let t=e,i=w(null),o=w(null),c=e=>{if(e.length<3)return e;let t=Math.min(15,Math.max(3,Math.floor(e.length*.2))),n=[];for(let r=0;re+t,0)/s.length)}let r=Math.min(12,n.length),i=n.length/r,a=[];for(let e=0;e!t.data||t.data.length===0?[]:c(t.data)),u=g(()=>!t.secondaryData||t.secondaryData.length===0?[]:c(t.secondaryData)),d=()=>{if(!i.value)return;let e=i.value.getContext(`2d`);if(!e)return;o.value&&=(o.value.destroy(),null);let r=l.value;if(r.length<2)return;let a=[{data:r,borderColor:t.color,borderWidth:2.5,fill:!1,tension:.4,pointRadius:0,pointHoverRadius:0}],s=u.value;s.length>=2&&t.secondaryColor&&a.push({data:s,borderColor:t.secondaryColor,borderWidth:2,borderDash:[4,3],fill:!1,tension:.4,pointRadius:0,pointHoverRadius:0}),o.value=n(new F(e,{type:`line`,data:{labels:r.map((e,t)=>t.toString()),datasets:a},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:800,easing:`easeOutQuart`},plugins:{legend:{display:!1},tooltip:{enabled:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1},grace:`10%`}},elements:{line:{capBezierPoints:!0}}}}))},m=()=>{if(!o.value){d();return}let e=l.value;if(e.length<2)return;o.value.data.labels=e.map((e,t)=>t.toString()),o.value.data.datasets[0].data=e;let n=u.value;n.length>=2&&t.secondaryColor&&(o.value.data.datasets.length<2?o.value.data.datasets.push({data:n,borderColor:t.secondaryColor,borderWidth:2,borderDash:[4,3],fill:!1,tension:.4,pointRadius:0,pointHoverRadius:0}):o.value.data.datasets[1].data=n),o.value.update(`default`)};return f(()=>t.data,()=>{a(()=>m())},{deep:!0}),f(()=>t.color,()=>{o.value&&(o.value.data.datasets[0].borderColor=t.color,o.value.update(`none`))}),r(()=>{a(()=>d())}),C(()=>{o.value&&=(o.value.destroy(),null)}),(t,n)=>(S(),b(`div`,B,[y(`div`,re,[y(`p`,ie,s(e.title),1),y(`div`,ae,[y(`span`,{class:`card-value`,style:x({color:e.color})},s(typeof e.value==`number`?e.value.toLocaleString():e.value),5),e.secondaryValue===void 0?p(``,!0):(S(),b(`span`,{key:0,class:`card-secondary-value`,style:x({color:e.secondaryColor})},s(e.secondaryLabel)+s(typeof e.secondaryValue==`number`?e.secondaryValue.toLocaleString():e.secondaryValue),5))])]),y(`div`,oe,[e.showChart?(S(),b(`canvas`,{key:0,ref_key:`canvasRef`,ref:i},null,512)):p(``,!0)])]))}}),[[`__scopeId`,`data-v-d5c09182`]]),H={class:`grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3 lg:gap-4 mb-5 stats-cards-container`},U=O(l({name:`StatsCards`,__name:`StatsCards`,setup(e){let t=D(),n=k(),i=w(null),o=w(null),s=w(!1),c=g(()=>{let e=t.packetStats,n=t.systemStats,r=e=>{let t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t>0?`${t}d ${n}h`:n>0?`${n}h ${r}m`:`${r}m`},i=e?.total_packets||0,a=e?.dropped_packets||0,o=i>0?Math.round(a/i*100):0;return{packetsReceived:i,packetsForwarded:e?.transmitted_packets||0,uptimeFormatted:n?r(n.uptime_seconds||0):`0m`,uptimeHours:n?Math.floor((n.uptime_seconds||0)/3600):0,droppedPackets:a,dropPercent:`${o}%`,signalQuality:Math.round((e?.avg_rssi||0)+120),crcErrorCount:t.crcErrorCount}}),l=g(()=>t.sparklineData),u=async()=>{if(!s.value)try{s.value=!0,await Promise.all([t.fetchSystemStats(),t.fetchPacketStats({hours:24})]),await a()}catch(e){console.error(`Error fetching stats:`,e)}finally{s.value=!1}};return r(async()=>{await t.initializeSparklineHistory(),u(),n.isConnected||(i.value=window.setInterval(u,3e4)),o.value=window.setInterval(()=>{t.interpolateRates()},6e4)}),f(()=>n.isConnected,e=>{e?i.value&&=(clearInterval(i.value),null):i.value||=window.setInterval(u,3e4)}),C(()=>{i.value&&clearInterval(i.value),o.value&&clearInterval(o.value)}),(e,t)=>(S(),b(`div`,H,[h(V,{title:`Up Time`,value:c.value.uptimeFormatted,color:`#EBA0FC`,data:[],showChart:!1,class:`stat-card`},null,8,[`value`]),h(V,{title:`RX Packets`,value:c.value.packetsReceived,color:`#AAE8E8`,data:l.value.totalPackets,class:`stat-card`},null,8,[`value`,`data`]),h(V,{title:`Forward`,value:c.value.packetsForwarded,color:`#FFC246`,data:l.value.transmittedPackets,class:`stat-card`},null,8,[`value`,`data`]),h(V,{title:`Dropped`,value:c.value.droppedPackets,color:`#FB787B`,data:l.value.droppedPackets,class:`stat-card`},null,8,[`value`,`data`]),h(V,{title:`CRC Errors`,value:c.value.crcErrorCount,color:`#F59E0B`,data:l.value.crcErrors,class:`stat-card`},null,8,[`value`,`data`])]))}}),[[`__scopeId`,`data-v-7b4043f7`]]),W={class:`glass-card rounded-[10px] p-4 lg:p-6`},G={class:`h-48 lg:h-56 relative`},K={key:0,class:`absolute inset-0 flex items-center justify-center`},se={key:1,class:`absolute inset-0 flex items-center justify-center`},q={class:`text-red-600 dark:text-red-400 text-sm lg:text-base`},ce={key:2,class:`absolute inset-0 flex items-center justify-center`},J={key:3,class:`h-full flex flex-col`},Y={key:0,class:`absolute top-2 left-1/2 -translate-x-1/2 bg-white/95 dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke rounded-lg px-3 py-2 z-10 pointer-events-none min-w-48`},X={class:`text-content-primary dark:text-content-primary text-sm font-medium mb-1`},le={class:`text-content-primary dark:text-content-primary`},ue={class:`flex-1 flex items-end justify-evenly gap-4 px-4`},de=[`onMouseenter`],Z={class:`text-content-primary dark:text-content-primary text-xs sm:text-sm font-semibold text-center w-full`,style:{"padding-bottom":`5px`}},fe={class:`text-content-secondary dark:text-content-muted text-xs mt-2 text-center`},pe={key:0,class:`mt-4 flex flex-wrap justify-center gap-3 sm:gap-4 px-2 sm:px-4 text-[10px] sm:text-xs text-content-secondary dark:text-content-muted`},me={class:`truncate text-left`},he={key:1,class:`mt-3 text-xs text-content-secondary dark:text-content-muted text-center`},ge=O(l({name:`PacketTypesChart`,__name:`PacketTypesChart`,setup(e){let n=w([]),i=D(),a=k(),o=w(!0),c=w(null),l=w(null),u=[{name:`Payload`,types:[`Plain Text Message`,`Group Text Message`,`Group Datagram`,`Multi-part Packet`],subColors:[`#3B82F6`,`#60A5FA`,`#93C5FD`,`#BFDBFE`]},{name:`Requests`,types:[`Request`,`Response`,`Anonymous Request`],subColors:[`#10B981`,`#34D399`,`#6EE7B7`]},{name:`Control`,types:[`Node Advertisement`,`Acknowledgment`,`Returned Path`],subColors:[`#F59E0B`,`#FBBF24`,`#FCD34D`]},{name:`Routing`,types:[`Trace`],subColors:[`#8B5CF6`]},{name:`Reserved`,types:[`Reserved Type 11`,`Reserved Type 12`,`Reserved Type 13`],subColors:[`#6B7280`,`#9CA3AF`,`#D1D5DB`]}],d=g(()=>u.map(e=>{let t=n.value.filter(t=>e.types.some(e=>t.name.includes(e)||t.name===e)).sort((e,t)=>t.count-e.count).map((t,n)=>({...t,color:e.subColors[n%e.subColors.length]}));return{name:e.name,color:e.subColors[0],items:t,total:t.reduce((e,t)=>e+t.count,0)}}).filter(e=>e.total>0)),m=g(()=>Math.max(...d.value.map(e=>e.total),1)),h=g(()=>d.value.reduce((e,t)=>e+t.total,0)),_=async()=>{try{c.value=null;let e=await T.get(`/packet_type_graph_data`);if(e?.success&&e?.data){let t=e.data;if(t?.series){let e=[];t.series.forEach((t,n)=>{let r=0;t.data&&Array.isArray(t.data)&&(r=t.data.reduce((e,t)=>e+(t[1]||0),0)),r>0&&e.push({name:t.name||`Type ${t.type}`,type:t.type,count:r,color:``})}),n.value=e,o.value=!1}else c.value=`No series data in server response`,o.value=!1}else c.value=`Invalid response from server`,o.value=!1}catch(e){c.value=e instanceof Error?e.message:`Failed to load data`,o.value=!1}},C={0:`Request`,1:`Response`,2:`Plain Text Message`,3:`Acknowledgment`,4:`Node Advertisement`,5:`Group Text Message`,6:`Group Datagram`,7:`Anonymous Request`,8:`Returned Path`,9:`Trace`,10:`Multi-part Packet`,15:`Custom Packet`},E=()=>{let e=i.packetTypeBreakdown;!e||e.length===0||(n.value=e.map(e=>({name:C[Number(e.type)]||`Type ${e.type}`,type:e.type,count:e.count,color:``})),o.value=!1,c.value=null)},O=e=>Math.max(e/m.value*90,2),A=(e,t)=>t===0?0:e/t*100;return r(()=>{_()}),f(()=>i.packetTypeBreakdown,()=>E(),{deep:!0,immediate:!0}),f(()=>a.isConnected,e=>{e||_()},{immediate:!0}),(e,n)=>(S(),b(`div`,W,[n[3]||=y(`div`,{class:`flex items-baseline justify-between mb-3 lg:mb-4`},[y(`h3`,{class:`text-content-primary dark:text-content-primary text-lg lg:text-xl font-semibold`},` Packet Types `),y(`p`,{class:`text-content-secondary dark:text-content-muted text-xs lg:text-sm uppercase`},` Distribution by Type `)],-1),y(`div`,G,[o.value?(S(),b(`div`,K,[...n[1]||=[y(`div`,{class:`text-content-secondary dark:text-content-primary text-sm lg:text-base`},` Loading packet types... `,-1)]])):c.value?(S(),b(`div`,se,[y(`div`,q,s(c.value),1)])):d.value.length===0?(S(),b(`div`,ce,[...n[2]||=[y(`div`,{class:`text-content-secondary dark:text-content-primary text-sm lg:text-base`},` No packet data available `,-1)]])):(S(),b(`div`,J,[l.value?(S(),b(`div`,Y,[y(`div`,X,s(l.value.name)+` · `+s(l.value.total.toLocaleString()),1),(S(!0),b(v,null,t(l.value.items,e=>(S(),b(`div`,{key:e.type,class:`flex justify-between gap-4 text-xs text-content-secondary dark:text-content-muted`},[y(`span`,null,s(e.name),1),y(`span`,le,s(e.count.toLocaleString()),1)]))),128))])):p(``,!0),y(`div`,ue,[(S(!0),b(v,null,t(d.value,e=>(S(),b(`div`,{key:e.name,class:`flex flex-col items-center flex-1 max-w-32 h-full justify-end cursor-pointer`,onMouseenter:t=>l.value=e,onMouseleave:n[0]||=e=>l.value=null},[y(`span`,Z,s(e.total.toLocaleString()),1),y(`div`,{class:`w-full rounded-[5px] transition-all duration-300 ease-out hover:opacity-90 overflow-hidden flex flex-col-reverse`,style:x({height:O(e.total)+`%`,minHeight:`8px`})},[(S(!0),b(v,null,t(e.items,t=>(S(),b(`div`,{key:t.type,style:x({height:A(t.count,e.total)+`%`,backgroundColor:t.color})},null,4))),128))],4),y(`span`,fe,s(e.name),1)],40,de))),128))])]))]),d.value.length>0?(S(),b(`div`,pe,[(S(!0),b(v,null,t(d.value,e=>(S(),b(`div`,{key:`legend-`+e.name,class:`flex flex-col gap-0.5 min-w-[100px] max-w-[140px] flex-shrink-0`},[(S(!0),b(v,null,t(e.items,e=>(S(),b(`div`,{key:e.type,class:`flex items-center gap-1.5`},[y(`span`,{class:`w-2 h-2 rounded-sm shrink-0`,style:x({backgroundColor:e.color})},null,4),y(`span`,me,s(e.name),1)]))),128))]))),128))])):p(``,!0),d.value.length>0?(S(),b(`div`,he,` Total: `+s(h.value.toLocaleString())+` packets `,1)):p(``,!0)]))}}),[[`__scopeId`,`data-v-4f61d810`]]),_e={class:`glass-card rounded-[10px] p-4 lg:p-6`},ve={class:`relative h-40 lg:h-48`},ye={class:`mt-3 lg:mt-4 grid grid-cols-2 gap-3 lg:gap-4`},be={class:`text-center`},xe={class:`text-lg lg:text-2xl font-bold text-content-primary dark:text-content-primary`},Se={class:`text-center`},Ce={class:`text-lg lg:text-2xl font-bold text-content-primary dark:text-content-primary`},we={class:`mt-2 lg:mt-3 grid grid-cols-3 gap-2 lg:gap-3 text-center`},Te={class:`text-xs lg:text-sm font-semibold text-accent-purple flex items-center justify-center gap-1`},Ee={key:0,class:`inline-block w-1.5 h-1.5 rounded-full bg-secondary opacity-70`,title:`Early data - limited uptime`},De={class:`text-xs text-content-secondary dark:text-content-muted`},Oe={class:`text-xs lg:text-sm font-semibold text-accent-red flex items-center justify-center gap-1`},ke={key:0,class:`inline-block w-1.5 h-1.5 rounded-full bg-secondary opacity-70`,title:`Early data - limited uptime`},Ae={class:`text-xs text-content-secondary dark:text-content-muted`},je={class:`text-xs lg:text-sm font-semibold text-white`},Me=O(l({name:`AirtimeUtilizationChart`,__name:`AirtimeUtilizationChart`,setup(e){let t=D(),n=E(),o=w(null),l=w([]),u=w(!0),d=w(null),f=w(30),m=w({totalReceived:0,totalTransmitted:0,dropped:0,firstPacketTime:0}),h=w({sf:9,bwHz:62500,cr:5,preamble:17}),v=e=>{let{sf:t,bwHz:n,cr:r,preamble:i}=h.value,a=t>=11&&n<=125e3?1:0,o=n/1e3,s=2**t/o,c=(i+4.25)*s,l=Math.max(8*e-4*t+28+16-0,0),u=4*(t-2*a);return c+(8+Math.ceil(l/u)*r)*s},x=e=>e.airtime_ms!==void 0&&e.airtime_ms>0?e.airtime_ms:v(e.length??e.payload_length??32),O=(e,t=60)=>{if(e.length===0)return[];let n=1-.5**(1/t),r=Math.min(e.length,Math.max(10,Math.floor(t/3))),i=0,a=0;for(let t=0;t(i=n*e.rxUtil+(1-n)*i,a=n*e.txUtil+(1-n)*a,{...e,rxUtil:i,txUtil:a}))},k=g(()=>{let e=t.packetStats?.total_packets||0,r=t.packetStats?.transmitted_packets||0,i=n.stats?.uptime_seconds||0,a=e||m.value.totalReceived,o=r||m.value.totalTransmitted,s=m.value.firstPacketTime>0?Math.floor(Date.now()/1e3)-m.value.firstPacketTime:0,c=i||s,l=Math.max(c/3600,.1);if(l<1){let e=Math.max(c/60,1);return{rxRate:{value:Math.round(a/e*100)/100,label:l<.5?`RX/min (early)`:`RX/min`},txRate:{value:Math.round(o/e*100)/100,label:l<.5?`TX/min (early)`:`TX/min`},confidence:`low`}}let u=Math.round(a/l*100)/100,d=Math.round(o/l*100)/100,f,p;return l<6?(f=`RX/hr (${Math.round(l)}h)`,p=`medium`):l<24?(f=`RX/hr (${Math.round(l)}h)`,p=`high`):(f=`RX/hr`,p=`high`),{rxRate:{value:u,label:f},txRate:{value:d,label:f.replace(`RX`,`TX`)},confidence:p}}),A=async()=>{u.value=!0;try{let e=10*1e3,t=24*3600/10,n=Math.floor(Date.now()/1e3),r=n-24*3600,i=0;try{let e=await T.get(`/stats`);if(e.success&&e.data){let t=e.data,n=t.config;if(n?.radio){let e=n.radio;h.value={sf:e.spreading_factor??9,bwHz:e.bandwidth??62500,cr:e.coding_rate??5,preamble:e.preamble_length??17}}i=t.dropped_count??0}}catch{}let o=await T.get(`/filtered_packets`,{start_timestamp:r,end_timestamp:n,limit:5e4});if(!o.success){l.value=[],u.value=!1,a(()=>j());return}let s=o.data||[],c=new Float64Array(t),d=new Float64Array(t),p=0,g=0,_=1/0;for(let e of s){let n=Math.floor((e.timestamp-r)/10);if(n<0||n>=t)continue;let i=x(e),a=e.packet_origin;e.timestamp<_&&(_=e.timestamp),(a===`tx_local`||a===`tx_forward`||e.transmitted)&&(d[n]+=i,g++),a!==`tx_local`&&(c[n]+=i,p++)}m.value={totalReceived:p,totalTransmitted:g,dropped:i,firstPacketTime:_===1/0?n:_};let v=[];for(let n=0;n[e.rxUtil,e.txUtil]))*1.05;f.value=Math.max(5,Math.ceil(C/5)*5),u.value=!1,a(()=>j())}catch(e){console.error(`Failed to fetch airtime data:`,e),l.value=[],u.value=!1,a(()=>j())}},j=()=>{if(!o.value)return;let e=o.value,t=e.getContext(`2d`);if(!t)return;let n=e.parentElement;if(!n)return;let r=n.getBoundingClientRect(),i=r.width,a=r.height;if(e.width=i*window.devicePixelRatio,e.height=a*window.devicePixelRatio,e.style.width=i+`px`,e.style.height=a+`px`,t.scale(window.devicePixelRatio,window.devicePixelRatio),t.clearRect(0,0,i,a),u.value){t.fillStyle=`#666`,t.font=`16px system-ui`,t.textAlign=`center`,t.fillText(`Loading chart data...`,i/2,a/2);return}if(l.value.length===0){t.fillStyle=`#666`,t.font=`16px system-ui`,t.textAlign=`center`,t.fillText(`No data available`,i/2,a/2);return}let s=i-45-20,c=a-40,d=f.value,p=f.value;t.strokeStyle=`rgba(255, 255, 255, 0.1)`,t.lineWidth=1,t.font=`10px system-ui`,t.textAlign=`right`;for(let e=0;e<=5;e++){let n=20+c*e/5;t.beginPath(),t.moveTo(45,n),t.lineTo(i-20,n),t.stroke();let r=d-e/5*p;t.fillStyle=`rgba(255, 255, 255, 0.5)`,t.fillText(`${r.toFixed(0)}%`,40,n+3)}for(let e=0;e<=6;e++){let n=45+s*e/6;t.beginPath(),t.moveTo(n,20),t.lineTo(n,a-20),t.stroke()}l.value.length>1&&(t.strokeStyle=`#EBA0FC`,t.lineWidth=2,t.beginPath(),l.value.forEach((e,n)=>{let r=45+s*n/(l.value.length-1),i=a-20-Math.min(e.rxUtil,f.value)/p*c;n===0?t.moveTo(r,i):t.lineTo(r,i)}),t.stroke()),l.value.length>1&&(t.strokeStyle=`#FB787B`,t.lineWidth=2,t.beginPath(),l.value.forEach((e,n)=>{let r=45+s*n/(l.value.length-1),i=a-20-Math.min(e.txUtil,f.value)/p*c;n===0?t.moveTo(r,i):t.lineTo(r,i)}),t.stroke())};return r(()=>{A(),d.value=window.setInterval(A,3e4),a(()=>{j(),setTimeout(()=>j(),100)}),window.addEventListener(`resize`,j)}),C(()=>{d.value&&clearInterval(d.value),window.removeEventListener(`resize`,j)}),(e,n)=>(S(),b(`div`,_e,[n[3]||=c(`

Airtime Utilization

Activity (Last 24 Hours)

Rx Util
Tx Util
`,3),y(`div`,ve,[y(`canvas`,{ref_key:`chartRef`,ref:o,class:`absolute inset-0 w-full h-full`},null,512)]),y(`div`,ye,[y(`div`,be,[y(`div`,xe,s(i(t).packetStats?.total_packets||m.value.totalReceived),1),n[0]||=y(`div`,{class:`text-xs text-content-secondary dark:text-content-muted uppercase tracking-wide`},` Total Received `,-1)]),y(`div`,Se,[y(`div`,Ce,s(i(t).packetStats?.transmitted_packets||m.value.totalTransmitted),1),n[1]||=y(`div`,{class:`text-xs text-content-secondary dark:text-content-muted uppercase tracking-wide`},` Total Transmitted `,-1)])]),y(`div`,we,[y(`div`,null,[y(`div`,Te,[_(s(k.value.rxRate.value)+` `,1),k.value.confidence===`low`?(S(),b(`span`,Ee)):p(``,!0)]),y(`div`,De,s(k.value.rxRate.label),1)]),y(`div`,null,[y(`div`,Oe,[_(s(k.value.txRate.value)+` `,1),k.value.confidence===`low`?(S(),b(`span`,ke)):p(``,!0)]),y(`div`,Ae,s(k.value.txRate.label),1)]),y(`div`,null,[y(`div`,je,s(i(t).packetStats?.dropped_packets||m.value.dropped),1),n[2]||=y(`div`,{class:`text-xs text-white/60`},`Dropped`,-1)])])]))}}),[[`__scopeId`,`data-v-501b1337`]]),Ne={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] shadow-2xl border border-stroke-subtle dark:border-white/20 flex flex-col h-full overflow-hidden`},Pe={class:`flex items-center justify-between p-8 pb-4 flex-shrink-0`},Fe={class:`text-content-secondary dark:text-content-muted text-sm`},Ie={class:`flex items-center gap-2`},Le=[`title`],Re={class:`flex-1 overflow-y-auto custom-scrollbar px-8`},ze={class:`mb-6`},Be={class:`glass-card bg-white/5 rounded-[15px] p-4`},Ve={class:`grid grid-cols-1 md:grid-cols-2 gap-4`},He={class:`space-y-3`},Ue={class:`flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10`},We={class:`text-content-primary dark:text-content-primary font-mono text-sm`},Ge={class:`flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10`},Ke={class:`text-content-primary dark:text-content-primary font-mono text-xs break-all`},qe={key:0,class:`flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10`},Je={class:`text-content-primary dark:text-content-primary font-mono text-xs`},Ye={class:`space-y-3`},Xe={class:`flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10`},Ze={class:`text-content-primary dark:text-content-primary font-semibold`},Qe={class:`flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10`},$e={class:`text-content-primary dark:text-content-primary font-semibold`},et={class:`flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10`},tt={class:`mb-6`},nt={class:`bg-gray-50 dark:bg-white/5 rounded-[15px] p-4 border border-stroke-subtle dark:border-stroke/10`},rt={class:`space-y-3`},it={class:`flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10`},at={class:`text-content-primary dark:text-content-primary`},ot={key:0,class:`pt-2`},st={class:`glass-card bg-background-mute dark:bg-black/30 rounded-[10px] p-4 mb-4`},ct={class:`w-full overflow-x-auto`},lt={class:`text-content-primary dark:text-content-primary/90 text-xs font-mono whitespace-pre leading-relaxed min-w-full`},ut={class:`flex items-center justify-between mb-3`},dt={class:`text-content-secondary dark:text-content-primary/80 text-sm font-semibold`},ft={class:`text-content-muted dark:text-content-muted text-xs`},pt={class:`bg-background-mute dark:bg-black/40 rounded-[8px] p-3 mb-3`},mt={class:`font-mono text-xs text-content-primary dark:text-content-primary break-all whitespace-pre-wrap leading-relaxed`},ht={class:`bg-gray-50 dark:bg-white/5 rounded-[10px] overflow-hidden`},gt={key:0,class:`min-w-0`},_t={class:`text-cyan-500 text-sm font-mono break-words min-w-0`},vt={class:`text-content-primary dark:text-content-primary text-sm break-words min-w-0`},yt={class:`text-content-primary dark:text-content-primary text-sm font-semibold break-all min-w-0 overflow-hidden`},bt=[`title`],xt={key:0,class:`text-orange-500 text-xs font-mono break-all min-w-0 overflow-hidden`},St=[`title`],Ct={class:`grid grid-cols-2 gap-2`},wt={class:`text-cyan-500 text-sm font-mono break-words`},Tt={class:`text-content-primary dark:text-content-primary text-sm break-words`},Et=[`title`],Dt={key:0},Ot=[`title`],kt={key:0,class:`text-content-muted dark:text-content-muted text-xs italic mt-2 px-1`},At={key:1,class:`py-2`},jt={class:`mb-6`},Mt={class:`bg-gray-50 dark:bg-white/5 rounded-[15px] p-4 border border-stroke-subtle dark:border-stroke/10`},Nt={class:`space-y-4`},Pt={class:`grid grid-cols-1 md:grid-cols-2 gap-4`},Ft={class:`flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10`},It={class:`flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10`},Lt={key:0,class:`py-2`},Rt={class:`bg-background-mute dark:bg-black/20 rounded-[10px] p-4`},zt={class:`flex items-center flex-wrap gap-2`},Bt={class:`relative group`},Vt={class:`relative px-3 py-2 bg-gradient-to-br from-blue-500/20 to-cyan-500/20 border border-cyan-400/40 rounded-lg transform transition-all hover:scale-105`},Ht={class:`font-mono text-[10px] font-semibold tracking-tight text-content-primary dark:text-content-primary/90 sm:text-xs`},Ut={class:`pointer-events-none absolute bottom-full left-1/2 z-50 mb-2 -translate-x-1/2 transform whitespace-nowrap rounded-md bg-neutral-900 px-2 py-1 font-mono text-xs text-white opacity-0 shadow-lg ring-1 ring-white/10 transition-opacity group-hover:opacity-100`},Wt={key:0,class:`mx-2 text-cyan-600 dark:text-cyan-400/60`},Gt={key:1,class:`py-2`},Kt={class:`text-content-secondary dark:text-content-muted text-sm mb-2 flex items-center`},qt={key:0,class:`w-4 h-4 ml-2 text-yellow-500`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Jt={key:1,class:`text-yellow-500 text-xs ml-1`},Yt={class:`bg-background-mute dark:bg-black/20 rounded-[10px] p-4`},Xt={class:`flex items-center flex-wrap gap-2`},Zt={class:`relative group`},Qt={key:0,class:`absolute -top-1 -right-1 w-2 h-2 bg-yellow-400 rounded-full animate-pulse`},$t={class:`pointer-events-none absolute bottom-full left-1/2 z-50 mb-2 -translate-x-1/2 transform whitespace-nowrap rounded-md bg-neutral-900 px-2 py-1 font-mono text-xs text-white opacity-0 shadow-lg ring-1 ring-white/10 transition-opacity group-hover:opacity-100`},en={key:0,class:`mx-1 text-orange-600 dark:text-orange-400/60`},tn={class:`mb-6`},nn={class:`glass-card bg-gray-50 dark:bg-white/5 rounded-[15px] p-4`},rn={class:`grid grid-cols-1 md:grid-cols-3 gap-4 mb-4`},an={class:`text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]`},on={class:`text-lg font-bold text-content-primary dark:text-content-primary`},sn={class:`text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]`},cn={class:`text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]`},ln={class:`text-lg font-bold text-content-primary dark:text-content-primary`},un={key:0,class:`mb-4`},dn={class:`flex items-center gap-3`},fn={class:`flex gap-1`},pn={class:`text-content-secondary dark:text-content-primary/80 text-sm capitalize`},mn={key:1,class:`mb-4`},hn={key:2,class:`mb-4`},gn={class:`text-content-secondary dark:text-content-muted text-sm mb-3`},_n={class:`space-y-2`},vn={class:`flex items-center gap-3`},yn={class:`text-content-muted dark:text-content-muted text-sm`},bn={key:3,class:`mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke/10`},xn={class:`grid grid-cols-1 md:grid-cols-3 gap-3 mb-4`},Sn={class:`text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]`},Cn={class:`text-2xl font-bold text-content-primary dark:text-content-primary`},wn={class:`text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]`},Tn={class:`text-2xl font-bold text-content-primary dark:text-content-primary`},En={class:`text-content-muted dark:text-content-muted text-xs mt-1`},Dn={class:`text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]`},On={class:`text-content-muted dark:text-content-muted text-xs mt-1`},kn={key:0,class:`glass-card bg-background-mute dark:bg-black/20 rounded-[10px] p-4`},An={class:`space-y-3`},jn={class:`flex-shrink-0 w-16 text-right`},Mn={class:`text-content-secondary dark:text-content-muted text-xs`},Nn={class:`flex-1 relative`},Pn={class:`h-8 rounded-lg overflow-hidden bg-background-mute dark:bg-stroke/5 relative`},Fn={class:`absolute inset-0 flex items-center px-3`},In={class:`text-content-primary dark:text-content-primary text-xs font-mono font-semibold`},Ln={class:`flex-shrink-0 w-12 text-left`},Rn={class:`text-content-muted dark:text-content-muted text-xs`},zn={class:`grid grid-cols-1 md:grid-cols-2 gap-4`},Bn={class:`space-y-2`},Vn={class:`flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10`},Hn={class:`text-content-primary dark:text-content-primary`},Un={class:`flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10`},Wn={class:`space-y-2`},Gn={class:`flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10`},Kn={key:0,class:`flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10`},qn={class:`text-red-600 dark:text-red-400 text-sm`},Jn={class:`p-8 pt-4 border-t border-stroke-subtle dark:border-stroke/10 flex justify-end flex-shrink-0`},Yn=O(l({name:`PacketDetailsModal`,__name:`PacketDetailsModal`,props:{packet:{},isOpen:{type:Boolean},localHash:{}},emits:[`close`],setup(n,{emit:r}){let{getSignalQuality:i}=ne(),a=n,c=r,l=w(!1),d=e=>new Date(e*1e3).toLocaleString(),g=e=>e.transmitted?e.is_duplicate?`text-amber-600 dark:text-amber-400`:e.drop_reason?`text-red-600 dark:text-red-400`:`text-green-600 dark:text-green-400`:`text-red-600 dark:text-red-400`,C=e=>e.transmitted?e.is_duplicate?`Duplicate`:e.drop_reason?`Dropped`:`Forwarded`:`Dropped`,T=e=>({0:`Request`,1:`Response`,2:`Plain Text Message`,3:`Acknowledgment`,4:`Node Advertisement`,5:`Group Text Message`,6:`Group Datagram`,7:`Anonymous Request`,8:`Returned Path`,9:`Trace`,10:`Multi-part Packet`,15:`Custom Packet`})[e]||`Unknown Type (${e})`,E=e=>({0:`Transport Flood`,1:`Flood`,2:`Direct`,3:`Transport Direct`})[e]||`Unknown Route (${e})`,D=e=>{if(!e)return`None`;let t=e.replace(/\s+/g,``).toUpperCase().match(/.{2}/g)||[],n=[];for(let e=0;e{try{let r=0,i=t.length/2;if(i>=100){if(t.length>=r+64){let i=t.slice(r,r+64);e.push({name:`Public Key`,byteRange:`${(n+r)/2}-${(n+r+63)/2}`,hexData:i.match(/.{8}/g)?.join(` `)||i,description:`Ed25519 public key of the node (32 bytes)`,fields:[{bits:`0-255`,name:`Ed25519 Public Key`,value:`${i.slice(0,16)}...${i.slice(-16)}`,binary:`32 bytes (256 bits)`}]}),r+=64}if(t.length>=r+8){let i=t.slice(r,r+8),a=parseInt(i,16),o=new Date(a*1e3);e.push({name:`Timestamp`,byteRange:`${(n+r)/2}-${(n+r+7)/2}`,hexData:i.match(/.{2}/g)?.join(` `)||i,description:`Unix timestamp of advertisement`,fields:[{bits:`0-31`,name:`Unix Timestamp`,value:`${a} (${o.toLocaleString()})`,binary:a.toString(2).padStart(32,`0`)}]}),r+=8}if(t.length>=r+128){let i=t.slice(r,r+128);e.push({name:`Signature`,byteRange:`${(n+r)/2}-${(n+r+127)/2}`,hexData:i.match(/.{8}/g)?.join(` `)||i,description:`Ed25519 signature of public key, timestamp, and appdata`,fields:[{bits:`0-511`,name:`Ed25519 Signature`,value:`${i.slice(0,16)}...${i.slice(-16)}`,binary:`64 bytes (512 bits)`}]}),r+=128}t.length>r&&k(e,t.slice(r),n+r)}else e.push({name:`ADVERT AppData (Partial)`,byteRange:`${n/2}-${n/2+i-1}`,hexData:t.match(/.{2}/g)?.join(` `)||t,description:`Partial ADVERT data - appears to be just AppData portion (${i} bytes)`,fields:[{bits:`0-${i*8-1}`,name:`Partial Data`,value:`${i} bytes - attempting to decode as AppData`,binary:`${i} bytes (${i*8} bits)`}]}),k(e,t,n)}catch(n){e.push({name:`ADVERT Parse Error`,byteRange:`N/A`,hexData:t.slice(0,32)+`...`,description:`Failed to parse ADVERT payload structure`,fields:[{bits:`N/A`,name:`Error`,value:`Parse error: ${n instanceof Error?n.message:`Unknown error`}`,binary:`Invalid`}]})}},k=(e,t,n)=>{try{let r=t.length/2;e.push({name:`AppData`,byteRange:`${n/2}-${n/2+r-1}`,hexData:t.match(/.{2}/g)?.join(` `)||t,description:`Node advertisement application data (${r} bytes)`,fields:[{bits:`0-${r*8-1}`,name:`Application Data`,value:`${r} bytes (contains flags, location, name, etc.)`,binary:`${r} bytes (${r*8} bits)`}]});let i=0;if(t.length>=2){let r=parseInt(t.slice(i,i+2),16),a=[],o=!!(r&16),s=!!(r&32),c=!!(r&64),l=!!(r&128);if(r&1&&a.push(`is chat node`),r&2&&a.push(`is repeater`),r&4&&a.push(`is room server`),r&8&&a.push(`is sensor`),o&&a.push(`has location`),s&&a.push(`has feature 1`),c&&a.push(`has feature 2`),l&&a.push(`has name`),e.push({name:`AppData Flags`,byteRange:`${(n+i)/2}`,hexData:`0x${t.slice(i,i+2)}`,description:`Flags indicating which optional fields are present`,fields:[{bits:`0-7`,name:`Flags`,value:a.join(`, `)||`none`,binary:r.toString(2).padStart(8,`0`)}]}),i+=2,o&&t.length>=i+16){let r=t.slice(i,i+8),a=[];for(let e=6;e>=0;e-=2)a.push(r.slice(e,e+2));let o=parseInt(a.join(``),16),s=o>2147483647?o-4294967296:o,c=s/1e6,l=t.slice(i+8,i+16),u=[];for(let e=6;e>=0;e-=2)u.push(l.slice(e,e+2));let d=parseInt(u.join(``),16),f=d>2147483647?d-4294967296:d,p=f/1e6;e.push({name:`Location Data`,byteRange:`${(n+i)/2}-${(n+i+15)/2}`,hexData:`${r.match(/.{2}/g)?.join(` `)||r} ${l.match(/.{2}/g)?.join(` `)||l}`,description:`GPS coordinates (latitude and longitude)`,fields:[{bits:`0-31`,name:`Latitude`,value:`${c.toFixed(6)}° (raw: ${s})`,binary:s.toString(2).padStart(32,`0`)},{bits:`32-63`,name:`Longitude`,value:`${p.toFixed(6)}° (raw: ${f})`,binary:f.toString(2).padStart(32,`0`)}]}),i+=16}if(s&&t.length>=i+4){let r=t.slice(i,i+4),a=parseInt(r,16);e.push({name:`Feature 1`,byteRange:`${(n+i)/2}-${(n+i+3)/2}`,hexData:r.match(/.{2}/g)?.join(` `)||r,description:`Reserved feature 1 (2 bytes)`,fields:[{bits:`0-15`,name:`Feature 1 Value`,value:`${a}`,binary:a.toString(2).padStart(16,`0`)}]}),i+=4}if(c&&t.length>=i+4){let r=t.slice(i,i+4),a=parseInt(r,16);e.push({name:`Feature 2`,byteRange:`${(n+i)/2}-${(n+i+3)/2}`,hexData:r.match(/.{2}/g)?.join(` `)||r,description:`Reserved feature 2 (2 bytes)`,fields:[{bits:`0-15`,name:`Feature 2 Value`,value:`${a}`,binary:a.toString(2).padStart(16,`0`)}]}),i+=4}if(l&&t.length>i){let r=t.slice(i),a=r.match(/.{2}/g)||[],o=a.map(e=>{let t=parseInt(e,16);return t>=32&&t<=126?String.fromCharCode(t):`.`}).join(``).replace(/\.+$/,``);e.push({name:`Node Name`,byteRange:`${(n+i)/2}-${(n+t.length-1)/2}`,hexData:r.match(/.{2}/g)?.join(` `)||r,description:`Node name string (${a.length} bytes)`,fields:[{bits:`0-${a.length*8-1}`,name:`Node Name`,value:`"${o}"`,binary:`ASCII text (${a.length} bytes)`}]})}}}catch(n){e.push({name:`AppData Parse Error`,byteRange:`N/A`,hexData:t.slice(0,Math.min(32,t.length)),description:`Failed to parse AppData structure`,fields:[{bits:`N/A`,name:`Error`,value:`Parse error: ${n instanceof Error?n.message:`Unknown error`}`,binary:`Invalid`}]})}},M=e=>{if(!e)return[];if(Array.isArray(e))return e;if(typeof e==`string`)try{return JSON.parse(e)}catch{return[]}return[]},N=e=>{let t=[];if(!e)return t;try{let n=e.raw_packet;if(n){let e=n.replace(/\s+/g,``).toUpperCase(),r=0;if(e.length>=2){let n=e.slice(r,r+2),i=parseInt(n,16),a=i&3,o=(i&60)>>2,s=(i&192)>>6;if(t.push({name:`Header`,byteRange:`0`,hexData:`0x${n}`,description:`Contains routing type, payload type, and payload version`,fields:[{bits:`0-1`,name:`Route Type`,value:{0:`Transport Flood`,1:`Flood`,2:`Direct`,3:`Transport Direct`}[a]||`Unknown`,binary:a.toString(2).padStart(2,`0`)},{bits:`2-5`,name:`Payload Type`,value:{0:`REQ`,1:`RESPONSE`,2:`TXT_MSG`,3:`ACK`,4:`ADVERT`,5:`GRP_TXT`,6:`GRP_DATA`,7:`ANON_REQ`,8:`PATH`,9:`TRACE`,10:`MULTIPART`,15:`RAW_CUSTOM`}[o]||`Unknown`,binary:o.toString(2).padStart(4,`0`)},{bits:`6-7`,name:`Version`,value:s.toString(),binary:s.toString(2).padStart(2,`0`)}]}),r+=2,(a===0||a===3)&&e.length>=r+8){let n=e.slice(r,r+8),i=parseInt(n.slice(0,4),16),a=parseInt(n.slice(4,8),16);t.push({name:`Transport Codes`,byteRange:`1-4`,hexData:`${n.slice(0,4)} ${n.slice(4,8)}`,description:`2x 16-bit transport codes for routing optimization`,fields:[{bits:`0-15`,name:`Code 1`,value:i.toString(),binary:i.toString(2).padStart(16,`0`)},{bits:`16-31`,name:`Code 2`,value:a.toString(),binary:a.toString(2).padStart(16,`0`)}]}),r+=8}if(e.length>=r+2){let n=e.slice(r,r+2),i=parseInt(n,16),a=(i>>6)+1,o=i&63,s=o*a;if(t.push({name:`Path Length`,byteRange:`${r/2}`,hexData:`0x${n}`,description:`${o} hop${o===1?``:`s`}, ${a}-byte hash${a>1?`es`:``} (${s} bytes)`,fields:[{bits:`6-7`,name:`Hash Size`,value:`${a}-byte`,binary:(i>>6&3).toString(2).padStart(2,`0`)},{bits:`0-5`,name:`Hop Count`,value:`${o}`,binary:(i&63).toString(2).padStart(6,`0`)}]}),r+=2,s>0&&e.length>=r+s*2){let n=e.slice(r,r+s*2),i=RegExp(`.{${a*2}}`,`g`),c=n.match(i)||[];t.push({name:`Path Data`,byteRange:`${r/2}-${(r+s*2-2)/2}`,hexData:c.join(` `)||n,description:`${o} × ${a}-byte routing hash${o===1?``:`es`}`,fields:c.map((e,t)=>({bits:`${t*a*8}-${(t+1)*a*8-1}`,name:`Hop ${t+1}`,value:e.toUpperCase(),binary:`${a} byte${a>1?`s`:``}`}))}),r+=s*2}}if(e.length>r){let n=e.slice(r),i=n.length/2;o===4?O(t,n,r):t.push({name:`Payload Data`,byteRange:`${r/2}-${r/2+i-1}`,hexData:n.match(/.{2}/g)?.join(` `)||n,description:`Application data content`,fields:[{bits:`0-${i*8-1}`,name:`Application Data`,value:`${i} bytes`,binary:`${i} bytes (${i*8} bits)`}]})}}}else{if(e.header){let n=e.header.replace(/0x/gi,``).replace(/\s+/g,``).toUpperCase(),r=parseInt(n,16),i=r&3,a=(r&60)>>2,o=(r&192)>>6;t.push({name:`Header`,byteRange:`0`,hexData:`0x${n}`,description:`Contains routing type, payload type, and payload version`,fields:[{bits:`0-1`,name:`Route Type`,value:{0:`Transport Flood`,1:`Flood`,2:`Direct`,3:`Transport Direct`}[i]||`Unknown`,binary:i.toString(2).padStart(2,`0`)},{bits:`2-5`,name:`Payload Type`,value:{0:`REQ`,1:`RESPONSE`,2:`TXT_MSG`,3:`ACK`,4:`ADVERT`,5:`GRP_TXT`,6:`GRP_DATA`,7:`ANON_REQ`,8:`PATH`,9:`TRACE`,10:`MULTIPART`,15:`RAW_CUSTOM`}[a]||`Unknown`,binary:a.toString(2).padStart(4,`0`)},{bits:`6-7`,name:`Version`,value:o.toString(),binary:o.toString(2).padStart(2,`0`)}]}),e.transport_codes&&t.push({name:`Transport Codes`,byteRange:`1-4`,hexData:e.transport_codes,description:`2x 16-bit transport codes for routing optimization`,fields:[{bits:`0-31`,name:`Transport Codes`,value:e.transport_codes,binary:`Available in separate field`}]}),e.original_path&&e.original_path.length>0&&t.push({name:`Original Path`,byteRange:`?`,hexData:e.original_path.join(` `),description:`Original routing path (${e.original_path.length} nodes)`,fields:[{bits:`0-?`,name:`Path Nodes`,value:`${e.original_path.length} nodes`,binary:`Available as node list`}]}),e.forwarded_path&&e.forwarded_path.length>0&&t.push({name:`Forwarded Path`,byteRange:`?`,hexData:e.forwarded_path.join(` `),description:`Forwarded routing path (${e.forwarded_path.length} nodes)`,fields:[{bits:`0-?`,name:`Path Nodes`,value:`${e.forwarded_path.length} nodes`,binary:`Available as node list`}]})}if(e.payload){let n=e.payload.replace(/\s+/g,``).toUpperCase(),r=n.length/2;e.type===4?O(t,n,0):t.push({name:`Payload Data`,byteRange:`0-${r-1}`,hexData:n.match(/.{2}/g)?.join(` `)||n,description:`Application data content (${r} bytes)`,fields:[{bits:`0-${r*8-1}`,name:`Application Data`,value:`${r} bytes`,binary:`${r} bytes (${r*8} bits)`}]})}}}catch{t.push({name:`Parse Error`,byteRange:`N/A`,hexData:`Error`,description:`Unable to parse packet structure`,fields:[{bits:`N/A`,name:`Error`,value:`Parse failed`,binary:`Invalid`}]})}return t},P=(e,t)=>e==null||t==null?`text-content-muted dark:text-content-muted`:i(t).color,F=e=>{if(e==null)return{level:0,className:`signal-none`};let t=i(e),n,r;return t.bars>=5?(n=4,r=`signal-excellent`):t.bars>=4?(n=3,r=`signal-good`):t.bars>=2?(n=2,r=`signal-fair`):t.bars>=1?(n=1,r=`signal-poor`):(n=0,r=`signal-none`),{level:n,className:r}},I=e=>{if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}},L=e=>e>=1e3?`${(e/1e3).toFixed(2)}s`:`${Math.round(e)}ms`,R=e=>{e.key===`Escape`&&c(`close`)},ee=e=>{e.target===e.currentTarget&&c(`close`)};return f(()=>a.isOpen,e=>{e?document.body.style.overflow=`hidden`:document.body.style.overflow=``},{immediate:!0}),(r,i)=>(S(),o(u,{to:`body`},[h(j,{name:`modal`,appear:``},{default:e(()=>[n.isOpen&&n.packet?(S(),b(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center p-4 overflow-hidden`,onClick:ee,onKeydown:R,tabindex:`0`},[i[51]||=y(`div`,{class:`absolute inset-0 bg-black/60 backdrop-blur-md pointer-events-none`},null,-1),y(`div`,{class:`relative w-full max-w-4xl max-h-[90vh] flex flex-col`,onClick:i[3]||=A(()=>{},[`stop`])},[y(`div`,Ne,[y(`div`,Pe,[y(`div`,null,[i[4]||=y(`h2`,{class:`text-2xl font-bold text-content-primary dark:text-content-primary mb-1`},` Packet Details `,-1),y(`p`,Fe,s(T(n.packet.type))+` - `+s(E(n.packet.route)),1)]),y(`div`,Ie,[y(`button`,{onClick:i[0]||=e=>l.value=!l.value,class:m([`flex items-center gap-2 px-3 py-1.5 rounded-lg transition-all duration-200`,l.value?`bg-cyan-500/20 border border-cyan-400/30 text-cyan-600 dark:text-cyan-400`:`bg-background-mute dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-secondary dark:text-content-muted`]),title:l.value?`Hide binary values`:`Show binary values`},[...i[5]||=[y(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4`})],-1),y(`span`,{class:`text-xs font-medium`},`Binary`,-1)]],10,Le),y(`button`,{onClick:i[1]||=e=>c(`close`),class:`w-8 h-8 flex items-center justify-center rounded-full bg-background-mute dark:bg-white/10 hover:bg-stroke-subtle dark:hover:bg-white/20 transition-colors duration-200 text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary`},[...i[6]||=[y(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])])]),y(`div`,Re,[y(`div`,ze,[i[13]||=y(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-4 flex items-center`},[y(`div`,{class:`w-2 h-2 rounded-full bg-cyan-400 mr-3`}),_(` Basic Information `)],-1),y(`div`,Be,[y(`div`,Ve,[y(`div`,He,[y(`div`,Ue,[i[7]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Timestamp`,-1),y(`span`,We,s(d(n.packet.timestamp)),1)]),y(`div`,Ge,[i[8]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Packet Hash`,-1),y(`span`,Ke,s(n.packet.packet_hash),1)]),n.packet.header?(S(),b(`div`,qe,[i[9]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Header`,-1),y(`span`,Je,s(n.packet.header),1)])):p(``,!0)]),y(`div`,Ye,[y(`div`,Xe,[i[10]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Type`,-1),y(`span`,Ze,s(n.packet.type)+` (`+s(T(n.packet.type))+`)`,1)]),y(`div`,Qe,[i[11]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Route`,-1),y(`span`,$e,s(n.packet.route)+` (`+s(E(n.packet.route))+`)`,1)]),y(`div`,et,[i[12]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Status`,-1),y(`span`,{class:m([`font-semibold`,g(n.packet)])},s(C(n.packet)),3)])])])])]),y(`div`,tt,[i[25]||=y(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-4 flex items-center`},[y(`div`,{class:`w-2 h-2 rounded-full bg-orange-400 mr-3`}),_(` Payload Data `)],-1),y(`div`,nt,[y(`div`,rt,[y(`div`,it,[i[14]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Payload Length`,-1),y(`span`,at,s(n.packet.payload_length||n.packet.length)+` bytes`,1)]),n.packet.payload?(S(),b(`div`,ot,[i[23]||=y(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-3`},` Payload Analysis `,-1),y(`div`,st,[i[15]||=y(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-2 font-semibold`},` Raw Hex Data `,-1),y(`div`,ct,[y(`pre`,lt,s(D(n.packet.payload)),1)])]),(S(!0),b(v,null,t(N(n.packet).filter(e=>!e.name.includes(`Parse Error`)),(e,n)=>(S(),b(`div`,{key:n,class:`mb-4`},[y(`div`,ut,[y(`h4`,dt,s(e.name),1),y(`span`,ft,`Bytes `+s(e.byteRange),1)]),y(`div`,pt,[y(`div`,mt,s(e.hexData),1)]),y(`div`,ht,[y(`div`,{class:m([`hidden md:grid gap-3 p-3 bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-muted text-xs font-semibold uppercase tracking-wide`,l.value?`grid-cols-4`:`grid-cols-3`])},[i[16]||=y(`div`,{class:`min-w-0`},`Bits`,-1),i[17]||=y(`div`,{class:`min-w-0`},`Field`,-1),i[18]||=y(`div`,{class:`min-w-0`},`Value`,-1),l.value?(S(),b(`div`,gt,`Binary`)):p(``,!0)],2),(S(!0),b(v,null,t(e.fields,(e,t)=>(S(),b(`div`,{key:t,class:m([`hidden md:grid gap-3 p-3 border-b border-stroke-subtle dark:border-stroke/5 last:border-b-0 hover:bg-background-mute dark:hover:bg-stroke/5 transition-colors`,l.value?`grid-cols-4`:`grid-cols-3`])},[y(`div`,_t,s(e.bits),1),y(`div`,vt,s(e.name),1),y(`div`,yt,[y(`span`,{class:`block`,title:e.value},s(e.value),9,bt)]),l.value?(S(),b(`div`,xt,[y(`span`,{class:`block`,title:e.binary},s(e.binary),9,St)])):p(``,!0)],2))),128)),(S(!0),b(v,null,t(e.fields,(e,t)=>(S(),b(`div`,{key:`mobile-${t}`,class:`md:hidden p-3 border-b border-stroke-subtle dark:border-stroke/5 last:border-b-0 space-y-2`},[y(`div`,Ct,[y(`div`,null,[i[19]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide`},`Bits:`,-1),y(`div`,wt,s(e.bits),1)]),y(`div`,null,[i[20]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide`},`Field:`,-1),y(`div`,Tt,s(e.name),1)])]),y(`div`,null,[i[21]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide`},`Value:`,-1),y(`div`,{class:`text-content-primary dark:text-content-primary text-sm font-semibold break-all`,title:e.value},s(e.value),9,Et)]),l.value?(S(),b(`div`,Dt,[i[22]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide`},`Binary:`,-1),y(`div`,{class:`text-orange-500 text-xs font-mono break-all`,title:e.binary},s(e.binary),9,Ot)])):p(``,!0)]))),128))]),e.description?(S(),b(`div`,kt,s(e.description),1)):p(``,!0)]))),128))])):(S(),b(`div`,At,[...i[24]||=[y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Payload:`,-1),y(`span`,{class:`text-content-muted dark:text-content-muted ml-2`},`None`,-1)]]))])])]),y(`div`,jt,[i[33]||=y(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-4 flex items-center`},[y(`div`,{class:`w-2 h-2 rounded-full bg-purple-400 mr-3`}),_(` Path Information `)],-1),y(`div`,Mt,[y(`div`,Nt,[y(`div`,Pt,[y(`div`,Ft,[i[26]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Source Hash`,-1),y(`span`,{class:m([`text-content-primary dark:text-content-primary font-mono text-xs`,a.localHash&&n.packet.src_hash===a.localHash?`bg-cyan-400/20 text-cyan-600 dark:text-cyan-300 px-1 rounded`:``])},s(n.packet.src_hash||`Unknown`),3)]),y(`div`,It,[i[27]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Destination Hash`,-1),y(`span`,{class:m([`text-content-primary dark:text-content-primary font-mono text-xs`,a.localHash&&n.packet.dst_hash===a.localHash?`bg-cyan-400/20 text-cyan-600 dark:text-cyan-300 px-1 rounded`:``])},s(n.packet.dst_hash||`Broadcast`),3)])]),M(n.packet.original_path).length>0?(S(),b(`div`,Lt,[i[29]||=y(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-2`},` Original Path `,-1),y(`div`,Rt,[y(`div`,zt,[(S(!0),b(v,null,t(M(n.packet.original_path),(e,t)=>(S(),b(`div`,{key:t,class:`flex items-center`},[y(`div`,Bt,[y(`div`,Vt,[y(`div`,Ht,s(e.toUpperCase()),1)]),y(`div`,Ut,` Node: `+s(e.toUpperCase()),1)]),t0?(S(),b(`div`,Gt,[y(`div`,Kt,[i[31]||=_(` Forwarded Path `,-1),JSON.stringify(M(n.packet.original_path))===JSON.stringify(M(n.packet.forwarded_path))?p(``,!0):(S(),b(`svg`,qt,[...i[30]||=[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`},null,-1)]])),JSON.stringify(M(n.packet.original_path))===JSON.stringify(M(n.packet.forwarded_path))?p(``,!0):(S(),b(`span`,Jt,`(Modified)`))]),y(`div`,Yt,[y(`div`,Xt,[(S(!0),b(v,null,t(M(n.packet.forwarded_path),(e,t)=>(S(),b(`div`,{key:t,class:`flex items-center`},[y(`div`,Zt,[y(`div`,{class:m([`relative px-3 py-2 bg-gradient-to-br from-orange-500/20 to-yellow-500/20 border border-orange-500 dark:border-orange-400/40 rounded-lg transform transition-all hover:scale-105`,a.localHash&&e===a.localHash?`bg-gradient-to-br from-yellow-400/30 to-orange-400/30 border-yellow-300 shadow-yellow-400/20 shadow-lg`:`hover:border-orange-500 dark:border-orange-400/60`])},[y(`div`,{class:m([`font-mono text-[10px] font-semibold tracking-tight sm:text-xs`,a.localHash&&e===a.localHash?`text-yellow-200`:`text-white/90`])},s(e.toUpperCase()),3),a.localHash&&e===a.localHash?(S(),b(`div`,Qt)):p(``,!0)],2),y(`div`,$t,s(e.toUpperCase()),1)]),ty(`div`,{key:e,class:m([`w-2 h-6 rounded-sm transition-all duration-300`,e<=F(n.packet.rssi).level?{"signal-excellent":`bg-green-400`,"signal-good":`bg-cyan-400`,"signal-fair":`bg-yellow-400`,"signal-poor":`bg-red-400`}[F(n.packet.rssi).className]:`bg-stroke-subtle dark:bg-stroke/10`])},null,2)),64))]),y(`span`,pn,s(F(n.packet.rssi).className.replace(`signal-`,``)),1)])])),n.packet.is_trace&&n.packet.path_snr_details&&n.packet.path_snr_details.length>0?(S(),b(`div`,hn,[y(`div`,gn,` Path SNR Details (`+s(n.packet.path_snr_details.length)+` hops) `,1),y(`div`,_n,[(S(!0),b(v,null,t(n.packet.path_snr_details,(e,t)=>(S(),b(`div`,{key:t,class:`flex items-center justify-between p-2 glass-card bg-background-mute dark:bg-black/20 rounded-[8px]`},[y(`div`,vn,[y(`span`,yn,s(t+1)+`.`,1),y(`span`,{class:m([`font-mono text-xs text-content-primary dark:text-content-primary`,a.localHash&&e.hash===a.localHash?`bg-cyan-400/20 text-cyan-600 dark:text-cyan-300 px-1 rounded`:``])},s(e.hash.toUpperCase()),3)]),y(`span`,{class:m([`text-sm font-bold`,P(e.snr_db,null)])},s(e.snr_db.toFixed(1))+`dB `,3)]))),128))])])):p(``,!0),n.packet.transmitted&&n.packet.lbt_attempts!==void 0?(S(),b(`div`,bn,[i[45]||=y(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-3 flex items-center`},[y(`svg`,{class:`w-4 h-4 mr-2`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z`})]),_(` Listen Before Talk (LBT) Metrics `)],-1),y(`div`,xn,[y(`div`,Sn,[i[41]||=y(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` CAD Attempts `,-1),y(`div`,Cn,s(n.packet.lbt_attempts),1)]),y(`div`,wn,[i[42]||=y(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Total LBT Delay `,-1),y(`div`,Tn,s(L(I(n.packet.lbt_backoff_delays_ms).reduce((e,t)=>e+t,0))),1),y(`div`,En,s(I(n.packet.lbt_backoff_delays_ms).length)+` backoffs `,1)]),y(`div`,Dn,[i[43]||=y(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Channel Status `,-1),y(`div`,{class:m([`text-lg font-bold`,n.packet.lbt_channel_busy?`text-yellow-600 dark:text-yellow-400`:`text-green-600 dark:text-green-400`])},s(n.packet.lbt_channel_busy?`BUSY`:`CLEAR`),3),y(`div`,On,s(n.packet.lbt_channel_busy?`Waited for clear`:`Immediate TX`),1)])]),I(n.packet.lbt_backoff_delays_ms).length>0?(S(),b(`div`,kn,[i[44]||=y(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-3 font-semibold`},` Backoff Pattern (Exponential with Jitter) `,-1),y(`div`,An,[(S(!0),b(v,null,t(I(n.packet.lbt_backoff_delays_ms),(e,t)=>(S(),b(`div`,{key:t,class:`flex items-center gap-3`},[y(`div`,jn,[y(`span`,Mn,`Attempt `+s(t+1),1)]),y(`div`,Nn,[y(`div`,Pn,[y(`div`,{class:m([`h-full rounded-lg transition-all duration-300`,[t===0?`bg-gradient-to-r from-cyan-500/50 to-cyan-600/50`:t===1?`bg-gradient-to-r from-yellow-500/50 to-yellow-600/50`:t===2?`bg-gradient-to-r from-orange-500/50 to-orange-600/50`:`bg-gradient-to-r from-red-500/50 to-red-600/50`]]),style:x({width:`${Math.min(100,e/Math.max(...I(n.packet.lbt_backoff_delays_ms))*100)}%`})},[y(`div`,Fn,[y(`span`,In,s(L(e)),1)])],6)])]),y(`div`,Ln,[y(`span`,Rn,s(Math.round(e/I(n.packet.lbt_backoff_delays_ms).reduce((e,t)=>e+t,0)*100))+`% `,1)])]))),128))])])):p(``,!0)])):p(``,!0),y(`div`,zn,[y(`div`,Bn,[y(`div`,Vn,[i[46]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`TX Delay`,-1),y(`span`,Hn,s(Number(n.packet.tx_delay_ms)>0?Number(n.packet.tx_delay_ms).toFixed(1)+`ms`:`-`),1)]),y(`div`,Un,[i[47]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Transmitted`,-1),y(`span`,{class:m(n.packet.transmitted?`text-green-600 dark:text-green-400`:`text-red-600 dark:text-red-400`)},s(n.packet.transmitted?`Yes`:`No`),3)])]),y(`div`,Wn,[y(`div`,Gn,[i[48]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Is Duplicate`,-1),y(`span`,{class:m(n.packet.is_duplicate?`text-amber-600 dark:text-amber-400`:`text-content-muted dark:text-content-muted`)},s(n.packet.is_duplicate?`Yes`:`No`),3)]),n.packet.drop_reason?(S(),b(`div`,Kn,[i[49]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Drop Reason`,-1),y(`span`,qn,s(n.packet.drop_reason),1)])):p(``,!0)])])])])]),y(`div`,Jn,[y(`button`,{onClick:i[2]||=e=>c(`close`),class:`px-6 py-2 bg-gradient-to-r from-cyan-500/20 to-cyan-400/20 hover:from-cyan-500/30 hover:to-cyan-400/30 border border-cyan-400/30 rounded-[10px] text-content-primary dark:text-content-primary transition-all duration-200 backdrop-blur-sm`},` Close `)])])])],32)):p(``,!0)]),_:1})]))}}),[[`__scopeId`,`data-v-c8711b75`]]),Xn={class:`glass-card rounded-[20px] p-6`},Zn={class:`flex flex-col lg:flex-row lg:justify-between lg:items-center mb-6 gap-4 filter-container`},Qn={class:`flex items-center gap-2 header-info relative`},$n={class:`text-content-secondary dark:text-content-muted text-sm packet-count`},er=[`title`],tr={class:`hidden sm:inline`},nr={key:1,class:`text-accent-red text-sm error-indicator`},rr={class:`flex items-center gap-3 lg:flex filter-controls`},ir={class:`flex flex-col`},ar=[`value`],or={class:`flex flex-col`},sr=[`value`],cr={class:`flex flex-col`},lr={class:`flex flex-col reset-container`},ur=[`disabled`],dr={class:`space-y-4 overflow-hidden`},fr={class:`space-y-4`},pr=[`onClick`],mr={class:`hidden lg:grid grid-cols-12 gap-2 items-center`},hr={class:`col-span-1 text-content-primary dark:text-content-primary text-sm`},gr={class:`col-span-1 flex items-center gap-2`},_r={class:`flex flex-col`},vr={class:`text-content-primary dark:text-content-primary text-xs`},yr=[`title`],br={class:`col-span-2`},xr={class:`col-span-1 text-content-primary dark:text-content-primary text-xs`},Sr={class:`col-span-2`},Cr={class:`space-y-1`},wr={key:0,class:`flex items-center gap-0.5 flex-wrap`},Tr=[`title`],Er={key:0,class:`w-2.5 h-2.5 text-content-muted dark:text-content-muted/60`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Dr={key:0,class:`text-[9px] text-content-muted dark:text-content-muted ml-1`},Or={key:1,class:`flex items-center gap-1`},kr={class:`inline-block px-2 py-0.5 rounded bg-badge-cyan-bg text-badge-cyan-text text-xs font-mono`},Ar={class:`col-span-1 text-content-primary dark:text-content-primary text-xs`},jr={class:`col-span-1 text-content-primary dark:text-content-primary text-xs`},Mr={class:`col-span-1 text-content-primary dark:text-content-primary text-xs`},Nr={class:`col-span-1 text-content-primary dark:text-content-primary text-xs`},Pr={key:0,class:`flex items-center gap-1`},Fr={class:`col-span-1`},Ir={key:0,class:`text-accent-red text-[8px] italic truncate`},Lr={class:`lg:hidden space-y-2`},Rr={class:`flex items-center justify-between`},zr={class:`flex items-center gap-2`},Br={class:`flex flex-col`},Vr={class:`text-content-primary dark:text-content-primary text-sm font-medium`},Hr=[`title`],Ur={class:`flex items-center gap-2 text-right`},Wr={class:`text-content-secondary dark:text-content-muted text-xs`},Gr={class:`flex items-center justify-between`},Kr={class:`flex items-center gap-1.5`},qr={key:0,class:`flex flex-wrap items-center gap-0.5`},Jr=[`title`],Yr={key:0,class:`w-2.5 h-2.5 text-content-muted dark:text-content-muted/60`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Xr={key:0,class:`text-[9px] text-content-muted dark:text-content-muted ml-1`},Zr={class:`flex items-center gap-1`},Qr={class:`inline-block px-2 py-0.5 rounded bg-badge-cyan-bg text-badge-cyan-text text-xs font-mono font-semibold`},$r={class:`flex items-center gap-0.5 text-content-muted dark:text-content-muted/60`},ei={key:0,class:`text-[9px] font-medium`,title:`Multi-hop path`},ti={class:`flex items-center gap-1`},ni={class:`flex items-center gap-2`},ri={class:`flex items-center gap-1`},ii={key:0,class:`flex gap-0.5`},ai={class:`text-content-primary dark:text-content-primary text-xs`},oi={class:`flex items-center justify-between text-content-secondary dark:text-content-muted text-xs`},si={class:`flex items-center gap-3`},ci={class:`flex items-center gap-2`},li={key:0,class:`flex items-center gap-1`},ui={key:0,class:`text-accent-red text-xs italic`},di={key:0,class:`flex justify-between items-center mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke pagination-container`},fi={class:`flex items-center gap-4 pagination-info`},pi={class:`text-content-secondary dark:text-content-muted text-sm`},mi={key:0,class:`flex items-center gap-2 load-more-section`},hi=[`disabled`],gi={class:`text-content-secondary dark:text-content-muted text-xs load-more-count`},_i={class:`flex items-center gap-2 pagination-controls`},vi=[`disabled`],yi={class:`flex items-center gap-1 page-numbers`},bi={key:1,class:`text-content-secondary dark:text-content-muted text-sm px-2 ellipsis`},xi=[`onClick`],Si={key:2,class:`text-content-secondary dark:text-content-muted text-sm px-2 ellipsis`},Ci=[`disabled`],wi={key:1,class:`flex justify-center mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke`},Ti={class:`flex items-center gap-4`},Ei={class:`text-content-secondary dark:text-content-muted text-sm`},Di={class:`text-content-secondary dark:text-content-muted text-xs`},Oi={key:2,class:`flex justify-center mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke`},Q=10,$=1e3,ki=O(l({name:`PacketTable`,__name:`PacketTable`,setup(e){let n=D(),a=k(),o=w(1),l=w(null),u=w(100),_=w(!1),x=w(!1),T=null;f(()=>n.isLoading,e=>{e?(T&&=(clearTimeout(T),null),x.value=!0):T=window.setTimeout(()=>{x.value=!1,T=null},600)});let E=w(null),O=w(!1),A=e=>{E.value=e,O.value=!0},j=()=>{O.value=!1,E.value=null},F=w(P(`packetTable_selectedType`,`all`)),I=w(P(`packetTable_selectedRoute`,`all`)),L=w(!1),R=w(null),ee=[`all`,`0`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`10`,`11`],te=[`all`,`1`,`2`];f(F,e=>{N(`packetTable_selectedType`,e),o.value=1}),f(I,e=>{N(`packetTable_selectedRoute`,e),o.value=1}),f(L,()=>{o.value=1});let z=g(()=>{let e=n.recentPackets;if(F.value!==`all`){let t=parseInt(F.value);e=e.filter(e=>e.type===t)}if(I.value!==`all`){let t=parseInt(I.value);e=e.filter(e=>e.route===t)}return L.value&&R.value!==null&&(e=e.filter(e=>e.timestamp>=R.value)),e}),ne=g(()=>{let e=(o.value-1)*Q,t=e+Q;return z.value.slice(e,t)}),B=g(()=>Math.ceil(z.value.length/Q)),re=g(()=>o.value===B.value),ie=g(()=>n.recentPackets.length>=u.value&&u.value<$),ae=g(()=>re.value&&ie.value&&!_.value),oe=e=>new Date(e*1e3).toLocaleTimeString(void 0,{hour12:!0}),V=e=>({0:`REQ`,1:`RESPONSE`,2:`TXT_MSG`,3:`ACK`,4:`ADVERT`,5:`GRP_TXT`,6:`GRP_DATA`,7:`ANON_REQ`,8:`PATH`,9:`TRACE`,10:`MULTI_PART`,11:`CONTROL`})[e]||`TYPE_${e}`,H=e=>({0:`T-Flood`,1:`Flood`,2:`Direct`,3:`T-Direct`})[e]||`Route ${e}`,U=e=>e.transmitted?`text-accent-green`:`text-primary`,W=e=>e.drop_reason?`Dropped`:e.transmitted?`Forward`:`Received`,G=e=>e===1?`bg-badge-cyan-bg text-badge-cyan-text`:`bg-badge-neutral-bg text-badge-neutral-text`,K=e=>({0:`bg-primary`,1:`bg-accent-green`,2:`bg-secondary`,3:`bg-accent-purple`,4:`bg-accent-red`,5:`bg-accent-cyan`,6:`bg-primary`,7:`bg-accent-purple`,8:`bg-accent-green`,9:`bg-secondary`})[e]||`bg-gray-500`,se=e=>({0:`border-l-primary`,1:`border-l-accent-green`,2:`border-l-secondary`,3:`border-l-accent-purple`,4:`border-l-accent-red`,5:`border-l-accent-cyan`,6:`border-l-primary`,7:`border-l-accent-purple`,8:`border-l-accent-green`,9:`border-l-secondary`})[e]||`border-l-gray-500`,q=e=>!e.transmitted||!e.lbt_attempts||e.lbt_attempts===0?`bg-green-400`:e.lbt_attempts===1?`bg-cyan-400`:e.lbt_attempts===2?`bg-yellow-400`:`bg-orange-400`,ce=e=>e>=1e3?(e/1e3).toFixed(2)+`s`:e.toFixed(1)+`ms`,J=e=>{if(!e)return[];if(Array.isArray(e))return e;if(typeof e==`string`)try{let t=JSON.parse(e);return typeof t==`string`?JSON.parse(t):Array.isArray(t)?t:[]}catch{return[]}return[]},Y=e=>{let t=J(e.original_path),n=J(e.forwarded_path),r=t.length>0?t:n;return r.length===0?null:{hops:r.length-1,nodes:r.map(e=>e.toUpperCase())}},X=e=>{if(e.type!==4||!e.payload)return null;try{let t=e.payload.replace(/\s+/g,``).toUpperCase(),n=t,r=0;if(t.length/2>=100)if(t.length>200)n=t.slice(200),r=0;else return null;if(n.length>=2){let e=parseInt(n.slice(0,2),16);r+=2;let t=!!(e&16),i=!!(e&32),a=!!(e&64);if(!(e&128))return null;if(t&&n.length>=r+16&&(r+=16),i&&n.length>=r+4&&(r+=4),a&&n.length>=r+4&&(r+=4),n.length>r){let e=(n.slice(r).match(/.{2}/g)||[]).map(e=>{let t=parseInt(e,16);return t>=32&&t<=126?String.fromCharCode(t):`.`}).join(``).replace(/\.*$/,``);return e.length>0?e:null}}}catch(e){console.error(`Error parsing ADVERT node name:`,e)}return null},le=()=>{F.value=`all`,I.value=`all`,L.value=!1,R.value=null,o.value=1},ue=()=>{L.value?(L.value=!1,R.value=null):(L.value=!0,R.value=Date.now()/1e3),o.value=1},de=g(()=>R.value?new Date(R.value*1e3).toLocaleTimeString(void 0,{hour12:!0}):``),Z=async e=>{try{let t=e||u.value;await n.fetchRecentPackets({limit:t})}catch(e){console.error(`Error fetching packet data:`,e)}},fe=async()=>{if(!(_.value||u.value>=$)){_.value=!0;try{let e=Math.min(u.value+200,$);u.value=e,await Z(e)}catch(e){console.error(`Error loading more records:`,e)}finally{_.value=!1}}};return r(async()=>{await Z(),a.isConnected||(l.value=window.setInterval(Z,1e4))}),f(()=>a.isConnected,e=>{e?l.value&&=(clearInterval(l.value),null):l.value||=window.setInterval(Z,1e4)}),C(()=>{l.value&&clearInterval(l.value),T&&clearTimeout(T)}),(e,r)=>(S(),b(v,null,[y(`div`,Xn,[y(`div`,Zn,[y(`div`,Qn,[r[7]||=y(`h3`,{class:`text-content-primary dark:text-content-primary text-xl font-semibold`},` Recent Packets `,-1),y(`span`,$n,` (`+s(z.value.length)+` of `+s(i(n).recentPackets.length)+`) `,1),L.value?(S(),b(`span`,{key:0,class:`text-primary text-xs sm:text-sm bg-primary/10 px-2 py-1 rounded-md border border-primary/20 live-mode-badge whitespace-nowrap`,title:`Filter activated at ${de.value}`},[y(`span`,tr,`Live Mode (since `+s(de.value)+`)`,1),r[6]||=y(`span`,{class:`sm:hidden`},`Live`,-1)],8,er)):p(``,!0),i(n).error?(S(),b(`span`,nr,s(i(n).error),1)):p(``,!0)]),y(`div`,rr,[y(`div`,ir,[r[8]||=y(`label`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},`Type`,-1),d(y(`select`,{"onUpdate:modelValue":r[0]||=e=>F.value=e,class:`glass-card border border-stroke-subtle dark:border-stroke rounded-[10px] px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50`},[(S(),b(v,null,t(ee,e=>y(`option`,{key:e,value:e,class:`bg-surface dark:bg-surface-elevated text-content-primary dark:text-content-primary`},s(e===`all`?`All Types`:`Type ${e} (${V(parseInt(e))})`),9,ar)),64))],512),[[M,F.value]])]),y(`div`,or,[r[9]||=y(`label`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},`Route`,-1),d(y(`select`,{"onUpdate:modelValue":r[1]||=e=>I.value=e,class:`glass-card border border-stroke-subtle dark:border-stroke rounded-[10px] px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50`},[(S(),b(v,null,t(te,e=>y(`option`,{key:e,value:e,class:`bg-surface dark:bg-surface-elevated text-content-primary dark:text-content-primary`},s(e===`all`?`All Routes`:`Route ${e} (${H(parseInt(e))})`),9,sr)),64))],512),[[M,I.value]])]),y(`div`,cr,[r[10]||=y(`label`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},`Filter`,-1),y(`button`,{onClick:ue,class:m([`glass-card border rounded-[10px] px-4 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 min-w-[120px]`,{"border-primary bg-primary/10 text-primary":L.value,"border-stroke-subtle dark:border-stroke text-content-secondary dark:text-content-muted hover:border-primary hover:text-content-primary dark:hover:text-content-primary hover:bg-primary/5":!L.value}])},s(L.value?`New Only`:`Show New`),3)]),y(`div`,lr,[r[11]||=y(`label`,{class:`text-transparent text-xs mb-1`},`.`,-1),y(`button`,{onClick:le,class:m([`glass-card border border-stroke-subtle dark:border-stroke hover:border-primary rounded-[10px] px-4 py-2 text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary text-sm transition-all duration-200 focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20`,{"opacity-50 cursor-not-allowed hover:border-stroke-subtle dark:hover:border-stroke hover:text-content-secondary dark:hover:text-content-muted":F.value===`all`&&I.value===`all`&&!L.value,"hover:bg-primary/10":F.value!==`all`||I.value!==`all`||L.value}]),disabled:F.value===`all`&&I.value===`all`&&!L.value},` Reset `,10,ur)])])]),r[25]||=c(``,1),y(`div`,dr,[y(`div`,fr,[(S(!0),b(v,null,t(ne.value,(e,n)=>(S(),b(`div`,{key:`${e.packet_hash}_${e.timestamp}_${n}`,class:m([`packet-row border-b border-stroke-subtle dark:border-dark-border/50 pb-4 hover:bg-background-mute dark:hover:bg-stroke/5 transition-colors duration-150 cursor-pointer rounded-[10px] p-2 border-l-4`,se(e.type)]),onClick:t=>A(e)},[y(`div`,mr,[y(`div`,hr,s(oe(e.timestamp)),1),y(`div`,gr,[y(`div`,{class:m([`w-2 h-2 rounded-full`,K(e.type)])},null,2),y(`div`,_r,[y(`span`,vr,s(V(e.type)),1),e.type===4&&X(e)?(S(),b(`span`,{key:0,class:`text-accent-red/70 text-[10px] font-medium max-w-[80px] truncate`,title:X(e)||void 0},s(X(e)),9,yr)):p(``,!0)])]),y(`div`,br,[y(`span`,{class:m([`inline-block px-2 py-1 rounded text-xs font-medium`,G(e.route)])},s(H(e.route)),3)]),y(`div`,xr,s(e.length)+`B `,1),y(`div`,Sr,[y(`div`,Cr,[Y(e)?(S(),b(`div`,wr,[(S(!0),b(v,null,t(Y(e).nodes,(t,n)=>(S(),b(v,{key:n},[y(`span`,{class:m([`inline-block max-w-full truncate px-1.5 py-0.5 rounded text-[9px] font-mono font-semibold leading-tight tracking-tight`,n===0?`bg-badge-cyan-bg text-badge-cyan-text`:`bg-gray-500/20 text-content-muted dark:text-content-muted`]),title:t},s(t),11,Tr),n0?(S(),b(`span`,Dr,` (`+s(Y(e).hops)+` hop`+s(Y(e).hops>1?`s`:``)+`) `,1)):p(``,!0)])):(S(),b(`div`,Or,[y(`span`,kr,s(e.src_hash?.slice(-4).toUpperCase()||`????`),1),r[13]||=y(`svg`,{class:`w-3 h-3 text-content-muted dark:text-content-muted/60`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2.5`,d:`M9 5l7 7-7 7`})],-1),y(`span`,{class:m([`inline-block px-2 py-0.5 rounded text-xs font-mono`,e.dst_hash?`bg-badge-cyan-bg text-badge-cyan-text`:`bg-yellow-500/20 text-yellow-700 dark:text-yellow-300`])},s(e.dst_hash?e.dst_hash.slice(-4).toUpperCase():`BCAST`),3)]))])]),y(`div`,Ar,s(e.rssi==null?`N/A`:e.rssi.toFixed(0)),1),y(`div`,jr,s(e.snr==null?`N/A`:e.snr.toFixed(1)+`dB`),1),y(`div`,Mr,s(e.score==null?`N/A`:e.score.toFixed(2)),1),y(`div`,Nr,[Number(e.tx_delay_ms)>0?(S(),b(`div`,Pr,[e.transmitted?(S(),b(`div`,{key:0,class:m([`w-1.5 h-1.5 rounded-full flex-shrink-0`,q(e)])},null,2)):p(``,!0),y(`span`,null,s(ce(Number(e.tx_delay_ms))),1)])):p(``,!0)]),y(`div`,Fr,[y(`div`,null,[y(`span`,{class:m([`text-xs font-medium`,U(e)])},s(W(e)),3),e.drop_reason?(S(),b(`p`,Ir,s(e.drop_reason),1)):p(``,!0)])])]),y(`div`,Lr,[y(`div`,Rr,[y(`div`,zr,[y(`div`,{class:m([`w-2 h-2 rounded-full flex-shrink-0`,K(e.type)])},null,2),y(`div`,Br,[y(`span`,Vr,s(V(e.type)),1),e.type===4&&X(e)?(S(),b(`span`,{key:0,class:`text-accent-red/70 text-[10px] font-medium leading-tight`,title:X(e)||void 0},s(X(e)),9,Hr)):p(``,!0)]),y(`span`,{class:m([`inline-block px-2 py-1 rounded text-xs font-medium ml-2`,G(e.route)])},s(H(e.route)),3)]),y(`div`,Ur,[y(`span`,Wr,s(oe(e.timestamp)),1),y(`span`,{class:m([`text-xs font-medium`,U(e)])},s(W(e)),3)])]),y(`div`,Gr,[y(`div`,Kr,[Y(e)?(S(),b(`div`,qr,[r[15]||=y(`span`,{class:`text-content-muted dark:text-content-muted text-[10px] font-medium`},`PATH`,-1),(S(!0),b(v,null,t(Y(e).nodes,(t,n)=>(S(),b(v,{key:n},[y(`span`,{class:m([`inline-block max-w-full truncate px-1.5 py-0.5 rounded text-[9px] font-mono font-semibold leading-tight tracking-tight`,n===0?`bg-badge-cyan-bg text-badge-cyan-text`:`bg-gray-500/20 text-content-muted dark:text-content-muted`]),title:t},s(t),11,Jr),n0?(S(),b(`span`,Xr,` (`+s(Y(e).hops)+` hop`+s(Y(e).hops>1?`s`:``)+`) `,1)):p(``,!0)])):(S(),b(v,{key:1},[y(`div`,Zr,[r[16]||=y(`span`,{class:`text-content-muted dark:text-content-muted text-[10px] font-medium`},`SRC`,-1),y(`span`,Qr,s(e.src_hash?.slice(-4)||`????`),1)]),y(`div`,$r,[r[18]||=y(`svg`,{class:`w-3 h-3`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2.5`,d:`M9 5l7 7-7 7`})],-1),e.route===1?(S(),b(`span`,ei,[...r[17]||=[y(`svg`,{class:`w-2.5 h-2.5 inline`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 5l7 7-7 7M5 5l7 7-7 7`})],-1)]])):p(``,!0)]),y(`div`,ti,[y(`span`,{class:m([`inline-block px-2 py-0.5 rounded text-xs font-mono font-semibold`,e.dst_hash?`bg-badge-cyan-bg text-badge-cyan-text`:`bg-yellow-500/20 text-yellow-700 dark:text-yellow-300`])},s(e.dst_hash?e.dst_hash.slice(-4).toUpperCase():`BCAST`),3),r[19]||=y(`span`,{class:`text-content-muted dark:text-content-muted text-[10px] font-medium`},`DST`,-1)])],64))]),y(`div`,ni,[y(`div`,ri,[e.snr==null?p(``,!0):(S(),b(`div`,ii,[y(`div`,{class:m([`w-1 h-3 rounded-sm`,e.snr>=-10?`bg-green-400`:`bg-white/20`])},null,2),y(`div`,{class:m([`w-1 h-4 rounded-sm`,e.snr>=-5?`bg-green-400`:`bg-white/20`])},null,2),y(`div`,{class:m([`w-1 h-5 rounded-sm`,e.snr>=0?`bg-green-400`:`bg-white/20`])},null,2),y(`div`,{class:m([`w-1 h-6 rounded-sm`,e.snr>=10?`bg-green-400`:`bg-white/20`])},null,2)])),y(`span`,ai,s(e.rssi==null?`TX`:e.rssi.toFixed(0)+`dBm`),1)])])]),y(`div`,oi,[y(`div`,si,[y(`span`,null,s(e.length)+`B`,1),y(`span`,null,`SNR: `+s(e.snr==null?`N/A`:e.snr.toFixed(1)+`dB`),1),y(`span`,null,`Score: `+s(e.score==null?`N/A`:e.score.toFixed(2)),1)]),y(`div`,ci,[Number(e.tx_delay_ms)>0?(S(),b(`span`,li,[e.transmitted?(S(),b(`div`,{key:0,class:m([`w-1.5 h-1.5 rounded-full flex-shrink-0`,q(e)])},null,2)):p(``,!0),y(`span`,null,s(ce(Number(e.tx_delay_ms))),1)])):p(``,!0)])]),e.drop_reason?(S(),b(`div`,ui,s(e.drop_reason),1)):p(``,!0)])],10,pr))),128))])]),B.value>1?(S(),b(`div`,di,[y(`div`,fi,[y(`span`,pi,` Showing `+s((o.value-1)*Q+1)+` - `+s(Math.min(o.value*Q,z.value.length))+` of `+s(z.value.length)+` packets `,1),ae.value?(S(),b(`div`,mi,[r[20]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-xs`},`•`,-1),y(`button`,{onClick:fe,disabled:_.value,class:m([`glass-card border border-primary rounded-[8px] px-3 py-1.5 text-xs transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 hover:bg-primary/5`,{"text-primary border-primary cursor-pointer":!_.value,"text-content-secondary dark:text-content-muted border-stroke-subtle dark:border-stroke cursor-not-allowed opacity-50":_.value}])},s(_.value?`Loading...`:`Load ${Math.min(200,$-u.value)} more`),11,hi),y(`span`,gi,`(`+s(u.value)+`/`+s($)+` max)`,1)])):p(``,!0)]),y(`div`,_i,[y(`button`,{onClick:r[2]||=e=>--o.value,disabled:o.value<=1,class:m([`glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 prev-next-btn`,{"border-stroke-subtle dark:border-stroke text-content-muted dark:text-content-muted cursor-not-allowed opacity-50":o.value<=1,"border-stroke-subtle dark:border-stroke text-content-primary dark:text-content-primary hover:border-primary hover:text-primary hover:bg-primary/5":o.value>1}])},[...r[21]||=[y(`span`,{class:`hidden sm:inline`},`Previous`,-1),y(`span`,{class:`sm:hidden`},`‹`,-1)]],10,vi),y(`div`,yi,[o.value>3?(S(),b(`button`,{key:0,onClick:r[3]||=e=>o.value=1,class:`glass-card border border-stroke-subtle dark:border-stroke hover:border-primary rounded-[8px] px-3 py-2 text-sm text-content-primary dark:text-content-primary hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20`},` 1 `)):p(``,!0),o.value>4?(S(),b(`span`,bi,`...`)):p(``,!0),(S(!0),b(v,null,t(Array.from({length:Math.min(5,B.value)},(e,t)=>Math.max(1,Math.min(o.value-2,B.value-4))+t).filter(e=>e<=B.value),e=>(S(),b(`button`,{key:e,onClick:t=>o.value=e,class:m([`glass-card border rounded-[8px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 page-number`,{"border-primary bg-primary/10 text-primary":o.value===e,"border-stroke-subtle dark:border-stroke text-content-primary dark:text-content-primary hover:border-primary hover:text-primary hover:bg-primary/5":o.value!==e}])},s(e),11,xi))),128)),o.valueo.value=B.value,class:`glass-card border border-stroke-subtle dark:border-stroke hover:border-primary rounded-[8px] px-3 py-2 text-sm text-content-primary dark:text-content-primary hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20`},s(B.value),1)):p(``,!0)]),y(`button`,{onClick:r[5]||=e=>o.value+=1,disabled:o.value>=B.value,class:m([`glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 prev-next-btn`,{"border-stroke-subtle dark:border-stroke text-content-muted dark:text-content-muted cursor-not-allowed opacity-50":o.value>=B.value,"border-stroke-subtle dark:border-stroke text-content-primary dark:text-content-primary hover:border-primary hover:text-primary hover:bg-primary/5":o.value(S(),b(`div`,null,[h(U),y(`div`,Ai,[h(Me),h(ge)]),h(ki)]))}});export{ji as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/Dashboard-Cv42kxN_.js b/repeater/web/html/assets/Dashboard-Cv42kxN_.js deleted file mode 100644 index 52269e8..0000000 --- a/repeater/web/html/assets/Dashboard-Cv42kxN_.js +++ /dev/null @@ -1,2 +0,0 @@ -import{C as wt,a as Nt,L as Bt,P as Ft,b as Et,c as jt,i as It}from"./chart-B185MtDy.js";import{a as ct,r as B,c as Y,E as et,o as bt,H as dt,b as gt,e as l,f as t,t as n,h as k,n as ut,I as Ut,q as r,y as mt,J as vt,K as kt,g as st,F as H,i as Q,L as ft,M as Lt,j as Rt,u as pt,l as rt,N as Vt,T as Ht,m as zt,O as Xt,k as T,x as Gt,w as $t,s as Tt}from"./index-xzvnOpJo.js";import{u as Ot}from"./useSignalQuality-DZXpd2l9.js";import{g as Ct,s as St}from"./preferences-DtwbSSgO.js";const Wt={class:"sparkline-card"},Qt={class:"card-header"},qt={class:"card-title"},Kt={class:"card-values"},Jt={class:"card-chart"},Yt=ct({name:"ChartSparkline",__name:"ChartSparkline",props:{title:{},value:{},color:{},data:{default:()=>[]},showChart:{type:Boolean,default:!0},secondaryValue:{default:void 0},secondaryLabel:{default:""},secondaryColor:{default:""},secondaryData:{default:()=>[]}},setup(ot){wt.register(Nt,Bt,Ft,Et,jt,It);const _=ot,q=B(null),m=B(null),C=h=>{if(h.length<3)return h;const F=Math.min(15,Math.max(3,Math.floor(h.length*.2))),O=[];for(let S=0;SN+w,0)/v.length)}const G=Math.min(12,O.length),E=O.length/G,M=[];for(let S=0;S!_.data||_.data.length===0?[]:C(_.data)),A=Y(()=>!_.secondaryData||_.secondaryData.length===0?[]:C(_.secondaryData)),X=()=>{if(!q.value)return;const h=q.value.getContext("2d");if(!h)return;m.value&&(m.value.destroy(),m.value=null);const F=$.value;if(F.length<2)return;const O=[{data:F,borderColor:_.color,borderWidth:2.5,fill:!1,tension:.4,pointRadius:0,pointHoverRadius:0}],G=A.value;G.length>=2&&_.secondaryColor&&O.push({data:G,borderColor:_.secondaryColor,borderWidth:2,borderDash:[4,3],fill:!1,tension:.4,pointRadius:0,pointHoverRadius:0}),m.value=Ut(new wt(h,{type:"line",data:{labels:F.map((E,M)=>M.toString()),datasets:O},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:800,easing:"easeOutQuart"},plugins:{legend:{display:!1},tooltip:{enabled:!1}},scales:{x:{display:!1,grid:{display:!1}},y:{display:!1,grid:{display:!1},grace:"10%"}},elements:{line:{capBezierPoints:!0}}}}))},D=()=>{if(!m.value){X();return}const h=$.value;if(h.length<2)return;m.value.data.labels=h.map((O,G)=>G.toString()),m.value.data.datasets[0].data=h;const F=A.value;F.length>=2&&_.secondaryColor&&(m.value.data.datasets.length<2?m.value.data.datasets.push({data:F,borderColor:_.secondaryColor,borderWidth:2,borderDash:[4,3],fill:!1,tension:.4,pointRadius:0,pointHoverRadius:0}):m.value.data.datasets[1].data=F),m.value.update("default")};return et(()=>_.data,()=>{dt(()=>D())},{deep:!0}),et(()=>_.color,()=>{m.value&&(m.value.data.datasets[0].borderColor=_.color,m.value.update("none"))}),bt(()=>{dt(()=>X())}),gt(()=>{m.value&&(m.value.destroy(),m.value=null)}),(h,F)=>(r(),l("div",Wt,[t("div",Qt,[t("p",qt,n(h.title),1),t("div",Kt,[t("span",{class:"card-value",style:ut({color:h.color})},n(typeof h.value=="number"?h.value.toLocaleString():h.value),5),h.secondaryValue!==void 0?(r(),l("span",{key:0,class:"card-secondary-value",style:ut({color:h.secondaryColor})},n(h.secondaryLabel)+n(typeof h.secondaryValue=="number"?h.secondaryValue.toLocaleString():h.secondaryValue),5)):k("",!0)])]),t("div",Jt,[h.showChart?(r(),l("canvas",{key:0,ref_key:"canvasRef",ref:q},null,512)):k("",!0)])]))}}),xt=mt(Yt,[["__scopeId","data-v-814635af"]]),Zt={class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3 lg:gap-4 mb-5 stats-cards-container"},te=ct({name:"StatsCards",__name:"StatsCards",setup(ot){const _=vt(),q=kt(),m=B(null),C=B(null),$=B(!1),A=Y(()=>{const h=_.packetStats,F=_.systemStats,O=S=>{const x=Math.floor(S/86400),d=Math.floor(S%86400/3600),g=Math.floor(S%3600/60);return x>0?`${x}d ${d}h`:d>0?`${d}h ${g}m`:`${g}m`},G=h?.total_packets||0,E=h?.dropped_packets||0,M=G>0?Math.round(E/G*100):0;return{packetsReceived:G,packetsForwarded:h?.transmitted_packets||0,uptimeFormatted:F?O(F.uptime_seconds||0):"0m",uptimeHours:F?Math.floor((F.uptime_seconds||0)/3600):0,droppedPackets:E,dropPercent:`${M}%`,signalQuality:Math.round((h?.avg_rssi||0)+120),crcErrorCount:_.crcErrorCount}}),X=Y(()=>_.sparklineData),D=async()=>{if(!$.value)try{$.value=!0,await Promise.all([_.fetchSystemStats(),_.fetchPacketStats({hours:24})]),await dt()}catch(h){console.error("Error fetching stats:",h)}finally{$.value=!1}};return bt(async()=>{await _.initializeSparklineHistory(),D(),q.isConnected||(m.value=window.setInterval(D,3e4)),C.value=window.setInterval(()=>{_.interpolateRates()},6e4)}),et(()=>q.isConnected,h=>{h?m.value&&(clearInterval(m.value),m.value=null):m.value||(m.value=window.setInterval(D,3e4))}),gt(()=>{m.value&&clearInterval(m.value),C.value&&clearInterval(C.value)}),(h,F)=>(r(),l("div",Zt,[st(xt,{title:"Up Time",value:A.value.uptimeFormatted,color:"#EBA0FC",data:[],showChart:!1,class:"stat-card"},null,8,["value"]),st(xt,{title:"RX Packets",value:A.value.packetsReceived,color:"#AAE8E8",data:X.value.totalPackets,class:"stat-card"},null,8,["value","data"]),st(xt,{title:"Forward",value:A.value.packetsForwarded,color:"#FFC246",data:X.value.transmittedPackets,class:"stat-card"},null,8,["value","data"]),st(xt,{title:"Dropped",value:A.value.droppedPackets,color:"#FB787B",data:X.value.droppedPackets,class:"stat-card"},null,8,["value","data"]),st(xt,{title:"CRC Errors",value:A.value.crcErrorCount,color:"#F59E0B",data:X.value.crcErrors,class:"stat-card"},null,8,["value","data"])]))}}),ee=mt(te,[["__scopeId","data-v-84cee3fb"]]),se={class:"glass-card rounded-[10px] p-4 lg:p-6"},ae={class:"h-48 lg:h-56 relative"},ne={key:0,class:"absolute inset-0 flex items-center justify-center"},oe={key:1,class:"absolute inset-0 flex items-center justify-center"},re={class:"text-red-600 dark:text-red-400 text-sm lg:text-base"},le={key:2,class:"absolute inset-0 flex items-center justify-center"},ie={key:3,class:"h-full flex flex-col"},de={key:0,class:"absolute top-2 left-1/2 -translate-x-1/2 bg-white/95 dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke rounded-lg px-3 py-2 z-10 pointer-events-none min-w-48"},ce={class:"text-content-primary dark:text-content-primary text-sm font-medium mb-1"},ue={class:"text-content-primary dark:text-content-primary"},pe={class:"flex-1 flex items-end justify-evenly gap-4 px-4"},me=["onMouseenter"],xe={class:"text-content-primary dark:text-content-primary text-xs sm:text-sm font-semibold text-center w-full",style:{"padding-bottom":"5px"}},ye={class:"text-content-secondary dark:text-content-muted text-xs mt-2 text-center"},be={key:0,class:"mt-4 flex flex-wrap justify-center gap-3 sm:gap-4 px-2 sm:px-4 text-[10px] sm:text-xs text-content-secondary dark:text-content-muted"},ge={class:"truncate text-left"},ve={key:1,class:"mt-3 text-xs text-content-secondary dark:text-content-muted text-center"},he=ct({name:"PacketTypesChart",__name:"PacketTypesChart",setup(ot){const _=B([]),q=vt(),m=kt(),C=B(!0),$=B(null),A=B(null),X=[{name:"Payload",types:["Plain Text Message","Group Text Message","Group Datagram","Multi-part Packet"],subColors:["#3B82F6","#60A5FA","#93C5FD","#BFDBFE"]},{name:"Requests",types:["Request","Response","Anonymous Request"],subColors:["#10B981","#34D399","#6EE7B7"]},{name:"Control",types:["Node Advertisement","Acknowledgment","Returned Path"],subColors:["#F59E0B","#FBBF24","#FCD34D"]},{name:"Routing",types:["Trace"],subColors:["#8B5CF6"]},{name:"Reserved",types:["Reserved Type 11","Reserved Type 12","Reserved Type 13"],subColors:["#6B7280","#9CA3AF","#D1D5DB"]}],D=Y(()=>X.map(x=>{const d=_.value.filter(g=>x.types.some(v=>g.name.includes(v)||g.name===v)).sort((g,v)=>v.count-g.count).map((g,v)=>({...g,color:x.subColors[v%x.subColors.length]}));return{name:x.name,color:x.subColors[0],items:d,total:d.reduce((g,v)=>g+v.count,0)}}).filter(x=>x.total>0)),h=Y(()=>Math.max(...D.value.map(x=>x.total),1)),F=Y(()=>D.value.reduce((x,d)=>x+d.total,0)),O=async()=>{try{$.value=null;const x=await ft.get("/packet_type_graph_data");if(x?.success&&x?.data){const d=x.data;if(d?.series){const g=[];d.series.forEach((v,N)=>{let w=0;v.data&&Array.isArray(v.data)&&(w=v.data.reduce((s,e)=>s+(e[1]||0),0)),w>0&&g.push({name:v.name||`Type ${v.type}`,type:v.type,count:w,color:""})}),_.value=g,C.value=!1}else $.value="No series data in server response",C.value=!1}else $.value="Invalid response from server",C.value=!1}catch(x){$.value=x instanceof Error?x.message:"Failed to load data",C.value=!1}},G={0:"Request",1:"Response",2:"Plain Text Message",3:"Acknowledgment",4:"Node Advertisement",5:"Group Text Message",6:"Group Datagram",7:"Anonymous Request",8:"Returned Path",9:"Trace",10:"Multi-part Packet",15:"Custom Packet"},E=()=>{const x=q.packetTypeBreakdown;!x||x.length===0||(_.value=x.map(d=>({name:G[Number(d.type)]||`Type ${d.type}`,type:d.type,count:d.count,color:""})),C.value=!1,$.value=null)},M=x=>Math.max(x/h.value*90,2),S=(x,d)=>d===0?0:x/d*100;return bt(()=>{O()}),et(()=>q.packetTypeBreakdown,()=>E(),{deep:!0,immediate:!0}),et(()=>m.isConnected,x=>{x||O()},{immediate:!0}),(x,d)=>(r(),l("div",se,[d[3]||(d[3]=t("div",{class:"flex items-baseline justify-between mb-3 lg:mb-4"},[t("h3",{class:"text-content-primary dark:text-content-primary text-lg lg:text-xl font-semibold"},"Packet Types"),t("p",{class:"text-content-secondary dark:text-content-muted text-xs lg:text-sm uppercase"},"Distribution by Type")],-1)),t("div",ae,[C.value?(r(),l("div",ne,d[1]||(d[1]=[t("div",{class:"text-content-secondary dark:text-content-primary text-sm lg:text-base"},"Loading packet types...",-1)]))):$.value?(r(),l("div",oe,[t("div",re,n($.value),1)])):D.value.length===0?(r(),l("div",le,d[2]||(d[2]=[t("div",{class:"text-content-secondary dark:text-content-primary text-sm lg:text-base"},"No packet data available",-1)]))):(r(),l("div",ie,[A.value?(r(),l("div",de,[t("div",ce,n(A.value.name)+" · "+n(A.value.total.toLocaleString()),1),(r(!0),l(H,null,Q(A.value.items,g=>(r(),l("div",{key:g.type,class:"flex justify-between gap-4 text-xs text-content-secondary dark:text-content-muted"},[t("span",null,n(g.name),1),t("span",ue,n(g.count.toLocaleString()),1)]))),128))])):k("",!0),t("div",pe,[(r(!0),l(H,null,Q(D.value,g=>(r(),l("div",{key:g.name,class:"flex flex-col items-center flex-1 max-w-32 h-full justify-end cursor-pointer",onMouseenter:v=>A.value=g,onMouseleave:d[0]||(d[0]=v=>A.value=null)},[t("span",xe,n(g.total.toLocaleString()),1),t("div",{class:"w-full rounded-[5px] transition-all duration-300 ease-out hover:opacity-90 overflow-hidden flex flex-col-reverse",style:ut({height:M(g.total)+"%",minHeight:"8px"})},[(r(!0),l(H,null,Q(g.items,v=>(r(),l("div",{key:v.type,style:ut({height:S(v.count,g.total)+"%",backgroundColor:v.color})},null,4))),128))],4),t("span",ye,n(g.name),1)],40,me))),128))])]))]),D.value.length>0?(r(),l("div",be,[(r(!0),l(H,null,Q(D.value,g=>(r(),l("div",{key:"legend-"+g.name,class:"flex flex-col gap-0.5 min-w-[100px] max-w-[140px] flex-shrink-0"},[(r(!0),l(H,null,Q(g.items,v=>(r(),l("div",{key:v.type,class:"flex items-center gap-1.5"},[t("span",{class:"w-2 h-2 rounded-sm shrink-0",style:ut({backgroundColor:v.color})},null,4),t("span",ge,n(v.name),1)]))),128))]))),128))])):k("",!0),D.value.length>0?(r(),l("div",ve," Total: "+n(F.value.toLocaleString())+" packets ",1)):k("",!0)]))}}),fe=mt(he,[["__scopeId","data-v-0948a4bb"]]),ke={class:"glass-card rounded-[10px] p-4 lg:p-6"},_e={class:"relative h-40 lg:h-48"},we={class:"mt-3 lg:mt-4 grid grid-cols-2 gap-3 lg:gap-4"},$e={class:"text-center"},Te={class:"text-lg lg:text-2xl font-bold text-content-primary dark:text-content-primary"},Ce={class:"text-center"},Se={class:"text-lg lg:text-2xl font-bold text-content-primary dark:text-content-primary"},Re={class:"mt-2 lg:mt-3 grid grid-cols-3 gap-2 lg:gap-3 text-center"},Pe={class:"text-xs lg:text-sm font-semibold text-accent-purple flex items-center justify-center gap-1"},Ae={key:0,class:"inline-block w-1.5 h-1.5 rounded-full bg-secondary opacity-70",title:"Early data - limited uptime"},De={class:"text-xs text-content-secondary dark:text-content-muted"},Me={class:"text-xs lg:text-sm font-semibold text-accent-red flex items-center justify-center gap-1"},Ne={key:0,class:"inline-block w-1.5 h-1.5 rounded-full bg-secondary opacity-70",title:"Early data - limited uptime"},Be={class:"text-xs text-content-secondary dark:text-content-muted"},Fe={class:"text-xs lg:text-sm font-semibold text-white"},Ee=ct({name:"AirtimeUtilizationChart",__name:"AirtimeUtilizationChart",setup(ot){const _=vt(),q=Lt(),m=B(null),C=B([]),$=B(!0),A=B(null),X=B(30),D=B({totalReceived:0,totalTransmitted:0,dropped:0,firstPacketTime:0}),h=B({sf:9,bwHz:62500,cr:5,preamble:17}),F=x=>{const{sf:d,bwHz:g,cr:v,preamble:N}=h.value,w=1,s=0,e=d>=11&&g<=125e3?1:0,u=g/1e3,i=Math.pow(2,d)/u,o=(N+4.25)*i,y=Math.max(8*x-4*d+28+16*w-20*s,0),f=4*(d-2*e),j=(8+Math.ceil(y/f)*v)*i;return o+j},O=x=>{if(x.airtime_ms!==void 0&&x.airtime_ms>0)return x.airtime_ms;const d=x.length??x.payload_length??32;return F(d)},G=(x,d=60)=>{if(x.length===0)return[];const g=1-Math.pow(.5,1/d),v=Math.min(x.length,Math.max(10,Math.floor(d/3)));let N=0,w=0;for(let s=0;s(N=g*s.rxUtil+(1-g)*N,w=g*s.txUtil+(1-g)*w,{...s,rxUtil:N,txUtil:w}))},E=Y(()=>{const x=_.packetStats?.total_packets||0,d=_.packetStats?.transmitted_packets||0,g=q.stats?.uptime_seconds||0,v=x||D.value.totalReceived,N=d||D.value.totalTransmitted,w=D.value.firstPacketTime>0?Math.floor(Date.now()/1e3)-D.value.firstPacketTime:0,s=g||w,e=Math.max(s/3600,.1);if(e<1){const R=Math.max(s/60,1);return{rxRate:{value:Math.round(v/R*100)/100,label:e<.5?"RX/min (early)":"RX/min"},txRate:{value:Math.round(N/R*100)/100,label:e<.5?"TX/min (early)":"TX/min"},confidence:"low"}}const i=Math.round(v/e*100)/100,o=Math.round(N/e*100)/100;let y,f;return e<6?(y=`RX/hr (${Math.round(e)}h)`,f="medium"):e<24?(y=`RX/hr (${Math.round(e)}h)`,f="high"):(y="RX/hr",f="high"),{rxRate:{value:i,label:y},txRate:{value:o,label:y.replace("RX","TX")},confidence:f}}),M=async()=>{$.value=!0;try{const N=Math.floor(Date.now()/1e3),w=N-24*3600;let s=0;try{const b=await ft.get("/stats");if(b.success&&b.data){const P=b.data,z=P.config;if(z?.radio){const U=z.radio;h.value={sf:U.spreading_factor??9,bwHz:U.bandwidth??62500,cr:U.coding_rate??5,preamble:U.preamble_length??17}}s=P.dropped_count??0}}catch{}const e=await ft.get("/filtered_packets",{start_timestamp:w,end_timestamp:N,limit:5e4});if(!e.success){C.value=[],$.value=!1,dt(()=>S());return}const u=e.data||[],i=new Float64Array(8640),o=new Float64Array(8640);let y=0,f=0,R=1/0;for(const b of u){const P=Math.floor((b.timestamp-w)/10);if(P<0||P>=8640)continue;const z=O(b),U=b.packet_origin;b.timestamp[b.rxUtil,b.txUtil]))*1.05;X.value=Math.max(5,Math.ceil(V/5)*5),$.value=!1,dt(()=>S())}catch(x){console.error("Failed to fetch airtime data:",x),C.value=[],$.value=!1,dt(()=>S())}},S=()=>{if(!m.value)return;const x=m.value,d=x.getContext("2d");if(!d)return;const g=x.parentElement;if(!g)return;const v=g.getBoundingClientRect(),N=v.width,w=v.height;x.width=N*window.devicePixelRatio,x.height=w*window.devicePixelRatio,x.style.width=N+"px",x.style.height=w+"px",d.scale(window.devicePixelRatio,window.devicePixelRatio);const s=20,e=45;if(d.clearRect(0,0,N,w),$.value){d.fillStyle="#666",d.font="16px system-ui",d.textAlign="center",d.fillText("Loading chart data...",N/2,w/2);return}if(C.value.length===0){d.fillStyle="#666",d.font="16px system-ui",d.textAlign="center",d.fillText("No data available",N/2,w/2);return}const u=N-e-s,i=w-s*2,o=X.value,y=X.value;d.strokeStyle="rgba(255, 255, 255, 0.1)",d.lineWidth=1,d.font="10px system-ui",d.textAlign="right";for(let f=0;f<=5;f++){const R=s+i*f/5;d.beginPath(),d.moveTo(e,R),d.lineTo(N-s,R),d.stroke();const j=o-f/5*y;d.fillStyle="rgba(255, 255, 255, 0.5)",d.fillText(`${j.toFixed(0)}%`,e-5,R+3)}for(let f=0;f<=6;f++){const R=e+u*f/6;d.beginPath(),d.moveTo(R,s),d.lineTo(R,w-s),d.stroke()}C.value.length>1&&(d.strokeStyle="#EBA0FC",d.lineWidth=2,d.beginPath(),C.value.forEach((f,R)=>{const j=e+u*R/(C.value.length-1),L=w-s-Math.min(f.rxUtil,X.value)/y*i;R===0?d.moveTo(j,L):d.lineTo(j,L)}),d.stroke()),C.value.length>1&&(d.strokeStyle="#FB787B",d.lineWidth=2,d.beginPath(),C.value.forEach((f,R)=>{const j=e+u*R/(C.value.length-1),L=w-s-Math.min(f.txUtil,X.value)/y*i;R===0?d.moveTo(j,L):d.lineTo(j,L)}),d.stroke())};return bt(()=>{M(),A.value=window.setInterval(M,3e4),dt(()=>{S(),setTimeout(()=>S(),100)}),window.addEventListener("resize",S)}),gt(()=>{A.value&&clearInterval(A.value),window.removeEventListener("resize",S)}),(x,d)=>(r(),l("div",ke,[d[3]||(d[3]=Rt('

Airtime Utilization

Activity (Last 24 Hours)

Rx Util
Tx Util
',3)),t("div",_e,[t("canvas",{ref_key:"chartRef",ref:m,class:"absolute inset-0 w-full h-full"},null,512)]),t("div",we,[t("div",$e,[t("div",Te,n(pt(_).packetStats?.total_packets||D.value.totalReceived),1),d[0]||(d[0]=t("div",{class:"text-xs text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Total Received",-1))]),t("div",Ce,[t("div",Se,n(pt(_).packetStats?.transmitted_packets||D.value.totalTransmitted),1),d[1]||(d[1]=t("div",{class:"text-xs text-content-secondary dark:text-content-muted uppercase tracking-wide"},"Total Transmitted",-1))])]),t("div",Re,[t("div",null,[t("div",Pe,[rt(n(E.value.rxRate.value)+" ",1),E.value.confidence==="low"?(r(),l("span",Ae)):k("",!0)]),t("div",De,n(E.value.rxRate.label),1)]),t("div",null,[t("div",Me,[rt(n(E.value.txRate.value)+" ",1),E.value.confidence==="low"?(r(),l("span",Ne)):k("",!0)]),t("div",Be,n(E.value.txRate.label),1)]),t("div",null,[t("div",Fe,n(pt(_).packetStats?.dropped_packets||D.value.dropped),1),d[2]||(d[2]=t("div",{class:"text-xs text-white/60"},"Dropped",-1))])])]))}}),je=mt(Ee,[["__scopeId","data-v-6bf3fe96"]]),Ie={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] shadow-2xl border border-stroke-subtle dark:border-white/20 flex flex-col h-full overflow-hidden"},Ue={class:"flex items-center justify-between p-8 pb-4 flex-shrink-0"},Le={class:"text-content-secondary dark:text-content-muted text-sm"},Ve={class:"flex items-center gap-2"},He=["title"],ze={class:"flex-1 overflow-y-auto custom-scrollbar px-8"},Xe={class:"mb-6"},Ge={class:"glass-card bg-white/5 rounded-[15px] p-4"},Oe={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},We={class:"space-y-3"},Qe={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},qe={class:"text-content-primary dark:text-content-primary font-mono text-sm"},Ke={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Je={class:"text-content-primary dark:text-content-primary font-mono text-xs break-all"},Ye={key:0,class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Ze={class:"text-content-primary dark:text-content-primary font-mono text-xs"},ts={class:"space-y-3"},es={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},ss={class:"text-content-primary dark:text-content-primary font-semibold"},as={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},ns={class:"text-content-primary dark:text-content-primary font-semibold"},os={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},rs={class:"mb-6"},ls={class:"bg-gray-50 dark:bg-white/5 rounded-[15px] p-4 border border-stroke-subtle dark:border-stroke/10"},is={class:"space-y-3"},ds={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},cs={class:"text-content-primary dark:text-content-primary"},us={key:0,class:"pt-2"},ps={class:"glass-card bg-background-mute dark:bg-black/30 rounded-[10px] p-4 mb-4"},ms={class:"w-full overflow-x-auto"},xs={class:"text-content-primary dark:text-content-primary/90 text-xs font-mono whitespace-pre leading-relaxed min-w-full"},ys={class:"flex items-center justify-between mb-3"},bs={class:"text-content-secondary dark:text-content-primary/80 text-sm font-semibold"},gs={class:"text-content-muted dark:text-content-muted text-xs"},vs={class:"bg-background-mute dark:bg-black/40 rounded-[8px] p-3 mb-3"},hs={class:"font-mono text-xs text-content-primary dark:text-content-primary break-all whitespace-pre-wrap leading-relaxed"},fs={class:"bg-gray-50 dark:bg-white/5 rounded-[10px] overflow-hidden"},ks={key:0,class:"min-w-0"},_s={class:"text-cyan-500 text-sm font-mono break-words min-w-0"},ws={class:"text-content-primary dark:text-content-primary text-sm break-words min-w-0"},$s={class:"text-content-primary dark:text-content-primary text-sm font-semibold break-all min-w-0 overflow-hidden"},Ts=["title"],Cs={key:0,class:"text-orange-500 text-xs font-mono break-all min-w-0 overflow-hidden"},Ss=["title"],Rs={class:"grid grid-cols-2 gap-2"},Ps={class:"text-cyan-500 text-sm font-mono break-words"},As={class:"text-content-primary dark:text-content-primary text-sm break-words"},Ds=["title"],Ms={key:0},Ns=["title"],Bs={key:0,class:"text-content-muted dark:text-content-muted text-xs italic mt-2 px-1"},Fs={key:1,class:"py-2"},Es={class:"mb-6"},js={class:"bg-gray-50 dark:bg-white/5 rounded-[15px] p-4 border border-stroke-subtle dark:border-stroke/10"},Is={class:"space-y-4"},Us={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Ls={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Vs={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Hs={key:0,class:"py-2"},zs={class:"bg-background-mute dark:bg-black/20 rounded-[10px] p-4"},Xs={class:"flex items-center flex-wrap gap-2"},Gs={class:"relative group"},Os={class:"relative px-3 py-2 bg-gradient-to-br from-blue-500/20 to-cyan-500/20 border border-cyan-400/40 rounded-lg transform transition-all hover:scale-105"},Ws={class:"font-mono text-[10px] font-semibold tracking-tight text-content-primary dark:text-content-primary/90 sm:text-xs"},Qs={class:"pointer-events-none absolute bottom-full left-1/2 z-50 mb-2 -translate-x-1/2 transform whitespace-nowrap rounded-md bg-neutral-900 px-2 py-1 font-mono text-xs text-white opacity-0 shadow-lg ring-1 ring-white/10 transition-opacity group-hover:opacity-100"},qs={key:0,class:"mx-2 text-cyan-600 dark:text-cyan-400/60"},Ks={key:1,class:"py-2"},Js={class:"text-content-secondary dark:text-content-muted text-sm mb-2 flex items-center"},Ys={key:0,class:"w-4 h-4 ml-2 text-yellow-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Zs={key:1,class:"text-yellow-500 text-xs ml-1"},ta={class:"bg-background-mute dark:bg-black/20 rounded-[10px] p-4"},ea={class:"flex items-center flex-wrap gap-2"},sa={class:"relative group"},aa={key:0,class:"absolute -top-1 -right-1 w-2 h-2 bg-yellow-400 rounded-full animate-pulse"},na={class:"pointer-events-none absolute bottom-full left-1/2 z-50 mb-2 -translate-x-1/2 transform whitespace-nowrap rounded-md bg-neutral-900 px-2 py-1 font-mono text-xs text-white opacity-0 shadow-lg ring-1 ring-white/10 transition-opacity group-hover:opacity-100"},oa={key:0,class:"mx-1 text-orange-600 dark:text-orange-400/60"},ra={class:"mb-6"},la={class:"glass-card bg-gray-50 dark:bg-white/5 rounded-[15px] p-4"},ia={class:"grid grid-cols-1 md:grid-cols-3 gap-4 mb-4"},da={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},ca={class:"text-lg font-bold text-content-primary dark:text-content-primary"},ua={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},pa={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},ma={class:"text-lg font-bold text-content-primary dark:text-content-primary"},xa={key:0,class:"mb-4"},ya={class:"flex items-center gap-3"},ba={class:"flex gap-1"},ga={class:"text-content-secondary dark:text-content-primary/80 text-sm capitalize"},va={key:1,class:"mb-4"},ha={key:2,class:"mb-4"},fa={class:"text-content-secondary dark:text-content-muted text-sm mb-3"},ka={class:"space-y-2"},_a={class:"flex items-center gap-3"},wa={class:"text-content-muted dark:text-content-muted text-sm"},$a={key:3,class:"mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke/10"},Ta={class:"grid grid-cols-1 md:grid-cols-3 gap-3 mb-4"},Ca={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},Sa={class:"text-2xl font-bold text-content-primary dark:text-content-primary"},Ra={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},Pa={class:"text-2xl font-bold text-content-primary dark:text-content-primary"},Aa={class:"text-content-muted dark:text-content-muted text-xs mt-1"},Da={class:"text-center p-3 glass-card bg-background-mute dark:bg-black/20 rounded-[10px]"},Ma={class:"text-content-muted dark:text-content-muted text-xs mt-1"},Na={key:0,class:"glass-card bg-background-mute dark:bg-black/20 rounded-[10px] p-4"},Ba={class:"space-y-3"},Fa={class:"flex-shrink-0 w-16 text-right"},Ea={class:"text-content-secondary dark:text-content-muted text-xs"},ja={class:"flex-1 relative"},Ia={class:"h-8 rounded-lg overflow-hidden bg-background-mute dark:bg-stroke/5 relative"},Ua={class:"absolute inset-0 flex items-center px-3"},La={class:"text-content-primary dark:text-content-primary text-xs font-mono font-semibold"},Va={class:"flex-shrink-0 w-12 text-left"},Ha={class:"text-content-muted dark:text-content-muted text-xs"},za={class:"grid grid-cols-1 md:grid-cols-2 gap-4"},Xa={class:"space-y-2"},Ga={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Oa={class:"text-content-primary dark:text-content-primary"},Wa={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Qa={class:"space-y-2"},qa={class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Ka={key:0,class:"flex justify-between py-2 border-b border-stroke-subtle dark:border-stroke/10"},Ja={class:"text-red-600 dark:text-red-400 text-sm"},Ya={class:"p-8 pt-4 border-t border-stroke-subtle dark:border-stroke/10 flex justify-end flex-shrink-0"},Za=ct({name:"PacketDetailsModal",__name:"PacketDetailsModal",props:{packet:{},isOpen:{type:Boolean},localHash:{}},emits:["close"],setup(ot,{emit:_}){const{getSignalQuality:q}=Ot(),m=ot,C=_,$=B(!1),A=s=>new Date(s*1e3).toLocaleString(),X=s=>s.transmitted?s.is_duplicate?"text-amber-600 dark:text-amber-400":s.drop_reason?"text-red-600 dark:text-red-400":"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400",D=s=>s.transmitted?s.is_duplicate?"Duplicate":s.drop_reason?"Dropped":"Forwarded":"Dropped",h=s=>({0:"Request",1:"Response",2:"Plain Text Message",3:"Acknowledgment",4:"Node Advertisement",5:"Group Text Message",6:"Group Datagram",7:"Anonymous Request",8:"Returned Path",9:"Trace",10:"Multi-part Packet",15:"Custom Packet"})[s]||`Unknown Type (${s})`,F=s=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[s]||`Unknown Route (${s})`,O=s=>{if(!s)return"None";const u=s.replace(/\s+/g,"").toUpperCase().match(/.{2}/g)||[],i=[];for(let o=0;o{try{let i=0;const o=e.length/2;if(o>=100){if(e.length>=i+64){const y=e.slice(i,i+64);s.push({name:"Public Key",byteRange:`${(u+i)/2}-${(u+i+63)/2}`,hexData:y.match(/.{8}/g)?.join(" ")||y,description:"Ed25519 public key of the node (32 bytes)",fields:[{bits:"0-255",name:"Ed25519 Public Key",value:`${y.slice(0,16)}...${y.slice(-16)}`,binary:"32 bytes (256 bits)"}]}),i+=64}if(e.length>=i+8){const y=e.slice(i,i+8),f=parseInt(y,16),R=new Date(f*1e3);s.push({name:"Timestamp",byteRange:`${(u+i)/2}-${(u+i+7)/2}`,hexData:y.match(/.{2}/g)?.join(" ")||y,description:"Unix timestamp of advertisement",fields:[{bits:"0-31",name:"Unix Timestamp",value:`${f} (${R.toLocaleString()})`,binary:f.toString(2).padStart(32,"0")}]}),i+=8}if(e.length>=i+128){const y=e.slice(i,i+128);s.push({name:"Signature",byteRange:`${(u+i)/2}-${(u+i+127)/2}`,hexData:y.match(/.{8}/g)?.join(" ")||y,description:"Ed25519 signature of public key, timestamp, and appdata",fields:[{bits:"0-511",name:"Ed25519 Signature",value:`${y.slice(0,16)}...${y.slice(-16)}`,binary:"64 bytes (512 bits)"}]}),i+=128}if(e.length>i){const y=e.slice(i);E(s,y,u+i)}}else s.push({name:"ADVERT AppData (Partial)",byteRange:`${u/2}-${u/2+o-1}`,hexData:e.match(/.{2}/g)?.join(" ")||e,description:`Partial ADVERT data - appears to be just AppData portion (${o} bytes)`,fields:[{bits:`0-${o*8-1}`,name:"Partial Data",value:`${o} bytes - attempting to decode as AppData`,binary:`${o} bytes (${o*8} bits)`}]}),E(s,e,u)}catch(i){s.push({name:"ADVERT Parse Error",byteRange:"N/A",hexData:e.slice(0,32)+"...",description:"Failed to parse ADVERT payload structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${i instanceof Error?i.message:"Unknown error"}`,binary:"Invalid"}]})}},E=(s,e,u)=>{try{const i=e.length/2;s.push({name:"AppData",byteRange:`${u/2}-${u/2+i-1}`,hexData:e.match(/.{2}/g)?.join(" ")||e,description:`Node advertisement application data (${i} bytes)`,fields:[{bits:`0-${i*8-1}`,name:"Application Data",value:`${i} bytes (contains flags, location, name, etc.)`,binary:`${i} bytes (${i*8} bits)`}]});let o=0;if(e.length>=2){const y=parseInt(e.slice(o,o+2),16),f=[],R=!!(y&16),j=!!(y&32),L=!!(y&64),nt=!!(y&128);if(y&1&&f.push("is chat node"),y&2&&f.push("is repeater"),y&4&&f.push("is room server"),y&8&&f.push("is sensor"),R&&f.push("has location"),j&&f.push("has feature 1"),L&&f.push("has feature 2"),nt&&f.push("has name"),s.push({name:"AppData Flags",byteRange:`${(u+o)/2}`,hexData:`0x${e.slice(o,o+2)}`,description:"Flags indicating which optional fields are present",fields:[{bits:"0-7",name:"Flags",value:f.join(", ")||"none",binary:y.toString(2).padStart(8,"0")}]}),o+=2,R&&e.length>=o+16){const I=e.slice(o,o+8),K=[];for(let p=6;p>=0;p-=2)K.push(I.slice(p,p+2));const V=parseInt(K.join(""),16),b=V>2147483647?V-4294967296:V,P=b/1e6,z=e.slice(o+8,o+16),U=[];for(let p=6;p>=0;p-=2)U.push(z.slice(p,p+2));const tt=parseInt(U.join(""),16),J=tt>2147483647?tt-4294967296:tt,lt=J/1e6;s.push({name:"Location Data",byteRange:`${(u+o)/2}-${(u+o+15)/2}`,hexData:`${I.match(/.{2}/g)?.join(" ")||I} ${z.match(/.{2}/g)?.join(" ")||z}`,description:"GPS coordinates (latitude and longitude)",fields:[{bits:"0-31",name:"Latitude",value:`${P.toFixed(6)}° (raw: ${b})`,binary:b.toString(2).padStart(32,"0")},{bits:"32-63",name:"Longitude",value:`${lt.toFixed(6)}° (raw: ${J})`,binary:J.toString(2).padStart(32,"0")}]}),o+=16}if(j&&e.length>=o+4){const I=e.slice(o,o+4),K=parseInt(I,16);s.push({name:"Feature 1",byteRange:`${(u+o)/2}-${(u+o+3)/2}`,hexData:I.match(/.{2}/g)?.join(" ")||I,description:"Reserved feature 1 (2 bytes)",fields:[{bits:"0-15",name:"Feature 1 Value",value:`${K}`,binary:K.toString(2).padStart(16,"0")}]}),o+=4}if(L&&e.length>=o+4){const I=e.slice(o,o+4),K=parseInt(I,16);s.push({name:"Feature 2",byteRange:`${(u+o)/2}-${(u+o+3)/2}`,hexData:I.match(/.{2}/g)?.join(" ")||I,description:"Reserved feature 2 (2 bytes)",fields:[{bits:"0-15",name:"Feature 2 Value",value:`${K}`,binary:K.toString(2).padStart(16,"0")}]}),o+=4}if(nt&&e.length>o){const I=e.slice(o),K=I.match(/.{2}/g)||[],V=K.map(b=>{const P=parseInt(b,16);return P>=32&&P<=126?String.fromCharCode(P):"."}).join("").replace(/\.+$/,"");s.push({name:"Node Name",byteRange:`${(u+o)/2}-${(u+e.length-1)/2}`,hexData:I.match(/.{2}/g)?.join(" ")||I,description:`Node name string (${K.length} bytes)`,fields:[{bits:`0-${K.length*8-1}`,name:"Node Name",value:`"${V}"`,binary:`ASCII text (${K.length} bytes)`}]})}}}catch(i){s.push({name:"AppData Parse Error",byteRange:"N/A",hexData:e.slice(0,Math.min(32,e.length)),description:"Failed to parse AppData structure",fields:[{bits:"N/A",name:"Error",value:`Parse error: ${i instanceof Error?i.message:"Unknown error"}`,binary:"Invalid"}]})}},M=s=>{if(!s)return[];if(Array.isArray(s))return s;if(typeof s=="string")try{return JSON.parse(s)}catch{return[]}return[]},S=s=>{const e=[];if(!s)return e;try{const u=s.raw_packet;if(u){const i=u.replace(/\s+/g,"").toUpperCase();let o=0;if(i.length>=2){const y=i.slice(o,o+2),f=parseInt(y,16),R=f&3,j=(f&60)>>2,L=(f&192)>>6,nt={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},I={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};if(e.push({name:"Header",byteRange:"0",hexData:`0x${y}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:nt[R]||"Unknown",binary:R.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:I[j]||"Unknown",binary:j.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:L.toString(),binary:L.toString(2).padStart(2,"0")}]}),o+=2,(R===0||R===3)&&i.length>=o+8){const V=i.slice(o,o+8),b=parseInt(V.slice(0,4),16),P=parseInt(V.slice(4,8),16);e.push({name:"Transport Codes",byteRange:"1-4",hexData:`${V.slice(0,4)} ${V.slice(4,8)}`,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-15",name:"Code 1",value:b.toString(),binary:b.toString(2).padStart(16,"0")},{bits:"16-31",name:"Code 2",value:P.toString(),binary:P.toString(2).padStart(16,"0")}]}),o+=8}if(i.length>=o+2){const V=i.slice(o,o+2),b=parseInt(V,16),P=(b>>6)+1,z=b&63,U=z*P;if(e.push({name:"Path Length",byteRange:`${o/2}`,hexData:`0x${V}`,description:`${z} hop${z!==1?"s":""}, ${P}-byte hash${P>1?"es":""} (${U} bytes)`,fields:[{bits:"6-7",name:"Hash Size",value:`${P}-byte`,binary:(b>>6&3).toString(2).padStart(2,"0")},{bits:"0-5",name:"Hop Count",value:`${z}`,binary:(b&63).toString(2).padStart(6,"0")}]}),o+=2,U>0&&i.length>=o+U*2){const tt=i.slice(o,o+U*2),J=new RegExp(`.{${P*2}}`,"g"),lt=tt.match(J)||[];e.push({name:"Path Data",byteRange:`${o/2}-${(o+U*2-2)/2}`,hexData:lt.join(" ")||tt,description:`${z} × ${P}-byte routing hash${z!==1?"es":""}`,fields:lt.map((p,c)=>({bits:`${c*P*8}-${(c+1)*P*8-1}`,name:`Hop ${c+1}`,value:p.toUpperCase(),binary:`${P} byte${P>1?"s":""}`}))}),o+=U*2}}if(i.length>o){const V=i.slice(o),b=V.length/2;j===4?G(e,V,o):e.push({name:"Payload Data",byteRange:`${o/2}-${o/2+b-1}`,hexData:V.match(/.{2}/g)?.join(" ")||V,description:"Application data content",fields:[{bits:`0-${b*8-1}`,name:"Application Data",value:`${b} bytes`,binary:`${b} bytes (${b*8} bits)`}]})}}}else{if(s.header){const i=s.header.replace(/0x/gi,"").replace(/\s+/g,"").toUpperCase(),o=parseInt(i,16),y=o&3,f=(o&60)>>2,R=(o&192)>>6,j={0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"},L={0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTIPART",15:"RAW_CUSTOM"};e.push({name:"Header",byteRange:"0",hexData:`0x${i}`,description:"Contains routing type, payload type, and payload version",fields:[{bits:"0-1",name:"Route Type",value:j[y]||"Unknown",binary:y.toString(2).padStart(2,"0")},{bits:"2-5",name:"Payload Type",value:L[f]||"Unknown",binary:f.toString(2).padStart(4,"0")},{bits:"6-7",name:"Version",value:R.toString(),binary:R.toString(2).padStart(2,"0")}]}),s.transport_codes&&e.push({name:"Transport Codes",byteRange:"1-4",hexData:s.transport_codes,description:"2x 16-bit transport codes for routing optimization",fields:[{bits:"0-31",name:"Transport Codes",value:s.transport_codes,binary:"Available in separate field"}]}),s.original_path&&s.original_path.length>0&&e.push({name:"Original Path",byteRange:"?",hexData:s.original_path.join(" "),description:`Original routing path (${s.original_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${s.original_path.length} nodes`,binary:"Available as node list"}]}),s.forwarded_path&&s.forwarded_path.length>0&&e.push({name:"Forwarded Path",byteRange:"?",hexData:s.forwarded_path.join(" "),description:`Forwarded routing path (${s.forwarded_path.length} nodes)`,fields:[{bits:"0-?",name:"Path Nodes",value:`${s.forwarded_path.length} nodes`,binary:"Available as node list"}]})}if(s.payload){const i=s.payload.replace(/\s+/g,"").toUpperCase(),o=i.length/2;s.type===4?G(e,i,0):e.push({name:"Payload Data",byteRange:`0-${o-1}`,hexData:i.match(/.{2}/g)?.join(" ")||i,description:`Application data content (${o} bytes)`,fields:[{bits:`0-${o*8-1}`,name:"Application Data",value:`${o} bytes`,binary:`${o} bytes (${o*8} bits)`}]})}}}catch{e.push({name:"Parse Error",byteRange:"N/A",hexData:"Error",description:"Unable to parse packet structure",fields:[{bits:"N/A",name:"Error",value:"Parse failed",binary:"Invalid"}]})}return e},x=(s,e)=>s==null||e==null?"text-content-muted dark:text-content-muted":q(e).color,d=s=>{if(s==null)return{level:0,className:"signal-none"};const e=q(s);let u,i;return e.bars>=5?(u=4,i="signal-excellent"):e.bars>=4?(u=3,i="signal-good"):e.bars>=2?(u=2,i="signal-fair"):e.bars>=1?(u=1,i="signal-poor"):(u=0,i="signal-none"),{level:u,className:i}},g=s=>{if(!s)return[];try{const e=JSON.parse(s);return Array.isArray(e)?e:[]}catch{return[]}},v=s=>s>=1e3?`${(s/1e3).toFixed(2)}s`:`${Math.round(s)}ms`,N=s=>{s.key==="Escape"&&C("close")},w=s=>{s.target===s.currentTarget&&C("close")};return et(()=>m.isOpen,s=>{s?document.body.style.overflow="hidden":document.body.style.overflow=""},{immediate:!0}),(s,e)=>(r(),Vt(Xt,{to:"body"},[st(Ht,{name:"modal",appear:""},{default:zt(()=>[s.isOpen&&s.packet?(r(),l("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 overflow-hidden",onClick:w,onKeydown:N,tabindex:"0"},[e[51]||(e[51]=t("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-md pointer-events-none"},null,-1)),t("div",{class:"relative w-full max-w-4xl max-h-[90vh] flex flex-col",onClick:e[3]||(e[3]=Gt(()=>{},["stop"]))},[t("div",Ie,[t("div",Ue,[t("div",null,[e[4]||(e[4]=t("h2",{class:"text-2xl font-bold text-content-primary dark:text-content-primary mb-1"},"Packet Details",-1)),t("p",Le,n(h(s.packet.type))+" - "+n(F(s.packet.route)),1)]),t("div",Ve,[t("button",{onClick:e[0]||(e[0]=u=>$.value=!$.value),class:T(["flex items-center gap-2 px-3 py-1.5 rounded-lg transition-all duration-200",$.value?"bg-cyan-500/20 border border-cyan-400/30 text-cyan-600 dark:text-cyan-400":"bg-background-mute dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-secondary dark:text-content-muted"]),title:$.value?"Hide binary values":"Show binary values"},e[5]||(e[5]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"})],-1),t("span",{class:"text-xs font-medium"},"Binary",-1)]),10,He),t("button",{onClick:e[1]||(e[1]=u=>C("close")),class:"w-8 h-8 flex items-center justify-center rounded-full bg-background-mute dark:bg-white/10 hover:bg-stroke-subtle dark:hover:bg-white/20 transition-colors duration-200 text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary"},e[6]||(e[6]=[t("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])]),t("div",ze,[t("div",Xe,[e[13]||(e[13]=t("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4 flex items-center"},[t("div",{class:"w-2 h-2 rounded-full bg-cyan-400 mr-3"}),rt(" Basic Information ")],-1)),t("div",Ge,[t("div",Oe,[t("div",We,[t("div",Qe,[e[7]||(e[7]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Timestamp",-1)),t("span",qe,n(A(s.packet.timestamp)),1)]),t("div",Ke,[e[8]||(e[8]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Packet Hash",-1)),t("span",Je,n(s.packet.packet_hash),1)]),s.packet.header?(r(),l("div",Ye,[e[9]||(e[9]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Header",-1)),t("span",Ze,n(s.packet.header),1)])):k("",!0)]),t("div",ts,[t("div",es,[e[10]||(e[10]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Type",-1)),t("span",ss,n(s.packet.type)+" ("+n(h(s.packet.type))+")",1)]),t("div",as,[e[11]||(e[11]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Route",-1)),t("span",ns,n(s.packet.route)+" ("+n(F(s.packet.route))+")",1)]),t("div",os,[e[12]||(e[12]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Status",-1)),t("span",{class:T(["font-semibold",X(s.packet)])},n(D(s.packet)),3)])])])])]),t("div",rs,[e[25]||(e[25]=t("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4 flex items-center"},[t("div",{class:"w-2 h-2 rounded-full bg-orange-400 mr-3"}),rt(" Payload Data ")],-1)),t("div",ls,[t("div",is,[t("div",ds,[e[14]||(e[14]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Payload Length",-1)),t("span",cs,n(s.packet.payload_length||s.packet.length)+" bytes",1)]),s.packet.payload?(r(),l("div",us,[e[23]||(e[23]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-3"},"Payload Analysis",-1)),t("div",ps,[e[15]||(e[15]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-2 font-semibold"},"Raw Hex Data",-1)),t("div",ms,[t("pre",xs,n(O(s.packet.payload)),1)])]),(r(!0),l(H,null,Q(S(s.packet).filter(u=>!u.name.includes("Parse Error")),(u,i)=>(r(),l("div",{key:i,class:"mb-4"},[t("div",ys,[t("h4",bs,n(u.name),1),t("span",gs,"Bytes "+n(u.byteRange),1)]),t("div",vs,[t("div",hs,n(u.hexData),1)]),t("div",fs,[t("div",{class:T(["hidden md:grid gap-3 p-3 bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-muted text-xs font-semibold uppercase tracking-wide",$.value?"grid-cols-4":"grid-cols-3"])},[e[16]||(e[16]=t("div",{class:"min-w-0"},"Bits",-1)),e[17]||(e[17]=t("div",{class:"min-w-0"},"Field",-1)),e[18]||(e[18]=t("div",{class:"min-w-0"},"Value",-1)),$.value?(r(),l("div",ks,"Binary")):k("",!0)],2),(r(!0),l(H,null,Q(u.fields,(o,y)=>(r(),l("div",{key:y,class:T(["hidden md:grid gap-3 p-3 border-b border-stroke-subtle dark:border-stroke/5 last:border-b-0 hover:bg-background-mute dark:hover:bg-stroke/5 transition-colors",$.value?"grid-cols-4":"grid-cols-3"])},[t("div",_s,n(o.bits),1),t("div",ws,n(o.name),1),t("div",$s,[t("span",{class:"block",title:o.value},n(o.value),9,Ts)]),$.value?(r(),l("div",Cs,[t("span",{class:"block",title:o.binary},n(o.binary),9,Ss)])):k("",!0)],2))),128)),(r(!0),l(H,null,Q(u.fields,(o,y)=>(r(),l("div",{key:`mobile-${y}`,class:"md:hidden p-3 border-b border-stroke-subtle dark:border-stroke/5 last:border-b-0 space-y-2"},[t("div",Rs,[t("div",null,[e[19]||(e[19]=t("span",{class:"text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide"},"Bits:",-1)),t("div",Ps,n(o.bits),1)]),t("div",null,[e[20]||(e[20]=t("span",{class:"text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide"},"Field:",-1)),t("div",As,n(o.name),1)])]),t("div",null,[e[21]||(e[21]=t("span",{class:"text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide"},"Value:",-1)),t("div",{class:"text-content-primary dark:text-content-primary text-sm font-semibold break-all",title:o.value},n(o.value),9,Ds)]),$.value?(r(),l("div",Ms,[e[22]||(e[22]=t("span",{class:"text-content-secondary dark:text-content-muted text-xs uppercase tracking-wide"},"Binary:",-1)),t("div",{class:"text-orange-500 text-xs font-mono break-all",title:o.binary},n(o.binary),9,Ns)])):k("",!0)]))),128))]),u.description?(r(),l("div",Bs,n(u.description),1)):k("",!0)]))),128))])):(r(),l("div",Fs,e[24]||(e[24]=[t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Payload:",-1),t("span",{class:"text-content-muted dark:text-content-muted ml-2"},"None",-1)])))])])]),t("div",Es,[e[33]||(e[33]=t("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4 flex items-center"},[t("div",{class:"w-2 h-2 rounded-full bg-purple-400 mr-3"}),rt(" Path Information ")],-1)),t("div",js,[t("div",Is,[t("div",Us,[t("div",Ls,[e[26]||(e[26]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Source Hash",-1)),t("span",{class:T(["text-content-primary dark:text-content-primary font-mono text-xs",m.localHash&&s.packet.src_hash===m.localHash?"bg-cyan-400/20 text-cyan-600 dark:text-cyan-300 px-1 rounded":""])},n(s.packet.src_hash||"Unknown"),3)]),t("div",Vs,[e[27]||(e[27]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Destination Hash",-1)),t("span",{class:T(["text-content-primary dark:text-content-primary font-mono text-xs",m.localHash&&s.packet.dst_hash===m.localHash?"bg-cyan-400/20 text-cyan-600 dark:text-cyan-300 px-1 rounded":""])},n(s.packet.dst_hash||"Broadcast"),3)])]),M(s.packet.original_path).length>0?(r(),l("div",Hs,[e[29]||(e[29]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-2"},"Original Path",-1)),t("div",zs,[t("div",Xs,[(r(!0),l(H,null,Q(M(s.packet.original_path),(u,i)=>(r(),l("div",{key:i,class:"flex items-center"},[t("div",Gs,[t("div",Os,[t("div",Ws,n(u.toUpperCase()),1)]),t("div",Qs," Node: "+n(u.toUpperCase()),1)]),i0?(r(),l("div",Ks,[t("div",Js,[e[31]||(e[31]=rt(" Forwarded Path ",-1)),JSON.stringify(M(s.packet.original_path))!==JSON.stringify(M(s.packet.forwarded_path))?(r(),l("svg",Ys,e[30]||(e[30]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):k("",!0),JSON.stringify(M(s.packet.original_path))!==JSON.stringify(M(s.packet.forwarded_path))?(r(),l("span",Zs,"(Modified)")):k("",!0)]),t("div",ta,[t("div",ea,[(r(!0),l(H,null,Q(M(s.packet.forwarded_path),(u,i)=>(r(),l("div",{key:i,class:"flex items-center"},[t("div",sa,[t("div",{class:T(["relative px-3 py-2 bg-gradient-to-br from-orange-500/20 to-yellow-500/20 border border-orange-500 dark:border-orange-400/40 rounded-lg transform transition-all hover:scale-105",m.localHash&&u===m.localHash?"bg-gradient-to-br from-yellow-400/30 to-orange-400/30 border-yellow-300 shadow-yellow-400/20 shadow-lg":"hover:border-orange-500 dark:border-orange-400/60"])},[t("div",{class:T(["font-mono text-[10px] font-semibold tracking-tight sm:text-xs",m.localHash&&u===m.localHash?"text-yellow-200":"text-white/90"])},n(u.toUpperCase()),3),m.localHash&&u===m.localHash?(r(),l("div",aa)):k("",!0)],2),t("div",na,n(u.toUpperCase()),1)]),it("div",{key:u,class:T(["w-2 h-6 rounded-sm transition-all duration-300",u<=d(s.packet.rssi).level?{"signal-excellent":"bg-green-400","signal-good":"bg-cyan-400","signal-fair":"bg-yellow-400","signal-poor":"bg-red-400"}[d(s.packet.rssi).className]:"bg-stroke-subtle dark:bg-stroke/10"])},null,2)),64))]),t("span",ga,n(d(s.packet.rssi).className.replace("signal-","")),1)])])):(r(),l("div",va,e[40]||(e[40]=[t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-2"},"Signal Quality",-1),t("div",{class:"text-content-muted dark:text-content-muted text-sm italic"},"N/A (TX Packet)",-1)]))),s.packet.is_trace&&s.packet.path_snr_details&&s.packet.path_snr_details.length>0?(r(),l("div",ha,[t("div",fa,"Path SNR Details ("+n(s.packet.path_snr_details.length)+" hops)",1),t("div",ka,[(r(!0),l(H,null,Q(s.packet.path_snr_details,(u,i)=>(r(),l("div",{key:i,class:"flex items-center justify-between p-2 glass-card bg-background-mute dark:bg-black/20 rounded-[8px]"},[t("div",_a,[t("span",wa,n(i+1)+".",1),t("span",{class:T(["font-mono text-xs text-content-primary dark:text-content-primary",m.localHash&&u.hash===m.localHash?"bg-cyan-400/20 text-cyan-600 dark:text-cyan-300 px-1 rounded":""])},n(u.hash.toUpperCase()),3)]),t("span",{class:T(["text-sm font-bold",x(u.snr_db,null)])},n(u.snr_db.toFixed(1))+"dB ",3)]))),128))])])):k("",!0),s.packet.transmitted&&s.packet.lbt_attempts!==void 0?(r(),l("div",$a,[e[45]||(e[45]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-3 flex items-center"},[t("svg",{class:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})]),rt(" Listen Before Talk (LBT) Metrics ")],-1)),t("div",Ta,[t("div",Ca,[e[41]||(e[41]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"CAD Attempts",-1)),t("div",Sa,n(s.packet.lbt_attempts),1)]),t("div",Ra,[e[42]||(e[42]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Total LBT Delay",-1)),t("div",Pa,n(v(g(s.packet.lbt_backoff_delays_ms).reduce((u,i)=>u+i,0))),1),t("div",Aa,n(g(s.packet.lbt_backoff_delays_ms).length)+" backoffs ",1)]),t("div",Da,[e[43]||(e[43]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Channel Status",-1)),t("div",{class:T(["text-lg font-bold",s.packet.lbt_channel_busy?"text-yellow-600 dark:text-yellow-400":"text-green-600 dark:text-green-400"])},n(s.packet.lbt_channel_busy?"BUSY":"CLEAR"),3),t("div",Ma,n(s.packet.lbt_channel_busy?"Waited for clear":"Immediate TX"),1)])]),g(s.packet.lbt_backoff_delays_ms).length>0?(r(),l("div",Na,[e[44]||(e[44]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-3 font-semibold"},"Backoff Pattern (Exponential with Jitter)",-1)),t("div",Ba,[(r(!0),l(H,null,Q(g(s.packet.lbt_backoff_delays_ms),(u,i)=>(r(),l("div",{key:i,class:"flex items-center gap-3"},[t("div",Fa,[t("span",Ea,"Attempt "+n(i+1),1)]),t("div",ja,[t("div",Ia,[t("div",{class:T(["h-full rounded-lg transition-all duration-300",[i===0?"bg-gradient-to-r from-cyan-500/50 to-cyan-600/50":i===1?"bg-gradient-to-r from-yellow-500/50 to-yellow-600/50":i===2?"bg-gradient-to-r from-orange-500/50 to-orange-600/50":"bg-gradient-to-r from-red-500/50 to-red-600/50"]]),style:ut({width:`${Math.min(100,u/Math.max(...g(s.packet.lbt_backoff_delays_ms))*100)}%`})},[t("div",Ua,[t("span",La,n(v(u)),1)])],6)])]),t("div",Va,[t("span",Ha,n(Math.round(u/g(s.packet.lbt_backoff_delays_ms).reduce((o,y)=>o+y,0)*100))+"% ",1)])]))),128))])])):k("",!0)])):k("",!0),t("div",za,[t("div",Xa,[t("div",Ga,[e[46]||(e[46]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"TX Delay",-1)),t("span",Oa,n(Number(s.packet.tx_delay_ms)>0?Number(s.packet.tx_delay_ms).toFixed(1)+"ms":"-"),1)]),t("div",Wa,[e[47]||(e[47]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Transmitted",-1)),t("span",{class:T(s.packet.transmitted?"text-green-600 dark:text-green-400":"text-red-600 dark:text-red-400")},n(s.packet.transmitted?"Yes":"No"),3)])]),t("div",Qa,[t("div",qa,[e[48]||(e[48]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Is Duplicate",-1)),t("span",{class:T(s.packet.is_duplicate?"text-amber-600 dark:text-amber-400":"text-content-muted dark:text-content-muted")},n(s.packet.is_duplicate?"Yes":"No"),3)]),s.packet.drop_reason?(r(),l("div",Ka,[e[49]||(e[49]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Drop Reason",-1)),t("span",Ja,n(s.packet.drop_reason),1)])):k("",!0)])])])])]),t("div",Ya,[t("button",{onClick:e[2]||(e[2]=u=>C("close")),class:"px-6 py-2 bg-gradient-to-r from-cyan-500/20 to-cyan-400/20 hover:from-cyan-500/30 hover:to-cyan-400/30 border border-cyan-400/30 rounded-[10px] text-content-primary dark:text-content-primary transition-all duration-200 backdrop-blur-sm"}," Close ")])])])],32)):k("",!0)]),_:1})]))}}),tn=mt(Za,[["__scopeId","data-v-5dbeec6f"]]),en={class:"glass-card rounded-[20px] p-6"},sn={class:"flex flex-col lg:flex-row lg:justify-between lg:items-center mb-6 gap-4 filter-container"},an={class:"flex items-center gap-2 header-info relative"},nn={class:"text-content-secondary dark:text-content-muted text-sm packet-count"},on=["title"],rn={class:"hidden sm:inline"},ln={key:1,class:"text-accent-red text-sm error-indicator"},dn={class:"flex items-center gap-3 lg:flex filter-controls"},cn={class:"flex flex-col"},un=["value"],pn={class:"flex flex-col"},mn=["value"],xn={class:"flex flex-col"},yn={class:"flex flex-col reset-container"},bn=["disabled"],gn={class:"space-y-4 overflow-hidden"},vn={class:"space-y-4"},hn=["onClick"],fn={class:"hidden lg:grid grid-cols-12 gap-2 items-center"},kn={class:"col-span-1 text-content-primary dark:text-content-primary text-sm"},_n={class:"col-span-1 flex items-center gap-2"},wn={class:"flex flex-col"},$n={class:"text-content-primary dark:text-content-primary text-xs"},Tn=["title"],Cn={class:"col-span-2"},Sn={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},Rn={class:"col-span-2"},Pn={class:"space-y-1"},An={key:0,class:"flex items-center gap-0.5 flex-wrap"},Dn=["title"],Mn={key:0,class:"w-2.5 h-2.5 text-content-muted dark:text-content-muted/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Nn={key:0,class:"text-[9px] text-content-muted dark:text-content-muted ml-1"},Bn={key:1,class:"flex items-center gap-1"},Fn={class:"inline-block px-2 py-0.5 rounded bg-badge-cyan-bg text-badge-cyan-text text-xs font-mono"},En={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},jn={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},In={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},Un={class:"col-span-1 text-content-primary dark:text-content-primary text-xs"},Ln={key:0,class:"flex items-center gap-1"},Vn={class:"col-span-1"},Hn={key:0,class:"text-accent-red text-[8px] italic truncate"},zn={class:"lg:hidden space-y-2"},Xn={class:"flex items-center justify-between"},Gn={class:"flex items-center gap-2"},On={class:"flex flex-col"},Wn={class:"text-content-primary dark:text-content-primary text-sm font-medium"},Qn=["title"],qn={class:"flex items-center gap-2 text-right"},Kn={class:"text-content-secondary dark:text-content-muted text-xs"},Jn={class:"flex items-center justify-between"},Yn={class:"flex items-center gap-1.5"},Zn={key:0,class:"flex flex-wrap items-center gap-0.5"},to=["title"],eo={key:0,class:"w-2.5 h-2.5 text-content-muted dark:text-content-muted/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},so={key:0,class:"text-[9px] text-content-muted dark:text-content-muted ml-1"},ao={class:"flex items-center gap-1"},no={class:"inline-block px-2 py-0.5 rounded bg-badge-cyan-bg text-badge-cyan-text text-xs font-mono font-semibold"},oo={class:"flex items-center gap-0.5 text-content-muted dark:text-content-muted/60"},ro={key:0,class:"text-[9px] font-medium",title:"Multi-hop path"},lo={class:"flex items-center gap-1"},io={class:"flex items-center gap-2"},co={class:"flex items-center gap-1"},uo={key:0,class:"flex gap-0.5"},po={class:"text-content-primary dark:text-content-primary text-xs"},mo={class:"flex items-center justify-between text-content-secondary dark:text-content-muted text-xs"},xo={class:"flex items-center gap-3"},yo={class:"flex items-center gap-2"},bo={key:0,class:"flex items-center gap-1"},go={key:0,class:"text-accent-red text-xs italic"},vo={key:0,class:"flex justify-between items-center mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke pagination-container"},ho={class:"flex items-center gap-4 pagination-info"},fo={class:"text-content-secondary dark:text-content-muted text-sm"},ko={key:0,class:"flex items-center gap-2 load-more-section"},_o=["disabled"],wo={class:"text-content-secondary dark:text-content-muted text-xs load-more-count"},$o={class:"flex items-center gap-2 pagination-controls"},To=["disabled"],Co={class:"flex items-center gap-1 page-numbers"},So={key:1,class:"text-content-secondary dark:text-content-muted text-sm px-2 ellipsis"},Ro=["onClick"],Po={key:2,class:"text-content-secondary dark:text-content-muted text-sm px-2 ellipsis"},Ao=["disabled"],Do={key:1,class:"flex justify-center mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke"},Mo={class:"flex items-center gap-4"},No={class:"text-content-secondary dark:text-content-muted text-sm"},Bo={class:"text-content-secondary dark:text-content-muted text-xs"},Fo={key:2,class:"flex justify-center mt-6 pt-4 border-t border-stroke-subtle dark:border-stroke"},yt=10,it=1e3,Eo=ct({name:"PacketTable",__name:"PacketTable",setup(ot){const _=vt(),q=kt(),m=B(1),C=B(null),$=B(100),A=B(!1),X=B(!1);let D=null;et(()=>_.isLoading,p=>{p?(D&&(clearTimeout(D),D=null),X.value=!0):D=window.setTimeout(()=>{X.value=!1,D=null},600)});const h=B(null),F=B(!1),O=p=>{h.value=p,F.value=!0},G=()=>{F.value=!1,h.value=null},E=B(Ct("packetTable_selectedType","all")),M=B(Ct("packetTable_selectedRoute","all")),S=B(!1),x=B(null),d=["all","0","1","2","3","4","5","6","7","8","9","10","11"],g=["all","1","2"];et(E,p=>{St("packetTable_selectedType",p),m.value=1}),et(M,p=>{St("packetTable_selectedRoute",p),m.value=1}),et(S,()=>{m.value=1});const v=Y(()=>{let p=_.recentPackets;if(E.value!=="all"){const c=parseInt(E.value);p=p.filter(a=>a.type===c)}if(M.value!=="all"){const c=parseInt(M.value);p=p.filter(a=>a.route===c)}return S.value&&x.value!==null&&(p=p.filter(c=>c.timestamp>=x.value)),p}),N=Y(()=>{const p=(m.value-1)*yt,c=p+yt;return v.value.slice(p,c)}),w=Y(()=>Math.ceil(v.value.length/yt)),s=Y(()=>m.value===w.value),e=Y(()=>_.recentPackets.length>=$.value&&$.values.value&&e.value&&!A.value),i=p=>new Date(p*1e3).toLocaleTimeString(void 0,{hour12:!0}),o=p=>({0:"REQ",1:"RESPONSE",2:"TXT_MSG",3:"ACK",4:"ADVERT",5:"GRP_TXT",6:"GRP_DATA",7:"ANON_REQ",8:"PATH",9:"TRACE",10:"MULTI_PART",11:"CONTROL"})[p]||`TYPE_${p}`,y=p=>({0:"T-Flood",1:"Flood",2:"Direct",3:"T-Direct"})[p]||`Route ${p}`,f=p=>p.transmitted?"text-accent-green":"text-primary",R=p=>p.drop_reason?"Dropped":p.transmitted?"Forward":"Received",j=p=>p===1?"bg-badge-cyan-bg text-badge-cyan-text":"bg-badge-neutral-bg text-badge-neutral-text",L=p=>({0:"bg-primary",1:"bg-accent-green",2:"bg-secondary",3:"bg-accent-purple",4:"bg-accent-red",5:"bg-accent-cyan",6:"bg-primary",7:"bg-accent-purple",8:"bg-accent-green",9:"bg-secondary"})[p]||"bg-gray-500",nt=p=>({0:"border-l-primary",1:"border-l-accent-green",2:"border-l-secondary",3:"border-l-accent-purple",4:"border-l-accent-red",5:"border-l-accent-cyan",6:"border-l-primary",7:"border-l-accent-purple",8:"border-l-accent-green",9:"border-l-secondary"})[p]||"border-l-gray-500",I=p=>!p.transmitted||!p.lbt_attempts||p.lbt_attempts===0?"bg-green-400":p.lbt_attempts===1?"bg-cyan-400":p.lbt_attempts===2?"bg-yellow-400":"bg-orange-400",K=p=>p>=1e3?(p/1e3).toFixed(2)+"s":p.toFixed(1)+"ms",V=p=>{if(!p)return[];if(Array.isArray(p))return p;if(typeof p=="string")try{const c=JSON.parse(p);return typeof c=="string"?JSON.parse(c):Array.isArray(c)?c:[]}catch{return[]}return[]},b=p=>{const c=V(p.original_path),a=V(p.forwarded_path),W=c.length>0?c:a;return W.length===0?null:{hops:W.length-1,nodes:W.map(at=>at.toUpperCase())}},P=p=>{if(p.type!==4||!p.payload)return null;try{const c=p.payload.replace(/\s+/g,"").toUpperCase();let a=c,W=0;if(c.length/2>=100)if(c.length>200)a=c.slice(200),W=0;else return null;if(a.length>=2){const Z=parseInt(a.slice(0,2),16);W+=2;const Pt=!!(Z&16),At=!!(Z&32),Dt=!!(Z&64);if(!!!(Z&128))return null;if(Pt&&a.length>=W+16&&(W+=16),At&&a.length>=W+4&&(W+=4),Dt&&a.length>=W+4&&(W+=4),a.length>W){const _t=(a.slice(W).match(/.{2}/g)||[]).map(Mt=>{const ht=parseInt(Mt,16);return ht>=32&&ht<=126?String.fromCharCode(ht):"."}).join("").replace(/\.*$/,"");return _t.length>0?_t:null}}}catch(c){console.error("Error parsing ADVERT node name:",c)}return null},z=()=>{E.value="all",M.value="all",S.value=!1,x.value=null,m.value=1},U=()=>{S.value?(S.value=!1,x.value=null):(S.value=!0,x.value=Date.now()/1e3),m.value=1},tt=Y(()=>x.value?new Date(x.value*1e3).toLocaleTimeString(void 0,{hour12:!0}):""),J=async p=>{try{const c=p||$.value;await _.fetchRecentPackets({limit:c})}catch(c){console.error("Error fetching packet data:",c)}},lt=async()=>{if(!(A.value||$.value>=it)){A.value=!0;try{const p=Math.min($.value+200,it);$.value=p,await J(p)}catch(p){console.error("Error loading more records:",p)}finally{A.value=!1}}};return bt(async()=>{await J(),q.isConnected||(C.value=window.setInterval(J,1e4))}),et(()=>q.isConnected,p=>{p?C.value&&(clearInterval(C.value),C.value=null):C.value||(C.value=window.setInterval(J,1e4))}),gt(()=>{C.value&&clearInterval(C.value),D&&clearTimeout(D)}),(p,c)=>(r(),l(H,null,[t("div",en,[t("div",sn,[t("div",an,[c[7]||(c[7]=t("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold"},"Recent Packets",-1)),t("span",nn," ("+n(v.value.length)+" of "+n(pt(_).recentPackets.length)+") ",1),S.value?(r(),l("span",{key:0,class:"text-primary text-xs sm:text-sm bg-primary/10 px-2 py-1 rounded-md border border-primary/20 live-mode-badge whitespace-nowrap",title:`Filter activated at ${tt.value}`},[t("span",rn,"Live Mode (since "+n(tt.value)+")",1),c[6]||(c[6]=t("span",{class:"sm:hidden"},"Live",-1))],8,on)):k("",!0),pt(_).error?(r(),l("span",ln,n(pt(_).error),1)):k("",!0)]),t("div",dn,[t("div",cn,[c[8]||(c[8]=t("label",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Type",-1)),$t(t("select",{"onUpdate:modelValue":c[0]||(c[0]=a=>E.value=a),class:"glass-card border border-stroke-subtle dark:border-stroke rounded-[10px] px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(r(),l(H,null,Q(d,a=>t("option",{key:a,value:a,class:"bg-surface dark:bg-surface-elevated text-content-primary dark:text-content-primary"},n(a==="all"?"All Types":`Type ${a} (${o(parseInt(a))})`),9,un)),64))],512),[[Tt,E.value]])]),t("div",pn,[c[9]||(c[9]=t("label",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Route",-1)),$t(t("select",{"onUpdate:modelValue":c[1]||(c[1]=a=>M.value=a),class:"glass-card border border-stroke-subtle dark:border-stroke rounded-[10px] px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20 transition-all duration-200 min-w-[120px] cursor-pointer hover:border-primary/50"},[(r(),l(H,null,Q(g,a=>t("option",{key:a,value:a,class:"bg-surface dark:bg-surface-elevated text-content-primary dark:text-content-primary"},n(a==="all"?"All Routes":`Route ${a} (${y(parseInt(a))})`),9,mn)),64))],512),[[Tt,M.value]])]),t("div",xn,[c[10]||(c[10]=t("label",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Filter",-1)),t("button",{onClick:U,class:T(["glass-card border rounded-[10px] px-4 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 min-w-[120px]",{"border-primary bg-primary/10 text-primary":S.value,"border-stroke-subtle dark:border-stroke text-content-secondary dark:text-content-muted hover:border-primary hover:text-content-primary dark:hover:text-content-primary hover:bg-primary/5":!S.value}])},n(S.value?"New Only":"Show New"),3)]),t("div",yn,[c[11]||(c[11]=t("label",{class:"text-transparent text-xs mb-1"},".",-1)),t("button",{onClick:z,class:T(["glass-card border border-stroke-subtle dark:border-stroke hover:border-primary rounded-[10px] px-4 py-2 text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary text-sm transition-all duration-200 focus:outline-none focus:border-primary focus:ring-1 focus:ring-primary/20",{"opacity-50 cursor-not-allowed hover:border-stroke-subtle dark:hover:border-stroke hover:text-content-secondary dark:hover:text-content-muted":E.value==="all"&&M.value==="all"&&!S.value,"hover:bg-primary/10":E.value!=="all"||M.value!=="all"||S.value}]),disabled:E.value==="all"&&M.value==="all"&&!S.value}," Reset ",10,bn)])])]),c[25]||(c[25]=Rt('',1)),t("div",gn,[t("div",vn,[(r(!0),l(H,null,Q(N.value,(a,W)=>(r(),l("div",{key:`${a.packet_hash}_${a.timestamp}_${W}`,class:T(["packet-row border-b border-stroke-subtle dark:border-dark-border/50 pb-4 hover:bg-background-mute dark:hover:bg-stroke/5 transition-colors duration-150 cursor-pointer rounded-[10px] p-2 border-l-4",nt(a.type)]),onClick:at=>O(a)},[t("div",fn,[t("div",kn,n(i(a.timestamp)),1),t("div",_n,[t("div",{class:T(["w-2 h-2 rounded-full",L(a.type)])},null,2),t("div",wn,[t("span",$n,n(o(a.type)),1),a.type===4&&P(a)?(r(),l("span",{key:0,class:"text-accent-red/70 text-[10px] font-medium max-w-[80px] truncate",title:P(a)||void 0},n(P(a)),9,Tn)):k("",!0)])]),t("div",Cn,[t("span",{class:T(["inline-block px-2 py-1 rounded text-xs font-medium",j(a.route)])},n(y(a.route)),3)]),t("div",Sn,n(a.length)+"B",1),t("div",Rn,[t("div",Pn,[b(a)?(r(),l("div",An,[(r(!0),l(H,null,Q(b(a).nodes,(at,Z)=>(r(),l(H,{key:Z},[t("span",{class:T(["inline-block max-w-full truncate px-1.5 py-0.5 rounded text-[9px] font-mono font-semibold leading-tight tracking-tight",Z===0?"bg-badge-cyan-bg text-badge-cyan-text":"bg-gray-500/20 text-content-muted dark:text-content-muted"]),title:at},n(at),11,Dn),Z0?(r(),l("span",Nn," ("+n(b(a).hops)+" hop"+n(b(a).hops>1?"s":"")+") ",1)):k("",!0)])):(r(),l("div",Bn,[t("span",Fn,n(a.src_hash?.slice(-4).toUpperCase()||"????"),1),c[13]||(c[13]=t("svg",{class:"w-3 h-3 text-content-muted dark:text-content-muted/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M9 5l7 7-7 7"})],-1)),t("span",{class:T(["inline-block px-2 py-0.5 rounded text-xs font-mono",a.dst_hash?"bg-badge-cyan-bg text-badge-cyan-text":"bg-yellow-500/20 text-yellow-700 dark:text-yellow-300"])},n(a.dst_hash?a.dst_hash.slice(-4).toUpperCase():"BCAST"),3)]))])]),t("div",En,n(a.rssi!=null?a.rssi.toFixed(0):"N/A"),1),t("div",jn,n(a.snr!=null?a.snr.toFixed(1)+"dB":"N/A"),1),t("div",In,n(a.score!=null?a.score.toFixed(2):"N/A"),1),t("div",Un,[Number(a.tx_delay_ms)>0?(r(),l("div",Ln,[a.transmitted?(r(),l("div",{key:0,class:T(["w-1.5 h-1.5 rounded-full flex-shrink-0",I(a)])},null,2)):k("",!0),t("span",null,n(K(Number(a.tx_delay_ms))),1)])):k("",!0)]),t("div",Vn,[t("div",null,[t("span",{class:T(["text-xs font-medium",f(a)])},n(R(a)),3),a.drop_reason?(r(),l("p",Hn,n(a.drop_reason),1)):k("",!0)])])]),t("div",zn,[t("div",Xn,[t("div",Gn,[t("div",{class:T(["w-2 h-2 rounded-full flex-shrink-0",L(a.type)])},null,2),t("div",On,[t("span",Wn,n(o(a.type)),1),a.type===4&&P(a)?(r(),l("span",{key:0,class:"text-accent-red/70 text-[10px] font-medium leading-tight",title:P(a)||void 0},n(P(a)),9,Qn)):k("",!0)]),t("span",{class:T(["inline-block px-2 py-1 rounded text-xs font-medium ml-2",j(a.route)])},n(y(a.route)),3)]),t("div",qn,[t("span",Kn,n(i(a.timestamp)),1),t("span",{class:T(["text-xs font-medium",f(a)])},n(R(a)),3)])]),t("div",Jn,[t("div",Yn,[b(a)?(r(),l("div",Zn,[c[15]||(c[15]=t("span",{class:"text-content-muted dark:text-content-muted text-[10px] font-medium"},"PATH",-1)),(r(!0),l(H,null,Q(b(a).nodes,(at,Z)=>(r(),l(H,{key:Z},[t("span",{class:T(["inline-block max-w-full truncate px-1.5 py-0.5 rounded text-[9px] font-mono font-semibold leading-tight tracking-tight",Z===0?"bg-badge-cyan-bg text-badge-cyan-text":"bg-gray-500/20 text-content-muted dark:text-content-muted"]),title:at},n(at),11,to),Z0?(r(),l("span",so," ("+n(b(a).hops)+" hop"+n(b(a).hops>1?"s":"")+") ",1)):k("",!0)])):(r(),l(H,{key:1},[t("div",ao,[c[16]||(c[16]=t("span",{class:"text-content-muted dark:text-content-muted text-[10px] font-medium"},"SRC",-1)),t("span",no,n(a.src_hash?.slice(-4)||"????"),1)]),t("div",oo,[c[18]||(c[18]=t("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M9 5l7 7-7 7"})],-1)),a.route===1?(r(),l("span",ro,c[17]||(c[17]=[t("svg",{class:"w-2.5 h-2.5 inline",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 5l7 7-7 7M5 5l7 7-7 7"})],-1)]))):k("",!0)]),t("div",lo,[t("span",{class:T(["inline-block px-2 py-0.5 rounded text-xs font-mono font-semibold",a.dst_hash?"bg-badge-cyan-bg text-badge-cyan-text":"bg-yellow-500/20 text-yellow-700 dark:text-yellow-300"])},n(a.dst_hash?a.dst_hash.slice(-4).toUpperCase():"BCAST"),3),c[19]||(c[19]=t("span",{class:"text-content-muted dark:text-content-muted text-[10px] font-medium"},"DST",-1))])],64))]),t("div",io,[t("div",co,[a.snr!=null?(r(),l("div",uo,[t("div",{class:T(["w-1 h-3 rounded-sm",a.snr>=-10?"bg-green-400":"bg-white/20"])},null,2),t("div",{class:T(["w-1 h-4 rounded-sm",a.snr>=-5?"bg-green-400":"bg-white/20"])},null,2),t("div",{class:T(["w-1 h-5 rounded-sm",a.snr>=0?"bg-green-400":"bg-white/20"])},null,2),t("div",{class:T(["w-1 h-6 rounded-sm",a.snr>=10?"bg-green-400":"bg-white/20"])},null,2)])):k("",!0),t("span",po,n(a.rssi!=null?a.rssi.toFixed(0)+"dBm":"TX"),1)])])]),t("div",mo,[t("div",xo,[t("span",null,n(a.length)+"B",1),t("span",null,"SNR: "+n(a.snr!=null?a.snr.toFixed(1)+"dB":"N/A"),1),t("span",null,"Score: "+n(a.score!=null?a.score.toFixed(2):"N/A"),1)]),t("div",yo,[Number(a.tx_delay_ms)>0?(r(),l("span",bo,[a.transmitted?(r(),l("div",{key:0,class:T(["w-1.5 h-1.5 rounded-full flex-shrink-0",I(a)])},null,2)):k("",!0),t("span",null,n(K(Number(a.tx_delay_ms))),1)])):k("",!0)])]),a.drop_reason?(r(),l("div",go,n(a.drop_reason),1)):k("",!0)])],10,hn))),128))])]),w.value>1?(r(),l("div",vo,[t("div",ho,[t("span",fo," Showing "+n((m.value-1)*yt+1)+" - "+n(Math.min(m.value*yt,v.value.length))+" of "+n(v.value.length)+" packets ",1),u.value?(r(),l("div",ko,[c[20]||(c[20]=t("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"•",-1)),t("button",{onClick:lt,disabled:A.value,class:T(["glass-card border border-primary rounded-[8px] px-3 py-1.5 text-xs transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 hover:bg-primary/5",{"text-primary border-primary cursor-pointer":!A.value,"text-content-secondary dark:text-content-muted border-stroke-subtle dark:border-stroke cursor-not-allowed opacity-50":A.value}])},n(A.value?"Loading...":`Load ${Math.min(200,it-$.value)} more`),11,_o),t("span",wo,"("+n($.value)+"/"+n(it)+" max)",1)])):k("",!0)]),t("div",$o,[t("button",{onClick:c[2]||(c[2]=a=>m.value=m.value-1),disabled:m.value<=1,class:T(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 prev-next-btn",{"border-stroke-subtle dark:border-stroke text-content-muted dark:text-content-muted cursor-not-allowed opacity-50":m.value<=1,"border-stroke-subtle dark:border-stroke text-content-primary dark:text-content-primary hover:border-primary hover:text-primary hover:bg-primary/5":m.value>1}])},c[21]||(c[21]=[t("span",{class:"hidden sm:inline"},"Previous",-1),t("span",{class:"sm:hidden"},"‹",-1)]),10,To),t("div",Co,[m.value>3?(r(),l("button",{key:0,onClick:c[3]||(c[3]=a=>m.value=1),class:"glass-card border border-stroke-subtle dark:border-stroke hover:border-primary rounded-[8px] px-3 py-2 text-sm text-content-primary dark:text-content-primary hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"}," 1 ")):k("",!0),m.value>4?(r(),l("span",So,"...")):k("",!0),(r(!0),l(H,null,Q(Array.from({length:Math.min(5,w.value)},(a,W)=>Math.max(1,Math.min(m.value-2,w.value-4))+W).filter(a=>a<=w.value),a=>(r(),l("button",{key:a,onClick:W=>m.value=a,class:T(["glass-card border rounded-[8px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 page-number",{"border-primary bg-primary/10 text-primary":m.value===a,"border-stroke-subtle dark:border-stroke text-content-primary dark:text-content-primary hover:border-primary hover:text-primary hover:bg-primary/5":m.value!==a}])},n(a),11,Ro))),128)),m.valuem.value=w.value),class:"glass-card border border-stroke-subtle dark:border-stroke hover:border-primary rounded-[8px] px-3 py-2 text-sm text-content-primary dark:text-content-primary hover:text-primary hover:bg-primary/5 transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20"},n(w.value),1)):k("",!0)]),t("button",{onClick:c[5]||(c[5]=a=>m.value=m.value+1),disabled:m.value>=w.value,class:T(["glass-card border rounded-[10px] px-3 py-2 text-sm transition-all duration-200 focus:outline-none focus:ring-1 focus:ring-primary/20 prev-next-btn",{"border-stroke-subtle dark:border-stroke text-content-muted dark:text-content-muted cursor-not-allowed opacity-50":m.value>=w.value,"border-stroke-subtle dark:border-stroke text-content-primary dark:text-content-primary hover:border-primary hover:text-primary hover:bg-primary/5":m.value(r(),l("div",null,[st(ee),t("div",Io,[st(je),st(fe)]),st(jo)]))}});export{Oo as default}; diff --git a/repeater/web/html/assets/Dashboard-Ddg_Fz_R.css b/repeater/web/html/assets/Dashboard-Ddg_Fz_R.css deleted file mode 100644 index 8db7b6d..0000000 --- a/repeater/web/html/assets/Dashboard-Ddg_Fz_R.css +++ /dev/null @@ -1 +0,0 @@ -.sparkline-card[data-v-814635af]{background:#ffffffbf;border:1px solid rgba(0,0,0,.06);border-radius:12px;padding:12px 14px;-webkit-backdrop-filter:blur(50px);backdrop-filter:blur(50px);overflow:hidden;transition:background .3s ease,border-color .3s ease,box-shadow .3s ease;box-shadow:0 4px 16px #0000000a,0 1px 3px #00000005}.dark .sparkline-card[data-v-814635af]{background:#0006;border:1px solid rgba(255,255,255,.05);box-shadow:0 4px 16px #0003}.card-header[data-v-814635af]{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:8px}.card-title[data-v-814635af]{color:#4b5563b3;font-size:11px;font-weight:500;text-transform:uppercase;letter-spacing:.05em;transition:color .3s ease}.dark .card-title[data-v-814635af]{color:#fff9}.card-value[data-v-814635af]{font-size:22px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}.card-values[data-v-814635af]{display:flex;align-items:baseline;gap:6px}.card-secondary-value[data-v-814635af]{font-size:13px;font-weight:600;line-height:1;font-variant-numeric:tabular-nums;opacity:.85}.card-chart[data-v-814635af]{width:100%;height:28px;overflow:hidden}.card-chart canvas[data-v-814635af]{width:100%!important;height:100%!important}@media (min-width: 1024px){.sparkline-card[data-v-814635af]{padding:14px 16px}.card-header[data-v-814635af]{margin-bottom:10px}.card-title[data-v-814635af]{font-size:12px}.card-value[data-v-814635af]{font-size:26px}.card-chart[data-v-814635af]{height:32px}}.stats-cards-container[data-v-84cee3fb]{will-change:auto;contain:layout}.stat-card[data-v-84cee3fb]{transition:opacity .3s ease-out}.stat-card[data-v-84cee3fb] .text-lg,.stat-card[data-v-84cee3fb] .text-\[30px\]{transition:color .2s ease-out}canvas[data-v-6bf3fe96]{width:100%;height:100%}.modal-enter-active[data-v-5dbeec6f]{transition:all .3s cubic-bezier(.4,0,.2,1)}.modal-leave-active[data-v-5dbeec6f]{transition:all .2s ease-in}.modal-enter-from[data-v-5dbeec6f]{opacity:0;transform:scale(.95) translateY(-10px)}.modal-leave-to[data-v-5dbeec6f]{opacity:0;transform:scale(1.05)}.custom-scrollbar[data-v-5dbeec6f]{scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.3) transparent}.custom-scrollbar[data-v-5dbeec6f]::-webkit-scrollbar{width:6px}.custom-scrollbar[data-v-5dbeec6f]::-webkit-scrollbar-track{background:#ffffff1a;border-radius:3px}.custom-scrollbar[data-v-5dbeec6f]::-webkit-scrollbar-thumb{background:#ffffff4d;border-radius:3px}.custom-scrollbar[data-v-5dbeec6f]::-webkit-scrollbar-thumb:hover{background:#fff6}.glass-card[data-v-5dbeec6f]{-webkit-backdrop-filter:blur(50px);backdrop-filter:blur(50px)}.fade-enter-active[data-v-a2805165],.fade-leave-active[data-v-a2805165]{transition:opacity .3s ease-out,transform .3s ease-out}.fade-enter-from[data-v-a2805165],.fade-leave-to[data-v-a2805165]{opacity:0;transform:translateY(-10px)}@keyframes spin-a2805165{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.animate-spin[data-v-a2805165]{animation:spin-a2805165 .8s linear infinite}.packet-list-enter-active[data-v-a2805165],.packet-list-leave-active[data-v-a2805165],.packet-list-move[data-v-a2805165]{transition:all .4s ease-out}.packet-list-enter-from[data-v-a2805165]{opacity:0;transform:translateY(-30px) scale(.98)}.packet-list-enter-to[data-v-a2805165],.packet-list-leave-from[data-v-a2805165]{opacity:1;transform:translateY(0) scale(1)}.packet-list-leave-to[data-v-a2805165]{opacity:0;transform:translateY(-20px) scale(.95)}.packet-row[data-v-a2805165]{position:relative;transition:all .3s ease}.packet-list-enter-active .packet-row[data-v-a2805165]{background:linear-gradient(90deg,rgba(78,201,176,.1) 0%,rgba(78,201,176,.05) 50%,transparent 100%);box-shadow:0 0 20px #4ec9b033;border-left:3px solid rgba(78,201,176,.6);border-radius:8px;padding-left:12px}.packet-row[data-v-a2805165]:hover{background:#ffffff05;border-radius:8px;transition:background .2s ease}@media (max-width: 1023px){.filter-container[data-v-a2805165]{flex-direction:column;gap:1rem;align-items:stretch}.header-info[data-v-a2805165]{flex-direction:column;align-items:flex-start;gap:.5rem}.packet-count[data-v-a2805165]{order:1}.live-mode-badge[data-v-a2805165]{order:2;align-self:flex-start}.loading-indicator[data-v-a2805165],.error-indicator[data-v-a2805165]{order:3;align-self:flex-start}.filter-controls[data-v-a2805165]{display:grid!important;grid-template-columns:1fr 1fr;gap:.75rem;flex-direction:column}.filter-controls .flex.flex-col[data-v-a2805165]{flex-direction:column;align-items:stretch;gap:.25rem}.filter-controls .flex.flex-col label[data-v-a2805165]{margin-bottom:0;font-size:.75rem}.reset-container[data-v-a2805165]{grid-column:span 2!important;display:flex;justify-content:center;margin-top:.5rem}.pagination-container[data-v-a2805165]{flex-direction:column;gap:1rem;align-items:stretch}.pagination-info[data-v-a2805165]{justify-content:center;text-align:center;flex-direction:column;gap:.5rem}.load-more-section[data-v-a2805165]{justify-content:center}.load-more-count[data-v-a2805165]{display:none}.pagination-controls[data-v-a2805165]{justify-content:center}.page-numbers[data-v-a2805165]{max-width:200px;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.page-numbers[data-v-a2805165]::-webkit-scrollbar{display:none}.ellipsis[data-v-a2805165]{display:none}.page-number[data-v-a2805165]{min-width:40px;flex-shrink:0}}@media (max-width: 640px){.filter-controls[data-v-a2805165]{grid-template-columns:1fr!important;gap:.75rem}.reset-container[data-v-a2805165]{grid-column:span 1!important}.header-info h3[data-v-a2805165]{font-size:1.125rem}.packet-count[data-v-a2805165]{font-size:.75rem}.live-mode-badge[data-v-a2805165]{font-size:.75rem;padding:.25rem .5rem}.pagination-info span[data-v-a2805165]{font-size:.75rem}.prev-next-btn[data-v-a2805165]{min-width:40px;padding:.5rem}.page-numbers[data-v-a2805165]{max-width:150px;gap:.25rem}.page-number[data-v-a2805165]{min-width:36px;padding:.5rem .25rem;font-size:.75rem}.load-more-section button[data-v-a2805165]{font-size:.6rem;padding:.375rem .75rem}} diff --git a/repeater/web/html/assets/Help-1i4KzGWQ.js b/repeater/web/html/assets/Help-1i4KzGWQ.js new file mode 100644 index 0000000..4a2021e --- /dev/null +++ b/repeater/web/html/assets/Help-1i4KzGWQ.js @@ -0,0 +1 @@ +import{f as e,g as t,u as n,w as r}from"./runtime-core.esm-bundler-IofF4kUm.js";var i=t({name:`HelpView`,__name:`Help`,setup(t){return(t,i)=>(r(),n(`div`,null,[...i[0]||=[e(`

Help & Documentation

pyMC Repeater Wiki

Access documentation, setup guides, troubleshooting tips, and community resources on our official wiki.

Visit Wiki Documentation
Opens in a new tab
`,1)]]))}});export{i as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/Help-xigBHw94.js b/repeater/web/html/assets/Help-xigBHw94.js deleted file mode 100644 index 13fbcc9..0000000 --- a/repeater/web/html/assets/Help-xigBHw94.js +++ /dev/null @@ -1 +0,0 @@ -import{a as e,e as r,j as o,q as n}from"./index-xzvnOpJo.js";const d=e({name:"HelpView",__name:"Help",setup(a){return(i,t)=>(n(),r("div",null,t[0]||(t[0]=[o('

Help & Documentation

pyMC Repeater Wiki

Access documentation, setup guides, troubleshooting tips, and community resources on our official wiki.

Visit Wiki Documentation
Opens in a new tab
',1)])))}});export{d as default}; diff --git a/repeater/web/html/assets/Login-BTzcMhpV.css b/repeater/web/html/assets/Login-BTzcMhpV.css new file mode 100644 index 0000000..a27d165 --- /dev/null +++ b/repeater/web/html/assets/Login-BTzcMhpV.css @@ -0,0 +1 @@ +.bg-gradient-light[data-v-63d1c99c]{background:linear-gradient(#0ea5e966,#06b6d44d)}.bg-gradient-dark[data-v-63d1c99c]{background:linear-gradient(#67e8f94d,#a5f3fc26)}.login-card[data-v-63d1c99c]{-webkit-backdrop-filter:blur(40px)saturate(180%);background:#ffffffb3}.dark .login-card[data-v-63d1c99c]{background:#11191c66}.input-glass[data-v-63d1c99c]{-webkit-backdrop-filter:blur(20px);background:#ffffffe6;border:1px solid #d1d5db}.dark .input-glass[data-v-63d1c99c]{background:#ffffff0d;border-color:#ffffff1a}.input-glass[data-v-63d1c99c]:focus{background:#fff}.dark .input-glass[data-v-63d1c99c]:focus{background:#ffffff1a}.input-glass[data-v-63d1c99c]:focus{box-shadow:0 0 0 1px #aae8e833,0 0 20px #aae8e826,inset 0 1px #ffffff1a}.input-glow[data-v-63d1c99c]{opacity:0;transition:opacity .3s;box-shadow:inset 0 1px #ffffff0d}.input-glass:focus+.input-glow[data-v-63d1c99c]{opacity:1;box-shadow:0 0 20px #aae8e833,inset 0 1px #ffffff1a}.button-glass[data-v-63d1c99c]{-webkit-backdrop-filter:blur(20px);position:relative}.button-glass[data-v-63d1c99c]:before{content:"";-webkit-mask-composite:xor;background:linear-gradient(90deg,#0000 0%,#aae8e84d 50%,#0000 100%);border-radius:12px;padding:1px;transition:transform 1s;position:absolute;inset:0;transform:translate(-100%);-webkit-mask-image:linear-gradient(#fff 0 0),linear-gradient(#fff 0 0);-webkit-mask-position:0 0,0 0;-webkit-mask-size:auto,auto;-webkit-mask-repeat:repeat,repeat;-webkit-mask-clip:content-box,border-box;-webkit-mask-origin:content-box,border-box;-webkit-mask-composite:xor;mask-composite:exclude;-webkit-mask-source-type:auto,auto;mask-mode:match-source,match-source}.button-glass[data-v-63d1c99c]:hover:not(:disabled):before{transform:translate(100%)}.button-glass[data-v-63d1c99c]{box-shadow:0 0 0 1px #aae8e833,0 4px 16px #0003,inset 0 1px #ffffff1a}.button-glass[data-v-63d1c99c]:hover:not(:disabled){box-shadow:0 0 0 1px #aae8e866,0 0 30px #aae8e84d,0 4px 20px #0000004d,inset 0 1px #ffffff26}.login-content:has(.button-glass:hover:not(:disabled)) .logo-image[data-v-63d1c99c]{filter:brightness(1.4)drop-shadow(0 0 12px #aae8e8b3);transform:scale(1.02)}.login-content:has(.button-glass:hover:not(:disabled)) .logo-glow[data-v-63d1c99c]{opacity:.6;transform:scale(1.15)}.logo-glow[data-v-63d1c99c]{opacity:0}.dark .logo-glow[data-v-63d1c99c]{opacity:1}@keyframes float-63d1c99c{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}@keyframes pulse-slow-63d1c99c{0%,to{opacity:.8;transform:scale(1)}50%{opacity:.6;transform:scale(1.05)}}@keyframes pulse-slower-63d1c99c{0%,to{opacity:.75;transform:scale(1)}50%{opacity:.5;transform:scale(1.08)}}@keyframes pulse-slowest-63d1c99c{0%,to{opacity:.8;transform:scale(1)}50%{opacity:.6;transform:scale(1.06)}}.animate-pulse-slow[data-v-63d1c99c]{animation:8s ease-in-out infinite pulse-slow-63d1c99c}.animate-pulse-slower[data-v-63d1c99c]{animation:10s ease-in-out infinite pulse-slower-63d1c99c}.animate-pulse-slowest[data-v-63d1c99c]{animation:12s ease-in-out infinite pulse-slowest-63d1c99c}@keyframes shake-63d1c99c{0%,to{transform:translate(0)}10%,30%,50%,70%,90%{transform:translate(-5px)}20%,40%,60%,80%{transform:translate(5px)}}.animate-shake[data-v-63d1c99c]{animation:.5s ease-in-out shake-63d1c99c}.form-group[data-v-63d1c99c]{position:relative}.form-group:hover label[data-v-63d1c99c]{color:#aae8e8e6;transition:color .3s} diff --git a/repeater/web/html/assets/Login-BiyTDci2.css b/repeater/web/html/assets/Login-BiyTDci2.css deleted file mode 100644 index 98c60ff..0000000 --- a/repeater/web/html/assets/Login-BiyTDci2.css +++ /dev/null @@ -1 +0,0 @@ -.bg-gradient-light[data-v-7d3a3377]{background:linear-gradient(to bottom,#0ea5e966,#06b6d44d)}.bg-gradient-dark[data-v-7d3a3377]{background:linear-gradient(to bottom,#67e8f94d,#a5f3fc26)}.login-card[data-v-7d3a3377]{background:#11191c66;backdrop-filter:blur(40px) saturate(180%);-webkit-backdrop-filter:blur(40px) saturate(180%)}.login-card[data-v-7d3a3377]{background:#ffffffb3}.dark .login-card[data-v-7d3a3377]{background:#11191c66}.input-glass[data-v-7d3a3377]{backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}.input-glass[data-v-7d3a3377]{background:#ffffffe6;border:1px solid #D1D5DB}.dark .input-glass[data-v-7d3a3377]{background:#ffffff0d;border-color:#ffffff1a}.input-glass[data-v-7d3a3377]:focus{background:#fff}.dark .input-glass[data-v-7d3a3377]:focus{background:#ffffff1a}.input-glass[data-v-7d3a3377]:focus{box-shadow:0 0 0 1px #aae8e833,0 0 20px #aae8e826,inset 0 1px #ffffff1a}.input-glow[data-v-7d3a3377]{opacity:0;transition:opacity .3s ease;box-shadow:inset 0 1px #ffffff0d}.input-glass:focus+.input-glow[data-v-7d3a3377]{opacity:1;box-shadow:0 0 20px #aae8e833,inset 0 1px #ffffff1a}.button-glass[data-v-7d3a3377]{backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);position:relative}.button-glass[data-v-7d3a3377]:before{content:"";position:absolute;inset:0;border-radius:12px;padding:1px;background:linear-gradient(90deg,transparent 0%,rgba(170,232,232,.3) 50%,transparent 100%);-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;transform:translate(-100%);transition:transform 1s ease}.button-glass[data-v-7d3a3377]:hover:not(:disabled):before{transform:translate(100%)}.button-glass[data-v-7d3a3377]{box-shadow:0 0 0 1px #aae8e833,0 4px 16px #0003,inset 0 1px #ffffff1a}.button-glass[data-v-7d3a3377]:hover:not(:disabled){box-shadow:0 0 0 1px #aae8e866,0 0 30px #aae8e84d,0 4px 20px #0000004d,inset 0 1px #ffffff26}.login-content:has(.button-glass:hover:not(:disabled)) .logo-image[data-v-7d3a3377]{filter:brightness(1.4) drop-shadow(0 0 12px rgba(170,232,232,.7));transform:scale(1.02)}.login-content:has(.button-glass:hover:not(:disabled)) .logo-glow[data-v-7d3a3377]{opacity:.6;transform:scale(1.15)}.logo-glow[data-v-7d3a3377]{opacity:0}.dark .logo-glow[data-v-7d3a3377]{opacity:1}@keyframes float-7d3a3377{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}@keyframes pulse-slow-7d3a3377{0%,to{opacity:.8;transform:scale(1)}50%{opacity:.6;transform:scale(1.05)}}@keyframes pulse-slower-7d3a3377{0%,to{opacity:.75;transform:scale(1)}50%{opacity:.5;transform:scale(1.08)}}@keyframes pulse-slowest-7d3a3377{0%,to{opacity:.8;transform:scale(1)}50%{opacity:.6;transform:scale(1.06)}}.animate-pulse-slow[data-v-7d3a3377]{animation:pulse-slow-7d3a3377 8s ease-in-out infinite}.animate-pulse-slower[data-v-7d3a3377]{animation:pulse-slower-7d3a3377 10s ease-in-out infinite}.animate-pulse-slowest[data-v-7d3a3377]{animation:pulse-slowest-7d3a3377 12s ease-in-out infinite}@keyframes shake-7d3a3377{0%,to{transform:translate(0)}10%,30%,50%,70%,90%{transform:translate(-5px)}20%,40%,60%,80%{transform:translate(5px)}}.animate-shake[data-v-7d3a3377]{animation:shake-7d3a3377 .5s ease-in-out}.form-group[data-v-7d3a3377]{position:relative}.form-group:hover label[data-v-7d3a3377]{color:#aae8e8e6;transition:color .3s ease} diff --git a/repeater/web/html/assets/Login-Ci7Po_oi.js b/repeater/web/html/assets/Login-Ci7Po_oi.js new file mode 100644 index 0000000..280775a --- /dev/null +++ b/repeater/web/html/assets/Login-Ci7Po_oi.js @@ -0,0 +1,3 @@ +import{dt as e,f as t,g as n,j as r,l as i,m as a,p as o,s,u as c,w as l,z as u}from"./runtime-core.esm-bundler-IofF4kUm.js";import{i as d}from"./vue-router-BsDVl_JC.js";import{n as f,o as p,u as m}from"./api-CrUX-ZnK.js";import{t as h}from"./_plugin-vue_export-helper-V-yks4gF.js";import{d as g,i as _,m as v,r as y,t as b}from"./index-CPWfwDmA.js";var x={class:`glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/20 rounded-[15px] p-6 max-w-md w-full shadow-2xl`},S={key:0,class:`bg-red-500/10 border border-red-500/30 rounded-lg p-3`},C={class:`text-red-600 dark:text-red-400 text-sm`},w={key:1,class:`bg-green-500/10 border border-green-600/40 dark:border-green-500/30 rounded-lg p-3`},T={class:`text-green-600 dark:text-green-400 text-sm`},E={class:`flex justify-end gap-3 mt-6`},D=[`disabled`],O=[`disabled`],k={key:0,class:`w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin`},A=n({name:`ChangePasswordModal`,__name:`ChangePasswordModal`,props:{isOpen:{type:Boolean},canSkip:{type:Boolean,default:!0}},emits:[`close`,`success`],setup(t,{emit:n}){let a=n,d=u(``),p=u(``),m=u(``),h=u(!1),_=u(``),y=u(``),b=()=>{h.value||a(`close`)},A=()=>{a(`close`)},j=async()=>{if(_.value=``,y.value=``,p.value.length<8){_.value=`New password must be at least 8 characters long`;return}if(p.value!==m.value){_.value=`Passwords do not match`;return}if(p.value===d.value){_.value=`New password must be different from current password`;return}h.value=!0;try{let e=(await f.post(`/auth/change_password`,{current_password:d.value,new_password:p.value})).data;e&&e.success?(y.value=e.message||`Password changed successfully!`,setTimeout(()=>{a(`success`),a(`close`)},1500)):_.value=e?.error||`Failed to change password`}catch(e){console.error(`Password change error:`,e),_.value=e.response?.data?.error||`Failed to change password. Please try again.`}finally{h.value=!1}};return(n,a)=>t.isOpen?(l(),c(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm`,onClick:v(b,[`self`])},[s(`div`,x,[a[6]||=s(`h3`,{class:`text-xl font-semibold text-content-primary dark:text-content-primary mb-2`},` Change Default Password `,-1),a[7]||=s(`p`,{class:`text-content-secondary dark:text-content-muted text-sm mb-6`},` You're using the default password. Please change it to secure your account. `,-1),s(`form`,{onSubmit:v(j,[`prevent`]),class:`space-y-4`},[s(`div`,null,[a[3]||=s(`label`,{class:`block text-sm font-medium text-content-secondary dark:text-content-primary/70 mb-2`},`Current Password`,-1),r(s(`input`,{"onUpdate:modelValue":a[0]||=e=>d.value=e,type:`password`,required:``,class:`w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors`,placeholder:`Enter current password`},null,512),[[g,d.value]])]),s(`div`,null,[a[4]||=s(`label`,{class:`block text-sm font-medium text-content-secondary dark:text-content-primary/70 mb-2`},`New Password`,-1),r(s(`input`,{"onUpdate:modelValue":a[1]||=e=>p.value=e,type:`password`,required:``,minlength:`8`,class:`w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors`,placeholder:`Enter new password (min 8 characters)`},null,512),[[g,p.value]])]),s(`div`,null,[a[5]||=s(`label`,{class:`block text-sm font-medium text-content-secondary dark:text-content-primary/70 mb-2`},`Confirm New Password`,-1),r(s(`input`,{"onUpdate:modelValue":a[2]||=e=>m.value=e,type:`password`,required:``,minlength:`8`,class:`w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors`,placeholder:`Confirm new password`},null,512),[[g,m.value]])]),_.value?(l(),c(`div`,S,[s(`p`,C,e(_.value),1)])):i(``,!0),y.value?(l(),c(`div`,w,[s(`p`,T,e(y.value),1)])):i(``,!0),s(`div`,E,[t.canSkip?(l(),c(`button`,{key:0,type:`button`,onClick:A,disabled:h.value,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/10 transition-colors disabled:opacity-50`},` Skip for Now `,8,D)):i(``,!0),s(`button`,{type:`submit`,disabled:h.value,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors disabled:opacity-50 flex items-center gap-2`},[h.value?(l(),c(`div`,k)):i(``,!0),o(` `+e(h.value?`Changing...`:`Change Password`),1)],8,O)])],32)])])):i(``,!0)}}),j={class:`min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-start sm:items-center justify-center p-2 sm:p-4 pt-8 sm:pt-4`},M={class:`absolute top-4 right-4 z-20`},N={class:`login-card relative z-10 w-full max-w-md p-6 sm:p-10 rounded-[16px] sm:rounded-[24px] border-0 sm:border sm:border-stroke-subtle dark:sm:border-stroke/20 shadow-[0_8px_32px_0_rgba(0,0,0,0.1)] dark:shadow-[0_8px_32px_0_rgba(0,0,0,0.37)] backdrop-blur-xl`},P={class:`relative login-content`},F={class:`form-group`},I={class:`relative`},L=[`disabled`],R={class:`form-group`},z={class:`relative`},B=[`disabled`],V={key:0,class:`bg-red-500/10 border border-red-500/30 rounded-[12px] p-2.5 sm:p-3.5 backdrop-blur-sm animate-shake`},H={class:`text-red-600 dark:text-red-400 text-xs sm:text-sm font-medium`},U=[`disabled`],W={key:0,class:`w-4 h-4 sm:w-5 sm:h-5 border-2 border-white border-t-transparent rounded-full animate-spin`},G={key:1,class:`w-4 h-4 sm:w-5 sm:h-5 group-hover:translate-x-1 transition-transform duration-300`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},K={class:`relative`},q={class:`mt-6 sm:mt-8 pt-4 sm:pt-6 border-t border-stroke-subtle dark:border-stroke/10`},J={class:`flex items-center justify-center gap-3`},Y={href:`https://github.com/rightup`,target:`_blank`,class:`inline-flex items-center justify-center w-9 h-9 sm:w-10 sm:h-10 rounded-xl bg-content-primary dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 hover:bg-primary/20 dark:hover:bg-primary/30 hover:border-primary/50 transition-all duration-300 hover:scale-110 group backdrop-blur-sm`,title:`GitHub`},X={href:`https://buymeacoffee.com/rightup`,target:`_blank`,class:`inline-flex items-center justify-center w-9 h-9 sm:w-10 sm:h-10 rounded-xl bg-content-primary dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 hover:bg-yellow-50 dark:hover:bg-yellow-500/20 hover:border-yellow-500/50 transition-all duration-300 hover:scale-110 group backdrop-blur-sm`,title:`Buy Me a Coffee`},Z=h(n({name:`LoginView`,__name:`Login`,setup(n){let o=d(),h=u(`admin`),x=u(``),S=u(!1),C=u(``),w=u(!1),T=u(!1),E=async()=>{C.value=``,S.value=!0;try{let e=p(),t=(await f.post(`/auth/login`,{username:h.value,password:x.value,client_id:e})).data;t.success&&t.token?x.value===`admin123`?(m(t.token),T.value=!0,w.value=!0):(m(t.token),o.push(`/`)):C.value=t.error||`Login failed`}catch(e){console.error(`Login error:`,e),C.value=e.response?.data?.error||`Connection error. Please try again.`}finally{S.value=!1}},D=()=>{w.value=!1,o.push(`/`)},O=()=>{w.value=!1,T.value&&o.push(`/`)};return(n,o)=>(l(),c(`div`,j,[s(`div`,M,[a(b)]),o[9]||=s(`div`,{class:`bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slow -top-[79px] left-[575px] mix-blend-multiply dark:mix-blend-screen pointer-events-none`},null,-1),o[10]||=s(`div`,{class:`bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-75 animate-pulse-slower -top-[94px] -left-[92px] mix-blend-multiply dark:mix-blend-screen pointer-events-none`},null,-1),o[11]||=s(`div`,{class:`bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slowest top-[373px] left-[246px] mix-blend-multiply dark:mix-blend-screen pointer-events-none`},null,-1),s(`div`,N,[o[8]||=s(`div`,{class:`absolute inset-0 rounded-[24px] bg-gradient-to-br from-primary/3 dark:from-primary/5 to-transparent pointer-events-none`},null,-1),s(`div`,P,[o[7]||=t(`
MeshCore

pyMC Repeater

Sign in to access your dashboard

`,1),s(`form`,{onSubmit:v(E,[`prevent`]),class:`space-y-4 sm:space-y-5`},[s(`div`,F,[o[3]||=s(`label`,{for:`username`,class:`block text-content-secondary dark:text-content-primary/90 text-xs sm:text-sm font-medium mb-2`},` Username `,-1),s(`div`,I,[r(s(`input`,{id:`username`,"onUpdate:modelValue":o[0]||=e=>h.value=e,type:`text`,autocomplete:`username`,required:``,class:`input-glass w-full px-3 sm:px-4 py-2.5 sm:py-3.5 rounded-[12px] text-content-primary dark:text-content-primary text-sm placeholder-gray-400 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 transition-all duration-300`,placeholder:`Enter username`,disabled:S.value},null,8,L),[[g,h.value]]),o[2]||=s(`div`,{class:`absolute inset-0 rounded-[12px] pointer-events-none input-glow`},null,-1)])]),s(`div`,R,[o[5]||=s(`label`,{for:`password`,class:`block text-content-secondary dark:text-content-primary/90 text-xs sm:text-sm font-medium mb-2`},` Password `,-1),s(`div`,z,[r(s(`input`,{id:`password`,"onUpdate:modelValue":o[1]||=e=>x.value=e,type:`password`,autocomplete:`current-password`,required:``,class:`input-glass w-full px-3 sm:px-4 py-2.5 sm:py-3.5 rounded-[12px] text-content-primary dark:text-content-primary text-sm placeholder-gray-400 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 transition-all duration-300`,placeholder:`Enter password`,disabled:S.value},null,8,B),[[g,x.value]]),o[4]||=s(`div`,{class:`absolute inset-0 rounded-[12px] pointer-events-none input-glow`},null,-1)])]),C.value?(l(),c(`div`,V,[s(`p`,H,e(C.value),1)])):i(``,!0),s(`button`,{type:`submit`,disabled:S.value,class:`button-glass w-full relative overflow-hidden bg-primary/20 hover:bg-primary/30 active:scale-[0.98] text-primary dark:text-white font-semibold py-3 sm:py-4 px-4 rounded-[12px] border border-primary/50 hover:border-primary/60 transition-all duration-300 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 sm:gap-2.5 group mt-6 sm:mt-8 text-sm sm:text-base backdrop-blur-sm`},[S.value?(l(),c(`div`,W)):(l(),c(`svg`,G,[...o[6]||=[s(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1`},null,-1)]])),s(`span`,K,e(S.value?`Signing in...`:`Sign In`),1)],8,U)],32),s(`div`,q,[s(`div`,J,[s(`a`,Y,[a(_,{class:`w-5 h-5 sm:w-6 sm:h-6 text-white group-hover:text-primary transition-colors`})]),s(`a`,X,[a(y,{class:`w-5 h-5 sm:w-6 sm:h-6 text-white group-hover:text-yellow-500 transition-colors`})])])])])]),a(A,{"is-open":w.value,"can-skip":!0,onClose:O,onSuccess:D},null,8,[`is-open`])]))}}),[[`__scopeId`,`data-v-63d1c99c`]]);export{Z as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/Login-D0PhxOgj.js b/repeater/web/html/assets/Login-D0PhxOgj.js deleted file mode 100644 index a560b66..0000000 --- a/repeater/web/html/assets/Login-D0PhxOgj.js +++ /dev/null @@ -1 +0,0 @@ -import{a as P,r as a,e as i,h as g,x as _,f as e,w as v,v as h,t as y,l as M,z as S,q as u,g as w,_ as $,j,G as N,C as B,A as D,p as q,B as I,D as C,y as L}from"./index-xzvnOpJo.js";const U={class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/20 rounded-[15px] p-6 max-w-md w-full shadow-2xl"},E={key:0,class:"bg-red-500/10 border border-red-500/30 rounded-lg p-3"},z={class:"text-red-600 dark:text-red-400 text-sm"},T={key:1,class:"bg-green-500/10 border border-green-600/40 dark:border-green-500/30 rounded-lg p-3"},G={class:"text-green-600 dark:text-green-400 text-sm"},H={class:"flex justify-end gap-3 mt-6"},F=["disabled"],O=["disabled"],R={key:0,class:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"},A=P({name:"ChangePasswordModal",__name:"ChangePasswordModal",props:{isOpen:{type:Boolean},canSkip:{type:Boolean,default:!0}},emits:["close","success"],setup(V,{emit:x}){const p=x,l=a(""),s=a(""),d=a(""),o=a(!1),n=a(""),m=a(""),f=()=>{o.value||p("close")},k=()=>{p("close")},c=async()=>{if(n.value="",m.value="",s.value.length<8){n.value="New password must be at least 8 characters long";return}if(s.value!==d.value){n.value="Passwords do not match";return}if(s.value===l.value){n.value="New password must be different from current password";return}o.value=!0;try{const r=(await S.post("/auth/change_password",{current_password:l.value,new_password:s.value})).data;r&&r.success?(m.value=r.message||"Password changed successfully!",setTimeout(()=>{p("success"),p("close")},1500)):n.value=r?.error||"Failed to change password"}catch(t){console.error("Password change error:",t),n.value=t.response?.data?.error||"Failed to change password. Please try again."}finally{o.value=!1}};return(t,r)=>t.isOpen?(u(),i("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:_(f,["self"])},[e("div",U,[r[6]||(r[6]=e("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary mb-2"},"Change Default Password",-1)),r[7]||(r[7]=e("p",{class:"text-content-secondary dark:text-content-muted text-sm mb-6"}," You're using the default password. Please change it to secure your account. ",-1)),e("form",{onSubmit:_(c,["prevent"]),class:"space-y-4"},[e("div",null,[r[3]||(r[3]=e("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-primary/70 mb-2"},"Current Password",-1)),v(e("input",{"onUpdate:modelValue":r[0]||(r[0]=b=>l.value=b),type:"password",required:"",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors",placeholder:"Enter current password"},null,512),[[h,l.value]])]),e("div",null,[r[4]||(r[4]=e("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-primary/70 mb-2"},"New Password",-1)),v(e("input",{"onUpdate:modelValue":r[1]||(r[1]=b=>s.value=b),type:"password",required:"",minlength:"8",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors",placeholder:"Enter new password (min 8 characters)"},null,512),[[h,s.value]])]),e("div",null,[r[5]||(r[5]=e("label",{class:"block text-sm font-medium text-content-secondary dark:text-content-primary/70 mb-2"},"Confirm New Password",-1)),v(e("input",{"onUpdate:modelValue":r[2]||(r[2]=b=>d.value=b),type:"password",required:"",minlength:"8",class:"w-full px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary transition-colors",placeholder:"Confirm new password"},null,512),[[h,d.value]])]),n.value?(u(),i("div",E,[e("p",z,y(n.value),1)])):g("",!0),m.value?(u(),i("div",T,[e("p",G,y(m.value),1)])):g("",!0),e("div",H,[t.canSkip?(u(),i("button",{key:0,type:"button",onClick:k,disabled:o.value,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg border border-stroke-subtle dark:border-stroke/10 transition-colors disabled:opacity-50"}," Skip for Now ",8,F)):g("",!0),e("button",{type:"submit",disabled:o.value,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-white rounded-lg border border-primary/50 transition-colors disabled:opacity-50 flex items-center gap-2"},[o.value?(u(),i("div",R)):g("",!0),M(" "+y(o.value?"Changing...":"Change Password"),1)],8,O)])],32)])])):g("",!0)}}),Y={class:"min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-start sm:items-center justify-center p-2 sm:p-4 pt-8 sm:pt-4"},J={class:"absolute top-4 right-4 z-20"},K={class:"login-card relative z-10 w-full max-w-md p-6 sm:p-10 rounded-[16px] sm:rounded-[24px] border-0 sm:border sm:border-stroke-subtle dark:sm:border-stroke/20 shadow-[0_8px_32px_0_rgba(0,0,0,0.1)] dark:shadow-[0_8px_32px_0_rgba(0,0,0,0.37)] backdrop-blur-xl"},Q={class:"relative login-content"},W={class:"form-group"},X={class:"relative"},Z=["disabled"],ee={class:"form-group"},te={class:"relative"},re=["disabled"],se={key:0,class:"bg-red-500/10 border border-red-500/30 rounded-[12px] p-2.5 sm:p-3.5 backdrop-blur-sm animate-shake"},oe={class:"text-red-600 dark:text-red-400 text-xs sm:text-sm font-medium"},ae=["disabled"],ne={key:0,class:"w-4 h-4 sm:w-5 sm:h-5 border-2 border-white border-t-transparent rounded-full animate-spin"},le={key:1,class:"w-4 h-4 sm:w-5 sm:h-5 group-hover:translate-x-1 transition-transform duration-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},de={class:"relative"},ie={class:"mt-6 sm:mt-8 pt-4 sm:pt-6 border-t border-stroke-subtle dark:border-stroke/10"},ue={class:"flex items-center justify-center gap-3"},pe={href:"https://github.com/rightup",target:"_blank",class:"inline-flex items-center justify-center w-9 h-9 sm:w-10 sm:h-10 rounded-xl bg-content-primary dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 hover:bg-primary/20 dark:hover:bg-primary/30 hover:border-primary/50 transition-all duration-300 hover:scale-110 group backdrop-blur-sm",title:"GitHub"},ce={href:"https://buymeacoffee.com/rightup",target:"_blank",class:"inline-flex items-center justify-center w-9 h-9 sm:w-10 sm:h-10 rounded-xl bg-content-primary dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 hover:bg-yellow-50 dark:hover:bg-yellow-500/20 hover:border-yellow-500/50 transition-all duration-300 hover:scale-110 group backdrop-blur-sm",title:"Buy Me a Coffee"},me=P({name:"LoginView",__name:"Login",setup(V){const x=q(),p=a("admin"),l=a(""),s=a(!1),d=a(""),o=a(!1),n=a(!1),m=async()=>{d.value="",s.value=!0;try{const c=I(),r=(await S.post("/auth/login",{username:p.value,password:l.value,client_id:c})).data;r.success&&r.token?l.value==="admin123"?(C(r.token),n.value=!0,o.value=!0):(C(r.token),x.push("/")):d.value=r.error||"Login failed"}catch(c){console.error("Login error:",c);const t=c;d.value=t.response?.data?.error||"Connection error. Please try again."}finally{s.value=!1}},f=()=>{o.value=!1,x.push("/")},k=()=>{o.value=!1,n.value&&x.push("/")};return(c,t)=>(u(),i("div",Y,[e("div",J,[w($)]),t[9]||(t[9]=e("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slow -top-[79px] left-[575px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),t[10]||(t[10]=e("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-75 animate-pulse-slower -top-[94px] -left-[92px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),t[11]||(t[11]=e("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slowest top-[373px] left-[246px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),e("div",K,[t[8]||(t[8]=e("div",{class:"absolute inset-0 rounded-[24px] bg-gradient-to-br from-primary/3 dark:from-primary/5 to-transparent pointer-events-none"},null,-1)),e("div",Q,[t[7]||(t[7]=j('
MeshCore

pyMC Repeater

Sign in to access your dashboard

',1)),e("form",{onSubmit:_(m,["prevent"]),class:"space-y-4 sm:space-y-5"},[e("div",W,[t[3]||(t[3]=e("label",{for:"username",class:"block text-content-secondary dark:text-content-primary/90 text-xs sm:text-sm font-medium mb-2"}," Username ",-1)),e("div",X,[v(e("input",{id:"username","onUpdate:modelValue":t[0]||(t[0]=r=>p.value=r),type:"text",autocomplete:"username",required:"",class:"input-glass w-full px-3 sm:px-4 py-2.5 sm:py-3.5 rounded-[12px] text-content-primary dark:text-content-primary text-sm placeholder-gray-400 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 transition-all duration-300",placeholder:"Enter username",disabled:s.value},null,8,Z),[[h,p.value]]),t[2]||(t[2]=e("div",{class:"absolute inset-0 rounded-[12px] pointer-events-none input-glow"},null,-1))])]),e("div",ee,[t[5]||(t[5]=e("label",{for:"password",class:"block text-content-secondary dark:text-content-primary/90 text-xs sm:text-sm font-medium mb-2"}," Password ",-1)),e("div",te,[v(e("input",{id:"password","onUpdate:modelValue":t[1]||(t[1]=r=>l.value=r),type:"password",autocomplete:"current-password",required:"",class:"input-glass w-full px-3 sm:px-4 py-2.5 sm:py-3.5 rounded-[12px] text-content-primary dark:text-content-primary text-sm placeholder-gray-400 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 transition-all duration-300",placeholder:"Enter password",disabled:s.value},null,8,re),[[h,l.value]]),t[4]||(t[4]=e("div",{class:"absolute inset-0 rounded-[12px] pointer-events-none input-glow"},null,-1))])]),d.value?(u(),i("div",se,[e("p",oe,y(d.value),1)])):g("",!0),e("button",{type:"submit",disabled:s.value,class:"button-glass w-full relative overflow-hidden bg-primary/20 hover:bg-primary/30 active:scale-[0.98] text-primary dark:text-white font-semibold py-3 sm:py-4 px-4 rounded-[12px] border border-primary/50 hover:border-primary/60 transition-all duration-300 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2 sm:gap-2.5 group mt-6 sm:mt-8 text-sm sm:text-base backdrop-blur-sm"},[s.value?(u(),i("div",ne)):(u(),i("svg",le,t[6]||(t[6]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"},null,-1)]))),e("span",de,y(s.value?"Signing in...":"Sign In"),1)],8,ae)],32),e("div",ie,[e("div",ue,[e("a",pe,[w(N,{class:"w-5 h-5 sm:w-6 sm:h-6 text-white group-hover:text-primary transition-colors"})]),e("a",ce,[w(B,{class:"w-5 h-5 sm:w-6 sm:h-6 text-white group-hover:text-yellow-500 transition-colors"})])])])])]),w(A,{"is-open":o.value,"can-skip":!0,onClose:k,onSuccess:f},null,8,["is-open"])]))}}),ge=L(me,[["__scopeId","data-v-7d3a3377"]]);export{ge as default}; diff --git a/repeater/web/html/assets/Logs-Deot7VVG.js b/repeater/web/html/assets/Logs-Deot7VVG.js new file mode 100644 index 0000000..3ce0f25 --- /dev/null +++ b/repeater/web/html/assets/Logs-Deot7VVG.js @@ -0,0 +1 @@ +import{E as e,S as t,dt as n,f as r,g as i,l as a,lt as o,o as s,p as c,r as l,s as u,u as d,w as f,x as p,z as m}from"./runtime-core.esm-bundler-IofF4kUm.js";import{t as h}from"./api-CrUX-ZnK.js";var g={class:`space-y-6`},_={class:`glass-card backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6`},v={class:`flex items-center justify-between mb-4`},y=[`disabled`],b={class:`bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4`},x={class:`flex flex-wrap gap-2`},S=[`onClick`],C={key:0,class:`w-px h-6 bg-stroke-subtle dark:bg-stroke/20 mx-2 self-center`},w=[`onClick`],T={class:`glass-card backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[15px] overflow-hidden`},E={key:0,class:`p-8 text-center`},D={key:1,class:`p-8 text-center`},O={class:`text-content-secondary dark:text-content-muted mb-4`},k={key:2,class:`max-h-[600px] overflow-y-auto`},A={key:0,class:`p-8 text-center`},j={key:1,class:`divide-y divide-gray-200 dark:divide-white/5`},M={class:`flex-shrink-0 text-content-secondary dark:text-content-muted`},N={class:`flex-shrink-0 px-2 py-1 text-xs font-medium rounded bg-blue-500/20 text-blue-600 dark:text-blue-400`},P={class:`text-content-primary dark:text-content-primary flex-1 break-all`},F=i({name:`LogsView`,__name:`Logs`,setup(i){let F=m([]),I=m(new Set),L=m(new Set([`DEBUG`,`INFO`,`WARNING`,`ERROR`])),R=m(new Set),z=m(new Set),B=m(!0),V=m(null),H=null,U=e=>{let t=e.match(/- ([^-]+) - (?:DEBUG|INFO|WARNING|ERROR) -/);return t?t[1].trim():`Unknown`},ee=e=>{let t=e.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} - [^-]+ - (?:DEBUG|INFO|WARNING|ERROR) - (.+)$/);return t?t[1]:e},W=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0},G=async()=>{try{let e=await h.getLogs();if(e.logs&&e.logs.length>0){F.value=e.logs;let t=new Set;F.value.forEach(e=>{let n=U(e.message);t.add(n)});let n=new Set;F.value.forEach(e=>{n.add(e.level)}),I.value.size===0&&(I.value=new Set(t));let r=!W(R.value,t),i=!W(z.value,n);r&&(R.value=t),i&&(z.value=n),V.value=null}}catch(e){console.error(`Error loading logs:`,e),V.value=e instanceof Error?e.message:`Failed to load logs`}finally{B.value=!1}},K=s(()=>F.value.filter(e=>{let t=U(e.message),n=I.value.has(t),r=L.value.has(e.level);return n&&r})),q=s(()=>Array.from(R.value).sort()),J=s(()=>{let e=[`ERROR`,`WARNING`,`WARN`,`INFO`,`DEBUG`];return Array.from(z.value).sort((t,n)=>{let r=e.indexOf(t),i=e.indexOf(n);return r!==-1&&i!==-1?r-i:t.localeCompare(n)})}),Y=e=>{L.value.has(e)?L.value.delete(e):L.value.add(e),L.value=new Set(L.value)},X=e=>new Date(e).toLocaleTimeString(`en-US`,{hour12:!1,hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),Z=e=>({ERROR:`text-red-600 dark:text-red-400 bg-red-900/20`,WARNING:`text-yellow-600 dark:text-yellow-400 bg-yellow-900/20`,WARN:`text-yellow-600 dark:text-yellow-400 bg-yellow-900/20`,INFO:`text-blue-600 dark:text-blue-400 bg-blue-900/20`,DEBUG:`text-gray-400 bg-gray-900/20`})[e]||`text-gray-400 bg-gray-900/20`,Q=(e,t)=>t?{ERROR:`bg-red-100 dark:bg-red-500/20 text-red-600 dark:text-red-400 border-red-500/50`,WARNING:`bg-yellow-100 dark:bg-yellow-500/20 text-yellow-600 dark:text-yellow-400 border-yellow-500/50`,WARN:`bg-yellow-100 dark:bg-yellow-500/20 text-yellow-600 dark:text-yellow-400 border-yellow-500/50`,INFO:`bg-blue-500/20 text-blue-600 dark:text-blue-400 border-blue-500/50`,DEBUG:`bg-gray-500/20 text-gray-400 border-gray-500/50`}[e]||`bg-primary/20 text-primary border-primary/50`:`bg-background-mute dark:bg-white/5 text-content-muted dark:text-white/60 border-stroke-subtle dark:border-white/20 hover:bg-stroke-subtle dark:hover:bg-white/10`,$=e=>{I.value.has(e)?I.value.delete(e):I.value.add(e),I.value=new Set(I.value)},te=()=>{I.value=new Set(R.value)},ne=()=>{I.value=new Set},re=()=>{L.value=new Set(z.value)},ie=()=>{L.value=new Set},ae=()=>{H&&clearInterval(H),H=setInterval(G,5e3)},oe=()=>{H&&=(clearInterval(H),null)};return t(()=>{G(),ae()}),p(()=>{oe()}),(t,i)=>(f(),d(`div`,g,[u(`div`,_,[u(`div`,v,[i[1]||=u(`div`,null,[u(`h1`,{class:`text-content-primary dark:text-content-primary text-2xl font-semibold mb-2`},` System Logs `),u(`p`,{class:`text-content-secondary dark:text-content-muted`},` Real-time system events and diagnostics `)],-1),u(`button`,{onClick:G,disabled:B.value,class:`flex items-center gap-2 px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors disabled:opacity-50`},[(f(),d(`svg`,{class:o([`w-4 h-4`,{"animate-spin":B.value}]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...i[0]||=[u(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15`},null,-1)]],2)),c(` `+n(B.value?`Loading...`:`Refresh`),1)],8,y)]),u(`div`,b,[u(`div`,{class:`flex flex-wrap items-center gap-3 mb-4`},[i[2]||=u(`span`,{class:`text-content-primary dark:text-content-primary font-medium`},`Filters:`,-1),u(`button`,{onClick:te,class:`px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors`},` All Loggers `),u(`button`,{onClick:ne,class:`px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors`},` Clear Loggers `),i[3]||=u(`div`,{class:`w-px h-4 bg-white/20 mx-1`},null,-1),u(`button`,{onClick:re,class:`px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors`},` All Levels `),u(`button`,{onClick:ie,class:`px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors`},` Clear Levels `)]),u(`div`,x,[(f(!0),d(l,null,e(q.value,e=>(f(),d(`button`,{key:`logger-`+e,onClick:t=>$(e),class:o([`px-3 py-1 text-xs border rounded-full transition-colors`,I.value.has(e)?`bg-primary/20 text-primary border-primary/50`:`bg-background-mute dark:bg-white/5 text-content-secondary dark:text-content-muted border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-white/10`])},n(e),11,S))),128)),q.value.length>0&&J.value.length>0?(f(),d(`div`,C)):a(``,!0),(f(!0),d(l,null,e(J.value,e=>(f(),d(`button`,{key:`level-`+e,onClick:t=>Y(e),class:o([`px-3 py-1 text-xs border rounded-full transition-colors font-medium`,L.value.has(e)?Q(e,!0):Q(e,!1)])},n(e),11,w))),128))])])]),u(`div`,T,[B.value&&F.value.length===0?(f(),d(`div`,E,[...i[4]||=[u(`div`,{class:`animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4`},null,-1),u(`p`,{class:`text-content-secondary dark:text-content-muted`},`Loading system logs...`,-1)]])):V.value?(f(),d(`div`,D,[i[5]||=u(`div`,{class:`text-red-600 dark:text-red-400 mb-4`},[u(`svg`,{class:`w-12 h-12 mx-auto mb-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[u(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})])],-1),i[6]||=u(`h3`,{class:`text-content-primary dark:text-content-primary text-lg font-medium mb-2`},` Error Loading Logs `,-1),u(`p`,O,n(V.value),1),u(`button`,{onClick:G,class:`px-4 py-2 bg-red-100 dark:bg-red-500/20 hover:bg-red-500/30 text-red-600 dark:text-red-400 border border-red-500/50 rounded-lg transition-colors`},` Try Again `)])):(f(),d(`div`,k,[K.value.length===0?(f(),d(`div`,A,[...i[7]||=[r(`

No Logs to Display

No logs match the current filter criteria.

`,3)]])):(f(),d(`div`,j,[(f(!0),d(l,null,e(K.value,(e,t)=>(f(),d(`div`,{key:t,class:`flex items-start gap-4 p-4 hover:bg-background-mute dark:hover:bg-stroke/5 transition-colors font-mono text-sm`},[u(`span`,M,` [`+n(X(e.timestamp))+`] `,1),u(`span`,N,n(U(e.message)),1),u(`span`,{class:o([`flex-shrink-0 px-2 py-1 text-xs font-medium rounded`,Z(e.level)])},n(e.level),3),u(`span`,P,n(ee(e.message)),1)]))),128))]))]))])]))}});export{F as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/Logs-FrDrsrTw.js b/repeater/web/html/assets/Logs-FrDrsrTw.js deleted file mode 100644 index 03edd8d..0000000 --- a/repeater/web/html/assets/Logs-FrDrsrTw.js +++ /dev/null @@ -1 +0,0 @@ -import{a as j,r as i,c as w,o as T,b as H,e as s,f as o,l as $,k as h,t as c,h as q,F as L,i as N,j as J,L as K,q as n}from"./index-xzvnOpJo.js";const P={class:"space-y-6"},Q={class:"glass-card backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6"},X={class:"flex items-center justify-between mb-4"},Y=["disabled"],Z={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4"},ee={class:"flex flex-wrap gap-2"},te=["onClick"],re={key:0,class:"w-px h-6 bg-stroke-subtle dark:bg-stroke/20 mx-2 self-center"},oe=["onClick"],se={class:"glass-card backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[15px] overflow-hidden"},ne={key:0,class:"p-8 text-center"},ae={key:1,class:"p-8 text-center"},le={class:"text-content-secondary dark:text-content-muted mb-4"},de={key:2,class:"max-h-[600px] overflow-y-auto"},ce={key:0,class:"p-8 text-center"},ie={key:1,class:"divide-y divide-gray-200 dark:divide-white/5"},ue={class:"flex-shrink-0 text-content-secondary dark:text-content-muted"},ge={class:"flex-shrink-0 px-2 py-1 text-xs font-medium rounded bg-blue-500/20 text-blue-600 dark:text-blue-400"},be={class:"text-content-primary dark:text-content-primary flex-1 break-all"},ve=j({name:"LogsView",__name:"Logs",setup(xe){const x=i([]),a=i(new Set),d=i(new Set(["DEBUG","INFO","WARNING","ERROR"])),v=i(new Set),p=i(new Set),m=i(!0),k=i(null);let u=null;const f=t=>{const e=t.match(/- ([^-]+) - (?:DEBUG|INFO|WARNING|ERROR) -/);return e?e[1].trim():"Unknown"},S=t=>{const e=t.match(/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3} - [^-]+ - (?:DEBUG|INFO|WARNING|ERROR) - (.+)$/);return e?e[1]:t},R=(t,e)=>{if(t.size!==e.size)return!1;for(const r of t)if(!e.has(r))return!1;return!0},y=async()=>{try{const t=await K.getLogs();if(t.logs&&t.logs.length>0){x.value=t.logs;const e=new Set;x.value.forEach(b=>{const z=f(b.message);e.add(z)});const r=new Set;x.value.forEach(b=>{r.add(b.level)}),a.value.size===0&&(a.value=new Set(e));const l=!R(v.value,e),g=!R(p.value,r);l&&(v.value=e),g&&(p.value=r),k.value=null}}catch(t){console.error("Error loading logs:",t),k.value=t instanceof Error?t.message:"Failed to load logs"}finally{m.value=!1}},_=w(()=>x.value.filter(e=>{const r=f(e.message),l=a.value.has(r),g=d.value.has(e.level);return l&&g})),C=w(()=>Array.from(v.value).sort()),A=w(()=>{const t=["ERROR","WARNING","WARN","INFO","DEBUG"];return Array.from(p.value).sort((r,l)=>{const g=t.indexOf(r),b=t.indexOf(l);return g!==-1&&b!==-1?g-b:r.localeCompare(l)})}),I=t=>{d.value.has(t)?d.value.delete(t):d.value.add(t),d.value=new Set(d.value)},O=t=>new Date(t).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"}),B=t=>({ERROR:"text-red-600 dark:text-red-400 bg-red-900/20",WARNING:"text-yellow-600 dark:text-yellow-400 bg-yellow-900/20",WARN:"text-yellow-600 dark:text-yellow-400 bg-yellow-900/20",INFO:"text-blue-600 dark:text-blue-400 bg-blue-900/20",DEBUG:"text-gray-400 bg-gray-900/20"})[t]||"text-gray-400 bg-gray-900/20",E=(t,e)=>e?{ERROR:"bg-red-100 dark:bg-red-500/20 text-red-600 dark:text-red-400 border-red-500/50",WARNING:"bg-yellow-100 dark:bg-yellow-500/20 text-yellow-600 dark:text-yellow-400 border-yellow-500/50",WARN:"bg-yellow-100 dark:bg-yellow-500/20 text-yellow-600 dark:text-yellow-400 border-yellow-500/50",INFO:"bg-blue-500/20 text-blue-600 dark:text-blue-400 border-blue-500/50",DEBUG:"bg-gray-500/20 text-gray-400 border-gray-500/50"}[t]||"bg-primary/20 text-primary border-primary/50":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-white/60 border-stroke-subtle dark:border-white/20 hover:bg-stroke-subtle dark:hover:bg-white/10",G=t=>{a.value.has(t)?a.value.delete(t):a.value.add(t),a.value=new Set(a.value)},F=()=>{a.value=new Set(v.value)},M=()=>{a.value=new Set},D=()=>{d.value=new Set(p.value)},U=()=>{d.value=new Set},W=()=>{u&&clearInterval(u),u=setInterval(y,5e3)},V=()=>{u&&(clearInterval(u),u=null)};return T(()=>{y(),W()}),H(()=>{V()}),(t,e)=>(n(),s("div",P,[o("div",Q,[o("div",X,[e[1]||(e[1]=o("div",null,[o("h1",{class:"text-content-primary dark:text-content-primary text-2xl font-semibold mb-2"},"System Logs"),o("p",{class:"text-content-secondary dark:text-content-muted"},"Real-time system events and diagnostics")],-1)),o("button",{onClick:y,disabled:m.value,class:"flex items-center gap-2 px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors disabled:opacity-50"},[(n(),s("svg",{class:h(["w-4 h-4",{"animate-spin":m.value}]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e[0]||(e[0]=[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"},null,-1)]),2)),$(" "+c(m.value?"Loading...":"Refresh"),1)],8,Y)]),o("div",Z,[o("div",{class:"flex flex-wrap items-center gap-3 mb-4"},[e[2]||(e[2]=o("span",{class:"text-content-primary dark:text-content-primary font-medium"},"Filters:",-1)),o("button",{onClick:F,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Loggers "),o("button",{onClick:M,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Loggers "),e[3]||(e[3]=o("div",{class:"w-px h-4 bg-white/20 mx-1"},null,-1)),o("button",{onClick:D,class:"px-3 py-1 text-xs bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/50 rounded transition-colors"}," All Levels "),o("button",{onClick:U,class:"px-3 py-1 text-xs bg-accent-red/20 hover:bg-accent-red/30 text-accent-red border border-accent-red/50 rounded transition-colors"}," Clear Levels ")]),o("div",ee,[(n(!0),s(L,null,N(C.value,r=>(n(),s("button",{key:"logger-"+r,onClick:l=>G(r),class:h(["px-3 py-1 text-xs border rounded-full transition-colors",a.value.has(r)?"bg-primary/20 text-primary border-primary/50":"bg-background-mute dark:bg-white/5 text-content-secondary dark:text-content-muted border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-white/10"])},c(r),11,te))),128)),C.value.length>0&&A.value.length>0?(n(),s("div",re)):q("",!0),(n(!0),s(L,null,N(A.value,r=>(n(),s("button",{key:"level-"+r,onClick:l=>I(r),class:h(["px-3 py-1 text-xs border rounded-full transition-colors font-medium",d.value.has(r)?E(r,!0):E(r,!1)])},c(r),11,oe))),128))])])]),o("div",se,[m.value&&x.value.length===0?(n(),s("div",ne,e[4]||(e[4]=[o("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary mx-auto mb-4"},null,-1),o("p",{class:"text-content-secondary dark:text-content-muted"},"Loading system logs...",-1)]))):k.value?(n(),s("div",ae,[e[5]||(e[5]=o("div",{class:"text-red-600 dark:text-red-400 mb-4"},[o("svg",{class:"w-12 h-12 mx-auto mb-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),e[6]||(e[6]=o("h3",{class:"text-content-primary dark:text-content-primary text-lg font-medium mb-2"},"Error Loading Logs",-1)),o("p",le,c(k.value),1),o("button",{onClick:y,class:"px-4 py-2 bg-red-100 dark:bg-red-500/20 hover:bg-red-500/30 text-red-600 dark:text-red-400 border border-red-500/50 rounded-lg transition-colors"}," Try Again ")])):(n(),s("div",de,[_.value.length===0?(n(),s("div",ce,e[7]||(e[7]=[J('

No Logs to Display

No logs match the current filter criteria.

',3)]))):(n(),s("div",ie,[(n(!0),s(L,null,N(_.value,(r,l)=>(n(),s("div",{key:l,class:"flex items-start gap-4 p-4 hover:bg-background-mute dark:hover:bg-stroke/5 transition-colors font-mono text-sm"},[o("span",ue," ["+c(O(r.timestamp))+"] ",1),o("span",ge,c(f(r.message)),1),o("span",{class:h(["flex-shrink-0 px-2 py-1 text-xs font-medium rounded",B(r.level)])},c(r.level),3),o("span",be,c(S(r.message)),1)]))),128))]))]))])]))}});export{ve as default}; diff --git a/repeater/web/html/assets/MessageDialog-CSjABYko.js b/repeater/web/html/assets/MessageDialog-CSjABYko.js new file mode 100644 index 0000000..2652d07 --- /dev/null +++ b/repeater/web/html/assets/MessageDialog-CSjABYko.js @@ -0,0 +1 @@ +import{dt as e,g as t,l as n,lt as r,s as i,u as a,w as o}from"./runtime-core.esm-bundler-IofF4kUm.js";import{m as s}from"./index-CPWfwDmA.js";var c={class:`mb-6`},l={key:0,class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},u={key:1,class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},d={key:2,class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},f={class:`text-content-secondary dark:text-content-primary/80 text-base leading-relaxed`},p={class:`flex`},m=t({__name:`MessageDialog`,props:{show:{type:Boolean},message:{},variant:{default:`success`}},emits:[`close`],setup(t,{emit:m}){let h=t,g=m,_=e=>{e.target===e.currentTarget&&g(`close`)},v={success:`bg-green-100 dark:bg-green-500/20 border-green-600/40 dark:border-green-500/30 text-green-600 dark:text-green-400`,error:`bg-red-100 dark:bg-red-500/20 border-red-500/30 text-red-600 dark:text-red-400`,info:`bg-blue-500/20 border-blue-500/30 text-blue-600 dark:text-blue-400`},y={success:`bg-green-500 hover:bg-green-600`,error:`bg-red-500 hover:bg-red-600`,info:`bg-blue-500 hover:bg-blue-600`};return(t,m)=>h.show?(o(),a(`div`,{key:0,onClick:_,class:`fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4`,style:{"backdrop-filter":`blur(8px) saturate(180%)`,position:`fixed`,top:`0`,left:`0`,right:`0`,bottom:`0`}},[i(`div`,{class:`bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10`,onClick:m[1]||=s(()=>{},[`stop`])},[i(`div`,c,[i(`div`,{class:r([`inline-flex p-3 rounded-xl mb-4`,v[h.variant]])},[h.variant===`success`?(o(),a(`svg`,l,[...m[2]||=[i(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 13l4 4L19 7`},null,-1)]])):h.variant===`error`?(o(),a(`svg`,u,[...m[3]||=[i(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`},null,-1)]])):(o(),a(`svg`,d,[...m[4]||=[i(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`},null,-1)]]))],2),i(`p`,f,e(h.message),1)]),i(`div`,p,[i(`button`,{onClick:m[0]||=e=>g(`close`),class:r([`flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200`,y[h.variant]])},` OK `,2)])])])):n(``,!0)}});export{m as t}; \ No newline at end of file diff --git a/repeater/web/html/assets/MessageDialog.vue_vue_type_script_setup_true_lang-SzTqrYUh.js b/repeater/web/html/assets/MessageDialog.vue_vue_type_script_setup_true_lang-SzTqrYUh.js deleted file mode 100644 index 222fcc8..0000000 --- a/repeater/web/html/assets/MessageDialog.vue_vue_type_script_setup_true_lang-SzTqrYUh.js +++ /dev/null @@ -1 +0,0 @@ -import{a as k,e as o,h as g,f as r,k as a,t as p,x,q as s}from"./index-xzvnOpJo.js";const f={class:"mb-6"},m={key:0,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},v={key:1,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},h={key:2,class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},w={class:"text-content-secondary dark:text-content-primary/80 text-base leading-relaxed"},C={class:"flex"},B=k({__name:"MessageDialog",props:{show:{type:Boolean},message:{},variant:{default:"success"}},emits:["close"],setup(i,{emit:d}){const t=i,l=d,c=n=>{n.target===n.currentTarget&&l("close")},u={success:"bg-green-100 dark:bg-green-500/20 border-green-600/40 dark:border-green-500/30 text-green-600 dark:text-green-400",error:"bg-red-100 dark:bg-red-500/20 border-red-500/30 text-red-600 dark:text-red-400",info:"bg-blue-500/20 border-blue-500/30 text-blue-600 dark:text-blue-400"},b={success:"bg-green-500 hover:bg-green-600",error:"bg-red-500 hover:bg-red-600",info:"bg-blue-500 hover:bg-blue-600"};return(n,e)=>t.show?(s(),o("div",{key:0,onClick:c,class:"fixed inset-0 bg-black/40 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[r("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:e[1]||(e[1]=x(()=>{},["stop"]))},[r("div",f,[r("div",{class:a(["inline-flex p-3 rounded-xl mb-4",u[t.variant]])},[t.variant==="success"?(s(),o("svg",m,e[2]||(e[2]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"},null,-1)]))):t.variant==="error"?(s(),o("svg",v,e[3]||(e[3]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(s(),o("svg",h,e[4]||(e[4]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2),r("p",w,p(t.message),1)]),r("div",C,[r("button",{onClick:e[0]||(e[0]=y=>l("close")),class:a(["flex-1 px-4 py-3 rounded-xl text-white transition-all duration-200",b[t.variant]])}," OK ",2)])])])):g("",!0)}});export{B as _}; diff --git a/repeater/web/html/assets/Neighbors-CeQMbE6r.css b/repeater/web/html/assets/Neighbors-CeQMbE6r.css deleted file mode 100644 index bc45d2c..0000000 --- a/repeater/web/html/assets/Neighbors-CeQMbE6r.css +++ /dev/null @@ -1 +0,0 @@ -.modal-enter-active[data-v-c4eb8a10],.modal-leave-active[data-v-c4eb8a10]{transition:opacity .2s ease}.modal-enter-from[data-v-c4eb8a10],.modal-leave-to[data-v-c4eb8a10]{opacity:0}.modal-enter-active>div[data-v-c4eb8a10],.modal-leave-active>div[data-v-c4eb8a10]{transition:transform .2s ease}.modal-enter-from>div[data-v-c4eb8a10],.modal-leave-to>div[data-v-c4eb8a10]{transform:scale(.95)}.packet-enter-active[data-v-c4eb8a10],.packet-leave-active[data-v-c4eb8a10]{transition:all .15s ease}.packet-enter-from[data-v-c4eb8a10],.packet-leave-to[data-v-c4eb8a10]{opacity:0;transform:translate(-50%) scale(.5)}.custom-scrollbar[data-v-5669a05a]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-5669a05a]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar[data-v-5669a05a]::-webkit-scrollbar-thumb{background:#0003;border-radius:4px}.dark .custom-scrollbar[data-v-5669a05a]::-webkit-scrollbar-thumb{background:#fff3}.custom-scrollbar[data-v-5669a05a]::-webkit-scrollbar-thumb:hover{background:#0000004d}.dark .custom-scrollbar[data-v-5669a05a]::-webkit-scrollbar-thumb:hover{background:#ffffff4d}.modal-enter-active[data-v-5669a05a],.modal-leave-active[data-v-5669a05a]{transition:opacity .3s ease}.modal-enter-active>div[data-v-5669a05a],.modal-leave-active>div[data-v-5669a05a]{transition:transform .3s ease,opacity .3s ease}.modal-enter-from[data-v-5669a05a],.modal-leave-to[data-v-5669a05a]{opacity:0}.modal-enter-from>div[data-v-5669a05a],.modal-leave-to>div[data-v-5669a05a]{transform:scale(.95);opacity:0}.leaflet-container{background:transparent}.custom-marker{background:transparent!important;border:none!important}.map-container[data-v-a6a23e33]{position:relative;background:transparent;border-radius:15px;overflow:hidden}.leaflet-map-container[data-v-a6a23e33]{background:linear-gradient(135deg,#09090bcc,#0009);-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}.map-legend[data-v-a6a23e33]{position:absolute;top:10px;right:10px;background:#0006;border:1px solid rgba(255,255,255,.1);border-radius:15px;padding:12px;font-size:12px;color:#fff;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);z-index:1000;min-width:150px;max-width:180px;box-shadow:0 8px 32px #0000004d}.legend-title[data-v-a6a23e33]{font-weight:700;margin-bottom:10px;color:#fff;font-size:13px}.legend-section[data-v-a6a23e33]{margin-bottom:10px}.legend-section[data-v-a6a23e33]:last-of-type{margin-bottom:8px}.legend-subtitle[data-v-a6a23e33]{font-weight:600;margin-bottom:6px;color:#fffc;font-size:11px;text-transform:uppercase;letter-spacing:.5px}.legend-footer[data-v-a6a23e33]{margin-top:10px;padding-top:8px;border-top:1px solid rgba(255,255,255,.1);color:#fff9;font-size:10px;text-align:center}.legend-items[data-v-a6a23e33]{display:flex;flex-direction:column;gap:4px}.legend-item[data-v-a6a23e33]{display:flex;align-items:center;gap:6px}.legend-icon[data-v-a6a23e33]{width:8px;height:8px;border-radius:50%;border:1px solid rgba(255,255,255,.8);box-shadow:0 1px 2px #0003;flex-shrink:0}.legend-icon.cluster-icon[data-v-a6a23e33]{width:16px;height:16px;border-radius:50%;border:1px solid #AAE8E8;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.legend-line[data-v-a6a23e33]{width:16px;height:2px;border-radius:1px;flex-shrink:0;position:relative}.legend-line-dashed[data-v-a6a23e33]{background-image:repeating-linear-gradient(90deg,currentColor 0px,currentColor 4px,transparent 4px,transparent 8px)!important;background-color:transparent!important}.legend-line-dashed[style*="#FFC246"][data-v-a6a23e33]{color:#ffc246!important}.legend-line-dashed[style*="#ea580c"][data-v-a6a23e33]{color:#ea580c!important}.marker-highlight{position:relative!important;z-index:1000!important;animation:marker-glow-a6a23e33 1s ease-in-out infinite!important;border-radius:50%!important;box-shadow:0 0 0 3px #a5e5b6,0 0 8px #a5e5b6,0 0 16px #a5e5b6!important;transform:scale(1.2)!important}@keyframes marker-glow-a6a23e33{0%,to{box-shadow:0 0 0 3px #a5e5b6,0 0 8px #a5e5b6,0 0 16px #a5e5b6;filter:brightness(1)}50%{box-shadow:0 0 0 5px #a5e5b6,0 0 12px #a5e5b6,0 0 24px #a5e5b6;filter:brightness(1.3)}}@keyframes pulse-highlight-a6a23e33{0%{box-shadow:0 0 #3b82f6b3}70%{box-shadow:0 0 0 8px #3b82f600}to{box-shadow:0 0 #3b82f600}}.leaflet-popup-content-wrapper{background:#0006!important;color:#fff!important;border-radius:15px!important;box-shadow:0 8px 32px #0000004d!important;border:1px solid rgba(255,255,255,.1)!important;-webkit-backdrop-filter:blur(20px)!important;backdrop-filter:blur(20px)!important}.leaflet-popup-tip{background:#0006!important;border:1px solid rgba(255,255,255,.1)!important}.leaflet-popup-close-button{color:#fff9!important;font-size:18px!important}.leaflet-popup-close-button:hover{color:#fff!important}.custom-div-icon,.custom-cluster-icon{background:transparent!important;border:none!important}.custom-cluster-icon div{transition:all .3s ease!important;cursor:pointer!important}.custom-cluster-icon:hover div{transform:scale(1.1)!important;box-shadow:0 6px 16px #aae8e880!important}.leaflet-control-zoom{border:1px solid rgba(255,255,255,.1)!important;border-radius:15px!important;overflow:hidden;-webkit-backdrop-filter:blur(20px)!important;backdrop-filter:blur(20px)!important}.leaflet-control-zoom a{background-color:#0006!important;color:#fff!important;border-bottom:1px solid rgba(255,255,255,.1)!important;transition:all .2s ease!important}.leaflet-control-zoom a:hover{background-color:#ffffff1a!important;color:#fff!important}.leaflet-control-attribution{background-color:#1f2937cc!important;color:#9ca3af!important;border-top:1px solid rgba(75,85,99,.3)!important;border-radius:4px!important;padding:4px 8px!important;font-size:11px!important}.leaflet-control-attribution a{color:#60a5fa!important;text-decoration:none}.leaflet-control-attribution a:hover{color:#93c5fd!important;text-decoration:underline}.leaflet-bottom.leaflet-left .leaflet-control-attribution{margin-left:10px!important;margin-bottom:10px!important}.map-attribution[data-v-a6a23e33]{position:absolute;bottom:10px;left:10px;background:#0006;color:#fff9;border:1px solid rgba(255,255,255,.1);border-radius:15px;padding:4px 8px;font-size:10px;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);z-index:1000}@media (max-width: 640px){.leaflet-control-attribution{display:none!important}} diff --git a/repeater/web/html/assets/Neighbors-Cfo189NY.css b/repeater/web/html/assets/Neighbors-Cfo189NY.css new file mode 100644 index 0000000..e379b7d --- /dev/null +++ b/repeater/web/html/assets/Neighbors-Cfo189NY.css @@ -0,0 +1 @@ +.modal-enter-active[data-v-dacea749],.modal-leave-active[data-v-dacea749]{transition:opacity .2s}.modal-enter-from[data-v-dacea749],.modal-leave-to[data-v-dacea749]{opacity:0}.modal-enter-active>div[data-v-dacea749],.modal-leave-active>div[data-v-dacea749]{transition:transform .2s}.modal-enter-from>div[data-v-dacea749],.modal-leave-to>div[data-v-dacea749]{transform:scale(.95)}.packet-enter-active[data-v-dacea749],.packet-leave-active[data-v-dacea749]{transition:all .15s}.packet-enter-from[data-v-dacea749],.packet-leave-to[data-v-dacea749]{opacity:0;transform:translate(-50%)scale(.5)}.custom-scrollbar[data-v-2fb1fa15]::-webkit-scrollbar{width:8px}.custom-scrollbar[data-v-2fb1fa15]::-webkit-scrollbar-track{background:0 0}.custom-scrollbar[data-v-2fb1fa15]::-webkit-scrollbar-thumb{background:#0003;border-radius:4px}.dark .custom-scrollbar[data-v-2fb1fa15]::-webkit-scrollbar-thumb{background:#fff3}.custom-scrollbar[data-v-2fb1fa15]::-webkit-scrollbar-thumb:hover{background:#0000004d}.dark .custom-scrollbar[data-v-2fb1fa15]::-webkit-scrollbar-thumb:hover{background:#ffffff4d}.modal-enter-active[data-v-2fb1fa15],.modal-leave-active[data-v-2fb1fa15]{transition:opacity .3s}.modal-enter-active>div[data-v-2fb1fa15],.modal-leave-active>div[data-v-2fb1fa15]{transition:transform .3s,opacity .3s}.modal-enter-from[data-v-2fb1fa15],.modal-leave-to[data-v-2fb1fa15]{opacity:0}.modal-enter-from>div[data-v-2fb1fa15],.modal-leave-to>div[data-v-2fb1fa15]{opacity:0;transform:scale(.95)}.leaflet-container{background:0 0}.custom-marker{background:0 0!important;border:none!important}.map-container[data-v-61a18eed]{background:0 0;border-radius:15px;position:relative;overflow:hidden}.leaflet-map-container[data-v-61a18eed]{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);background:linear-gradient(135deg,#09090bcc 0%,#0009 100%)}.map-legend[data-v-61a18eed]{color:#fff;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);z-index:1000;background:#0006;border:1px solid #ffffff1a;border-radius:15px;min-width:150px;max-width:180px;padding:12px;font-size:12px;position:absolute;top:10px;right:10px;box-shadow:0 8px 32px #0000004d}.legend-title[data-v-61a18eed]{color:#fff;margin-bottom:10px;font-size:13px;font-weight:700}.legend-section[data-v-61a18eed]{margin-bottom:10px}.legend-section[data-v-61a18eed]:last-of-type{margin-bottom:8px}.legend-subtitle[data-v-61a18eed]{color:#fffc;text-transform:uppercase;letter-spacing:.5px;margin-bottom:6px;font-size:11px;font-weight:600}.legend-footer[data-v-61a18eed]{color:#fff9;text-align:center;border-top:1px solid #ffffff1a;margin-top:10px;padding-top:8px;font-size:10px}.legend-items[data-v-61a18eed]{flex-direction:column;gap:4px;display:flex}.legend-item[data-v-61a18eed]{align-items:center;gap:6px;display:flex}.legend-icon[data-v-61a18eed]{border:1px solid #fffc;border-radius:50%;flex-shrink:0;width:8px;height:8px;box-shadow:0 1px 2px #0003}.legend-icon.cluster-icon[data-v-61a18eed]{-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);border:1px solid #aae8e8;border-radius:50%;width:16px;height:16px}.legend-line[data-v-61a18eed]{border-radius:1px;flex-shrink:0;width:16px;height:2px;position:relative}.legend-line-dashed[data-v-61a18eed]{background-color:#0000!important;background-image:repeating-linear-gradient(90deg,currentColor 0 4px,#0000 4px 8px)!important}.legend-line-dashed[style*=\#FFC246][data-v-61a18eed]{color:#ffc246!important}.legend-line-dashed[style*=\#ea580c][data-v-61a18eed]{color:#ea580c!important}.marker-highlight{z-index:1000!important;border-radius:50%!important;animation:1s ease-in-out infinite marker-glow-61a18eed!important;position:relative!important;transform:scale(1.2)!important;box-shadow:0 0 0 3px #a5e5b6,0 0 8px #a5e5b6,0 0 16px #a5e5b6!important}@keyframes marker-glow-61a18eed{0%,to{filter:brightness();box-shadow:0 0 0 3px #a5e5b6,0 0 8px #a5e5b6,0 0 16px #a5e5b6}50%{filter:brightness(1.3);box-shadow:0 0 0 5px #a5e5b6,0 0 12px #a5e5b6,0 0 24px #a5e5b6}}@keyframes pulse-highlight-61a18eed{0%{box-shadow:0 0 #3b82f6b3}70%{box-shadow:0 0 0 8px #3b82f600}to{box-shadow:0 0 #3b82f600}}.leaflet-popup-content-wrapper{color:#fff!important;-webkit-backdrop-filter:blur(20px)!important;backdrop-filter:blur(20px)!important;background:#0006!important;border:1px solid #ffffff1a!important;border-radius:15px!important;box-shadow:0 8px 32px #0000004d!important}.leaflet-popup-tip{background:#0006!important;border:1px solid #ffffff1a!important}.leaflet-popup-close-button{color:#fff9!important;font-size:18px!important}.leaflet-popup-close-button:hover{color:#fff!important}.custom-div-icon,.custom-cluster-icon{background:0 0!important;border:none!important}.custom-cluster-icon div{cursor:pointer!important;transition:all .3s!important}.custom-cluster-icon:hover div{transform:scale(1.1)!important;box-shadow:0 6px 16px #aae8e880!important}.leaflet-control-zoom{overflow:hidden;-webkit-backdrop-filter:blur(20px)!important;backdrop-filter:blur(20px)!important;border:1px solid #ffffff1a!important;border-radius:15px!important}.leaflet-control-zoom a{color:#fff!important;background-color:#0006!important;border-bottom:1px solid #ffffff1a!important;transition:all .2s!important}.leaflet-control-zoom a:hover{color:#fff!important;background-color:#ffffff1a!important}.leaflet-control-attribution{color:#9ca3af!important;background-color:#1f2937cc!important;border-top:1px solid #4b55634d!important;border-radius:4px!important;padding:4px 8px!important;font-size:11px!important}.leaflet-control-attribution a{text-decoration:none;color:#60a5fa!important}.leaflet-control-attribution a:hover{text-decoration:underline;color:#93c5fd!important}.leaflet-bottom.leaflet-left .leaflet-control-attribution{margin-bottom:10px!important;margin-left:10px!important}.map-attribution[data-v-61a18eed]{color:#fff9;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);z-index:1000;background:#0006;border:1px solid #ffffff1a;border-radius:15px;padding:4px 8px;font-size:10px;position:absolute;bottom:10px;left:10px}@media (width<=640px){.leaflet-control-attribution{display:none!important}} diff --git a/repeater/web/html/assets/Neighbors-Iq3xu5XJ.js b/repeater/web/html/assets/Neighbors-Iq3xu5XJ.js deleted file mode 100644 index 7a200a8..0000000 --- a/repeater/web/html/assets/Neighbors-Iq3xu5XJ.js +++ /dev/null @@ -1,65 +0,0 @@ -import{a as bt,e as _,h as P,f as t,t as w,x as Lt,q as k,M as Yt,r as D,c as q,E as ht,N as Rt,g as it,T as Ft,m as Dt,O as jt,k as C,F as ct,i as gt,y as It,l as et,o as Xt,P as te,j as ft,H as Pt,n as At,w as wt,Q as ie,s as Wt,v as le,L as Et}from"./index-xzvnOpJo.js";import{u as Ut}from"./useSignalQuality-DZXpd2l9.js";import{L as Q}from"./leaflet-src-BtisrQHC.js";/* empty css */import{g as _t,s as Ct}from"./preferences-DtwbSSgO.js";import"./_commonjsHelpers-CqkleIqs.js";const de={class:"bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4 mb-6"},ce={class:"flex items-center gap-3"},ue={class:"flex-1 min-w-0"},pe={class:"text-content-primary dark:text-content-primary font-medium truncate"},ge={class:"text-content-secondary dark:text-content-muted text-sm font-mono"},me={key:0,class:"text-white/50 text-xs"},he={key:1,class:"text-white/50 text-xs"},be=bt({__name:"DeleteNeighborModal",props:{show:{type:Boolean},neighbor:{}},emits:["close","delete"],setup($,{emit:r}){const o=$,i=r,e=()=>{o.neighbor&&(i("delete",o.neighbor.id),d())},d=()=>{i("close")},h=s=>{s.target===s.currentTarget&&d()};return(s,a)=>s.show&&s.neighbor?(k(),_("div",{key:0,onClick:h,class:"fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4",style:{"backdrop-filter":"blur(8px) saturate(180%)",position:"fixed",top:"0",left:"0",right:"0",bottom:"0"}},[t("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10",onClick:a[0]||(a[0]=Lt(()=>{},["stop"]))},[t("div",{class:"flex items-center gap-3 mb-6"},[a[2]||(a[2]=t("svg",{class:"w-6 h-6 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),a[3]||(a[3]=t("div",null,[t("h3",{class:"text-xl font-semibold text-content-primary dark:text-content-primary"},"Delete Neighbor"),t("p",{class:"text-content-secondary dark:text-content-muted text-sm mt-1"}," Are you sure you want to delete this neighbor? ")],-1)),t("button",{onClick:d,class:"ml-auto text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors"},a[1]||(a[1]=[t("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),t("div",de,[t("div",ce,[t("div",ue,[t("div",pe,w(s.neighbor?.node_name||s.neighbor?.long_name||s.neighbor?.short_name||"Unknown"),1),t("div",ge," ID: "+w(s.neighbor?.node_num_hex||s.neighbor?.node_num||s.neighbor?.id||"N/A"),1),s.neighbor?.contact_type?(k(),_("div",me,w(s.neighbor.contact_type),1)):P("",!0),s.neighbor?.hw_model?(k(),_("div",he,w(s.neighbor.hw_model),1)):P("",!0)])])]),a[4]||(a[4]=t("div",{class:"bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6"},[t("div",{class:"flex items-center gap-2 text-accent-red text-sm"},[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),t("span",null,"This action cannot be undone")])],-1)),t("div",{class:"flex gap-3"},[t("button",{onClick:d,class:"flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),t("button",{onClick:e,class:"flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium"}," Delete ")])])])):P("",!0)}}),xe={class:"bg-gradient-to-r from-primary/20 to-accent-cyan/20 border-b border-stroke-subtle dark:border-stroke/10 px-6 py-4"},ye={class:"flex items-center justify-between"},ve={class:"flex items-center gap-3"},ke={key:0,class:"text-sm text-content-secondary dark:text-content-muted"},fe={class:"p-6"},we={key:0,class:"text-center py-8"},_e={key:1,class:"text-center py-8"},Ce={class:"text-content-secondary dark:text-content-muted text-sm"},Me={key:2,class:"space-y-4"},$e={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},Ae={class:"flex items-center justify-between mb-2"},Le={class:"flex items-baseline gap-2"},Te={class:"text-3xl font-bold text-content-primary dark:text-content-primary"},Ee={class:"grid grid-cols-2 gap-3"},Se={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},Be={class:"flex items-center gap-2 mb-2"},Ne={class:"flex gap-0.5"},Fe={class:"flex items-baseline gap-1"},De={class:"text-xl font-bold text-content-primary dark:text-content-primary"},Pe={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},ze={class:"flex items-baseline gap-1"},Re={class:"text-xl font-bold text-content-primary dark:text-content-primary"},je={key:0,class:"flex items-start gap-3 bg-amber-500/10 border border-amber-500/30 rounded-[12px] p-3"},Ie={class:"text-xs leading-relaxed"},Ue={class:"font-semibold text-amber-600 dark:text-amber-400 mb-0.5"},Oe={class:"bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4"},He={class:"relative"},Ve={class:"flex items-center gap-2 overflow-x-auto pb-2"},Ze={key:0,class:"relative flex items-center"},We={key:0,class:"absolute left-1/2 -translate-x-1/2 animate-pulse"},Qe={class:"text-content-muted dark:text-content-muted text-xs mt-2 flex items-center justify-between"},qe={key:0,class:"text-cyan-500 dark:text-primary animate-pulse"},Ke={class:"flex items-center justify-between text-xs text-content-muted dark:text-content-muted pt-2"},Ge=bt({__name:"PingResultModal",props:{show:{type:Boolean},nodeName:{default:null},result:{default:null},error:{default:null},loading:{type:Boolean,default:!1}},emits:["close"],setup($,{emit:r}){const o=$,i=r,e=Yt(),{getSignalQuality:d}=Ut(),h=D(0),s=D(!1),a=q(()=>{const g=e.stats?.config?.radio?.spreading_factor??7,c=e.stats?.config?.radio?.bandwidth??125,T=e.stats?.config?.radio?.coding_rate??5,F=Math.pow(2,g)/c,I=8+4.25*(T-4)+20;return F*I}),f=q(()=>{if(!o.result)return{color:"text-gray-400",label:"Unknown"};const g=o.result.rtt_ms,c=a.value,T=o.result.path.length,I=2*c*T+500*T;return g{if(!o.result)return{bars:0,color:"text-gray-400"};const g=d(o.result.rssi);return{bars:g.bars,color:g.color}}),v=q(()=>{if(!o.result)return 0;if(o.result.path_hash_mode!==void 0)return o.result.path_hash_mode;const g=o.result.path.reduce((c,T)=>{const F=T.replace(/^0x/i,"");return Math.max(c,F.length)},0);return g>4?2:g>2?1:0}),L=q(()=>v.value>0),B=q(()=>({0:"1-byte",1:"2-byte",2:"3-byte"})[v.value]??"1-byte");ht(()=>o.result,g=>{if(g&&!s.value){s.value=!0,h.value=0;const c=g.path.length,F=1500/(c*2);let I=0;const y=c*2-2,p=()=>{I<=y?(h.value=I/y,I++,setTimeout(p,F)):(s.value=!1,h.value=1)};setTimeout(p,100)}},{immediate:!0});const N=q(()=>{if(!o.result||!s.value)return-1;const g=o.result.path.length;if(g<=1)return-1;const c=h.value,T=.5;if(c<=T)return c/T*(g-1);{const F=(c-T)/T;return(g-1)*(1-F)}}),S=()=>{i("close")};return(g,c)=>(k(),Rt(jt,{to:"body"},[it(Ft,{name:"modal"},{default:Dt(()=>[g.show?(k(),_("div",{key:0,class:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[99999] p-4",onClick:Lt(S,["self"])},[t("div",{class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/20 rounded-[20px] shadow-2xl w-full max-w-md overflow-hidden",onClick:c[0]||(c[0]=Lt(()=>{},["stop"]))},[t("div",xe,[t("div",ye,[t("div",ve,[c[2]||(c[2]=t("div",{class:"p-2 bg-cyan-400/20 dark:bg-primary/20 rounded-lg"},[t("svg",{class:"w-5 h-5 text-cyan-500 dark:text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})])],-1)),t("div",null,[c[1]||(c[1]=t("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary"},"Ping Result",-1)),g.nodeName?(k(),_("p",ke,w(g.nodeName),1)):P("",!0)])]),t("button",{onClick:S,class:"p-2 hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-lg transition-colors text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary"},c[3]||(c[3]=[t("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])]),t("div",fe,[g.loading?(k(),_("div",we,c[4]||(c[4]=[t("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"},null,-1),t("p",{class:"text-content-secondary dark:text-content-muted"},"Sending ping...",-1),t("p",{class:"text-content-muted dark:text-content-muted text-sm mt-1"},"Waiting for response...",-1)]))):g.error?(k(),_("div",_e,[c[5]||(c[5]=t("div",{class:"p-3 bg-accent-red/10 rounded-full w-16 h-16 mx-auto mb-4 flex items-center justify-center"},[t("svg",{class:"w-8 h-8 text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-1.964-1.333-2.732 0L3.268 16c-.77 1.333.192 3 1.732 3z"})])],-1)),c[6]||(c[6]=t("h3",{class:"text-accent-red font-semibold mb-2"},"Ping Failed",-1)),t("p",Ce,w(g.error),1)])):g.result?(k(),_("div",Me,[t("div",$e,[t("div",Ae,[c[7]||(c[7]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"Round-Trip Time",-1)),t("span",{class:C(["text-xs font-medium px-2 py-1 rounded-full",f.value.color,"bg-current/10"])},w(f.value.label),3)]),t("div",Le,[t("span",Te,w(g.result.rtt_ms.toFixed(2)),1),c[8]||(c[8]=t("span",{class:"text-content-secondary dark:text-content-muted"},"ms",-1))])]),t("div",Ee,[t("div",Se,[t("div",Be,[c[9]||(c[9]=t("span",{class:"text-content-secondary dark:text-content-muted text-sm"},"RSSI",-1)),t("div",Ne,[(k(),_(ct,null,gt(5,T=>t("div",{key:T,class:C(["w-1 h-3 rounded-sm",T<=b.value.bars?b.value.color:"bg-stroke-subtle dark:bg-stroke/10"])},null,2)),64))])]),t("div",Fe,[t("span",De,w(g.result.rssi),1),c[10]||(c[10]=t("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"dBm",-1))])]),t("div",Pe,[c[12]||(c[12]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-2"},"SNR",-1)),t("div",ze,[t("span",Re,w(g.result.snr_db),1),c[11]||(c[11]=t("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"dB",-1))])])]),L.value?(k(),_("div",je,[c[14]||(c[14]=t("svg",{class:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-1.964-1.333-2.732 0L3.268 16c-.77 1.333.192 3 1.732 3z"})],-1)),t("div",Ie,[t("p",Ue,w(B.value)+" path hashes active ",1),c[13]||(c[13]=t("p",{class:"text-content-secondary dark:text-content-muted"}," This result uses multi-byte path hashes. The repeater being traced must be running firmware that supports multi-byte path hashes. Repeaters on older firmware will not respond to or correctly route these trace packets. ",-1))])])):P("",!0),t("div",Oe,[c[17]||(c[17]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-3"},"Network Path",-1)),t("div",He,[t("div",Ve,[(k(!0),_(ct,null,gt(g.result.path,(T,F)=>(k(),_("div",{key:F,class:"flex items-center gap-2 flex-shrink-0 relative"},[t("div",{class:C(["bg-cyan-400/20 dark:bg-primary/20 text-cyan-600 dark:text-primary border border-cyan-400/40 dark:border-primary/30 px-3 py-1.5 rounded-lg text-sm font-mono transition-all duration-300",s.value&&Math.floor(N.value)===F?"ring-2 ring-cyan-400/50 dark:ring-primary/50 scale-105":""])},w(T),3),F[s.value&&N.value>=F&&N.valuenew Date(y*1e3).toLocaleString(),f=y=>y?`${y} dBm`:"N/A",b=y=>y?`${y.toFixed(1)} dB`:"N/A",v=y=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[y||0]||"Unknown",L=y=>({Unknown:"Unknown","Chat Node":"Chat Node",Repeater:"Repeater","Room Server":"Room Server","Hybrid Node":"Hybrid Node"})[y]||y,B=y=>({Unknown:"text-gray-600 dark:text-gray-400","Chat Node":"text-blue-600 dark:text-blue-400",Repeater:"text-emerald-600 dark:text-emerald-400","Room Server":"text-purple-600 dark:text-purple-400","Hybrid Node":"text-amber-600 dark:text-amber-400"})[y]||"text-gray-600 dark:text-gray-400",N=async()=>{if(!e.neighbor?.latitude||!e.neighbor?.longitude)return;const y=e.neighbor.latitude.toFixed(6),p=e.neighbor.longitude.toFixed(6),U=`${y}, ${p}`;try{await navigator.clipboard.writeText(U),i.value="Copied!",setTimeout(()=>{i.value="Copy"},2e3)}catch(Y){console.error("Failed to copy coordinates:",Y),i.value="Failed",setTimeout(()=>{i.value="Copy"},2e3)}},S=q(()=>{if(!e.neighbor?.latitude||!e.neighbor?.longitude||!e.baseLatitude||!e.baseLongitude)return null;const y=6371,p=(e.neighbor.latitude-e.baseLatitude)*Math.PI/180,U=(e.neighbor.longitude-e.baseLongitude)*Math.PI/180,Y=Math.sin(p/2)*Math.sin(p/2)+Math.cos(e.baseLatitude*Math.PI/180)*Math.cos(e.neighbor.latitude*Math.PI/180)*Math.sin(U/2)*Math.sin(U/2),ot=2*Math.atan2(Math.sqrt(Y),Math.sqrt(1-Y));return y*ot}),g=q(()=>e.neighbor?.latitude!==null&&e.neighbor?.longitude!==null&&e.neighbor?.latitude!==0&&e.neighbor?.longitude!==0&&Math.abs(e.neighbor?.latitude??0)<=90&&Math.abs(e.neighbor?.longitude??0)<=180),c=()=>{if(!h.value||!e.neighbor||!g.value)return;s&&(s.remove(),s=null);const y=document.documentElement.classList.contains("dark");s=Q.map(h.value,{center:[e.neighbor.latitude,e.neighbor.longitude],zoom:13,zoomControl:!0,attributionControl:!1});const p=y?"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png":"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png";Q.tileLayer(p,{maxZoom:19,attribution:"© OpenStreetMap © CARTO"}).addTo(s);const U=Q.divIcon({className:"custom-marker",html:`
${e.neighbor.node_name?.charAt(0)||"?"}
`,iconSize:[32,32],iconAnchor:[16,16]});if(Q.marker([e.neighbor.latitude,e.neighbor.longitude],{icon:U}).addTo(s).bindPopup(`${e.neighbor.node_name||"Unknown"}
${e.neighbor.pubkey.slice(0,8)}...`),e.baseLatitude!==null&&e.baseLongitude!==null&&e.baseLatitude!==0&&e.baseLongitude!==0&&Math.abs(e.baseLatitude)<=90&&Math.abs(e.baseLongitude)<=180){const ot=Q.divIcon({className:"custom-marker",html:'
B
',iconSize:[32,32],iconAnchor:[16,16]});Q.marker([e.baseLatitude,e.baseLongitude],{icon:ot}).addTo(s).bindPopup("Base Station"),Q.polyline([[e.baseLatitude,e.baseLongitude],[e.neighbor.latitude,e.neighbor.longitude]],{color:"#3b82f6",weight:2,opacity:.6,dashArray:"5, 10"}).addTo(s);const lt=Q.latLngBounds([e.baseLatitude,e.baseLongitude],[e.neighbor.latitude,e.neighbor.longitude]);s.fitBounds(lt,{padding:[50,50]})}},T=y=>{y.key==="Escape"&&d("close")},F=y=>{y.target===y.currentTarget&&d("close")};ht(()=>e.isOpen,y=>{y?(document.body.style.overflow="hidden",setTimeout(()=>{g.value&&c()},100)):(document.body.style.overflow="",s&&(s.remove(),s=null))},{immediate:!0});const I=q(()=>e.neighbor?.rssi?o(e.neighbor.rssi):null);return(y,p)=>(k(),Rt(jt,{to:"body"},[it(Ft,{name:"modal",appear:""},{default:Dt(()=>[y.isOpen&&y.neighbor?(k(),_("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 overflow-hidden",onClick:F,onKeydown:T,tabindex:"0"},[p[20]||(p[20]=t("div",{class:"absolute inset-0 bg-black/60 backdrop-blur-md pointer-events-none"},null,-1)),t("div",{class:"relative w-full max-w-4xl max-h-[90vh] flex flex-col",onClick:p[2]||(p[2]=Lt(()=>{},["stop"]))},[t("div",Ye,[t("div",Xe,[t("div",to,[t("h2",eo,w(y.neighbor.node_name||"Unknown Node"),1),t("p",oo,w(y.neighbor.pubkey),1)]),t("div",ro,[t("button",{onClick:p[0]||(p[0]=U=>d("close")),class:"w-8 h-8 flex items-center justify-center rounded-full bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors duration-200 text-gray-700 dark:text-white hover:text-gray-900 dark:hover:text-white"},p[3]||(p[3]=[t("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])]),t("div",no,[t("div",so,[p[8]||(p[8]=t("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4"},"Basic Information",-1)),t("div",ao,[t("div",io,[p[4]||(p[4]=t("div",{class:"text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1"},"Contact Type",-1)),t("div",{class:C(["font-medium",B(y.neighbor.contact_type)])},w(L(y.neighbor.contact_type)),3)]),t("div",lo,[p[5]||(p[5]=t("div",{class:"text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1"},"Route Type",-1)),t("div",co,w(v(y.neighbor.route_type)),1)]),t("div",uo,[p[6]||(p[6]=t("div",{class:"text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1"},"Zero Hop",-1)),t("div",{class:C(["font-medium",y.neighbor.zero_hop?"text-green-600 dark:text-green-400":"text-gray-600 dark:text-gray-400"])},w(y.neighbor.zero_hop?"Yes":"No"),3)]),t("div",po,[p[7]||(p[7]=t("div",{class:"text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1"},"Advert Count",-1)),t("div",go,w(y.neighbor.advert_count.toLocaleString()),1)])])]),t("div",mo,[p[12]||(p[12]=t("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4"},"Signal Quality",-1)),t("div",ho,[t("div",bo,[p[9]||(p[9]=t("div",{class:"text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1"},"RSSI",-1)),t("div",xo,w(f(y.neighbor.rssi)),1)]),t("div",yo,[p[10]||(p[10]=t("div",{class:"text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1"},"SNR",-1)),t("div",vo,w(b(y.neighbor.snr)),1)]),I.value?(k(),_("div",ko,[p[11]||(p[11]=t("div",{class:"text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1"},"Signal Strength",-1)),t("div",fo,[t("div",wo,[(k(),_(ct,null,gt(4,U=>t("div",{key:U,class:C(["w-1 h-3 rounded-sm",U<=I.value.bars?I.value.color:"bg-gray-300 dark:bg-gray-700"])},null,2)),64))]),t("span",{class:C(["text-sm font-medium",I.value.color])},w(I.value.quality),3)])])):P("",!0)])]),t("div",_o,[p[15]||(p[15]=t("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4"},"Timeline",-1)),t("div",Co,[t("div",Mo,[p[13]||(p[13]=t("div",{class:"text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1"},"First Seen",-1)),t("div",$o,w(a(y.neighbor.first_seen)),1)]),t("div",Ao,[p[14]||(p[14]=t("div",{class:"text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1"},"Last Seen",-1)),t("div",Lo,w(a(y.neighbor.last_seen)),1)])])]),g.value?(k(),_("div",To,[p[19]||(p[19]=t("h3",{class:"text-lg font-semibold text-content-primary dark:text-content-primary mb-4"},"Location",-1)),t("div",Eo,[t("div",So,[p[16]||(p[16]=t("div",{class:"text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1"},"Latitude",-1)),t("div",Bo,w(y.neighbor.latitude?.toFixed(6)),1)]),t("div",No,[p[17]||(p[17]=t("div",{class:"text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1"},"Longitude",-1)),t("div",Fo,w(y.neighbor.longitude?.toFixed(6)),1)]),t("div",Do,[t("div",Po,w(S.value!==null?"Distance":"Coordinates"),1),S.value!==null?(k(),_("div",zo,w(S.value.toFixed(2))+" km ",1)):(k(),_("button",{key:1,onClick:N,class:"w-full px-3 py-1.5 bg-primary hover:bg-primary/90 dark:bg-gray-700 dark:hover:bg-gray-600 text-white text-sm font-medium rounded-lg transition-colors flex items-center justify-center gap-1.5"},[p[18]||(p[18]=t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})],-1)),et(" "+w(i.value),1)]))])]),t("div",{ref_key:"mapContainer",ref:h,class:"w-full h-96 rounded-[12px] overflow-hidden border border-stroke-subtle dark:border-white/10"},null,512)])):P("",!0)]),t("div",Ro,[t("button",{onClick:p[1]||(p[1]=U=>d("close")),class:"w-full px-4 py-2.5 bg-primary hover:bg-primary/90 dark:bg-gray-700 dark:hover:bg-gray-600 text-white font-medium rounded-lg transition-colors"}," Close ")])])])],32)):P("",!0)]),_:1})]))}}),Io=It(jo,[["__scopeId","data-v-5669a05a"]]),Qt=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],St=1,vt=8;class Ot{static from(r){if(!(r instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[o,i]=new Uint8Array(r,0,2);if(o!==219)throw new Error("Data does not appear to be in a KDBush format.");const e=i>>4;if(e!==St)throw new Error(`Got v${e} data when expected v${St}.`);const d=Qt[i&15];if(!d)throw new Error("Unrecognized array type.");const[h]=new Uint16Array(r,2,1),[s]=new Uint32Array(r,4,1);return new Ot(s,h,d,r)}constructor(r,o=64,i=Float64Array,e){if(isNaN(r)||r<0)throw new Error(`Unpexpected numItems value: ${r}.`);this.numItems=+r,this.nodeSize=Math.min(Math.max(+o,2),65535),this.ArrayType=i,this.IndexArrayType=r<65536?Uint16Array:Uint32Array;const d=Qt.indexOf(this.ArrayType),h=r*2*this.ArrayType.BYTES_PER_ELEMENT,s=r*this.IndexArrayType.BYTES_PER_ELEMENT,a=(8-s%8)%8;if(d<0)throw new Error(`Unexpected typed array class: ${i}.`);e&&e instanceof ArrayBuffer?(this.data=e,this.ids=new this.IndexArrayType(this.data,vt,r),this.coords=new this.ArrayType(this.data,vt+s+a,r*2),this._pos=r*2,this._finished=!0):(this.data=new ArrayBuffer(vt+h+s+a),this.ids=new this.IndexArrayType(this.data,vt,r),this.coords=new this.ArrayType(this.data,vt+s+a,r*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(St<<4)+d]),new Uint16Array(this.data,2,1)[0]=o,new Uint32Array(this.data,4,1)[0]=r)}add(r,o){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=r,this.coords[this._pos++]=o,i}finish(){const r=this._pos>>1;if(r!==this.numItems)throw new Error(`Added ${r} items when expected ${this.numItems}.`);return zt(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(r,o,i,e){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:d,coords:h,nodeSize:s}=this,a=[0,d.length-1,0],f=[];for(;a.length;){const b=a.pop()||0,v=a.pop()||0,L=a.pop()||0;if(v-L<=s){for(let g=L;g<=v;g++){const c=h[2*g],T=h[2*g+1];c>=r&&c<=i&&T>=o&&T<=e&&f.push(d[g])}continue}const B=L+v>>1,N=h[2*B],S=h[2*B+1];N>=r&&N<=i&&S>=o&&S<=e&&f.push(d[B]),(b===0?r<=N:o<=S)&&(a.push(L),a.push(B-1),a.push(1-b)),(b===0?i>=N:e>=S)&&(a.push(B+1),a.push(v),a.push(1-b))}return f}within(r,o,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:e,coords:d,nodeSize:h}=this,s=[0,e.length-1,0],a=[],f=i*i;for(;s.length;){const b=s.pop()||0,v=s.pop()||0,L=s.pop()||0;if(v-L<=h){for(let g=L;g<=v;g++)qt(d[2*g],d[2*g+1],r,o)<=f&&a.push(e[g]);continue}const B=L+v>>1,N=d[2*B],S=d[2*B+1];qt(N,S,r,o)<=f&&a.push(e[B]),(b===0?r-i<=N:o-i<=S)&&(s.push(L),s.push(B-1),s.push(1-b)),(b===0?r+i>=N:o+i>=S)&&(s.push(B+1),s.push(v),s.push(1-b))}return a}}function zt($,r,o,i,e,d){if(e-i<=o)return;const h=i+e>>1;ee($,r,h,i,e,d),zt($,r,o,i,h-1,1-d),zt($,r,o,h+1,e,1-d)}function ee($,r,o,i,e,d){for(;e>i;){if(e-i>600){const f=e-i+1,b=o-i+1,v=Math.log(f),L=.5*Math.exp(2*v/3),B=.5*Math.sqrt(v*L*(f-L)/f)*(b-f/2<0?-1:1),N=Math.max(i,Math.floor(o-b*L/f+B)),S=Math.min(e,Math.floor(o+(f-b)*L/f+B));ee($,r,o,N,S,d)}const h=r[2*o+d];let s=i,a=e;for(kt($,r,i,o),r[2*e+d]>h&&kt($,r,i,e);sh;)a--}r[2*i+d]===h?kt($,r,i,a):(a++,kt($,r,a,e)),a<=o&&(i=a+1),o<=a&&(e=a-1)}}function kt($,r,o,i){Bt($,o,i),Bt(r,2*o,2*i),Bt(r,2*o+1,2*i+1)}function Bt($,r,o){const i=$[r];$[r]=$[o],$[o]=i}function qt($,r,o,i){const e=$-o,d=r-i;return e*e+d*d}const Uo={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:$=>$},Kt=Math.fround||($=>r=>($[0]=+r,$[0]))(new Float32Array(1)),mt=2,pt=3,Nt=4,ut=5,oe=6;class Oo{constructor(r){this.options=Object.assign(Object.create(Uo),r),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(r){const{log:o,minZoom:i,maxZoom:e}=this.options;o&&console.time("total time");const d=`prepare ${r.length} points`;o&&console.time(d),this.points=r;const h=[];for(let a=0;a=i;a--){const f=+Date.now();s=this.trees[a]=this._createTree(this._cluster(s,a)),o&&console.log("z%d: %d clusters in %dms",a,s.numItems,+Date.now()-f)}return o&&console.timeEnd("total time"),this}getClusters(r,o){let i=((r[0]+180)%360+360)%360-180;const e=Math.max(-90,Math.min(90,r[1]));let d=r[2]===180?180:((r[2]+180)%360+360)%360-180;const h=Math.max(-90,Math.min(90,r[3]));if(r[2]-r[0]>=360)i=-180,d=180;else if(i>d){const v=this.getClusters([i,e,180,h],o),L=this.getClusters([-180,e,d,h],o);return v.concat(L)}const s=this.trees[this._limitZoom(o)],a=s.range(Mt(i),$t(h),Mt(d),$t(e)),f=s.data,b=[];for(const v of a){const L=this.stride*v;b.push(f[L+ut]>1?Gt(f,L,this.clusterProps):this.points[f[L+pt]])}return b}getChildren(r){const o=this._getOriginId(r),i=this._getOriginZoom(r),e="No cluster with the specified id.",d=this.trees[i];if(!d)throw new Error(e);const h=d.data;if(o*this.stride>=h.length)throw new Error(e);const s=this.options.radius/(this.options.extent*Math.pow(2,i-1)),a=h[o*this.stride],f=h[o*this.stride+1],b=d.within(a,f,s),v=[];for(const L of b){const B=L*this.stride;h[B+Nt]===r&&v.push(h[B+ut]>1?Gt(h,B,this.clusterProps):this.points[h[B+pt]])}if(v.length===0)throw new Error(e);return v}getLeaves(r,o,i){o=o||10,i=i||0;const e=[];return this._appendLeaves(e,r,o,i,0),e}getTile(r,o,i){const e=this.trees[this._limitZoom(r)],d=Math.pow(2,r),{extent:h,radius:s}=this.options,a=s/h,f=(i-a)/d,b=(i+1+a)/d,v={features:[]};return this._addTileFeatures(e.range((o-a)/d,f,(o+1+a)/d,b),e.data,o,i,d,v),o===0&&this._addTileFeatures(e.range(1-a/d,f,1,b),e.data,d,i,d,v),o===d-1&&this._addTileFeatures(e.range(0,f,a/d,b),e.data,-1,i,d,v),v.features.length?v:null}getClusterExpansionZoom(r){let o=this._getOriginZoom(r)-1;for(;o<=this.options.maxZoom;){const i=this.getChildren(r);if(o++,i.length!==1)break;r=i[0].properties.cluster_id}return o}_appendLeaves(r,o,i,e,d){const h=this.getChildren(o);for(const s of h){const a=s.properties;if(a&&a.cluster?d+a.point_count<=e?d+=a.point_count:d=this._appendLeaves(r,a.cluster_id,i,e,d):d1;let b,v,L;if(f)b=re(o,a,this.clusterProps),v=o[a],L=o[a+1];else{const S=this.points[o[a+pt]];b=S.properties;const[g,c]=S.geometry.coordinates;v=Mt(g),L=$t(c)}const B={type:1,geometry:[[Math.round(this.options.extent*(v*d-i)),Math.round(this.options.extent*(L*d-e))]],tags:b};let N;f||this.options.generateId?N=o[a+pt]:N=this.points[o[a+pt]].id,N!==void 0&&(B.id=N),h.features.push(B)}}_limitZoom(r){return Math.max(this.options.minZoom,Math.min(Math.floor(+r),this.options.maxZoom+1))}_cluster(r,o){const{radius:i,extent:e,reduce:d,minPoints:h}=this.options,s=i/(e*Math.pow(2,o)),a=r.data,f=[],b=this.stride;for(let v=0;vo&&(g+=a[T+ut])}if(g>S&&g>=h){let c=L*S,T=B*S,F,I=-1;const y=((v/b|0)<<5)+(o+1)+this.points.length;for(const p of N){const U=p*b;if(a[U+mt]<=o)continue;a[U+mt]=o;const Y=a[U+ut];c+=a[U]*Y,T+=a[U+1]*Y,a[U+Nt]=y,d&&(F||(F=this._map(a,v,!0),I=this.clusterProps.length,this.clusterProps.push(F)),d(F,this._map(a,U)))}a[v+Nt]=y,f.push(c/g,T/g,1/0,y,-1,g),d&&f.push(I)}else{for(let c=0;c1)for(const c of N){const T=c*b;if(!(a[T+mt]<=o)){a[T+mt]=o;for(let F=0;F>5}_getOriginZoom(r){return(r-this.points.length)%32}_map(r,o,i){if(r[o+ut]>1){const h=this.clusterProps[r[o+oe]];return i?Object.assign({},h):h}const e=this.points[r[o+pt]].properties,d=this.options.map(e);return i&&d===e?Object.assign({},d):d}}function Gt($,r,o){return{type:"Feature",id:$[r+pt],properties:re($,r,o),geometry:{type:"Point",coordinates:[Ho($[r]),Vo($[r+1])]}}}function re($,r,o){const i=$[r+ut],e=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?`${Math.round(i/100)/10}k`:i,d=$[r+oe],h=d===-1?{}:Object.assign({},o[d]);return Object.assign(h,{cluster:!0,cluster_id:$[r+pt],point_count:i,point_count_abbreviated:e})}function Mt($){return $/360+.5}function $t($){const r=Math.sin($*Math.PI/180),o=.5-.25*Math.log((1+r)/(1-r))/Math.PI;return o<0?0:o>1?1:o}function Ho($){return($-.5)*360}function Vo($){const r=(180-$*360)*Math.PI/180;return 360*Math.atan(Math.exp(r))/Math.PI-90}const Zo={class:"map-container"},Wo={key:0,class:"flex items-center justify-center h-96 glass-card backdrop-blur border border-black/6 dark:border-white/10 rounded-[12px] shadow-sm dark:shadow-none"},Qo={class:"hidden sm:inline"},qo={key:3,class:"map-legend"},Ko={class:"legend-footer"},Go={key:4,class:"map-attribution"},Jo=bt({__name:"NetworkMap",props:{adverts:{},baseLatitude:{default:null},baseLongitude:{default:null},showLegend:{type:Boolean,default:!0}},emits:["update:showLegend"],setup($,{expose:r,emit:o}){typeof window<"u"&&!window.chrome&&(window.chrome={runtime:{}});const i=$,e=o,d=()=>{e("update:showLegend",!i.showLegend)},h=D();let s=null;const a=D(new Map);let f=null;const b=D(new Map),v=D([]),L=D(!0),B=D(60),N=D(14),S=D(document.documentElement.classList.contains("dark")),g=new MutationObserver(()=>{const A=document.documentElement.classList.contains("dark");A!==S.value&&(S.value=A,s&&Y())}),c=q(()=>i.baseLatitude!==null&&i.baseLongitude!==null&&typeof i.baseLatitude=="number"&&typeof i.baseLongitude=="number"&&i.baseLatitude!==0&&i.baseLongitude!==0&&Math.abs(i.baseLatitude)<=90&&Math.abs(i.baseLongitude)<=180),T=A=>new Date(A*1e3).toLocaleString(),F=A=>A?`${A} dBm`:"N/A",I=A=>A?`${A} dB`:"N/A",y=A=>({0:"Transport Flood",1:"Flood",2:"Direct",3:"Transport Direct"})[A||0]||"Unknown",p=(A,u,n,l)=>{const j=(n-A)*Math.PI/180,H=(l-u)*Math.PI/180,X=Math.sin(j/2)*Math.sin(j/2)+Math.cos(A*Math.PI/180)*Math.cos(n*Math.PI/180)*Math.sin(H/2)*Math.sin(H/2);return 6371*(2*Math.atan2(Math.sqrt(X),Math.sqrt(1-X)))},U=()=>{s&&(v.value.forEach(A=>{s&&A.remove()}),v.value.length=0,s.remove(),s=null),a.value.clear(),b.value.clear(),f=null},Y=async()=>{const A=s?.getZoom()||11,u=s?.getCenter()||(c.value?[i.baseLatitude,i.baseLongitude]:[0,0]);U(),await Pt(),await at(),s&&s.setView(u,A)},ot=A=>{const u=new Map;return A.filter(n=>n.latitude!==null&&n.longitude!==null).map(n=>{let l=n.latitude,E=n.longitude;const j=`${l.toFixed(6)}_${E.toFixed(6)}`,H=u.get(j)||0;if(u.set(j,H+1),H>0){const tt=H*60*(Math.PI/180);l+=Math.sin(tt)*.001*(H*.5),E+=Math.cos(tt)*.001*(H*.5)}return{type:"Feature",properties:{advert:{...n,jittered_latitude:l,jittered_longitude:E}},geometry:{type:"Point",coordinates:[E,l]}}})},lt=A=>{f=new Oo({radius:B.value,maxZoom:N.value,minPoints:2}),f.load(A)},at=async()=>{if(!h.value||!c.value){console.warn("Cannot initialize map: missing container or coordinates");return}U(),await Pt();const A=i.baseLatitude,u=i.baseLongitude;s=Q.map(h.value,{center:[A,u],zoom:11,zoomControl:!0,attributionControl:!1,preferCanvas:!1});try{const n=S.value?"https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png":"https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}{r}.png",l=S.value?"https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png":"https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.png",E=Q.tileLayer(n,{maxZoom:19,attribution:'© OpenStreetMap contributors © CARTO',errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="}),j=Q.tileLayer(l,{maxZoom:19,attribution:"",errorTileUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg=="});E.addTo(s),j.addTo(s)}catch(n){console.warn("Error loading tiles:",n)}try{const n=(R,V=!1)=>{const x=V?16:12;return Q.divIcon({className:"custom-div-icon",html:`
`,iconSize:[x+4,x+4],iconAnchor:[(x+4)/2,(x+4)/2]})},l=R=>{const V=R<10?30:R<100?40:50;return Q.divIcon({className:"custom-cluster-icon",html:` -
- ${R} -
- `,iconSize:[V,V],iconAnchor:[V/2,V/2]})},E=n("#ef4444",!0);Q.marker([A,u],{icon:E}).addTo(s).bindPopup(` -
- Base Station
- Base Station
- ${A.toFixed(6)}, ${u.toFixed(6)} -
- `);const j={Unknown:"#9CA3AF","Chat Node":"#60A5FA",Repeater:"#A5E5B6","Room Server":"#EBA0FC","Hybrid Node":"#FFC246"},H=(R,V,x,m,M=0)=>{if(!s)return;const z=R.jittered_latitude||R.latitude,Z=R.jittered_longitude||R.longitude;if(z===null||Z===null)return;const O=R.route_type||0;let K=m,W=3,G=.7,J;O===2?(K="#A5E5B6",W=4,G=.9):O===1?(K="#FFC246",J="10, 5",G=.8):O===3?(K="#059669",W=5,G=.95):O===0?(K="#ea580c",J="12, 6",G=.8):(K="#9CA3AF",J="2, 5",G=.6);const rt=[V,x],st=[z,Z],dt=Q.polyline([rt,st],{color:K,weight:W,opacity:0,dashArray:J,className:"connection-line"}).addTo(s),xt=Q.polyline([rt,rt],{color:K,weight:W,opacity:0,dashArray:J,className:"connection-line animated-line"}).addTo(s);setTimeout(()=>{let Tt=0;const Ht=30;xt.setStyle({opacity:G+.2});const Vt=()=>{Tt++;const Zt=Tt/Ht,ne=rt[0]+(st[0]-rt[0])*Zt,se=rt[1]+(st[1]-rt[1])*Zt;xt.setLatLngs([rt,[ne,se]]),Tt{s&&xt&&xt.remove(),dt.setStyle({opacity:G}),dt.on("mouseover",()=>{dt.setStyle({weight:W+2,opacity:Math.min(G+.3,1)})}),dt.on("mouseout",()=>{dt.setStyle({weight:W,opacity:G})});const ae=p(V,x,z,Z);dt.bindPopup(` -
- Connection to ${R.node_name||"Unknown Node"}
- Distance: ${ae.toFixed(2)} km
- Route: ${y(R.route_type)}
- Signal: ${F(R.rssi)} / ${I(R.snr)} -
- `),v.value.push(dt)},200)};Vt()},M)},X=()=>{if(!s||!f)return;const R=s.getBounds(),V=Math.floor(s.getZoom());b.value.forEach(m=>{s&&m.remove()}),b.value.clear(),v.value.forEach(m=>{s&&m.remove()}),v.value.length=0,f.getClusters([R.getWest(),R.getSouth(),R.getEast(),R.getNorth()],V).forEach(m=>{const[M,z]=m.geometry.coordinates,Z=m.properties;if(Z.cluster){const O=Q.marker([z,M],{icon:l(Z.point_count||0)}).addTo(s);O.on("click",()=>{if(s&&f){const st=f.getClusterExpansionZoom(Z.cluster_id);s.setView([z,M],st)}});const W=f.getLeaves(Z.cluster_id,1/0).map(st=>`
- • ${st.properties.advert.node_name||"Unknown Node"} (${st.properties.advert.contact_type}) -
`).join("");O.bindPopup(` -
- Cluster: ${Z.point_count} nodes
-
- ${W} -
-
- Click to zoom in and separate nodes -
-
- `),b.value.set(`cluster-${Z.cluster_id}`,O);const G=p(A,u,z,M),J=Math.min(Math.floor(G*5),200),rt={node_name:`Cluster of ${Z.point_count} nodes`,contact_type:"Cluster",route_type:2,rssi:null,snr:null,jittered_latitude:z,jittered_longitude:M,latitude:z,longitude:M};H(rt,A,u,"#AAE8E8",J)}else{const O=Z.advert,K=j[O.contact_type]||j.Unknown,W=n(K),G=z,J=M,rt=p(A,u,G,J),st=Q.marker([G,J],{icon:W}).addTo(s).bindPopup(` -
- ${O.node_name||"Unknown Node"}
- Type: ${O.contact_type}
- Distance: ${rt.toFixed(2)} km
- Signal: ${F(O.rssi)} / ${I(O.snr)}
- Route: ${y(O.route_type)}
- Last Seen: ${T(O.last_seen)} - ${O.jittered_latitude?'
Position adjusted to separate overlapping nodes':""} -
- `);a.value.set(O.pubkey,st),b.value.set(`node-${O.pubkey}`,st);const dt=Math.min(Math.floor(rt*5),200),xt={...O,jittered_latitude:G,jittered_longitude:J};H(xt,A,u,K,dt)}})},tt=(R,V)=>{let x=0;ot(i.adverts).forEach(M=>{const z=M.properties.advert;if(z.latitude!==null&&z.longitude!==null){const Z=j[z.contact_type]||j.Unknown,O=n(Z),K=z.jittered_latitude||z.latitude,W=z.jittered_longitude||z.longitude,G=Q.marker([K,W],{icon:O}).addTo(s).bindPopup(` -
- ${z.node_name||"Unknown Node"}
- Type: ${z.contact_type}
- Distance: ${p(R,V,K,W).toFixed(2)} km
- Signal: ${F(z.rssi)} / ${I(z.snr)}
- Route: ${y(z.route_type)}
- Last Seen: ${T(z.last_seen)} - ${z.jittered_latitude?'
Position adjusted to separate overlapping nodes':""} -
- `);a.value.set(z.pubkey,G);const J=G.getElement();J&&(J.style.opacity="0",J.style.transition="opacity 0.5s ease-out"),H(z,R,V,Z,x),setTimeout(()=>{J&&(J.style.opacity="1")},x+1e3),x+=100}})};if(L.value&&i.adverts.length>0)try{const R=ot(i.adverts);lt(R);const V=Math.min(14,s.getZoom());s.setZoom(V),setTimeout(()=>{try{X()}catch(x){console.warn("Error updating clusters:",x),tt(A,u)}},100),s.on("moveend",()=>{try{X()}catch(x){console.warn("Error updating clusters on move:",x)}}),s.on("zoomend",()=>{try{X()}catch(x){console.warn("Error updating clusters on zoom:",x)}})}catch(R){console.warn("Error initializing clustering:",R),tt(A,u)}else tt(A,u);setTimeout(()=>{s&&s.invalidateSize()},1e3)}catch(n){console.error("Error initializing map:",n)}};return r({highlightNode:A=>{const u=a.value.get(A);if(u){const n=u.getElement();if(n){const l=n.querySelector("div");l&&l.classList.add("marker-highlight")}}},unhighlightNode:A=>{const u=a.value.get(A);if(u){const n=u.getElement();if(n){const l=n.querySelector("div");l&&l.classList.remove("marker-highlight")}}},initializeOpenStreetMap:at}),ht(()=>i.adverts,()=>{s&&c.value&&setTimeout(()=>{at()},100)},{immediate:!1}),Xt(()=>{g.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),c.value&&i.adverts.length>0&&setTimeout(()=>{at()},300)}),te(()=>{g.disconnect(),U()}),(A,u)=>(k(),_("div",Zo,[c.value?(k(),_("div",{key:1,ref_key:"mapContainer",ref:h,class:"leaflet-map-container h-96 w-full glass-card backdrop-blur border border-black/6 dark:border-white/10 rounded-[12px] overflow-hidden shadow-sm dark:shadow-none",style:{"min-height":"384px",position:"relative"}},null,512)):(k(),_("div",Wo,u[0]||(u[0]=[ft('

No valid coordinates available

Configure base station location to view map

',1)]))),c.value&&A.adverts.length>0?(k(),_("button",{key:2,onClick:d,class:"absolute bottom-3 right-3 z-[1001] flex items-center gap-2 px-3 py-2 bg-black/40 border border-white/10 rounded-lg text-white/80 hover:bg-white/10 hover:text-white transition-colors text-sm backdrop-blur-sm"},[u[1]||(u[1]=t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})],-1)),t("span",Qo,w(A.showLegend?"Hide":"Show"),1)])):P("",!0),c.value&&A.adverts.length>0&&A.showLegend?(k(),_("div",qo,[u[2]||(u[2]=ft('
Node Types
Base Station
Chat Node
Repeater
Room Server
Hybrid Node
Route Types
Direct
Transport Direct
Flood
Transport Flood
',2)),t("div",Ko,w(A.adverts.length)+" node"+w(A.adverts.length!==1?"s":"")+" visible ",1)])):P("",!0),c.value?(k(),_("div",Go," © OpenStreetMap contributors © CARTO ")):P("",!0)]))}}),Yo=It(Jo,[["__scopeId","data-v-a6a23e33"]]),Xo={class:"relative","data-menu-container":""},Jt=bt({__name:"NeighborMenu",props:{neighbor:{},canPing:{type:Boolean}},emits:["ping","delete","show-details"],setup($,{emit:r}){const o=window.__neighborMenuManager||{activeMenu:null,setActiveMenu:g=>{if(o.activeMenu&&o.activeMenu!==g)try{o.activeMenu.closeMenu()}catch(c){console.warn("Error closing previous menu:",c)}o.activeMenu=g}};window.__neighborMenuManager=o;const i=$,e=r,d=D(!1),h=D(),s=D({top:0,left:0}),a=()=>{d.value=!1,document.removeEventListener("click",B,!0),document.removeEventListener("keydown",N),o.activeMenu===f&&(o.activeMenu=null)},f={closeMenu:a},b=()=>{a(),e("ping",i.neighbor)},v=()=>{a(),e("show-details",i.neighbor)},L=()=>{a(),e("delete",i.neighbor)},B=g=>{g.target.closest("[data-menu-container]")||a()},N=g=>{g.key==="Escape"&&a()},S=async()=>{if(!d.value&&h.value){o.setActiveMenu(f);const g=h.value.getBoundingClientRect(),c=window.innerWidth,T=144,F=c<1024,I=g.left+T>c-16;let y=g.left;F&&I&&(y=g.right-T),y=Math.max(8,y),s.value={top:g.bottom+4,left:y},d.value=!0,await Pt(),document.addEventListener("click",B,!0),document.addEventListener("keydown",N)}else a()};return te(()=>{a()}),(g,c)=>(k(),_("div",Xo,[t("button",{ref_key:"buttonRef",ref:h,onClick:S,class:C(["p-1 rounded hover:bg-stroke-subtle dark:hover:bg-white/10 transition-colors text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary/80",{"bg-background-mute dark:bg-stroke/10 text-content-primary dark:text-content-primary/80":d.value}]),"data-menu-container":""},c[0]||(c[0]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})],-1)]),2),(k(),Rt(jt,{to:"body"},[d.value?(k(),_("div",{key:0,class:"fixed w-36 bg-white dark:bg-surface-elevated backdrop-blur-lg border border-stroke-subtle dark:border-white/20 rounded-[15px] shadow-2xl z-[999999]",style:At({top:s.value.top+"px",left:s.value.left+"px"}),"data-menu-container":""},[t("div",{class:"py-2"},[t("button",{onClick:v,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-content-primary dark:text-content-primary hover:bg-primary/10 transition-colors border-b border-stroke-subtle dark:border-white/10"},c[1]||(c[1]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})],-1),t("span",{class:"font-medium"},"Details",-1)])),t("button",{onClick:b,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-content-primary dark:text-content-primary hover:bg-primary/10 transition-colors border-b border-stroke-subtle dark:border-white/10"},c[2]||(c[2]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0"})],-1),t("span",{class:"font-medium"},"Ping",-1)])),t("button",{onClick:L,class:"flex items-center gap-3 w-full px-4 py-3 text-sm text-accent-red hover:bg-accent-red/10 transition-colors"},c[3]||(c[3]=[t("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1),t("span",{class:"font-medium"},"Delete",-1)]))])],4)):P("",!0)]))]))}}),tr={class:"glass-card/30 backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[12px] p-6 shadow-sm dark:shadow-none"},er={class:"flex items-center justify-between mb-4"},or={class:"flex items-center gap-3"},rr={class:"text-content-primary dark:text-content-primary text-lg font-semibold"},nr={class:"bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-primary text-xs px-2 py-1 rounded-full"},sr={key:0,class:"text-content-muted dark:text-content-muted"},ar={key:0,class:"hidden lg:flex bg-background-mute dark:bg-surface-elevated/30 backdrop-blur rounded-lg border border-stroke-subtle dark:border-stroke/10 p-1"},ir={class:"hidden lg:block overflow-x-auto"},lr={class:"w-full"},dr={class:"bg-background-mute dark:bg-transparent"},cr={class:"flex items-center gap-1"},ur={class:"flex items-center gap-1"},pr={class:"flex items-center gap-1"},gr={class:"flex items-center gap-1"},mr={class:"flex items-center gap-1"},hr={class:"flex items-center gap-1"},br={class:"flex items-center gap-1"},xr={class:"flex items-center gap-1"},yr={class:"flex items-center gap-1"},vr={class:"bg-surface/50 dark:bg-transparent"},kr=["onMouseenter","onMouseleave"],fr=["onClick","title"],wr={key:0,class:"ml-1 text-xs"},_r={key:0,class:"flex items-center gap-3"},Cr={class:"text-content-secondary dark:text-content-muted"},Mr={class:"flex gap-1"},$r=["onClick"],Ar=["onClick"],Lr={key:1,class:"text-content-muted"},Tr={class:"flex items-center gap-2"},Er={class:"flex items-end gap-0.5"},Sr={class:"flex items-center gap-2"},Br=["title"],Nr=["title"],Fr={class:"lg:hidden space-y-3"},Dr=["onClick"],Pr={class:"flex items-center justify-between mb-3"},zr={class:"flex items-center gap-3"},Rr={class:"text-content-primary dark:text-content-primary font-medium text-base"},jr={class:"flex items-center gap-2"},Ir={class:"grid grid-cols-1 gap-3"},Ur={class:"grid grid-cols-2 gap-4"},Or=["onClick","title"],Hr={key:0,class:"ml-1 text-xs"},Vr={class:"flex items-center gap-2 justify-end"},Zr={class:"flex items-end gap-0.5"},Wr={class:"grid grid-cols-2 gap-4"},Qr={class:"flex items-center gap-2"},qr=["title"],Kr={class:"text-content-primary dark:text-content-primary text-sm block text-right"},Gr={key:0,class:"border-t border-white/10 pt-3"},Jr={class:"flex items-center justify-between"},Yr={class:"text-content-secondary dark:text-content-muted text-sm font-mono"},Xr={class:"flex gap-2"},tn=["onClick"],en=["onClick"],on={class:"grid grid-cols-3 gap-4 pt-3 border-t border-white/10"},rn={class:"text-center"},nn={class:"text-content-primary dark:text-content-primary text-sm font-medium"},sn={class:"text-center"},an={class:"text-content-primary dark:text-content-primary text-sm font-medium"},ln={class:"text-center"},dn=["title"],cn=bt({__name:"NeighborTable",props:{contactType:{},contactTypeKey:{},adverts:{},originalCount:{default:0},color:{},baseLatitude:{default:null},baseLongitude:{default:null},isCompactView:{type:Boolean,default:!1},isFirstTable:{type:Boolean,default:!1},showViewToggle:{type:Boolean,default:!1}},emits:["highlight-node","unhighlight-node","menu-ping","menu-delete","show-details","toggle-view"],setup($,{emit:r}){const o=D(null),{getSignalQuality:i}=Ut(),e=D("advert_count"),d=D("desc"),h=$,s=r,a=u=>new Date(u*1e3).toLocaleString(),f=u=>`${u.slice(0,4)}...${u.slice(-4)}`,b=u=>{switch(u){case 2:return{text:"Direct",bgColor:"bg-green-100 dark:bg-green-500/20",borderColor:"border-green-500 dark:border-green-400/30",textColor:"text-green-600 dark:text-green-400"};case 3:return{text:"Transport Direct",bgColor:"bg-green-100 dark:bg-green-600/20",borderColor:"border-green-600/40 dark:border-green-500/30",textColor:"text-green-700 dark:text-green-500"};case 1:return{text:"Flood",bgColor:"bg-yellow-100 dark:bg-yellow-500/20",borderColor:"border-yellow-500 dark:border-yellow-400/30",textColor:"text-yellow-600 dark:text-yellow-400"};case 0:return{text:"Transport Flood",bgColor:"bg-orange-100 dark:bg-orange-500/20",borderColor:"border-orange-500 dark:border-orange-400/30",textColor:"text-orange-600 dark:text-orange-400"};default:return{text:"Unknown",bgColor:"bg-gray-500/20",borderColor:"border-gray-400/30",textColor:"text-gray-400"}}},v=u=>u?`${u} dBm`:"N/A",L=u=>u?`${u} dB`:"N/A",B=(u,n,l,E)=>{const H=(l-u)*Math.PI/180,X=(E-n)*Math.PI/180,tt=Math.sin(H/2)*Math.sin(H/2)+Math.cos(u*Math.PI/180)*Math.cos(l*Math.PI/180)*Math.sin(X/2)*Math.sin(X/2);return 6371*(2*Math.atan2(Math.sqrt(tt),Math.sqrt(1-tt)))},N=u=>h.baseLatitude===null||h.baseLongitude===null||u.latitude===null||u.longitude===null?"N/A":`${B(h.baseLatitude,h.baseLongitude,u.latitude,u.longitude).toFixed(1)} km`,S=async u=>{try{return await navigator.clipboard.writeText(u),!0}catch{const n=document.createElement("textarea");return n.value=u,document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),!0}},g=u=>{const n=Date.now(),l=u*1e3,E=n-l,j=Math.floor(E/1e3),H=Math.floor(j/60),X=Math.floor(H/60),tt=Math.floor(X/24);return j<60?`${j}s ago`:H<60?`${H}m ago`:X<24?`${X}h ago`:`${tt}d ago`},c=u=>{const n=Date.now(),l=u*1e3,E=n-l,j=Math.floor(E/(1e3*60*60));return j<1?{color:"text-green-600 dark:text-green-400"}:j<26?{color:"text-yellow-600 dark:text-yellow-400"}:{color:"text-red-600 dark:text-red-400"}},T=async(u,n)=>{const l=`${u.toFixed(6)}, ${n.toFixed(6)}`;await S(l)},F=(u,n)=>{const l=`https://www.google.com/maps?q=${u},${n}`;window.open(l,"_blank")},I=async u=>{await S(u),o.value=u,setTimeout(()=>{o.value=null},2e3)},y=u=>{const n=i(u);return{bars:n.bars,color:n.color}},p=()=>h.isCompactView?"py-2 px-2":"py-4 px-3",U=()=>{s("toggle-view")},Y=u=>{s("highlight-node",u)},ot=u=>{s("unhighlight-node",u)},lt=u=>{s("menu-ping",u)},at=u=>{s("show-details",u)},yt=u=>{s("menu-delete",u)},nt=u=>{e.value===u?d.value=d.value==="asc"?"desc":"asc":(e.value=u,d.value=typeof h.adverts[0]?.[u]=="number"?"desc":"asc")},A=q(()=>e.value?[...h.adverts].sort((u,n)=>{const l=u[e.value],E=n[e.value];if(l==null)return 1;if(E==null)return-1;let j=0;return typeof l=="string"&&typeof E=="string"?j=l.localeCompare(E):typeof l=="number"&&typeof E=="number"?j=l-E:typeof l=="boolean"&&typeof E=="boolean"&&(j=l===E?0:l?1:-1),d.value==="asc"?j:-j}):h.adverts);return(u,n)=>(k(),_("div",tr,[t("div",er,[t("div",or,[t("div",{class:"w-3 h-3 rounded-full border border-white/20",style:At({backgroundColor:u.color})},null,4),t("h3",rr,w(u.contactType),1),t("span",nr,[et(w(u.adverts.length)+" ",1),u.originalCount>0&&u.adverts.lengthnt("node_name")),class:C(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${p().split(" ")[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[t("div",cr,[n[12]||(n[12]=et(" Node Name ",-1)),e.value==="node_name"?(k(),_("svg",{key:0,class:C(["w-3 h-3",d.value==="asc"?"":"rotate-180"]),fill:"currentColor",viewBox:"0 0 20 20"},n[11]||(n[11]=[t("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)]),2)):P("",!0)])],2),t("th",{onClick:n[1]||(n[1]=l=>nt("pubkey")),class:C(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${p().split(" ")[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[t("div",ur,[n[14]||(n[14]=et(" Public Key ",-1)),e.value==="pubkey"?(k(),_("svg",{key:0,class:C(["w-3 h-3",d.value==="asc"?"":"rotate-180"]),fill:"currentColor",viewBox:"0 0 20 20"},n[13]||(n[13]=[t("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)]),2)):P("",!0)])],2),t("th",{class:C(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${p().split(" ")[1]} border-b border-stroke-subtle dark:border-white/5`)},"Location",2),t("th",{class:C(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${p().split(" ")[1]} border-b border-stroke-subtle dark:border-white/5`)},"Distance",2),t("th",{onClick:n[2]||(n[2]=l=>nt("route_type")),class:C(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${p().split(" ")[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[t("div",pr,[n[16]||(n[16]=et(" Route Type ",-1)),e.value==="route_type"?(k(),_("svg",{key:0,class:C(["w-3 h-3",d.value==="asc"?"":"rotate-180"]),fill:"currentColor",viewBox:"0 0 20 20"},n[15]||(n[15]=[t("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)]),2)):P("",!0)])],2),t("th",{onClick:n[3]||(n[3]=l=>nt("zero_hop")),class:C(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${p().split(" ")[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[t("div",gr,[n[18]||(n[18]=et(" Zero Hop ",-1)),e.value==="zero_hop"?(k(),_("svg",{key:0,class:C(["w-3 h-3",d.value==="asc"?"":"rotate-180"]),fill:"currentColor",viewBox:"0 0 20 20"},n[17]||(n[17]=[t("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)]),2)):P("",!0)])],2),t("th",{onClick:n[4]||(n[4]=l=>nt("rssi")),class:C(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${p().split(" ")[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[t("div",mr,[n[20]||(n[20]=et(" RSSI ",-1)),e.value==="rssi"?(k(),_("svg",{key:0,class:C(["w-3 h-3",d.value==="asc"?"":"rotate-180"]),fill:"currentColor",viewBox:"0 0 20 20"},n[19]||(n[19]=[t("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)]),2)):P("",!0)])],2),t("th",{onClick:n[5]||(n[5]=l=>nt("snr")),class:C(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${p().split(" ")[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[t("div",hr,[n[22]||(n[22]=et(" SNR ",-1)),e.value==="snr"?(k(),_("svg",{key:0,class:C(["w-3 h-3",d.value==="asc"?"":"rotate-180"]),fill:"currentColor",viewBox:"0 0 20 20"},n[21]||(n[21]=[t("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)]),2)):P("",!0)])],2),t("th",{onClick:n[6]||(n[6]=l=>nt("last_seen")),class:C(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${p().split(" ")[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[t("div",br,[n[24]||(n[24]=et(" Last Seen ",-1)),e.value==="last_seen"?(k(),_("svg",{key:0,class:C(["w-3 h-3",d.value==="asc"?"":"rotate-180"]),fill:"currentColor",viewBox:"0 0 20 20"},n[23]||(n[23]=[t("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)]),2)):P("",!0)])],2),t("th",{onClick:n[7]||(n[7]=l=>nt("first_seen")),class:C(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${p().split(" ")[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[t("div",xr,[n[26]||(n[26]=et(" First Seen ",-1)),e.value==="first_seen"?(k(),_("svg",{key:0,class:C(["w-3 h-3",d.value==="asc"?"":"rotate-180"]),fill:"currentColor",viewBox:"0 0 20 20"},n[25]||(n[25]=[t("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)]),2)):P("",!0)])],2),t("th",{onClick:n[8]||(n[8]=l=>nt("advert_count")),class:C(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${p().split(" ")[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[t("div",yr,[n[28]||(n[28]=et(" Advert Count ",-1)),e.value==="advert_count"?(k(),_("svg",{key:0,class:C(["w-3 h-3",d.value==="asc"?"":"rotate-180"]),fill:"currentColor",viewBox:"0 0 20 20"},n[27]||(n[27]=[t("path",{"fill-rule":"evenodd",d:"M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z","clip-rule":"evenodd"},null,-1)]),2)):P("",!0)])],2)])]),t("tbody",vr,[(k(!0),_(ct,null,gt(A.value,l=>(k(),_("tr",{key:l.id,class:"hover:bg-background-mute/50 dark:hover:bg-white/5 transition-colors",onMouseenter:E=>Y(l.pubkey),onMouseleave:E=>ot(l.pubkey)},[t("td",{class:C(p())},[it(Jt,{neighbor:l,onPing:lt,onShowDetails:at,onDelete:yt},null,8,["neighbor"])],2),t("td",{class:C(`${p()} text-content-primary dark:text-content-primary text-sm`)},w(l.node_name||"Unknown"),3),t("td",{class:C(`${p()} text-content-primary dark:text-content-primary text-sm font-mono`)},[t("button",{onClick:E=>I(l.pubkey),class:C(["text-content-primary dark:text-content-primary hover:text-primary-light transition-colors cursor-pointer underline underline-offset-2 decoration-gray-400 dark:decoration-white/30 hover:decoration-primary-light/60",o.value===l.pubkey?"text-green-600 dark:text-green-400 decoration-green-400/60":""]),title:o.value===l.pubkey?"Copied!":"Click to copy full public key"},[et(w(f(l.pubkey))+" ",1),o.value===l.pubkey?(k(),_("span",wr,"✓")):P("",!0)],10,fr)],2),t("td",{class:C(`${p()} text-content-primary dark:text-content-primary text-sm`)},[l.latitude!==null&&l.longitude!==null?(k(),_("div",_r,[t("span",Cr,w(l.latitude.toFixed(4))+", "+w(l.longitude.toFixed(4)),1),t("div",Mr,[t("button",{onClick:E=>T(l.latitude,l.longitude),class:"text-content-muted dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors cursor-pointer",title:"Copy coordinates to clipboard"},n[29]||(n[29]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),t("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,$r),t("button",{onClick:E=>F(l.latitude,l.longitude),class:"text-white/60 hover:text-blue-600 dark:text-blue-400 transition-colors cursor-pointer",title:"Open in Google Maps"},n[30]||(n[30]=[t("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),t("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,Ar)])])):(k(),_("span",Lr,"Unknown"))],2),t("td",{class:C(`${p()} text-content-primary dark:text-content-primary text-sm`)},w(N(l)),3),t("td",{class:C(`${p()} text-content-primary dark:text-content-primary text-sm`)},[t("span",{class:C(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",b(l.route_type).bgColor,b(l.route_type).borderColor,b(l.route_type).textColor])},w(b(l.route_type).text),3)],2),t("td",{class:C(`${p()} text-content-primary dark:text-content-primary text-sm`)},[t("span",{class:C(["inline-block px-2 py-1 rounded-full text-xs border transition-colors",l.zero_hop?"bg-green-100 dark:bg-green-500/20 border-green-500 dark:border-green-400/30 text-green-600 dark:text-green-400":"bg-orange-100 dark:bg-orange-500/20 border-orange-500 dark:border-orange-400/30 text-orange-600 dark:text-orange-400"])},w(l.zero_hop?"Zero Hop":"Multi-Hop"),3)],2),t("td",{class:C(`${p()} text-content-primary dark:text-content-primary text-sm`)},[t("div",Tr,[t("div",Er,[(k(),_(ct,null,gt(5,E=>t("div",{key:E,class:C(["w-1 transition-colors",E<=y(l.rssi).bars?y(l.rssi).color:"text-gray-600"]),style:At({height:`${4+E*2}px`})},n[31]||(n[31]=[t("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),t("span",{class:C(y(l.rssi).color)},w(v(l.rssi)),3)])],2),t("td",{class:C(`${p()} text-content-primary dark:text-content-primary text-sm`)},w(L(l.snr)),3),t("td",{class:C(`${p()} text-content-primary dark:text-content-primary text-sm`)},[t("div",Sr,[t("div",{class:C(["w-2 h-2 rounded-full",c(l.last_seen).color==="text-green-600 dark:text-green-400"?"bg-green-400":"",c(l.last_seen).color==="text-yellow-600 dark:text-yellow-400"?"bg-yellow-400":"",c(l.last_seen).color==="text-red-600 dark:text-red-400"?"bg-red-400":""])},null,2),t("span",{class:C([c(l.last_seen).color,"cursor-help"]),title:a(l.last_seen)},w(g(l.last_seen)),11,Br)])],2),t("td",{class:C(`${p()} text-content-primary dark:text-content-primary text-sm`)},[t("span",{title:a(l.first_seen),class:"cursor-help"},w(g(l.first_seen)),9,Nr)],2),t("td",{class:C(`${p()} text-content-primary dark:text-content-primary text-sm text-center`)},w(l.advert_count),3)],40,kr))),128))])])]),t("div",Fr,[(k(!0),_(ct,null,gt(A.value,l=>(k(),_("div",{key:l.id,class:"bg-surface/50 dark:bg-transparent border border-stroke-subtle dark:border-white/10 rounded-lg p-4 hover:bg-background-mute/50 dark:hover:bg-white/5 transition-colors",onClick:E=>Y(l.pubkey)},[t("div",Pr,[t("div",zr,[t("h4",Rr,w(l.node_name||"Unknown Node"),1),t("div",jr,[t("span",{class:C(["inline-block px-2 py-1 rounded-full text-xs border",b(l.route_type).bgColor,b(l.route_type).borderColor,b(l.route_type).textColor])},w(b(l.route_type).text),3),t("span",{class:C(["inline-block px-2 py-1 rounded-full text-xs border",l.zero_hop?"bg-green-100 dark:bg-green-500/20 border-green-500 dark:border-green-400/30 text-green-600 dark:text-green-400":"bg-orange-100 dark:bg-orange-500/20 border-orange-500 dark:border-orange-400/30 text-orange-600 dark:text-orange-400"])},w(l.zero_hop?"Zero Hop":"Multi-Hop"),3)])]),it(Jt,{neighbor:l,onPing:lt,onShowDetails:at,onDelete:yt},null,8,["neighbor"])]),t("div",Ir,[t("div",Ur,[t("div",null,[n[32]||(n[32]=t("div",{class:"text-content-muted text-xs mb-1"},"Public Key",-1)),t("button",{onClick:E=>I(l.pubkey),class:C(["text-content-primary dark:text-content-primary hover:text-primary-light transition-colors cursor-pointer font-mono text-sm underline underline-offset-2 decoration-gray-400 dark:decoration-white/30 hover:decoration-primary-light/60 break-all",o.value===l.pubkey?"text-green-600 dark:text-green-400 decoration-green-400/60":""]),title:o.value===l.pubkey?"Copied!":"Click to copy full public key"},[et(w(f(l.pubkey))+" ",1),o.value===l.pubkey?(k(),_("span",Hr,"✓")):P("",!0)],10,Or)]),t("div",null,[n[34]||(n[34]=t("div",{class:"text-content-muted text-xs mb-1"},"Signal",-1)),t("div",Vr,[t("div",Zr,[(k(),_(ct,null,gt(5,E=>t("div",{key:E,class:C(["w-1.5 transition-colors",E<=y(l.rssi).bars?y(l.rssi).color:"text-gray-600"]),style:At({height:`${6+E*2}px`})},n[33]||(n[33]=[t("div",{class:"w-full h-full bg-current rounded-sm"},null,-1)]),6)),64))]),t("span",{class:C(`${y(l.rssi).color} text-sm font-medium`)},w(v(l.rssi)),3)])])]),t("div",Wr,[t("div",null,[n[35]||(n[35]=t("div",{class:"text-content-muted text-xs mb-1"},"Last Seen",-1)),t("div",Qr,[t("div",{class:C(["w-2 h-2 rounded-full",c(l.last_seen).color==="text-green-600 dark:text-green-400"?"bg-green-400":"",c(l.last_seen).color==="text-yellow-600 dark:text-yellow-400"?"bg-yellow-400":"",c(l.last_seen).color==="text-red-600 dark:text-red-400"?"bg-red-400":""])},null,2),t("span",{class:C(`${c(l.last_seen).color} text-sm`),title:a(l.last_seen)},w(g(l.last_seen)),11,qr)])]),t("div",null,[n[36]||(n[36]=t("div",{class:"text-content-muted text-xs mb-1"},"Distance",-1)),t("span",Kr,w(N(l)),1)])]),l.latitude!==null&&l.longitude!==null?(k(),_("div",Gr,[n[39]||(n[39]=t("div",{class:"text-content-muted text-xs mb-1"},"Location",-1)),t("div",Jr,[t("span",Yr,w(l.latitude.toFixed(4))+", "+w(l.longitude.toFixed(4)),1),t("div",Xr,[t("button",{onClick:E=>T(l.latitude,l.longitude),class:"text-content-muted dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors p-2 hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-lg",title:"Copy coordinates"},n[37]||(n[37]=[t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2",stroke:"currentColor","stroke-width":"2"}),t("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1",stroke:"currentColor","stroke-width":"2"})],-1)]),8,tn),t("button",{onClick:E=>F(l.latitude,l.longitude),class:"text-white/60 hover:text-blue-600 dark:text-blue-400 transition-colors p-2 hover:bg-white/10 rounded-lg",title:"Open in Maps"},n[38]||(n[38]=[t("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("path",{d:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z",stroke:"currentColor","stroke-width":"2"}),t("circle",{cx:"12",cy:"10",r:"3",stroke:"currentColor","stroke-width":"2"})],-1)]),8,en)])])])):P("",!0),t("div",on,[t("div",rn,[n[40]||(n[40]=t("div",{class:"text-content-muted text-xs mb-1"},"SNR",-1)),t("span",nn,w(L(l.snr)),1)]),t("div",sn,[n[41]||(n[41]=t("div",{class:"text-content-muted text-xs mb-1"},"Adverts",-1)),t("span",an,w(l.advert_count),1)]),t("div",ln,[n[42]||(n[42]=t("div",{class:"text-content-muted text-xs mb-1"},"First Seen",-1)),t("span",{class:"text-content-primary dark:text-content-primary text-sm",title:a(l.first_seen)},w(g(l.first_seen)),9,dn)])])])],8,Dr))),128))])]))}}),un={class:"space-y-6"},pn={key:0,class:"flex items-center justify-center py-12"},gn={key:1,class:"bg-red-50 dark:bg-accent-red/10 border border-red-300 dark:border-accent-red/20 rounded-[15px] p-6"},mn={class:"flex items-center gap-3"},hn={class:"text-red-500 dark:text-accent-red/80 text-sm"},bn={key:0,class:""},xn={class:"flex items-center justify-between"},yn={class:"flex items-center gap-3"},vn={class:"hidden lg:flex bg-background-mute dark:bg-surface-elevated/30 backdrop-blur rounded-lg border border-stroke-subtle dark:border-stroke/10 mb p-1"},kn={class:"flex items-center gap-2"},fn={key:0,class:"ml-1 bg-accent-cyan/20 text-accent-cyan border border-accent-cyan/30 text-xs px-1.5 py-0.5 rounded-full font-medium"},wn={class:"bg-background dark:bg-background/30 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4 mt-4 space-y-4"},_n={class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Cn={key:1,class:"text-center py-12"},Mn={key:2,class:"text-center py-12"},Bn=bt({name:"NeighborsView",__name:"Neighbors",setup($){const r=Yt(),o={0:"Unknown",1:"Chat Node",2:"Repeater",3:"Room Server",4:"Hybrid Node"},i={0:"#6b7280",1:"#60a5fa",2:"#34d399",3:"#a855f7",4:"#f59e0b"},e=D({}),d=D(!0),h=D(null),s=D(_t("neighbors_compactView",!1)),a=D(_t("neighbors_showMapLegend",typeof window<"u"?window.innerWidth>=1024:!0)),f=D(_t("neighbors_showFilters",!1)),b=D(_t("neighbors_filters",{zeroHop:"all",routeType:"all",searchText:""}));ht(s,x=>Ct("neighbors_compactView",x)),ht(a,x=>Ct("neighbors_showMapLegend",x)),ht(f,x=>Ct("neighbors_showFilters",x)),ht(b,x=>Ct("neighbors_filters",x),{deep:!0});const v=D(!1),L=D(!1),B=D(!1),N=D(null),S=D(null),g=D(null),c=D(null),T=D(!1),F=D(null),I=q(()=>{if(!c.value)return null;const x=c.value;return{id:x.id,pubkey:x.pubkey,node_name:x.node_name,contact_type:x.contact_type,latitude:x.latitude,longitude:x.longitude,rssi:x.rssi,snr:x.snr,route_type:x.route_type,last_seen:x.last_seen,first_seen:x.first_seen,advert_count:x.advert_count,timestamp:x.timestamp,is_repeater:x.is_repeater,is_new_neighbor:x.is_new_neighbor,zero_hop:x.zero_hop}}),y=q(()=>r.stats?.config?.repeater?.latitude),p=q(()=>r.stats?.config?.repeater?.longitude),U=x=>x.filter(m=>{if(b.value.zeroHop!=="all"){const M=m.zero_hop;if(b.value.zeroHop==="true"&&!M||b.value.zeroHop==="false"&&M)return!1}if(b.value.routeType!=="all"){const M=m.route_type;if(b.value.routeType==="direct"&&M!==2||b.value.routeType==="transport_direct"&&M!==3||b.value.routeType==="flood"&&M!==1||b.value.routeType==="transport_flood"&&M!==0)return!1}if(b.value.searchText){const M=b.value.searchText.toLowerCase(),z=m.node_name?.toLowerCase()||"",Z=m.pubkey.toLowerCase();if(!z.includes(M)&&!Z.includes(M))return!1}return!0}),Y=()=>{b.value={zeroHop:"all",routeType:"all",searchText:""}},ot=q(()=>b.value.zeroHop!=="all"||b.value.routeType!=="all"||b.value.searchText!==""),lt=q(()=>{const x={};for(const[m,M]of Object.entries(e.value))x[m]=U(M);return x}),at=q(()=>Object.entries(o).filter(([x])=>lt.value[x]?.length>0).sort(([x],[m])=>parseInt(x)-parseInt(m))),yt=q(()=>Object.values(e.value).flat().filter(x=>{const m=x.latitude,M=x.longitude;return m!=null&&m!==0&&M!==null&&M!==void 0&&M!==0&&typeof m=="number"&&typeof M=="number"&&!isNaN(m)&&!isNaN(M)&&x.zero_hop===!0})),nt=async x=>{try{const m=await Et.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(x)}&hours=168`);return m.success&&Array.isArray(m.data)?m.data:[]}catch(m){return console.error(`Error fetching adverts for contact type ${x}:`,m),[]}},A=async()=>{d.value=!0,h.value=null;try{e.value={};for(const[x,m]of Object.entries(o)){const M=await nt(m);M.length>0&&(e.value[x]=M)}}catch(x){console.error("Error loading adverts:",x),h.value=x instanceof Error?x.message:"Failed to load neighbor data"}finally{d.value=!1}},u=D(),n=x=>{u.value?.highlightNode(x)},l=x=>{u.value?.unhighlightNode(x)},E=async x=>{const m=x;N.value=null,S.value=null,B.value=!0,g.value=m.node_name||"Unknown Node",L.value=!0;try{const M=r.stats?.config?.mesh?.path_hash_mode??0,Z=(M===2?3:M===1?2:1)*2,K=`0x${parseInt(m.pubkey.substring(0,Z),16).toString(16).padStart(Z,"0")}`;console.log(`Pinging neighbor ${m.node_name||"Unknown"} (${K}, path_hash_mode=${M})...`);const W=await Et.pingNeighbor(K,10);W.success&&W.data?(N.value=W.data,console.log("Ping successful:",W.data)):(S.value=W.error||"Unknown error occurred",console.error("Failed to ping neighbor:",W.error))}catch(M){console.error("Error pinging neighbor:",M),S.value=M instanceof Error?M.message:"Unknown error occurred"}finally{B.value=!1}},j=()=>{L.value=!1,N.value=null,S.value=null,g.value=null},H=x=>{c.value=x,v.value=!0},X=x=>{F.value=x,T.value=!0},tt=()=>{T.value=!1,F.value=null},R=()=>{v.value=!1,c.value=null},V=async x=>{try{await Et.deleteAdvert(x),await A(),R()}catch(m){console.error("Error deleting neighbor:",m)}};return Xt(async()=>{await A()}),(x,m)=>(k(),_("div",un,[d.value?(k(),_("div",pn,m[7]||(m[7]=[t("div",{class:"text-center"},[t("div",{class:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4"}),t("p",{class:"text-content-secondary dark:text-content-muted"},"Loading neighbor data...")],-1)]))):h.value?(k(),_("div",gn,[t("div",mn,[m[9]||(m[9]=t("svg",{class:"w-5 h-5 text-red-600 dark:text-accent-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z"})],-1)),t("div",null,[m[8]||(m[8]=t("h3",{class:"text-red-600 dark:text-accent-red font-medium"},"Error Loading Neighbors",-1)),t("p",hn,w(h.value),1)])])])):(k(),_(ct,{key:2},[it(Yo,{ref_key:"networkMapRef",ref:u,adverts:yt.value,"base-latitude":y.value,"base-longitude":p.value,"show-legend":a.value,"onUpdate:showLegend":m[0]||(m[0]=M=>a.value=M)},null,8,["adverts","base-latitude","base-longitude","show-legend"]),Object.keys(e.value).length>0?(k(),_("div",bn,[t("div",xn,[m[14]||(m[14]=t("span",{class:"text-content-primary dark:text-content-primary text-lg font-semibold"},null,-1)),t("div",yn,[t("div",vn,[t("button",{onClick:m[1]||(m[1]=M=>s.value=!1),class:C(["p-2 rounded-md transition-colors",s.value?"text-content-secondary dark:text-content-muted hover:text-primary hover:bg-primary/10":"bg-primary/20 text-primary border border-primary/30"]),title:"Comfortable view"},m[10]||(m[10]=[t("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("rect",{x:"3",y:"3",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"}),t("rect",{x:"3",y:"12",width:"18",height:"6",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2),t("button",{onClick:m[2]||(m[2]=M=>s.value=!0),class:C(["p-2 rounded-md transition-colors",s.value?"bg-primary/20 text-primary border border-primary/30":"text-content-secondary dark:text-content-muted hover:text-primary hover:bg-primary/10"]),title:"Compact view"},m[11]||(m[11]=[t("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t("rect",{x:"3",y:"3",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),t("rect",{x:"3",y:"10",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"}),t("rect",{x:"3",y:"17",width:"18",height:"4",rx:"2",stroke:"currentColor","stroke-width":"2"})],-1)]),2)]),t("div",kn,[t("button",{onClick:m[3]||(m[3]=M=>f.value=!f.value),class:C(["px-3 py-1.5 text-xs rounded-lg transition-colors border",ot.value?"bg-primary/20 text-primary border-primary/30":"bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-primary border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-white/20"])},[m[12]||(m[12]=t("svg",{class:"w-4 h-4 inline mr-1",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707v6.586a1 1 0 01-1.447.894l-4-2A1 1 0 717 18.586V13.414a1 1 0 00-.293-.707L.293 6.293A1 1 0 010 5.586V3a1 1 0 011-1z"})],-1)),m[13]||(m[13]=et(" Filters ",-1)),ot.value?(k(),_("span",fn," Active ")):P("",!0)],2),ot.value?(k(),_("button",{key:0,onClick:Y,class:"px-3 py-1.5 text-xs rounded-lg bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-primary border border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-white/20 transition-colors"}," Clear Filters ")):P("",!0)])])]),wt(t("div",wn,[t("div",_n,[t("div",null,[m[16]||(m[16]=t("label",{class:"block text-xs font-medium text-content-secondary dark:text-content-muted mb-1"},"Zero Hop",-1)),wt(t("select",{"onUpdate:modelValue":m[4]||(m[4]=M=>b.value.zeroHop=M),class:"w-full bg-surface dark:bg-surface/50 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:border-primary/50 focus:outline-none"},m[15]||(m[15]=[t("option",{value:"all"},"All Nodes",-1),t("option",{value:"true"},"Zero Hop Only",-1),t("option",{value:"false"},"Multi-Hop Only",-1)]),512),[[Wt,b.value.zeroHop]])]),t("div",null,[m[18]||(m[18]=t("label",{class:"block text-xs font-medium text-content-secondary dark:text-content-muted mb-1"},"Route Type",-1)),wt(t("select",{"onUpdate:modelValue":m[5]||(m[5]=M=>b.value.routeType=M),class:"w-full bg-surface dark:bg-surface/50 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:border-primary/50 focus:outline-none"},m[17]||(m[17]=[ft('',5)]),512),[[Wt,b.value.routeType]])]),t("div",null,[m[19]||(m[19]=t("label",{class:"block text-xs font-medium text-content-secondary dark:text-content-muted mb-1"},"Search",-1)),wt(t("input",{"onUpdate:modelValue":m[6]||(m[6]=M=>b.value.searchText=M),type:"text",placeholder:"Node name or pubkey...",class:"w-full bg-surface dark:bg-surface/50 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:border-primary/50 focus:outline-none placeholder-gray-400 dark:placeholder-white/40"},null,512),[[le,b.value.searchText]])])])],512),[[ie,f.value]])])):P("",!0),(k(!0),_(ct,null,gt(at.value,([M,z])=>(k(),_("div",{key:M,class:"space-y-6"},[it(cn,{"contact-type":z,"contact-type-key":M,adverts:lt.value[M],"original-count":e.value[M]?.length||0,color:i[parseInt(M)],"base-latitude":y.value,"base-longitude":p.value,"is-compact-view":s.value,"is-first-table":!1,"show-view-toggle":!1,onHighlightNode:n,onUnhighlightNode:l,onMenuPing:E,onMenuDelete:H,onShowDetails:X},null,8,["contact-type","contact-type-key","adverts","original-count","color","base-latitude","base-longitude","is-compact-view"])]))),128)),at.value.length===0&&Object.keys(e.value).length===0?(k(),_("div",Cn,[m[20]||(m[20]=ft('

No Neighbors Found

No mesh neighbors have been discovered in your area yet.

',3)),t("button",{onClick:A,class:"mt-4 px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Refresh ")])):at.value.length===0&&ot.value?(k(),_("div",Mn,[m[21]||(m[21]=ft('

No neighbors match your filters

Try adjusting your filter criteria to see more results.

',3)),t("button",{onClick:Y,class:"px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors"}," Clear Filters ")])):P("",!0)],64)),it(be,{show:v.value,neighbor:I.value,onClose:R,onDelete:V},null,8,["show","neighbor"]),it(Je,{show:L.value,"node-name":g.value,result:N.value,error:S.value,loading:B.value,onClose:j},null,8,["show","node-name","result","error","loading"]),it(Io,{"is-open":T.value,neighbor:F.value,"base-latitude":y.value,"base-longitude":p.value,onClose:tt},null,8,["is-open","neighbor","base-latitude","base-longitude"])]))}});export{Bn as default}; diff --git a/repeater/web/html/assets/Neighbors-tK0iZybD.js b/repeater/web/html/assets/Neighbors-tK0iZybD.js new file mode 100644 index 0000000..5067e19 --- /dev/null +++ b/repeater/web/html/assets/Neighbors-tK0iZybD.js @@ -0,0 +1,65 @@ +import{r as e}from"./chunk-DECur_0Z.js";import{A as t,C as n,E as r,S as i,b as a,c as o,dt as s,f as c,g as l,i as u,j as d,k as f,l as p,lt as m,m as h,o as g,p as _,r as v,s as y,u as b,ut as x,w as S,z as C}from"./runtime-core.esm-bundler-IofF4kUm.js";import{t as w}from"./api-CrUX-ZnK.js";import{t as T}from"./system-CCY_Ibb-.js";import{t as E}from"./_plugin-vue_export-helper-V-yks4gF.js";import{d as D,f as O,m as k,s as A,u as j}from"./index-CPWfwDmA.js";import{t as M}from"./leaflet-src-BtX0-WJ4.js";/* empty css */import{n as N,t as P}from"./preferences-N3Pls1rF.js";import{t as F}from"./useSignalQuality-hIA9BjQx.js";var I={class:`bg-gray-50 dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4 mb-6`},L={class:`flex items-center gap-3`},R={class:`flex-1 min-w-0`},z={class:`text-content-primary dark:text-content-primary font-medium truncate`},B={class:`text-content-secondary dark:text-content-muted text-sm font-mono`},V={key:0,class:`text-white/50 text-xs`},H={key:1,class:`text-white/50 text-xs`},U=l({__name:`DeleteNeighborModal`,props:{show:{type:Boolean},neighbor:{}},emits:[`close`,`delete`],setup(e,{emit:t}){let n=e,r=t,i=()=>{n.neighbor&&(r(`delete`,n.neighbor.id),a())},a=()=>{r(`close`)},o=e=>{e.target===e.currentTarget&&a()};return(t,n)=>e.show&&e.neighbor?(S(),b(`div`,{key:0,onClick:o,class:`fixed inset-0 bg-black/80 backdrop-blur-lg z-[99999] flex items-center justify-center p-4`,style:{"backdrop-filter":`blur(8px) saturate(180%)`,position:`fixed`,top:`0`,left:`0`,right:`0`,bottom:`0`}},[y(`div`,{class:`bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-6 w-full max-w-md border border-stroke-subtle dark:border-white/10`,onClick:n[0]||=k(()=>{},[`stop`])},[y(`div`,{class:`flex items-center gap-3 mb-6`},[n[2]||=y(`svg`,{class:`w-6 h-6 text-accent-red`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z`})],-1),n[3]||=y(`div`,null,[y(`h3`,{class:`text-xl font-semibold text-content-primary dark:text-content-primary`},` Delete Neighbor `),y(`p`,{class:`text-content-secondary dark:text-content-muted text-sm mt-1`},` Are you sure you want to delete this neighbor? `)],-1),y(`button`,{onClick:a,class:`ml-auto text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors`},[...n[1]||=[y(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),y(`div`,I,[y(`div`,L,[y(`div`,R,[y(`div`,z,s(e.neighbor?.node_name||e.neighbor?.long_name||e.neighbor?.short_name||`Unknown`),1),y(`div`,B,` ID: `+s(e.neighbor?.node_num_hex||e.neighbor?.node_num||e.neighbor?.id||`N/A`),1),e.neighbor?.contact_type?(S(),b(`div`,V,s(e.neighbor.contact_type),1)):p(``,!0),e.neighbor?.hw_model?(S(),b(`div`,H,s(e.neighbor.hw_model),1)):p(``,!0)])])]),n[4]||=y(`div`,{class:`bg-accent-red/10 border border-accent-red/30 rounded-lg p-4 mb-6`},[y(`div`,{class:`flex items-center gap-2 text-accent-red text-sm`},[y(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})]),y(`span`,null,`This action cannot be undone`)])],-1),y(`div`,{class:`flex gap-3`},[y(`button`,{onClick:a,class:`flex-1 px-4 py-3 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/20 text-content-primary dark:text-content-primary rounded-lg transition-colors`},` Cancel `),y(`button`,{onClick:i,class:`flex-1 px-4 py-3 bg-accent-red/20 hover:bg-accent-red/30 border border-accent-red/50 text-accent-red rounded-lg transition-colors font-medium`},` Delete `)])])])):p(``,!0)}}),W={class:`bg-gradient-to-r from-primary/20 to-accent-cyan/20 border-b border-stroke-subtle dark:border-stroke/10 px-6 py-4`},G={class:`flex items-center justify-between`},K={class:`flex items-center gap-3`},ee={key:0,class:`text-sm text-content-secondary dark:text-content-muted`},te={class:`p-6`},q={key:0,class:`text-center py-8`},ne={key:1,class:`text-center py-8`},re={class:`text-content-secondary dark:text-content-muted text-sm`},ie={key:2,class:`space-y-4`},ae={class:`bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4`},oe={class:`flex items-center justify-between mb-2`},se={class:`flex items-baseline gap-2`},ce={class:`text-3xl font-bold text-content-primary dark:text-content-primary`},le={class:`grid grid-cols-2 gap-3`},ue={class:`bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4`},de={class:`flex items-center gap-2 mb-2`},fe={class:`flex gap-0.5`},pe={class:`flex items-baseline gap-1`},me={class:`text-xl font-bold text-content-primary dark:text-content-primary`},he={class:`bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4`},ge={class:`flex items-baseline gap-1`},_e={class:`text-xl font-bold text-content-primary dark:text-content-primary`},ve={key:0,class:`flex items-start gap-3 bg-amber-500/10 border border-amber-500/30 rounded-[12px] p-3`},ye={class:`text-xs leading-relaxed`},be={class:`font-semibold text-amber-600 dark:text-amber-400 mb-0.5`},xe={class:`bg-background-mute dark:bg-background/50 border border-stroke-subtle dark:border-stroke/10 rounded-[15px] p-4`},Se={class:`relative`},Ce={class:`flex items-center gap-2 overflow-x-auto pb-2`},we={key:0,class:`relative flex items-center`},Te={key:0,class:`absolute left-1/2 -translate-x-1/2 animate-pulse`},Ee={class:`text-content-muted dark:text-content-muted text-xs mt-2 flex items-center justify-between`},De={key:0,class:`text-cyan-500 dark:text-primary animate-pulse`},Oe={class:`flex items-center justify-between text-xs text-content-muted dark:text-content-muted pt-2`},ke=E(l({__name:`PingResultModal`,props:{show:{type:Boolean},nodeName:{default:null},result:{default:null},error:{default:null},loading:{type:Boolean,default:!1}},emits:[`close`],setup(e,{emit:n}){let i=e,a=n,c=T(),{getSignalQuality:l}=F(),d=C(0),_=C(!1),x=g(()=>{let e=c.stats?.config?.radio?.spreading_factor??7,t=c.stats?.config?.radio?.bandwidth??125,n=c.stats?.config?.radio?.coding_rate??5;return 2**e/t*(8+4.25*(n-4)+20)}),w=g(()=>{if(!i.result)return{color:`text-gray-400`,label:`Unknown`};let e=i.result.rtt_ms,t=x.value,n=i.result.path.length,r=2*t*n+500*n;return e{if(!i.result)return{bars:0,color:`text-gray-400`};let e=l(i.result.rssi);return{bars:e.bars,color:e.color}}),D=g(()=>{if(!i.result)return 0;if(i.result.path_hash_mode!==void 0)return i.result.path_hash_mode;let e=i.result.path.reduce((e,t)=>{let n=t.replace(/^0x/i,``);return Math.max(e,n.length)},0);return e>4?2:e>2?1:0}),O=g(()=>D.value>0),j=g(()=>({0:`1-byte`,1:`2-byte`,2:`3-byte`})[D.value]??`1-byte`);f(()=>i.result,e=>{if(e&&!_.value){_.value=!0,d.value=0;let t=e.path.length,n=1500/(t*2),r=0,i=t*2-2,a=()=>{r<=i?(d.value=r/i,r++,setTimeout(a,n)):(_.value=!1,d.value=1)};setTimeout(a,100)}},{immediate:!0});let M=g(()=>{if(!i.result||!_.value)return-1;let e=i.result.path.length;if(e<=1)return-1;let t=d.value,n=.5;if(t<=n)return t/n*(e-1);{let r=(t-n)/n;return(e-1)*(1-r)}}),N=()=>{a(`close`)};return(n,i)=>(S(),o(u,{to:`body`},[h(A,{name:`modal`},{default:t(()=>[e.show?(S(),b(`div`,{key:0,class:`fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-[99999] p-4`,onClick:k(N,[`self`])},[y(`div`,{class:`glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/20 rounded-[20px] shadow-2xl w-full max-w-md overflow-hidden`,onClick:i[0]||=k(()=>{},[`stop`])},[y(`div`,W,[y(`div`,G,[y(`div`,K,[i[2]||=y(`div`,{class:`p-2 bg-cyan-400/20 dark:bg-primary/20 rounded-lg`},[y(`svg`,{class:`w-5 h-5 text-cyan-500 dark:text-primary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0`})])],-1),y(`div`,null,[i[1]||=y(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary`},` Ping Result `,-1),e.nodeName?(S(),b(`p`,ee,s(e.nodeName),1)):p(``,!0)])]),y(`button`,{onClick:N,class:`p-2 hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-lg transition-colors text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary`},[...i[3]||=[y(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])])]),y(`div`,te,[e.loading?(S(),b(`div`,q,[...i[4]||=[y(`div`,{class:`animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4`},null,-1),y(`p`,{class:`text-content-secondary dark:text-content-muted`},`Sending ping...`,-1),y(`p`,{class:`text-content-muted dark:text-content-muted text-sm mt-1`},` Waiting for response... `,-1)]])):e.error?(S(),b(`div`,ne,[i[5]||=y(`div`,{class:`p-3 bg-accent-red/10 rounded-full w-16 h-16 mx-auto mb-4 flex items-center justify-center`},[y(`svg`,{class:`w-8 h-8 text-accent-red`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-1.964-1.333-2.732 0L3.268 16c-.77 1.333.192 3 1.732 3z`})])],-1),i[6]||=y(`h3`,{class:`text-accent-red font-semibold mb-2`},`Ping Failed`,-1),y(`p`,re,s(e.error),1)])):e.result?(S(),b(`div`,ie,[y(`div`,ae,[y(`div`,oe,[i[7]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`Round-Trip Time`,-1),y(`span`,{class:m([`text-xs font-medium px-2 py-1 rounded-full`,w.value.color,`bg-current/10`])},s(w.value.label),3)]),y(`div`,se,[y(`span`,ce,s(e.result.rtt_ms.toFixed(2)),1),i[8]||=y(`span`,{class:`text-content-secondary dark:text-content-muted`},`ms`,-1)])]),y(`div`,le,[y(`div`,ue,[y(`div`,de,[i[9]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-sm`},`RSSI`,-1),y(`div`,fe,[(S(),b(v,null,r(5,e=>y(`div`,{key:e,class:m([`w-1 h-3 rounded-sm`,e<=E.value.bars?E.value.color:`bg-stroke-subtle dark:bg-stroke/10`])},null,2)),64))])]),y(`div`,pe,[y(`span`,me,s(e.result.rssi),1),i[10]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-xs`},`dBm`,-1)])]),y(`div`,he,[i[12]||=y(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-2`},`SNR`,-1),y(`div`,ge,[y(`span`,_e,s(e.result.snr_db),1),i[11]||=y(`span`,{class:`text-content-secondary dark:text-content-muted text-xs`},`dB`,-1)])])]),O.value?(S(),b(`div`,ve,[i[14]||=y(`svg`,{class:`w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-1.964-1.333-2.732 0L3.268 16c-.77 1.333.192 3 1.732 3z`})],-1),y(`div`,ye,[y(`p`,be,s(j.value)+` path hashes active `,1),i[13]||=y(`p`,{class:`text-content-secondary dark:text-content-muted`},` This result uses multi-byte path hashes. The repeater being traced must be running firmware that supports multi-byte path hashes. Repeaters on older firmware will not respond to or correctly route these trace packets. `,-1)])])):p(``,!0),y(`div`,xe,[i[17]||=y(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-3`},` Network Path `,-1),y(`div`,Se,[y(`div`,Ce,[(S(!0),b(v,null,r(e.result.path,(n,r)=>(S(),b(`div`,{key:r,class:`flex items-center gap-2 flex-shrink-0 relative`},[y(`div`,{class:m([`bg-cyan-400/20 dark:bg-primary/20 text-cyan-600 dark:text-primary border border-cyan-400/40 dark:border-primary/30 px-3 py-1.5 rounded-lg text-sm font-mono transition-all duration-300`,_.value&&Math.floor(M.value)===r?`ring-2 ring-cyan-400/50 dark:ring-primary/50 scale-105`:``])},s(n),3),r[_.value&&M.value>=r&&M.valuenew Date(e*1e3).toLocaleString(),T=e=>e?`${e} dBm`:`N/A`,E=e=>e?`${e.toFixed(1)} dB`:`N/A`,D=e=>({0:`Transport Flood`,1:`Flood`,2:`Direct`,3:`Transport Direct`})[e||0]||`Unknown`,O=e=>({Unknown:`Unknown`,"Chat Node":`Chat Node`,Repeater:`Repeater`,"Room Server":`Room Server`,"Hybrid Node":`Hybrid Node`})[e]||e,j=e=>({Unknown:`text-gray-600 dark:text-gray-400`,"Chat Node":`text-blue-600 dark:text-blue-400`,Repeater:`text-emerald-600 dark:text-emerald-400`,"Room Server":`text-purple-600 dark:text-purple-400`,"Hybrid Node":`text-amber-600 dark:text-amber-400`})[e]||`text-gray-600 dark:text-gray-400`,M=async()=>{if(!c.neighbor?.latitude||!c.neighbor?.longitude)return;let e=`${c.neighbor.latitude.toFixed(6)}, ${c.neighbor.longitude.toFixed(6)}`;try{await navigator.clipboard.writeText(e),a.value=`Copied!`,setTimeout(()=>{a.value=`Copy`},2e3)}catch(e){console.error(`Failed to copy coordinates:`,e),a.value=`Failed`,setTimeout(()=>{a.value=`Copy`},2e3)}},N=g(()=>{if(!c.neighbor?.latitude||!c.neighbor?.longitude||!c.baseLatitude||!c.baseLongitude)return null;let e=(c.neighbor.latitude-c.baseLatitude)*Math.PI/180,t=(c.neighbor.longitude-c.baseLongitude)*Math.PI/180,n=Math.sin(e/2)*Math.sin(e/2)+Math.cos(c.baseLatitude*Math.PI/180)*Math.cos(c.neighbor.latitude*Math.PI/180)*Math.sin(t/2)*Math.sin(t/2);return 6371*(2*Math.atan2(Math.sqrt(n),Math.sqrt(1-n)))}),P=g(()=>c.neighbor?.latitude!==null&&c.neighbor?.longitude!==null&&c.neighbor?.latitude!==0&&c.neighbor?.longitude!==0&&Math.abs(c.neighbor?.latitude??0)<=90&&Math.abs(c.neighbor?.longitude??0)<=180),I=()=>{if(!d.value||!c.neighbor||!P.value)return;x&&=(x.remove(),null);let e=document.documentElement.classList.contains(`dark`);x=J.default.map(d.value,{center:[c.neighbor.latitude,c.neighbor.longitude],zoom:13,zoomControl:!0,attributionControl:!1});let t=e?`https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png`:`https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png`;J.default.tileLayer(t,{maxZoom:19,attribution:`© OpenStreetMap © CARTO`}).addTo(x);let n=J.default.divIcon({className:`custom-marker`,html:`
${c.neighbor.node_name?.charAt(0)||`?`}
`,iconSize:[32,32],iconAnchor:[16,16]});if(J.default.marker([c.neighbor.latitude,c.neighbor.longitude],{icon:n}).addTo(x).bindPopup(`${c.neighbor.node_name||`Unknown`}
${c.neighbor.pubkey.slice(0,8)}...`),c.baseLatitude!==null&&c.baseLongitude!==null&&c.baseLatitude!==0&&c.baseLongitude!==0&&Math.abs(c.baseLatitude)<=90&&Math.abs(c.baseLongitude)<=180){let e=J.default.divIcon({className:`custom-marker`,html:`
B
`,iconSize:[32,32],iconAnchor:[16,16]});J.default.marker([c.baseLatitude,c.baseLongitude],{icon:e}).addTo(x).bindPopup(`Base Station`),J.default.polyline([[c.baseLatitude,c.baseLongitude],[c.neighbor.latitude,c.neighbor.longitude]],{color:`#3b82f6`,weight:2,opacity:.6,dashArray:`5, 10`}).addTo(x);let t=J.default.latLngBounds([c.baseLatitude,c.baseLongitude],[c.neighbor.latitude,c.neighbor.longitude]);x.fitBounds(t,{padding:[50,50]})}},L=e=>{e.key===`Escape`&&l(`close`)},R=e=>{e.target===e.currentTarget&&l(`close`)};f(()=>c.isOpen,e=>{e?(document.body.style.overflow=`hidden`,setTimeout(()=>{P.value&&I()},100)):(document.body.style.overflow=``,x&&=(x.remove(),null))},{immediate:!0});let z=g(()=>c.neighbor?.rssi?i(c.neighbor.rssi):null);return(n,i)=>(S(),o(u,{to:`body`},[h(A,{name:`modal`,appear:``},{default:t(()=>[e.isOpen&&e.neighbor?(S(),b(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center p-4 overflow-hidden`,onClick:R,onKeydown:L,tabindex:`0`},[i[20]||=y(`div`,{class:`absolute inset-0 bg-black/60 backdrop-blur-md pointer-events-none`},null,-1),y(`div`,{class:`relative w-full max-w-4xl max-h-[90vh] flex flex-col`,onClick:i[2]||=k(()=>{},[`stop`])},[y(`div`,Ae,[y(`div`,je,[y(`div`,Me,[y(`h2`,Ne,s(e.neighbor.node_name||`Unknown Node`),1),y(`p`,Pe,s(e.neighbor.pubkey),1)]),y(`div`,Fe,[y(`button`,{onClick:i[0]||=e=>l(`close`),class:`w-8 h-8 flex items-center justify-center rounded-full bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 dark:hover:bg-gray-600 transition-colors duration-200 text-gray-700 dark:text-white hover:text-gray-900 dark:hover:text-white`},[...i[3]||=[y(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])])]),y(`div`,Ie,[y(`div`,Le,[i[8]||=y(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-4`},` Basic Information `,-1),y(`div`,Re,[y(`div`,ze,[i[4]||=y(`div`,{class:`text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1`},` Contact Type `,-1),y(`div`,{class:m([`font-medium`,j(e.neighbor.contact_type)])},s(O(e.neighbor.contact_type)),3)]),y(`div`,Be,[i[5]||=y(`div`,{class:`text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1`},` Route Type `,-1),y(`div`,Ve,s(D(e.neighbor.route_type)),1)]),y(`div`,He,[i[6]||=y(`div`,{class:`text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1`},` Zero Hop `,-1),y(`div`,{class:m([`font-medium`,e.neighbor.zero_hop?`text-green-600 dark:text-green-400`:`text-gray-600 dark:text-gray-400`])},s(e.neighbor.zero_hop?`Yes`:`No`),3)]),y(`div`,Ue,[i[7]||=y(`div`,{class:`text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1`},` Advert Count `,-1),y(`div`,We,s(e.neighbor.advert_count.toLocaleString()),1)])])]),y(`div`,Ge,[i[12]||=y(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-4`},` Signal Quality `,-1),y(`div`,Ke,[y(`div`,qe,[i[9]||=y(`div`,{class:`text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1`},` RSSI `,-1),y(`div`,Je,s(T(e.neighbor.rssi)),1)]),y(`div`,Ye,[i[10]||=y(`div`,{class:`text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1`},` SNR `,-1),y(`div`,Xe,s(E(e.neighbor.snr)),1)]),z.value?(S(),b(`div`,Ze,[i[11]||=y(`div`,{class:`text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1`},` Signal Strength `,-1),y(`div`,Qe,[y(`div`,$e,[(S(),b(v,null,r(4,e=>y(`div`,{key:e,class:m([`w-1 h-3 rounded-sm`,e<=z.value.bars?z.value.color:`bg-gray-300 dark:bg-gray-700`])},null,2)),64))]),y(`span`,{class:m([`text-sm font-medium`,z.value.color])},s(z.value.quality),3)])])):p(``,!0)])]),y(`div`,et,[i[15]||=y(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-4`},` Timeline `,-1),y(`div`,tt,[y(`div`,nt,[i[13]||=y(`div`,{class:`text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1`},` First Seen `,-1),y(`div`,rt,s(w(e.neighbor.first_seen)),1)]),y(`div`,it,[i[14]||=y(`div`,{class:`text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1`},` Last Seen `,-1),y(`div`,at,s(w(e.neighbor.last_seen)),1)])])]),P.value?(S(),b(`div`,ot,[i[19]||=y(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary mb-4`},` Location `,-1),y(`div`,st,[y(`div`,ct,[i[16]||=y(`div`,{class:`text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1`},` Latitude `,-1),y(`div`,lt,s(e.neighbor.latitude?.toFixed(6)),1)]),y(`div`,ut,[i[17]||=y(`div`,{class:`text-content-muted dark:text-content-muted text-xs uppercase tracking-wide mb-1`},` Longitude `,-1),y(`div`,dt,s(e.neighbor.longitude?.toFixed(6)),1)]),y(`div`,ft,[y(`div`,pt,s(N.value===null?`Coordinates`:`Distance`),1),N.value===null?(S(),b(`button`,{key:1,onClick:M,class:`w-full px-3 py-1.5 bg-primary hover:bg-primary/90 dark:bg-gray-700 dark:hover:bg-gray-600 text-white text-sm font-medium rounded-lg transition-colors flex items-center justify-center gap-1.5`},[i[18]||=y(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z`})],-1),_(` `+s(a.value),1)])):(S(),b(`div`,mt,s(N.value.toFixed(2))+` km `,1))])]),y(`div`,{ref_key:`mapContainer`,ref:d,class:`w-full h-96 rounded-[12px] overflow-hidden border border-stroke-subtle dark:border-white/10`},null,512)])):p(``,!0)]),y(`div`,ht,[y(`button`,{onClick:i[1]||=e=>l(`close`),class:`w-full px-4 py-2.5 bg-primary hover:bg-primary/90 dark:bg-gray-700 dark:hover:bg-gray-600 text-white font-medium rounded-lg transition-colors`},` Close `)])])])],32)):p(``,!0)]),_:1})]))}}),[[`__scopeId`,`data-v-2fb1fa15`]]),_t=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],vt=1,Y=8,yt=class e{static from(t){if(!(t instanceof ArrayBuffer))throw Error(`Data must be an instance of ArrayBuffer.`);let[n,r]=new Uint8Array(t,0,2);if(n!==219)throw Error(`Data does not appear to be in a KDBush format.`);let i=r>>4;if(i!==vt)throw Error(`Got v${i} data when expected v${vt}.`);let a=_t[r&15];if(!a)throw Error(`Unrecognized array type.`);let[o]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,o,a,t)}constructor(e,t=64,n=Float64Array,r){if(isNaN(e)||e<0)throw Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let i=_t.indexOf(this.ArrayType),a=e*2*this.ArrayType.BYTES_PER_ELEMENT,o=e*this.IndexArrayType.BYTES_PER_ELEMENT,s=(8-o%8)%8;if(i<0)throw Error(`Unexpected typed array class: ${n}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,Y,e),this.coords=new this.ArrayType(this.data,Y+o+s,e*2),this._pos=e*2,this._finished=!0):(this.data=new ArrayBuffer(Y+a+o+s),this.ids=new this.IndexArrayType(this.data,Y,e),this.coords=new this.ArrayType(this.data,Y+o+s,e*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(vt<<4)+i]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return bt(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this,s=[0,i.length-1,0],c=[];for(;s.length;){let l=s.pop()||0,u=s.pop()||0,d=s.pop()||0;if(u-d<=o){for(let o=d;o<=u;o++){let s=a[2*o],l=a[2*o+1];s>=e&&s<=n&&l>=t&&l<=r&&c.push(i[o])}continue}let f=d+u>>1,p=a[2*f],m=a[2*f+1];p>=e&&p<=n&&m>=t&&m<=r&&c.push(i[f]),(l===0?e<=p:t<=m)&&(s.push(d),s.push(f-1),s.push(1-l)),(l===0?n>=p:r>=m)&&(s.push(f+1),s.push(u),s.push(1-l))}return c}within(e,t,n){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:r,coords:i,nodeSize:a}=this,o=[0,r.length-1,0],s=[],c=n*n;for(;o.length;){let l=o.pop()||0,u=o.pop()||0,d=o.pop()||0;if(u-d<=a){for(let n=d;n<=u;n++)Ct(i[2*n],i[2*n+1],e,t)<=c&&s.push(r[n]);continue}let f=d+u>>1,p=i[2*f],m=i[2*f+1];Ct(p,m,e,t)<=c&&s.push(r[f]),(l===0?e-n<=p:t-n<=m)&&(o.push(d),o.push(f-1),o.push(1-l)),(l===0?e+n>=p:t+n>=m)&&(o.push(f+1),o.push(u),o.push(1-l))}return s}};function bt(e,t,n,r,i,a){if(i-r<=n)return;let o=r+i>>1;xt(e,t,o,r,i,a),bt(e,t,n,r,o-1,1-a),bt(e,t,n,o+1,i,1-a)}function xt(e,t,n,r,i,a){for(;i>r;){if(i-r>600){let o=i-r+1,s=n-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1);xt(e,t,n,Math.max(r,Math.floor(n-s*l/o+u)),Math.min(i,Math.floor(n+(o-s)*l/o+u)),a)}let o=t[2*n+a],s=r,c=i;for(X(e,t,r,n),t[2*i+a]>o&&X(e,t,r,i);so;)c--}t[2*r+a]===o?X(e,t,r,c):(c++,X(e,t,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}}function X(e,t,n,r){St(e,n,r),St(t,2*n,2*r),St(t,2*n+1,2*r+1)}function St(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Ct(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}var wt={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},Tt=Math.fround||(e=>(t=>(e[0]=+t,e[0])))(new Float32Array(1)),Z=2,Q=3,Et=4,$=5,Dt=6,Ot=class{constructor(e){this.options=Object.assign(Object.create(wt),e),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:n,maxZoom:r}=this.options;t&&console.time(`total time`);let i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;let a=[];for(let t=0;t=n;e--){let n=+Date.now();o=this.trees[e]=this._createTree(this._cluster(o,e)),t&&console.log(`z%d: %d clusters in %dms`,e,o.numItems,+Date.now()-n)}return t&&console.timeEnd(`total time`),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){let e=this.getClusters([n,r,180,a],t),o=this.getClusters([-180,r,i,a],t);return e.concat(o)}let o=this.trees[this._limitZoom(t)],s=o.range(jt(n),Mt(a),jt(i),Mt(r)),c=o.data,l=[];for(let e of s){let t=this.stride*e;l.push(c[t+$]>1?kt(c,t,this.clusterProps):this.points[c[t+Q]])}return l}getChildren(e){let t=this._getOriginId(e),n=this._getOriginZoom(e),r=`No cluster with the specified id.`,i=this.trees[n];if(!i)throw Error(r);let a=i.data;if(t*this.stride>=a.length)throw Error(r);let o=this.options.radius/(this.options.extent*2**(n-1)),s=a[t*this.stride],c=a[t*this.stride+1],l=i.within(s,c,o),u=[];for(let t of l){let n=t*this.stride;a[n+Et]===e&&u.push(a[n+$]>1?kt(a,n,this.clusterProps):this.points[a[n+Q]])}if(u.length===0)throw Error(r);return u}getLeaves(e,t,n){t||=10,n||=0;let r=[];return this._appendLeaves(r,e,t,n,0),r}getTile(e,t,n){let r=this.trees[this._limitZoom(e)],i=2**e,{extent:a,radius:o}=this.options,s=o/a,c=(n-s)/i,l=(n+1+s)/i,u={features:[]};return this._addTileFeatures(r.range((t-s)/i,c,(t+1+s)/i,l),r.data,t,n,i,u),t===0&&this._addTileFeatures(r.range(1-s/i,c,1,l),r.data,i,n,i,u),t===i-1&&this._addTileFeatures(r.range(0,c,s/i,l),r.data,-1,n,i,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let n=this.getChildren(e);if(t++,n.length!==1)break;e=n[0].properties.cluster_id}return t}_appendLeaves(e,t,n,r,i){let a=this.getChildren(t);for(let t of a){let a=t.properties;if(a&&a.cluster?i+a.point_count<=r?i+=a.point_count:i=this._appendLeaves(e,a.cluster_id,n,r,i):i1,c,l,u;if(s)c=At(t,e,this.clusterProps),l=t[e],u=t[e+1];else{let n=this.points[t[e+Q]];c=n.properties;let[r,i]=n.geometry.coordinates;l=jt(r),u=Mt(i)}let d={type:1,geometry:[[Math.round(this.options.extent*(l*i-n)),Math.round(this.options.extent*(u*i-r))]],tags:c},f;f=s||this.options.generateId?t[e+Q]:this.points[t[e+Q]].id,f!==void 0&&(d.id=f),a.features.push(d)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:n,extent:r,reduce:i,minPoints:a}=this.options,o=n/(r*2**t),s=e.data,c=[],l=this.stride;for(let n=0;nt&&(p+=s[n+$])}if(p>f&&p>=a){let e=r*f,a=u*f,o,m=-1,h=((n/l|0)<<5)+(t+1)+this.points.length;for(let r of d){let c=r*l;if(s[c+Z]<=t)continue;s[c+Z]=t;let u=s[c+$];e+=s[c]*u,a+=s[c+1]*u,s[c+Et]=h,i&&(o||(o=this._map(s,n,!0),m=this.clusterProps.length,this.clusterProps.push(o)),i(o,this._map(s,c)))}s[n+Et]=h,c.push(e/p,a/p,1/0,h,-1,p),i&&c.push(m)}else{for(let e=0;e1)for(let e of d){let n=e*l;if(!(s[n+Z]<=t)){s[n+Z]=t;for(let e=0;e>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,n){if(e[t+$]>1){let r=this.clusterProps[e[t+Dt]];return n?Object.assign({},r):r}let r=this.points[e[t+Q]].properties,i=this.options.map(r);return n&&i===r?Object.assign({},i):i}};function kt(e,t,n){return{type:`Feature`,id:e[t+Q],properties:At(e,t,n),geometry:{type:`Point`,coordinates:[Nt(e[t]),Pt(e[t+1])]}}}function At(e,t,n){let r=e[t+$],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,a=e[t+Dt],o=a===-1?{}:Object.assign({},n[a]);return Object.assign(o,{cluster:!0,cluster_id:e[t+Q],point_count:r,point_count_abbreviated:i})}function jt(e){return e/360+.5}function Mt(e){let t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function Nt(e){return(e-.5)*360}function Pt(e){let t=(180-e*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}var Ft={class:`map-container`},It={key:0,class:`flex items-center justify-center h-96 glass-card backdrop-blur border border-black/6 dark:border-white/10 rounded-[12px] shadow-sm dark:shadow-none`},Lt={class:`hidden sm:inline`},Rt={key:3,class:`map-legend`},zt={class:`legend-footer`},Bt={key:4,class:`map-attribution`},Vt=E(l({__name:`NetworkMap`,props:{adverts:{},baseLatitude:{default:null},baseLongitude:{default:null},showLegend:{type:Boolean,default:!0}},emits:[`update:showLegend`],setup(e,{expose:t,emit:r}){typeof window<`u`&&!window.chrome&&(window.chrome={runtime:{}});let o=e,l=r,u=()=>{l(`update:showLegend`,!o.showLegend)},d=C(),m=null,h=C(new Map),_=null,v=C(new Map),x=C([]),w=C(!0),T=C(60),E=C(14),D=C(document.documentElement.classList.contains(`dark`)),O=new MutationObserver(()=>{let e=document.documentElement.classList.contains(`dark`);e!==D.value&&(D.value=e,m&&I())}),k=g(()=>o.baseLatitude!==null&&o.baseLongitude!==null&&typeof o.baseLatitude==`number`&&typeof o.baseLongitude==`number`&&o.baseLatitude!==0&&o.baseLongitude!==0&&Math.abs(o.baseLatitude)<=90&&Math.abs(o.baseLongitude)<=180),A=e=>new Date(e*1e3).toLocaleString(),j=e=>e?`${e} dBm`:`N/A`,M=e=>e?`${e} dB`:`N/A`,N=e=>({0:`Transport Flood`,1:`Flood`,2:`Direct`,3:`Transport Direct`})[e||0]||`Unknown`,P=(e,t,n,r)=>{let i=(n-e)*Math.PI/180,a=(r-t)*Math.PI/180,o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(e*Math.PI/180)*Math.cos(n*Math.PI/180)*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))},F=()=>{m&&=(x.value.forEach(e=>{m&&e.remove()}),x.value.length=0,m.remove(),null),h.value.clear(),v.value.clear(),_=null},I=async()=>{let e=m?.getZoom()||11,t=m?.getCenter()||(k.value?[o.baseLatitude,o.baseLongitude]:[0,0]);F(),await a(),await z(),m&&m.setView(t,e)},L=e=>{let t=new Map;return e.filter(e=>e.latitude!==null&&e.longitude!==null).map(e=>{let n=e.latitude,r=e.longitude,i=`${n.toFixed(6)}_${r.toFixed(6)}`,a=t.get(i)||0;if(t.set(i,a+1),a>0){let e=.001,t=a*60*(Math.PI/180);n+=Math.sin(t)*e*(a*.5),r+=Math.cos(t)*e*(a*.5)}return{type:`Feature`,properties:{advert:{...e,jittered_latitude:n,jittered_longitude:r}},geometry:{type:`Point`,coordinates:[r,n]}}})},R=e=>{_=new Ot({radius:T.value,maxZoom:E.value,minPoints:2}),_.load(e)},z=async()=>{if(!d.value||!k.value){console.warn(`Cannot initialize map: missing container or coordinates`);return}F(),await a();let e=o.baseLatitude,t=o.baseLongitude;m=J.default.map(d.value,{center:[e,t],zoom:11,zoomControl:!0,attributionControl:!1,preferCanvas:!1});try{let e=D.value?`https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}{r}.png`:`https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}{r}.png`,t=D.value?`https://{s}.basemaps.cartocdn.com/dark_only_labels/{z}/{x}/{y}{r}.png`:`https://{s}.basemaps.cartocdn.com/light_only_labels/{z}/{x}/{y}{r}.png`,n=J.default.tileLayer(e,{maxZoom:19,attribution:`© OpenStreetMap contributors © CARTO`,errorTileUrl:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==`}),r=J.default.tileLayer(t,{maxZoom:19,attribution:``,errorTileUrl:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==`});n.addTo(m),r.addTo(m)}catch(e){console.warn(`Error loading tiles:`,e)}try{let n=(e,t=!1)=>{let n=t?16:12;return J.default.divIcon({className:`custom-div-icon`,html:`
`,iconSize:[n+4,n+4],iconAnchor:[(n+4)/2,(n+4)/2]})},r=e=>{let t=e<10?30:e<100?40:50;return J.default.divIcon({className:`custom-cluster-icon`,html:` +
+ ${e} +
+ `,iconSize:[t,t],iconAnchor:[t/2,t/2]})},i=n(`#ef4444`,!0);J.default.marker([e,t],{icon:i}).addTo(m).bindPopup(` +
+ Base Station
+ Base Station
+ ${e.toFixed(6)}, ${t.toFixed(6)} +
+ `);let a={Unknown:`#9CA3AF`,"Chat Node":`#60A5FA`,Repeater:`#A5E5B6`,"Room Server":`#EBA0FC`,"Hybrid Node":`#FFC246`},s=(e,t,n,r,i=0)=>{if(!m)return;let a=e.jittered_latitude||e.latitude,o=e.jittered_longitude||e.longitude;if(a===null||o===null)return;let s=e.route_type||0,c=r,l=3,u=.7,d;s===2?(c=`#A5E5B6`,l=4,u=.9):s===1?(c=`#FFC246`,d=`10, 5`,u=.8):s===3?(c=`#059669`,l=5,u=.95):s===0?(c=`#ea580c`,d=`12, 6`,u=.8):(c=`#9CA3AF`,d=`2, 5`,u=.6);let f=[t,n],p=[a,o],h=J.default.polyline([f,p],{color:c,weight:l,opacity:0,dashArray:d,className:`connection-line`}).addTo(m),g=J.default.polyline([f,f],{color:c,weight:l,opacity:0,dashArray:d,className:`connection-line animated-line`}).addTo(m);setTimeout(()=>{let i=0;g.setStyle({opacity:u+.2});let s=()=>{i++;let c=i/30,d=f[0]+(p[0]-f[0])*c,_=f[1]+(p[1]-f[1])*c;g.setLatLngs([f,[d,_]]),i<30?setTimeout(s,30):setTimeout(()=>{m&&g&&g.remove(),h.setStyle({opacity:u}),h.on(`mouseover`,()=>{h.setStyle({weight:l+2,opacity:Math.min(u+.3,1)})}),h.on(`mouseout`,()=>{h.setStyle({weight:l,opacity:u})});let i=P(t,n,a,o);h.bindPopup(` +
+ Connection to ${e.node_name||`Unknown Node`}
+ Distance: ${i.toFixed(2)} km
+ Route: ${N(e.route_type)}
+ Signal: ${j(e.rssi)} / ${M(e.snr)} +
+ `),x.value.push(h)},200)};s()},i)},c=()=>{if(!m||!_)return;let i=m.getBounds(),o=Math.floor(m.getZoom());v.value.forEach(e=>{m&&e.remove()}),v.value.clear(),x.value.forEach(e=>{m&&e.remove()}),x.value.length=0,_.getClusters([i.getWest(),i.getSouth(),i.getEast(),i.getNorth()],o).forEach(i=>{let[o,c]=i.geometry.coordinates,l=i.properties;if(l.cluster){let n=J.default.marker([c,o],{icon:r(l.point_count||0)}).addTo(m);n.on(`click`,()=>{if(m&&_){let e=_.getClusterExpansionZoom(l.cluster_id);m.setView([c,o],e)}});let i=_.getLeaves(l.cluster_id,1/0).map(e=>`
+ • ${e.properties.advert.node_name||`Unknown Node`} (${e.properties.advert.contact_type}) +
`).join(``);n.bindPopup(` +
+ Cluster: ${l.point_count} nodes
+
+ ${i} +
+
+ Click to zoom in and separate nodes +
+
+ `),v.value.set(`cluster-${l.cluster_id}`,n);let u=P(e,t,c,o),d=Math.min(Math.floor(u*5),200);s({node_name:`Cluster of ${l.point_count} nodes`,contact_type:`Cluster`,route_type:2,rssi:null,snr:null,jittered_latitude:c,jittered_longitude:o,latitude:c,longitude:o},e,t,`#AAE8E8`,d)}else{let r=l.advert,i=a[r.contact_type]||a.Unknown,u=n(i),d=c,f=o,p=P(e,t,d,f),g=J.default.marker([d,f],{icon:u}).addTo(m).bindPopup(` +
+ ${r.node_name||`Unknown Node`}
+ Type: ${r.contact_type}
+ Distance: ${p.toFixed(2)} km
+ Signal: ${j(r.rssi)} / ${M(r.snr)}
+ Route: ${N(r.route_type)}
+ Last Seen: ${A(r.last_seen)} + ${r.jittered_latitude?`
Position adjusted to separate overlapping nodes`:``} +
+ `);h.value.set(r.pubkey,g),v.value.set(`node-${r.pubkey}`,g);let _=Math.min(Math.floor(p*5),200);s({...r,jittered_latitude:d,jittered_longitude:f},e,t,i,_)}})},l=(e,t)=>{let r=0;L(o.adverts).forEach(i=>{let o=i.properties.advert;if(o.latitude!==null&&o.longitude!==null){let i=a[o.contact_type]||a.Unknown,c=n(i),l=o.jittered_latitude||o.latitude,u=o.jittered_longitude||o.longitude,d=J.default.marker([l,u],{icon:c}).addTo(m).bindPopup(` +
+ ${o.node_name||`Unknown Node`}
+ Type: ${o.contact_type}
+ Distance: ${P(e,t,l,u).toFixed(2)} km
+ Signal: ${j(o.rssi)} / ${M(o.snr)}
+ Route: ${N(o.route_type)}
+ Last Seen: ${A(o.last_seen)} + ${o.jittered_latitude?`
Position adjusted to separate overlapping nodes`:``} +
+ `);h.value.set(o.pubkey,d);let f=d.getElement();f&&(f.style.opacity=`0`,f.style.transition=`opacity 0.5s ease-out`),s(o,e,t,i,r),setTimeout(()=>{f&&(f.style.opacity=`1`)},r+1e3),r+=100}})};if(w.value&&o.adverts.length>0)try{R(L(o.adverts));let n=Math.min(14,m.getZoom());m.setZoom(n),setTimeout(()=>{try{c()}catch(n){console.warn(`Error updating clusters:`,n),l(e,t)}},100),m.on(`moveend`,()=>{try{c()}catch(e){console.warn(`Error updating clusters on move:`,e)}}),m.on(`zoomend`,()=>{try{c()}catch(e){console.warn(`Error updating clusters on zoom:`,e)}})}catch(n){console.warn(`Error initializing clustering:`,n),l(e,t)}else l(e,t);setTimeout(()=>{m&&m.invalidateSize()},1e3)}catch(e){console.error(`Error initializing map:`,e)}};return t({highlightNode:e=>{let t=h.value.get(e);if(t){let e=t.getElement();if(e){let t=e.querySelector(`div`);t&&t.classList.add(`marker-highlight`)}}},unhighlightNode:e=>{let t=h.value.get(e);if(t){let e=t.getElement();if(e){let t=e.querySelector(`div`);t&&t.classList.remove(`marker-highlight`)}}},initializeOpenStreetMap:z}),f(()=>o.adverts,()=>{m&&k.value&&setTimeout(()=>{z()},100)},{immediate:!1}),i(()=>{O.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),k.value&&o.adverts.length>0&&setTimeout(()=>{z()},300)}),n(()=>{O.disconnect(),F()}),(t,n)=>(S(),b(`div`,Ft,[k.value?(S(),b(`div`,{key:1,ref_key:`mapContainer`,ref:d,class:`leaflet-map-container h-96 w-full glass-card backdrop-blur border border-black/6 dark:border-white/10 rounded-[12px] overflow-hidden shadow-sm dark:shadow-none`,style:{"min-height":`384px`,position:`relative`}},null,512)):(S(),b(`div`,It,[...n[0]||=[c(`

No valid coordinates available

Configure base station location to view map

`,1)]])),k.value&&e.adverts.length>0?(S(),b(`button`,{key:2,onClick:u,class:`absolute bottom-3 right-3 z-[1001] flex items-center gap-2 px-3 py-2 bg-black/40 border border-white/10 rounded-lg text-white/80 hover:bg-white/10 hover:text-white transition-colors text-sm backdrop-blur-sm`},[n[1]||=y(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z`})],-1),y(`span`,Lt,s(e.showLegend?`Hide`:`Show`),1)])):p(``,!0),k.value&&e.adverts.length>0&&e.showLegend?(S(),b(`div`,Rt,[n[2]||=c(`
Node Types
Base Station
Chat Node
Repeater
Room Server
Hybrid Node
Route Types
Direct
Transport Direct
Flood
Transport Flood
`,2),y(`div`,zt,s(e.adverts.length)+` node`+s(e.adverts.length===1?``:`s`)+` visible `,1)])):p(``,!0),k.value?(S(),b(`div`,Bt,` © OpenStreetMap contributors © CARTO `)):p(``,!0)]))}}),[[`__scopeId`,`data-v-61a18eed`]]),Ht={class:`relative`,"data-menu-container":``},Ut=l({__name:`NeighborMenu`,props:{neighbor:{},canPing:{type:Boolean}},emits:[`ping`,`delete`,`show-details`],setup(e,{emit:t}){let r=window.__neighborMenuManager||{activeMenu:null,setActiveMenu:e=>{if(r.activeMenu&&r.activeMenu!==e)try{r.activeMenu.closeMenu()}catch(e){console.warn(`Error closing previous menu:`,e)}r.activeMenu=e}};window.__neighborMenuManager=r;let i=e,s=t,c=C(!1),l=C(),d=C({top:0,left:0}),f=()=>{c.value=!1,document.removeEventListener(`click`,w,!0),document.removeEventListener(`keydown`,T),r.activeMenu===h&&(r.activeMenu=null)},h={closeMenu:f},g=()=>{f(),s(`ping`,i.neighbor)},_=()=>{f(),s(`show-details`,i.neighbor)},v=()=>{f(),s(`delete`,i.neighbor)},w=e=>{e.target.closest(`[data-menu-container]`)||f()},T=e=>{e.key===`Escape`&&f()},E=async()=>{if(!c.value&&l.value){r.setActiveMenu(h);let e=l.value.getBoundingClientRect(),t=window.innerWidth,n=t<1024,i=e.left+144>t-16,o=e.left;n&&i&&(o=e.right-144),o=Math.max(8,o),d.value={top:e.bottom+4,left:o},c.value=!0,await a(),document.addEventListener(`click`,w,!0),document.addEventListener(`keydown`,T)}else f()};return n(()=>{f()}),(e,t)=>(S(),b(`div`,Ht,[y(`button`,{ref_key:`buttonRef`,ref:l,onClick:E,class:m([`p-1 rounded hover:bg-stroke-subtle dark:hover:bg-white/10 transition-colors text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary/80`,{"bg-background-mute dark:bg-stroke/10 text-content-primary dark:text-content-primary/80":c.value}]),"data-menu-container":``},[...t[0]||=[y(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z`})],-1)]],2),(S(),o(u,{to:`body`},[c.value?(S(),b(`div`,{key:0,class:`fixed w-36 bg-white dark:bg-surface-elevated backdrop-blur-lg border border-stroke-subtle dark:border-white/20 rounded-[15px] shadow-2xl z-[999999]`,style:x({top:d.value.top+`px`,left:d.value.left+`px`}),"data-menu-container":``},[y(`div`,{class:`py-2`},[y(`button`,{onClick:_,class:`flex items-center gap-3 w-full px-4 py-3 text-sm text-content-primary dark:text-content-primary hover:bg-primary/10 transition-colors border-b border-stroke-subtle dark:border-white/10`},[...t[1]||=[y(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})],-1),y(`span`,{class:`font-medium`},`Details`,-1)]]),y(`button`,{onClick:g,class:`flex items-center gap-3 w-full px-4 py-3 text-sm text-content-primary dark:text-content-primary hover:bg-primary/10 transition-colors border-b border-stroke-subtle dark:border-white/10`},[...t[2]||=[y(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8.111 16.404a5.5 5.5 0 017.778 0M12 20h.01m-7.08-7.071c3.904-3.905 10.236-3.905 14.141 0M1.394 9.393c5.857-5.857 15.355-5.857 21.213 0`})],-1),y(`span`,{class:`font-medium`},`Ping`,-1)]]),y(`button`,{onClick:v,class:`flex items-center gap-3 w-full px-4 py-3 text-sm text-accent-red hover:bg-accent-red/10 transition-colors`},[...t[3]||=[y(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})],-1),y(`span`,{class:`font-medium`},`Delete`,-1)]])])],4)):p(``,!0)]))]))}}),Wt={class:`glass-card/30 backdrop-blur border border-stroke-subtle dark:border-white/10 rounded-[12px] p-6 shadow-sm dark:shadow-none`},Gt={class:`flex items-center justify-between mb-4`},Kt={class:`flex items-center gap-3`},qt={class:`text-content-primary dark:text-content-primary text-lg font-semibold`},Jt={class:`bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-primary text-xs px-2 py-1 rounded-full`},Yt={key:0,class:`text-content-muted dark:text-content-muted`},Xt={key:0,class:`hidden lg:flex bg-background-mute dark:bg-surface-elevated/30 backdrop-blur rounded-lg border border-stroke-subtle dark:border-stroke/10 p-1`},Zt={class:`hidden lg:block overflow-x-auto`},Qt={class:`w-full`},$t={class:`bg-background-mute dark:bg-transparent`},en={class:`flex items-center gap-1`},tn={class:`flex items-center gap-1`},nn={class:`flex items-center gap-1`},rn={class:`flex items-center gap-1`},an={class:`flex items-center gap-1`},on={class:`flex items-center gap-1`},sn={class:`flex items-center gap-1`},cn={class:`flex items-center gap-1`},ln={class:`flex items-center gap-1`},un={class:`bg-surface/50 dark:bg-transparent`},dn=[`onMouseenter`,`onMouseleave`],fn=[`onClick`,`title`],pn={key:0,class:`ml-1 text-xs`},mn={key:0,class:`flex items-center gap-3`},hn={class:`text-content-secondary dark:text-content-muted`},gn={class:`flex gap-1`},_n=[`onClick`],vn=[`onClick`],yn={key:1,class:`text-content-muted`},bn={class:`flex items-center gap-2`},xn={class:`flex items-end gap-0.5`},Sn={class:`flex items-center gap-2`},Cn=[`title`],wn=[`title`],Tn={class:`lg:hidden space-y-3`},En=[`onClick`],Dn={class:`flex items-center justify-between mb-3`},On={class:`flex items-center gap-3`},kn={class:`text-content-primary dark:text-content-primary font-medium text-base`},An={class:`flex items-center gap-2`},jn={class:`grid grid-cols-1 gap-3`},Mn={class:`grid grid-cols-2 gap-4`},Nn=[`onClick`,`title`],Pn={key:0,class:`ml-1 text-xs`},Fn={class:`flex items-center gap-2 justify-end`},In={class:`flex items-end gap-0.5`},Ln={class:`grid grid-cols-2 gap-4`},Rn={class:`flex items-center gap-2`},zn=[`title`],Bn={class:`text-content-primary dark:text-content-primary text-sm block text-right`},Vn={key:0,class:`border-t border-white/10 pt-3`},Hn={class:`flex items-center justify-between`},Un={class:`text-content-secondary dark:text-content-muted text-sm font-mono`},Wn={class:`flex gap-2`},Gn=[`onClick`],Kn=[`onClick`],qn={class:`grid grid-cols-3 gap-4 pt-3 border-t border-white/10`},Jn={class:`text-center`},Yn={class:`text-content-primary dark:text-content-primary text-sm font-medium`},Xn={class:`text-center`},Zn={class:`text-content-primary dark:text-content-primary text-sm font-medium`},Qn={class:`text-center`},$n=[`title`],er=l({__name:`NeighborTable`,props:{contactType:{},contactTypeKey:{},adverts:{},originalCount:{default:0},color:{},baseLatitude:{default:null},baseLongitude:{default:null},isCompactView:{type:Boolean,default:!1},isFirstTable:{type:Boolean,default:!1},showViewToggle:{type:Boolean,default:!1}},emits:[`highlight-node`,`unhighlight-node`,`menu-ping`,`menu-delete`,`show-details`,`toggle-view`],setup(e,{emit:t}){let n=C(null),{getSignalQuality:i}=F(),a=C(`advert_count`),o=C(`desc`),c=e,l=t,u=e=>new Date(e*1e3).toLocaleString(),d=e=>`${e.slice(0,4)}...${e.slice(-4)}`,f=e=>{switch(e){case 2:return{text:`Direct`,bgColor:`bg-green-100 dark:bg-green-500/20`,borderColor:`border-green-500 dark:border-green-400/30`,textColor:`text-green-600 dark:text-green-400`};case 3:return{text:`Transport Direct`,bgColor:`bg-green-100 dark:bg-green-600/20`,borderColor:`border-green-600/40 dark:border-green-500/30`,textColor:`text-green-700 dark:text-green-500`};case 1:return{text:`Flood`,bgColor:`bg-yellow-100 dark:bg-yellow-500/20`,borderColor:`border-yellow-500 dark:border-yellow-400/30`,textColor:`text-yellow-600 dark:text-yellow-400`};case 0:return{text:`Transport Flood`,bgColor:`bg-orange-100 dark:bg-orange-500/20`,borderColor:`border-orange-500 dark:border-orange-400/30`,textColor:`text-orange-600 dark:text-orange-400`};default:return{text:`Unknown`,bgColor:`bg-gray-500/20`,borderColor:`border-gray-400/30`,textColor:`text-gray-400`}}},w=e=>e?`${e} dBm`:`N/A`,T=e=>e?`${e} dB`:`N/A`,E=(e,t,n,r)=>{let i=(n-e)*Math.PI/180,a=(r-t)*Math.PI/180,o=Math.sin(i/2)*Math.sin(i/2)+Math.cos(e*Math.PI/180)*Math.cos(n*Math.PI/180)*Math.sin(a/2)*Math.sin(a/2);return 6371*(2*Math.atan2(Math.sqrt(o),Math.sqrt(1-o)))},D=e=>c.baseLatitude===null||c.baseLongitude===null||e.latitude===null||e.longitude===null?`N/A`:`${E(c.baseLatitude,c.baseLongitude,e.latitude,e.longitude).toFixed(1)} km`,O=async e=>{try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);return t.value=e,document.body.appendChild(t),t.select(),document.execCommand(`copy`),document.body.removeChild(t),!0}},k=e=>{let t=Date.now()-e*1e3,n=Math.floor(t/1e3),r=Math.floor(n/60),i=Math.floor(r/60),a=Math.floor(i/24);return n<60?`${n}s ago`:r<60?`${r}m ago`:i<24?`${i}h ago`:`${a}d ago`},A=e=>{let t=Date.now()-e*1e3,n=Math.floor(t/(1e3*60*60));return n<1?{color:`text-green-600 dark:text-green-400`}:n<26?{color:`text-yellow-600 dark:text-yellow-400`}:{color:`text-red-600 dark:text-red-400`}},j=async(e,t)=>{await O(`${e.toFixed(6)}, ${t.toFixed(6)}`)},M=(e,t)=>{let n=`https://www.google.com/maps?q=${e},${t}`;window.open(n,`_blank`)},N=async e=>{await O(e),n.value=e,setTimeout(()=>{n.value=null},2e3)},P=e=>{let t=i(e);return{bars:t.bars,color:t.color}},I=()=>c.isCompactView?`py-2 px-2`:`py-4 px-3`,L=()=>{l(`toggle-view`)},R=e=>{l(`highlight-node`,e)},z=e=>{l(`unhighlight-node`,e)},B=e=>{l(`menu-ping`,e)},V=e=>{l(`show-details`,e)},H=e=>{l(`menu-delete`,e)},U=e=>{a.value===e?o.value=o.value===`asc`?`desc`:`asc`:(a.value=e,o.value=typeof c.adverts[0]?.[e]==`number`?`desc`:`asc`)},W=g(()=>a.value?[...c.adverts].sort((e,t)=>{let n=e[a.value],r=t[a.value];if(n==null)return 1;if(r==null)return-1;let i=0;return typeof n==`string`&&typeof r==`string`?i=n.localeCompare(r):typeof n==`number`&&typeof r==`number`?i=n-r:typeof n==`boolean`&&typeof r==`boolean`&&(i=n===r?0:n?1:-1),o.value===`asc`?i:-i}):c.adverts);return(t,i)=>(S(),b(`div`,Wt,[y(`div`,Gt,[y(`div`,Kt,[y(`div`,{class:`w-3 h-3 rounded-full border border-white/20`,style:x({backgroundColor:e.color})},null,4),y(`h3`,qt,s(e.contactType),1),y(`span`,Jt,[_(s(e.adverts.length)+` `,1),e.originalCount>0&&e.adverts.lengthU(`node_name`),class:m(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${I().split(` `)[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[y(`div`,en,[i[12]||=_(` Node Name `,-1),a.value===`node_name`?(S(),b(`svg`,{key:0,class:m([`w-3 h-3`,o.value===`asc`?``:`rotate-180`]),fill:`currentColor`,viewBox:`0 0 20 20`},[...i[11]||=[y(`path`,{"fill-rule":`evenodd`,d:`M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z`,"clip-rule":`evenodd`},null,-1)]],2)):p(``,!0)])],2),y(`th`,{onClick:i[1]||=e=>U(`pubkey`),class:m(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${I().split(` `)[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[y(`div`,tn,[i[14]||=_(` Public Key `,-1),a.value===`pubkey`?(S(),b(`svg`,{key:0,class:m([`w-3 h-3`,o.value===`asc`?``:`rotate-180`]),fill:`currentColor`,viewBox:`0 0 20 20`},[...i[13]||=[y(`path`,{"fill-rule":`evenodd`,d:`M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z`,"clip-rule":`evenodd`},null,-1)]],2)):p(``,!0)])],2),y(`th`,{class:m(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${I().split(` `)[1]} border-b border-stroke-subtle dark:border-white/5`)},` Location `,2),y(`th`,{class:m(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${I().split(` `)[1]} border-b border-stroke-subtle dark:border-white/5`)},` Distance `,2),y(`th`,{onClick:i[2]||=e=>U(`route_type`),class:m(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${I().split(` `)[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[y(`div`,nn,[i[16]||=_(` Route Type `,-1),a.value===`route_type`?(S(),b(`svg`,{key:0,class:m([`w-3 h-3`,o.value===`asc`?``:`rotate-180`]),fill:`currentColor`,viewBox:`0 0 20 20`},[...i[15]||=[y(`path`,{"fill-rule":`evenodd`,d:`M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z`,"clip-rule":`evenodd`},null,-1)]],2)):p(``,!0)])],2),y(`th`,{onClick:i[3]||=e=>U(`zero_hop`),class:m(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${I().split(` `)[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[y(`div`,rn,[i[18]||=_(` Zero Hop `,-1),a.value===`zero_hop`?(S(),b(`svg`,{key:0,class:m([`w-3 h-3`,o.value===`asc`?``:`rotate-180`]),fill:`currentColor`,viewBox:`0 0 20 20`},[...i[17]||=[y(`path`,{"fill-rule":`evenodd`,d:`M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z`,"clip-rule":`evenodd`},null,-1)]],2)):p(``,!0)])],2),y(`th`,{onClick:i[4]||=e=>U(`rssi`),class:m(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${I().split(` `)[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[y(`div`,an,[i[20]||=_(` RSSI `,-1),a.value===`rssi`?(S(),b(`svg`,{key:0,class:m([`w-3 h-3`,o.value===`asc`?``:`rotate-180`]),fill:`currentColor`,viewBox:`0 0 20 20`},[...i[19]||=[y(`path`,{"fill-rule":`evenodd`,d:`M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z`,"clip-rule":`evenodd`},null,-1)]],2)):p(``,!0)])],2),y(`th`,{onClick:i[5]||=e=>U(`snr`),class:m(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${I().split(` `)[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[y(`div`,on,[i[22]||=_(` SNR `,-1),a.value===`snr`?(S(),b(`svg`,{key:0,class:m([`w-3 h-3`,o.value===`asc`?``:`rotate-180`]),fill:`currentColor`,viewBox:`0 0 20 20`},[...i[21]||=[y(`path`,{"fill-rule":`evenodd`,d:`M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z`,"clip-rule":`evenodd`},null,-1)]],2)):p(``,!0)])],2),y(`th`,{onClick:i[6]||=e=>U(`last_seen`),class:m(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${I().split(` `)[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[y(`div`,sn,[i[24]||=_(` Last Seen `,-1),a.value===`last_seen`?(S(),b(`svg`,{key:0,class:m([`w-3 h-3`,o.value===`asc`?``:`rotate-180`]),fill:`currentColor`,viewBox:`0 0 20 20`},[...i[23]||=[y(`path`,{"fill-rule":`evenodd`,d:`M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z`,"clip-rule":`evenodd`},null,-1)]],2)):p(``,!0)])],2),y(`th`,{onClick:i[7]||=e=>U(`first_seen`),class:m(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${I().split(` `)[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[y(`div`,cn,[i[26]||=_(` First Seen `,-1),a.value===`first_seen`?(S(),b(`svg`,{key:0,class:m([`w-3 h-3`,o.value===`asc`?``:`rotate-180`]),fill:`currentColor`,viewBox:`0 0 20 20`},[...i[25]||=[y(`path`,{"fill-rule":`evenodd`,d:`M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z`,"clip-rule":`evenodd`},null,-1)]],2)):p(``,!0)])],2),y(`th`,{onClick:i[8]||=e=>U(`advert_count`),class:m(`text-left text-content-secondary dark:text-content-muted text-xs font-medium py-3 ${I().split(` `)[1]} border-b border-stroke-subtle dark:border-white/5 cursor-pointer hover:text-primary transition-colors select-none`)},[y(`div`,ln,[i[28]||=_(` Advert Count `,-1),a.value===`advert_count`?(S(),b(`svg`,{key:0,class:m([`w-3 h-3`,o.value===`asc`?``:`rotate-180`]),fill:`currentColor`,viewBox:`0 0 20 20`},[...i[27]||=[y(`path`,{"fill-rule":`evenodd`,d:`M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z`,"clip-rule":`evenodd`},null,-1)]],2)):p(``,!0)])],2)])]),y(`tbody`,un,[(S(!0),b(v,null,r(W.value,e=>(S(),b(`tr`,{key:e.id,class:`hover:bg-background-mute/50 dark:hover:bg-white/5 transition-colors`,onMouseenter:t=>R(e.pubkey),onMouseleave:t=>z(e.pubkey)},[y(`td`,{class:m(I())},[h(Ut,{neighbor:e,onPing:B,onShowDetails:V,onDelete:H},null,8,[`neighbor`])],2),y(`td`,{class:m(`${I()} text-content-primary dark:text-content-primary text-sm`)},s(e.node_name||`Unknown`),3),y(`td`,{class:m(`${I()} text-content-primary dark:text-content-primary text-sm font-mono`)},[y(`button`,{onClick:t=>N(e.pubkey),class:m([`text-content-primary dark:text-content-primary hover:text-primary-light transition-colors cursor-pointer underline underline-offset-2 decoration-gray-400 dark:decoration-white/30 hover:decoration-primary-light/60`,n.value===e.pubkey?`text-green-600 dark:text-green-400 decoration-green-400/60`:``]),title:n.value===e.pubkey?`Copied!`:`Click to copy full public key`},[_(s(d(e.pubkey))+` `,1),n.value===e.pubkey?(S(),b(`span`,pn,`✓`)):p(``,!0)],10,fn)],2),y(`td`,{class:m(`${I()} text-content-primary dark:text-content-primary text-sm`)},[e.latitude!==null&&e.longitude!==null?(S(),b(`div`,mn,[y(`span`,hn,s(e.latitude.toFixed(4))+`, `+s(e.longitude.toFixed(4)),1),y(`div`,gn,[y(`button`,{onClick:t=>j(e.latitude,e.longitude),class:`text-content-muted dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors cursor-pointer`,title:`Copy coordinates to clipboard`},[...i[29]||=[y(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[y(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`,stroke:`currentColor`,"stroke-width":`2`}),y(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`,stroke:`currentColor`,"stroke-width":`2`})],-1)]],8,_n),y(`button`,{onClick:t=>M(e.latitude,e.longitude),class:`text-white/60 hover:text-blue-600 dark:text-blue-400 transition-colors cursor-pointer`,title:`Open in Google Maps`},[...i[30]||=[y(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[y(`path`,{d:`M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z`,stroke:`currentColor`,"stroke-width":`2`}),y(`circle`,{cx:`12`,cy:`10`,r:`3`,stroke:`currentColor`,"stroke-width":`2`})],-1)]],8,vn)])])):(S(),b(`span`,yn,`Unknown`))],2),y(`td`,{class:m(`${I()} text-content-primary dark:text-content-primary text-sm`)},s(D(e)),3),y(`td`,{class:m(`${I()} text-content-primary dark:text-content-primary text-sm`)},[y(`span`,{class:m([`inline-block px-2 py-1 rounded-full text-xs border transition-colors`,f(e.route_type).bgColor,f(e.route_type).borderColor,f(e.route_type).textColor])},s(f(e.route_type).text),3)],2),y(`td`,{class:m(`${I()} text-content-primary dark:text-content-primary text-sm`)},[y(`span`,{class:m([`inline-block px-2 py-1 rounded-full text-xs border transition-colors`,e.zero_hop?`bg-green-100 dark:bg-green-500/20 border-green-500 dark:border-green-400/30 text-green-600 dark:text-green-400`:`bg-orange-100 dark:bg-orange-500/20 border-orange-500 dark:border-orange-400/30 text-orange-600 dark:text-orange-400`])},s(e.zero_hop?`Zero Hop`:`Multi-Hop`),3)],2),y(`td`,{class:m(`${I()} text-content-primary dark:text-content-primary text-sm`)},[y(`div`,bn,[y(`div`,xn,[(S(),b(v,null,r(5,t=>y(`div`,{key:t,class:m([`w-1 transition-colors`,t<=P(e.rssi).bars?P(e.rssi).color:`text-gray-600`]),style:x({height:`${4+t*2}px`})},[...i[31]||=[y(`div`,{class:`w-full h-full bg-current rounded-sm`},null,-1)]],6)),64))]),y(`span`,{class:m(P(e.rssi).color)},s(w(e.rssi)),3)])],2),y(`td`,{class:m(`${I()} text-content-primary dark:text-content-primary text-sm`)},s(T(e.snr)),3),y(`td`,{class:m(`${I()} text-content-primary dark:text-content-primary text-sm`)},[y(`div`,Sn,[y(`div`,{class:m([`w-2 h-2 rounded-full`,A(e.last_seen).color===`text-green-600 dark:text-green-400`?`bg-green-400`:``,A(e.last_seen).color===`text-yellow-600 dark:text-yellow-400`?`bg-yellow-400`:``,A(e.last_seen).color===`text-red-600 dark:text-red-400`?`bg-red-400`:``])},null,2),y(`span`,{class:m([A(e.last_seen).color,`cursor-help`]),title:u(e.last_seen)},s(k(e.last_seen)),11,Cn)])],2),y(`td`,{class:m(`${I()} text-content-primary dark:text-content-primary text-sm`)},[y(`span`,{title:u(e.first_seen),class:`cursor-help`},s(k(e.first_seen)),9,wn)],2),y(`td`,{class:m(`${I()} text-content-primary dark:text-content-primary text-sm text-center`)},s(e.advert_count),3)],40,dn))),128))])])]),y(`div`,Tn,[(S(!0),b(v,null,r(W.value,e=>(S(),b(`div`,{key:e.id,class:`bg-surface/50 dark:bg-transparent border border-stroke-subtle dark:border-white/10 rounded-lg p-4 hover:bg-background-mute/50 dark:hover:bg-white/5 transition-colors`,onClick:t=>R(e.pubkey)},[y(`div`,Dn,[y(`div`,On,[y(`h4`,kn,s(e.node_name||`Unknown Node`),1),y(`div`,An,[y(`span`,{class:m([`inline-block px-2 py-1 rounded-full text-xs border`,f(e.route_type).bgColor,f(e.route_type).borderColor,f(e.route_type).textColor])},s(f(e.route_type).text),3),y(`span`,{class:m([`inline-block px-2 py-1 rounded-full text-xs border`,e.zero_hop?`bg-green-100 dark:bg-green-500/20 border-green-500 dark:border-green-400/30 text-green-600 dark:text-green-400`:`bg-orange-100 dark:bg-orange-500/20 border-orange-500 dark:border-orange-400/30 text-orange-600 dark:text-orange-400`])},s(e.zero_hop?`Zero Hop`:`Multi-Hop`),3)])]),h(Ut,{neighbor:e,onPing:B,onShowDetails:V,onDelete:H},null,8,[`neighbor`])]),y(`div`,jn,[y(`div`,Mn,[y(`div`,null,[i[32]||=y(`div`,{class:`text-content-muted text-xs mb-1`},`Public Key`,-1),y(`button`,{onClick:t=>N(e.pubkey),class:m([`text-content-primary dark:text-content-primary hover:text-primary-light transition-colors cursor-pointer font-mono text-sm underline underline-offset-2 decoration-gray-400 dark:decoration-white/30 hover:decoration-primary-light/60 break-all`,n.value===e.pubkey?`text-green-600 dark:text-green-400 decoration-green-400/60`:``]),title:n.value===e.pubkey?`Copied!`:`Click to copy full public key`},[_(s(d(e.pubkey))+` `,1),n.value===e.pubkey?(S(),b(`span`,Pn,`✓`)):p(``,!0)],10,Nn)]),y(`div`,null,[i[34]||=y(`div`,{class:`text-content-muted text-xs mb-1`},`Signal`,-1),y(`div`,Fn,[y(`div`,In,[(S(),b(v,null,r(5,t=>y(`div`,{key:t,class:m([`w-1.5 transition-colors`,t<=P(e.rssi).bars?P(e.rssi).color:`text-gray-600`]),style:x({height:`${6+t*2}px`})},[...i[33]||=[y(`div`,{class:`w-full h-full bg-current rounded-sm`},null,-1)]],6)),64))]),y(`span`,{class:m(`${P(e.rssi).color} text-sm font-medium`)},s(w(e.rssi)),3)])])]),y(`div`,Ln,[y(`div`,null,[i[35]||=y(`div`,{class:`text-content-muted text-xs mb-1`},`Last Seen`,-1),y(`div`,Rn,[y(`div`,{class:m([`w-2 h-2 rounded-full`,A(e.last_seen).color===`text-green-600 dark:text-green-400`?`bg-green-400`:``,A(e.last_seen).color===`text-yellow-600 dark:text-yellow-400`?`bg-yellow-400`:``,A(e.last_seen).color===`text-red-600 dark:text-red-400`?`bg-red-400`:``])},null,2),y(`span`,{class:m(`${A(e.last_seen).color} text-sm`),title:u(e.last_seen)},s(k(e.last_seen)),11,zn)])]),y(`div`,null,[i[36]||=y(`div`,{class:`text-content-muted text-xs mb-1`},`Distance`,-1),y(`span`,Bn,s(D(e)),1)])]),e.latitude!==null&&e.longitude!==null?(S(),b(`div`,Vn,[i[39]||=y(`div`,{class:`text-content-muted text-xs mb-1`},`Location`,-1),y(`div`,Hn,[y(`span`,Un,s(e.latitude.toFixed(4))+`, `+s(e.longitude.toFixed(4)),1),y(`div`,Wn,[y(`button`,{onClick:t=>j(e.latitude,e.longitude),class:`text-content-muted dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors p-2 hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-lg`,title:`Copy coordinates`},[...i[37]||=[y(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[y(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`,stroke:`currentColor`,"stroke-width":`2`}),y(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`,stroke:`currentColor`,"stroke-width":`2`})],-1)]],8,Gn),y(`button`,{onClick:t=>M(e.latitude,e.longitude),class:`text-white/60 hover:text-blue-600 dark:text-blue-400 transition-colors p-2 hover:bg-white/10 rounded-lg`,title:`Open in Maps`},[...i[38]||=[y(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[y(`path`,{d:`M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z`,stroke:`currentColor`,"stroke-width":`2`}),y(`circle`,{cx:`12`,cy:`10`,r:`3`,stroke:`currentColor`,"stroke-width":`2`})],-1)]],8,Kn)])])])):p(``,!0),y(`div`,qn,[y(`div`,Jn,[i[40]||=y(`div`,{class:`text-content-muted text-xs mb-1`},`SNR`,-1),y(`span`,Yn,s(T(e.snr)),1)]),y(`div`,Xn,[i[41]||=y(`div`,{class:`text-content-muted text-xs mb-1`},`Adverts`,-1),y(`span`,Zn,s(e.advert_count),1)]),y(`div`,Qn,[i[42]||=y(`div`,{class:`text-content-muted text-xs mb-1`},`First Seen`,-1),y(`span`,{class:`text-content-primary dark:text-content-primary text-sm`,title:u(e.first_seen)},s(k(e.first_seen)),9,$n)])])])],8,En))),128))])]))}}),tr={class:`space-y-6`},nr={key:0,class:`flex items-center justify-center py-12`},rr={key:1,class:`bg-red-50 dark:bg-accent-red/10 border border-red-300 dark:border-accent-red/20 rounded-[15px] p-6`},ir={class:`flex items-center gap-3`},ar={class:`text-red-500 dark:text-accent-red/80 text-sm`},or={key:0,class:``},sr={class:`flex items-center justify-between`},cr={class:`flex items-center gap-3`},lr={class:`hidden lg:flex bg-background-mute dark:bg-surface-elevated/30 backdrop-blur rounded-lg border border-stroke-subtle dark:border-stroke/10 mb p-1`},ur={class:`flex items-center gap-2`},dr={key:0,class:`ml-1 bg-accent-cyan/20 text-accent-cyan border border-accent-cyan/30 text-xs px-1.5 py-0.5 rounded-full font-medium`},fr={class:`bg-background dark:bg-background/30 border border-stroke-subtle dark:border-stroke/10 rounded-lg p-4 mt-4 space-y-4`},pr={class:`grid grid-cols-1 md:grid-cols-3 gap-4`},mr={key:1,class:`text-center py-12`},hr={key:2,class:`text-center py-12`},gr=l({name:`NeighborsView`,__name:`Neighbors`,setup(e){let t=T(),n={0:`Unknown`,1:`Chat Node`,2:`Repeater`,3:`Room Server`,4:`Hybrid Node`},a={0:`#6b7280`,1:`#60a5fa`,2:`#34d399`,3:`#a855f7`,4:`#f59e0b`},o=C({}),l=C(!0),u=C(null),x=C(P(`neighbors_compactView`,!1)),E=C(P(`neighbors_showMapLegend`,typeof window<`u`?window.innerWidth>=1024:!0)),k=C(P(`neighbors_showFilters`,!1)),A=C(P(`neighbors_filters`,{zeroHop:`all`,routeType:`all`,searchText:``}));f(x,e=>N(`neighbors_compactView`,e)),f(E,e=>N(`neighbors_showMapLegend`,e)),f(k,e=>N(`neighbors_showFilters`,e)),f(A,e=>N(`neighbors_filters`,e),{deep:!0});let M=C(!1),F=C(!1),I=C(!1),L=C(null),R=C(null),z=C(null),B=C(null),V=C(!1),H=C(null),W=g(()=>{if(!B.value)return null;let e=B.value;return{id:e.id,pubkey:e.pubkey,node_name:e.node_name,contact_type:e.contact_type,latitude:e.latitude,longitude:e.longitude,rssi:e.rssi,snr:e.snr,route_type:e.route_type,last_seen:e.last_seen,first_seen:e.first_seen,advert_count:e.advert_count,timestamp:e.timestamp,is_repeater:e.is_repeater,is_new_neighbor:e.is_new_neighbor,zero_hop:e.zero_hop}}),G=g(()=>t.stats?.config?.repeater?.latitude),K=g(()=>t.stats?.config?.repeater?.longitude),ee=e=>e.filter(e=>{if(A.value.zeroHop!==`all`){let t=e.zero_hop;if(A.value.zeroHop===`true`&&!t||A.value.zeroHop===`false`&&t)return!1}if(A.value.routeType!==`all`){let t=e.route_type;if(A.value.routeType===`direct`&&t!==2||A.value.routeType===`transport_direct`&&t!==3||A.value.routeType===`flood`&&t!==1||A.value.routeType===`transport_flood`&&t!==0)return!1}if(A.value.searchText){let t=A.value.searchText.toLowerCase(),n=e.node_name?.toLowerCase()||``,r=e.pubkey.toLowerCase();if(!n.includes(t)&&!r.includes(t))return!1}return!0}),te=()=>{A.value={zeroHop:`all`,routeType:`all`,searchText:``}},q=g(()=>A.value.zeroHop!==`all`||A.value.routeType!==`all`||A.value.searchText!==``),ne=g(()=>{let e={};for(let[t,n]of Object.entries(o.value))e[t]=ee(n);return e}),re=g(()=>Object.entries(n).filter(([e])=>ne.value[e]?.length>0).sort(([e],[t])=>parseInt(e)-parseInt(t))),ie=g(()=>Object.values(o.value).flat().filter(e=>{let t=e.latitude,n=e.longitude;return t!=null&&t!==0&&n!=null&&n!==0&&typeof t==`number`&&typeof n==`number`&&!isNaN(t)&&!isNaN(n)&&e.zero_hop===!0})),ae=async e=>{try{let t=await w.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(e)}&hours=168`);return t.success&&Array.isArray(t.data)?t.data:[]}catch(t){return console.error(`Error fetching adverts for contact type ${e}:`,t),[]}},oe=async()=>{l.value=!0,u.value=null;try{o.value={};for(let[e,t]of Object.entries(n)){let n=await ae(t);n.length>0&&(o.value[e]=n)}}catch(e){console.error(`Error loading adverts:`,e),u.value=e instanceof Error?e.message:`Failed to load neighbor data`}finally{l.value=!1}},se=C(),ce=e=>{se.value?.highlightNode(e)},le=e=>{se.value?.unhighlightNode(e)},ue=async e=>{let n=e;L.value=null,R.value=null,I.value=!0,z.value=n.node_name||`Unknown Node`,F.value=!0;try{let e=t.stats?.config?.mesh?.path_hash_mode??0,r=(e===2?3:e===1?2:1)*2,i=`0x${parseInt(n.pubkey.substring(0,r),16).toString(16).padStart(r,`0`)}`,a=await w.pingNeighbor(i,10);a.success&&a.data?L.value=a.data:(R.value=a.error||`Unknown error occurred`,console.error(`Failed to ping neighbor:`,a.error))}catch(e){console.error(`Error pinging neighbor:`,e),R.value=e instanceof Error?e.message:`Unknown error occurred`}finally{I.value=!1}},de=()=>{F.value=!1,L.value=null,R.value=null,z.value=null},fe=e=>{B.value=e,M.value=!0},pe=e=>{H.value=e,V.value=!0},me=()=>{V.value=!1,H.value=null},he=()=>{M.value=!1,B.value=null},ge=async e=>{try{await w.deleteAdvert(e),await oe(),he()}catch(e){console.error(`Error deleting neighbor:`,e)}};return i(async()=>{await oe()}),(e,t)=>(S(),b(`div`,tr,[l.value?(S(),b(`div`,nr,[...t[7]||=[y(`div`,{class:`text-center`},[y(`div`,{class:`animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto mb-4`}),y(`p`,{class:`text-content-secondary dark:text-content-muted`},`Loading neighbor data...`)],-1)]])):u.value?(S(),b(`div`,rr,[y(`div`,ir,[t[9]||=y(`svg`,{class:`w-5 h-5 text-red-600 dark:text-accent-red`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L4.082 16.5c-.77.833.192 2.5 1.732 2.5z`})],-1),y(`div`,null,[t[8]||=y(`h3`,{class:`text-red-600 dark:text-accent-red font-medium`},`Error Loading Neighbors`,-1),y(`p`,ar,s(u.value),1)])])])):(S(),b(v,{key:2},[h(Vt,{ref_key:`networkMapRef`,ref:se,adverts:ie.value,"base-latitude":G.value,"base-longitude":K.value,"show-legend":E.value,"onUpdate:showLegend":t[0]||=e=>E.value=e},null,8,[`adverts`,`base-latitude`,`base-longitude`,`show-legend`]),Object.keys(o.value).length>0?(S(),b(`div`,or,[y(`div`,sr,[t[14]||=y(`span`,{class:`text-content-primary dark:text-content-primary text-lg font-semibold`},null,-1),y(`div`,cr,[y(`div`,lr,[y(`button`,{onClick:t[1]||=e=>x.value=!1,class:m([`p-2 rounded-md transition-colors`,x.value?`text-content-secondary dark:text-content-muted hover:text-primary hover:bg-primary/10`:`bg-primary/20 text-primary border border-primary/30`]),title:`Comfortable view`},[...t[10]||=[y(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[y(`rect`,{x:`3`,y:`3`,width:`18`,height:`6`,rx:`2`,stroke:`currentColor`,"stroke-width":`2`}),y(`rect`,{x:`3`,y:`12`,width:`18`,height:`6`,rx:`2`,stroke:`currentColor`,"stroke-width":`2`})],-1)]],2),y(`button`,{onClick:t[2]||=e=>x.value=!0,class:m([`p-2 rounded-md transition-colors`,x.value?`bg-primary/20 text-primary border border-primary/30`:`text-content-secondary dark:text-content-muted hover:text-primary hover:bg-primary/10`]),title:`Compact view`},[...t[11]||=[y(`svg`,{width:`18`,height:`18`,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[y(`rect`,{x:`3`,y:`3`,width:`18`,height:`4`,rx:`2`,stroke:`currentColor`,"stroke-width":`2`}),y(`rect`,{x:`3`,y:`10`,width:`18`,height:`4`,rx:`2`,stroke:`currentColor`,"stroke-width":`2`}),y(`rect`,{x:`3`,y:`17`,width:`18`,height:`4`,rx:`2`,stroke:`currentColor`,"stroke-width":`2`})],-1)]],2)]),y(`div`,ur,[y(`button`,{onClick:t[3]||=e=>k.value=!k.value,class:m([`px-3 py-1.5 text-xs rounded-lg transition-colors border`,q.value?`bg-primary/20 text-primary border-primary/30`:`bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-primary border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-white/20`])},[t[12]||=y(`svg`,{class:`w-4 h-4 inline mr-1`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[y(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707v6.586a1 1 0 01-1.447.894l-4-2A1 1 0 717 18.586V13.414a1 1 0 00-.293-.707L.293 6.293A1 1 0 010 5.586V3a1 1 0 011-1z`})],-1),t[13]||=_(` Filters `,-1),q.value?(S(),b(`span`,dr,` Active `)):p(``,!0)],2),q.value?(S(),b(`button`,{key:0,onClick:te,class:`px-3 py-1.5 text-xs rounded-lg bg-background-mute dark:bg-white/10 text-content-secondary dark:text-content-primary border border-stroke-subtle dark:border-stroke/20 hover:bg-stroke-subtle dark:hover:bg-white/20 transition-colors`},` Clear Filters `)):p(``,!0)])])]),d(y(`div`,fr,[y(`div`,pr,[y(`div`,null,[t[16]||=y(`label`,{class:`block text-xs font-medium text-content-secondary dark:text-content-muted mb-1`},`Zero Hop`,-1),d(y(`select`,{"onUpdate:modelValue":t[4]||=e=>A.value.zeroHop=e,class:`w-full bg-surface dark:bg-surface/50 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:border-primary/50 focus:outline-none`},[...t[15]||=[y(`option`,{value:`all`},`All Nodes`,-1),y(`option`,{value:`true`},`Zero Hop Only`,-1),y(`option`,{value:`false`},`Multi-Hop Only`,-1)]],512),[[j,A.value.zeroHop]])]),y(`div`,null,[t[18]||=y(`label`,{class:`block text-xs font-medium text-content-secondary dark:text-content-muted mb-1`},`Route Type`,-1),d(y(`select`,{"onUpdate:modelValue":t[5]||=e=>A.value.routeType=e,class:`w-full bg-surface dark:bg-surface/50 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:border-primary/50 focus:outline-none`},[...t[17]||=[c(``,5)]],512),[[j,A.value.routeType]])]),y(`div`,null,[t[19]||=y(`label`,{class:`block text-xs font-medium text-content-secondary dark:text-content-muted mb-1`},`Search`,-1),d(y(`input`,{"onUpdate:modelValue":t[6]||=e=>A.value.searchText=e,type:`text`,placeholder:`Node name or pubkey...`,class:`w-full bg-surface dark:bg-surface/50 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-3 py-2 text-content-primary dark:text-content-primary text-sm focus:border-primary/50 focus:outline-none placeholder-gray-400 dark:placeholder-white/40`},null,512),[[D,A.value.searchText]])])])],512),[[O,k.value]])])):p(``,!0),(S(!0),b(v,null,r(re.value,([e,t])=>(S(),b(`div`,{key:e,class:`space-y-6`},[h(er,{"contact-type":t,"contact-type-key":e,adverts:ne.value[e],"original-count":o.value[e]?.length||0,color:a[parseInt(e)],"base-latitude":G.value,"base-longitude":K.value,"is-compact-view":x.value,"is-first-table":!1,"show-view-toggle":!1,onHighlightNode:ce,onUnhighlightNode:le,onMenuPing:ue,onMenuDelete:fe,onShowDetails:pe},null,8,[`contact-type`,`contact-type-key`,`adverts`,`original-count`,`color`,`base-latitude`,`base-longitude`,`is-compact-view`])]))),128)),re.value.length===0&&Object.keys(o.value).length===0?(S(),b(`div`,mr,[t[20]||=c(`

No Neighbors Found

No mesh neighbors have been discovered in your area yet.

`,3),y(`button`,{onClick:oe,class:`mt-4 px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors`},` Refresh `)])):re.value.length===0&&q.value?(S(),b(`div`,hr,[t[21]||=c(`

No neighbors match your filters

Try adjusting your filter criteria to see more results.

`,3),y(`button`,{onClick:te,class:`px-4 py-2 bg-primary/20 text-primary border border-primary/30 rounded-lg hover:bg-primary/30 transition-colors`},` Clear Filters `)])):p(``,!0)],64)),h(U,{show:M.value,neighbor:W.value,onClose:he,onDelete:ge},null,8,[`show`,`neighbor`]),h(ke,{show:F.value,"node-name":z.value,result:L.value,error:R.value,loading:I.value,onClose:de},null,8,[`show`,`node-name`,`result`,`error`,`loading`]),h(gt,{"is-open":V.value,neighbor:H.value,"base-latitude":G.value,"base-longitude":K.value,onClose:me},null,8,[`is-open`,`neighbor`,`base-latitude`,`base-longitude`])]))}});export{gr as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/RFNoiseFloor-D00K9PjZ.js b/repeater/web/html/assets/RFNoiseFloor-D00K9PjZ.js new file mode 100644 index 0000000..fba6578 --- /dev/null +++ b/repeater/web/html/assets/RFNoiseFloor-D00K9PjZ.js @@ -0,0 +1 @@ +import{n as e}from"./index-CPWfwDmA.js";export{e as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/RoomServers-CGLfVLxc.js b/repeater/web/html/assets/RoomServers-CGLfVLxc.js deleted file mode 100644 index 449d8f6..0000000 --- a/repeater/web/html/assets/RoomServers-CGLfVLxc.js +++ /dev/null @@ -1 +0,0 @@ -import{a as ve,r as d,E as xe,o as be,L as x,e as s,f as e,g as Q,h as u,j as G,l as b,t as a,k as h,F as D,i as q,w as m,v,X as Y,x as Z,q as n}from"./index-xzvnOpJo.js";import{g as ye,s as ge}from"./preferences-DtwbSSgO.js";import{_ as ke}from"./ConfirmDialog.vue_vue_type_script_setup_true_lang-7siCLFWH.js";import{_ as fe}from"./MessageDialog.vue_vue_type_script_setup_true_lang-SzTqrYUh.js";const he={class:"p-6 space-y-6"},we={class:"relative overflow-hidden rounded-[20px] p-6 mb-6 glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10"},_e={class:"relative flex items-center justify-between"},Ce={key:0,class:"grid grid-cols-1 md:grid-cols-3 gap-4"},Me={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},je={class:"relative flex items-center justify-between"},Le={class:"text-3xl font-bold text-content-primary dark:text-content-primary mb-1"},Se={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},$e={class:"relative flex items-center justify-between"},Ae={class:"text-3xl font-bold text-primary mb-1"},Ve={class:"group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer"},Be={class:"relative flex items-center justify-between"},Re={key:0,class:"w-6 h-6 text-accent-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},ze={key:1,class:"w-6 h-6 text-accent-yellow",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Ee={class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6"},Fe={key:0,class:"flex items-center justify-center py-12"},Ie={key:1,class:"flex items-center justify-center py-12"},De={class:"text-center"},Ne={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},Ue={key:2,class:"space-y-4"},He={class:"relative flex items-start justify-between"},Ke={class:"flex-1"},Oe={class:"flex items-center gap-3 mb-4"},Pe={class:"relative"},Te={key:0,class:"absolute inset-0 bg-accent-green/50 rounded-full animate-ping"},Ge={class:"text-xl font-bold text-content-primary dark:text-content-primary group-hover:text-primary transition-colors"},qe={key:0,class:"text-content-muted dark:text-content-muted text-sm"},Je={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3"},We={class:"text-content-primary dark:text-content-primary/90 ml-2"},Xe={class:"flex items-center gap-2"},Qe={key:0,class:"text-content-primary dark:text-content-primary/90 font-mono ml-2 text-xs"},Ye={key:1,class:"text-content-muted dark:text-content-muted ml-2 text-xs"},Ze=["onClick"],et={class:"text-content-primary dark:text-content-primary/90 ml-2"},tt={key:0},rt={class:"text-content-primary dark:text-content-primary/90 ml-2"},ot={key:0,class:"text-accent-green"},st={key:1,class:"text-content-muted dark:text-content-muted"},nt={key:2,class:"text-primary"},at={key:0,class:"text-xs text-content-muted dark:text-content-muted font-mono"},lt={class:"ml-4 flex flex-wrap gap-2"},dt=["onClick","disabled","title"],it=["onClick","disabled","title"],ut=["onClick"],ct=["onClick"],pt={key:3,class:"text-center py-12 text-content-secondary dark:text-content-muted"},mt={key:1,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},vt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},xt={class:"space-y-4"},bt={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},yt={key:0},gt={key:1,class:"text-content-secondary dark:text-content-muted text-sm"},kt={class:"grid grid-cols-2 gap-4"},ft={class:"grid grid-cols-2 gap-4"},ht={key:2,class:"fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4"},wt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto"},_t={class:"space-y-4"},Ct=["value"],Mt={class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},jt={key:0},Lt={key:1,class:"text-content-secondary dark:text-content-muted text-sm"},St={class:"grid grid-cols-2 gap-4"},$t={class:"grid grid-cols-2 gap-4"},At={key:0,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-50 p-4"},Vt={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 max-w-4xl w-full h-[85vh] flex flex-col shadow-2xl"},Bt={class:"relative overflow-hidden rounded-[15px] mb-6 p-5 bg-white/50 dark:bg-white/5 border border-stroke-subtle dark:border-white/10"},Rt={class:"relative flex items-center justify-between"},zt={class:"flex items-center gap-4"},Et={class:"text-content-secondary dark:text-content-muted text-sm flex items-center gap-2"},Ft={class:"text-primary font-semibold"},It={class:"flex items-center gap-2"},Dt={class:"bg-primary/30 px-1.5 py-0.5 rounded-full text-[10px]"},Nt={class:"flex-1 overflow-y-auto mb-4 space-y-3"},Ut={key:0,class:"flex items-center justify-center py-12"},Ht={key:1,class:"flex items-center justify-center py-12"},Kt={class:"text-center"},Ot={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},Pt={key:2,class:"space-y-3"},Tt={class:"relative flex items-start justify-between gap-3"},Gt={class:"flex-1 min-w-0"},qt={class:"flex items-center gap-2 mb-3"},Jt={class:"flex items-center gap-2 flex-wrap"},Wt={key:0,class:"text-primary text-sm font-bold"},Xt={key:1,class:"text-primary/80 text-xs font-mono bg-primary/10 px-2 py-1 rounded-md border border-primary/20"},Qt={key:2,class:"text-content-muted dark:text-content-muted text-xs"},Yt={class:"text-content-secondary dark:text-content-muted text-xs flex items-center gap-1"},Zt={key:3,class:"text-content-muted dark:text-content-muted/50 text-[10px] font-mono bg-background-mute dark:bg-white/5 px-1.5 py-0.5 rounded"},er={class:"text-content-primary dark:text-content-primary/90 text-sm leading-relaxed break-words whitespace-pre-wrap bg-gray-50 dark:bg-white/5 p-3 rounded-[10px] border border-stroke-subtle dark:border-white/5"},tr=["onClick"],rr={key:0,class:"text-center pt-4"},or={key:1,class:"text-center pt-4"},sr={key:3,class:"flex items-center justify-center h-full"},nr={class:"relative overflow-hidden rounded-[15px] border-t border-stroke-subtle dark:border-white/20 pt-4 mt-4"},ar={class:"relative space-y-3"},lr={class:"flex gap-3"},dr={class:"flex-1 relative"},ir=["onKeydown"],ur=["disabled"],cr={key:1,class:"fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-[60] p-4"},pr={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-3xl w-full max-h-[80vh] flex flex-col"},mr={class:"flex items-center justify-between mb-4 pb-4 border-b border-stroke-subtle dark:border-white/10"},vr={class:"text-content-secondary dark:text-content-primary/70 text-sm mt-1"},xr={class:"text-primary"},br={class:"flex-1 overflow-y-auto space-y-3"},yr={key:0,class:"text-center py-12"},gr={class:"space-y-2"},kr={class:"flex items-center justify-between"},fr={class:"flex items-center gap-2"},hr={class:"text-content-primary dark:text-content-primary font-semibold"},wr={class:"flex items-center gap-2"},_r={class:"text-content-secondary dark:text-content-muted text-xs"},Cr=["onClick"],Mr={class:"space-y-1 text-xs"},jr={class:"flex items-center gap-2"},Lr={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded"},Sr={class:"flex items-center gap-2"},$r={class:"text-primary font-mono bg-primary/10 px-2 py-0.5 rounded text-[10px] break-all"},Ar={class:"flex items-center justify-between text-xs text-content-secondary dark:text-content-muted"},Vr={class:"flex items-center gap-4"},Br={key:0},Rr={key:1},zr={key:0},Ur=ve({name:"RoomServersView",__name:"RoomServers",setup(Er){const N=d(!1),j=d(null),c=d(null),L=d(!1),B=d(!1),l=d(null),w=d(!1),_=d(!1),S=d(new Set),R=d(!1),z=d(""),U=d(!1),H=d({message:"",variant:"success"}),K=d(!1),y=d(""),E=d(""),g=d([]),$=d(!1),C=d(null),k=d(""),F=d(ye("roomServers_messagesLimit",50)),I=d(0),O=d(!0);xe(F,o=>ge("roomServers_messagesLimit",o));const M=d([]),P=d(!1),p=d({name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}});be(async()=>{await A()});async function A(){N.value=!0,j.value=null;try{const o=await x.getIdentities();o.success?c.value=o.data:j.value=o.error||"Failed to load identities"}catch(o){j.value=o instanceof Error?o.message:"Failed to load identities"}finally{N.value=!1}}async function ee(){try{const o=await x.createIdentity(p.value);o.success?(L.value=!1,J(),await A(),i(o.message||"Identity created successfully!","success")):i(`Failed to create identity: ${o.error}`,"error")}catch(o){i(`Error creating identity: ${o}`,"error")}}async function te(){try{const o=await x.updateIdentity(l.value);o.success?(B.value=!1,l.value=null,await A(),i(o.message||"Identity updated successfully!","success")):i(`Failed to update identity: ${o.error}`,"error")}catch(o){i(`Error updating identity: ${o}`,"error")}}function re(o){z.value=o,R.value=!0}async function oe(){const o=z.value;R.value=!1;try{const t=await x.deleteIdentity(o);t.success?(await A(),i(t.message||"Identity deleted successfully!","success")):i(`Failed to delete identity: ${t.error}`,"error")}catch(t){i(`Error deleting identity: ${t}`,"error")}finally{z.value=""}}function i(o,t){H.value={message:o,variant:t},U.value=!0}async function se(o){try{const t=await x.sendRoomServerAdvert(o);t.success?i(t.message||`Advert sent for '${o}'!`,"success"):i(`Failed to send advert: ${t.error}`,"error")}catch(t){i(`Error sending advert: ${t}`,"error")}}function ne(o){l.value=JSON.parse(JSON.stringify(o)),l.value.settings||(l.value.settings={}),l.value.settings.admin_password||(l.value.settings.admin_password=""),l.value.settings.guest_password||(l.value.settings.guest_password=""),_.value=!1,B.value=!0}function J(){p.value={name:"",identity_key:"",type:"room_server",settings:{node_name:"",latitude:0,longitude:0,admin_password:"",guest_password:""}},w.value=!1}function W(){L.value=!1,B.value=!1,l.value=null,w.value=!1,_.value=!1,J()}function ae(o){S.value.has(o)?S.value.delete(o):S.value.add(o)}async function le(o){y.value=o,K.value=!0,I.value=0,O.value=!0;const t=c.value?.configured.find(r=>r.name===o);E.value=t?.hash||"",await X(),await V(!0)}async function X(){try{console.log("Fetching ACL clients for room:",y.value,"hash:",E.value);const o=await x.getACLClients({identity_hash:E.value,identity_name:y.value});console.log("ACL clients response:",o),o.success&&o.data&&(M.value=o.data.clients||[],console.log("ACL clients loaded:",M.value.length))}catch(o){console.error("Failed to fetch ACL clients:",o)}}async function V(o=!1){o&&(I.value=0,g.value=[]),$.value=!0,C.value=null;try{const t=await x.getRoomMessages({room_name:y.value,limit:F.value,offset:I.value});if(t.success&&t.data){const r=t.data.messages||[];o?g.value=r:g.value=[...g.value,...r],O.value=r.length===F.value}else C.value=t.error||"Failed to load messages"}catch(t){C.value=t instanceof Error?t.message:"Failed to load messages"}finally{$.value=!1}}async function de(){I.value+=F.value,await V(!1)}async function T(){if(k.value.trim())try{const o=await x.postRoomMessage({room_name:y.value,message:k.value,author_pubkey:"server"});o.success?(k.value="",await V(!0)):i(`Failed to send message: ${o.error}`,"error")}catch(o){i(`Error sending message: ${o}`,"error")}}async function ie(o){if(confirm("Are you sure you want to delete this message?"))try{const t=await x.deleteRoomMessage({room_name:y.value,message_id:o});t.success?(await V(!0),i("Message deleted successfully","success")):i(`Failed to delete message: ${t.error}`,"error")}catch(t){i(`Error deleting message: ${t}`,"error")}}function ue(){K.value=!1,y.value="",E.value="",g.value=[],k.value="",C.value=null,M.value=[]}function ce(o){return o?new Date(o*1e3).toLocaleString():"Unknown"}async function pe(o,t){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const r=await x.removeACLClient({public_key:o,identity_hash:t});r.success?(await X(),i("Client removed successfully","success")):i(`Failed to remove client: ${r.error}`,"error")}catch(r){i(`Error removing client: ${r}`,"error")}}return(o,t)=>(n(),s(D,null,[e("div",he,[e("div",we,[t[26]||(t[26]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50"},null,-1)),t[27]||(t[27]=e("div",{class:"absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse"},null,-1)),e("div",_e,[t[25]||(t[25]=G('

Room Servers

Manage room server identities and messages

',1)),e("button",{onClick:t[0]||(t[0]=r=>L.value=!0),class:"group relative px-6 py-3 bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary rounded-[12px] border border-primary/50 transition-all hover:scale-105 hover:shadow-lg hover:shadow-primary/20"},t[24]||(t[24]=[e("span",{class:"flex items-center gap-2"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})]),b(" Add Room Server ")],-1)]))])]),c.value&&c.value.total_configured>0?(n(),s("div",Ce,[e("div",Me,[t[30]||(t[30]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",je,[e("div",null,[t[28]||(t[28]=e("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Total Configured",-1)),e("div",Le,a(c.value.total_configured),1)]),t[29]||(t[29]=e("div",{class:"bg-background-mute dark:bg-white/10 p-3 rounded-[12px] group-hover:bg-background-mute dark:group-hover:bg-stroke/20 transition-colors"},[e("svg",{class:"w-6 h-6 text-content-secondary dark:text-content-primary/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"})])],-1))])]),e("div",Se,[t[33]||(t[33]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-primary/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",$e,[e("div",null,[t[31]||(t[31]=e("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Currently Registered",-1)),e("div",Ae,a(c.value.total_registered),1)]),t[32]||(t[32]=e("div",{class:"bg-primary/20 p-3 rounded-[12px] group-hover:bg-primary/30 transition-colors"},[e("svg",{class:"w-6 h-6 text-primary",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})])],-1))])]),e("div",Ve,[t[37]||(t[37]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-accent-green/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",Be,[e("div",null,[t[34]||(t[34]=e("div",{class:"text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide"},"Status",-1)),e("div",{class:h(["text-3xl font-bold",c.value.total_registered===c.value.total_configured?"text-accent-green":"text-accent-yellow"])},a(c.value.total_registered===c.value.total_configured?"Synced":"Out of Sync"),3)]),e("div",{class:h(["p-3 rounded-[12px] transition-colors",c.value.total_registered===c.value.total_configured?"bg-accent-green/20 group-hover:bg-accent-green/30":"bg-accent-yellow/20 group-hover:bg-accent-yellow/30"])},[c.value.total_registered===c.value.total_configured?(n(),s("svg",Re,t[35]||(t[35]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)]))):(n(),s("svg",ze,t[36]||(t[36]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"},null,-1)])))],2)])])])):u("",!0),e("div",Ee,[N.value?(n(),s("div",Fe,t[38]||(t[38]=[e("div",{class:"text-center"},[e("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),e("div",{class:"text-content-secondary dark:text-content-primary/70"},"Loading room servers...")],-1)]))):j.value?(n(),s("div",Ie,[e("div",De,[t[39]||(t[39]=e("div",{class:"text-red-600 dark:text-red-400 mb-2"},"Failed to load room servers",-1)),e("div",Ne,a(j.value),1),e("button",{onClick:A,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):c.value&&c.value.configured.length>0?(n(),s("div",Ue,[(n(!0),s(D,null,q(c.value.configured,r=>(n(),s("div",{key:r.name,class:"group relative overflow-hidden glass-card backdrop-blur-xl rounded-[15px] p-5 border border-stroke-subtle dark:border-white/10 hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300"},[t[46]||(t[46]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",He,[e("div",Ke,[e("div",Oe,[e("div",Pe,[r.registered?(n(),s("div",Te)):u("",!0),e("div",{class:h(["relative w-3 h-3 rounded-full",r.registered?"bg-accent-green":"bg-accent-red"])},null,2)]),e("h3",Ge,a(r.name),1),e("span",{class:h(["px-3 py-1 text-xs font-semibold rounded-full",r.registered?"bg-accent-green/20 text-accent-green border border-accent-green/30":"bg-accent-red/20 text-accent-red border border-accent-red/30"])},a(r.registered?"● Active":"○ Inactive"),3),r.hash?(n(),s("span",qe,a(r.hash),1)):u("",!0)]),e("div",Je,[e("div",null,[t[40]||(t[40]=e("span",{class:"text-content-muted dark:text-content-muted"},"Node Name:",-1)),e("span",We,a(r.settings?.node_name||"Not set"),1)]),e("div",Xe,[t[41]||(t[41]=e("span",{class:"text-content-muted dark:text-content-muted"},"Identity Key:",-1)),S.value.has(r.name)?(n(),s("span",Qe,a(r.identity_key),1)):(n(),s("span",Ye," •••••••••••••••• ")),e("button",{onClick:f=>ae(r.name),class:"text-primary/70 hover:text-primary text-xs underline"},a(S.value.has(r.name)?"Hide":"Show"),9,Ze)]),e("div",null,[t[42]||(t[42]=e("span",{class:"text-content-muted dark:text-content-muted"},"Location:",-1)),e("span",et,a(r.settings?.latitude||0)+", "+a(r.settings?.longitude||0),1)]),r.settings?.admin_password||r.settings?.guest_password?(n(),s("div",tt,[t[43]||(t[43]=e("span",{class:"text-content-muted dark:text-content-muted"},"Passwords:",-1)),e("span",rt,[r.settings?.admin_password?(n(),s("span",ot,"Admin")):u("",!0),r.settings?.admin_password&&r.settings?.guest_password?(n(),s("span",st," / ")):u("",!0),r.settings?.guest_password?(n(),s("span",nt,"Guest")):u("",!0)])])):u("",!0)]),r.address?(n(),s("div",at," Address: "+a(r.address),1)):u("",!0)]),e("div",lt,[e("button",{onClick:f=>le(r.name),disabled:!r.registered,class:h(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",r.registered?"bg-secondary/20 hover:bg-secondary/30 text-secondary border border-secondary/30 hover:scale-105 hover:shadow-lg hover:shadow-secondary/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"]),title:r.registered?"Manage messages for this room":"Room server must be active to manage messages"},t[44]||(t[44]=[e("svg",{class:"w-4 h-4 group-hover:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})],-1),b(" Messages ",-1)]),10,dt),e("button",{onClick:f=>se(r.name),disabled:!r.registered,class:h(["group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2",r.registered?"bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/30 hover:scale-105 hover:shadow-lg hover:shadow-accent-green/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"]),title:r.registered?"Send advert for this room server":"Room server must be active to send advert"},t[45]||(t[45]=[e("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 10V3L4 14h7v7l9-11h-7z"})],-1),b(" Send Advert ",-1)]),10,it),e("button",{onClick:f=>ne(r),class:"px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors"}," Edit ",8,ut),e("button",{onClick:f=>re(r.name),class:"px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors"}," Delete ",8,ct)])])]))),128))])):(n(),s("div",pt,[t[47]||(t[47]=e("svg",{class:"w-16 h-16 mx-auto mb-4 text-content-muted dark:text-content-muted/60",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})],-1)),t[48]||(t[48]=e("p",{class:"text-lg mb-2"},"No room servers configured",-1)),t[49]||(t[49]=e("p",{class:"text-sm mb-4"},"Add your first room server to get started",-1)),e("button",{onClick:t[1]||(t[1]=r=>L.value=!0),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," + Add Room Server ")]))]),L.value?(n(),s("div",mt,[e("div",vt,[t[60]||(t[60]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Add Room Server",-1)),e("div",xt,[e("div",null,[t[50]||(t[50]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Name *",-1)),m(e("input",{"onUpdate:modelValue":t[2]||(t[2]=r=>p.value.name=r),type:"text",placeholder:"e.g., MainBBS",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.name]])]),e("div",null,[e("label",bt,[t[51]||(t[51]=b(" Identity Key (Optional) ",-1)),e("button",{onClick:t[3]||(t[3]=r=>w.value=!w.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},a(w.value?"Hide":"Show/Edit"),1)]),w.value?(n(),s("div",yt,[m(e("input",{"onUpdate:modelValue":t[4]||(t[4]=r=>p.value.identity_key=r),type:"text",placeholder:"Leave empty to auto-generate",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.identity_key]]),t[52]||(t[52]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Leave empty to automatically generate a secure key",-1))])):(n(),s("div",gt," Will be auto-generated if not provided "))]),e("div",null,[t[53]||(t[53]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),m(e("input",{"onUpdate:modelValue":t[5]||(t[5]=r=>p.value.settings.node_name=r),type:"text",placeholder:"Display name for the room server",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.node_name]])]),e("div",kt,[e("div",null,[t[54]||(t[54]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Latitude",-1)),m(e("input",{"onUpdate:modelValue":t[6]||(t[6]=r=>p.value.settings.latitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.latitude,void 0,{number:!0}]])]),e("div",null,[t[55]||(t[55]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Longitude",-1)),m(e("input",{"onUpdate:modelValue":t[7]||(t[7]=r=>p.value.settings.longitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.longitude,void 0,{number:!0}]])])]),e("div",ft,[e("div",null,[t[56]||(t[56]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Admin Password (Optional)",-1)),m(e("input",{"onUpdate:modelValue":t[8]||(t[8]=r=>p.value.settings.admin_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.admin_password]]),t[57]||(t[57]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Full access to room server",-1))]),e("div",null,[t[58]||(t[58]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Guest Password (Optional)",-1)),m(e("input",{"onUpdate:modelValue":t[9]||(t[9]=r=>p.value.settings.guest_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,p.value.settings.guest_password]]),t[59]||(t[59]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Read-only access",-1))])])]),e("div",{class:"flex justify-end gap-3 mt-6"},[e("button",{onClick:W,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),e("button",{onClick:ee,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Create ")])])])):u("",!0),B.value&&l.value?(n(),s("div",ht,[e("div",wt,[t[72]||(t[72]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary mb-4"},"Edit Room Server",-1)),e("div",_t,[e("div",null,[t[61]||(t[61]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Current Name",-1)),e("input",{value:l.value.name,disabled:"",type:"text",class:"w-full bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-muted dark:text-content-muted cursor-not-allowed"},null,8,Ct)]),e("div",null,[t[62]||(t[62]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"New Name (optional)",-1)),m(e("input",{"onUpdate:modelValue":t[10]||(t[10]=r=>l.value.new_name=r),type:"text",placeholder:"Leave empty to keep current name",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.new_name]])]),e("div",null,[e("label",Mt,[t[63]||(t[63]=b(" Identity Key (Optional) ",-1)),e("button",{onClick:t[11]||(t[11]=r=>_.value=!_.value),type:"button",class:"ml-2 text-primary/70 hover:text-primary text-xs underline"},a(_.value?"Hide":"Show/Edit"),1)]),_.value?(n(),s("div",jt,[m(e("input",{"onUpdate:modelValue":t[12]||(t[12]=r=>l.value.identity_key=r),type:"text",placeholder:"Leave empty to keep current key",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.identity_key]]),t[64]||(t[64]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Leave empty to keep the current identity key",-1))])):(n(),s("div",Lt,' Click "Show/Edit" to change the identity key '))]),e("div",null,[t[65]||(t[65]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Node Name",-1)),m(e("input",{"onUpdate:modelValue":t[13]||(t[13]=r=>l.value.settings.node_name=r),type:"text",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.node_name]])]),e("div",St,[e("div",null,[t[66]||(t[66]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Latitude",-1)),m(e("input",{"onUpdate:modelValue":t[14]||(t[14]=r=>l.value.settings.latitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.latitude,void 0,{number:!0}]])]),e("div",null,[t[67]||(t[67]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Longitude",-1)),m(e("input",{"onUpdate:modelValue":t[15]||(t[15]=r=>l.value.settings.longitude=r),type:"number",step:"0.000001",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.longitude,void 0,{number:!0}]])])]),e("div",$t,[e("div",null,[t[68]||(t[68]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Admin Password",-1)),m(e("input",{"onUpdate:modelValue":t[16]||(t[16]=r=>l.value.settings.admin_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.admin_password]]),t[69]||(t[69]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Full access to room server",-1))]),e("div",null,[t[70]||(t[70]=e("label",{class:"block text-content-secondary dark:text-content-primary/70 text-sm mb-2"},"Guest Password",-1)),m(e("input",{"onUpdate:modelValue":t[17]||(t[17]=r=>l.value.settings.guest_password=r),type:"password",placeholder:"Leave empty for no password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors"},null,512),[[v,l.value.settings.guest_password]]),t[71]||(t[71]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-1"},"Read-only access",-1))])])]),e("div",{class:"flex justify-end gap-3 mt-6"},[e("button",{onClick:W,class:"px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors"}," Cancel "),e("button",{onClick:te,class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors"}," Update ")])])])):u("",!0)]),Q(ke,{show:R.value,title:"Delete Room Server",message:`Are you sure you want to delete '${z.value}'? This action cannot be undone.`,"confirm-text":"Delete","cancel-text":"Cancel",variant:"danger",onClose:t[18]||(t[18]=r=>R.value=!1),onConfirm:oe},null,8,["show","message"]),Q(fe,{show:U.value,message:H.value.message,variant:H.value.variant,onClose:t[19]||(t[19]=r=>U.value=!1)},null,8,["show","message","variant"]),K.value?(n(),s("div",At,[e("div",Vt,[e("div",Bt,[t[79]||(t[79]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/20 via-primary/20 to-accent-purple/20"},null,-1)),t[80]||(t[80]=e("div",{class:"absolute inset-0 bg-gradient-to-br from-transparent via-white/5 to-transparent"},null,-1)),e("div",Rt,[e("div",zt,[t[75]||(t[75]=G('
',1)),e("div",null,[t[74]||(t[74]=e("h2",{class:"text-2xl font-bold text-content-primary dark:text-content-primary mb-1"},"Room Messages",-1)),e("p",Et,[t[73]||(t[73]=e("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})],-1)),e("span",Ft,a(y.value),1)])])]),e("div",It,[e("button",{onClick:t[20]||(t[20]=r=>P.value=!0),class:"group px-3 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-[10px] text-xs font-medium transition-all hover:scale-105 border border-primary/30 flex items-center gap-2",title:"View active sessions"},[t[76]||(t[76]=e("svg",{class:"w-4 h-4 group-hover:scale-110 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})],-1)),t[77]||(t[77]=e("span",{class:"hidden sm:inline"},"Sessions",-1)),e("span",Dt,a(M.value.length),1)]),e("button",{onClick:ue,class:"p-2 text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-[10px] transition-all"},t[78]||(t[78]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))])])]),e("div",Nt,[$.value&&g.value.length===0?(n(),s("div",Ut,t[81]||(t[81]=[e("div",{class:"text-center"},[e("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4"}),e("div",{class:"text-content-secondary dark:text-content-primary/70"},"Loading messages...")],-1)]))):C.value?(n(),s("div",Ht,[e("div",Kt,[t[82]||(t[82]=e("div",{class:"text-red-600 dark:text-red-400 mb-2"},"Failed to load messages",-1)),e("div",Ot,a(C.value),1),e("button",{onClick:t[21]||(t[21]=r=>V(!0)),class:"px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors"}," Retry ")])])):g.value.length>0?(n(),s("div",Pt,[(n(!0),s(D,null,q(g.value,(r,f)=>(n(),s("div",{key:r.id||f,class:"group relative overflow-hidden glass-card backdrop-blur-xl rounded-[12px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-secondary/30 transition-all duration-300 hover:shadow-lg hover:shadow-secondary/10"},[t[87]||(t[87]=e("div",{class:"absolute inset-0 bg-gradient-to-r from-secondary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity"},null,-1)),e("div",Tt,[e("div",Gt,[e("div",qt,[e("div",Jt,[t[84]||(t[84]=e("div",{class:"w-6 h-6 rounded-full bg-gradient-to-br from-primary/30 to-secondary/30 flex items-center justify-center"},[e("svg",{class:"w-3 h-3 text-content-secondary dark:text-content-primary/70",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})])],-1)),r.author_name?(n(),s("span",Wt,a(r.author_name),1)):u("",!0),r.author_pubkey?(n(),s("span",Xt,a(r.author_pubkey.substring(0,8))+"... ",1)):(n(),s("span",Qt," Anonymous ")),t[85]||(t[85]=e("span",{class:"text-content-muted dark:text-content-muted/60 text-xs"},"•",-1)),e("span",Yt,[t[83]||(t[83]=e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)),b(" "+a(ce(r.timestamp)),1)]),r.id?(n(),s("span",Zt," #"+a(r.id),1)):u("",!0)])]),e("div",er,a(r.message_text),1)]),e("button",{onClick:me=>ie(r.id),class:"group/delete flex-shrink-0 p-2 bg-accent-red/10 hover:bg-accent-red/20 text-accent-red rounded-[8px] transition-all hover:scale-110 border border-accent-red/20",title:"Delete this message"},t[86]||(t[86]=[e("svg",{class:"w-4 h-4 group-hover/delete:rotate-12 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)]),8,tr)])]))),128)),O.value&&!$.value?(n(),s("div",rr,[e("button",{onClick:de,class:"group px-6 py-2.5 bg-gradient-to-r from-gray-100 dark:from-white/5 to-gray-200 dark:to-white/10 hover:from-gray-200 dark:hover:from-white/10 hover:to-gray-300 dark:hover:to-white/15 text-content-primary dark:text-content-primary rounded-[10px] transition-all hover:scale-105 text-sm font-medium border border-stroke-subtle dark:border-stroke/10 flex items-center gap-2 mx-auto"},t[88]||(t[88]=[e("svg",{class:"w-4 h-4 group-hover:translate-y-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1),b(" Load More Messages ",-1)]))])):$.value?(n(),s("div",or,t[89]||(t[89]=[e("div",{class:"flex items-center justify-center gap-2 text-content-secondary dark:text-content-muted text-sm"},[e("div",{class:"animate-spin w-4 h-4 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full"}),b(" Loading... ")],-1)]))):u("",!0)])):(n(),s("div",sr,t[90]||(t[90]=[G('

No messages yet

Be the first to start the conversation

',1)])))]),e("div",nr,[t[93]||(t[93]=e("div",{class:"absolute inset-0 bg-gradient-to-t from-primary/5 to-transparent pointer-events-none"},null,-1)),e("div",ar,[e("div",lr,[e("div",dr,[m(e("textarea",{"onUpdate:modelValue":t[22]||(t[22]=r=>k.value=r),onKeydown:[Y(Z(T,["ctrl"]),["enter"]),Y(Z(T,["meta"]),["enter"])],placeholder:"Type your message... (Ctrl+Enter to send)",rows:"3",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-3 text-content-primary dark:text-content-primary text-sm placeholder-gray-500 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 focus:bg-white dark:focus:bg-white/10 transition-all resize-none"},null,40,ir),[[v,k.value]])]),e("button",{onClick:T,disabled:!k.value.trim(),class:h(["group px-6 py-3 rounded-[12px] transition-all duration-200 flex items-center justify-center gap-2 font-medium",k.value.trim()?"bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary border border-primary/50 hover:scale-105 hover:shadow-lg hover:shadow-primary/20":"bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10"])},t[91]||(t[91]=[e("svg",{class:"w-5 h-5 group-hover:translate-x-1 transition-transform",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 19l9 2-9-18-9 18 9-2zm0 0v-8"})],-1),e("span",{class:"hidden sm:inline"},"Send",-1)]),10,ur)]),t[92]||(t[92]=e("p",{class:"text-content-secondary dark:text-content-muted/60 text-xs flex items-center gap-2"},[e("svg",{class:"w-3 h-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]),b(" Press Ctrl+Enter to send message quickly ")],-1))])])])])):u("",!0),P.value?(n(),s("div",cr,[e("div",pr,[e("div",mr,[e("div",null,[t[95]||(t[95]=e("h2",{class:"text-xl font-bold text-content-primary dark:text-content-primary"},"Active Sessions",-1)),e("p",vr,[t[94]||(t[94]=b("Room: ",-1)),e("span",xr,a(y.value),1)])]),e("button",{onClick:t[23]||(t[23]=r=>P.value=!1),class:"text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary transition-colors"},t[96]||(t[96]=[e("svg",{class:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))]),e("div",br,[M.value.length===0?(n(),s("div",yr,t[97]||(t[97]=[e("div",{class:"text-content-secondary dark:text-content-muted"},"No active sessions found",-1)]))):u("",!0),(n(!0),s(D,null,q(M.value,(r,f)=>(n(),s("div",{key:r.public_key_full||f,class:"glass-card backdrop-blur-xl rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10"},[e("div",gr,[e("div",kr,[e("div",fr,[e("span",hr,a(r.identity_name||"Unknown"),1),e("span",{class:h(["px-2 py-0.5 text-xs font-medium rounded",r.permissions==="admin"?"bg-accent-green/20 text-accent-green":"bg-secondary/20 text-secondary"])},a(r.permissions),3)]),e("div",wr,[e("span",_r,a(r.identity_type),1),e("button",{onClick:me=>pe(r.public_key_full,r.identity_hash),class:"px-2 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors",title:"Remove client from ACL"}," Remove ",8,Cr)])]),e("div",Mr,[e("div",jr,[t[98]||(t[98]=e("span",{class:"text-content-secondary dark:text-content-muted"},"Short Key:",-1)),e("code",Lr,a(r.public_key),1)]),e("div",Sr,[t[99]||(t[99]=e("span",{class:"text-content-secondary dark:text-content-muted"},"Full Key:",-1)),e("code",$r,a(r.public_key_full),1)])]),e("div",Ar,[e("div",Vr,[r.address?(n(),s("span",Br,"📍 "+a(r.address),1)):u("",!0),r.last_login_success?(n(),s("span",Rr,"Last Login: "+a(new Date(r.last_login_success*1e3).toLocaleString()),1)):u("",!0)]),r.last_activity?(n(),s("span",zr,"Active: "+a(Math.floor((Date.now()/1e3-r.last_activity)/60))+"m ago",1)):u("",!0)])])]))),128))])])])):u("",!0)],64))}});export{Ur as default}; diff --git a/repeater/web/html/assets/RoomServers-CheebdAq.js b/repeater/web/html/assets/RoomServers-CheebdAq.js new file mode 100644 index 0000000..c28f8d0 --- /dev/null +++ b/repeater/web/html/assets/RoomServers-CheebdAq.js @@ -0,0 +1 @@ +import{E as e,S as t,dt as n,f as r,g as i,j as a,k as ee,l as o,lt as s,m as c,p as l,r as u,s as d,u as f,w as p,z as m}from"./runtime-core.esm-bundler-IofF4kUm.js";import{t as h}from"./api-CrUX-ZnK.js";import{d as g,m as _,p as v}from"./index-CPWfwDmA.js";import{t as te}from"./ConfirmDialog-BRvNEHEy.js";import{t as ne}from"./MessageDialog-CSjABYko.js";import{n as re,t as ie}from"./preferences-N3Pls1rF.js";var ae={class:`p-6 space-y-6`},oe={class:`relative overflow-hidden rounded-[20px] p-6 mb-6 glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10`},se={class:`relative flex items-center justify-between`},ce={key:0,class:`grid grid-cols-1 md:grid-cols-3 gap-4`},le={class:`group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer`},ue={class:`relative flex items-center justify-between`},de={class:`text-3xl font-bold text-content-primary dark:text-content-primary mb-1`},fe={class:`group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer`},pe={class:`relative flex items-center justify-between`},me={class:`text-3xl font-bold text-primary mb-1`},he={class:`group relative overflow-hidden glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-5 hover:scale-[1.02] transition-all duration-300 cursor-pointer`},ge={class:`relative flex items-center justify-between`},_e={key:0,class:`w-6 h-6 text-accent-green`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},ve={key:1,class:`w-6 h-6 text-accent-yellow`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},ye={class:`glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6`},be={key:0,class:`flex items-center justify-center py-12`},xe={key:1,class:`flex items-center justify-center py-12`},Se={class:`text-center`},Ce={class:`text-content-secondary dark:text-content-muted text-sm mb-4`},we={key:2,class:`space-y-4`},Te={class:`relative flex items-start justify-between`},Ee={class:`flex-1`},De={class:`flex items-center gap-3 mb-4`},Oe={class:`relative`},ke={key:0,class:`absolute inset-0 bg-accent-green/50 rounded-full animate-ping`},Ae={class:`text-xl font-bold text-content-primary dark:text-content-primary group-hover:text-primary transition-colors`},je={key:0,class:`text-content-muted dark:text-content-muted text-sm`},Me={class:`grid grid-cols-1 md:grid-cols-2 gap-3 text-sm mb-3`},Ne={class:`text-content-primary dark:text-content-primary/90 ml-2`},Pe={class:`flex items-center gap-2`},y={key:0,class:`text-content-primary dark:text-content-primary/90 font-mono ml-2 text-xs`},Fe={key:1,class:`text-content-muted dark:text-content-muted ml-2 text-xs`},Ie=[`onClick`],Le={class:`text-content-primary dark:text-content-primary/90 ml-2`},Re={key:0},ze={class:`text-content-primary dark:text-content-primary/90 ml-2`},Be={key:0,class:`text-accent-green`},Ve={key:1,class:`text-content-muted dark:text-content-muted`},He={key:2,class:`text-primary`},Ue={key:0,class:`text-xs text-content-muted dark:text-content-muted font-mono`},We={class:`ml-4 flex flex-wrap gap-2`},Ge=[`onClick`,`disabled`,`title`],Ke=[`onClick`,`disabled`,`title`],qe=[`onClick`],Je=[`onClick`],Ye={key:3,class:`text-center py-12 text-content-secondary dark:text-content-muted`},Xe={key:1,class:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`},Ze={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto`},Qe={class:`space-y-4`},$e={class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},et={key:0},tt={key:1,class:`text-content-secondary dark:text-content-muted text-sm`},nt={class:`grid grid-cols-2 gap-4`},rt={class:`grid grid-cols-2 gap-4`},it={key:2,class:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`},at={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-2xl w-full max-h-[90vh] overflow-y-auto`},ot={class:`space-y-4`},st=[`value`],ct={class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},lt={key:0},ut={key:1,class:`text-content-secondary dark:text-content-muted text-sm`},dt={class:`grid grid-cols-2 gap-4`},ft={class:`grid grid-cols-2 gap-4`},pt={key:0,class:`fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-50 p-4`},mt={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 max-w-4xl w-full h-[85vh] flex flex-col shadow-2xl`},ht={class:`relative overflow-hidden rounded-[15px] mb-6 p-5 bg-white/50 dark:bg-white/5 border border-stroke-subtle dark:border-white/10`},gt={class:`relative flex items-center justify-between`},_t={class:`flex items-center gap-4`},vt={class:`text-content-secondary dark:text-content-muted text-sm flex items-center gap-2`},yt={class:`text-primary font-semibold`},bt={class:`flex items-center gap-2`},xt={class:`bg-primary/30 px-1.5 py-0.5 rounded-full text-[10px]`},St={class:`flex-1 overflow-y-auto mb-4 space-y-3`},Ct={key:0,class:`flex items-center justify-center py-12`},wt={key:1,class:`flex items-center justify-center py-12`},Tt={class:`text-center`},Et={class:`text-content-secondary dark:text-content-muted text-sm mb-4`},Dt={key:2,class:`space-y-3`},Ot={class:`relative flex items-start justify-between gap-3`},kt={class:`flex-1 min-w-0`},At={class:`flex items-center gap-2 mb-3`},jt={class:`flex items-center gap-2 flex-wrap`},Mt={key:0,class:`text-primary text-sm font-bold`},Nt={key:1,class:`text-primary/80 text-xs font-mono bg-primary/10 px-2 py-1 rounded-md border border-primary/20`},Pt={key:2,class:`text-content-muted dark:text-content-muted text-xs`},Ft={class:`text-content-secondary dark:text-content-muted text-xs flex items-center gap-1`},It={key:3,class:`text-content-muted dark:text-content-muted/50 text-[10px] font-mono bg-background-mute dark:bg-white/5 px-1.5 py-0.5 rounded`},Lt={class:`text-content-primary dark:text-content-primary/90 text-sm leading-relaxed break-words whitespace-pre-wrap bg-gray-50 dark:bg-white/5 p-3 rounded-[10px] border border-stroke-subtle dark:border-white/5`},Rt=[`onClick`],zt={key:0,class:`text-center pt-4`},Bt={key:1,class:`text-center pt-4`},Vt={key:3,class:`flex items-center justify-center h-full`},Ht={class:`relative overflow-hidden rounded-[15px] border-t border-stroke-subtle dark:border-white/20 pt-4 mt-4`},Ut={class:`relative space-y-3`},Wt={class:`flex gap-3`},Gt={class:`flex-1 relative`},Kt=[`onKeydown`],qt=[`disabled`],Jt={key:1,class:`fixed inset-0 bg-black/70 backdrop-blur-md flex items-center justify-center z-[60] p-4`},Yt={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-6 max-w-3xl w-full max-h-[80vh] flex flex-col`},Xt={class:`flex items-center justify-between mb-4 pb-4 border-b border-stroke-subtle dark:border-white/10`},Zt={class:`text-content-secondary dark:text-content-primary/70 text-sm mt-1`},Qt={class:`text-primary`},b={class:`flex-1 overflow-y-auto space-y-3`},$t={key:0,class:`text-center py-12`},en={class:`space-y-2`},tn={class:`flex items-center justify-between`},nn={class:`flex items-center gap-2`},rn={class:`text-content-primary dark:text-content-primary font-semibold`},an={class:`flex items-center gap-2`},on={class:`text-content-secondary dark:text-content-muted text-xs`},sn=[`onClick`],cn={class:`space-y-1 text-xs`},ln={class:`flex items-center gap-2`},un={class:`text-primary font-mono bg-primary/10 px-2 py-0.5 rounded`},dn={class:`flex items-center gap-2`},fn={class:`text-primary font-mono bg-primary/10 px-2 py-0.5 rounded text-[10px] break-all`},pn={class:`flex items-center justify-between text-xs text-content-secondary dark:text-content-muted`},mn={class:`flex items-center gap-4`},hn={key:0},gn={key:1},_n={key:0},x=i({name:`RoomServersView`,__name:`RoomServers`,setup(i){let x=m(!1),S=m(null),C=m(null),w=m(!1),T=m(!1),E=m(null),D=m(!1),O=m(!1),k=m(new Set),A=m(!1),j=m(``),M=m(!1),N=m({message:``,variant:`success`}),P=m(!1),F=m(``),I=m(``),L=m([]),R=m(!1),z=m(null),B=m(``),V=m(ie(`roomServers_messagesLimit`,50)),H=m(0),U=m(!0);ee(V,e=>re(`roomServers_messagesLimit`,e));let W=m([]),G=m(!1),K=m({name:``,identity_key:``,type:`room_server`,settings:{node_name:``,latitude:0,longitude:0,admin_password:``,guest_password:``}});t(async()=>{await q()});async function q(){x.value=!0,S.value=null;try{let e=await h.getIdentities();e.success?C.value=e.data:S.value=e.error||`Failed to load identities`}catch(e){S.value=e instanceof Error?e.message:`Failed to load identities`}finally{x.value=!1}}async function vn(){try{let e=await h.createIdentity(K.value);e.success?(w.value=!1,Y(),await q(),J(e.message||`Identity created successfully!`,`success`)):J(`Failed to create identity: ${e.error}`,`error`)}catch(e){J(`Error creating identity: ${e}`,`error`)}}async function yn(){try{let e=await h.updateIdentity(E.value);e.success?(T.value=!1,E.value=null,await q(),J(e.message||`Identity updated successfully!`,`success`)):J(`Failed to update identity: ${e.error}`,`error`)}catch(e){J(`Error updating identity: ${e}`,`error`)}}function bn(e){j.value=e,A.value=!0}async function xn(){let e=j.value;A.value=!1;try{let t=await h.deleteIdentity(e);t.success?(await q(),J(t.message||`Identity deleted successfully!`,`success`)):J(`Failed to delete identity: ${t.error}`,`error`)}catch(e){J(`Error deleting identity: ${e}`,`error`)}finally{j.value=``}}function J(e,t){N.value={message:e,variant:t},M.value=!0}async function Sn(e){try{let t=await h.sendRoomServerAdvert(e);t.success?J(t.message||`Advert sent for '${e}'!`,`success`):J(`Failed to send advert: ${t.error}`,`error`)}catch(e){J(`Error sending advert: ${e}`,`error`)}}function Cn(e){E.value=JSON.parse(JSON.stringify(e)),E.value.settings||(E.value.settings={}),E.value.settings.admin_password||(E.value.settings.admin_password=``),E.value.settings.guest_password||(E.value.settings.guest_password=``),O.value=!1,T.value=!0}function Y(){K.value={name:``,identity_key:``,type:`room_server`,settings:{node_name:``,latitude:0,longitude:0,admin_password:``,guest_password:``}},D.value=!1}function X(){w.value=!1,T.value=!1,E.value=null,D.value=!1,O.value=!1,Y()}function wn(e){k.value.has(e)?k.value.delete(e):k.value.add(e)}async function Tn(e){F.value=e,P.value=!0,H.value=0,U.value=!0,I.value=C.value?.configured.find(t=>t.name===e)?.hash||``,await Z(),await Q(!0)}async function Z(){try{let e=await h.getACLClients({identity_hash:I.value,identity_name:F.value});e.success&&e.data&&(W.value=e.data.clients||[])}catch(e){console.error(`Failed to fetch ACL clients:`,e)}}async function Q(e=!1){e&&(H.value=0,L.value=[]),R.value=!0,z.value=null;try{let t=await h.getRoomMessages({room_name:F.value,limit:V.value,offset:H.value});if(t.success&&t.data){let n=t.data.messages||[];e?L.value=n:L.value=[...L.value,...n],U.value=n.length===V.value}else z.value=t.error||`Failed to load messages`}catch(e){z.value=e instanceof Error?e.message:`Failed to load messages`}finally{R.value=!1}}async function En(){H.value+=V.value,await Q(!1)}async function $(){if(B.value.trim())try{let e=await h.postRoomMessage({room_name:F.value,message:B.value,author_pubkey:`server`});e.success?(B.value=``,await Q(!0)):J(`Failed to send message: ${e.error}`,`error`)}catch(e){J(`Error sending message: ${e}`,`error`)}}async function Dn(e){if(confirm(`Are you sure you want to delete this message?`))try{let t=await h.deleteRoomMessage({room_name:F.value,message_id:e});t.success?(await Q(!0),J(`Message deleted successfully`,`success`)):J(`Failed to delete message: ${t.error}`,`error`)}catch(e){J(`Error deleting message: ${e}`,`error`)}}function On(){P.value=!1,F.value=``,I.value=``,L.value=[],B.value=``,z.value=null,W.value=[]}function kn(e){return e?new Date(e*1e3).toLocaleString():`Unknown`}async function An(e,t){if(confirm(`Are you sure you want to remove this client from the ACL?`))try{let n=await h.removeACLClient({public_key:e,identity_hash:t});n.success?(await Z(),J(`Client removed successfully`,`success`)):J(`Failed to remove client: ${n.error}`,`error`)}catch(e){J(`Error removing client: ${e}`,`error`)}}return(t,i)=>(p(),f(u,null,[d(`div`,ae,[d(`div`,oe,[i[26]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-primary/20 via-secondary/10 to-accent-purple/20 opacity-50`},null,-1),i[27]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-tl from-accent-green/10 via-transparent to-primary/10 animate-pulse`},null,-1),d(`div`,se,[i[25]||=r(`

Room Servers

Manage room server identities and messages

`,1),d(`button`,{onClick:i[0]||=e=>w.value=!0,class:`group relative px-6 py-3 bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary rounded-[12px] border border-primary/50 transition-all hover:scale-105 hover:shadow-lg hover:shadow-primary/20`},[...i[24]||=[d(`span`,{class:`flex items-center gap-2`},[d(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4v16m8-8H4`})]),l(` Add Room Server `)],-1)]])])]),C.value&&C.value.total_configured>0?(p(),f(`div`,ce,[d(`div`,le,[i[30]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-white/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,ue,[d(`div`,null,[i[28]||=d(`div`,{class:`text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide`},` Total Configured `,-1),d(`div`,de,n(C.value.total_configured),1)]),i[29]||=d(`div`,{class:`bg-background-mute dark:bg-white/10 p-3 rounded-[12px] group-hover:bg-background-mute dark:group-hover:bg-stroke/20 transition-colors`},[d(`svg`,{class:`w-6 h-6 text-content-secondary dark:text-content-primary/70`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10`})])],-1)])]),d(`div`,fe,[i[33]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-primary/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,pe,[d(`div`,null,[i[31]||=d(`div`,{class:`text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide`},` Currently Registered `,-1),d(`div`,me,n(C.value.total_registered),1)]),i[32]||=d(`div`,{class:`bg-primary/20 p-3 rounded-[12px] group-hover:bg-primary/30 transition-colors`},[d(`svg`,{class:`w-6 h-6 text-primary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 13l4 4L19 7`})])],-1)])]),d(`div`,he,[i[37]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-accent-green/10 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,ge,[d(`div`,null,[i[34]||=d(`div`,{class:`text-content-secondary dark:text-content-muted text-xs font-medium mb-2 uppercase tracking-wide`},` Status `,-1),d(`div`,{class:s([`text-3xl font-bold`,C.value.total_registered===C.value.total_configured?`text-accent-green`:`text-accent-yellow`])},n(C.value.total_registered===C.value.total_configured?`Synced`:`Out of Sync`),3)]),d(`div`,{class:s([`p-3 rounded-[12px] transition-colors`,C.value.total_registered===C.value.total_configured?`bg-accent-green/20 group-hover:bg-accent-green/30`:`bg-accent-yellow/20 group-hover:bg-accent-yellow/30`])},[C.value.total_registered===C.value.total_configured?(p(),f(`svg`,_e,[...i[35]||=[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z`},null,-1)]])):(p(),f(`svg`,ve,[...i[36]||=[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`},null,-1)]]))],2)])])])):o(``,!0),d(`div`,ye,[x.value?(p(),f(`div`,be,[...i[38]||=[d(`div`,{class:`text-center`},[d(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4`}),d(`div`,{class:`text-content-secondary dark:text-content-primary/70`},` Loading room servers... `)],-1)]])):S.value?(p(),f(`div`,xe,[d(`div`,Se,[i[39]||=d(`div`,{class:`text-red-600 dark:text-red-400 mb-2`},`Failed to load room servers`,-1),d(`div`,Ce,n(S.value),1),d(`button`,{onClick:q,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors`},` Retry `)])])):C.value&&C.value.configured.length>0?(p(),f(`div`,we,[(p(!0),f(u,null,e(C.value.configured,e=>(p(),f(`div`,{key:e.name,class:`group relative overflow-hidden glass-card backdrop-blur-xl rounded-[15px] p-5 border border-stroke-subtle dark:border-white/10 hover:border-primary/30 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300`},[i[46]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-r from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,Te,[d(`div`,Ee,[d(`div`,De,[d(`div`,Oe,[e.registered?(p(),f(`div`,ke)):o(``,!0),d(`div`,{class:s([`relative w-3 h-3 rounded-full`,e.registered?`bg-accent-green`:`bg-accent-red`])},null,2)]),d(`h3`,Ae,n(e.name),1),d(`span`,{class:s([`px-3 py-1 text-xs font-semibold rounded-full`,e.registered?`bg-accent-green/20 text-accent-green border border-accent-green/30`:`bg-accent-red/20 text-accent-red border border-accent-red/30`])},n(e.registered?`● Active`:`○ Inactive`),3),e.hash?(p(),f(`span`,je,n(e.hash),1)):o(``,!0)]),d(`div`,Me,[d(`div`,null,[i[40]||=d(`span`,{class:`text-content-muted dark:text-content-muted`},`Node Name:`,-1),d(`span`,Ne,n(e.settings?.node_name||`Not set`),1)]),d(`div`,Pe,[i[41]||=d(`span`,{class:`text-content-muted dark:text-content-muted`},`Identity Key:`,-1),k.value.has(e.name)?(p(),f(`span`,y,n(e.identity_key),1)):(p(),f(`span`,Fe,` •••••••••••••••• `)),d(`button`,{onClick:t=>wn(e.name),class:`text-primary/70 hover:text-primary text-xs underline`},n(k.value.has(e.name)?`Hide`:`Show`),9,Ie)]),d(`div`,null,[i[42]||=d(`span`,{class:`text-content-muted dark:text-content-muted`},`Location:`,-1),d(`span`,Le,n(e.settings?.latitude||0)+`, `+n(e.settings?.longitude||0),1)]),e.settings?.admin_password||e.settings?.guest_password?(p(),f(`div`,Re,[i[43]||=d(`span`,{class:`text-content-muted dark:text-content-muted`},`Passwords:`,-1),d(`span`,ze,[e.settings?.admin_password?(p(),f(`span`,Be,`Admin`)):o(``,!0),e.settings?.admin_password&&e.settings?.guest_password?(p(),f(`span`,Ve,` / `)):o(``,!0),e.settings?.guest_password?(p(),f(`span`,He,`Guest`)):o(``,!0)])])):o(``,!0)]),e.address?(p(),f(`div`,Ue,` Address: `+n(e.address),1)):o(``,!0)]),d(`div`,We,[d(`button`,{onClick:t=>Tn(e.name),disabled:!e.registered,class:s([`group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2`,e.registered?`bg-secondary/20 hover:bg-secondary/30 text-secondary border border-secondary/30 hover:scale-105 hover:shadow-lg hover:shadow-secondary/20`:`bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10`]),title:e.registered?`Manage messages for this room`:`Room server must be active to manage messages`},[...i[44]||=[d(`svg`,{class:`w-4 h-4 group-hover:rotate-12 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z`})],-1),l(` Messages `,-1)]],10,Ge),d(`button`,{onClick:t=>Sn(e.name),disabled:!e.registered,class:s([`group px-4 py-2 rounded-[10px] text-xs font-medium transition-all duration-200 flex items-center gap-2`,e.registered?`bg-accent-green/20 hover:bg-accent-green/30 text-accent-green border border-accent-green/30 hover:scale-105 hover:shadow-lg hover:shadow-accent-green/20`:`bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10`]),title:e.registered?`Send advert for this room server`:`Room server must be active to send advert`},[...i[45]||=[d(`svg`,{class:`w-4 h-4 group-hover:scale-110 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 10V3L4 14h7v7l9-11h-7z`})],-1),l(` Send Advert `,-1)]],10,Ke),d(`button`,{onClick:t=>Cn(e),class:`px-3 py-1 bg-primary/20 hover:bg-primary/30 text-primary rounded text-xs transition-colors`},` Edit `,8,qe),d(`button`,{onClick:t=>bn(e.name),class:`px-3 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors`},` Delete `,8,Je)])])]))),128))])):(p(),f(`div`,Ye,[i[47]||=d(`svg`,{class:`w-16 h-16 mx-auto mb-4 text-content-muted dark:text-content-muted/60`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4`})],-1),i[48]||=d(`p`,{class:`text-lg mb-2`},`No room servers configured`,-1),i[49]||=d(`p`,{class:`text-sm mb-4`},`Add your first room server to get started`,-1),d(`button`,{onClick:i[1]||=e=>w.value=!0,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors`},` + Add Room Server `)]))]),w.value?(p(),f(`div`,Xe,[d(`div`,Ze,[i[60]||=d(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary mb-4`},` Add Room Server `,-1),d(`div`,Qe,[d(`div`,null,[i[50]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Name *`,-1),a(d(`input`,{"onUpdate:modelValue":i[2]||=e=>K.value.name=e,type:`text`,placeholder:`e.g., MainBBS`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.name]])]),d(`div`,null,[d(`label`,$e,[i[51]||=l(` Identity Key (Optional) `,-1),d(`button`,{onClick:i[3]||=e=>D.value=!D.value,type:`button`,class:`ml-2 text-primary/70 hover:text-primary text-xs underline`},n(D.value?`Hide`:`Show/Edit`),1)]),D.value?(p(),f(`div`,et,[a(d(`input`,{"onUpdate:modelValue":i[4]||=e=>K.value.identity_key=e,type:`text`,placeholder:`Leave empty to auto-generate`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.identity_key]]),i[52]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Leave empty to automatically generate a secure key `,-1)])):(p(),f(`div`,tt,` Will be auto-generated if not provided `))]),d(`div`,null,[i[53]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Node Name`,-1),a(d(`input`,{"onUpdate:modelValue":i[5]||=e=>K.value.settings.node_name=e,type:`text`,placeholder:`Display name for the room server`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.node_name]])]),d(`div`,nt,[d(`div`,null,[i[54]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Latitude`,-1),a(d(`input`,{"onUpdate:modelValue":i[6]||=e=>K.value.settings.latitude=e,type:`number`,step:`0.000001`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.latitude,void 0,{number:!0}]])]),d(`div`,null,[i[55]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Longitude`,-1),a(d(`input`,{"onUpdate:modelValue":i[7]||=e=>K.value.settings.longitude=e,type:`number`,step:`0.000001`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.longitude,void 0,{number:!0}]])])]),d(`div`,rt,[d(`div`,null,[i[56]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Admin Password (Optional)`,-1),a(d(`input`,{"onUpdate:modelValue":i[8]||=e=>K.value.settings.admin_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.admin_password]]),i[57]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Full access to room server `,-1)]),d(`div`,null,[i[58]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Guest Password (Optional)`,-1),a(d(`input`,{"onUpdate:modelValue":i[9]||=e=>K.value.settings.guest_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,K.value.settings.guest_password]]),i[59]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Read-only access `,-1)])])]),d(`div`,{class:`flex justify-end gap-3 mt-6`},[d(`button`,{onClick:X,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors`},` Cancel `),d(`button`,{onClick:vn,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors`},` Create `)])])])):o(``,!0),T.value&&E.value?(p(),f(`div`,it,[d(`div`,at,[i[72]||=d(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary mb-4`},` Edit Room Server `,-1),d(`div`,ot,[d(`div`,null,[i[61]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Current Name`,-1),d(`input`,{value:E.value.name,disabled:``,type:`text`,class:`w-full bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-muted dark:text-content-muted cursor-not-allowed`},null,8,st)]),d(`div`,null,[i[62]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`New Name (optional)`,-1),a(d(`input`,{"onUpdate:modelValue":i[10]||=e=>E.value.new_name=e,type:`text`,placeholder:`Leave empty to keep current name`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.new_name]])]),d(`div`,null,[d(`label`,ct,[i[63]||=l(` Identity Key (Optional) `,-1),d(`button`,{onClick:i[11]||=e=>O.value=!O.value,type:`button`,class:`ml-2 text-primary/70 hover:text-primary text-xs underline`},n(O.value?`Hide`:`Show/Edit`),1)]),O.value?(p(),f(`div`,lt,[a(d(`input`,{"onUpdate:modelValue":i[12]||=e=>E.value.identity_key=e,type:`text`,placeholder:`Leave empty to keep current key`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary font-mono text-sm placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.identity_key]]),i[64]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Leave empty to keep the current identity key `,-1)])):(p(),f(`div`,ut,` Click "Show/Edit" to change the identity key `))]),d(`div`,null,[i[65]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Node Name`,-1),a(d(`input`,{"onUpdate:modelValue":i[13]||=e=>E.value.settings.node_name=e,type:`text`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.node_name]])]),d(`div`,dt,[d(`div`,null,[i[66]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Latitude`,-1),a(d(`input`,{"onUpdate:modelValue":i[14]||=e=>E.value.settings.latitude=e,type:`number`,step:`0.000001`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.latitude,void 0,{number:!0}]])]),d(`div`,null,[i[67]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Longitude`,-1),a(d(`input`,{"onUpdate:modelValue":i[15]||=e=>E.value.settings.longitude=e,type:`number`,step:`0.000001`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.longitude,void 0,{number:!0}]])])]),d(`div`,ft,[d(`div`,null,[i[68]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Admin Password`,-1),a(d(`input`,{"onUpdate:modelValue":i[16]||=e=>E.value.settings.admin_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.admin_password]]),i[69]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Full access to room server `,-1)]),d(`div`,null,[i[70]||=d(`label`,{class:`block text-content-secondary dark:text-content-primary/70 text-sm mb-2`},`Guest Password`,-1),a(d(`input`,{"onUpdate:modelValue":i[17]||=e=>E.value.settings.guest_password=e,type:`password`,placeholder:`Leave empty for no password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:border-primary/50 transition-colors`},null,512),[[g,E.value.settings.guest_password]]),i[71]||=d(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-1`},` Read-only access `,-1)])])]),d(`div`,{class:`flex justify-end gap-3 mt-6`},[d(`button`,{onClick:X,class:`px-4 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 text-content-primary dark:text-content-primary rounded-lg transition-colors`},` Cancel `),d(`button`,{onClick:yn,class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-lg border border-primary/50 transition-colors`},` Update `)])])])):o(``,!0)]),c(te,{show:A.value,title:`Delete Room Server`,message:`Are you sure you want to delete '${j.value}'? This action cannot be undone.`,"confirm-text":`Delete`,"cancel-text":`Cancel`,variant:`danger`,onClose:i[18]||=e=>A.value=!1,onConfirm:xn},null,8,[`show`,`message`]),c(ne,{show:M.value,message:N.value.message,variant:N.value.variant,onClose:i[19]||=e=>M.value=!1},null,8,[`show`,`message`,`variant`]),P.value?(p(),f(`div`,pt,[d(`div`,mt,[d(`div`,ht,[i[79]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-r from-secondary/20 via-primary/20 to-accent-purple/20`},null,-1),i[80]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-br from-transparent via-white/5 to-transparent`},null,-1),d(`div`,gt,[d(`div`,_t,[i[75]||=r(`
`,1),d(`div`,null,[i[74]||=d(`h2`,{class:`text-2xl font-bold text-content-primary dark:text-content-primary mb-1`},` Room Messages `,-1),d(`p`,vt,[i[73]||=d(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z`})],-1),d(`span`,yt,n(F.value),1)])])]),d(`div`,bt,[d(`button`,{onClick:i[20]||=e=>G.value=!0,class:`group px-3 py-2 bg-primary/20 hover:bg-primary/30 text-primary rounded-[10px] text-xs font-medium transition-all hover:scale-105 border border-primary/30 flex items-center gap-2`,title:`View active sessions`},[i[76]||=d(`svg`,{class:`w-4 h-4 group-hover:scale-110 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z`})],-1),i[77]||=d(`span`,{class:`hidden sm:inline`},`Sessions`,-1),d(`span`,xt,n(W.value.length),1)]),d(`button`,{onClick:On,class:`p-2 text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 rounded-[10px] transition-all`},[...i[78]||=[d(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])])])]),d(`div`,St,[R.value&&L.value.length===0?(p(),f(`div`,Ct,[...i[81]||=[d(`div`,{class:`text-center`},[d(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full mx-auto mb-4`}),d(`div`,{class:`text-content-secondary dark:text-content-primary/70`},` Loading messages... `)],-1)]])):z.value?(p(),f(`div`,wt,[d(`div`,Tt,[i[82]||=d(`div`,{class:`text-red-600 dark:text-red-400 mb-2`},`Failed to load messages`,-1),d(`div`,Et,n(z.value),1),d(`button`,{onClick:i[21]||=e=>Q(!0),class:`px-4 py-2 bg-primary/20 hover:bg-primary/30 text-content-primary dark:text-content-primary rounded-lg border border-primary/50 transition-colors`},` Retry `)])])):L.value.length>0?(p(),f(`div`,Dt,[(p(!0),f(u,null,e(L.value,(e,t)=>(p(),f(`div`,{key:e.id||t,class:`group relative overflow-hidden glass-card backdrop-blur-xl rounded-[12px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-secondary/30 transition-all duration-300 hover:shadow-lg hover:shadow-secondary/10`},[i[87]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-r from-secondary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity`},null,-1),d(`div`,Ot,[d(`div`,kt,[d(`div`,At,[d(`div`,jt,[i[84]||=d(`div`,{class:`w-6 h-6 rounded-full bg-gradient-to-br from-primary/30 to-secondary/30 flex items-center justify-center`},[d(`svg`,{class:`w-3 h-3 text-content-secondary dark:text-content-primary/70`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z`})])],-1),e.author_name?(p(),f(`span`,Mt,n(e.author_name),1)):o(``,!0),e.author_pubkey?(p(),f(`span`,Nt,n(e.author_pubkey.substring(0,8))+`... `,1)):(p(),f(`span`,Pt,` Anonymous `)),i[85]||=d(`span`,{class:`text-content-muted dark:text-content-muted/60 text-xs`},`•`,-1),d(`span`,Ft,[i[83]||=d(`svg`,{class:`w-3 h-3`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z`})],-1),l(` `+n(kn(e.timestamp)),1)]),e.id?(p(),f(`span`,It,` #`+n(e.id),1)):o(``,!0)])]),d(`div`,Lt,n(e.message_text),1)]),d(`button`,{onClick:t=>Dn(e.id),class:`group/delete flex-shrink-0 p-2 bg-accent-red/10 hover:bg-accent-red/20 text-accent-red rounded-[8px] transition-all hover:scale-110 border border-accent-red/20`,title:`Delete this message`},[...i[86]||=[d(`svg`,{class:`w-4 h-4 group-hover/delete:rotate-12 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})],-1)]],8,Rt)])]))),128)),U.value&&!R.value?(p(),f(`div`,zt,[d(`button`,{onClick:En,class:`group px-6 py-2.5 bg-gradient-to-r from-gray-100 dark:from-white/5 to-gray-200 dark:to-white/10 hover:from-gray-200 dark:hover:from-white/10 hover:to-gray-300 dark:hover:to-white/15 text-content-primary dark:text-content-primary rounded-[10px] transition-all hover:scale-105 text-sm font-medium border border-stroke-subtle dark:border-stroke/10 flex items-center gap-2 mx-auto`},[...i[88]||=[d(`svg`,{class:`w-4 h-4 group-hover:translate-y-1 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 9l-7 7-7-7`})],-1),l(` Load More Messages `,-1)]])])):R.value?(p(),f(`div`,Bt,[...i[89]||=[d(`div`,{class:`flex items-center justify-center gap-2 text-content-secondary dark:text-content-muted text-sm`},[d(`div`,{class:`animate-spin w-4 h-4 border-2 border-stroke-subtle dark:border-stroke/20 border-t-primary rounded-full`}),l(` Loading... `)],-1)]])):o(``,!0)])):(p(),f(`div`,Vt,[...i[90]||=[r(`

No messages yet

Be the first to start the conversation

`,1)]]))]),d(`div`,Ht,[i[93]||=d(`div`,{class:`absolute inset-0 bg-gradient-to-t from-primary/5 to-transparent pointer-events-none`},null,-1),d(`div`,Ut,[d(`div`,Wt,[d(`div`,Gt,[a(d(`textarea`,{"onUpdate:modelValue":i[22]||=e=>B.value=e,onKeydown:[v(_($,[`ctrl`]),[`enter`]),v(_($,[`meta`]),[`enter`])],placeholder:`Type your message... (Ctrl+Enter to send)`,rows:`3`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-3 text-content-primary dark:text-content-primary text-sm placeholder-gray-500 dark:placeholder-white/30 focus:outline-none focus:border-primary/50 focus:bg-white dark:focus:bg-white/10 transition-all resize-none`},null,40,Kt),[[g,B.value]])]),d(`button`,{onClick:$,disabled:!B.value.trim(),class:s([`group px-6 py-3 rounded-[12px] transition-all duration-200 flex items-center justify-center gap-2 font-medium`,B.value.trim()?`bg-gradient-to-r from-primary/30 to-secondary/30 hover:from-primary/40 hover:to-secondary/40 text-content-primary dark:text-content-primary border border-primary/50 hover:scale-105 hover:shadow-lg hover:shadow-primary/20`:`bg-background-mute dark:bg-white/5 text-content-muted dark:text-content-muted/60 cursor-not-allowed border border-stroke-subtle dark:border-stroke/10`])},[...i[91]||=[d(`svg`,{class:`w-5 h-5 group-hover:translate-x-1 transition-transform`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 19l9 2-9-18-9 18 9-2zm0 0v-8`})],-1),d(`span`,{class:`hidden sm:inline`},`Send`,-1)]],10,qt)]),i[92]||=d(`p`,{class:`text-content-secondary dark:text-content-muted/60 text-xs flex items-center gap-2`},[d(`svg`,{class:`w-3 h-3`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z`})]),l(` Press Ctrl+Enter to send message quickly `)],-1)])])])])):o(``,!0),G.value?(p(),f(`div`,Jt,[d(`div`,Yt,[d(`div`,Xt,[d(`div`,null,[i[95]||=d(`h2`,{class:`text-xl font-bold text-content-primary dark:text-content-primary`},` Active Sessions `,-1),d(`p`,Zt,[i[94]||=l(` Room: `,-1),d(`span`,Qt,n(F.value),1)])]),d(`button`,{onClick:i[23]||=e=>G.value=!1,class:`text-content-secondary dark:text-content-primary/70 hover:text-content-primary dark:hover:text-content-primary transition-colors`},[...i[96]||=[d(`svg`,{class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[d(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])]),d(`div`,b,[W.value.length===0?(p(),f(`div`,$t,[...i[97]||=[d(`div`,{class:`text-content-secondary dark:text-content-muted`},`No active sessions found`,-1)]])):o(``,!0),(p(!0),f(u,null,e(W.value,(e,t)=>(p(),f(`div`,{key:e.public_key_full||t,class:`glass-card backdrop-blur-xl rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10`},[d(`div`,en,[d(`div`,tn,[d(`div`,nn,[d(`span`,rn,n(e.identity_name||`Unknown`),1),d(`span`,{class:s([`px-2 py-0.5 text-xs font-medium rounded`,e.permissions===`admin`?`bg-accent-green/20 text-accent-green`:`bg-secondary/20 text-secondary`])},n(e.permissions),3)]),d(`div`,an,[d(`span`,on,n(e.identity_type),1),d(`button`,{onClick:t=>An(e.public_key_full,e.identity_hash),class:`px-2 py-1 bg-accent-red/20 hover:bg-accent-red/30 text-accent-red rounded text-xs transition-colors`,title:`Remove client from ACL`},` Remove `,8,sn)])]),d(`div`,cn,[d(`div`,ln,[i[98]||=d(`span`,{class:`text-content-secondary dark:text-content-muted`},`Short Key:`,-1),d(`code`,un,n(e.public_key),1)]),d(`div`,dn,[i[99]||=d(`span`,{class:`text-content-secondary dark:text-content-muted`},`Full Key:`,-1),d(`code`,fn,n(e.public_key_full),1)])]),d(`div`,pn,[d(`div`,mn,[e.address?(p(),f(`span`,hn,`📍 `+n(e.address),1)):o(``,!0),e.last_login_success?(p(),f(`span`,gn,`Last Login: `+n(new Date(e.last_login_success*1e3).toLocaleString()),1)):o(``,!0)]),e.last_activity?(p(),f(`span`,_n,`Active: `+n(Math.floor((Date.now()/1e3-e.last_activity)/60))+`m ago`,1)):o(``,!0)])])]))),128))])])])):o(``,!0)],64))}});export{x as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/Sessions-B4giR55K.js b/repeater/web/html/assets/Sessions-B4giR55K.js new file mode 100644 index 0000000..d600dda --- /dev/null +++ b/repeater/web/html/assets/Sessions-B4giR55K.js @@ -0,0 +1 @@ +import{E as e,S as t,dt as n,g as r,j as ee,l as i,lt as a,o,p as te,r as s,s as c,u as l,w as u,z as d}from"./runtime-core.esm-bundler-IofF4kUm.js";import{t as f}from"./api-CrUX-ZnK.js";import{u as ne}from"./index-CPWfwDmA.js";var re={class:`p-6 space-y-6`},ie={key:0,class:`grid grid-cols-1 md:grid-cols-4 gap-4`},ae={class:`glass-card rounded-[15px] p-4`},oe={class:`text-2xl font-bold text-content-primary dark:text-content-primary`},se={class:`glass-card rounded-[15px] p-4`},ce={class:`text-2xl font-bold text-cyan-500 dark:text-primary`},le={class:`glass-card rounded-[15px] p-4`},ue={class:`text-2xl font-bold text-green-700 dark:text-green-500 dark:text-accent-green`},de={class:`glass-card rounded-[15px] p-4`},fe={class:`text-2xl font-bold text-yellow-500 dark:text-secondary`},pe={class:`glass-card rounded-[15px] p-6`},me={class:`flex flex-wrap border-b border-stroke-subtle dark:border-stroke/10 mb-6`},he=[`onClick`],p={class:`flex items-center gap-2`},m={key:0,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},h={key:1,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},g={key:2,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},_={class:`min-h-[400px]`},v={key:0,class:`flex items-center justify-center py-12`},y={key:1,class:`flex items-center justify-center py-12`},b={class:`text-center`},x={class:`text-content-secondary dark:text-content-muted text-sm mb-4`},S={key:2,class:`space-y-4`},C={key:0,class:`text-center py-12 text-content-secondary dark:text-content-muted`},w={key:1,class:`space-y-4`},T={class:`flex items-start justify-between`},E={class:`flex-1 min-w-0`},D={class:`flex items-center gap-2 flex-wrap mb-3`},O={class:`text-lg font-semibold text-content-primary dark:text-content-primary truncate`},k={class:`flex flex-wrap items-center gap-x-4 gap-y-2 text-sm`},A={key:0,class:`flex items-center gap-1.5`},j={class:`text-content-secondary dark:text-content-muted`},M={key:1,class:`flex items-center gap-1.5`},N={class:`text-content-secondary dark:text-content-muted`},P={key:2,class:`text-content-secondary dark:text-content-muted font-mono text-xs`},F={key:3,class:`text-content-muted dark:text-content-muted font-mono text-xs`},I={key:0,class:`text-content-muted dark:text-content-muted text-xs mt-2 mb-0`},L={class:`grid grid-cols-2 md:grid-cols-4 gap-4 mt-4`},R={class:`text-content-primary dark:text-content-primary font-medium`},ge={class:`text-cyan-500 dark:text-primary font-medium`},_e={class:`mt-3 flex items-center gap-2`},ve={key:3,class:`space-y-4`},ye={key:0,class:`text-center py-12 text-content-secondary dark:text-content-muted`},be={key:1,class:`overflow-x-auto`},xe={class:`w-full`},Se={class:`py-3`},Ce={class:`font-mono text-sm text-content-primary dark:text-content-primary`},we={class:`py-3`},Te={class:`font-mono text-xs text-content-secondary dark:text-content-muted`},Ee={class:`py-3`},De={class:`text-sm text-content-primary dark:text-content-primary`},z={class:`text-xs text-content-muted dark:text-content-muted`},Oe={class:`py-3`},ke={class:`py-3`},Ae={class:`text-sm text-content-secondary dark:text-content-muted`},je={class:`py-3`},Me=[`onClick`],Ne={key:4,class:`space-y-4`},Pe={class:`mb-4`},Fe=[`value`],Ie={key:0,class:`text-center py-12 text-content-secondary dark:text-content-muted`},Le={key:1,class:`grid grid-cols-1 gap-4`},Re={class:`flex items-start justify-between`},ze={class:`flex-1`},Be={class:`flex items-center gap-3 mb-3`},Ve={class:`text-content-primary dark:text-content-primary font-mono text-sm`},He={class:`grid grid-cols-1 md:grid-cols-2 gap-3 text-sm`},Ue={class:`text-content-primary dark:text-content-primary/90 font-mono ml-2`},We={class:`text-content-primary dark:text-content-primary/90 ml-2`},Ge={class:`text-content-primary dark:text-content-primary/90 ml-2`},Ke={class:`text-content-primary dark:text-content-primary/90 ml-2`},qe=[`onClick`],Je={class:`flex justify-end`},Ye=[`disabled`],B=r({name:`SessionsView`,__name:`Sessions`,setup(r){let B=d(`overview`),V=d(!1),H=d(!1),U=d(null),W=d(null),G=d([]),K=d(null),q=d(null),Xe=[{id:`overview`,label:`Overview`,icon:`overview`},{id:`clients`,label:`Authenticated Clients`,icon:`clients`},{id:`identities`,label:`By Identity`,icon:`identities`}];t(async()=>{await J(),V.value=!0});async function J(){H.value=!0,U.value=null;try{let e=await f.getACLInfo();e.success&&(W.value=e.data);let t=await f.getACLClients();t.success&&t.data&&(G.value=t.data.clients||[]);let n=await f.getACLStats();n.success&&(K.value=n.data)}catch(e){U.value=e instanceof Error?e.message:`Failed to load ACL data`,console.error(`Error fetching ACL data:`,e)}finally{H.value=!1}}async function Y(e,t){if(confirm(`Are you sure you want to remove this client from the ACL?`))try{let n=await f.removeACLClient({public_key:e,identity_hash:t});n.success?await J():alert(`Failed to remove client: ${n.error}`)}catch(e){alert(`Error removing client: ${e}`)}}function X(e){return e?new Date(e*1e3).toLocaleString():`Never`}function Ze(e){B.value=e}let Z=o(()=>q.value?G.value.filter(e=>e.identity_name===q.value):G.value),Q=o(()=>W.value&&W.value.acls||[]);function Qe(e){return e?.type===`companion`}function $e(e){return e===`repeater`?`bg-cyan-500/20 dark:bg-primary/20 text-cyan-700 dark:text-primary`:e===`companion`?`bg-violet-500/20 dark:bg-violet-400/20 text-violet-700 dark:text-violet-300`:`bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary`}function $(e){return e==null?`N/A`:typeof e==`boolean`?e?`✓`:`✗`:String(e)}return(t,r)=>(u(),l(`div`,re,[r[22]||=c(`div`,null,[c(`h1`,{class:`text-2xl font-bold text-content-primary dark:text-content-primary`},` Sessions & Access Control `),c(`p`,{class:`text-content-secondary dark:text-content-muted mt-2`},` Manage authenticated clients and access control lists `),c(`p`,{class:`text-content-muted dark:text-content-muted text-sm mt-1`},` Repeater, room servers, and companion identities; companions do not accept client logins. `)],-1),K.value?(u(),l(`div`,ie,[c(`div`,ae,[r[1]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-1`},` Total Identities `,-1),c(`div`,oe,n(K.value.total_identities),1)]),c(`div`,se,[r[2]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-1`},` Authenticated Clients `,-1),c(`div`,ce,n(K.value.total_clients),1)]),c(`div`,le,[r[3]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-1`},`Admin Clients`,-1),c(`div`,ue,n(K.value.admin_clients),1)]),c(`div`,de,[r[4]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-sm mb-1`},`Guest Clients`,-1),c(`div`,fe,n(K.value.guest_clients),1)])])):i(``,!0),c(`div`,pe,[c(`div`,me,[(u(),l(s,null,e(Xe,e=>c(`button`,{key:e.id,onClick:t=>Ze(e.id),class:a([`px-4 py-2 text-sm font-medium transition-colors duration-200 border-b-2 mr-6 mb-2`,B.value===e.id?`text-cyan-500 dark:text-primary border-cyan-500 dark:border-primary`:`text-content-secondary dark:text-content-muted border-transparent hover:text-content-primary dark:hover:text-content-primary hover:border-stroke-subtle dark:hover:border-stroke/30`])},[c(`div`,p,[e.icon===`overview`?(u(),l(`svg`,m,[...r[5]||=[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z`},null,-1)]])):e.icon===`clients`?(u(),l(`svg`,h,[...r[6]||=[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z`},null,-1)]])):e.icon===`identities`?(u(),l(`svg`,g,[...r[7]||=[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2`},null,-1)]])):i(``,!0),te(` `+n(e.label),1)])],10,he)),64))]),c(`div`,_,[H.value&&!V.value?(u(),l(`div`,v,[...r[8]||=[c(`div`,{class:`text-center`},[c(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4`}),c(`div`,{class:`text-content-secondary dark:text-content-muted`},`Loading ACL data...`)],-1)]])):U.value?(u(),l(`div`,y,[c(`div`,b,[r[9]||=c(`div`,{class:`text-red-500 dark:text-red-400 mb-2`},`Failed to load ACL data`,-1),c(`div`,x,n(U.value),1),c(`button`,{onClick:J,class:`px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors`},` Retry `)])])):B.value===`overview`?(u(),l(`div`,S,[Q.value.length===0?(u(),l(`div`,C,` No identities configured `)):(u(),l(`div`,w,[(u(!0),l(s,null,e(Q.value,e=>(u(),l(`div`,{key:e.hash,class:`glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-cyan-400 dark:hover:border-primary/30 transition-colors`},[c(`div`,T,[c(`div`,E,[c(`div`,D,[c(`h3`,O,n(e.name),1),c(`span`,{class:a([`px-2 py-0.5 text-xs font-medium rounded shrink-0`,$e(e.type)])},n(e.type),3)]),Qe(e)?(u(),l(s,{key:0},[c(`div`,k,[e.registered===void 0?i(``,!0):(u(),l(`span`,A,[c(`span`,{class:a([`w-2 h-2 rounded-full shrink-0`,e.registered?`bg-accent-green`:`bg-accent-red`]),"aria-hidden":``},null,2),c(`span`,j,`Registered: `+n(e.registered?`Active`:`Inactive`),1)])),e.active===void 0?i(``,!0):(u(),l(`span`,M,[c(`span`,{class:a([`w-2 h-2 rounded-full shrink-0`,e.active?`bg-accent-green`:`bg-accent-red`]),"aria-hidden":``},null,2),c(`span`,N,`Bridge: `+n(e.active?`Connected`:`Disconnected`),1)])),e.client_ip?(u(),l(`span`,P,` Client: `+n(e.client_ip),1)):i(``,!0),e.hash?(u(),l(`span`,F,` Hash: `+n(e.hash),1)):i(``,!0)]),e.last_seen==null?i(``,!0):(u(),l(`p`,I,` Last seen: `+n(X(e.last_seen)),1))],64)):(u(),l(s,{key:1},[c(`div`,L,[c(`div`,null,[r[10]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Max Clients `,-1),c(`div`,R,n($(e.max_clients)),1)]),c(`div`,null,[r[11]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Authenticated `,-1),c(`div`,ge,n($(e.authenticated_clients)),1)]),c(`div`,null,[r[12]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Admin Password `,-1),c(`div`,{class:a(e.has_admin_password?`text-green-700 dark:text-green-500 dark:text-accent-green`:`text-red-500 dark:text-accent-red`)},n(e.has_admin_password==null?`N/A`:e.has_admin_password?`✓ Set`:`✗ Not Set`),3)]),c(`div`,null,[r[13]||=c(`div`,{class:`text-content-secondary dark:text-content-muted text-xs mb-1`},` Guest Password `,-1),c(`div`,{class:a(e.has_guest_password?`text-green-700 dark:text-green-500 dark:text-accent-green`:`text-red-500 dark:text-accent-red`)},n(e.has_guest_password==null?`N/A`:e.has_guest_password?`✓ Set`:`✗ Not Set`),3)])]),c(`div`,_e,[r[14]||=c(`span`,{class:`text-content-secondary dark:text-content-muted text-xs`},`Read-Only Access:`,-1),c(`span`,{class:a(e.allow_read_only?`text-green-700 dark:text-green-500 dark:text-accent-green`:`text-red-500 dark:text-accent-red`)},n(e.allow_read_only==null?`N/A`:e.allow_read_only?`Allowed`:`Disabled`),3)])],64))])])]))),128))]))])):B.value===`clients`?(u(),l(`div`,ve,[G.value.length===0?(u(),l(`div`,ye,` No authenticated clients `)):(u(),l(`div`,be,[c(`table`,xe,[r[15]||=c(`thead`,null,[c(`tr`,{class:`border-b border-stroke-subtle dark:border-stroke/10`},[c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Client `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Address `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Identity `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Permissions `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Last Activity `),c(`th`,{class:`text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3`},` Actions `)])],-1),c(`tbody`,null,[(u(!0),l(s,null,e(G.value,e=>(u(),l(`tr`,{key:e.public_key_full,class:`border-b border-stroke-subtle dark:border-white/5 hover:bg-gray-100/50 dark:hover:bg-white/5 transition-colors`},[c(`td`,Se,[c(`div`,Ce,n(e.public_key),1)]),c(`td`,we,[c(`div`,Te,n(e.address),1)]),c(`td`,Ee,[c(`div`,De,n(e.identity_name),1),c(`div`,z,n(e.identity_hash),1)]),c(`td`,Oe,[c(`span`,{class:a([`px-2 py-1 text-xs font-medium rounded`,e.permissions===`admin`?`bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green`:`bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary`])},n(e.permissions),3)]),c(`td`,ke,[c(`div`,Ae,n(X(e.last_activity)),1)]),c(`td`,je,[c(`button`,{onClick:t=>Y(e.public_key_full,e.identity_hash),class:`px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors`},` Remove `,8,Me)])]))),128))])])]))])):B.value===`identities`?(u(),l(`div`,Ne,[c(`div`,Pe,[r[17]||=c(`label`,{class:`block text-content-secondary dark:text-content-muted text-sm mb-2`},`Filter by Identity`,-1),ee(c(`select`,{"onUpdate:modelValue":r[0]||=e=>q.value=e,class:`bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-cyan-500 dark:focus:border-primary/50 transition-colors`},[r[16]||=c(`option`,{value:null},`All Identities`,-1),(u(!0),l(s,null,e(Q.value,e=>(u(),l(`option`,{key:e.name,value:e.name},n(e.name)+` (`+n(e.authenticated_clients??0)+` clients) `,9,Fe))),128))],512),[[ne,q.value]])]),Z.value.length===0?(u(),l(`div`,Ie,` No clients for selected identity `)):(u(),l(`div`,Le,[(u(!0),l(s,null,e(Z.value,e=>(u(),l(`div`,{key:e.public_key_full,class:`glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10`},[c(`div`,Re,[c(`div`,ze,[c(`div`,Be,[c(`span`,{class:a([`px-2 py-1 text-xs font-medium rounded`,e.permissions===`admin`?`bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green`:`bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary`])},n(e.permissions),3),c(`span`,Ve,n(e.public_key),1)]),c(`div`,He,[c(`div`,null,[r[18]||=c(`span`,{class:`text-content-secondary dark:text-content-muted`},`Address:`,-1),c(`span`,Ue,n(e.address),1)]),c(`div`,null,[r[19]||=c(`span`,{class:`text-content-secondary dark:text-content-muted`},`Identity:`,-1),c(`span`,We,n(e.identity_name)+` (`+n(e.identity_hash)+`)`,1)]),c(`div`,null,[r[20]||=c(`span`,{class:`text-content-secondary dark:text-content-muted`},`Last Activity:`,-1),c(`span`,Ge,n(X(e.last_activity)),1)]),c(`div`,null,[r[21]||=c(`span`,{class:`text-content-secondary dark:text-content-muted`},`Last Login:`,-1),c(`span`,Ke,n(X(e.last_login_success)),1)])])]),c(`button`,{onClick:t=>Y(e.public_key_full,e.identity_hash),class:`ml-4 px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors`},` Remove `,8,qe)])]))),128))]))])):i(``,!0)])]),c(`div`,Je,[c(`button`,{onClick:J,disabled:H.value,class:`px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-primary rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors disabled:opacity-50`},n(H.value?`Refreshing...`:`Refresh Data`),9,Ye)])]))}});export{B as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/Sessions-rHkTsOlY.js b/repeater/web/html/assets/Sessions-rHkTsOlY.js deleted file mode 100644 index f968d19..0000000 --- a/repeater/web/html/assets/Sessions-rHkTsOlY.js +++ /dev/null @@ -1 +0,0 @@ -import{a as V,r as c,o as j,L as g,c as N,e as o,f as t,h as l,t as n,F as i,i as k,w as D,s as z,k as d,l as F,q as r}from"./index-xzvnOpJo.js";const T={class:"p-6 space-y-6"},$={key:0,class:"grid grid-cols-1 md:grid-cols-4 gap-4"},E={class:"glass-card rounded-[15px] p-4"},H={class:"text-2xl font-bold text-content-primary dark:text-content-primary"},O={class:"glass-card rounded-[15px] p-4"},P={class:"text-2xl font-bold text-cyan-500 dark:text-primary"},G={class:"glass-card rounded-[15px] p-4"},q={class:"text-2xl font-bold text-green-700 dark:text-green-500 dark:text-accent-green"},U={class:"glass-card rounded-[15px] p-4"},J={class:"text-2xl font-bold text-yellow-500 dark:text-secondary"},K={class:"glass-card rounded-[15px] p-6"},Q={class:"flex flex-wrap border-b border-stroke-subtle dark:border-stroke/10 mb-6"},W=["onClick"],X={class:"flex items-center gap-2"},Y={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Z={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},tt={key:2,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},et={class:"min-h-[400px]"},st={key:0,class:"flex items-center justify-center py-12"},nt={key:1,class:"flex items-center justify-center py-12"},ot={class:"text-center"},rt={class:"text-content-secondary dark:text-content-muted text-sm mb-4"},at={key:2,class:"space-y-4"},dt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},ct={key:1,class:"space-y-4"},lt={class:"flex items-start justify-between"},it={class:"flex-1 min-w-0"},xt={class:"flex items-center gap-2 flex-wrap mb-3"},ut={class:"text-lg font-semibold text-content-primary dark:text-content-primary truncate"},mt={class:"flex flex-wrap items-center gap-x-4 gap-y-2 text-sm"},pt={key:0,class:"flex items-center gap-1.5"},kt={class:"text-content-secondary dark:text-content-muted"},vt={key:1,class:"flex items-center gap-1.5"},yt={class:"text-content-secondary dark:text-content-muted"},_t={key:2,class:"text-content-secondary dark:text-content-muted font-mono text-xs"},bt={key:3,class:"text-content-muted dark:text-content-muted font-mono text-xs"},gt={key:0,class:"text-content-muted dark:text-content-muted text-xs mt-2 mb-0"},ht={class:"grid grid-cols-2 md:grid-cols-4 gap-4 mt-4"},ft={class:"text-content-primary dark:text-content-primary font-medium"},wt={class:"text-cyan-500 dark:text-primary font-medium"},Ct={class:"mt-3 flex items-center gap-2"},At={key:3,class:"space-y-4"},Lt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},St={key:1,class:"overflow-x-auto"},Nt={class:"w-full"},Mt={class:"py-3"},Rt={class:"font-mono text-sm text-content-primary dark:text-content-primary"},It={class:"py-3"},Bt={class:"font-mono text-xs text-content-secondary dark:text-content-muted"},Vt={class:"py-3"},jt={class:"text-sm text-content-primary dark:text-content-primary"},Dt={class:"text-xs text-content-muted dark:text-content-muted"},zt={class:"py-3"},Ft={class:"py-3"},Tt={class:"text-sm text-content-secondary dark:text-content-muted"},$t={class:"py-3"},Et=["onClick"],Ht={key:4,class:"space-y-4"},Ot={class:"mb-4"},Pt=["value"],Gt={key:0,class:"text-center py-12 text-content-secondary dark:text-content-muted"},qt={key:1,class:"grid grid-cols-1 gap-4"},Ut={class:"flex items-start justify-between"},Jt={class:"flex-1"},Kt={class:"flex items-center gap-3 mb-3"},Qt={class:"text-content-primary dark:text-content-primary font-mono text-sm"},Wt={class:"grid grid-cols-1 md:grid-cols-2 gap-3 text-sm"},Xt={class:"text-content-primary dark:text-content-primary/90 font-mono ml-2"},Yt={class:"text-content-primary dark:text-content-primary/90 ml-2"},Zt={class:"text-content-primary dark:text-content-primary/90 ml-2"},te={class:"text-content-primary dark:text-content-primary/90 ml-2"},ee=["onClick"],se={class:"flex justify-end"},ne=["disabled"],ae=V({name:"SessionsView",__name:"Sessions",setup(oe){const u=c("overview"),w=c(!1),m=c(!1),v=c(null),h=c(null),p=c([]),x=c(null),y=c(null),M=[{id:"overview",label:"Overview",icon:"overview"},{id:"clients",label:"Authenticated Clients",icon:"clients"},{id:"identities",label:"By Identity",icon:"identities"}];j(async()=>{await _(),w.value=!0});async function _(){m.value=!0,v.value=null;try{const a=await g.getACLInfo();a.success&&(h.value=a.data);const s=await g.getACLClients();s.success&&s.data&&(p.value=s.data.clients||[]);const e=await g.getACLStats();e.success&&(x.value=e.data)}catch(a){v.value=a instanceof Error?a.message:"Failed to load ACL data",console.error("Error fetching ACL data:",a)}finally{m.value=!1}}async function C(a,s){if(confirm("Are you sure you want to remove this client from the ACL?"))try{const e=await g.removeACLClient({public_key:a,identity_hash:s});e.success?await _():alert(`Failed to remove client: ${e.error}`)}catch(e){alert(`Error removing client: ${e}`)}}function b(a){return a?new Date(a*1e3).toLocaleString():"Never"}function R(a){u.value=a}const A=N(()=>y.value?p.value.filter(a=>a.identity_name===y.value):p.value),f=N(()=>h.value?h.value.acls||[]:[]);function I(a){return a?.type==="companion"}function B(a){return a==="repeater"?"bg-cyan-500/20 dark:bg-primary/20 text-cyan-700 dark:text-primary":a==="companion"?"bg-violet-500/20 dark:bg-violet-400/20 text-violet-700 dark:text-violet-300":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"}function L(a){return a==null?"N/A":typeof a=="boolean"?a?"✓":"✗":String(a)}return(a,s)=>(r(),o("div",T,[s[22]||(s[22]=t("div",null,[t("h1",{class:"text-2xl font-bold text-content-primary dark:text-content-primary"},"Sessions & Access Control"),t("p",{class:"text-content-secondary dark:text-content-muted mt-2"},"Manage authenticated clients and access control lists"),t("p",{class:"text-content-muted dark:text-content-muted text-sm mt-1"},"Repeater, room servers, and companion identities; companions do not accept client logins.")],-1)),x.value?(r(),o("div",$,[t("div",E,[s[1]||(s[1]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Total Identities",-1)),t("div",H,n(x.value.total_identities),1)]),t("div",O,[s[2]||(s[2]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Authenticated Clients",-1)),t("div",P,n(x.value.total_clients),1)]),t("div",G,[s[3]||(s[3]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Admin Clients",-1)),t("div",q,n(x.value.admin_clients),1)]),t("div",U,[s[4]||(s[4]=t("div",{class:"text-content-secondary dark:text-content-muted text-sm mb-1"},"Guest Clients",-1)),t("div",J,n(x.value.guest_clients),1)])])):l("",!0),t("div",K,[t("div",Q,[(r(),o(i,null,k(M,e=>t("button",{key:e.id,onClick:S=>R(e.id),class:d(["px-4 py-2 text-sm font-medium transition-colors duration-200 border-b-2 mr-6 mb-2",u.value===e.id?"text-cyan-500 dark:text-primary border-cyan-500 dark:border-primary":"text-content-secondary dark:text-content-muted border-transparent hover:text-content-primary dark:hover:text-content-primary hover:border-stroke-subtle dark:hover:border-stroke/30"])},[t("div",X,[e.icon==="overview"?(r(),o("svg",Y,s[5]||(s[5]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"},null,-1)]))):e.icon==="clients"?(r(),o("svg",Z,s[6]||(s[6]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z"},null,-1)]))):e.icon==="identities"?(r(),o("svg",tt,s[7]||(s[7]=[t("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2"},null,-1)]))):l("",!0),F(" "+n(e.label),1)])],10,W)),64))]),t("div",et,[m.value&&!w.value?(r(),o("div",st,s[8]||(s[8]=[t("div",{class:"text-center"},[t("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-cyan-500 dark:border-t-primary rounded-full mx-auto mb-4"}),t("div",{class:"text-content-secondary dark:text-content-muted"},"Loading ACL data...")],-1)]))):v.value?(r(),o("div",nt,[t("div",ot,[s[9]||(s[9]=t("div",{class:"text-red-500 dark:text-red-400 mb-2"},"Failed to load ACL data",-1)),t("div",rt,n(v.value),1),t("button",{onClick:_,class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-white rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors"}," Retry ")])])):u.value==="overview"?(r(),o("div",at,[f.value.length===0?(r(),o("div",dt," No identities configured ")):(r(),o("div",ct,[(r(!0),o(i,null,k(f.value,e=>(r(),o("div",{key:e.hash,class:"glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10 hover:border-cyan-400 dark:hover:border-primary/30 transition-colors"},[t("div",lt,[t("div",it,[t("div",xt,[t("h3",ut,n(e.name),1),t("span",{class:d(["px-2 py-0.5 text-xs font-medium rounded shrink-0",B(e.type)])},n(e.type),3)]),I(e)?(r(),o(i,{key:0},[t("div",mt,[e.registered!==void 0?(r(),o("span",pt,[t("span",{class:d(["w-2 h-2 rounded-full shrink-0",e.registered?"bg-accent-green":"bg-accent-red"]),"aria-hidden":""},null,2),t("span",kt,"Registered: "+n(e.registered?"Active":"Inactive"),1)])):l("",!0),e.active!==void 0?(r(),o("span",vt,[t("span",{class:d(["w-2 h-2 rounded-full shrink-0",e.active?"bg-accent-green":"bg-accent-red"]),"aria-hidden":""},null,2),t("span",yt,"Bridge: "+n(e.active?"Connected":"Disconnected"),1)])):l("",!0),e.client_ip?(r(),o("span",_t," Client: "+n(e.client_ip),1)):l("",!0),e.hash?(r(),o("span",bt," Hash: "+n(e.hash),1)):l("",!0)]),e.last_seen!=null?(r(),o("p",gt," Last seen: "+n(b(e.last_seen)),1)):l("",!0)],64)):(r(),o(i,{key:1},[t("div",ht,[t("div",null,[s[10]||(s[10]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Max Clients",-1)),t("div",ft,n(L(e.max_clients)),1)]),t("div",null,[s[11]||(s[11]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Authenticated",-1)),t("div",wt,n(L(e.authenticated_clients)),1)]),t("div",null,[s[12]||(s[12]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Admin Password",-1)),t("div",{class:d(e.has_admin_password?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},n(e.has_admin_password!=null?e.has_admin_password?"✓ Set":"✗ Not Set":"N/A"),3)]),t("div",null,[s[13]||(s[13]=t("div",{class:"text-content-secondary dark:text-content-muted text-xs mb-1"},"Guest Password",-1)),t("div",{class:d(e.has_guest_password?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},n(e.has_guest_password!=null?e.has_guest_password?"✓ Set":"✗ Not Set":"N/A"),3)])]),t("div",Ct,[s[14]||(s[14]=t("span",{class:"text-content-secondary dark:text-content-muted text-xs"},"Read-Only Access:",-1)),t("span",{class:d(e.allow_read_only?"text-green-700 dark:text-green-500 dark:text-accent-green":"text-red-500 dark:text-accent-red")},n(e.allow_read_only!=null?e.allow_read_only?"Allowed":"Disabled":"N/A"),3)])],64))])])]))),128))]))])):u.value==="clients"?(r(),o("div",At,[p.value.length===0?(r(),o("div",Lt," No authenticated clients ")):(r(),o("div",St,[t("table",Nt,[s[15]||(s[15]=t("thead",null,[t("tr",{class:"border-b border-stroke-subtle dark:border-stroke/10"},[t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Client"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Address"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Identity"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Permissions"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Last Activity"),t("th",{class:"text-left text-content-secondary dark:text-content-muted text-sm font-medium pb-3"},"Actions")])],-1)),t("tbody",null,[(r(!0),o(i,null,k(p.value,e=>(r(),o("tr",{key:e.public_key_full,class:"border-b border-stroke-subtle dark:border-white/5 hover:bg-gray-100/50 dark:hover:bg-white/5 transition-colors"},[t("td",Mt,[t("div",Rt,n(e.public_key),1)]),t("td",It,[t("div",Bt,n(e.address),1)]),t("td",Vt,[t("div",jt,n(e.identity_name),1),t("div",Dt,n(e.identity_hash),1)]),t("td",zt,[t("span",{class:d(["px-2 py-1 text-xs font-medium rounded",e.permissions==="admin"?"bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"])},n(e.permissions),3)]),t("td",Ft,[t("div",Tt,n(b(e.last_activity)),1)]),t("td",$t,[t("button",{onClick:S=>C(e.public_key_full,e.identity_hash),class:"px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors"}," Remove ",8,Et)])]))),128))])])]))])):u.value==="identities"?(r(),o("div",Ht,[t("div",Ot,[s[17]||(s[17]=t("label",{class:"block text-content-secondary dark:text-content-muted text-sm mb-2"},"Filter by Identity",-1)),D(t("select",{"onUpdate:modelValue":s[0]||(s[0]=e=>y.value=e),class:"bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-2 text-content-primary dark:text-content-primary focus:outline-none focus:border-cyan-500 dark:focus:border-primary/50 transition-colors"},[s[16]||(s[16]=t("option",{value:null},"All Identities",-1)),(r(!0),o(i,null,k(f.value,e=>(r(),o("option",{key:e.name,value:e.name},n(e.name)+" ("+n(e.authenticated_clients??0)+" clients) ",9,Pt))),128))],512),[[z,y.value]])]),A.value.length===0?(r(),o("div",Gt," No clients for selected identity ")):(r(),o("div",qt,[(r(!0),o(i,null,k(A.value,e=>(r(),o("div",{key:e.public_key_full,class:"glass-card rounded-[10px] p-4 border border-stroke-subtle dark:border-white/10"},[t("div",Ut,[t("div",Jt,[t("div",Kt,[t("span",{class:d(["px-2 py-1 text-xs font-medium rounded",e.permissions==="admin"?"bg-green-100 dark:bg-green-500/20 dark:bg-accent-green/20 text-green-700 dark:text-accent-green":"bg-yellow-100 dark:bg-yellow-500/20 dark:bg-secondary/20 text-yellow-700 dark:text-secondary"])},n(e.permissions),3),t("span",Qt,n(e.public_key),1)]),t("div",Wt,[t("div",null,[s[18]||(s[18]=t("span",{class:"text-content-secondary dark:text-content-muted"},"Address:",-1)),t("span",Xt,n(e.address),1)]),t("div",null,[s[19]||(s[19]=t("span",{class:"text-content-secondary dark:text-content-muted"},"Identity:",-1)),t("span",Yt,n(e.identity_name)+" ("+n(e.identity_hash)+")",1)]),t("div",null,[s[20]||(s[20]=t("span",{class:"text-content-secondary dark:text-content-muted"},"Last Activity:",-1)),t("span",Zt,n(b(e.last_activity)),1)]),t("div",null,[s[21]||(s[21]=t("span",{class:"text-content-secondary dark:text-content-muted"},"Last Login:",-1)),t("span",te,n(b(e.last_login_success)),1)])])]),t("button",{onClick:S=>C(e.public_key_full,e.identity_hash),class:"ml-4 px-3 py-1 bg-red-100 dark:bg-red-500/20 dark:bg-accent-red/20 hover:bg-red-500/30 dark:hover:bg-accent-red/30 text-red-600 dark:text-accent-red rounded text-xs transition-colors"}," Remove ",8,ee)])]))),128))]))])):l("",!0)])]),t("div",se,[t("button",{onClick:_,disabled:m.value,class:"px-4 py-2 bg-cyan-500/20 dark:bg-primary/20 hover:bg-cyan-500/30 dark:hover:bg-primary/30 text-cyan-900 dark:text-primary rounded-lg border border-cyan-500/50 dark:border-primary/50 transition-colors disabled:opacity-50"},n(m.value?"Refreshing...":"Refresh Data"),9,ne)])]))}});export{ae as default}; diff --git a/repeater/web/html/assets/Setup-DiRq9fgD.css b/repeater/web/html/assets/Setup-DiRq9fgD.css new file mode 100644 index 0000000..3a9839e --- /dev/null +++ b/repeater/web/html/assets/Setup-DiRq9fgD.css @@ -0,0 +1 @@ +.glass-card[data-v-a201f2f2]{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:#ffffff0d;border:1px solid #ffffff1a}.modal-enter-active[data-v-a201f2f2],.modal-leave-active[data-v-a201f2f2]{transition:opacity .3s}.modal-enter-from[data-v-a201f2f2],.modal-leave-to[data-v-a201f2f2]{opacity:0}.modal-enter-active .glass-card[data-v-a201f2f2],.modal-leave-active .glass-card[data-v-a201f2f2]{transition:transform .3s}.modal-enter-from .glass-card[data-v-a201f2f2],.modal-leave-to .glass-card[data-v-a201f2f2]{transform:scale(.9)}.slide-enter-active[data-v-a201f2f2],.slide-leave-active[data-v-a201f2f2]{transition:all .3s}.slide-enter-from[data-v-a201f2f2],.slide-leave-to[data-v-a201f2f2]{opacity:0;transform:translateY(-10px)}@keyframes float-slow-a201f2f2{0%,to{opacity:.8;transform:translate(0)scale(1)rotate(-24.22deg)}50%{opacity:.6;transform:translate(20px,-20px)scale(1.05)rotate(-24.22deg)}}@keyframes float-slower-a201f2f2{0%,to{opacity:.75;transform:translate(0)scale(1)rotate(-24.22deg)}50%{opacity:.5;transform:translate(-30px,20px)scale(1.08)rotate(-24.22deg)}}@keyframes float-slowest-a201f2f2{0%,to{opacity:.8;transform:translate(0)scale(1)rotate(-24.22deg)}50%{opacity:.55;transform:translate(25px,25px)scale(1.1)rotate(-24.22deg)}}.animate-pulse-slow[data-v-a201f2f2]{will-change:transform, opacity;animation:15s ease-in-out infinite float-slow-a201f2f2}.animate-pulse-slower[data-v-a201f2f2]{will-change:transform, opacity;animation:18s ease-in-out infinite float-slower-a201f2f2}.animate-pulse-slowest[data-v-a201f2f2]{will-change:transform, opacity;animation:20s ease-in-out infinite float-slowest-a201f2f2} diff --git a/repeater/web/html/assets/Setup-Dq5DYqa_.js b/repeater/web/html/assets/Setup-Dq5DYqa_.js deleted file mode 100644 index 2739bbe..0000000 --- a/repeater/web/html/assets/Setup-Dq5DYqa_.js +++ /dev/null @@ -1 +0,0 @@ -import{d as D,r as l,c as B,a as W,o as I,b as Y,e as a,f as e,g as z,_ as J,t as i,u as o,n as K,h as v,F as V,i as q,j as Q,w as _,v as M,k as R,l as E,m as F,T as H,p as X,q as n,s as U,x as Z,y as ee}from"./index-xzvnOpJo.js";const te=D("setup",()=>{const x=l(1),r=l(5),y=l(`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,"0")}`),p=l(null),h=l(null),f=l(""),k=l(""),u=l(!1),c=l({frequency:"915.0",spreading_factor:"7",bandwidth:"125",coding_rate:"5"}),j=l([]),L=l([]),w=l(!1),S=l(!1),g=l(null),P=B(()=>{switch(x.value){case 1:return!0;case 2:return y.value.trim().length>0;case 3:return p.value!==null;case 4:return u.value?c.value.frequency&&c.value.spreading_factor&&c.value.bandwidth&&c.value.coding_rate:h.value!==null;case 5:return f.value.length>=6&&f.value===k.value;default:return!1}}),m=B(()=>x.value>1),t=B(()=>x.value===r.value);async function s(){w.value=!0,g.value=null;try{const b=await(await fetch("/api/hardware_options")).json();if(b.error)throw new Error(b.error);j.value=b.hardware||[]}catch(d){g.value=d instanceof Error?d.message:"Failed to load hardware options",console.error("Error fetching hardware options:",d)}finally{w.value=!1}}async function C(){w.value=!0,g.value=null;try{const b=await(await fetch("/api/radio_presets")).json();if(b.error)throw new Error(b.error);L.value=b.presets||[]}catch(d){g.value=d instanceof Error?d.message:"Failed to load radio presets",console.error("Error fetching radio presets:",d)}finally{w.value=!1}}async function T(){if(!P.value)return{success:!1,error:"Please complete all required fields"};S.value=!0,g.value=null;try{const d=u.value?{title:"Custom Configuration",description:"Custom radio settings",frequency:c.value.frequency,spreading_factor:c.value.spreading_factor,bandwidth:c.value.bandwidth,coding_rate:c.value.coding_rate}:h.value,N=await(await fetch("/api/setup_wizard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({node_name:y.value.trim(),hardware_key:p.value?.key,radio_preset:d,admin_password:f.value})})).json();if(!N.success)throw new Error(N.error||"Setup failed");return{success:!0,data:N}}catch(d){const b=d instanceof Error?d.message:"Failed to complete setup";return g.value=b,{success:!1,error:b}}finally{S.value=!1}}function O(){P.value&&x.value=1&&d<=r.value&&(x.value=d)}function A(){x.value=1,y.value=`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,"0")}`,p.value=null,h.value=null,u.value=!1,c.value={frequency:"915.0",spreading_factor:"7",bandwidth:"125",coding_rate:"5"},f.value="",k.value="",g.value=null}return{currentStep:x,totalSteps:r,nodeName:y,selectedHardware:p,selectedRadioPreset:h,useCustomRadio:u,customRadio:c,adminPassword:f,confirmPassword:k,hardwareOptions:j,radioPresets:L,isLoading:w,isSubmitting:S,error:g,canGoNext:P,canGoBack:m,isLastStep:t,fetchHardwareOptions:s,fetchRadioPresets:C,completeSetup:T,nextStep:O,previousStep:$,goToStep:G,reset:A}}),re={class:"min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-center justify-center p-4"},oe={class:"absolute top-4 right-4 z-20"},se={class:"w-full max-w-4xl relative z-10"},ae={class:"mb-8"},ne={class:"flex justify-between mb-2"},de={class:"text-content-secondary dark:text-content-muted text-sm"},ie={class:"text-content-secondary dark:text-content-muted text-sm"},le={class:"h-2 bg-stroke-subtle dark:bg-stroke/10 rounded-full overflow-hidden"},ue={class:"bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 sm:p-8 md:p-12"},ce={class:"flex justify-center mb-8"},pe={class:"flex gap-2"},me={class:"mb-8"},be={class:"text-2xl sm:text-3xl font-bold text-content-primary dark:text-content-primary mb-2 text-center"},xe={key:0,class:"space-y-6 mt-8"},ke={key:1,class:"space-y-6 mt-8"},ge={class:"max-w-md mx-auto"},fe={key:2,class:"space-y-6 mt-8"},ve={key:0,class:"text-center text-content-secondary dark:text-content-muted"},ye={key:1,class:"text-center text-content-secondary dark:text-content-muted"},he={key:2,class:"grid grid-cols-1 md:grid-cols-2 gap-4 max-w-3xl mx-auto"},we=["onClick"],_e={class:"font-medium text-content-primary dark:text-content-primary mb-1"},Se={class:"text-sm text-content-secondary dark:text-content-muted"},Ce={key:3,class:"space-y-6 mt-8"},Re={key:0,class:"text-center text-content-secondary dark:text-content-muted"},je={key:1,class:"text-center text-content-secondary dark:text-content-muted"},Pe={key:2,class:"max-w-5xl mx-auto"},Me={class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4"},Le=["onClick"],Be={class:"relative z-10"},Te={class:"font-medium text-content-primary dark:text-content-primary mb-1 flex items-start justify-between gap-2"},Ne={class:"flex items-center gap-2"},ze={class:"text-2xl"},Ve={key:0,class:"text-primary flex-shrink-0"},qe={class:"text-xs text-content-secondary dark:text-content-muted mb-3"},Ee={class:"grid grid-cols-2 gap-2 text-xs"},Fe={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},He={class:"text-content-primary dark:text-content-primary/80 font-medium"},Ue={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},Oe={class:"text-content-primary dark:text-content-primary/80 font-medium"},$e={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},Ge={class:"text-content-primary dark:text-content-primary/80 font-medium"},Ae={class:"bg-gray-50 dark:bg-white/5 rounded px-2 py-1"},De={class:"text-content-primary dark:text-content-primary/80 font-medium"},We={class:"border-t border-stroke-subtle dark:border-stroke/10 pt-6"},Ie={class:"flex items-center justify-between mb-2"},Ye={key:0,class:"text-primary"},Je={key:0,class:"mt-4 grid grid-cols-2 gap-4"},Ke={key:4,class:"space-y-6 mt-8"},Qe={class:"max-w-md mx-auto space-y-4"},Xe={key:0,class:"text-red-600 dark:text-red-400 text-sm"},Ze={key:0,class:"mb-6 bg-red-500/10 border border-red-500/30 rounded-lg p-4 text-red-600 dark:text-red-200"},et={class:"flex justify-between gap-4"},tt={key:1},rt=["disabled"],ot={key:0,class:"w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin"},st={key:1},at={key:2},nt={key:3},dt={key:4,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},it={class:"flex justify-center mb-6"},lt={key:0,class:"w-16 h-16 rounded-full bg-green-100 dark:bg-green-500/20 flex items-center justify-center"},ut={key:1,class:"w-16 h-16 rounded-full bg-red-100 dark:bg-red-500/20 flex items-center justify-center"},ct={class:"text-2xl font-bold text-content-primary dark:text-content-primary text-center mb-4"},pt={class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"},mt=W({name:"SetupView",__name:"Setup",setup(x){const r=te(),y=X(),p=l(!1),h=l(""),f=l(""),k=l("success");let u=null;const c=m=>{const t=m.toLowerCase();return t.includes("australia")?"🇦🇺":t.includes("eu")||t.includes("uk")?"🇪🇺":t.includes("czech")?"🇨🇿":t.includes("new zealand")?"🇳🇿":t.includes("portugal")?"🇵🇹":t.includes("switzerland")?"🇨🇭":t.includes("usa")||t.includes("canada")?"🇺🇸":t.includes("vietnam")?"🇻🇳":"🌍"};I(async()=>{await Promise.all([r.fetchHardwareOptions(),r.fetchRadioPresets()])});const j=B(()=>r.currentStep/r.totalSteps*100);async function L(){if(r.isLastStep){const m=await r.completeSetup();m.success?(k.value="success",h.value="Setup Complete!",f.value="Your repeater has been configured successfully. The service is restarting now...",p.value=!0,g()):(k.value="error",h.value="Setup Failed",f.value=m.error||"An unknown error occurred",p.value=!0)}else r.nextStep()}function w(){r.previousStep()}function S(){p.value=!1,k.value==="success"&&(u||y.push("/login"))}function g(){let m=0;const t=30;function s(){m++,fetch("/api/status",{method:"GET"}).then(T=>{T.ok?(u=null,p.value=!1,y.push("/login")):C()}).catch(()=>{C()})}function C(){m{u&&(clearTimeout(u),u=null)});const P=["Welcome","Repeater Name","Hardware Selection","Radio Configuration","Security Setup"];return(m,t)=>(n(),a("div",re,[e("div",oe,[z(J)]),t[36]||(t[36]=e("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slow -top-[79px] left-[575px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),t[37]||(t[37]=e("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-75 animate-pulse-slower -top-[94px] -left-[92px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),t[38]||(t[38]=e("div",{class:"bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slowest top-[373px] left-[246px] mix-blend-multiply dark:mix-blend-screen pointer-events-none"},null,-1)),e("div",se,[e("div",ae,[e("div",ne,[e("span",de,"Step "+i(o(r).currentStep)+" of "+i(o(r).totalSteps),1),e("span",ie,i(Math.round(j.value))+"% Complete",1)]),e("div",le,[e("div",{class:"h-full bg-gradient-to-r from-primary to-primary/80 transition-all duration-500",style:K({width:`${j.value}%`})},null,4)])]),e("div",ue,[e("div",ce,[e("div",pe,[(n(!0),a(V,null,q(o(r).totalSteps,s=>(n(),a("div",{key:s,class:R(["w-10 h-10 rounded-full flex items-center justify-center text-sm font-medium transition-all",s===o(r).currentStep?"bg-primary text-white":s

Welcome to your pyMC Repeater! Let's get you set up in just a few steps.

You'll configure:

  • Repeater name and identification
  • Hardware board selection
  • Radio frequency and settings
  • Admin password for secure access
',1)]))):o(r).currentStep===2?(n(),a("div",ke,[t[12]||(t[12]=e("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Choose a unique name for your repeater. This will be used for identification on the mesh network. ",-1)),e("div",ge,[t[10]||(t[10]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Repeater Name",-1)),_(e("input",{"onUpdate:modelValue":t[0]||(t[0]=s=>o(r).nodeName=s),type:"text",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"e.g., pyRpt0001",maxlength:"32"},null,512),[[M,o(r).nodeName]]),t[11]||(t[11]=e("p",{class:"text-content-secondary dark:text-content-muted text-xs mt-2"}," Use letters, numbers, hyphens, or underscores (3-32 characters) ",-1))])])):o(r).currentStep===3?(n(),a("div",fe,[t[13]||(t[13]=e("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Select your hardware board type ",-1)),o(r).isLoading?(n(),a("div",ve," Loading hardware options... ")):o(r).hardwareOptions.length===0?(n(),a("div",ye," No hardware options available ")):(n(),a("div",he,[(n(!0),a(V,null,q(o(r).hardwareOptions,s=>(n(),a("button",{key:s.key,onClick:C=>o(r).selectedHardware=s,class:R(["p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm",o(r).selectedHardware?.key===s.key?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20"])},[e("div",_e,i(s.name),1),e("div",Se,i(s.description||s.key),1)],10,we))),128))]))])):o(r).currentStep===4?(n(),a("div",Ce,[t[28]||(t[28]=e("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Choose a radio configuration preset for your region or create a custom configuration ",-1)),o(r).isLoading?(n(),a("div",Re," Loading radio presets... ")):o(r).radioPresets.length===0?(n(),a("div",je," No radio presets available ")):(n(),a("div",Pe,[e("div",Me,[(n(!0),a(V,null,q(o(r).radioPresets,s=>(n(),a("button",{key:s.title,onClick:C=>{o(r).selectedRadioPreset=s,o(r).useCustomRadio=!1},class:R(["p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm relative overflow-hidden",!o(r).useCustomRadio&&o(r).selectedRadioPreset?.title===s.title?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20"])},[e("div",Be,[e("div",Te,[e("span",Ne,[e("span",ze,i(c(s.title)),1),e("span",null,i(s.title),1)]),!o(r).useCustomRadio&&o(r).selectedRadioPreset?.title===s.title?(n(),a("div",Ve,t[14]||(t[14]=[e("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20"},[e("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)]))):v("",!0)]),e("div",qe,i(s.description),1),e("div",Ee,[e("div",Fe,[t[15]||(t[15]=e("div",{class:"text-content-muted dark:text-content-muted"},"Freq",-1)),e("div",He,i(s.frequency),1)]),e("div",Ue,[t[16]||(t[16]=e("div",{class:"text-content-muted dark:text-content-muted"},"BW",-1)),e("div",Oe,i(s.bandwidth),1)]),e("div",$e,[t[17]||(t[17]=e("div",{class:"text-content-muted dark:text-content-muted"},"SF",-1)),e("div",Ge,i(s.spreading_factor),1)]),e("div",Ae,[t[18]||(t[18]=e("div",{class:"text-content-muted dark:text-content-muted"},"CR",-1)),e("div",De,i(s.coding_rate),1)])])])],10,Le))),128))]),e("div",We,[e("button",{onClick:t[1]||(t[1]=s=>{o(r).useCustomRadio=!o(r).useCustomRadio,o(r).useCustomRadio&&(o(r).selectedRadioPreset=null)}),class:R(["w-full p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm",o(r).useCustomRadio?"bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20":"bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20"])},[e("div",Ie,[t[20]||(t[20]=e("div",{class:"font-medium text-content-primary dark:text-content-primary flex items-center gap-2"},[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"})]),E(" Custom Configuration ")],-1)),o(r).useCustomRadio?(n(),a("div",Ye,t[19]||(t[19]=[e("svg",{class:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20"},[e("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})],-1)]))):v("",!0)]),t[21]||(t[21]=e("div",{class:"text-xs text-content-secondary dark:text-content-muted"},"Manually configure frequency, bandwidth, spreading factor, and coding rate",-1))],2),z(H,{name:"slide"},{default:F(()=>[o(r).useCustomRadio?(n(),a("div",Je,[e("div",null,[t[22]||(t[22]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Frequency (MHz)",-1)),_(e("input",{"onUpdate:modelValue":t[2]||(t[2]=s=>o(r).customRadio.frequency=s),type:"number",step:"0.1",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all",placeholder:"915.0"},null,512),[[M,o(r).customRadio.frequency]])]),e("div",null,[t[23]||(t[23]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Bandwidth (kHz)",-1)),_(e("input",{"onUpdate:modelValue":t[3]||(t[3]=s=>o(r).customRadio.bandwidth=s),type:"number",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all",placeholder:"125"},null,512),[[M,o(r).customRadio.bandwidth]])]),e("div",null,[t[25]||(t[25]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Spreading Factor",-1)),_(e("select",{"onUpdate:modelValue":t[4]||(t[4]=s=>o(r).customRadio.spreading_factor=s),class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all"},t[24]||(t[24]=[e("option",{value:"7"},"7",-1),e("option",{value:"8"},"8",-1),e("option",{value:"9"},"9",-1),e("option",{value:"10"},"10",-1),e("option",{value:"11"},"11",-1),e("option",{value:"12"},"12",-1)]),512),[[U,o(r).customRadio.spreading_factor]])]),e("div",null,[t[27]||(t[27]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Coding Rate",-1)),_(e("select",{"onUpdate:modelValue":t[5]||(t[5]=s=>o(r).customRadio.coding_rate=s),class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all"},t[26]||(t[26]=[e("option",{value:"5"},"4/5",-1),e("option",{value:"6"},"4/6",-1),e("option",{value:"7"},"4/7",-1),e("option",{value:"8"},"4/8",-1)]),512),[[U,o(r).customRadio.coding_rate]])])])):v("",!0)]),_:1})])]))])):o(r).currentStep===5?(n(),a("div",Ke,[t[32]||(t[32]=e("p",{class:"text-content-secondary dark:text-content-primary/70 text-center mb-6"}," Set a secure admin password to protect your repeater ",-1)),e("div",Qe,[e("div",null,[t[29]||(t[29]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Admin Password",-1)),_(e("input",{"onUpdate:modelValue":t[6]||(t[6]=s=>o(r).adminPassword=s),type:"password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"Enter password (min 6 characters)",minlength:"6"},null,512),[[M,o(r).adminPassword]])]),e("div",null,[t[30]||(t[30]=e("label",{class:"block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2"},"Confirm Password",-1)),_(e("input",{"onUpdate:modelValue":t[7]||(t[7]=s=>o(r).confirmPassword=s),type:"password",class:"w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent",placeholder:"Confirm password"},null,512),[[M,o(r).confirmPassword]])]),o(r).adminPassword&&o(r).confirmPassword&&o(r).adminPassword!==o(r).confirmPassword?(n(),a("div",Xe," Passwords do not match ")):v("",!0),t[31]||(t[31]=e("div",{class:"bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3 text-sm text-yellow-800 dark:text-yellow-200"},[e("strong",null,"Important:"),E(" Remember this password - you'll need it to access the dashboard. ")],-1))])])):v("",!0)]),o(r).error?(n(),a("div",Ze,i(o(r).error),1)):v("",!0),e("div",et,[o(r).canGoBack?(n(),a("button",{key:0,onClick:w,class:"px-6 py-3 rounded-[12px] bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 text-content-primary dark:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20 transition-all duration-300 font-medium"}," Back ")):(n(),a("div",tt)),e("button",{onClick:L,disabled:!o(r).canGoNext||o(r).isSubmitting,class:R(["px-8 py-3 rounded-[12px] font-semibold transition-all duration-300 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",o(r).canGoNext&&!o(r).isSubmitting?"bg-primary hover:bg-primary/90 text-white border border-primary hover:border-primary/80":"bg-background-mute dark:bg-stroke/5 text-content-muted dark:text-content-muted border border-stroke-subtle dark:border-stroke/10"])},[o(r).isSubmitting?(n(),a("div",ot)):v("",!0),o(r).isSubmitting?(n(),a("span",st,"Setting up...")):o(r).isLastStep?(n(),a("span",at,"Complete Setup")):(n(),a("span",nt,"Next")),!o(r).isSubmitting&&!o(r).isLastStep?(n(),a("svg",dt,t[33]||(t[33]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)]))):v("",!0)],10,rt)])])]),z(H,{name:"modal"},{default:F(()=>[p.value?(n(),a("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",onClick:S},[e("div",{class:"bg-white dark:bg-surface-elevated backdrop-blur-xl max-w-md w-full p-8 rounded-[24px] border border-stroke-subtle dark:border-white/20 shadow-[0_8px_32px_0_rgba(0,0,0,0.37)]",onClick:t[8]||(t[8]=Z(()=>{},["stop"]))},[e("div",it,[k.value==="success"?(n(),a("div",lt,t[34]||(t[34]=[e("svg",{class:"w-8 h-8 text-green-600 dark:text-green-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 13l4 4L19 7"})],-1)]))):(n(),a("div",ut,t[35]||(t[35]=[e("svg",{class:"w-8 h-8 text-red-600 dark:text-red-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])))]),e("h3",ct,i(h.value),1),e("p",pt,i(f.value),1),e("button",{onClick:S,class:R(["w-full px-6 py-3 rounded-lg font-medium transition-all",k.value==="success"?"bg-primary hover:bg-primary/90 text-white":"bg-accent-red hover:bg-accent-red/90 text-white"])},i(k.value==="success"?"Continue to Login":"Close"),3)])])):v("",!0)]),_:1})]))}}),xt=ee(mt,[["__scopeId","data-v-693a052e"]]);export{xt as default}; diff --git a/repeater/web/html/assets/Setup-DxqfWs1P.css b/repeater/web/html/assets/Setup-DxqfWs1P.css deleted file mode 100644 index f6cc00a..0000000 --- a/repeater/web/html/assets/Setup-DxqfWs1P.css +++ /dev/null @@ -1 +0,0 @@ -.glass-card[data-v-693a052e]{background:#ffffff0d;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);border:1px solid rgba(255,255,255,.1)}.modal-enter-active[data-v-693a052e],.modal-leave-active[data-v-693a052e]{transition:opacity .3s ease}.modal-enter-from[data-v-693a052e],.modal-leave-to[data-v-693a052e]{opacity:0}.modal-enter-active .glass-card[data-v-693a052e],.modal-leave-active .glass-card[data-v-693a052e]{transition:transform .3s ease}.modal-enter-from .glass-card[data-v-693a052e],.modal-leave-to .glass-card[data-v-693a052e]{transform:scale(.9)}.slide-enter-active[data-v-693a052e],.slide-leave-active[data-v-693a052e]{transition:all .3s ease}.slide-enter-from[data-v-693a052e],.slide-leave-to[data-v-693a052e]{opacity:0;transform:translateY(-10px)}@keyframes float-slow-693a052e{0%,to{opacity:.8;transform:translate(0) scale(1) rotate(-24.22deg)}50%{opacity:.6;transform:translate(20px,-20px) scale(1.05) rotate(-24.22deg)}}@keyframes float-slower-693a052e{0%,to{opacity:.75;transform:translate(0) scale(1) rotate(-24.22deg)}50%{opacity:.5;transform:translate(-30px,20px) scale(1.08) rotate(-24.22deg)}}@keyframes float-slowest-693a052e{0%,to{opacity:.8;transform:translate(0) scale(1) rotate(-24.22deg)}50%{opacity:.55;transform:translate(25px,25px) scale(1.1) rotate(-24.22deg)}}.animate-pulse-slow[data-v-693a052e]{animation:float-slow-693a052e 15s ease-in-out infinite;will-change:transform,opacity}.animate-pulse-slower[data-v-693a052e]{animation:float-slower-693a052e 18s ease-in-out infinite;will-change:transform,opacity}.animate-pulse-slowest[data-v-693a052e]{animation:float-slowest-693a052e 20s ease-in-out infinite;will-change:transform,opacity} diff --git a/repeater/web/html/assets/Setup-wQ-fEW9F.js b/repeater/web/html/assets/Setup-wQ-fEW9F.js new file mode 100644 index 0000000..732875d --- /dev/null +++ b/repeater/web/html/assets/Setup-wQ-fEW9F.js @@ -0,0 +1 @@ +import{A as e,E as t,S as n,W as r,dt as i,f as a,g as o,j as s,l as c,lt as l,m as u,o as d,p as f,r as p,s as m,u as h,ut as g,w as _,x as v,z as y}from"./runtime-core.esm-bundler-IofF4kUm.js";import{n as b}from"./pinia-BrpcNUEi.js";import{i as x}from"./vue-router-BsDVl_JC.js";import{t as S}from"./_plugin-vue_export-helper-V-yks4gF.js";import{d as C,m as w,s as T,t as ee,u as E}from"./index-CPWfwDmA.js";var te=b(`setup`,()=>{let e=y(1),t=y(5),n=y(`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,`0`)}`),r=y(null),i=y(null),a=y(``),o=y(``),s=y(!1),c=y({frequency:`915.0`,spreading_factor:`7`,bandwidth:`125`,coding_rate:`5`}),l=y([]),u=y([]),f=y(!1),p=y(!1),m=y(null),h=d(()=>{switch(e.value){case 1:return!0;case 2:return n.value.trim().length>0;case 3:return r.value!==null;case 4:return s.value?c.value.frequency&&c.value.spreading_factor&&c.value.bandwidth&&c.value.coding_rate:i.value!==null;case 5:return a.value.length>=6&&a.value===o.value;default:return!1}}),g=d(()=>e.value>1),_=d(()=>e.value===t.value);async function v(){f.value=!0,m.value=null;try{let e=await(await fetch(`/api/hardware_options`)).json();if(e.error)throw Error(e.error);l.value=e.hardware||[]}catch(e){m.value=e instanceof Error?e.message:`Failed to load hardware options`,console.error(`Error fetching hardware options:`,e)}finally{f.value=!1}}async function b(){f.value=!0,m.value=null;try{let e=await(await fetch(`/api/radio_presets`)).json();if(e.error)throw Error(e.error);u.value=e.presets||[]}catch(e){m.value=e instanceof Error?e.message:`Failed to load radio presets`,console.error(`Error fetching radio presets:`,e)}finally{f.value=!1}}async function x(){if(!h.value)return{success:!1,error:`Please complete all required fields`};p.value=!0,m.value=null;try{let e=s.value?{title:`Custom Configuration`,description:`Custom radio settings`,frequency:c.value.frequency,spreading_factor:c.value.spreading_factor,bandwidth:c.value.bandwidth,coding_rate:c.value.coding_rate}:i.value,t=await(await fetch(`/api/setup_wizard`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({node_name:n.value.trim(),hardware_key:r.value?.key,radio_preset:e,admin_password:a.value})})).json();if(!t.success)throw Error(t.error||`Setup failed`);return{success:!0,data:t}}catch(e){let t=e instanceof Error?e.message:`Failed to complete setup`;return m.value=t,{success:!1,error:t}}finally{p.value=!1}}function S(){h.value&&e.value=1&&n<=t.value&&(e.value=n)}function T(){e.value=1,n.value=`pyRpt${Math.floor(Math.random()*1e4).toString().padStart(4,`0`)}`,r.value=null,i.value=null,s.value=!1,c.value={frequency:`915.0`,spreading_factor:`7`,bandwidth:`125`,coding_rate:`5`},a.value=``,o.value=``,m.value=null}return{currentStep:e,totalSteps:t,nodeName:n,selectedHardware:r,selectedRadioPreset:i,useCustomRadio:s,customRadio:c,adminPassword:a,confirmPassword:o,hardwareOptions:l,radioPresets:u,isLoading:f,isSubmitting:p,error:m,canGoNext:h,canGoBack:g,isLastStep:_,fetchHardwareOptions:v,fetchRadioPresets:b,completeSetup:x,nextStep:S,previousStep:C,goToStep:w,reset:T}}),ne={class:`min-h-screen bg-background dark:bg-background overflow-hidden relative flex items-center justify-center p-4`},re={class:`absolute top-4 right-4 z-20`},ie={class:`w-full max-w-4xl relative z-10`},ae={class:`mb-8`},oe={class:`flex justify-between mb-2`},se={class:`text-content-secondary dark:text-content-muted text-sm`},ce={class:`text-content-secondary dark:text-content-muted text-sm`},D={class:`h-2 bg-stroke-subtle dark:bg-stroke/10 rounded-full overflow-hidden`},O={class:`bg-white dark:bg-surface-elevated backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[20px] p-6 sm:p-8 md:p-12`},k={class:`flex justify-center mb-8`},A={class:`flex gap-2`},j={class:`mb-8`},M={class:`text-2xl sm:text-3xl font-bold text-content-primary dark:text-content-primary mb-2 text-center`},N={key:0,class:`space-y-6 mt-8`},P={key:1,class:`space-y-6 mt-8`},F={class:`max-w-md mx-auto`},I={key:2,class:`space-y-6 mt-8`},L={key:0,class:`text-center text-content-secondary dark:text-content-muted`},R={key:1,class:`text-center text-content-secondary dark:text-content-muted`},z={key:2,class:`grid grid-cols-1 md:grid-cols-2 gap-4 max-w-3xl mx-auto`},B=[`onClick`],V={class:`font-medium text-content-primary dark:text-content-primary mb-1`},H={class:`text-sm text-content-secondary dark:text-content-muted`},U={key:3,class:`space-y-6 mt-8`},W={key:0,class:`text-center text-content-secondary dark:text-content-muted`},G={key:1,class:`text-center text-content-secondary dark:text-content-muted`},le={key:2,class:`max-w-5xl mx-auto`},ue={class:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 mb-4`},de=[`onClick`],fe={class:`relative z-10`},pe={class:`font-medium text-content-primary dark:text-content-primary mb-1 flex items-start justify-between gap-2`},me={class:`flex items-center gap-2`},he={class:`text-2xl`},ge={key:0,class:`text-primary flex-shrink-0`},_e={class:`text-xs text-content-secondary dark:text-content-muted mb-3`},ve={class:`grid grid-cols-2 gap-2 text-xs`},ye={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},be={class:`text-content-primary dark:text-content-primary/80 font-medium`},xe={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Se={class:`text-content-primary dark:text-content-primary/80 font-medium`},K={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Ce={class:`text-content-primary dark:text-content-primary/80 font-medium`},we={class:`bg-gray-50 dark:bg-white/5 rounded px-2 py-1`},Te={class:`text-content-primary dark:text-content-primary/80 font-medium`},Ee={class:`border-t border-stroke-subtle dark:border-stroke/10 pt-6`},De={class:`flex items-center justify-between mb-2`},Oe={key:0,class:`text-primary`},ke={key:0,class:`mt-4 grid grid-cols-2 gap-4`},Ae={key:4,class:`space-y-6 mt-8`},je={class:`max-w-md mx-auto space-y-4`},Me={key:0,class:`text-red-600 dark:text-red-400 text-sm`},Ne={key:0,class:`mb-6 bg-red-500/10 border border-red-500/30 rounded-lg p-4 text-red-600 dark:text-red-200`},Pe={class:`flex justify-between gap-4`},Fe={key:1},Ie=[`disabled`],Le={key:0,class:`w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin`},Re={key:1},ze={key:2},Be={key:3},Ve={key:4,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},He={class:`flex justify-center mb-6`},Ue={key:0,class:`w-16 h-16 rounded-full bg-green-100 dark:bg-green-500/20 flex items-center justify-center`},We={key:1,class:`w-16 h-16 rounded-full bg-red-100 dark:bg-red-500/20 flex items-center justify-center`},Ge={class:`text-2xl font-bold text-content-primary dark:text-content-primary text-center mb-4`},Ke={class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},q=S(o({name:`SetupView`,__name:`Setup`,setup(o){let b=te(),S=x(),q=y(!1),J=y(``),Y=y(``),X=y(`success`),Z=null,qe=e=>{let t=e.toLowerCase();return t.includes(`australia`)?`🇦🇺`:t.includes(`eu`)||t.includes(`uk`)?`🇪🇺`:t.includes(`czech`)?`🇨🇿`:t.includes(`new zealand`)?`🇳🇿`:t.includes(`portugal`)?`🇵🇹`:t.includes(`switzerland`)?`🇨🇭`:t.includes(`usa`)||t.includes(`canada`)?`🇺🇸`:t.includes(`vietnam`)?`🇻🇳`:`🌍`};n(async()=>{await Promise.all([b.fetchHardwareOptions(),b.fetchRadioPresets()])});let Q=d(()=>b.currentStep/b.totalSteps*100);async function Je(){if(b.isLastStep){let e=await b.completeSetup();e.success?(X.value=`success`,J.value=`Setup Complete!`,Y.value=`Your repeater has been configured successfully. The service is restarting now...`,q.value=!0,Xe()):(X.value=`error`,J.value=`Setup Failed`,Y.value=e.error||`An unknown error occurred`,q.value=!0)}else b.nextStep()}function Ye(){b.previousStep()}function $(){q.value=!1,X.value===`success`&&(Z||S.push(`/login`))}function Xe(){let e=0;function t(){e++,fetch(`/api/status`,{method:`GET`}).then(e=>{e.ok?(Z=null,q.value=!1,S.push(`/login`)):n()}).catch(()=>{n()})}function n(){e<30?Z=setTimeout(t,1e3):(Z=null,q.value=!1,S.push(`/login`))}Z=setTimeout(t,2e3)}v(()=>{Z&&=(clearTimeout(Z),null)});let Ze=[`Welcome`,`Repeater Name`,`Hardware Selection`,`Radio Configuration`,`Security Setup`];return(n,o)=>(_(),h(`div`,ne,[m(`div`,re,[u(ee)]),o[36]||=m(`div`,{class:`bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slow -top-[79px] left-[575px] mix-blend-multiply dark:mix-blend-screen pointer-events-none`},null,-1),o[37]||=m(`div`,{class:`bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-75 animate-pulse-slower -top-[94px] -left-[92px] mix-blend-multiply dark:mix-blend-screen pointer-events-none`},null,-1),o[38]||=m(`div`,{class:`bg-gradient-light dark:bg-gradient-dark absolute rounded-full -rotate-[24.22deg] w-[705px] h-[512px] blur-[120px] opacity-80 animate-pulse-slowest top-[373px] left-[246px] mix-blend-multiply dark:mix-blend-screen pointer-events-none`},null,-1),m(`div`,ie,[m(`div`,ae,[m(`div`,oe,[m(`span`,se,`Step `+i(r(b).currentStep)+` of `+i(r(b).totalSteps),1),m(`span`,ce,i(Math.round(Q.value))+`% Complete`,1)]),m(`div`,D,[m(`div`,{class:`h-full bg-gradient-to-r from-primary to-primary/80 transition-all duration-500`,style:g({width:`${Q.value}%`})},null,4)])]),m(`div`,O,[m(`div`,k,[m(`div`,A,[(_(!0),h(p,null,t(r(b).totalSteps,e=>(_(),h(`div`,{key:e,class:l([`w-10 h-10 rounded-full flex items-center justify-center text-sm font-medium transition-all`,e===r(b).currentStep?`bg-primary text-white`:e

Welcome to your pyMC Repeater! Let's get you set up in just a few steps.

You'll configure:

  • Repeater name and identification
  • Hardware board selection
  • Radio frequency and settings
  • Admin password for secure access
`,1)]])):r(b).currentStep===2?(_(),h(`div`,P,[o[12]||=m(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Choose a unique name for your repeater. This will be used for identification on the mesh network. `,-1),m(`div`,F,[o[10]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Repeater Name`,-1),s(m(`input`,{"onUpdate:modelValue":o[0]||=e=>r(b).nodeName=e,type:`text`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent`,placeholder:`e.g., pyRpt0001`,maxlength:`32`},null,512),[[C,r(b).nodeName]]),o[11]||=m(`p`,{class:`text-content-secondary dark:text-content-muted text-xs mt-2`},` Use letters, numbers, hyphens, or underscores (3-32 characters) `,-1)])])):r(b).currentStep===3?(_(),h(`div`,I,[o[13]||=m(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Select your hardware board type `,-1),r(b).isLoading?(_(),h(`div`,L,` Loading hardware options... `)):r(b).hardwareOptions.length===0?(_(),h(`div`,R,` No hardware options available `)):(_(),h(`div`,z,[(_(!0),h(p,null,t(r(b).hardwareOptions,e=>(_(),h(`button`,{key:e.key,onClick:t=>r(b).selectedHardware=e,class:l([`p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm`,r(b).selectedHardware?.key===e.key?`bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20`:`bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20`])},[m(`div`,V,i(e.name),1),m(`div`,H,i(e.description||e.key),1)],10,B))),128))]))])):r(b).currentStep===4?(_(),h(`div`,U,[o[28]||=m(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Choose a radio configuration preset for your region or create a custom configuration `,-1),r(b).isLoading?(_(),h(`div`,W,` Loading radio presets... `)):r(b).radioPresets.length===0?(_(),h(`div`,G,` No radio presets available `)):(_(),h(`div`,le,[m(`div`,ue,[(_(!0),h(p,null,t(r(b).radioPresets,e=>(_(),h(`button`,{key:e.title,onClick:t=>{r(b).selectedRadioPreset=e,r(b).useCustomRadio=!1},class:l([`p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm relative overflow-hidden`,!r(b).useCustomRadio&&r(b).selectedRadioPreset?.title===e.title?`bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20`:`bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20`])},[m(`div`,fe,[m(`div`,pe,[m(`span`,me,[m(`span`,he,i(qe(e.title)),1),m(`span`,null,i(e.title),1)]),!r(b).useCustomRadio&&r(b).selectedRadioPreset?.title===e.title?(_(),h(`div`,ge,[...o[14]||=[m(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[m(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z`,"clip-rule":`evenodd`})],-1)]])):c(``,!0)]),m(`div`,_e,i(e.description),1),m(`div`,ve,[m(`div`,ye,[o[15]||=m(`div`,{class:`text-content-muted dark:text-content-muted`},`Freq`,-1),m(`div`,be,i(e.frequency),1)]),m(`div`,xe,[o[16]||=m(`div`,{class:`text-content-muted dark:text-content-muted`},`BW`,-1),m(`div`,Se,i(e.bandwidth),1)]),m(`div`,K,[o[17]||=m(`div`,{class:`text-content-muted dark:text-content-muted`},`SF`,-1),m(`div`,Ce,i(e.spreading_factor),1)]),m(`div`,we,[o[18]||=m(`div`,{class:`text-content-muted dark:text-content-muted`},`CR`,-1),m(`div`,Te,i(e.coding_rate),1)])])])],10,de))),128))]),m(`div`,Ee,[m(`button`,{onClick:o[1]||=e=>{r(b).useCustomRadio=!r(b).useCustomRadio,r(b).useCustomRadio&&(r(b).selectedRadioPreset=null)},class:l([`w-full p-4 rounded-[12px] border transition-all duration-300 text-left backdrop-blur-sm`,r(b).useCustomRadio?`bg-gradient-to-r from-primary/20 to-primary/10 border-primary/50 shadow-lg shadow-primary/20`:`bg-background-mute dark:bg-white/5 border-stroke-subtle dark:border-stroke/10 hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20`])},[m(`div`,De,[o[20]||=m(`div`,{class:`font-medium text-content-primary dark:text-content-primary flex items-center gap-2`},[m(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[m(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4`})]),f(` Custom Configuration `)],-1),r(b).useCustomRadio?(_(),h(`div`,Oe,[...o[19]||=[m(`svg`,{class:`w-5 h-5`,fill:`currentColor`,viewBox:`0 0 20 20`},[m(`path`,{"fill-rule":`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z`,"clip-rule":`evenodd`})],-1)]])):c(``,!0)]),o[21]||=m(`div`,{class:`text-xs text-content-secondary dark:text-content-muted`},` Manually configure frequency, bandwidth, spreading factor, and coding rate `,-1)],2),u(T,{name:`slide`},{default:e(()=>[r(b).useCustomRadio?(_(),h(`div`,ke,[m(`div`,null,[o[22]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Frequency (MHz)`,-1),s(m(`input`,{"onUpdate:modelValue":o[2]||=e=>r(b).customRadio.frequency=e,type:`number`,step:`0.1`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`,placeholder:`915.0`},null,512),[[C,r(b).customRadio.frequency]])]),m(`div`,null,[o[23]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Bandwidth (kHz)`,-1),s(m(`input`,{"onUpdate:modelValue":o[3]||=e=>r(b).customRadio.bandwidth=e,type:`number`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`,placeholder:`125`},null,512),[[C,r(b).customRadio.bandwidth]])]),m(`div`,null,[o[25]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Spreading Factor`,-1),s(m(`select`,{"onUpdate:modelValue":o[4]||=e=>r(b).customRadio.spreading_factor=e,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`},[...o[24]||=[m(`option`,{value:`7`},`7`,-1),m(`option`,{value:`8`},`8`,-1),m(`option`,{value:`9`},`9`,-1),m(`option`,{value:`10`},`10`,-1),m(`option`,{value:`11`},`11`,-1),m(`option`,{value:`12`},`12`,-1)]],512),[[E,r(b).customRadio.spreading_factor]])]),m(`div`,null,[o[27]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Coding Rate`,-1),s(m(`select`,{"onUpdate:modelValue":o[5]||=e=>r(b).customRadio.coding_rate=e,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-[12px] px-4 py-2.5 text-content-primary dark:text-content-primary focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-transparent transition-all`},[...o[26]||=[m(`option`,{value:`5`},`4/5`,-1),m(`option`,{value:`6`},`4/6`,-1),m(`option`,{value:`7`},`4/7`,-1),m(`option`,{value:`8`},`4/8`,-1)]],512),[[E,r(b).customRadio.coding_rate]])])])):c(``,!0)]),_:1})])]))])):r(b).currentStep===5?(_(),h(`div`,Ae,[o[32]||=m(`p`,{class:`text-content-secondary dark:text-content-primary/70 text-center mb-6`},` Set a secure admin password to protect your repeater `,-1),m(`div`,je,[m(`div`,null,[o[29]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Admin Password`,-1),s(m(`input`,{"onUpdate:modelValue":o[6]||=e=>r(b).adminPassword=e,type:`password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent`,placeholder:`Enter password (min 6 characters)`,minlength:`6`},null,512),[[C,r(b).adminPassword]])]),m(`div`,null,[o[30]||=m(`label`,{class:`block text-content-primary dark:text-content-primary/90 text-sm font-medium mb-2`},`Confirm Password`,-1),s(m(`input`,{"onUpdate:modelValue":o[7]||=e=>r(b).confirmPassword=e,type:`password`,class:`w-full bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg px-4 py-3 text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent`,placeholder:`Confirm password`},null,512),[[C,r(b).confirmPassword]])]),r(b).adminPassword&&r(b).confirmPassword&&r(b).adminPassword!==r(b).confirmPassword?(_(),h(`div`,Me,` Passwords do not match `)):c(``,!0),o[31]||=m(`div`,{class:`bg-yellow-500/10 border border-yellow-500/30 rounded-lg p-3 text-sm text-yellow-800 dark:text-yellow-200`},[m(`strong`,null,`Important:`),f(` Remember this password - you'll need it to access the dashboard. `)],-1)])])):c(``,!0)]),r(b).error?(_(),h(`div`,Ne,i(r(b).error),1)):c(``,!0),m(`div`,Pe,[r(b).canGoBack?(_(),h(`button`,{key:0,onClick:Ye,class:`px-6 py-3 rounded-[12px] bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 text-content-primary dark:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 hover:border-stroke dark:hover:border-stroke/20 transition-all duration-300 font-medium`},` Back `)):(_(),h(`div`,Fe)),m(`button`,{onClick:Je,disabled:!r(b).canGoNext||r(b).isSubmitting,class:l([`px-8 py-3 rounded-[12px] font-semibold transition-all duration-300 flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed`,r(b).canGoNext&&!r(b).isSubmitting?`bg-primary hover:bg-primary/90 text-white border border-primary hover:border-primary/80`:`bg-background-mute dark:bg-stroke/5 text-content-muted dark:text-content-muted border border-stroke-subtle dark:border-stroke/10`])},[r(b).isSubmitting?(_(),h(`div`,Le)):c(``,!0),r(b).isSubmitting?(_(),h(`span`,Re,`Setting up...`)):r(b).isLastStep?(_(),h(`span`,ze,`Complete Setup`)):(_(),h(`span`,Be,`Next`)),!r(b).isSubmitting&&!r(b).isLastStep?(_(),h(`svg`,Ve,[...o[33]||=[m(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 5l7 7-7 7`},null,-1)]])):c(``,!0)],10,Ie)])])]),u(T,{name:`modal`},{default:e(()=>[q.value?(_(),h(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm`,onClick:$},[m(`div`,{class:`bg-white dark:bg-surface-elevated backdrop-blur-xl max-w-md w-full p-8 rounded-[24px] border border-stroke-subtle dark:border-white/20 shadow-[0_8px_32px_0_rgba(0,0,0,0.37)]`,onClick:o[8]||=w(()=>{},[`stop`])},[m(`div`,He,[X.value===`success`?(_(),h(`div`,Ue,[...o[34]||=[m(`svg`,{class:`w-8 h-8 text-green-600 dark:text-green-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[m(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 13l4 4L19 7`})],-1)]])):(_(),h(`div`,We,[...o[35]||=[m(`svg`,{class:`w-8 h-8 text-red-600 dark:text-red-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[m(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]]))]),m(`h3`,Ge,i(J.value),1),m(`p`,Ke,i(Y.value),1),m(`button`,{onClick:$,class:l([`w-full px-6 py-3 rounded-lg font-medium transition-all`,X.value===`success`?`bg-primary hover:bg-primary/90 text-white`:`bg-accent-red hover:bg-accent-red/90 text-white`])},i(X.value===`success`?`Continue to Login`:`Close`),3)])])):c(``,!0)]),_:1})]))}}),[[`__scopeId`,`data-v-a201f2f2`]]);export{q as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/Statistics-2MFwNAp1.css b/repeater/web/html/assets/Statistics-2MFwNAp1.css new file mode 100644 index 0000000..93f11ff --- /dev/null +++ b/repeater/web/html/assets/Statistics-2MFwNAp1.css @@ -0,0 +1 @@ +.plotly-chart[data-v-bf282927]{background:0 0!important} diff --git a/repeater/web/html/assets/Statistics-C56LjnFt.css b/repeater/web/html/assets/Statistics-C56LjnFt.css deleted file mode 100644 index 07df351..0000000 --- a/repeater/web/html/assets/Statistics-C56LjnFt.css +++ /dev/null @@ -1 +0,0 @@ -.plotly-chart[data-v-8daccd7e]{background:transparent!important} diff --git a/repeater/web/html/assets/Statistics-Sn0kb5mJ.js b/repeater/web/html/assets/Statistics-Sn0kb5mJ.js deleted file mode 100644 index 13af6ac..0000000 --- a/repeater/web/html/assets/Statistics-Sn0kb5mJ.js +++ /dev/null @@ -1 +0,0 @@ -import{a as Oe,J as Le,K as ze,r as u,E as pe,c as me,o as He,H as ve,R as M,b as Je,e as h,f as a,h as B,w as Ue,s as je,F as ge,i as fe,g as G,u as xe,j as $e,t as Y,L as H,I as le,n as Ke,q as k,y as Ve}from"./index-xzvnOpJo.js";import{S as Z}from"./chartjs-adapter-date-fns.esm-DJ3p4DO2.js";import{g as Ie,s as Xe}from"./preferences-DtwbSSgO.js";import{C as q,a as We,L as Ge,P as Ye,b as Ze,c as qe,B as Qe,D as et,S as tt,p as at,d as st,e as rt,A as ot,f as lt,i as nt,T as it}from"./chart-B185MtDy.js";import{P as J}from"./plotly.min-DO11Gp-n.js";import"./_commonjsHelpers-CqkleIqs.js";const ct={class:"p-3 sm:p-6 space-y-4 sm:space-y-6"},dt={class:"flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3"},ut={class:"flex items-center gap-2 sm:gap-3"},pt=["value"],mt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4"},vt={class:"glass-card rounded-[15px] p-3 sm:p-6"},gt={class:"relative h-40 sm:h-48 rounded-lg p-2 sm:p-4"},ft={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-xs z-20"},xt={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20"},bt={class:"grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6 items-stretch"},yt={class:"glass-card rounded-[15px] p-3 sm:p-6 flex flex-col"},ht={class:"relative flex-1 min-h-[12rem] sm:min-h-[16rem] rounded-lg"},kt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-xs z-20"},Ct={class:"glass-card rounded-[15px] p-3 sm:p-6 flex flex-col"},_t={class:"flex-1 flex flex-col justify-evenly"},wt={key:0,class:"flex items-center justify-center flex-1"},St={key:1,class:"flex items-center justify-center flex-1"},Tt={class:"w-28 sm:w-32 text-sm text-content-primary dark:text-content-primary truncate"},Rt={class:"flex-1 h-12 bg-background-mute dark:bg-stroke/10 rounded overflow-hidden"},Dt={class:"w-20 text-sm text-content-secondary dark:text-content-muted text-right tabular-nums"},Et={key:0,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},Ft={key:1,class:"glass-card rounded-[15px] p-6 sm:p-8 text-center"},Mt={class:"text-content-secondary dark:text-content-muted text-sm"},Pt=Oe({name:"StatisticsView",__name:"Statistics",setup(Bt){q.register(We,Ge,Ye,Ze,qe,Qe,et,tt,at,st,rt,ot,lt,nt,it);const A=Le(),Q=ze(),N=u(null),ee=u(!1),ne=()=>{N.value||Q.isConnected||(N.value=window.setInterval(X,3e4))},ie=()=>{N.value&&(clearInterval(N.value),N.value=null)},T=()=>{const e=document.documentElement.classList.contains("dark");return{gridColor:e?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",tickColor:e?"rgba(255, 255, 255, 0.7)":"rgba(0, 0, 0, 0.7)",legendColor:e?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)",titleColor:e?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)"}},v=u(Ie("statistics_selectedHours",24)),be=[{value:1,label:"1 Hour"},{value:6,label:"6 Hours"},{value:12,label:"12 Hours"},{value:24,label:"24 Hours"},{value:48,label:"2 Days"},{value:168,label:"1 Week"}];pe(v,e=>Xe("statistics_selectedHours",e));const R=u(null),O=u(null),U=u([]),D=u(null),te=u([]),j=u([]),$=u(!0),K=u(null),C=u({packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0,sparklines:!0}),L=u(!1),V=u(!1),z=u(!1),_=u(null),w=u(null),y=u(null),I=u(null),ae=u(null),se=u(null),E=u(null),ce=me(()=>{const e=A.packetStats;return e?{totalRx:e.total_packets||0,totalTx:e.transmitted_packets||0}:{totalRx:0,totalTx:0}}),re=(e,t)=>{if(e.length===0)return[];const o=Math.round(t*60*60*1e3/72),r=new Map;return e.forEach(([i,g])=>{let f=i;i>1e15?f=i/1e3:i>1e9&&i<1e12&&(f=i*1e3);const S=Math.floor(f/o)*o;r.has(S)||r.set(S,[]),r.get(S).push(g)}),Array.from(r.entries()).sort((i,g)=>i[0]-g[0]).map(([,i])=>i.reduce((g,f)=>g+f,0)/i.length)},oe=me(()=>{let e=[],t=[];if(R.value?.series){const s=R.value.series.find(r=>r.type==="rx_count"),o=R.value.series.find(r=>r.type==="tx_count");s?.data&&(e=re(s.data,v.value)),o?.data&&(t=re(o.data,v.value))}return{totalPackets:e,transmittedPackets:t,droppedPackets:[],crcErrors:re(j.value.map(s=>[s.timestamp>1e12?s.timestamp:s.timestamp*1e3,s.count]),v.value)}}),X=async()=>{try{$.value=!0,K.value=null,await Promise.all([A.fetchPacketStats({hours:v.value}),A.fetchSystemStats()]),$.value=!1,ye()}catch(e){K.value=e instanceof Error?e.message:"Failed to fetch data",$.value=!1}},ye=async()=>{C.value={packetRate:!0,packetType:!0,noiseFloor:!0,routePie:!0,sparklines:!0};const e=[he(),ke(),Ce(),_e(),we()];try{await Promise.allSettled(e),await ve(),!I.value||!ae.value?setTimeout(()=>{de()},100):de()}catch(t){console.error("Error loading chart data:",t)}},he=async()=>{try{const e=await H.get("/metrics_graph_data",{hours:v.value,resolution:"average",metrics:"rx_count,tx_count"});e?.success&&(R.value=e.data)}catch{R.value=null}},ke=async()=>{try{const e=await H.get("/packet_type_graph_data",{hours:v.value,resolution:"average",types:"all"});if(e?.success&&e.data){const t=e.data;U.value=t.series||[]}}catch{U.value=[]}},Ce=async()=>{try{const e=await H.get("/route_stats",{hours:v.value});e?.success&&e.data&&(D.value=e.data)}catch{D.value=null}},_e=async()=>{try{const e={hours:v.value},t=await H.get("/noise_floor_history",e);if(t.success&&t.data){const o=t.data.history||[];Array.isArray(o)&&o.length>0&&(O.value={chart_data:o.map(r=>({timestamp:r.timestamp||Date.now()/1e3,noise_floor_dbm:r.noise_floor_dbm||r.noise_floor||-120}))},Te())}}catch{O.value={chart_data:[]}}},we=async()=>{try{const e=await H.get("/crc_error_history",{hours:v.value});if(e?.success&&e.data){const t=e.data;j.value=t.history||[]}}catch{j.value=[]}},Se=()=>{C.value={packetRate:!0,packetType:!0,noiseFloor:!0,routePie:!0,sparklines:!0},ue(),L.value=!1,V.value=!1,z.value=!1,X()},Te=()=>{if(te.value=[],O.value?.chart_data&&O.value.chart_data.length>0){const e=O.value.chart_data;te.value=e.map(t=>({timestamp:t.timestamp*1e3,snr:null,rssi:null,noiseFloor:t.noise_floor_dbm}))}},de=()=>{if(!ee.value){ee.value=!0;try{Re(),De(),Ee(),Fe(),setTimeout(()=>{C.value={packetRate:!1,packetType:!1,noiseFloor:!1,routePie:!1,sparklines:!1},setTimeout(()=>{const e=M(_.value),t=M(w.value),s=M(y.value);e&&e.update("none"),t&&t.update("none"),s&&s.update("none")},50)},100)}catch(e){console.error("Error creating/updating charts:",e),ue()}finally{ee.value=!1}}},ue=()=>{try{_.value&&(_.value.destroy(),_.value=null),w.value&&(w.value.destroy(),w.value=null),y.value&&(y.value.destroy(),y.value=null),E.value&&J.purge(E.value)}catch(e){console.error("Error destroying charts:",e)}},Re=()=>{if(!I.value)return;const e=I.value.getContext("2d");if(!e)return;let t=[],s=[];if(R.value?.series){const p=R.value.series.find(c=>c.type==="rx_count"),b=R.value.series.find(c=>c.type==="tx_count");p?.data&&(t=p.data.map(([c,d])=>{let n=c;return c>1e15?n=c/1e3:c>1e12?n=c:c>1e9?n=c*1e3:n=Date.now(),{x:n,y:d}})),b?.data&&(s=b.data.map(([c,d])=>{let n=c;return c>1e15?n=c/1e3:c>1e12?n=c:c>1e9?n=c*1e3:n=Date.now(),{x:n,y:d}}))}if(t.length===0&&s.length===0){L.value=!0;return}L.value=!1,_.value&&(_.value.destroy(),_.value=null);const r=Math.round(v.value*60*60*1e3/72),i=p=>{if(p.length===0)return[];const b=new Map;return p.forEach(d=>{const n=Math.floor(d.x/r)*r;b.has(n)||b.set(n,[]),b.get(n).push(d.y)}),Array.from(b.entries()).map(([d,n])=>({x:d,y:n.reduce((F,W)=>F+W,0)/n.length})).sort((d,n)=>d.x-n.x)},g=(p,b=3)=>{if(p.lengthAe+Ne.y,0)/W.length;c.push({x:p[d].x,y:Be})}return c},f=g(i(t)),S=g(i(s)),P=[...f.map(p=>p.y),...S.map(p=>p.y)],l=Math.min(...P),m=Math.max(...P),x=m-l||m*.1||.001,Me=Math.max(0,l-x*.05),Pe=m+x*.05;try{const p=JSON.parse(JSON.stringify(f)),b=JSON.parse(JSON.stringify(S)),c=new q(e,{type:"line",data:{datasets:[{label:"TX/hr",data:b,borderColor:"#F59E0B",backgroundColor:"#F59E0B",borderWidth:2,fill:"origin",tension:.4,pointRadius:0,pointHoverRadius:3,order:1},{label:"RX/hr",data:p,borderColor:"#C084FC",backgroundColor:"#C084FC",borderWidth:2,fill:"origin",tension:.4,pointRadius:0,pointHoverRadius:3,order:2}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!1},title:{display:!1},tooltip:{enabled:!0,backgroundColor:"rgba(0, 0, 0, 0.8)",titleColor:"rgba(255, 255, 255, 0.9)",bodyColor:"rgba(255, 255, 255, 0.8)",borderColor:"rgba(255, 255, 255, 0.2)",borderWidth:1,padding:12,displayColors:!0,callbacks:{title:function(d){const n=d[0]?.parsed?.x;return n==null?"":new Date(n).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},label:function(d){const n=d.dataset?.label||"",F=d.parsed?.y;return F==null?n:`${n}: ${F.toFixed(3)}`}}}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},min:Date.now()-v.value*3600*1e3,max:Date.now(),grid:{color:T().gridColor},ticks:{color:T().tickColor,maxTicksLimit:8}},y:{beginAtZero:!1,grid:{color:T().gridColor},ticks:{color:T().tickColor,callback:function(d){return typeof d=="number"?d.toFixed(3):d}},min:Me,max:Pe}}}});_.value=le(c)}catch(p){console.error("Error creating packet rate chart:",p),L.value=!0}},De=()=>{if(!ae.value)return;const e=ae.value.getContext("2d");if(!e)return;const t=[],s=[],o=["#60A5FA","#34D399","#FBBF24","#A78BFA","#F87171","#06B6D4","#84CC16","#F472B6","#10B981"];if(U.value.length>0)U.value.forEach(r=>{const i=r.data?r.data.reduce((g,f)=>g+f[1],0):0;i>0&&(t.push(r.name.replace(/\([^)]*\)/g,"").trim()),s.push(i))});else{V.value=!0;return}V.value=!1,w.value&&(w.value.destroy(),w.value=null);try{const r=JSON.parse(JSON.stringify(t)),i=JSON.parse(JSON.stringify(s)),g=new q(e,{type:"bar",data:{labels:r,datasets:[{data:i,backgroundColor:o.slice(0,i.length),borderRadius:8,borderSkipped:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{color:"rgba(255, 255, 255, 0.7)",font:{size:10}}},y:{beginAtZero:!0,grid:{color:"rgba(255, 255, 255, 0.1)"},ticks:{color:"rgba(255, 255, 255, 0.7)"}}}}});w.value=le(g)}catch(r){console.error("Error creating packet type chart:",r),V.value=!0}},Ee=()=>{if(!se.value)return;const e=se.value.getContext("2d");if(!e)return;const t=te.value.map(l=>({x:l.timestamp,y:l.noiseFloor})).filter(l=>l.y!==null&&l.y!==void 0),s=t.map(l=>l.y),o=s.length>0?Math.min(...s):-120,r=s.length>0?Math.max(...s):-110,i=r-o||1,g=o-i*.05,f=r+i*.05;if(y.value)try{const l=M(y.value),m=JSON.parse(JSON.stringify(t));l.data.datasets[0]&&(l.data.datasets[0].data=m),l.options?.scales?.x&&(l.options.scales.x.min=Date.now()-v.value*3600*1e3,l.options.scales.x.max=Date.now()),l.update("active");return}catch{y.value.destroy(),y.value=null}const S=JSON.parse(JSON.stringify(t)),P=new q(e,{type:"scatter",data:{datasets:[{label:"Noise Floor (dBm)",data:S,borderWidth:0,backgroundColor:"rgba(245, 158, 11, 0.8)",pointRadius:3,pointHoverRadius:5,pointStyle:"circle"}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:"index",intersect:!1},plugins:{legend:{display:!0,position:"top",labels:{color:T().legendColor,usePointStyle:!0,padding:20}},tooltip:{enabled:!0,backgroundColor:"rgba(0, 0, 0, 0.8)",titleColor:"rgba(255, 255, 255, 0.9)",bodyColor:"rgba(255, 255, 255, 0.8)",borderColor:"rgba(255, 255, 255, 0.2)",borderWidth:1,padding:12,displayColors:!0,callbacks:{title:function(l){const m=l[0]?.parsed?.x;return m==null?"":new Date(m).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},label:function(l){const m=l.dataset?.label||"",x=l.parsed?.y;return x==null?m:`${m}: ${x.toFixed(1)} dBm`}}}},scales:{x:{type:"time",time:{unit:"hour",displayFormats:{hour:"HH:mm"}},min:Date.now()-v.value*3600*1e3,max:Date.now(),grid:{color:T().gridColor},ticks:{color:T().tickColor,maxTicksLimit:8}},y:{type:"linear",display:!0,title:{display:!0,text:"Noise Floor (dBm)",color:T().titleColor},grid:{color:"rgba(245, 158, 11, 0.2)"},ticks:{color:"#F59E0B",callback:function(l){return typeof l=="number"?l.toFixed(1):l}},min:g,max:f}}}});y.value=le(P)},Fe=()=>{if(!E.value)return;if(!D.value||!D.value.route_totals){z.value=!0;return}z.value=!1;const e=D.value.route_totals,t=Object.keys(e),s=Object.values(e),o=["#3B82F6","#10B981","#F59E0B","#A78BFA","#F87171"];try{const r=JSON.parse(JSON.stringify(t)),i=JSON.parse(JSON.stringify(s)),g=i.reduce((m,x)=>m+x,0),f=i.map(m=>m/g*100),S=r.map((m,x)=>({type:"bar",name:m,x:[f[x]],y:[""],orientation:"h",marker:{color:o[x%o.length]},text:f[x]>=5?`${m} ${f[x].toFixed(0)}%`:"",textposition:"inside",textfont:{color:"white",size:11},hoverinfo:"none",insidetextanchor:"middle"})),P={paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:"rgba(255, 255, 255, 0.8)",size:11},margin:{t:10,b:60,l:10,r:10},barmode:"stack",showlegend:!0,legend:{orientation:"h",x:0,y:-.3,xanchor:"left",font:{color:"rgba(255, 255, 255, 0.8)",size:10}},xaxis:{showgrid:!1,showticklabels:!1,zeroline:!1,range:[0,100]},yaxis:{showgrid:!1,showticklabels:!1,zeroline:!1},hovermode:!1,bargap:0},l={responsive:!0,displayModeBar:!1,staticPlot:!0};J.newPlot(E.value,S,P,l)}catch(r){console.error("Error creating route treemap chart:",r),z.value=!0}};return He(async()=>{await ve(),X(),Q.isConnected||ne(),pe(()=>Q.isConnected,e=>{e?ie():ne()}),window.addEventListener("resize",()=>{setTimeout(()=>{M(_.value)?.resize(),M(w.value)?.resize(),M(y.value)?.resize(),E.value&&J.Plots&&J.Plots.resize(E.value)},100)})}),Je(()=>{ie(),_.value?.destroy(),w.value?.destroy(),y.value?.destroy(),E.value&&J.purge(E.value),window.removeEventListener("resize",()=>{})}),(e,t)=>(k(),h("div",ct,[a("div",dt,[t[2]||(t[2]=a("h2",{class:"text-xl sm:text-2xl font-bold text-content-primary dark:text-content-primary"},"Statistics",-1)),a("div",ut,[t[1]||(t[1]=a("label",{class:"text-content-secondary dark:text-content-muted text-xs sm:text-sm"},"Time Range:",-1)),Ue(a("select",{"onUpdate:modelValue":t[0]||(t[0]=s=>v.value=s),onChange:Se,class:"bg-white dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-2 sm:px-3 py-1.5 sm:py-2 text-content-primary dark:text-content-primary text-xs sm:text-sm focus:outline-hidden focus:border-primary dark:focus:border-accent-purple/50 transition-colors"},[(k(),h(ge,null,fe(be,s=>a("option",{key:s.value,value:s.value,class:"bg-white dark:bg-gray-800 text-content-primary dark:text-content-primary"},Y(s.label),9,pt)),64))],544),[[je,v.value]])])]),a("div",mt,[G(Z,{title:"Total RX",value:ce.value.totalRx,color:"#AAE8E8",data:oe.value.totalPackets,loading:C.value.sparklines,variant:"classic"},null,8,["value","data","loading"]),G(Z,{title:"Total TX",value:ce.value.totalTx,color:"#FFC246",data:oe.value.transmittedPackets,loading:C.value.sparklines,variant:"classic"},null,8,["value","data","loading"]),G(Z,{title:"CRC Errors",value:j.value.reduce((s,o)=>s+o.count,0),color:"#F59E0B",data:oe.value.crcErrors,loading:C.value.sparklines,variant:"classic"},null,8,["value","data","loading"]),G(Z,{title:"Packet Hash Cache",value:xe(A).systemStats?.duplicate_cache_size??0,color:"#9F7AEA",data:[],loading:!1,variant:"smooth",subtitle:`Entries expire after ${(()=>{const s=xe(A).systemStats?.cache_ttl??3600,o=Math.floor(s/60);return o>=60?`${Math.floor(o/60)}h`:`${o}m`})()}`},null,8,["value","subtitle"])]),a("div",vt,[t[6]||(t[6]=a("h3",{class:"text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4"},"Performance Metrics",-1)),a("div",null,[t[5]||(t[5]=$e('

Packet Rate (RX/TX PER HOUR)

RX/hr
TX/hr
',2)),a("div",gt,[a("canvas",{ref_key:"packetRateCanvasRef",ref:I,class:"w-full h-full relative z-10"},null,512),C.value.packetRate?(k(),h("div",ft,t[3]||(t[3]=[a("div",{class:"text-center"},[a("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-purple-600 dark:border-t-purple-400 rounded-full mx-auto mb-2"}),a("div",{class:"text-content-secondary dark:text-content-muted text-[10px] sm:text-xs"},"Loading packet rate data...")],-1)]))):B("",!0),L.value&&!C.value.packetRate?(k(),h("div",xt,t[4]||(t[4]=[a("div",{class:"text-center"},[a("div",{class:"text-red-700 dark:text-red-400 text-sm font-semibold mb-1"},"No Data Available"),a("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Packet rate data not found")],-1)]))):B("",!0)])])]),a("div",bt,[a("div",yt,[t[8]||(t[8]=a("h3",{class:"text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4"}," Noise Floor Over Time ",-1)),a("div",ht,[a("canvas",{ref_key:"signalMetricsCanvasRef",ref:se,class:"w-full h-full"},null,512),C.value.noiseFloor?(k(),h("div",kt,t[7]||(t[7]=[a("div",{class:"text-center"},[a("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-amber-600 dark:border-t-amber-400 rounded-full mx-auto mb-2"}),a("div",{class:"text-content-secondary dark:text-content-muted text-[10px] sm:text-xs"},"Loading noise floor data...")],-1)]))):B("",!0)])]),a("div",Ct,[t[11]||(t[11]=a("h3",{class:"text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4"},"Route Distribution",-1)),a("div",_t,[C.value.routePie?(k(),h("div",wt,t[9]||(t[9]=[a("div",{class:"text-center"},[a("div",{class:"animate-spin w-6 h-6 border-2 border-stroke-subtle dark:border-stroke/20 border-t-green-600 dark:border-t-green-400 rounded-full mx-auto mb-2"}),a("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Loading route data...")],-1)]))):z.value?(k(),h("div",St,t[10]||(t[10]=[a("div",{class:"text-center"},[a("div",{class:"text-red-700 dark:text-red-400 text-sm font-semibold mb-1"},"No Data Available"),a("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Route statistics not found")],-1)]))):D.value?.route_totals?(k(!0),h(ge,{key:2},fe(D.value.route_totals,(s,o,r)=>(k(),h("div",{key:o,class:"flex items-center gap-3"},[a("div",Tt,Y(o),1),a("div",Rt,[a("div",{class:"h-full rounded transition-all duration-300",style:Ke({width:`${s/Math.max(...Object.values(D.value.route_totals))*100}%`,backgroundColor:["#3B82F6","#10B981","#F59E0B","#A78BFA","#F87171"][r%5]})},null,4)]),a("div",Dt,Y(s.toLocaleString()),1)]))),128)):B("",!0)])])]),$.value?(k(),h("div",Et,t[12]||(t[12]=[a("div",{class:"text-content-secondary dark:text-content-muted mb-2 text-sm"},"Loading statistics...",-1),a("div",{class:"animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-content-primary dark:border-t-white/70 rounded-full mx-auto"},null,-1)]))):B("",!0),K.value?(k(),h("div",Ft,[t[13]||(t[13]=a("div",{class:"text-red-700 dark:text-red-400 mb-2 text-sm font-semibold"},"Failed to load statistics",-1)),a("p",Mt,Y(K.value),1),a("button",{onClick:X,class:"mt-4 px-4 py-2 bg-primary hover:bg-primary/90 dark:bg-primary dark:hover:bg-primary/80 text-white font-medium rounded-lg border border-primary/20 dark:border-primary/30 transition-colors shadow-sm"}," Retry ")])):B("",!0)]))}}),Jt=Ve(Pt,[["__scopeId","data-v-8daccd7e"]]);export{Jt as default}; diff --git a/repeater/web/html/assets/Statistics-m6h9b_Wm.js b/repeater/web/html/assets/Statistics-m6h9b_Wm.js new file mode 100644 index 0000000..f1f78a1 --- /dev/null +++ b/repeater/web/html/assets/Statistics-m6h9b_Wm.js @@ -0,0 +1 @@ +import{r as e}from"./chunk-DECur_0Z.js";import{E as t,H as n,I as r,S as i,W as a,b as o,dt as s,f as c,g as l,j as u,k as d,l as f,m as p,o as m,r as h,s as g,u as _,ut as ee,w as v,x as te,z as y}from"./runtime-core.esm-bundler-IofF4kUm.js";import{t as b}from"./api-CrUX-ZnK.js";import{t as ne}from"./packets-BxrAyCoo.js";import{t as x}from"./_plugin-vue_export-helper-V-yks4gF.js";import{a as re,u as ie}from"./index-CPWfwDmA.js";import{t as S}from"./plotly.min-Bnm7le34.js";import{n as ae,t as oe}from"./preferences-N3Pls1rF.js";import{_ as se,a as C,c as ce,d as le,f as ue,g as de,h as fe,i as pe,l as me,m as he,n as ge,o as _e,r as ve,s as ye,t as be,u as xe}from"./chart-DdrINt9G.js";import{t as w}from"./chartjs-adapter-date-fns.esm-CONKmChq.js";var T=e(S(),1),Se={class:`p-3 sm:p-6 space-y-4 sm:space-y-6`},Ce={class:`flex flex-col sm:flex-row sm:justify-between sm:items-center gap-3`},we={class:`flex items-center gap-2 sm:gap-3`},Te=[`value`],Ee={class:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4`},De={class:`glass-card rounded-[15px] p-3 sm:p-6`},Oe={class:`relative h-40 sm:h-48 rounded-lg p-2 sm:p-4`},ke={key:0,class:`absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-xs z-20`},Ae={key:1,class:`absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20`},je={class:`grid grid-cols-1 lg:grid-cols-2 gap-4 sm:gap-6 items-stretch`},Me={class:`glass-card rounded-[15px] p-3 sm:p-6 flex flex-col`},Ne={class:`relative flex-1 min-h-[12rem] sm:min-h-[16rem] rounded-lg`},Pe={key:0,class:`absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-xs z-20`},Fe={class:`glass-card rounded-[15px] p-3 sm:p-6 flex flex-col`},Ie={class:`flex-1 flex flex-col justify-evenly`},Le={key:0,class:`flex items-center justify-center flex-1`},Re={key:1,class:`flex items-center justify-center flex-1`},ze={class:`w-28 sm:w-32 text-sm text-content-primary dark:text-content-primary truncate`},Be={class:`flex-1 h-12 bg-background-mute dark:bg-stroke/10 rounded overflow-hidden`},Ve={class:`w-20 text-sm text-content-secondary dark:text-content-muted text-right tabular-nums`},He={key:0,class:`glass-card rounded-[15px] p-6 sm:p-8 text-center`},Ue={key:1,class:`glass-card rounded-[15px] p-6 sm:p-8 text-center`},We={class:`text-content-secondary dark:text-content-muted text-sm`},E=x(l({name:`StatisticsView`,__name:`Statistics`,setup(e){C.register(pe,me,xe,ce,ye,ge,_e,le,de,se,fe,be,ve,he,ue);let l=ne(),x=re(),S=y(null),E=y(!1),D=()=>{S.value||x.isConnected||(S.value=window.setInterval($,3e4))},O=()=>{S.value&&=(clearInterval(S.value),null)},k=()=>{let e=document.documentElement.classList.contains(`dark`);return{gridColor:e?`rgba(255, 255, 255, 0.1)`:`rgba(0, 0, 0, 0.1)`,tickColor:e?`rgba(255, 255, 255, 0.7)`:`rgba(0, 0, 0, 0.7)`,legendColor:e?`rgba(255, 255, 255, 0.8)`:`rgba(0, 0, 0, 0.8)`,titleColor:e?`rgba(255, 255, 255, 0.8)`:`rgba(0, 0, 0, 0.8)`}},A=y(oe(`statistics_selectedHours`,24)),Ge=[{value:1,label:`1 Hour`},{value:6,label:`6 Hours`},{value:12,label:`12 Hours`},{value:24,label:`24 Hours`},{value:48,label:`2 Days`},{value:168,label:`1 Week`}];d(A,e=>ae(`statistics_selectedHours`,e));let j=y(null),M=y(null),N=y([]),P=y(null),F=y([]),I=y([]),L=y(!0),R=y(null),z=y({packetRate:!0,packetType:!0,noiseFloor:!1,routePie:!0,sparklines:!0}),B=y(!1),V=y(!1),H=y(!1),U=y(null),W=y(null),G=y(null),K=y(null),q=y(null),J=y(null),Y=y(null),X=m(()=>{let e=l.packetStats;return e?{totalRx:e.total_packets||0,totalTx:e.transmitted_packets||0}:{totalRx:0,totalTx:0}}),Z=(e,t)=>{if(e.length===0)return[];let n=Math.round(t*60*60*1e3/72),r=new Map;return e.forEach(([e,t])=>{let i=e;e>0x38d7ea4c68000?i=e/1e3:e>1e9&&e<0xe8d4a51000&&(i=e*1e3);let a=Math.floor(i/n)*n;r.has(a)||r.set(a,[]),r.get(a).push(t)}),Array.from(r.entries()).sort((e,t)=>e[0]-t[0]).map(([,e])=>e.reduce((e,t)=>e+t,0)/e.length)},Q=m(()=>{let e=[],t=[];if(j.value?.series){let n=j.value.series.find(e=>e.type===`rx_count`),r=j.value.series.find(e=>e.type===`tx_count`);n?.data&&(e=Z(n.data,A.value)),r?.data&&(t=Z(r.data,A.value))}return{totalPackets:e,transmittedPackets:t,droppedPackets:[],crcErrors:Z(I.value.map(e=>[e.timestamp>0xe8d4a51000?e.timestamp:e.timestamp*1e3,e.count]),A.value)}}),$=async()=>{try{L.value=!0,R.value=null,await Promise.all([l.fetchPacketStats({hours:A.value}),l.fetchSystemStats()]),L.value=!1,Ke()}catch(e){R.value=e instanceof Error?e.message:`Failed to fetch data`,L.value=!1}},Ke=async()=>{z.value={packetRate:!0,packetType:!0,noiseFloor:!0,routePie:!0,sparklines:!0};let e=[qe(),Je(),Ye(),Xe(),Ze()];try{await Promise.allSettled(e),await o(),!K.value||!q.value?setTimeout(()=>{et()},100):et()}catch(e){console.error(`Error loading chart data:`,e)}},qe=async()=>{try{let e=await b.get(`/metrics_graph_data`,{hours:A.value,resolution:`average`,metrics:`rx_count,tx_count`});e?.success&&(j.value=e.data)}catch{j.value=null}},Je=async()=>{try{let e=await b.get(`/packet_type_graph_data`,{hours:A.value,resolution:`average`,types:`all`});e?.success&&e.data&&(N.value=e.data.series||[])}catch{N.value=[]}},Ye=async()=>{try{let e=await b.get(`/route_stats`,{hours:A.value});e?.success&&e.data&&(P.value=e.data)}catch{P.value=null}},Xe=async()=>{try{let e={hours:A.value},t=await b.get(`/noise_floor_history`,e);if(t.success&&t.data){let e=t.data.history||[];Array.isArray(e)&&e.length>0&&(M.value={chart_data:e.map(e=>({timestamp:e.timestamp||Date.now()/1e3,noise_floor_dbm:e.noise_floor_dbm||e.noise_floor||-120}))},$e())}}catch{M.value={chart_data:[]}}},Ze=async()=>{try{let e=await b.get(`/crc_error_history`,{hours:A.value});e?.success&&e.data&&(I.value=e.data.history||[])}catch{I.value=[]}},Qe=()=>{z.value={packetRate:!0,packetType:!0,noiseFloor:!0,routePie:!0,sparklines:!0},tt(),B.value=!1,V.value=!1,H.value=!1,$()},$e=()=>{F.value=[],M.value?.chart_data&&M.value.chart_data.length>0&&(F.value=M.value.chart_data.map(e=>({timestamp:e.timestamp*1e3,snr:null,rssi:null,noiseFloor:e.noise_floor_dbm})))},et=()=>{if(!E.value){E.value=!0;try{nt(),rt(),it(),at(),setTimeout(()=>{z.value={packetRate:!1,packetType:!1,noiseFloor:!1,routePie:!1,sparklines:!1},setTimeout(()=>{let e=n(U.value),t=n(W.value),r=n(G.value);e&&e.update(`none`),t&&t.update(`none`),r&&r.update(`none`)},50)},100)}catch(e){console.error(`Error creating/updating charts:`,e),tt()}finally{E.value=!1}}},tt=()=>{try{U.value&&=(U.value.destroy(),null),W.value&&=(W.value.destroy(),null),G.value&&=(G.value.destroy(),null),Y.value&&T.default.purge(Y.value)}catch(e){console.error(`Error destroying charts:`,e)}},nt=()=>{if(!K.value)return;let e=K.value.getContext(`2d`);if(!e)return;let t=[],n=[];if(j.value?.series){let e=j.value.series.find(e=>e.type===`rx_count`),r=j.value.series.find(e=>e.type===`tx_count`);e?.data&&(t=e.data.map(([e,t])=>{let n=e;return n=e>0x38d7ea4c68000?e/1e3:e>0xe8d4a51000?e:e>1e9?e*1e3:Date.now(),{x:n,y:t}})),r?.data&&(n=r.data.map(([e,t])=>{let n=e;return n=e>0x38d7ea4c68000?e/1e3:e>0xe8d4a51000?e:e>1e9?e*1e3:Date.now(),{x:n,y:t}}))}if(t.length===0&&n.length===0){B.value=!0;return}B.value=!1,U.value&&=(U.value.destroy(),null);let i=Math.round(A.value*60*60*1e3/72),a=e=>{if(e.length===0)return[];let t=new Map;return e.forEach(e=>{let n=Math.floor(e.x/i)*i;t.has(n)||t.set(n,[]),t.get(n).push(e.y)}),Array.from(t.entries()).map(([e,t])=>({x:e,y:t.reduce((e,t)=>e+t,0)/t.length})).sort((e,t)=>e.x-t.x)},o=(e,t=3)=>{if(e.lengthe+t.y,0)/o.length;n.push({x:e[r].x,y:s})}return n},s=o(a(t)),c=o(a(n)),l=[...s.map(e=>e.y),...c.map(e=>e.y)],u=Math.min(...l),d=Math.max(...l),f=d-u||d*.1||.001,p=Math.max(0,u-f*.05),m=d+f*.05;try{let t=JSON.parse(JSON.stringify(s));U.value=r(new C(e,{type:`line`,data:{datasets:[{label:`TX/hr`,data:JSON.parse(JSON.stringify(c)),borderColor:`#F59E0B`,backgroundColor:`#F59E0B`,borderWidth:2,fill:`origin`,tension:.4,pointRadius:0,pointHoverRadius:3,order:1},{label:`RX/hr`,data:t,borderColor:`#C084FC`,backgroundColor:`#C084FC`,borderWidth:2,fill:`origin`,tension:.4,pointRadius:0,pointHoverRadius:3,order:2}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:`index`,intersect:!1},plugins:{legend:{display:!1},title:{display:!1},tooltip:{enabled:!0,backgroundColor:`rgba(0, 0, 0, 0.8)`,titleColor:`rgba(255, 255, 255, 0.9)`,bodyColor:`rgba(255, 255, 255, 0.8)`,borderColor:`rgba(255, 255, 255, 0.2)`,borderWidth:1,padding:12,displayColors:!0,callbacks:{title:function(e){let t=e[0]?.parsed?.x;return t==null?``:new Date(t).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})},label:function(e){let t=e.dataset?.label||``,n=e.parsed?.y;return n==null?t:`${t}: ${n.toFixed(3)}`}}}},scales:{x:{type:`time`,time:{unit:`hour`,displayFormats:{hour:`HH:mm`}},min:Date.now()-A.value*3600*1e3,max:Date.now(),grid:{color:k().gridColor},ticks:{color:k().tickColor,maxTicksLimit:8}},y:{beginAtZero:!1,grid:{color:k().gridColor},ticks:{color:k().tickColor,callback:function(e){return typeof e==`number`?e.toFixed(3):e}},min:p,max:m}}}}))}catch(e){console.error(`Error creating packet rate chart:`,e),B.value=!0}},rt=()=>{if(!q.value)return;let e=q.value.getContext(`2d`);if(!e)return;let t=[],n=[],i=[`#60A5FA`,`#34D399`,`#FBBF24`,`#A78BFA`,`#F87171`,`#06B6D4`,`#84CC16`,`#F472B6`,`#10B981`];if(N.value.length>0)N.value.forEach(e=>{let r=e.data?e.data.reduce((e,t)=>e+t[1],0):0;r>0&&(t.push(e.name.replace(/\([^)]*\)/g,``).trim()),n.push(r))});else{V.value=!0;return}V.value=!1,W.value&&=(W.value.destroy(),null);try{let a=JSON.parse(JSON.stringify(t)),o=JSON.parse(JSON.stringify(n));W.value=r(new C(e,{type:`bar`,data:{labels:a,datasets:[{data:o,backgroundColor:i.slice(0,o.length),borderRadius:8,borderSkipped:!1}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},plugins:{legend:{display:!1}},scales:{x:{grid:{display:!1},ticks:{color:`rgba(255, 255, 255, 0.7)`,font:{size:10}}},y:{beginAtZero:!0,grid:{color:`rgba(255, 255, 255, 0.1)`},ticks:{color:`rgba(255, 255, 255, 0.7)`}}}}}))}catch(e){console.error(`Error creating packet type chart:`,e),V.value=!0}},it=()=>{if(!J.value)return;let e=J.value.getContext(`2d`);if(!e)return;let t=F.value.map(e=>({x:e.timestamp,y:e.noiseFloor})).filter(e=>e.y!==null&&e.y!==void 0),i=t.map(e=>e.y),a=i.length>0?Math.min(...i):-120,o=i.length>0?Math.max(...i):-110,s=o-a||1,c=a-s*.05,l=o+s*.05;if(G.value)try{let e=n(G.value),r=JSON.parse(JSON.stringify(t));e.data.datasets[0]&&(e.data.datasets[0].data=r),e.options?.scales?.x&&(e.options.scales.x.min=Date.now()-A.value*3600*1e3,e.options.scales.x.max=Date.now()),e.update(`active`);return}catch{G.value.destroy(),G.value=null}G.value=r(new C(e,{type:`scatter`,data:{datasets:[{label:`Noise Floor (dBm)`,data:JSON.parse(JSON.stringify(t)),borderWidth:0,backgroundColor:`rgba(245, 158, 11, 0.8)`,pointRadius:3,pointHoverRadius:5,pointStyle:`circle`}]},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:0},interaction:{mode:`index`,intersect:!1},plugins:{legend:{display:!0,position:`top`,labels:{color:k().legendColor,usePointStyle:!0,padding:20}},tooltip:{enabled:!0,backgroundColor:`rgba(0, 0, 0, 0.8)`,titleColor:`rgba(255, 255, 255, 0.9)`,bodyColor:`rgba(255, 255, 255, 0.8)`,borderColor:`rgba(255, 255, 255, 0.2)`,borderWidth:1,padding:12,displayColors:!0,callbacks:{title:function(e){let t=e[0]?.parsed?.x;return t==null?``:new Date(t).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})},label:function(e){let t=e.dataset?.label||``,n=e.parsed?.y;return n==null?t:`${t}: ${n.toFixed(1)} dBm`}}}},scales:{x:{type:`time`,time:{unit:`hour`,displayFormats:{hour:`HH:mm`}},min:Date.now()-A.value*3600*1e3,max:Date.now(),grid:{color:k().gridColor},ticks:{color:k().tickColor,maxTicksLimit:8}},y:{type:`linear`,display:!0,title:{display:!0,text:`Noise Floor (dBm)`,color:k().titleColor},grid:{color:`rgba(245, 158, 11, 0.2)`},ticks:{color:`#F59E0B`,callback:function(e){return typeof e==`number`?e.toFixed(1):e}},min:c,max:l}}}}))},at=()=>{if(!Y.value)return;if(!P.value||!P.value.route_totals){H.value=!0;return}H.value=!1;let e=P.value.route_totals,t=Object.keys(e),n=Object.values(e),r=[`#3B82F6`,`#10B981`,`#F59E0B`,`#A78BFA`,`#F87171`];try{let e=JSON.parse(JSON.stringify(t)),i=JSON.parse(JSON.stringify(n)),a=i.reduce((e,t)=>e+t,0),o=i.map(e=>e/a*100),s=e.map((e,t)=>({type:`bar`,name:e,x:[o[t]],y:[``],orientation:`h`,marker:{color:r[t%r.length]},text:o[t]>=5?`${e} ${o[t].toFixed(0)}%`:``,textposition:`inside`,textfont:{color:`white`,size:11},hoverinfo:`none`,insidetextanchor:`middle`}));T.default.newPlot(Y.value,s,{paper_bgcolor:`rgba(0,0,0,0)`,plot_bgcolor:`rgba(0,0,0,0)`,font:{color:`rgba(255, 255, 255, 0.8)`,size:11},margin:{t:10,b:60,l:10,r:10},barmode:`stack`,showlegend:!0,legend:{orientation:`h`,x:0,y:-.3,xanchor:`left`,font:{color:`rgba(255, 255, 255, 0.8)`,size:10}},xaxis:{showgrid:!1,showticklabels:!1,zeroline:!1,range:[0,100]},yaxis:{showgrid:!1,showticklabels:!1,zeroline:!1},hovermode:!1,bargap:0},{responsive:!0,displayModeBar:!1,staticPlot:!0})}catch(e){console.error(`Error creating route treemap chart:`,e),H.value=!0}};return i(async()=>{await o(),$(),x.isConnected||D(),d(()=>x.isConnected,e=>{e?O():D()}),window.addEventListener(`resize`,()=>{setTimeout(()=>{n(U.value)?.resize(),n(W.value)?.resize(),n(G.value)?.resize(),Y.value&&T.default.Plots&&T.default.Plots.resize(Y.value)},100)})}),te(()=>{O(),U.value?.destroy(),W.value?.destroy(),G.value?.destroy(),Y.value&&T.default.purge(Y.value),window.removeEventListener(`resize`,()=>{})}),(e,n)=>(v(),_(`div`,Se,[g(`div`,Ce,[n[2]||=g(`h2`,{class:`text-xl sm:text-2xl font-bold text-content-primary dark:text-content-primary`},` Statistics `,-1),g(`div`,we,[n[1]||=g(`label`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},`Time Range:`,-1),u(g(`select`,{"onUpdate:modelValue":n[0]||=e=>A.value=e,onChange:Qe,class:`bg-white dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 rounded-lg px-2 sm:px-3 py-1.5 sm:py-2 text-content-primary dark:text-content-primary text-xs sm:text-sm focus:outline-hidden focus:border-primary dark:focus:border-accent-purple/50 transition-colors`},[(v(),_(h,null,t(Ge,e=>g(`option`,{key:e.value,value:e.value,class:`bg-white dark:bg-gray-800 text-content-primary dark:text-content-primary`},s(e.label),9,Te)),64))],544),[[ie,A.value]])])]),g(`div`,Ee,[p(w,{title:`Total RX`,value:X.value.totalRx,color:`#AAE8E8`,data:Q.value.totalPackets,loading:z.value.sparklines,variant:`classic`},null,8,[`value`,`data`,`loading`]),p(w,{title:`Total TX`,value:X.value.totalTx,color:`#FFC246`,data:Q.value.transmittedPackets,loading:z.value.sparklines,variant:`classic`},null,8,[`value`,`data`,`loading`]),p(w,{title:`CRC Errors`,value:I.value.reduce((e,t)=>e+t.count,0),color:`#F59E0B`,data:Q.value.crcErrors,loading:z.value.sparklines,variant:`classic`},null,8,[`value`,`data`,`loading`]),p(w,{title:`Packet Hash Cache`,value:a(l).systemStats?.duplicate_cache_size??0,color:`#9F7AEA`,data:[],loading:!1,variant:`smooth`,subtitle:`Entries expire after ${(()=>{let e=a(l).systemStats?.cache_ttl??3600,t=Math.floor(e/60);return t>=60?`${Math.floor(t/60)}h`:`${t}m`})()}`},null,8,[`value`,`subtitle`])]),g(`div`,De,[n[6]||=g(`h3`,{class:`text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4`},` Performance Metrics `,-1),g(`div`,null,[n[5]||=c(`

Packet Rate (RX/TX PER HOUR)

RX/hr
TX/hr
`,2),g(`div`,Oe,[g(`canvas`,{ref_key:`packetRateCanvasRef`,ref:K,class:`w-full h-full relative z-10`},null,512),z.value.packetRate?(v(),_(`div`,ke,[...n[3]||=[g(`div`,{class:`text-center`},[g(`div`,{class:`animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-purple-600 dark:border-t-purple-400 rounded-full mx-auto mb-2`}),g(`div`,{class:`text-content-secondary dark:text-content-muted text-[10px] sm:text-xs`},` Loading packet rate data... `)],-1)]])):f(``,!0),B.value&&!z.value.packetRate?(v(),_(`div`,Ae,[...n[4]||=[g(`div`,{class:`text-center`},[g(`div`,{class:`text-red-700 dark:text-red-400 text-sm font-semibold mb-1`},` No Data Available `),g(`div`,{class:`text-content-secondary dark:text-content-muted text-xs`},` Packet rate data not found `)],-1)]])):f(``,!0)])])]),g(`div`,je,[g(`div`,Me,[n[8]||=g(`h3`,{class:`text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4`},` Noise Floor Over Time `,-1),g(`div`,Ne,[g(`canvas`,{ref_key:`signalMetricsCanvasRef`,ref:J,class:`w-full h-full`},null,512),z.value.noiseFloor?(v(),_(`div`,Pe,[...n[7]||=[g(`div`,{class:`text-center`},[g(`div`,{class:`animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-amber-600 dark:border-t-amber-400 rounded-full mx-auto mb-2`}),g(`div`,{class:`text-content-secondary dark:text-content-muted text-[10px] sm:text-xs`},` Loading noise floor data... `)],-1)]])):f(``,!0)])]),g(`div`,Fe,[n[11]||=g(`h3`,{class:`text-content-primary dark:text-content-primary text-lg sm:text-xl font-semibold mb-3 sm:mb-4`},` Route Distribution `,-1),g(`div`,Ie,[z.value.routePie?(v(),_(`div`,Le,[...n[9]||=[g(`div`,{class:`text-center`},[g(`div`,{class:`animate-spin w-6 h-6 border-2 border-stroke-subtle dark:border-stroke/20 border-t-green-600 dark:border-t-green-400 rounded-full mx-auto mb-2`}),g(`div`,{class:`text-content-secondary dark:text-content-muted text-xs`},` Loading route data... `)],-1)]])):H.value?(v(),_(`div`,Re,[...n[10]||=[g(`div`,{class:`text-center`},[g(`div`,{class:`text-red-700 dark:text-red-400 text-sm font-semibold mb-1`},` No Data Available `),g(`div`,{class:`text-content-secondary dark:text-content-muted text-xs`},` Route statistics not found `)],-1)]])):P.value?.route_totals?(v(!0),_(h,{key:2},t(P.value.route_totals,(e,t,n)=>(v(),_(`div`,{key:t,class:`flex items-center gap-3`},[g(`div`,ze,s(t),1),g(`div`,Be,[g(`div`,{class:`h-full rounded transition-all duration-300`,style:ee({width:`${e/Math.max(...Object.values(P.value.route_totals))*100}%`,backgroundColor:[`#3B82F6`,`#10B981`,`#F59E0B`,`#A78BFA`,`#F87171`][n%5]})},null,4)]),g(`div`,Ve,s(e.toLocaleString()),1)]))),128)):f(``,!0)])])]),L.value?(v(),_(`div`,He,[...n[12]||=[g(`div`,{class:`text-content-secondary dark:text-content-muted mb-2 text-sm`},` Loading statistics... `,-1),g(`div`,{class:`animate-spin w-6 h-6 sm:w-8 sm:h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-content-primary dark:border-t-white/70 rounded-full mx-auto`},null,-1)]])):f(``,!0),R.value?(v(),_(`div`,Ue,[n[13]||=g(`div`,{class:`text-red-700 dark:text-red-400 mb-2 text-sm font-semibold`},` Failed to load statistics `,-1),g(`p`,We,s(R.value),1),g(`button`,{onClick:$,class:`mt-4 px-4 py-2 bg-primary hover:bg-primary/90 dark:bg-primary dark:hover:bg-primary/80 text-white font-medium rounded-lg border border-primary/20 dark:border-primary/30 transition-colors shadow-sm`},` Retry `)])):f(``,!0)]))}}),[[`__scopeId`,`data-v-bf282927`]]);export{E as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/SystemStats-B8-MXEai.css b/repeater/web/html/assets/SystemStats-B8-MXEai.css deleted file mode 100644 index 228aab9..0000000 --- a/repeater/web/html/assets/SystemStats-B8-MXEai.css +++ /dev/null @@ -1 +0,0 @@ -.glass-card[data-v-eab6d04d]{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:#ffffffbf;border:1px solid rgba(0,0,0,.06);box-shadow:0 2px 8px #0000000a}.dark .glass-card[data-v-eab6d04d]{background:#0000004d;border:1px solid rgba(255,255,255,.1);box-shadow:none}.chart-updating[data-v-eab6d04d]{animation:subtle-pulse-eab6d04d .8s ease-in-out}@keyframes subtle-pulse-eab6d04d{0%{transform:scale(1)}50%{transform:scale(1.02)}to{transform:scale(1)}}.chart-container[data-v-eab6d04d]{position:relative;transition:all .3s ease}.chart-container[data-v-eab6d04d]:hover{background:#0000000a}.dark .chart-container[data-v-eab6d04d]:hover{background:#ffffff14}.process-row[data-v-eab6d04d]{transition:all .3s ease}.process-row[data-v-eab6d04d]:hover{background:#00000005;transform:translate(2px)}.dark .process-row[data-v-eab6d04d]:hover{background:#ffffff0d}.process-row-enter-active[data-v-eab6d04d],.process-row-leave-active[data-v-eab6d04d]{transition:all .4s ease}.process-row-enter-from[data-v-eab6d04d]{opacity:0;transform:translateY(-10px) scale(.95)}.process-row-leave-to[data-v-eab6d04d]{opacity:0;transform:translateY(10px) scale(.95)}.process-row-move[data-v-eab6d04d]{transition:transform .4s ease}.cpu-value[data-v-eab6d04d],.memory-value[data-v-eab6d04d]{transition:all .3s ease;padding:2px 6px;border-radius:4px}.cpu-value[data-v-eab6d04d]:hover,.memory-value[data-v-eab6d04d]:hover{background:#f59e0b1a;transform:scale(1.05)}@keyframes value-update-eab6d04d{0%{background:#f59e0b4d}to{background:transparent}}.value-updated[data-v-eab6d04d]{animation:value-update-eab6d04d .6s ease-out} diff --git a/repeater/web/html/assets/SystemStats-D99udK9A.js b/repeater/web/html/assets/SystemStats-D99udK9A.js deleted file mode 100644 index bc6129b..0000000 --- a/repeater/web/html/assets/SystemStats-D99udK9A.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/plotly.min-DO11Gp-n.js","assets/_commonjsHelpers-CqkleIqs.js"])))=>i.map(i=>d[i]); -import{a as ot,r as u,c as W,H as N,o as nt,R as X,S as O,b as lt,e as d,f as t,h as v,g as E,t as o,F as Y,i as G,I as K,L as Q,k as V,q as i,y as dt}from"./index-xzvnOpJo.js";import{S as P}from"./chartjs-adapter-date-fns.esm-DJ3p4DO2.js";import{C as j,a as it,L as ct,P as ut,b as mt,c as vt,B as pt,D as xt,p as yt,d as gt,e as ft,A as bt,f as kt,i as ht,T as _t}from"./chart-B185MtDy.js";const Ct={class:"p-6 space-y-6"},wt={class:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4"},Ft={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},St={class:"glass-card rounded-[15px] p-6"},Ut={class:"relative h-32 bg-gray-100/50 dark:bg-white/5 rounded-lg p-4 mb-4 chart-container"},Bt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-sm z-20"},At={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20"},Et={key:0,class:"grid grid-cols-2 gap-4 text-sm"},Pt={class:"text-content-primary dark:text-content-primary font-semibold"},Lt={class:"text-content-primary dark:text-content-primary font-semibold"},Mt={class:"text-content-primary dark:text-content-primary font-semibold"},Dt={class:"text-content-primary dark:text-content-primary font-semibold"},Rt={class:"glass-card rounded-[15px] p-6"},Tt={class:"relative h-32 bg-gray-100/50 dark:bg-white/5 rounded-lg p-4 mb-4 chart-container"},zt={key:0,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-sm z-20"},$t={key:1,class:"absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20"},It={key:0,class:"grid grid-cols-2 gap-4 text-sm"},Nt={class:"text-content-primary dark:text-content-primary font-semibold"},Ot={class:"text-content-primary dark:text-content-primary font-semibold"},Vt={class:"text-content-primary dark:text-content-primary font-semibold"},jt={class:"text-content-primary dark:text-content-primary font-semibold"},qt={class:"grid grid-cols-1 lg:grid-cols-2 gap-6"},Ht={class:"glass-card rounded-[15px] p-6"},Jt={class:"relative h-48"},Wt={key:0,class:"grid grid-cols-3 gap-4 text-sm mt-4"},Xt={class:"text-center"},Yt={class:"text-content-primary dark:text-content-primary font-semibold"},Gt={class:"text-center"},Kt={class:"font-semibold text-red-500 dark:text-red-400"},Qt={class:"text-center"},Zt={class:"font-semibold text-green-700 dark:text-green-400"},te={class:"glass-card rounded-[15px] p-6"},ee={key:0,class:"space-y-4"},ae={class:"grid grid-cols-2 gap-4 text-sm"},se={class:"text-content-primary dark:text-content-primary font-semibold"},re={class:"text-content-primary dark:text-content-primary font-semibold"},oe={class:"text-content-primary dark:text-content-primary font-semibold"},ne={class:"text-content-primary dark:text-content-primary font-semibold"},le={key:0,class:"pt-4 border-t border-stroke-subtle dark:border-stroke/10"},de={class:"grid grid-cols-2 gap-2 text-sm"},ie={class:"text-content-secondary dark:text-content-muted"},ce={class:"text-content-primary dark:text-content-primary font-semibold ml-1"},ue={class:"glass-card rounded-[15px] p-6"},me={key:0,class:"overflow-x-auto"},ve={class:"w-full text-sm"},pe={class:"text-content-secondary dark:text-content-primary/80 py-2 transition-all duration-300"},xe={class:"text-content-primary dark:text-content-primary font-semibold py-2 transition-all duration-300"},ye={class:"text-center text-orange-500 dark:text-orange-400 py-2 transition-all duration-300"},ge={class:"text-center text-green-700 dark:text-green-400 py-2 transition-all duration-300"},fe={class:"text-right text-content-secondary dark:text-content-primary/80 py-2 transition-all duration-300"},be={key:0,class:"mt-4 text-center text-content-secondary dark:text-content-muted text-sm transition-all duration-300"},ke={key:1,class:"text-center text-content-secondary dark:text-content-muted py-8"},he={key:0,class:"glass-card rounded-[15px] p-8 text-center"},_e={key:1,class:"glass-card rounded-[15px] p-8 text-center"},Ce={class:"text-content-secondary dark:text-content-muted text-sm"},we=ot({name:"SystemStatsView",__name:"SystemStats",setup(Fe){j.register(it,ct,ut,mt,vt,pt,xt,yt,gt,ft,bt,kt,ht,_t);const L=u(null),_=u(!0),C=u(null),s=u(null),b=u(null),x=u([]),M=u(null),p=u({cpuChart:!0,memoryChart:!0,diskChart:!1,processChart:!0}),D=u(!1),R=u(!1),y=u(null),g=u(null),T=u(null),z=u(null),k=u(null),B=W(()=>s.value?{cpuUsage:s.value.cpu.usage_percent,memoryUsage:s.value.memory.usage_percent,diskUsage:s.value.disk.usage_percent,uptime:s.value.system.uptime}:{cpuUsage:0,memoryUsage:0,diskUsage:0,uptime:0}),A=W(()=>x.value.length===0?{cpu:[],memory:[],disk:[],network:[]}:{cpu:x.value.map(a=>a.cpu.usage_percent),memory:x.value.map(a=>a.memory.usage_percent),disk:x.value.map(a=>a.disk.usage_percent),network:x.value.map(a=>a.network.bytes_recv/1024/1024)}),f=a=>{const e=["B","KB","MB","GB","TB"];if(a===0)return"0 B";const r=Math.floor(Math.log(a)/Math.log(1024));return parseFloat((a/Math.pow(1024,r)).toFixed(2))+" "+e[r]},Z=a=>{const e=Math.floor(a/86400),r=Math.floor(a%86400/3600),n=Math.floor(a%3600/60);return e>0?`${e}d ${r}h ${n}m`:r>0?`${r}h ${n}m`:`${n}m`},tt=async()=>{try{const a=await Q.get("/hardware_stats");if(a?.success&&a.data){const e=a.data;if(s.value=e,x.value.length===0)for(let n=0;n<12;n++)x.value.push(JSON.parse(JSON.stringify(e)));else x.value.push(e),x.value.length>20&&x.value.shift()}}catch(a){console.error("Failed to fetch hardware stats:",a),C.value="Failed to fetch hardware stats"}},et=async()=>{try{const a=await Q.get("/hardware_processes");a?.success&&a.data&&(M.value=b.value,b.value=a.data)}catch(a){console.error("Failed to fetch process stats:",a)}},$=(a,e)=>{if(!M.value)return!1;const r=M.value.processes.find(n=>n.pid===a.pid);return r?r[e]!==a[e]:!0},I=async()=>{try{_.value=!0,C.value=null,await Promise.all([tt(),et()]),_.value=!1,await N(),q()}catch(a){C.value=a instanceof Error?a.message:"Failed to fetch system data",_.value=!1}},q=()=>{s.value&&(at(),st(),rt())},at=()=>{if(!T.value||!s.value){p.value.cpuChart=!1;return}const a=T.value.getContext("2d");if(!a){p.value.cpuChart=!1;return}const e=s.value.cpu.usage_percent,r=100-e;if(y.value)try{y.value.data.datasets[0].data=[e,r],y.value.update("none");return}catch(m){console.warn("Failed to update CPU chart, recreating...",m),y.value.destroy(),y.value=null}const n=document.documentElement.classList.contains("dark"),h=n?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",w=n?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.2)",F=n?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.6)";try{const m=new j(a,{type:"doughnut",data:{labels:["Used","Available"],datasets:[{data:[e,r],backgroundColor:["#FFC246",h],borderColor:["#FFC246",w],borderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",animation:{animateRotate:!1,animateScale:!1,duration:0},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(c){return`${c.label}: ${c.parsed.toFixed(1)}%`}}}}},plugins:[{id:"centerText",beforeDraw:function(c){const l=c.ctx;l.save();const S=(c.chartArea.left+c.chartArea.right)/2,U=(c.chartArea.top+c.chartArea.bottom)/2;l.textAlign="center",l.textBaseline="middle",l.fillStyle="#FFC246",l.font="bold 18px sans-serif",l.fillText(`${e.toFixed(1)}%`,S,U-5),l.fillStyle=F,l.font="10px sans-serif",l.fillText("CPU",S,U+12),l.restore()}}]});y.value=K(m),D.value=!1,p.value.cpuChart=!1}catch(m){console.error("Error creating CPU chart:",m),D.value=!0,p.value.cpuChart=!1}},st=()=>{if(!z.value||!s.value){p.value.memoryChart=!1;return}const a=z.value.getContext("2d");if(!a){p.value.memoryChart=!1;return}const e=s.value.memory.usage_percent,r=100-e;if(g.value)try{g.value.data.datasets[0].data=[e,r],g.value.update("none");return}catch(m){console.warn("Failed to update Memory chart, recreating...",m),g.value.destroy(),g.value=null}const n=document.documentElement.classList.contains("dark"),h=n?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.1)",w=n?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.2)",F=n?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.6)";try{const m=new j(a,{type:"doughnut",data:{labels:["Used","Available"],datasets:[{data:[e,r],backgroundColor:["#A5E5B6",h],borderColor:["#A5E5B6",w],borderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",animation:{animateRotate:!1,animateScale:!1,duration:0},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(c){return`${c.label}: ${c.parsed.toFixed(1)}%`}}}}},plugins:[{id:"centerText",beforeDraw:function(c){const l=c.ctx;l.save();const S=(c.chartArea.left+c.chartArea.right)/2,U=(c.chartArea.top+c.chartArea.bottom)/2;l.textAlign="center",l.textBaseline="middle",l.fillStyle="#A5E5B6",l.font="bold 18px sans-serif",l.fillText(`${e.toFixed(1)}%`,S,U-5),l.fillStyle=F,l.font="10px sans-serif",l.fillText("Memory",S,U+12),l.restore()}}]});g.value=K(m),R.value=!1,p.value.memoryChart=!1}catch(m){console.error("Error creating Memory chart:",m),R.value=!0,p.value.memoryChart=!1}},rt=()=>{if(!k.value||!s.value)return;const e=document.documentElement.classList.contains("dark")?"rgba(255, 255, 255, 0.8)":"rgba(0, 0, 0, 0.8)";try{O(()=>import("./plotly.min-DO11Gp-n.js").then(r=>r.p),__vite__mapDeps([0,1])).then(r=>{const n=r.default||r,h=s.value.disk,w=[{type:"pie",labels:["Used","Free"],values:[h.used,h.free],marker:{colors:["#FB787B","#A5E5B6"]},hovertemplate:"%{label}
Size: %{value}
Percentage: %{percent}",textinfo:"label+percent",textposition:"auto",hole:.4}],F={title:{text:"",font:{color:e}},paper_bgcolor:"rgba(0,0,0,0)",plot_bgcolor:"rgba(0,0,0,0)",font:{color:e,size:11},margin:{t:20,b:20,l:20,r:20},showlegend:!0,legend:{orientation:"h",x:0,y:-.2,font:{color:e,size:10}}},m={responsive:!0,displayModeBar:!1,staticPlot:!1};n.newPlot(k.value,w,F,m)})}catch(r){console.error("Error creating disk chart:",r)}},H=()=>{try{if(y.value&&(y.value.destroy(),y.value=null),g.value&&(g.value.destroy(),g.value=null),k.value)try{O(()=>import("./plotly.min-DO11Gp-n.js").then(a=>a.p),__vite__mapDeps([0,1])).then(a=>{const e=a?.default||a;e?.purge&&e.purge(k.value)}).catch(()=>{})}catch{}}catch(a){console.error("Error destroying charts:",a)}},J=new MutationObserver(a=>{a.forEach(e=>{e.attributeName==="class"&&(H(),N(()=>{q()}))})});return nt(async()=>{await N(),I(),L.value=window.setInterval(I,5e3),J.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),window.addEventListener("resize",()=>{setTimeout(()=>{X(y.value)?.resize(),X(g.value)?.resize();try{O(()=>import("./plotly.min-DO11Gp-n.js").then(a=>a.p),__vite__mapDeps([0,1])).then(a=>{const e=a?.default||a;e?.Plots&&e.Plots.resize(k.value)}).catch(()=>{})}catch{}},100)})}),lt(()=>{L.value&&clearInterval(L.value),J.disconnect(),H(),window.removeEventListener("resize",()=>{})}),(a,e)=>(i(),d("div",Ct,[e[28]||(e[28]=t("div",{class:"flex justify-between items-center"},[t("h2",{class:"text-2xl font-bold text-content-primary dark:text-content-primary"},"System Statistics"),t("div",{class:"text-content-secondary dark:text-content-muted text-sm"}," Updates every 5 seconds ")],-1)),t("div",wt,[E(P,{title:"CPU Usage",value:`${B.value.cpuUsage.toFixed(1)}%`,color:"#FFC246",data:A.value.cpu},null,8,["value","data"]),E(P,{title:"Memory Usage",value:`${B.value.memoryUsage.toFixed(1)}%`,color:"#A5E5B6",data:A.value.memory},null,8,["value","data"]),E(P,{title:"Disk Usage",value:`${B.value.diskUsage.toFixed(1)}%`,color:"#FB787B",data:A.value.disk},null,8,["value","data"]),E(P,{title:"Uptime",value:Z(B.value.uptime),color:"#EBA0FC",data:A.value.network},null,8,["value","data"])]),t("div",Ft,[t("div",St,[e[6]||(e[6]=t("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"CPU Performance",-1)),t("div",Ut,[t("canvas",{ref_key:"cpuCanvasRef",ref:T,class:"w-full h-full relative z-10"},null,512),p.value.cpuChart?(i(),d("div",Bt,e[0]||(e[0]=[t("div",{class:"text-center"},[t("div",{class:"animate-spin w-6 h-6 border-2 border-stroke-subtle dark:border-stroke/20 border-t-orange-400 rounded-full mx-auto mb-2"}),t("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Loading CPU data...")],-1)]))):v("",!0),D.value&&!p.value.cpuChart?(i(),d("div",At,e[1]||(e[1]=[t("div",{class:"text-center"},[t("div",{class:"text-red-500 dark:text-red-400 text-sm mb-1"},"No Data Available"),t("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"CPU data not found")],-1)]))):v("",!0)]),s.value?(i(),d("div",Et,[t("div",null,[e[2]||(e[2]=t("div",{class:"text-content-secondary dark:text-content-muted"},"CPU Count",-1)),t("div",Pt,o(s.value.cpu.count)+" cores",1)]),t("div",null,[e[3]||(e[3]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Frequency",-1)),t("div",Lt,o(s.value.cpu.frequency.toFixed(0))+" MHz",1)]),t("div",null,[e[4]||(e[4]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Load (1m)",-1)),t("div",Mt,o(s.value.cpu.load_avg["1min"].toFixed(2)),1)]),t("div",null,[e[5]||(e[5]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Load (5m)",-1)),t("div",Dt,o(s.value.cpu.load_avg["5min"].toFixed(2)),1)])])):v("",!0)]),t("div",Rt,[e[13]||(e[13]=t("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"Memory Usage",-1)),t("div",Tt,[t("canvas",{ref_key:"memoryCanvasRef",ref:z,class:"w-full h-full relative z-10"},null,512),p.value.memoryChart?(i(),d("div",zt,e[7]||(e[7]=[t("div",{class:"text-center"},[t("div",{class:"animate-spin w-6 h-6 border-2 border-stroke-subtle dark:border-stroke/20 border-t-green-400 rounded-full mx-auto mb-2"}),t("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Loading memory data...")],-1)]))):v("",!0),R.value&&!p.value.memoryChart?(i(),d("div",$t,e[8]||(e[8]=[t("div",{class:"text-center"},[t("div",{class:"text-red-500 dark:text-red-400 text-sm mb-1"},"No Data Available"),t("div",{class:"text-content-secondary dark:text-content-muted text-xs"},"Memory data not found")],-1)]))):v("",!0)]),s.value?(i(),d("div",It,[t("div",null,[e[9]||(e[9]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Total",-1)),t("div",Nt,o(f(s.value.memory.total)),1)]),t("div",null,[e[10]||(e[10]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Used",-1)),t("div",Ot,o(f(s.value.memory.used)),1)]),t("div",null,[e[11]||(e[11]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Available",-1)),t("div",Vt,o(f(s.value.memory.available)),1)]),t("div",null,[e[12]||(e[12]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Usage",-1)),t("div",jt,o(s.value.memory.usage_percent.toFixed(1))+"%",1)])])):v("",!0)])]),t("div",qt,[t("div",Ht,[e[17]||(e[17]=t("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"Storage Usage",-1)),t("div",Jt,[t("div",{ref_key:"diskCanvasRef",ref:k,class:"w-full h-full"},null,512)]),s.value?(i(),d("div",Wt,[t("div",Xt,[e[14]||(e[14]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Total",-1)),t("div",Yt,o(f(s.value.disk.total)),1)]),t("div",Gt,[e[15]||(e[15]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Used",-1)),t("div",Kt,o(f(s.value.disk.used)),1)]),t("div",Qt,[e[16]||(e[16]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Free",-1)),t("div",Zt,o(f(s.value.disk.free)),1)])])):v("",!0)]),t("div",te,[e[23]||(e[23]=t("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"Network Statistics",-1)),s.value?(i(),d("div",ee,[t("div",ae,[t("div",null,[e[18]||(e[18]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Bytes Sent",-1)),t("div",se,o(f(s.value.network.bytes_sent)),1)]),t("div",null,[e[19]||(e[19]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Bytes Received",-1)),t("div",re,o(f(s.value.network.bytes_recv)),1)]),t("div",null,[e[20]||(e[20]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Packets Sent",-1)),t("div",oe,o(s.value.network.packets_sent.toLocaleString()),1)]),t("div",null,[e[21]||(e[21]=t("div",{class:"text-content-secondary dark:text-content-muted"},"Packets Received",-1)),t("div",ne,o(s.value.network.packets_recv.toLocaleString()),1)])]),s.value.temperatures&&Object.keys(s.value.temperatures).length>0?(i(),d("div",le,[e[22]||(e[22]=t("div",{class:"text-content-secondary dark:text-content-muted mb-2"},"System Temperatures",-1)),t("div",de,[(i(!0),d(Y,null,G(s.value.temperatures,(r,n)=>(i(),d("div",{key:n},[t("span",ie,o(n)+":",1),t("span",ce,o(r.toFixed(1))+"°C",1)]))),128))])])):v("",!0)])):v("",!0)])]),t("div",ue,[e[25]||(e[25]=t("h3",{class:"text-content-primary dark:text-content-primary text-xl font-semibold mb-4"},"Top Processes",-1)),b.value?.processes&&b.value.processes.length>0?(i(),d("div",me,[t("table",ve,[e[24]||(e[24]=t("thead",null,[t("tr",{class:"border-b border-stroke-subtle dark:border-stroke/10"},[t("th",{class:"text-left text-content-secondary dark:text-content-muted py-2"},"PID"),t("th",{class:"text-left text-content-secondary dark:text-content-muted py-2"},"Name"),t("th",{class:"text-center text-content-secondary dark:text-content-muted py-2"},"CPU %"),t("th",{class:"text-center text-content-secondary dark:text-content-muted py-2"},"Memory %"),t("th",{class:"text-right text-content-secondary dark:text-content-muted py-2"},"Memory")])],-1)),t("tbody",null,[(i(!0),d(Y,null,G(b.value.processes.slice(0,10),r=>(i(),d("tr",{key:r.pid,class:"border-b border-stroke-subtle dark:border-white/5 process-row"},[t("td",pe,o(r.pid),1),t("td",xe,o(r.name),1),t("td",ye,[t("span",{class:V(["cpu-value",{"value-updated":$(r,"cpu_percent")}])},o(r.cpu_percent.toFixed(1))+"% ",3)]),t("td",ge,[t("span",{class:V(["memory-value",{"value-updated":$(r,"memory_percent")}])},o(r.memory_percent.toFixed(1))+"% ",3)]),t("td",fe,[t("span",{class:V({"value-updated":$(r,"memory_mb")})},o(r.memory_mb.toFixed(1))+" MB ",3)])]))),128))])]),b.value.total_processes?(i(),d("div",be," Showing top 10 of "+o(b.value.total_processes)+" total processes ",1)):v("",!0)])):_.value?v("",!0):(i(),d("div",ke," No process data available "))]),_.value?(i(),d("div",he,e[26]||(e[26]=[t("div",{class:"text-content-secondary dark:text-content-muted mb-2"},"Loading system statistics...",-1),t("div",{class:"animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-gray-900 dark:border-t-white/70 rounded-full mx-auto"},null,-1)]))):v("",!0),C.value?(i(),d("div",_e,[e[27]||(e[27]=t("div",{class:"text-red-500 dark:text-red-400 mb-2"},"Failed to load system statistics",-1)),t("p",Ce,o(C.value),1),t("button",{onClick:I,class:"mt-4 px-4 py-2 bg-purple-500/20 dark:bg-accent-purple/20 hover:bg-purple-500/30 dark:hover:bg-accent-purple/30 text-content-primary dark:text-content-primary rounded-lg border border-purple-500/50 dark:border-accent-purple/50 transition-colors"}," Retry ")])):v("",!0)]))}}),Ae=dt(we,[["__scopeId","data-v-eab6d04d"]]);export{Ae as default}; diff --git a/repeater/web/html/assets/SystemStats-DE5yghoc.js b/repeater/web/html/assets/SystemStats-DE5yghoc.js new file mode 100644 index 0000000..4128411 --- /dev/null +++ b/repeater/web/html/assets/SystemStats-DE5yghoc.js @@ -0,0 +1,2 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/plotly.min-Bnm7le34.js","assets/chunk-DECur_0Z.js"])))=>i.map(i=>d[i]); +import{r as e}from"./chunk-DECur_0Z.js";import{E as t,H as n,I as r,S as i,b as a,dt as o,g as s,l as c,lt as l,m as u,o as d,r as f,s as p,u as m,w as h,x as ee,z as g}from"./runtime-core.esm-bundler-IofF4kUm.js";import{i as _,t as v}from"./api-CrUX-ZnK.js";import{t as y}from"./_plugin-vue_export-helper-V-yks4gF.js";import{_ as te,a as b,c as ne,f as re,g as ie,h as ae,i as oe,l as se,m as ce,n as le,o as ue,r as de,s as fe,t as pe,u as me}from"./chart-DdrINt9G.js";import{t as x}from"./chartjs-adapter-date-fns.esm-CONKmChq.js";var he={class:`p-6 space-y-6`},ge={class:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4`},_e={class:`grid grid-cols-1 lg:grid-cols-2 gap-6`},ve={class:`glass-card rounded-[15px] p-6`},ye={class:`relative h-32 bg-gray-100/50 dark:bg-white/5 rounded-lg p-4 mb-4 chart-container`},be={key:0,class:`absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-sm z-20`},xe={key:1,class:`absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20`},Se={key:0,class:`grid grid-cols-2 gap-4 text-sm`},Ce={class:`text-content-primary dark:text-content-primary font-semibold`},S={class:`text-content-primary dark:text-content-primary font-semibold`},C={class:`text-content-primary dark:text-content-primary font-semibold`},w={class:`text-content-primary dark:text-content-primary font-semibold`},T={class:`glass-card rounded-[15px] p-6`},E={class:`relative h-32 bg-gray-100/50 dark:bg-white/5 rounded-lg p-4 mb-4 chart-container`},D={key:0,class:`absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 backdrop-blur-sm z-20`},O={key:1,class:`absolute inset-0 flex items-center justify-center bg-white/50 dark:bg-white/5 z-20`},k={key:0,class:`grid grid-cols-2 gap-4 text-sm`},A={class:`text-content-primary dark:text-content-primary font-semibold`},we={class:`text-content-primary dark:text-content-primary font-semibold`},Te={class:`text-content-primary dark:text-content-primary font-semibold`},Ee={class:`text-content-primary dark:text-content-primary font-semibold`},De={class:`grid grid-cols-1 lg:grid-cols-2 gap-6`},Oe={class:`glass-card rounded-[15px] p-6`},ke={class:`relative h-48`},Ae={key:0,class:`grid grid-cols-3 gap-4 text-sm mt-4`},je={class:`text-center`},Me={class:`text-content-primary dark:text-content-primary font-semibold`},Ne={class:`text-center`},Pe={class:`font-semibold text-red-500 dark:text-red-400`},Fe={class:`text-center`},Ie={class:`font-semibold text-green-700 dark:text-green-400`},Le={class:`glass-card rounded-[15px] p-6`},Re={key:0,class:`space-y-4`},ze={class:`grid grid-cols-2 gap-4 text-sm`},Be={class:`text-content-primary dark:text-content-primary font-semibold`},Ve={class:`text-content-primary dark:text-content-primary font-semibold`},He={class:`text-content-primary dark:text-content-primary font-semibold`},Ue={class:`text-content-primary dark:text-content-primary font-semibold`},We={key:0,class:`pt-4 border-t border-stroke-subtle dark:border-stroke/10`},j={class:`grid grid-cols-2 gap-2 text-sm`},Ge={class:`text-content-secondary dark:text-content-muted`},Ke={class:`text-content-primary dark:text-content-primary font-semibold ml-1`},qe={class:`glass-card rounded-[15px] p-6`},Je={key:0,class:`overflow-x-auto`},Ye={class:`w-full text-sm`},Xe={class:`text-content-secondary dark:text-content-primary/80 py-2 transition-all duration-300`},Ze={class:`text-content-primary dark:text-content-primary font-semibold py-2 transition-all duration-300`},Qe={class:`text-center text-orange-500 dark:text-orange-400 py-2 transition-all duration-300`},$e={class:`text-center text-green-700 dark:text-green-400 py-2 transition-all duration-300`},et={class:`text-right text-content-secondary dark:text-content-primary/80 py-2 transition-all duration-300`},tt={key:0,class:`mt-4 text-center text-content-secondary dark:text-content-muted text-sm transition-all duration-300`},nt={key:1,class:`text-center text-content-secondary dark:text-content-muted py-8`},rt={key:0,class:`glass-card rounded-[15px] p-8 text-center`},it={key:1,class:`glass-card rounded-[15px] p-8 text-center`},at={class:`text-content-secondary dark:text-content-muted text-sm`},M=y(s({name:`SystemStatsView`,__name:`SystemStats`,setup(s){b.register(oe,se,me,ne,fe,le,ue,ie,te,ae,pe,de,ce,re);let y=g(null),M=g(!0),N=g(null),P=g(null),F=g(null),I=g([]),L=g(null),R=g({cpuChart:!0,memoryChart:!0,diskChart:!1,processChart:!0}),z=g(!1),B=g(!1),V=g(null),H=g(null),U=g(null),W=g(null),G=g(null),K=d(()=>P.value?{cpuUsage:P.value.cpu.usage_percent,memoryUsage:P.value.memory.usage_percent,diskUsage:P.value.disk.usage_percent,uptime:P.value.system.uptime}:{cpuUsage:0,memoryUsage:0,diskUsage:0,uptime:0}),q=d(()=>I.value.length===0?{cpu:[],memory:[],disk:[],network:[]}:{cpu:I.value.map(e=>e.cpu.usage_percent),memory:I.value.map(e=>e.memory.usage_percent),disk:I.value.map(e=>e.disk.usage_percent),network:I.value.map(e=>e.network.bytes_recv/1024/1024)}),J=e=>{let t=[`B`,`KB`,`MB`,`GB`,`TB`];if(e===0)return`0 B`;let n=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/1024**n).toFixed(2))+` `+t[n]},ot=e=>{let t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t>0?`${t}d ${n}h ${r}m`:n>0?`${n}h ${r}m`:`${r}m`},st=async()=>{try{let e=await v.get(`/hardware_stats`);if(e?.success&&e.data){let t=e.data;if(P.value=t,I.value.length===0)for(let e=0;e<12;e++)I.value.push(JSON.parse(JSON.stringify(t)));else I.value.push(t),I.value.length>20&&I.value.shift()}}catch(e){console.error(`Failed to fetch hardware stats:`,e),N.value=`Failed to fetch hardware stats`}},ct=async()=>{try{let e=await v.get(`/hardware_processes`);e?.success&&e.data&&(L.value=F.value,F.value=e.data)}catch(e){console.error(`Failed to fetch process stats:`,e)}},Y=(e,t)=>{if(!L.value)return!1;let n=L.value.processes.find(t=>t.pid===e.pid);return n?n[t]!==e[t]:!0},X=async()=>{try{M.value=!0,N.value=null,await Promise.all([st(),ct()]),M.value=!1,await a(),Z()}catch(e){N.value=e instanceof Error?e.message:`Failed to fetch system data`,M.value=!1}},Z=()=>{P.value&&(lt(),ut(),dt())},lt=()=>{if(!U.value||!P.value){R.value.cpuChart=!1;return}let e=U.value.getContext(`2d`);if(!e){R.value.cpuChart=!1;return}let t=P.value.cpu.usage_percent,n=100-t;if(V.value)try{V.value.data.datasets[0].data=[t,n],V.value.update(`none`);return}catch(e){console.warn(`Failed to update CPU chart, recreating...`,e),V.value.destroy(),V.value=null}let i=document.documentElement.classList.contains(`dark`),a=i?`rgba(255, 255, 255, 0.1)`:`rgba(0, 0, 0, 0.1)`,o=i?`rgba(255, 255, 255, 0.2)`:`rgba(0, 0, 0, 0.2)`,s=i?`rgba(255, 255, 255, 0.6)`:`rgba(0, 0, 0, 0.6)`;try{V.value=r(new b(e,{type:`doughnut`,data:{labels:[`Used`,`Available`],datasets:[{data:[t,n],backgroundColor:[`#FFC246`,a],borderColor:[`#FFC246`,o],borderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`70%`,animation:{animateRotate:!1,animateScale:!1,duration:0},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(e){return`${e.label}: ${e.parsed.toFixed(1)}%`}}}}},plugins:[{id:`centerText`,beforeDraw:function(e){let n=e.ctx;n.save();let r=(e.chartArea.left+e.chartArea.right)/2,i=(e.chartArea.top+e.chartArea.bottom)/2;n.textAlign=`center`,n.textBaseline=`middle`,n.fillStyle=`#FFC246`,n.font=`bold 18px sans-serif`,n.fillText(`${t.toFixed(1)}%`,r,i-5),n.fillStyle=s,n.font=`10px sans-serif`,n.fillText(`CPU`,r,i+12),n.restore()}}]})),z.value=!1,R.value.cpuChart=!1}catch(e){console.error(`Error creating CPU chart:`,e),z.value=!0,R.value.cpuChart=!1}},ut=()=>{if(!W.value||!P.value){R.value.memoryChart=!1;return}let e=W.value.getContext(`2d`);if(!e){R.value.memoryChart=!1;return}let t=P.value.memory.usage_percent,n=100-t;if(H.value)try{H.value.data.datasets[0].data=[t,n],H.value.update(`none`);return}catch(e){console.warn(`Failed to update Memory chart, recreating...`,e),H.value.destroy(),H.value=null}let i=document.documentElement.classList.contains(`dark`),a=i?`rgba(255, 255, 255, 0.1)`:`rgba(0, 0, 0, 0.1)`,o=i?`rgba(255, 255, 255, 0.2)`:`rgba(0, 0, 0, 0.2)`,s=i?`rgba(255, 255, 255, 0.6)`:`rgba(0, 0, 0, 0.6)`;try{H.value=r(new b(e,{type:`doughnut`,data:{labels:[`Used`,`Available`],datasets:[{data:[t,n],backgroundColor:[`#A5E5B6`,a],borderColor:[`#A5E5B6`,o],borderWidth:2}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:`70%`,animation:{animateRotate:!1,animateScale:!1,duration:0},plugins:{legend:{display:!1},tooltip:{callbacks:{label:function(e){return`${e.label}: ${e.parsed.toFixed(1)}%`}}}}},plugins:[{id:`centerText`,beforeDraw:function(e){let n=e.ctx;n.save();let r=(e.chartArea.left+e.chartArea.right)/2,i=(e.chartArea.top+e.chartArea.bottom)/2;n.textAlign=`center`,n.textBaseline=`middle`,n.fillStyle=`#A5E5B6`,n.font=`bold 18px sans-serif`,n.fillText(`${t.toFixed(1)}%`,r,i-5),n.fillStyle=s,n.font=`10px sans-serif`,n.fillText(`Memory`,r,i+12),n.restore()}}]})),B.value=!1,R.value.memoryChart=!1}catch(e){console.error(`Error creating Memory chart:`,e),B.value=!0,R.value.memoryChart=!1}},dt=()=>{if(!G.value||!P.value)return;let t=document.documentElement.classList.contains(`dark`)?`rgba(255, 255, 255, 0.8)`:`rgba(0, 0, 0, 0.8)`;try{_(()=>import(`./plotly.min-Bnm7le34.js`).then(t=>e(t.t(),1)).then(e=>{let n=e.default||e,r=P.value.disk,i=[{type:`pie`,labels:[`Used`,`Free`],values:[r.used,r.free],marker:{colors:[`#FB787B`,`#A5E5B6`]},hovertemplate:`%{label}
Size: %{value}
Percentage: %{percent}`,textinfo:`label+percent`,textposition:`auto`,hole:.4}],a={title:{text:``,font:{color:t}},paper_bgcolor:`rgba(0,0,0,0)`,plot_bgcolor:`rgba(0,0,0,0)`,font:{color:t,size:11},margin:{t:20,b:20,l:20,r:20},showlegend:!0,legend:{orientation:`h`,x:0,y:-.2,font:{color:t,size:10}}};n.newPlot(G.value,i,a,{responsive:!0,displayModeBar:!1,staticPlot:!1})}),__vite__mapDeps([0,1]))}catch(e){console.error(`Error creating disk chart:`,e)}},Q=()=>{try{if(V.value&&=(V.value.destroy(),null),H.value&&=(H.value.destroy(),null),G.value)try{_(()=>import(`./plotly.min-Bnm7le34.js`).then(t=>e(t.t(),1)).then(e=>{let t=e?.default||e;t?.purge&&t.purge(G.value)}),__vite__mapDeps([0,1])).catch(()=>{})}catch{}}catch(e){console.error(`Error destroying charts:`,e)}},$=new MutationObserver(e=>{e.forEach(e=>{e.attributeName===`class`&&(Q(),a(()=>{Z()}))})});return i(async()=>{await a(),X(),y.value=window.setInterval(X,5e3),$.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),window.addEventListener(`resize`,()=>{setTimeout(()=>{n(V.value)?.resize(),n(H.value)?.resize();try{_(()=>import(`./plotly.min-Bnm7le34.js`).then(t=>e(t.t(),1)).then(e=>{let t=e?.default||e;t?.Plots&&t.Plots.resize(G.value)}),__vite__mapDeps([0,1])).catch(()=>{})}catch{}},100)})}),ee(()=>{y.value&&clearInterval(y.value),$.disconnect(),Q(),window.removeEventListener(`resize`,()=>{})}),(e,n)=>(h(),m(`div`,he,[n[28]||=p(`div`,{class:`flex justify-between items-center`},[p(`h2`,{class:`text-2xl font-bold text-content-primary dark:text-content-primary`},` System Statistics `),p(`div`,{class:`text-content-secondary dark:text-content-muted text-sm`},` Updates every 5 seconds `)],-1),p(`div`,ge,[u(x,{title:`CPU Usage`,value:`${K.value.cpuUsage.toFixed(1)}%`,color:`#FFC246`,data:q.value.cpu},null,8,[`value`,`data`]),u(x,{title:`Memory Usage`,value:`${K.value.memoryUsage.toFixed(1)}%`,color:`#A5E5B6`,data:q.value.memory},null,8,[`value`,`data`]),u(x,{title:`Disk Usage`,value:`${K.value.diskUsage.toFixed(1)}%`,color:`#FB787B`,data:q.value.disk},null,8,[`value`,`data`]),u(x,{title:`Uptime`,value:ot(K.value.uptime),color:`#EBA0FC`,data:q.value.network},null,8,[`value`,`data`])]),p(`div`,_e,[p(`div`,ve,[n[6]||=p(`h3`,{class:`text-content-primary dark:text-content-primary text-xl font-semibold mb-4`},` CPU Performance `,-1),p(`div`,ye,[p(`canvas`,{ref_key:`cpuCanvasRef`,ref:U,class:`w-full h-full relative z-10`},null,512),R.value.cpuChart?(h(),m(`div`,be,[...n[0]||=[p(`div`,{class:`text-center`},[p(`div`,{class:`animate-spin w-6 h-6 border-2 border-stroke-subtle dark:border-stroke/20 border-t-orange-400 rounded-full mx-auto mb-2`}),p(`div`,{class:`text-content-secondary dark:text-content-muted text-xs`},` Loading CPU data... `)],-1)]])):c(``,!0),z.value&&!R.value.cpuChart?(h(),m(`div`,xe,[...n[1]||=[p(`div`,{class:`text-center`},[p(`div`,{class:`text-red-500 dark:text-red-400 text-sm mb-1`},`No Data Available`),p(`div`,{class:`text-content-secondary dark:text-content-muted text-xs`},` CPU data not found `)],-1)]])):c(``,!0)]),P.value?(h(),m(`div`,Se,[p(`div`,null,[n[2]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`CPU Count`,-1),p(`div`,Ce,o(P.value.cpu.count)+` cores `,1)]),p(`div`,null,[n[3]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Frequency`,-1),p(`div`,S,o(P.value.cpu.frequency.toFixed(0))+` MHz `,1)]),p(`div`,null,[n[4]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Load (1m)`,-1),p(`div`,C,o(P.value.cpu.load_avg[`1min`].toFixed(2)),1)]),p(`div`,null,[n[5]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Load (5m)`,-1),p(`div`,w,o(P.value.cpu.load_avg[`5min`].toFixed(2)),1)])])):c(``,!0)]),p(`div`,T,[n[13]||=p(`h3`,{class:`text-content-primary dark:text-content-primary text-xl font-semibold mb-4`},` Memory Usage `,-1),p(`div`,E,[p(`canvas`,{ref_key:`memoryCanvasRef`,ref:W,class:`w-full h-full relative z-10`},null,512),R.value.memoryChart?(h(),m(`div`,D,[...n[7]||=[p(`div`,{class:`text-center`},[p(`div`,{class:`animate-spin w-6 h-6 border-2 border-stroke-subtle dark:border-stroke/20 border-t-green-400 rounded-full mx-auto mb-2`}),p(`div`,{class:`text-content-secondary dark:text-content-muted text-xs`},` Loading memory data... `)],-1)]])):c(``,!0),B.value&&!R.value.memoryChart?(h(),m(`div`,O,[...n[8]||=[p(`div`,{class:`text-center`},[p(`div`,{class:`text-red-500 dark:text-red-400 text-sm mb-1`},`No Data Available`),p(`div`,{class:`text-content-secondary dark:text-content-muted text-xs`},` Memory data not found `)],-1)]])):c(``,!0)]),P.value?(h(),m(`div`,k,[p(`div`,null,[n[9]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Total`,-1),p(`div`,A,o(J(P.value.memory.total)),1)]),p(`div`,null,[n[10]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Used`,-1),p(`div`,we,o(J(P.value.memory.used)),1)]),p(`div`,null,[n[11]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Available`,-1),p(`div`,Te,o(J(P.value.memory.available)),1)]),p(`div`,null,[n[12]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Usage`,-1),p(`div`,Ee,o(P.value.memory.usage_percent.toFixed(1))+`% `,1)])])):c(``,!0)])]),p(`div`,De,[p(`div`,Oe,[n[17]||=p(`h3`,{class:`text-content-primary dark:text-content-primary text-xl font-semibold mb-4`},` Storage Usage `,-1),p(`div`,ke,[p(`div`,{ref_key:`diskCanvasRef`,ref:G,class:`w-full h-full`},null,512)]),P.value?(h(),m(`div`,Ae,[p(`div`,je,[n[14]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Total`,-1),p(`div`,Me,o(J(P.value.disk.total)),1)]),p(`div`,Ne,[n[15]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Used`,-1),p(`div`,Pe,o(J(P.value.disk.used)),1)]),p(`div`,Fe,[n[16]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Free`,-1),p(`div`,Ie,o(J(P.value.disk.free)),1)])])):c(``,!0)]),p(`div`,Le,[n[23]||=p(`h3`,{class:`text-content-primary dark:text-content-primary text-xl font-semibold mb-4`},` Network Statistics `,-1),P.value?(h(),m(`div`,Re,[p(`div`,ze,[p(`div`,null,[n[18]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Bytes Sent`,-1),p(`div`,Be,o(J(P.value.network.bytes_sent)),1)]),p(`div`,null,[n[19]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Bytes Received`,-1),p(`div`,Ve,o(J(P.value.network.bytes_recv)),1)]),p(`div`,null,[n[20]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Packets Sent`,-1),p(`div`,He,o(P.value.network.packets_sent.toLocaleString()),1)]),p(`div`,null,[n[21]||=p(`div`,{class:`text-content-secondary dark:text-content-muted`},`Packets Received`,-1),p(`div`,Ue,o(P.value.network.packets_recv.toLocaleString()),1)])]),P.value.temperatures&&Object.keys(P.value.temperatures).length>0?(h(),m(`div`,We,[n[22]||=p(`div`,{class:`text-content-secondary dark:text-content-muted mb-2`},` System Temperatures `,-1),p(`div`,j,[(h(!0),m(f,null,t(P.value.temperatures,(e,t)=>(h(),m(`div`,{key:t},[p(`span`,Ge,o(t)+`:`,1),p(`span`,Ke,o(e.toFixed(1))+`°C`,1)]))),128))])])):c(``,!0)])):c(``,!0)])]),p(`div`,qe,[n[25]||=p(`h3`,{class:`text-content-primary dark:text-content-primary text-xl font-semibold mb-4`},` Top Processes `,-1),F.value?.processes&&F.value.processes.length>0?(h(),m(`div`,Je,[p(`table`,Ye,[n[24]||=p(`thead`,null,[p(`tr`,{class:`border-b border-stroke-subtle dark:border-stroke/10`},[p(`th`,{class:`text-left text-content-secondary dark:text-content-muted py-2`},`PID`),p(`th`,{class:`text-left text-content-secondary dark:text-content-muted py-2`},`Name`),p(`th`,{class:`text-center text-content-secondary dark:text-content-muted py-2`},`CPU %`),p(`th`,{class:`text-center text-content-secondary dark:text-content-muted py-2`},` Memory % `),p(`th`,{class:`text-right text-content-secondary dark:text-content-muted py-2`},`Memory`)])],-1),p(`tbody`,null,[(h(!0),m(f,null,t(F.value.processes.slice(0,10),e=>(h(),m(`tr`,{key:e.pid,class:`border-b border-stroke-subtle dark:border-white/5 process-row`},[p(`td`,Xe,o(e.pid),1),p(`td`,Ze,o(e.name),1),p(`td`,Qe,[p(`span`,{class:l([`cpu-value`,{"value-updated":Y(e,`cpu_percent`)}])},o(e.cpu_percent.toFixed(1))+`% `,3)]),p(`td`,$e,[p(`span`,{class:l([`memory-value`,{"value-updated":Y(e,`memory_percent`)}])},o(e.memory_percent.toFixed(1))+`% `,3)]),p(`td`,et,[p(`span`,{class:l({"value-updated":Y(e,`memory_mb`)})},o(e.memory_mb.toFixed(1))+` MB `,3)])]))),128))])]),F.value.total_processes?(h(),m(`div`,tt,` Showing top 10 of `+o(F.value.total_processes)+` total processes `,1)):c(``,!0)])):M.value?c(``,!0):(h(),m(`div`,nt,` No process data available `))]),M.value?(h(),m(`div`,rt,[...n[26]||=[p(`div`,{class:`text-content-secondary dark:text-content-muted mb-2`},` Loading system statistics... `,-1),p(`div`,{class:`animate-spin w-8 h-8 border-2 border-stroke-subtle dark:border-stroke/20 border-t-gray-900 dark:border-t-white/70 rounded-full mx-auto`},null,-1)]])):c(``,!0),N.value?(h(),m(`div`,it,[n[27]||=p(`div`,{class:`text-red-500 dark:text-red-400 mb-2`},`Failed to load system statistics`,-1),p(`p`,at,o(N.value),1),p(`button`,{onClick:X,class:`mt-4 px-4 py-2 bg-purple-500/20 dark:bg-accent-purple/20 hover:bg-purple-500/30 dark:hover:bg-accent-purple/30 text-content-primary dark:text-content-primary rounded-lg border border-purple-500/50 dark:border-accent-purple/50 transition-colors`},` Retry `)])):c(``,!0)]))}}),[[`__scopeId`,`data-v-fda01968`]]);export{M as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/SystemStats-Dnc1_s5j.css b/repeater/web/html/assets/SystemStats-Dnc1_s5j.css new file mode 100644 index 0000000..04344e0 --- /dev/null +++ b/repeater/web/html/assets/SystemStats-Dnc1_s5j.css @@ -0,0 +1 @@ +.glass-card[data-v-fda01968]{-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);background:#ffffffbf;border:1px solid #0000000f;box-shadow:0 2px 8px #0000000a}.dark .glass-card[data-v-fda01968]{box-shadow:none;background:#0000004d;border:1px solid #ffffff1a}.chart-updating[data-v-fda01968]{animation:.8s ease-in-out subtle-pulse-fda01968}@keyframes subtle-pulse-fda01968{0%{transform:scale(1)}50%{transform:scale(1.02)}to{transform:scale(1)}}.chart-container[data-v-fda01968]{transition:all .3s;position:relative}.chart-container[data-v-fda01968]:hover{background:#0000000a}.dark .chart-container[data-v-fda01968]:hover{background:#ffffff14}.process-row[data-v-fda01968]{transition:all .3s}.process-row[data-v-fda01968]:hover{background:#00000005;transform:translate(2px)}.dark .process-row[data-v-fda01968]:hover{background:#ffffff0d}.process-row-enter-active[data-v-fda01968],.process-row-leave-active[data-v-fda01968]{transition:all .4s}.process-row-enter-from[data-v-fda01968]{opacity:0;transform:translateY(-10px)scale(.95)}.process-row-leave-to[data-v-fda01968]{opacity:0;transform:translateY(10px)scale(.95)}.process-row-move[data-v-fda01968]{transition:transform .4s}.cpu-value[data-v-fda01968],.memory-value[data-v-fda01968]{border-radius:4px;padding:2px 6px;transition:all .3s}.cpu-value[data-v-fda01968]:hover,.memory-value[data-v-fda01968]:hover{background:#f59e0b1a;transform:scale(1.05)}@keyframes value-update-fda01968{0%{background:#f59e0b4d}to{background:0 0}}.value-updated[data-v-fda01968]{animation:.6s ease-out value-update-fda01968} diff --git a/repeater/web/html/assets/Terminal-CO_C7fq3.js b/repeater/web/html/assets/Terminal-CO_C7fq3.js deleted file mode 100644 index 5ab0b99..0000000 --- a/repeater/web/html/assets/Terminal-CO_C7fq3.js +++ /dev/null @@ -1,184 +0,0 @@ -import{L as J,a as zl,r as ut,o as Hl,a0 as Ul,P as Rn,E as ql,e as tt,f as Z,h as Yt,t as Is,w as Kl,v as Vl,X as Ji,k as Tn,x as jl,q as it,y as Gl}from"./index-xzvnOpJo.js";/** - * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. - * @license MIT - * - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * @license MIT - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - */var oa=Object.defineProperty,Yl=Object.getOwnPropertyDescriptor,Xl=(t,e)=>{for(var i in e)oa(t,i,{get:e[i],enumerable:!0})},ue=(t,e,i,s)=>{for(var r=s>1?void 0:s?Yl(e,i):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(s?o(e,i,r):o(r))||r);return s&&r&&oa(e,i,r),r},P=(t,e)=>(i,s)=>e(i,s,t),Dn="Terminal input",pr={get:()=>Dn,set:t=>Dn=t},An="Too much output to announce, navigate to rows manually to read",vr={get:()=>An,set:t=>An=t};function Jl(t){return t.replace(/\r?\n/g,"\r")}function Zl(t,e){return e?"\x1B[200~"+t+"\x1B[201~":t}function Ql(t,e){t.clipboardData&&t.clipboardData.setData("text/plain",e.selectionText),t.preventDefault()}function eh(t,e,i,s){if(t.stopPropagation(),t.clipboardData){let r=t.clipboardData.getData("text/plain");aa(r,e,i,s)}}function aa(t,e,i,s){t=Jl(t),t=Zl(t,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(t,!0),e.value=""}function la(t,e,i){let s=i.getBoundingClientRect(),r=t.clientX-s.left-10,n=t.clientY-s.top-10;e.style.width="20px",e.style.height="20px",e.style.left=`${r}px`,e.style.top=`${n}px`,e.style.zIndex="1000",e.focus()}function Pn(t,e,i,s,r){la(t,e,i),r&&s.rightClickSelect(t),e.value=s.selectionText,e.select()}function Kt(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function Ts(t,e=0,i=t.length){let s="";for(let r=e;r65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var th=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n=0;if(this._interim){let o=e.charCodeAt(n++);56320<=o&&o<=57343?i[r++]=(this._interim-55296)*1024+o-56320+65536:(i[r++]=this._interim,i[r++]=o),this._interim=0}for(let o=n;o=s)return this._interim=l,r;let h=e.charCodeAt(o);56320<=h&&h<=57343?i[r++]=(l-55296)*1024+h-56320+65536:(i[r++]=l,i[r++]=h);continue}l!==65279&&(i[r++]=l)}return r}},ih=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let s=e.length;if(!s)return 0;let r=0,n,o,l,h,a=0,c=0;if(this.interim[0]){let d=!1,m=this.interim[0];m&=(m&224)===192?31:(m&240)===224?15:7;let y=0,k;for(;(k=this.interim[++y]&63)&&y<4;)m<<=6,m|=k;let R=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,D=R-y;for(;c=s)return 0;if(k=e[c++],(k&192)!==128){c--,d=!0;break}else this.interim[y++]=k,m<<=6,m|=k&63}d||(R===2?m<128?c--:i[r++]=m:R===3?m<2048||m>=55296&&m<=57343||m===65279||(i[r++]=m):m<65536||m>1114111||(i[r++]=m)),this.interim.fill(0)}let _=s-4,f=c;for(;f=s)return this.interim[0]=n,r;if(o=e[f++],(o&192)!==128){f--;continue}if(a=(n&31)<<6|o&63,a<128){f--;continue}i[r++]=a}else if((n&240)===224){if(f>=s)return this.interim[0]=n,r;if(o=e[f++],(o&192)!==128){f--;continue}if(f>=s)return this.interim[0]=n,this.interim[1]=o,r;if(l=e[f++],(l&192)!==128){f--;continue}if(a=(n&15)<<12|(o&63)<<6|l&63,a<2048||a>=55296&&a<=57343||a===65279)continue;i[r++]=a}else if((n&248)===240){if(f>=s)return this.interim[0]=n,r;if(o=e[f++],(o&192)!==128){f--;continue}if(f>=s)return this.interim[0]=n,this.interim[1]=o,r;if(l=e[f++],(l&192)!==128){f--;continue}if(f>=s)return this.interim[0]=n,this.interim[1]=o,this.interim[2]=l,r;if(h=e[f++],(h&192)!==128){f--;continue}if(a=(n&7)<<18|(o&63)<<12|(l&63)<<6|h&63,a<65536||a>1114111)continue;i[r++]=a}}return r}},ha="",Vt=" ",ji=class ca{constructor(){this.fg=0,this.bg=0,this.extended=new bs}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new ca;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},bs=class da{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new da(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},ct=class ua extends ji{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new bs,this.combinedData=""}static fromCharData(e){let i=new ua;return i.setFromCharData(e),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Kt(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(e[1].length===2){let s=e[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},$n="di$target",mr="di$dependencies",Os=new Map;function sh(t){return t[mr]||[]}function Ie(t){if(Os.has(t))return Os.get(t);let e=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");rh(e,i,r)};return e._id=t,Os.set(t,e),e}function rh(t,e,i){e[$n]===e?e[mr].push({id:t,index:i}):(e[mr]=[{id:t,index:i}],e[$n]=e)}var Ve=Ie("BufferService"),_a=Ie("CoreMouseService"),li=Ie("CoreService"),nh=Ie("CharsetService"),fn=Ie("InstantiationService"),fa=Ie("LogService"),je=Ie("OptionsService"),ga=Ie("OscLinkService"),oh=Ie("UnicodeService"),Gi=Ie("DecorationService"),wr=class{constructor(e,i,s){this._bufferService=e,this._optionsService=i,this._oscLinkService=s}provideLinks(e,i){let s=this._bufferService.buffer.lines.get(e-1);if(!s){i(void 0);return}let r=[],n=this._optionsService.rawOptions.linkHandler,o=new ct,l=s.getTrimmedLength(),h=-1,a=-1,c=!1;for(let _=0;_n?n.activate(y,k,d):ah(y,k),hover:(y,k)=>n?.hover?.(y,k,d),leave:(y,k)=>n?.leave?.(y,k,d)})}c=!1,o.hasExtendedAttrs()&&o.extended.urlId?(a=_,h=o.extended.urlId):(a=-1,h=-1)}}i(r)}};wr=ue([P(0,Ve),P(1,je),P(2,ga)],wr);function ah(t,e){if(confirm(`Do you want to navigate to ${e}? - -WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}var Ds=Ie("CharSizeService"),$t=Ie("CoreBrowserService"),gn=Ie("MouseService"),It=Ie("RenderService"),lh=Ie("SelectionService"),pa=Ie("CharacterJoinerService"),bi=Ie("ThemeService"),va=Ie("LinkProviderService"),hh=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?In.isErrorNoTelemetry(e)?new In(e.message+` - -`+e.stack):new Error(e.message+` - -`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},ch=new hh;function hs(t){dh(t)||ch.onUnexpectedError(t)}var Sr="Canceled";function dh(t){return t instanceof uh?!0:t instanceof Error&&t.name===Sr&&t.message===Sr}var uh=class extends Error{constructor(){super(Sr),this.name=this.message}};function _h(t){return new Error(`Illegal argument: ${t}`)}var In=class br extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof br)return e;let i=new br;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},yr=class ma extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,ma.prototype)}};function Xe(t,e=0){return t[t.length-(1+e)]}var fh;(t=>{function e(n){return n<0}t.isLessThan=e;function i(n){return n<=0}t.isLessThanOrEqual=i;function s(n){return n>0}t.isGreaterThan=s;function r(n){return n===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(fh||={});function gh(t,e){let i=this,s=!1,r;return function(){return s||(s=!0,e||(r=t.apply(i,arguments))),r}}var wa;(t=>{function e(S){return S&&typeof S=="object"&&typeof S[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function s(){return i}t.empty=s;function*r(S){yield S}t.single=r;function n(S){return e(S)?S:r(S)}t.wrap=n;function o(S){return S||i}t.from=o;function*l(S){for(let L=S.length-1;L>=0;L--)yield S[L]}t.reverse=l;function h(S){return!S||S[Symbol.iterator]().next().done===!0}t.isEmpty=h;function a(S){return S[Symbol.iterator]().next().value}t.first=a;function c(S,L){let B=0;for(let $ of S)if(L($,B++))return!0;return!1}t.some=c;function _(S,L){for(let B of S)if(L(B))return B}t.find=_;function*f(S,L){for(let B of S)L(B)&&(yield B)}t.filter=f;function*d(S,L){let B=0;for(let $ of S)yield L($,B++)}t.map=d;function*m(S,L){let B=0;for(let $ of S)yield*L($,B++)}t.flatMap=m;function*y(...S){for(let L of S)yield*L}t.concat=y;function k(S,L,B){let $=B;for(let U of S)$=L($,U);return $}t.reduce=k;function*R(S,L,B=S.length){for(L<0&&(L+=S.length),B<0?B+=S.length:B>S.length&&(B=S.length);L1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function ph(...t){return re(()=>oi(t))}function re(t){return{dispose:gh(()=>{t()})}}var Sa=class ba{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{oi(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?ba.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};Sa.DISABLE_DISPOSED_WARNING=!1;var jt=Sa,j=class{constructor(){this._store=new jt,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};j.None=Object.freeze({dispose(){}});var Si=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},At=typeof window=="object"?window:globalThis,Cr=class xr{constructor(e){this.element=e,this.next=xr.Undefined,this.prev=xr.Undefined}};Cr.Undefined=new Cr(void 0);var oe=Cr,On=class{constructor(){this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===oe.Undefined}clear(){let e=this._first;for(;e!==oe.Undefined;){let i=e.next;e.prev=oe.Undefined,e.next=oe.Undefined,e=i}this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let s=new oe(e);if(this._first===oe.Undefined)this._first=s,this._last=s;else if(i){let n=this._last;this._last=s,s.prev=n,n.next=s}else{let n=this._first;this._first=s,s.next=n,n.prev=s}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(s))}}shift(){if(this._first!==oe.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==oe.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==oe.Undefined&&e.next!==oe.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===oe.Undefined&&e.next===oe.Undefined?(this._first=oe.Undefined,this._last=oe.Undefined):e.next===oe.Undefined?(this._last=this._last.prev,this._last.next=oe.Undefined):e.prev===oe.Undefined&&(this._first=this._first.next,this._first.prev=oe.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==oe.Undefined;)yield e.element,e=e.next}},vh=globalThis.performance&&typeof globalThis.performance.now=="function",mh=class ya{static create(e){return new ya(e)}constructor(e){this._now=vh&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Fe;(t=>{t.None=()=>j.None;function e(v,u){return _(v,()=>{},0,void 0,!0,void 0,u)}t.defer=e;function i(v){return(u,p=null,g)=>{let w=!1,b;return b=v(C=>{if(!w)return b?b.dispose():w=!0,u.call(p,C)},null,g),w&&b.dispose(),b}}t.once=i;function s(v,u,p){return a((g,w=null,b)=>v(C=>g.call(w,u(C)),null,b),p)}t.map=s;function r(v,u,p){return a((g,w=null,b)=>v(C=>{u(C),g.call(w,C)},null,b),p)}t.forEach=r;function n(v,u,p){return a((g,w=null,b)=>v(C=>u(C)&&g.call(w,C),null,b),p)}t.filter=n;function o(v){return v}t.signal=o;function l(...v){return(u,p=null,g)=>{let w=ph(...v.map(b=>b(C=>u.call(p,C))));return c(w,g)}}t.any=l;function h(v,u,p,g){let w=p;return s(v,b=>(w=u(w,b),w),g)}t.reduce=h;function a(v,u){let p,g={onWillAddFirstListener(){p=v(w.fire,w)},onDidRemoveLastListener(){p?.dispose()}},w=new A(g);return u?.add(w),w.event}function c(v,u){return u instanceof Array?u.push(v):u&&u.add(v),v}function _(v,u,p=100,g=!1,w=!1,b,C){let x,M,F,K=0,z,pe={leakWarningThreshold:b,onWillAddFirstListener(){x=v(ne=>{K++,M=u(M,ne),g&&!F&&(q.fire(M),M=void 0),z=()=>{let O=M;M=void 0,F=void 0,(!g||K>1)&&q.fire(O),K=0},typeof p=="number"?(clearTimeout(F),F=setTimeout(z,p)):F===void 0&&(F=0,queueMicrotask(z))})},onWillRemoveListener(){w&&K>0&&z?.()},onDidRemoveLastListener(){z=void 0,x.dispose()}},q=new A(pe);return C?.add(q),q.event}t.debounce=_;function f(v,u=0,p){return t.debounce(v,(g,w)=>g?(g.push(w),g):[w],u,void 0,!0,void 0,p)}t.accumulate=f;function d(v,u=(g,w)=>g===w,p){let g=!0,w;return n(v,b=>{let C=g||!u(b,w);return g=!1,w=b,C},p)}t.latch=d;function m(v,u,p){return[t.filter(v,u,p),t.filter(v,g=>!u(g),p)]}t.split=m;function y(v,u=!1,p=[],g){let w=p.slice(),b=v(M=>{w?w.push(M):x.fire(M)});g&&g.add(b);let C=()=>{w?.forEach(M=>x.fire(M)),w=null},x=new A({onWillAddFirstListener(){b||(b=v(M=>x.fire(M)),g&&g.add(b))},onDidAddFirstListener(){w&&(u?setTimeout(C):C())},onDidRemoveLastListener(){b&&b.dispose(),b=null}});return g&&g.add(x),x.event}t.buffer=y;function k(v,u){return(p,g,w)=>{let b=u(new D);return v(function(C){let x=b.evaluate(C);x!==R&&p.call(g,x)},void 0,w)}}t.chain=k;let R=Symbol("HaltChainable");class D{constructor(){this.steps=[]}map(u){return this.steps.push(u),this}forEach(u){return this.steps.push(p=>(u(p),p)),this}filter(u){return this.steps.push(p=>u(p)?p:R),this}reduce(u,p){let g=p;return this.steps.push(w=>(g=u(g,w),g)),this}latch(u=(p,g)=>p===g){let p=!0,g;return this.steps.push(w=>{let b=p||!u(w,g);return p=!1,g=w,b?w:R}),this}evaluate(u){for(let p of this.steps)if(u=p(u),u===R)break;return u}}function T(v,u,p=g=>g){let g=(...x)=>C.fire(p(...x)),w=()=>v.on(u,g),b=()=>v.removeListener(u,g),C=new A({onWillAddFirstListener:w,onDidRemoveLastListener:b});return C.event}t.fromNodeEventEmitter=T;function S(v,u,p=g=>g){let g=(...x)=>C.fire(p(...x)),w=()=>v.addEventListener(u,g),b=()=>v.removeEventListener(u,g),C=new A({onWillAddFirstListener:w,onDidRemoveLastListener:b});return C.event}t.fromDOMEventEmitter=S;function L(v){return new Promise(u=>i(v)(u))}t.toPromise=L;function B(v){let u=new A;return v.then(p=>{u.fire(p)},()=>{u.fire(void 0)}).finally(()=>{u.dispose()}),u.event}t.fromPromise=B;function $(v,u){return v(p=>u.fire(p))}t.forward=$;function U(v,u,p){return u(p),v(g=>u(g))}t.runAndSubscribe=U;class Y{constructor(u,p){this._observable=u,this._counter=0,this._hasChanged=!1;let g={onWillAddFirstListener:()=>{u.addObserver(this)},onDidRemoveLastListener:()=>{u.removeObserver(this)}};this.emitter=new A(g),p&&p.add(this.emitter)}beginUpdate(u){this._counter++}handlePossibleChange(u){}handleChange(u,p){this._hasChanged=!0}endUpdate(u){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function le(v,u){return new Y(v,u).emitter.event}t.fromObservable=le;function W(v){return(u,p,g)=>{let w=0,b=!1,C={beginUpdate(){w++},endUpdate(){w--,w===0&&(v.reportChanges(),b&&(b=!1,u.call(p)))},handlePossibleChange(){},handleChange(){b=!0}};v.addObserver(C),v.reportChanges();let x={dispose(){v.removeObserver(C)}};return g instanceof jt?g.add(x):Array.isArray(g)&&g.push(x),x}}t.fromObservableLight=W})(Fe||={});var kr=class Lr{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${Lr._idPool++}`,Lr.all.add(this)}start(e){this._stopWatch=new mh,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};kr.all=new Set,kr._idPool=0;var wh=kr,Sh=-1,Ca=class xa{constructor(e,i,s=(xa._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,i){let s=this.threshold;if(s<=0||i{let n=this._stacks.get(e.value)||0;this._stacks.set(e.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[s,r]of this._stacks)(!e||i{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let h=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],a=new xh(`${l}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||hs)(a),j.None}if(this._disposed)return j.None;i&&(e=e.bind(i));let r=new Fs(e),n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=yh.create(),n=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Fs?(this._deliveryQueue??=new Eh,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=re(()=>{n?.(),this._removeListener(r)});return s instanceof jt?s.add(o):Array.isArray(s)&&s.push(o),o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let i=this._listeners,s=i.indexOf(e);if(s===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[s]=void 0;let r=this._deliveryQueue.current===this;if(this._size*Lh<=i.length){let n=0;for(let o=0;o0}},Eh=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,s){this.i=0,this.end=s,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Br=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new A,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new A,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,i){if(this.getZoomLevel(i)===e)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,e),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),e)}setFullscreen(e,i){if(this.isFullscreen(i)===e)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,e),this._onDidChangeFullscreen.fire(s)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};Br.INSTANCE=new Br;var pn=Br;function Mh(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}pn.INSTANCE.onDidChangeZoomLevel;function Rh(t){return pn.INSTANCE.getZoomFactor(t)}pn.INSTANCE.onDidChangeFullscreen;var yi=typeof navigator=="object"?navigator.userAgent:"",Er=yi.indexOf("Firefox")>=0,Th=yi.indexOf("AppleWebKit")>=0,vn=yi.indexOf("Chrome")>=0,Dh=!vn&&yi.indexOf("Safari")>=0;yi.indexOf("Electron/")>=0;yi.indexOf("Android")>=0;var Ns=!1;if(typeof At.matchMedia=="function"){let t=At.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=At.matchMedia("(display-mode: fullscreen)");Ns=t.matches,Mh(At,t,({matches:i})=>{Ns&&e.matches||(Ns=i)})}var gi="en",Mr=!1,Rr=!1,cs=!1,La=!1,Zi,ds=gi,Fn=gi,Ah,Mt,ii=globalThis,Ze;typeof ii.vscode<"u"&&typeof ii.vscode.process<"u"?Ze=ii.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Ze=process);var Ph=typeof Ze?.versions?.electron=="string",$h=Ph&&Ze?.type==="renderer";if(typeof Ze=="object"){Mr=Ze.platform==="win32",Rr=Ze.platform==="darwin",cs=Ze.platform==="linux",cs&&Ze.env.SNAP&&Ze.env.SNAP_REVISION,Ze.env.CI||Ze.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Zi=gi,ds=gi;let t=Ze.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);Zi=e.userLocale,Fn=e.osLocale,ds=e.resolvedLanguage||gi,Ah=e.languagePack?.translationsConfigFile}catch{}La=!0}else typeof navigator=="object"&&!$h?(Mt=navigator.userAgent,Mr=Mt.indexOf("Windows")>=0,Rr=Mt.indexOf("Macintosh")>=0,(Mt.indexOf("Macintosh")>=0||Mt.indexOf("iPad")>=0||Mt.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,cs=Mt.indexOf("Linux")>=0,Mt?.indexOf("Mobi")>=0,ds=globalThis._VSCODE_NLS_LANGUAGE||gi,Zi=navigator.language.toLowerCase(),Fn=Zi):console.error("Unable to resolve platform.");var Ba=Mr,wt=Rr,Ih=cs,Nn=La,St=Mt,Ot=ds,Oh;(t=>{function e(){return Ot}t.value=e;function i(){return Ot.length===2?Ot==="en":Ot.length>=3?Ot[0]==="e"&&Ot[1]==="n"&&Ot[2]==="-":!1}t.isDefaultVariant=i;function s(){return Ot==="en"}t.isDefault=s})(Oh||={});var Fh=typeof ii.postMessage=="function"&&!ii.importScripts;(()=>{if(Fh){let t=[];ii.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=t.length;s{let s=++e;t.push({id:s,callback:i}),ii.postMessage({vscodeScheduleAsyncWork:s},"*")}}return t=>setTimeout(t)})();var Nh=!!(St&&St.indexOf("Chrome")>=0);St&&St.indexOf("Firefox")>=0;!Nh&&St&&St.indexOf("Safari")>=0;St&&St.indexOf("Edg/")>=0;St&&St.indexOf("Android")>=0;var ci=typeof navigator=="object"?navigator:{};Nn||document.queryCommandSupported&&document.queryCommandSupported("copy")||ci&&ci.clipboard&&ci.clipboard.writeText,Nn||ci&&ci.clipboard&&ci.clipboard.readText;var mn=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,i){this._keyCodeToStr[e]=i,this._strToKeyCode[i.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Ws=new mn,Wn=new mn,zn=new mn,Wh=new Array(230),Ea;(t=>{function e(l){return Ws.keyCodeToStr(l)}t.toString=e;function i(l){return Ws.strToKeyCode(l)}t.fromString=i;function s(l){return Wn.keyCodeToStr(l)}t.toUserSettingsUS=s;function r(l){return zn.keyCodeToStr(l)}t.toUserSettingsGeneral=r;function n(l){return Wn.strToKeyCode(l)||zn.strToKeyCode(l)}t.fromUserSettings=n;function o(l){if(l>=98&&l<=113)return null;switch(l){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Ws.keyCodeToStr(l)}t.toElectronAccelerator=o})(Ea||={});var zh=class Ma{constructor(e,i,s,r,n){this.ctrlKey=e,this.shiftKey=i,this.altKey=s,this.metaKey=r,this.keyCode=n}equals(e){return e instanceof Ma&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}getHashCode(){let e=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",s=this.altKey?"1":"0",r=this.metaKey?"1":"0";return`K${e}${i}${s}${r}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new Hh([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},Hh=class{constructor(t){if(t.length===0)throw _h("chords");this.chords=t}getHashCode(){let t="";for(let e=0,i=this.chords.length;e{function e(i){return i===t.None||i===t.Cancelled||i instanceof Jh?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Fe.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ra})})(Xh||={});var Jh=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Ra:(this._emitter||(this._emitter=new A),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},wn=class{constructor(e,i){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof i=="number"&&this.setIfNotSet(e,i)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,i){if(this._isDisposed)throw new yr("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},i)}setIfNotSet(e,i){if(this._isDisposed)throw new yr("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},i))}},Zh=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,i,s=globalThis){if(this.isDisposed)throw new yr("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let r=s.setInterval(()=>{e()},i);this.disposable=re(()=>{s.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Qh;(t=>{async function e(s){let r,n=await Promise.all(s.map(o=>o.then(l=>l,l=>{r||(r=l)})));if(typeof r<"u")throw r;return n}t.settled=e;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}t.withAsyncBody=i})(Qh||={});var Kn=class rt{static fromArray(e){return new rt(i=>{i.emitMany(e)})}static fromPromise(e){return new rt(async i=>{i.emitMany(await e)})}static fromPromises(e){return new rt(async i=>{await Promise.all(e.map(async s=>i.emitOne(await s)))})}static merge(e){return new rt(async i=>{await Promise.all(e.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new A,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(e(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,i){return new rt(async s=>{for await(let r of e)s.emitOne(i(r))})}map(e){return rt.map(this,e)}static filter(e,i){return new rt(async s=>{for await(let r of e)i(r)&&s.emitOne(r)})}filter(e){return rt.filter(this,e)}static coalesce(e){return rt.filter(e,i=>!!i)}coalesce(){return rt.coalesce(this)}static async toPromise(e){let i=[];for await(let s of e)i.push(s);return i}toPromise(){return rt.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Kn.EMPTY=Kn.fromArray([]);var{getWindow:mt,getWindowId:ec,onDidRegisterWindow:tc}=function(){let t=new Map,e={window:At,disposables:new jt};t.set(At.vscodeWindowId,e);let i=new A,s=new A,r=new A;function n(o,l){return(typeof o=="number"?t.get(o):void 0)??(l?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(o){if(t.has(o.vscodeWindowId))return j.None;let l=new jt,h={window:o,disposables:l.add(new jt)};return t.set(o.vscodeWindowId,h),l.add(re(()=>{t.delete(o.vscodeWindowId),s.fire(o)})),l.add(H(o,Me.BEFORE_UNLOAD,()=>{r.fire(o)})),i.fire(h),l},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return t.has(o)},getWindowById:n,getWindow(o){let l=o;if(l?.ownerDocument?.defaultView)return l.ownerDocument.defaultView.window;let h=o;return h?.view?h.view.window:At},getDocument(o){return mt(o).document}}}(),ic=class{constructor(e,i,s,r){this._node=e,this._type=i,this._handler=s,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function H(t,e,i,s){return new ic(t,e,i,s)}var Vn=function(t,e,i,s){return H(t,e,i,s)},Sn,sc=class extends Zh{constructor(t){super(),this.defaultTarget=t&&mt(t)}cancelAndSet(t,e,i){return super.cancelAndSet(t,e,i??this.defaultTarget)}},jn=class{constructor(e,i=0){this._runner=e,this.priority=i,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){hs(e)}}static sort(e,i){return i.priority-e.priority}};(function(){let t=new Map,e=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let o=t.get(n)??[];for(e.set(n,o),t.set(n,[]),s.set(n,!0);o.length>0;)o.sort(jn.sort),o.shift().execute();s.set(n,!1)};Sn=(n,o,l=0)=>{let h=ec(n),a=new jn(o,l),c=t.get(h);return c||(c=[],t.set(h,c)),c.push(a),i.get(h)||(i.set(h,!0),n.requestAnimationFrame(()=>r(h))),a}})();function rc(t){let e=t.getBoundingClientRect(),i=mt(t);return{left:e.left+i.scrollX,top:e.top+i.scrollY,width:e.width,height:e.height}}var Me={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},nc=class{constructor(t){this.domNode=t,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(t){let e=Ge(t);this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth)}setWidth(t){let e=Ge(t);this._width!==e&&(this._width=e,this.domNode.style.width=this._width)}setHeight(t){let e=Ge(t);this._height!==e&&(this._height=e,this.domNode.style.height=this._height)}setTop(t){let e=Ge(t);this._top!==e&&(this._top=e,this.domNode.style.top=this._top)}setLeft(t){let e=Ge(t);this._left!==e&&(this._left=e,this.domNode.style.left=this._left)}setBottom(t){let e=Ge(t);this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom)}setRight(t){let e=Ge(t);this._right!==e&&(this._right=e,this.domNode.style.right=this._right)}setPaddingTop(t){let e=Ge(t);this._paddingTop!==e&&(this._paddingTop=e,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(t){let e=Ge(t);this._paddingLeft!==e&&(this._paddingLeft=e,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(t){let e=Ge(t);this._paddingBottom!==e&&(this._paddingBottom=e,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(t){let e=Ge(t);this._paddingRight!==e&&(this._paddingRight=e,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(t){let e=Ge(t);this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize)}setFontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(t){this._fontFeatureSettings!==t&&(this._fontFeatureSettings=t,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(t){this._fontVariationSettings!==t&&(this._fontVariationSettings=t,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(t){this._textDecoration!==t&&(this._textDecoration=t,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(t){let e=Ge(t);this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(t){let e=Ge(t);this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(t){this._className!==t&&(this._className=t,this.domNode.className=this._className)}toggleClassName(t,e){this.domNode.classList.toggle(t,e),this._className=this.domNode.className}setDisplay(t){this._display!==t&&(this._display=t,this.domNode.style.display=this._display)}setPosition(t){this._position!==t&&(this._position=t,this.domNode.style.position=this._position)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this.domNode.style.visibility=this._visibility)}setColor(t){this._color!==t&&(this._color=t,this.domNode.style.color=this._color)}setBackgroundColor(t){this._backgroundColor!==t&&(this._backgroundColor=t,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(t){this._layerHint!==t&&(this._layerHint=t,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(t){this._boxShadow!==t&&(this._boxShadow=t,this.domNode.style.boxShadow=t)}setContain(t){this._contain!==t&&(this._contain=t,this.domNode.style.contain=this._contain)}setAttribute(t,e){this.domNode.setAttribute(t,e)}removeAttribute(t){this.domNode.removeAttribute(t)}appendChild(t){this.domNode.appendChild(t.domNode)}removeChild(t){this.domNode.removeChild(t.domNode)}};function Ge(t){return typeof t=="number"?`${t}px`:t}function zi(t){return new nc(t)}var Ta=class{constructor(){this._hooks=new jt,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,i){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let s=this._onStopCallback;this._onStopCallback=null,e&&s&&s(i)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,i,s,r,n){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=n;let o=e;try{e.setPointerCapture(i),this._hooks.add(re(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{o=mt(e)}this._hooks.add(H(o,Me.POINTER_MOVE,l=>{if(l.buttons!==s){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(H(o,Me.POINTER_UP,l=>this.stopMonitoring(!0)))}};function oc(t,e,i){let s=null,r=null;if(typeof i.value=="function"?(s="value",r=i.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(s="get",r=i.get),!r)throw new Error("not supported");let n=`$memoize$${e}`;i[s]=function(...o){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,o)}),this[n]}}var pt;(t=>(t.Tap="-xterm-gesturetap",t.Change="-xterm-gesturechange",t.Start="-xterm-gesturestart",t.End="-xterm-gesturesend",t.Contextmenu="-xterm-gesturecontextmenu"))(pt||={});var $i=class Ne extends j{constructor(){super(),this.dispatched=!1,this.targets=new On,this.ignoreTargets=new On,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Fe.runAndSubscribe(tc,({window:e,disposables:i})=>{i.add(H(e.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(H(e.document,"touchend",s=>this.onTouchEnd(e,s))),i.add(H(e.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:At,disposables:this._store}))}static addTarget(e){if(!Ne.isTouchDevice())return j.None;Ne.INSTANCE||(Ne.INSTANCE=new Ne);let i=Ne.INSTANCE.targets.push(e);return re(i)}static ignoreTarget(e){if(!Ne.isTouchDevice())return j.None;Ne.INSTANCE||(Ne.INSTANCE=new Ne);let i=Ne.INSTANCE.ignoreTargets.push(e);return re(i)}static isTouchDevice(){return"ontouchstart"in At||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let s=0,r=e.targetTouches.length;s=Ne.HOLD_DELAY&&Math.abs(h.initialPageX-Xe(h.rollingPageX))<30&&Math.abs(h.initialPageY-Xe(h.rollingPageY))<30){let c=this.newGestureEvent(pt.Contextmenu,h.initialTarget);c.pageX=Xe(h.rollingPageX),c.pageY=Xe(h.rollingPageY),this.dispatchEvent(c)}else if(r===1){let c=Xe(h.rollingPageX),_=Xe(h.rollingPageY),f=Xe(h.rollingTimestamps)-h.rollingTimestamps[0],d=c-h.rollingPageX[0],m=_-h.rollingPageY[0],y=[...this.targets].filter(k=>h.initialTarget instanceof Node&&k.contains(h.initialTarget));this.inertia(e,y,s,Math.abs(d)/f,d>0?1:-1,c,Math.abs(m)/f,m>0?1:-1,_)}this.dispatchEvent(this.newGestureEvent(pt.End,h.initialTarget)),delete this.activeTouches[l.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,i){let s=document.createEvent("CustomEvent");return s.initEvent(e,!1,!0),s.initialTarget=i,s.tapCount=0,s}dispatchEvent(e){if(e.type===pt.Tap){let i=new Date().getTime(),s=0;i-this._lastSetTapCountTime>Ne.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=i,e.tapCount=s}else(e.type===pt.Change||e.type===pt.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(e.initialTarget))return;let i=[];for(let s of this.targets)if(s.contains(e.initialTarget)){let r=0,n=e.initialTarget;for(;n&&n!==s;)r++,n=n.parentElement;i.push([r,s])}i.sort((s,r)=>s[0]-r[0]);for(let[s,r]of i)r.dispatchEvent(e),this.dispatched=!0}}inertia(e,i,s,r,n,o,l,h,a){this.handle=Sn(e,()=>{let c=Date.now(),_=c-s,f=0,d=0,m=!0;r+=Ne.SCROLL_FRICTION*_,l+=Ne.SCROLL_FRICTION*_,r>0&&(m=!1,f=n*r*_),l>0&&(m=!1,d=h*l*_);let y=this.newGestureEvent(pt.Change);y.translationX=f,y.translationY=d,i.forEach(k=>k.dispatchEvent(y)),m||this.inertia(e,i,c,r,n,o+f,l,h,a+d)})}onTouchMove(e){let i=Date.now();for(let s=0,r=e.changedTouches.length;s3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(i)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};$i.SCROLL_FRICTION=-.005,$i.HOLD_DELAY=700,$i.CLEAR_TAP_COUNT_TIME=400,ue([oc],$i,"isTouchDevice",1);var ac=$i,bn=class extends j{onclick(e,i){this._register(H(e,Me.CLICK,s=>i(new Qi(mt(e),s))))}onmousedown(e,i){this._register(H(e,Me.MOUSE_DOWN,s=>i(new Qi(mt(e),s))))}onmouseover(e,i){this._register(H(e,Me.MOUSE_OVER,s=>i(new Qi(mt(e),s))))}onmouseleave(e,i){this._register(H(e,Me.MOUSE_LEAVE,s=>i(new Qi(mt(e),s))))}onkeydown(e,i){this._register(H(e,Me.KEY_DOWN,s=>i(new Hn(s))))}onkeyup(e,i){this._register(H(e,Me.KEY_UP,s=>i(new Hn(s))))}oninput(e,i){this._register(H(e,Me.INPUT,i))}onblur(e,i){this._register(H(e,Me.BLUR,i))}onfocus(e,i){this._register(H(e,Me.FOCUS,i))}onchange(e,i){this._register(H(e,Me.CHANGE,i))}ignoreGesture(e){return ac.ignoreTarget(e)}},Gn=11,lc=class extends bn{constructor(t){super(),this._onActivate=t.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=t.bgWidth+"px",this.bgDomNode.style.height=t.bgHeight+"px",typeof t.top<"u"&&(this.bgDomNode.style.top="0px"),typeof t.left<"u"&&(this.bgDomNode.style.left="0px"),typeof t.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof t.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=t.className,this.domNode.style.position="absolute",this.domNode.style.width=Gn+"px",this.domNode.style.height=Gn+"px",typeof t.top<"u"&&(this.domNode.style.top=t.top+"px"),typeof t.left<"u"&&(this.domNode.style.left=t.left+"px"),typeof t.bottom<"u"&&(this.domNode.style.bottom=t.bottom+"px"),typeof t.right<"u"&&(this.domNode.style.right=t.right+"px"),this._pointerMoveMonitor=this._register(new Ta),this._register(Vn(this.bgDomNode,Me.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(Vn(this.domNode,Me.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new sc),this._pointerdownScheduleRepeatTimer=this._register(new wn)}_arrowPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,mt(t))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(e,200),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),t.preventDefault()}},hc=class Tr{constructor(e,i,s,r,n,o,l){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,s=s|0,r=r|0,n=n|0,o=o|0,l=l|0),this.rawScrollLeft=r,this.rawScrollTop=l,i<0&&(i=0),r+i>s&&(r=s-i),r<0&&(r=0),n<0&&(n=0),l+n>o&&(l=o-n),l<0&&(l=0),this.width=i,this.scrollWidth=s,this.scrollLeft=r,this.height=n,this.scrollHeight=o,this.scrollTop=l}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,i){return new Tr(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new Tr(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,i){let s=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,n=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,l=this.scrollHeight!==e.scrollHeight,h=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:i,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:s,scrollWidthChanged:r,scrollLeftChanged:n,heightChanged:o,scrollHeightChanged:l,scrollTopChanged:h}}},cc=class extends j{constructor(t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new A),this.onScroll=this._onScroll.event,this._smoothScrollDuration=t.smoothScrollDuration,this._scheduleAtNextAnimationFrame=t.scheduleAtNextAnimationFrame,this._state=new hc(t.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(t){this._smoothScrollDuration=t}validateScrollPosition(t){return this._state.withScrollPosition(t)}getScrollDimensions(){return this._state}setScrollDimensions(t,e){let i=this._state.withScrollDimensions(t,e);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(t){let e=this._state.withScrollPosition(t);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(e,!1)}setScrollPositionSmooth(t,e){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(t);if(this._smoothScrolling){t={scrollLeft:typeof t.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:t.scrollLeft,scrollTop:typeof t.scrollTop>"u"?this._smoothScrolling.to.scrollTop:t.scrollTop};let i=this._state.withScrollPosition(t);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;e?s=new Xn(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let i=this._state.withScrollPosition(t);this._smoothScrolling=Xn.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let t=this._smoothScrolling.tick(),e=this._state.withScrollPosition(t);if(this._setState(e,!0),!!this._smoothScrolling){if(t.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(t,e){let i=this._state;i.equals(t)||(this._state=t,this._onScroll.fire(this._state.createScrollEvent(i,e)))}},Yn=class{constructor(e,i,s){this.scrollLeft=e,this.scrollTop=i,this.isDone=s}};function zs(t,e){let i=e-t;return function(s){return t+i*_c(s)}}function dc(t,e,i){return function(s){return s2.5*s){let r,n;return e{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},gc=140,Da=class extends bn{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new fc(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Ta),this._shouldRender=!0,this.domNode=zi(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(H(this.domNode.domNode,Me.POINTER_DOWN,i=>this._domNodePointerDown(i)))}_createArrow(e){let i=this._register(new lc(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,s,r){this.slider=zi(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(i),typeof s=="number"&&this.slider.setWidth(s),typeof r=="number"&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(H(this.slider.domNode,Me.POINTER_DOWN,n=>{n.button===0&&(n.preventDefault(),this._sliderPointerDown(n))})),this.onclick(this.slider.domNode,n=>{n.leftButton&&n.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let i=this.domNode.domNode.getClientRects()[0].top,s=i+this._scrollbarState.getSliderPosition(),r=i+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),n=this._sliderPointerPosition(e);s<=n&&n<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let i,s;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")i=e.offsetX,s=e.offsetY;else{let n=rc(this.domNode.domNode);i=e.pageX-n.left,s=e.pageY-n.top}let r=this._pointerDownRelativePosition(i,s);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=this._sliderPointerPosition(e),s=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,n=>{let o=this._sliderOrthogonalPointerPosition(n),l=Math.abs(o-s);if(Ba&&l>gc){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let h=this._sliderPointerPosition(n)-i;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(h))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let i={};this.writeScrollPosition(i,e),this._scrollable.setScrollPositionNow(i)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Aa=class Ar{constructor(e,i,s,r,n,o){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=n,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Ar(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let i=Math.round(e);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(e){let i=Math.round(e);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(e){let i=Math.round(e);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,i,s,r,n){let o=Math.max(0,s-e),l=Math.max(0,o-2*i),h=r>0&&r>s;if(!h)return{computedAvailableSize:Math.round(o),computedIsNeeded:h,computedSliderSize:Math.round(l),computedSliderRatio:0,computedSliderPosition:0};let a=Math.round(Math.max(20,Math.floor(s*l/r))),c=(l-a)/(r-s),_=n*c;return{computedAvailableSize:Math.round(o),computedIsNeeded:h,computedSliderSize:Math.round(a),computedSliderRatio:c,computedSliderPosition:Math.round(_)}}_refreshComputedValues(){let e=Ar._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let i=e-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let i=e-this._arrowSize,s=this._scrollPosition;return i0&&Math.abs(e.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(s+=.25),i){let r=Math.abs(e.deltaX),n=Math.abs(e.deltaY),o=Math.abs(i.deltaX),l=Math.abs(i.deltaY),h=Math.max(Math.min(r,o),1),a=Math.max(Math.min(n,l),1),c=Math.max(r,o),_=Math.max(n,l);c%h===0&&_%a===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};Pr.INSTANCE=new Pr;var Sc=Pr,bc=class extends bn{constructor(t,e,i){super(),this._onScroll=this._register(new A),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new A),this.onWillScroll=this._onWillScroll.event,this._options=Cc(e),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));let s={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new vc(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new pc(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(t),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=zi(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=zi(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=zi(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new wn),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=oi(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(t){this._verticalScrollbar.delegatePointerDown(t)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(t){this._scrollable.setScrollDimensions(t,!1)}updateClassName(t){this._options.className=t,wt&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(t){typeof t.handleMouseWheel<"u"&&(this._options.handleMouseWheel=t.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof t.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity),typeof t.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=t.fastScrollSensitivity),typeof t.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=t.scrollPredominantAxis),typeof t.horizontal<"u"&&(this._options.horizontal=t.horizontal),typeof t.vertical<"u"&&(this._options.vertical=t.vertical),typeof t.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=t.horizontalScrollbarSize),typeof t.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=t.verticalScrollbarSize),typeof t.scrollByPage<"u"&&(this._options.scrollByPage=t.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(t){this._revealOnScroll=t}delegateScrollFromMouseWheelEvent(t){this._onMouseWheel(new qn(t))}_setListeningToMouseWheel(t){if(this._mouseWheelToDispose.length>0!==t&&(this._mouseWheelToDispose=oi(this._mouseWheelToDispose),t)){let e=i=>{this._onMouseWheel(new qn(i))};this._mouseWheelToDispose.push(H(this._listenOnDomNode,Me.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(t){if(t.browserEvent?.defaultPrevented)return;let e=Sc.INSTANCE;e.acceptStandardWheelEvent(t);let i=!1;if(t.deltaY||t.deltaX){let r=t.deltaY*this._options.mouseWheelScrollSensitivity,n=t.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&n+r===0?n=r=0:Math.abs(r)>=Math.abs(n)?n=0:r=0),this._options.flipAxes&&([r,n]=[n,r]);let o=!wt&&t.browserEvent&&t.browserEvent.shiftKey;(this._options.scrollYToX||o)&&!n&&(n=r,r=0),t.browserEvent&&t.browserEvent.altKey&&(n=n*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);let l=this._scrollable.getFutureScrollPosition(),h={};if(r){let a=Jn*r,c=l.scrollTop-(a<0?Math.floor(a):Math.ceil(a));this._verticalScrollbar.writeScrollPosition(h,c)}if(n){let a=Jn*n,c=l.scrollLeft-(a<0?Math.floor(a):Math.ceil(a));this._horizontalScrollbar.writeScrollPosition(h,c)}h=this._scrollable.validateScrollPosition(h),(l.scrollLeft!==h.scrollLeft||l.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&e.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(t.preventDefault(),t.stopPropagation())}_onDidScroll(t){this._shouldRender=this._horizontalScrollbar.onDidScroll(t)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(t)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let t=this._scrollable.getCurrentScrollPosition(),e=t.scrollTop>0,i=t.scrollLeft>0,s=i?" left":"",r=e?" top":"",n=i||e?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${n}${r}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(t){this._mouseIsOver=!1,this._hide()}_onMouseOver(t){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),mc)}},yc=class extends bc{constructor(e,i,s){super(e,i,s)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function Cc(t){let e={lazyRender:typeof t.lazyRender<"u"?t.lazyRender:!1,className:typeof t.className<"u"?t.className:"",useShadows:typeof t.useShadows<"u"?t.useShadows:!0,handleMouseWheel:typeof t.handleMouseWheel<"u"?t.handleMouseWheel:!0,flipAxes:typeof t.flipAxes<"u"?t.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof t.consumeMouseWheelIfScrollbarIsNeeded<"u"?t.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof t.alwaysConsumeMouseWheel<"u"?t.alwaysConsumeMouseWheel:!1,scrollYToX:typeof t.scrollYToX<"u"?t.scrollYToX:!1,mouseWheelScrollSensitivity:typeof t.mouseWheelScrollSensitivity<"u"?t.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof t.fastScrollSensitivity<"u"?t.fastScrollSensitivity:5,scrollPredominantAxis:typeof t.scrollPredominantAxis<"u"?t.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof t.mouseWheelSmoothScroll<"u"?t.mouseWheelSmoothScroll:!0,arrowSize:typeof t.arrowSize<"u"?t.arrowSize:11,listenOnDomNode:typeof t.listenOnDomNode<"u"?t.listenOnDomNode:null,horizontal:typeof t.horizontal<"u"?t.horizontal:1,horizontalScrollbarSize:typeof t.horizontalScrollbarSize<"u"?t.horizontalScrollbarSize:10,horizontalSliderSize:typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:0,horizontalHasArrows:typeof t.horizontalHasArrows<"u"?t.horizontalHasArrows:!1,vertical:typeof t.vertical<"u"?t.vertical:1,verticalScrollbarSize:typeof t.verticalScrollbarSize<"u"?t.verticalScrollbarSize:10,verticalHasArrows:typeof t.verticalHasArrows<"u"?t.verticalHasArrows:!1,verticalSliderSize:typeof t.verticalSliderSize<"u"?t.verticalSliderSize:0,scrollByPage:typeof t.scrollByPage<"u"?t.scrollByPage:!1};return e.horizontalSliderSize=typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof t.verticalSliderSize<"u"?t.verticalSliderSize:e.verticalScrollbarSize,wt&&(e.className+=" mac"),e}var $r=class extends j{constructor(e,i,s,r,n,o,l,h){super(),this._bufferService=s,this._optionsService=l,this._renderService=h,this._onRequestScrollLines=this._register(new A),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let a=this._register(new cc({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:c=>Sn(r.window,c)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{a.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new yc(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},a)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(n.onProtocolChange(c=>{this._scrollableElement.updateOptions({handleMouseWheel:!(c&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Fe.runAndSubscribe(o.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=o.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(re(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register(re(()=>this._styleElement.remove())),this._register(Fe.runAndSubscribe(o.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${o.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${o.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${o.colors.scrollbarSliderActiveBackground.css};`,"}"].join(` -`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(c=>this._handleScroll(c)))}scrollLines(e){let i=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i){i&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let i=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),s=i-this._bufferService.buffer.ydisp;s!==0&&(this._latestYDisp=i,this._onRequestScrollLines.fire(s)),this._isHandlingScroll=!1}};$r=ue([P(2,Ve),P(3,$t),P(4,_a),P(5,bi),P(6,je),P(7,It)],$r);var Ir=class extends j{constructor(e,i,s,r,n){super(),this._screenElement=e,this._bufferService=i,this._coreBrowserService=s,this._decorationService=r,this._renderService=n,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(o=>this._removeDecoration(o))),this._register(re(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let s=e.options.x??0;return s&&s>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){let i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let s=this._decorationElements.get(e);s||(s=this._createElement(e),e.element=s,this._decorationElements.set(e,s),this._container.appendChild(s),e.onDispose(()=>{this._decorationElements.delete(e),s.remove()})),s.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(s.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,s.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,s.style.top=`${i*this._renderService.dimensions.css.cell.height}px`,s.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(s)}}_refreshXPosition(e,i=e.element){if(!i)return;let s=e.options.x??0;(e.options.anchor||"left")==="right"?i.style.right=s?`${s*this._renderService.dimensions.css.cell.width}px`:"":i.style.left=s?`${s*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};Ir=ue([P(1,Ve),P(2,$t),P(3,Gi),P(4,It)],Ir);var xc=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let i of this._zones)if(i.color===e.options.overviewRulerOptions.color&&i.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(i,e.marker.line))return;if(this._lineAdjacentToZone(i,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(i,e.marker.line);return}}if(this._zonePoolIndex=e.startBufferLine&&i<=e.endBufferLine}_lineAdjacentToZone(e,i,s){return i>=e.startBufferLine-this._linePadding[s||"full"]&&i<=e.endBufferLine+this._linePadding[s||"full"]}_addLineToZone(e,i){e.startBufferLine=Math.min(e.startBufferLine,i),e.endBufferLine=Math.max(e.endBufferLine,i)}},_t={full:0,left:0,center:0,right:0},Ft={full:0,left:0,center:0,right:0},ki={full:0,left:0,center:0,right:0},ys=class extends j{constructor(e,i,s,r,n,o,l,h){super(),this._viewportElement=e,this._screenElement=i,this._bufferService=s,this._decorationService=r,this._renderService=n,this._optionsService=o,this._themeService=l,this._coreBrowserService=h,this._colorZoneStore=new xc,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(re(()=>this._canvas?.remove()));let a=this._canvas.getContext("2d");if(a)this._ctx=a;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),i=Math.ceil((this._canvas.width-1)/3);Ft.full=this._canvas.width,Ft.left=e,Ft.center=i,Ft.right=e,this._refreshDrawHeightConstants(),ki.full=1,ki.left=1,ki.center=1+Ft.left,ki.right=1+Ft.left+Ft.center}_refreshDrawHeightConstants(){_t.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,i=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);_t.left=i,_t.center=i,_t.right=i}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_t.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_t.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_t.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*_t.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let i of this._decorationService.decorations)this._colorZoneStore.addDecoration(i);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let i of e)i.position!=="full"&&this._renderColorZone(i);for(let i of e)i.position==="full"&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(ki[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-_t[e.position||"full"]/2),Ft[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+_t[e.position||"full"]))}_queueRefresh(e,i){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=i||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};ys=ue([P(2,Ve),P(3,Gi),P(4,It),P(5,je),P(6,bi),P(7,$t)],ys);var E;(t=>(t.NUL="\0",t.SOH="",t.STX="",t.ETX="",t.EOT="",t.ENQ="",t.ACK="",t.BEL="\x07",t.BS="\b",t.HT=" ",t.LF=` -`,t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="\x1B",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""))(E||={});var us;(t=>(t.PAD="€",t.HOP="",t.BPH="‚",t.NBH="ƒ",t.IND="„",t.NEL="…",t.SSA="†",t.ESA="‡",t.HTS="ˆ",t.HTJ="‰",t.VTS="Š",t.PLD="‹",t.PLU="Œ",t.RI="",t.SS2="Ž",t.SS3="",t.DCS="",t.PU1="‘",t.PU2="’",t.STS="“",t.CCH="”",t.MW="•",t.SPA="–",t.EPA="—",t.SOS="˜",t.SGCI="™",t.SCI="š",t.CSI="›",t.ST="œ",t.OSC="",t.PM="ž",t.APC="Ÿ"))(us||={});var Pa;(t=>t.ST=`${E.ESC}\\`)(Pa||={});var Or=class{constructor(e,i,s,r,n,o){this._textarea=e,this._compositionView=i,this._bufferService=s,this._optionsService=r,this._coreService=n,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let s;i.start+=this._dataAlreadySent.length,this._isComposing?s=this._textarea.value.substring(i.start,this._compositionPosition.start):s=this._textarea.value.substring(i.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}},0)}else{this._isSendingComposition=!1;let i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let i=this._textarea.value,s=i.replace(e,"");this._dataAlreadySent=s,i.length>e.length?this._coreService.triggerDataEvent(s,!0):i.lengththis.updateCompositionElements(!0),0)}}};Or=ue([P(2,Ve),P(3,je),P(4,li),P(5,It)],Or);var Re=0,Te=0,De=0,ce=0,Zn={css:"#00000000",rgba:0},Se;(t=>{function e(r,n,o,l){return l!==void 0?`#${Xt(r)}${Xt(n)}${Xt(o)}${Xt(l)}`:`#${Xt(r)}${Xt(n)}${Xt(o)}`}t.toCss=e;function i(r,n,o,l=255){return(r<<24|n<<16|o<<8|l)>>>0}t.toRgba=i;function s(r,n,o,l){return{css:t.toCss(r,n,o,l),rgba:t.toRgba(r,n,o,l)}}t.toColor=s})(Se||={});var ie;(t=>{function e(h,a){if(ce=(a.rgba&255)/255,ce===1)return{css:a.css,rgba:a.rgba};let c=a.rgba>>24&255,_=a.rgba>>16&255,f=a.rgba>>8&255,d=h.rgba>>24&255,m=h.rgba>>16&255,y=h.rgba>>8&255;Re=d+Math.round((c-d)*ce),Te=m+Math.round((_-m)*ce),De=y+Math.round((f-y)*ce);let k=Se.toCss(Re,Te,De),R=Se.toRgba(Re,Te,De);return{css:k,rgba:R}}t.blend=e;function i(h){return(h.rgba&255)===255}t.isOpaque=i;function s(h,a,c){let _=_s.ensureContrastRatio(h.rgba,a.rgba,c);if(_)return Se.toColor(_>>24&255,_>>16&255,_>>8&255)}t.ensureContrastRatio=s;function r(h){let a=(h.rgba|255)>>>0;return[Re,Te,De]=_s.toChannels(a),{css:Se.toCss(Re,Te,De),rgba:a}}t.opaque=r;function n(h,a){return ce=Math.round(a*255),[Re,Te,De]=_s.toChannels(h.rgba),{css:Se.toCss(Re,Te,De,ce),rgba:Se.toRgba(Re,Te,De,ce)}}t.opacity=n;function o(h,a){return ce=h.rgba&255,n(h,ce*a/255)}t.multiplyOpacity=o;function l(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}t.toColorRGB=l})(ie||={});var ae;(t=>{let e,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(e=n,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return Re=parseInt(r.slice(1,2).repeat(2),16),Te=parseInt(r.slice(2,3).repeat(2),16),De=parseInt(r.slice(3,4).repeat(2),16),Se.toColor(Re,Te,De);case 5:return Re=parseInt(r.slice(1,2).repeat(2),16),Te=parseInt(r.slice(2,3).repeat(2),16),De=parseInt(r.slice(3,4).repeat(2),16),ce=parseInt(r.slice(4,5).repeat(2),16),Se.toColor(Re,Te,De,ce);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let n=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return Re=parseInt(n[1]),Te=parseInt(n[2]),De=parseInt(n[3]),ce=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),Se.toColor(Re,Te,De,ce);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=r,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Re,Te,De,ce]=e.getImageData(0,0,1,1).data,ce!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Se.toRgba(Re,Te,De,ce),css:r}}t.toColor=s})(ae||={});var Ue;(t=>{function e(s){return i(s>>16&255,s>>8&255,s&255)}t.relativeLuminance=e;function i(s,r,n){let o=s/255,l=r/255,h=n/255,a=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),c=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),_=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return a*.2126+c*.7152+_*.0722}t.relativeLuminance2=i})(Ue||={});var _s;(t=>{function e(o,l){if(ce=(l&255)/255,ce===1)return l;let h=l>>24&255,a=l>>16&255,c=l>>8&255,_=o>>24&255,f=o>>16&255,d=o>>8&255;return Re=_+Math.round((h-_)*ce),Te=f+Math.round((a-f)*ce),De=d+Math.round((c-d)*ce),Se.toRgba(Re,Te,De)}t.blend=e;function i(o,l,h){let a=Ue.relativeLuminance(o>>8),c=Ue.relativeLuminance(l>>8);if(xt(a,c)>8));if(m>8));return m>k?d:y}return d}let _=r(o,l,h),f=xt(a,Ue.relativeLuminance(_>>8));if(f>8));return f>m?_:d}return _}}t.ensureContrastRatio=i;function s(o,l,h){let a=o>>24&255,c=o>>16&255,_=o>>8&255,f=l>>24&255,d=l>>16&255,m=l>>8&255,y=xt(Ue.relativeLuminance2(f,d,m),Ue.relativeLuminance2(a,c,_));for(;y0||d>0||m>0);)f-=Math.max(0,Math.ceil(f*.1)),d-=Math.max(0,Math.ceil(d*.1)),m-=Math.max(0,Math.ceil(m*.1)),y=xt(Ue.relativeLuminance2(f,d,m),Ue.relativeLuminance2(a,c,_));return(f<<24|d<<16|m<<8|255)>>>0}t.reduceLuminance=s;function r(o,l,h){let a=o>>24&255,c=o>>16&255,_=o>>8&255,f=l>>24&255,d=l>>16&255,m=l>>8&255,y=xt(Ue.relativeLuminance2(f,d,m),Ue.relativeLuminance2(a,c,_));for(;y>>0}t.increaseLuminance=r;function n(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=n})(_s||={});function Xt(t){let e=t.toString(16);return e.length<2?"0"+e:e}function xt(t,e){return t1){let c=this._getJoinedRanges(s,o,n,e,r);for(let _=0;_1){let a=this._getJoinedRanges(s,o,n,e,r);for(let c=0;c=W,C=p,x=this._workCell;if(d.length>0&&p===d[0][0]&&b){let N=d.shift(),be=this._isCellInSelection(N[0],i);for(T=N[0]+1;T=N[1],b?(w=!0,x=new kc(this._workCell,e.translateToString(!0,N[0],N[1]),N[1]-N[0]),C=N[1]-1,g=x.getWidth()):W=N[1]}let M=this._isCellInSelection(p,i),F=s&&p===o,K=u&&p>=c&&p<=_,z=!1;this._decorationService.forEachDecorationAtCell(p,i,void 0,N=>{z=!0});let pe=x.getChars()||Vt;if(pe===" "&&(x.isUnderline()||x.isOverline())&&(pe=" "),le=g*h-a.get(pe,x.isBold(),x.isItalic()),!k)k=this._document.createElement("span");else if(R&&(M&&Y||!M&&!Y&&x.bg===S)&&(M&&Y&&m.selectionForeground||x.fg===L)&&x.extended.ext===B&&K===$&&le===U&&!F&&!w&&!z&&b){x.isInvisible()?D+=Vt:D+=pe,R++;continue}else R&&(k.textContent=D),k=this._document.createElement("span"),R=0,D="";if(S=x.bg,L=x.fg,B=x.extended.ext,$=K,U=le,Y=M,w&&o>=p&&o<=C&&(o=p),!this._coreService.isCursorHidden&&F&&this._coreService.isCursorInitialized){if(v.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&v.push("xterm-cursor-blink"),v.push(r==="bar"?"xterm-cursor-bar":r==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(n)switch(n){case"outline":v.push("xterm-cursor-outline");break;case"block":v.push("xterm-cursor-block");break;case"bar":v.push("xterm-cursor-bar");break;case"underline":v.push("xterm-cursor-underline");break}}if(x.isBold()&&v.push("xterm-bold"),x.isItalic()&&v.push("xterm-italic"),x.isDim()&&v.push("xterm-dim"),x.isInvisible()?D=Vt:D=x.getChars()||Vt,x.isUnderline()&&(v.push(`xterm-underline-${x.extended.underlineStyle}`),D===" "&&(D=" "),!x.isUnderlineColorDefault()))if(x.isUnderlineColorRGB())k.style.textDecorationColor=`rgb(${ji.toColorRGB(x.getUnderlineColor()).join(",")})`;else{let N=x.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&x.isBold()&&N<8&&(N+=8),k.style.textDecorationColor=m.ansi[N].css}x.isOverline()&&(v.push("xterm-overline"),D===" "&&(D=" ")),x.isStrikethrough()&&v.push("xterm-strikethrough"),K&&(k.style.textDecoration="underline");let q=x.getFgColor(),ne=x.getFgColorMode(),O=x.getBgColor(),I=x.getBgColorMode(),G=!!x.isInverse();if(G){let N=q;q=O,O=N;let be=ne;ne=I,I=be}let X,_e,Le=!1;this._decorationService.forEachDecorationAtCell(p,i,void 0,N=>{N.options.layer!=="top"&&Le||(N.backgroundColorRGB&&(I=50331648,O=N.backgroundColorRGB.rgba>>8&16777215,X=N.backgroundColorRGB),N.foregroundColorRGB&&(ne=50331648,q=N.foregroundColorRGB.rgba>>8&16777215,_e=N.foregroundColorRGB),Le=N.options.layer==="top")}),!Le&&M&&(X=this._coreBrowserService.isFocused?m.selectionBackgroundOpaque:m.selectionInactiveBackgroundOpaque,O=X.rgba>>8&16777215,I=50331648,Le=!0,m.selectionForeground&&(ne=50331648,q=m.selectionForeground.rgba>>8&16777215,_e=m.selectionForeground)),Le&&v.push("xterm-decoration-top");let Be;switch(I){case 16777216:case 33554432:Be=m.ansi[O],v.push(`xterm-bg-${O}`);break;case 50331648:Be=Se.toColor(O>>16,O>>8&255,O&255),this._addStyle(k,`background-color:#${Qn((O>>>0).toString(16),"0",6)}`);break;case 0:default:G?(Be=m.foreground,v.push("xterm-bg-257")):Be=m.background}switch(X||x.isDim()&&(X=ie.multiplyOpacity(Be,.5)),ne){case 16777216:case 33554432:x.isBold()&&q<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(q+=8),this._applyMinimumContrast(k,Be,m.ansi[q],x,X,void 0)||v.push(`xterm-fg-${q}`);break;case 50331648:let N=Se.toColor(q>>16&255,q>>8&255,q&255);this._applyMinimumContrast(k,Be,N,x,X,_e)||this._addStyle(k,`color:#${Qn(q.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(k,Be,m.foreground,x,X,_e)||G&&v.push("xterm-fg-257")}v.length&&(k.className=v.join(" "),v.length=0),!F&&!w&&!z&&b?R++:k.textContent=D,le!==this.defaultSpacing&&(k.style.letterSpacing=`${le}px`),f.push(k),p=C}return k&&R&&(k.textContent=D),f}_applyMinimumContrast(e,i,s,r,n,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||Ec(r.getCode()))return!1;let l=this._getContrastCache(r),h;if(!n&&!o&&(h=l.getColor(i.rgba,s.rgba)),h===void 0){let a=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);h=ie.ensureContrastRatio(n||i,o||s,a),l.setColor((n||i).rgba,(o||s).rgba,h??null)}return h?(this._addStyle(e,`color:${h.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,i){e.setAttribute("style",`${e.getAttribute("style")||""}${i};`)}_isCellInSelection(e,i){let s=this._selectionStart,r=this._selectionEnd;return!s||!r?!1:this._columnSelectMode?s[0]<=r[0]?e>=s[0]&&i>=s[1]&&e=s[1]&&e>=r[0]&&i<=r[1]:i>s[1]&&i=s[0]&&e=s[0]}};Fr=ue([P(1,pa),P(2,je),P(3,$t),P(4,li),P(5,Gi),P(6,bi)],Fr);function Qn(t,e,i){for(;t.length0&&(this._flat[r]=l),l}let n=e;i&&(n+="B"),s&&(n+="I");let o=this._holey.get(n);if(o===void 0){let l=0;i&&(l|=1),s&&(l|=2),o=this._measure(e,l),o>0&&this._holey.set(n,o)}return o}_measure(e,i){let s=this._measureElements[i];return s.textContent=e.repeat(32),s.offsetWidth/32}},Tc=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,i,s,r=!1){if(this.selectionStart=i,this.selectionEnd=s,!i||!s||i[0]===s[0]&&i[1]===s[1]){this.clear();return}let n=e.buffers.active.ydisp,o=i[1]-n,l=s[1]-n,h=Math.max(o,0),a=Math.min(l,e.rows-1);if(h>=e.rows||a<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=o,this.viewportEndRow=l,this.viewportCappedStartRow=h,this.viewportCappedEndRow=a,this.startCol=i[0],this.endCol=s[0]}isCellSelected(e,i,s){return this.hasSelection?(s-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&s>=this.viewportCappedStartRow&&i=this.viewportCappedStartRow&&i>=this.endCol&&s<=this.viewportCappedEndRow:s>this.viewportStartRow&&s=this.startCol&&i=this.startCol):!1}};function Dc(){return new Tc}var Hs="xterm-dom-renderer-owner-",st="xterm-rows",ts="xterm-fg-",eo="xterm-bg-",Li="xterm-focus",is="xterm-selection",Ac=1,Nr=class extends j{constructor(e,i,s,r,n,o,l,h,a,c,_,f,d,m){super(),this._terminal=e,this._document=i,this._element=s,this._screenElement=r,this._viewportElement=n,this._helperContainer=o,this._linkifier2=l,this._charSizeService=a,this._optionsService=c,this._bufferService=_,this._coreService=f,this._coreBrowserService=d,this._themeService=m,this._terminalClass=Ac++,this._rowElements=[],this._selectionRenderModel=Dc(),this.onRequestRedraw=this._register(new A).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(st),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(is),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=Mc(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(y=>this._injectCss(y))),this._injectCss(this._themeService.colors),this._rowFactory=h.createInstance(Fr,document),this._element.classList.add(Hs+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(y=>this._handleLinkHover(y))),this._register(this._linkifier2.onHideLinkUnderline(y=>this._handleLinkLeave(y))),this._register(re(()=>{this._element.classList.remove(Hs+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new Rc(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let s of this._rowElements)s.style.width=`${this.dimensions.css.canvas.width}px`,s.style.height=`${this.dimensions.css.cell.height}px`,s.style.lineHeight=`${this.dimensions.css.cell.height}px`,s.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i=`${this._terminalSelector} .${st} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=i,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .${st} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;i+=`${this._terminalSelector} .${st} .xterm-dim { color: ${ie.multiplyOpacity(e.foreground,.5).css};}`,i+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let s=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,n=`blink_block_${this._terminalClass}`;i+=`@keyframes ${s} { 50% { border-bottom-style: hidden; }}`,i+=`@keyframes ${r} { 50% { box-shadow: none; }}`,i+=`@keyframes ${n} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,i+=`${this._terminalSelector} .${st}.${Li} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${st}.${Li} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${st}.${Li} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${st} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${st} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${st} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${st} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${st} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${is} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${is} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${is} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,l]of e.ansi.entries())i+=`${this._terminalSelector} .${ts}${o} { color: ${l.css}; }${this._terminalSelector} .${ts}${o}.xterm-dim { color: ${ie.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${eo}${o} { background-color: ${l.css}; }`;i+=`${this._terminalSelector} .${ts}257 { color: ${ie.opaque(e.background).css}; }${this._terminalSelector} .${ts}257.xterm-dim { color: ${ie.multiplyOpacity(ie.opaque(e.background),.5).css}; }${this._terminalSelector} .${eo}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=i}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,i){for(let s=this._rowElements.length;s<=i;s++){let r=this._document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,i){this._refreshRowElements(e,i),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Li),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Li),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i,s){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i,s),this.renderRows(0,this._bufferService.rows-1),!e||!i||(this._selectionRenderModel.update(this._terminal,e,i,s),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,n=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,h=this._document.createDocumentFragment();if(s){let a=e[0]>i[0];h.appendChild(this._createSelectionElement(o,a?i[0]:e[0],a?e[0]:i[0],l-o+1))}else{let a=r===o?e[0]:0,c=o===n?i[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(o,a,c));let _=l-o-1;if(h.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,_)),o!==l){let f=n===l?i[0]:this._bufferService.cols;h.appendChild(this._createSelectionElement(l,0,f))}}this._selectionContainer.appendChild(h)}_createSelectionElement(e,i,s,r=1){let n=this._document.createElement("div"),o=i*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(s-i);return o+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-o),n.style.height=`${r*this.dimensions.css.cell.height}px`,n.style.top=`${e*this.dimensions.css.cell.height}px`,n.style.left=`${o}px`,n.style.width=`${l}px`,n}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,i){let s=this._bufferService.buffer,r=s.ybase+s.y,n=Math.min(s.x,this._bufferService.cols-1),o=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,h=this._optionsService.rawOptions.cursorInactiveStyle;for(let a=e;a<=i;a++){let c=a+s.ydisp,_=this._rowElements[a],f=s.lines.get(c);if(!_||!f)break;_.replaceChildren(...this._rowFactory.createRow(f,c,c===r,l,h,n,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Hs}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,i,s,r,n,o){s<0&&(e=0),r<0&&(i=0);let l=this._bufferService.rows-1;s=Math.max(Math.min(s,l),0),r=Math.max(Math.min(r,l),0),n=Math.min(n,this._bufferService.cols);let h=this._bufferService.buffer,a=h.ybase+h.y,c=Math.min(h.x,n-1),_=this._optionsService.rawOptions.cursorBlink,f=this._optionsService.rawOptions.cursorStyle,d=this._optionsService.rawOptions.cursorInactiveStyle;for(let m=s;m<=r;++m){let y=m+h.ydisp,k=this._rowElements[m],R=h.lines.get(y);if(!k||!R)break;k.replaceChildren(...this._rowFactory.createRow(R,y,y===a,f,d,c,_,this.dimensions.css.cell.width,this._widthCache,o?m===s?e:0:-1,o?(m===r?i:n)-1:-1))}}};Nr=ue([P(7,fn),P(8,Ds),P(9,je),P(10,Ve),P(11,li),P(12,$t),P(13,bi)],Nr);var Wr=class extends j{constructor(e,i,s){super(),this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=this._register(new A),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new $c(this._optionsService))}catch{this._measureStrategy=this._register(new Pc(e,i,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Wr=ue([P(2,je)],Wr);var $a=class extends j{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,e){t!==void 0&&t>0&&e!==void 0&&e>0&&(this._result.width=t,this._result.height=e)}},Pc=class extends $a{constructor(t,e,i){super(),this._document=t,this._parentElement=e,this._optionsService=i,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},$c=class extends $a{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let i=this._ctx.measureText("W");if(!("width"in i&&"fontBoundingBoxAscent"in i&&"fontBoundingBoxDescent"in i))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},Ic=class extends j{constructor(e,i,s){super(),this._textarea=e,this._window=i,this.mainDocument=s,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new Oc(this._window)),this._onDprChange=this._register(new A),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new A),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(r=>this._screenDprMonitor.setWindow(r))),this._register(Fe.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(H(this._textarea,"focus",()=>this._isFocused=!0)),this._register(H(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},Oc=class extends j{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Si),this._onDprChange=this._register(new A),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(re(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=H(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},Fc=class extends j{constructor(){super(),this.linkProviders=[],this._register(re(()=>this.linkProviders.length=0))}registerLinkProvider(t){return this.linkProviders.push(t),{dispose:()=>{let e=this.linkProviders.indexOf(t);e!==-1&&this.linkProviders.splice(e,1)}}}};function yn(t,e,i){let s=i.getBoundingClientRect(),r=t.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),o=parseInt(r.getPropertyValue("padding-top"));return[e.clientX-s.left-n,e.clientY-s.top-o]}function Nc(t,e,i,s,r,n,o,l,h){if(!n)return;let a=yn(t,e,i);if(a)return a[0]=Math.ceil((a[0]+(h?o/2:0))/o),a[1]=Math.ceil(a[1]/l),a[0]=Math.min(Math.max(a[0],1),s+(h?1:0)),a[1]=Math.min(Math.max(a[1],1),r),a}var zr=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,s,r,n){return Nc(window,e,i,s,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,n)}getMouseReportCoords(e,i){let s=yn(window,e,i);if(this._charSizeService.hasValidSize)return s[0]=Math.min(Math.max(s[0],0),this._renderService.dimensions.css.canvas.width-1),s[1]=Math.min(Math.max(s[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(s[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(s[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(s[0]),y:Math.floor(s[1])}}};zr=ue([P(0,It),P(1,Ds)],zr);var Wc=class{constructor(e,i){this._renderCallback=e,this._coreBrowserService=i,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,i,s){this._rowCount=s,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},Ia={};Xl(Ia,{getSafariVersion:()=>Hc,isChromeOS:()=>Wa,isFirefox:()=>Oa,isIpad:()=>Uc,isIphone:()=>qc,isLegacyEdge:()=>zc,isLinux:()=>Cn,isMac:()=>xs,isNode:()=>As,isSafari:()=>Fa,isWindows:()=>Na});var As=typeof process<"u"&&"title"in process,Yi=As?"node":navigator.userAgent,Xi=As?"node":navigator.platform,Oa=Yi.includes("Firefox"),zc=Yi.includes("Edge"),Fa=/^((?!chrome|android).)*safari/i.test(Yi);function Hc(){if(!Fa)return 0;let t=Yi.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}var xs=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Xi),Uc=Xi==="iPad",qc=Xi==="iPhone",Na=["Windows","Win16","Win32","WinCE"].includes(Xi),Cn=Xi.indexOf("Linux")>=0,Wa=/\bCrOS\b/.test(Yi),za=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),this._start()}flush(){for(;this._ir){s-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-e))}ms`),this._start();return}s=r}this.clear()}},Kc=class extends za{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let i=performance.now()+e;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},Vc=class extends za{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},ks=!As&&"requestIdleCallback"in window?Vc:Kc,jc=class{constructor(){this._queue=new ks}set(t){this._queue.clear(),this._queue.enqueue(t)}flush(){this._queue.flush()}},Hr=class extends j{constructor(e,i,s,r,n,o,l,h,a){super(),this._rowCount=e,this._optionsService=s,this._charSizeService=r,this._coreService=n,this._coreBrowserService=h,this._renderer=this._register(new Si),this._pausedResizeTask=new jc,this._observerDisposable=this._register(new Si),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new A),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new A),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new A),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new A),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new Wc((c,_)=>this._renderRows(c,_),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new Gc(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(re(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(o.onDecorationRegistered(()=>this._fullRefresh())),this._register(o.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(l.cols,l.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(l.buffer.y,l.buffer.y,!0))),this._register(a.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,i),this._register(this._coreBrowserService.onWindowChange(c=>this._registerIntersectionObserver(c,i)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){let s=new e.IntersectionObserver(r=>this._handleIntersectionChange(r[r.length-1]),{threshold:0});s.observe(i),this._observerDisposable.value=re(()=>s.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,i,s=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),i=Math.max(i,r.end)),s||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount)}_renderRows(e,i){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0}}resize(e,i){this._rowCount=i,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(i=>this.refreshRows(i.start,i.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,i)):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,i,s){this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=s,this._renderer.value?.handleSelectionChanged(e,i,s)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};Hr=ue([P(2,je),P(3,Ds),P(4,li),P(5,Gi),P(6,Ve),P(7,$t),P(8,bi)],Hr);var Gc=class{constructor(t,e,i){this._coreBrowserService=t,this._coreService=e,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(t,e){this._isBuffering?(this._start=Math.min(this._start,t),this._end=Math.max(this._end,e)):(this._start=t,this._end=e,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let t={start:this._start,end:this._end};return this._isBuffering=!1,t}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function Yc(t,e,i,s){let r=i.buffer.x,n=i.buffer.y;if(!i.buffer.hasScrollback)return Zc(r,n,t,e,i,s)+Ps(n,e,i,s)+Qc(r,n,t,e,i,s);let o;if(n===e)return o=r>t?"D":"C",qi(Math.abs(r-t),Ui(o,s));o=n>e?"D":"C";let l=Math.abs(n-e),h=Jc(n>e?t:r,i)+(l-1)*i.cols+1+Xc(n>e?r:t);return qi(h,Ui(o,s))}function Xc(t,e){return t-1}function Jc(t,e){return e.cols-t}function Zc(t,e,i,s,r,n){return Ps(e,s,r,n).length===0?"":qi(Ua(t,e,t,e-ai(e,r),!1,r).length,Ui("D",n))}function Ps(t,e,i,s){let r=t-ai(t,i),n=e-ai(e,i),o=Math.abs(r-n)-ed(t,e,i);return qi(o,Ui(Ha(t,e),s))}function Qc(t,e,i,s,r,n){let o;Ps(e,s,r,n).length>0?o=s-ai(s,r):o=e;let l=s,h=td(t,e,i,s,r,n);return qi(Ua(t,o,i,l,h==="C",r).length,Ui(h,n))}function ed(t,e,i){let s=0,r=t-ai(t,i),n=e-ai(e,i);for(let o=0;o=0&&t0?o=s-ai(s,r):o=e,t=i&&oe?"A":"B"}function Ua(t,e,i,s,r,n){let o=t,l=e,h="";for(;(o!==i||l!==s)&&l>=0&&ln.cols-1?(h+=n.buffer.translateBufferLineToString(l,!1,t,o),o=0,t=0,l++):!r&&o<0&&(h+=n.buffer.translateBufferLineToString(l,!1,0,t+1),o=n.cols-1,t=o,l--);return h+n.buffer.translateBufferLineToString(l,!1,t,o)}function Ui(t,e){let i=e?"O":"[";return E.ESC+i+t}function qi(t,e){t=Math.floor(t);let i="";for(let s=0;sthis._bufferService.cols?t%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let t=this.selectionStart,e=this.selectionEnd;return!t||!e?!1:t[1]>e[1]||t[1]===e[1]&&t[0]>e[0]}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function to(t,e){if(t.start.y>t.end.y)throw new Error(`Buffer range end (${t.end.x}, ${t.end.y}) cannot be before start (${t.start.x}, ${t.start.y})`);return e*(t.end.y-t.start.y)+(t.end.x-t.start.x+1)}var Us=50,sd=15,rd=50,nd=500,od=" ",ad=new RegExp(od,"g"),Ur=class extends j{constructor(e,i,s,r,n,o,l,h,a){super(),this._element=e,this._screenElement=i,this._linkifier=s,this._bufferService=r,this._coreService=n,this._mouseService=o,this._optionsService=l,this._renderService=h,this._coreBrowserService=a,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new ct,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new A),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new A),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new A),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new A),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=c=>this._handleMouseMove(c),this._mouseUpListener=c=>this._handleMouseUp(c),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(c=>this._handleTrim(c)),this._register(this._bufferService.buffers.onBufferActivate(c=>this._handleBufferActivate(c))),this.enable(),this._model=new id(this._bufferService),this._activeSelectionMode=0,this._register(re(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(c=>{c.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!e||!i?!1:e[0]!==i[0]||e[1]!==i[1]}get selectionText(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;if(!e||!i)return"";let s=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===i[0])return"";let n=e[0]n.replace(ad," ")).join(Na?`\r -`:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Cn&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let i=this._getMouseBufferCoords(e),s=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!s||!r||!i?!1:this._areCoordsInSelection(i,s,r)}isCellInSelection(e,i){let s=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!s||!r?!1:this._areCoordsInSelection([e,i],s,r)}_areCoordsInSelection(e,i,s){return e[1]>i[1]&&e[1]=i[0]&&e[0]=i[0]}_selectWordAtCursor(e,i){let s=this._linkifier.currentLink?.link?.range;if(s)return this._model.selectionStart=[s.start.x-1,s.start.y-1],this._model.selectionStartLength=to(s,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,i),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=yn(this._coreBrowserService.window,e,this._screenElement)[1],s=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=s?0:(i>s&&(i-=s),i=Math.min(Math.max(i,-Us),Us),i/=Us,i/Math.abs(i)+Math.round(i*(sd-1)))}shouldForceSelection(e){return xs?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),rd)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&i.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(xs&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let s=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&ithis._handleTrim(i))}_convertViewportColToCharacterIndex(e,i){let s=i;for(let r=0;i>=r;r++){let n=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?s--:n>1&&i!==r&&(s+=n-1)}return s}setSelection(e,i,s){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=s,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,s=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let n=this._bufferService.buffer,o=n.lines.get(e[1]);if(!o)return;let l=n.translateBufferLineToString(e[1],!1),h=this._convertViewportColToCharacterIndex(o,e[0]),a=h,c=e[0]-h,_=0,f=0,d=0,m=0;if(l.charAt(h)===" "){for(;h>0&&l.charAt(h-1)===" ";)h--;for(;a1&&(m+=T-1,a+=T-1);R>0&&h>0&&!this._isCharWordSeparator(o.loadCell(R-1,this._workCell));){o.loadCell(R-1,this._workCell);let S=this._workCell.getChars().length;this._workCell.getWidth()===0?(_++,R--):S>1&&(d+=S-1,h-=S-1),h--,R--}for(;D1&&(m+=S-1,a+=S-1),a++,D++}}a++;let y=h+c-_+d,k=Math.min(this._bufferService.cols,a-h+_+f-d-m);if(!(!i&&l.slice(h,a).trim()==="")){if(s&&y===0&&o.getCodePoint(0)!==32){let R=n.lines.get(e[1]-1);if(R&&o.isWrapped&&R.getCodePoint(this._bufferService.cols-1)!==32){let D=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(D){let T=this._bufferService.cols-D.start;y-=T,k+=T}}}if(r&&y+k===this._bufferService.cols&&o.getCodePoint(this._bufferService.cols-1)!==32){let R=n.lines.get(e[1]+1);if(R?.isWrapped&&R.getCodePoint(0)!==32){let D=this._getWordAt([0,e[1]+1],!1,!1,!0);D&&(k+=D.length)}}return{start:y,length:k}}}_selectWordAt(e,i){let s=this._getWordAt(e,i);if(s){for(;s.start<0;)s.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[s.start,e[1]],this._model.selectionStartLength=s.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let s=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,s--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,s++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,s]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),s={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=to(s,this._bufferService.cols)}};Ur=ue([P(3,Ve),P(4,li),P(5,gn),P(6,je),P(7,It),P(8,$t)],Ur);var io=class{constructor(){this._data={}}set(e,i,s){this._data[e]||(this._data[e]={}),this._data[e][i]=s}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},so=class{constructor(){this._color=new io,this._css=new io}setCss(e,i,s){this._css.set(e,i,s)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,s){this._color.set(e,i,s)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},ye=Object.freeze((()=>{let t=[ae.toColor("#2e3436"),ae.toColor("#cc0000"),ae.toColor("#4e9a06"),ae.toColor("#c4a000"),ae.toColor("#3465a4"),ae.toColor("#75507b"),ae.toColor("#06989a"),ae.toColor("#d3d7cf"),ae.toColor("#555753"),ae.toColor("#ef2929"),ae.toColor("#8ae234"),ae.toColor("#fce94f"),ae.toColor("#729fcf"),ae.toColor("#ad7fa8"),ae.toColor("#34e2e2"),ae.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let i=0;i<216;i++){let s=e[i/36%6|0],r=e[i/6%6|0],n=e[i%6];t.push({css:Se.toCss(s,r,n),rgba:Se.toRgba(s,r,n)})}for(let i=0;i<24;i++){let s=8+i*10;t.push({css:Se.toCss(s,s,s),rgba:Se.toRgba(s,s,s)})}return t})()),Zt=ae.toColor("#ffffff"),Ii=ae.toColor("#000000"),ro=ae.toColor("#ffffff"),no=Ii,Bi={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},ld=Zt,qr=class extends j{constructor(e){super(),this._optionsService=e,this._contrastCache=new so,this._halfContrastCache=new so,this._onChangeColors=this._register(new A),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Zt,background:Ii,cursor:ro,cursorAccent:no,selectionForeground:void 0,selectionBackgroundTransparent:Bi,selectionBackgroundOpaque:ie.blend(Ii,Bi),selectionInactiveBackgroundTransparent:Bi,selectionInactiveBackgroundOpaque:ie.blend(Ii,Bi),scrollbarSliderBackground:ie.opacity(Zt,.2),scrollbarSliderHoverBackground:ie.opacity(Zt,.4),scrollbarSliderActiveBackground:ie.opacity(Zt,.5),overviewRulerBorder:Zt,ansi:ye.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let i=this._colors;if(i.foreground=Q(e.foreground,Zt),i.background=Q(e.background,Ii),i.cursor=ie.blend(i.background,Q(e.cursor,ro)),i.cursorAccent=ie.blend(i.background,Q(e.cursorAccent,no)),i.selectionBackgroundTransparent=Q(e.selectionBackground,Bi),i.selectionBackgroundOpaque=ie.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=Q(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=ie.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?Q(e.selectionForeground,Zn):void 0,i.selectionForeground===Zn&&(i.selectionForeground=void 0),ie.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=ie.opacity(i.selectionBackgroundTransparent,.3)),ie.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=ie.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=Q(e.scrollbarSliderBackground,ie.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=Q(e.scrollbarSliderHoverBackground,ie.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=Q(e.scrollbarSliderActiveBackground,ie.opacity(i.foreground,.5)),i.overviewRulerBorder=Q(e.overviewRulerBorder,ld),i.ansi=ye.slice(),i.ansi[0]=Q(e.black,ye[0]),i.ansi[1]=Q(e.red,ye[1]),i.ansi[2]=Q(e.green,ye[2]),i.ansi[3]=Q(e.yellow,ye[3]),i.ansi[4]=Q(e.blue,ye[4]),i.ansi[5]=Q(e.magenta,ye[5]),i.ansi[6]=Q(e.cyan,ye[6]),i.ansi[7]=Q(e.white,ye[7]),i.ansi[8]=Q(e.brightBlack,ye[8]),i.ansi[9]=Q(e.brightRed,ye[9]),i.ansi[10]=Q(e.brightGreen,ye[10]),i.ansi[11]=Q(e.brightYellow,ye[11]),i.ansi[12]=Q(e.brightBlue,ye[12]),i.ansi[13]=Q(e.brightMagenta,ye[13]),i.ansi[14]=Q(e.brightCyan,ye[14]),i.ansi[15]=Q(e.brightWhite,ye[15]),e.extendedAnsi){let s=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let r=0;rn.index-o.index),s=[];for(let n of i){let o=this._services.get(n.id);if(!o)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${n.id._id}.`);s.push(o)}let r=i.length>0?i[0].index:e.length;if(e.length!==r)throw new Error(`[createInstance] First service dependency of ${t.name} at position ${r+1} conflicts with ${e.length} static arguments`);return new t(...e,...s)}},dd={trace:0,debug:1,info:2,warn:3,error:4,off:5},ud="xterm.js: ",Kr=class extends j{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=dd[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;ithis._length)for(let i=this._length;i=e;r--)this._array[this._getCyclicIndex(r+s.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;rthis._maxLength){let r=this._length+s.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=s.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,s){if(!(i<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+s<0)throw new Error("Cannot shift elements in list beyond index 0");if(s>0){for(let n=i-1;n>=0;n--)this.set(e+n+s,this.get(e+n));let r=e+i+s-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r>22,i&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):s]}set(e,i){this._data[e*V+1]=i[0],i[1].length>1?(this._combined[e]=i[1],this._data[e*V+0]=e|2097152|i[2]<<22):this._data[e*V+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(e){return this._data[e*V+0]>>22}hasWidth(e){return this._data[e*V+0]&12582912}getFg(e){return this._data[e*V+1]}getBg(e){return this._data[e*V+2]}hasContent(e){return this._data[e*V+0]&4194303}getCodePoint(e){let i=this._data[e*V+0];return i&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):i&2097151}isCombined(e){return this._data[e*V+0]&2097152}getString(e){let i=this._data[e*V+0];return i&2097152?this._combined[e]:i&2097151?Kt(i&2097151):""}isProtected(e){return this._data[e*V+2]&536870912}loadCell(e,i){return ss=e*V,i.content=this._data[ss+0],i.fg=this._data[ss+1],i.bg=this._data[ss+2],i.content&2097152&&(i.combinedData=this._combined[e]),i.bg&268435456&&(i.extended=this._extendedAttrs[e]),i}setCell(e,i){i.content&2097152&&(this._combined[e]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[e]=i.extended),this._data[e*V+0]=i.content,this._data[e*V+1]=i.fg,this._data[e*V+2]=i.bg}setCellFromCodepoint(e,i,s,r){r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*V+0]=i|s<<22,this._data[e*V+1]=r.fg,this._data[e*V+2]=r.bg}addCodepointToCell(e,i,s){let r=this._data[e*V+0];r&2097152?this._combined[e]+=Kt(i):r&2097151?(this._combined[e]=Kt(r&2097151)+Kt(i),r&=-2097152,r|=2097152):r=i|1<<22,s&&(r&=-12582913,r|=s<<22),this._data[e*V+0]=r}insertCells(e,i,s){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,s),i=0;--n)this.setCell(e+i+n,this.loadCell(e+n,r));for(let n=0;nthis.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let r=new Uint32Array(s);r.set(this._data),this._data=r}for(let r=this.length;r=e&&delete this._combined[l]}let n=Object.keys(this._extendedAttrs);for(let o=0;o=e&&delete this._extendedAttrs[l]}}return this.length=e,s*4*qs=0;--e)if(this._data[e*V+0]&4194303)return e+(this._data[e*V+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*V+0]&4194303||this._data[e*V+2]&50331648)return e+(this._data[e*V+0]>>22);return 0}copyCellsFrom(e,i,s,r,n){let o=e._data;if(n)for(let h=r-1;h>=0;h--){for(let a=0;a=i&&(this._combined[a-i+s]=e._combined[a])}}translateToString(e,i,s,r){i=i??0,s=s??this.length,e&&(s=Math.min(s,this.getTrimmedLength())),r&&(r.length=0);let n="";for(;i>22||1}return r&&r.push(i),n}};function _d(t,e,i,s,r,n){let o=[];for(let l=0;l=l&&s0&&(k>_||c[k].getTrimmedLength()===0);k--)y++;y>0&&(o.push(l+c.length-y),o.push(y)),l+=c.length-1}return o}function fd(t,e){let i=[],s=0,r=e[s],n=0;for(let o=0;oKi(t,a,e)).reduce((h,a)=>h+a),n=0,o=0,l=0;for(;lh&&(n-=h,o++);let a=t[o].getWidth(n-1)===2;a&&n--;let c=a?i-1:i;s.push(c),l+=c}return s}function Ki(t,e,i){if(e===t.length-1)return t[e].getTrimmedLength();let s=!t[e].hasContent(i-1)&&t[e].getWidth(i-1)===1,r=t[e+1].getWidth(0)===2;return s&&r?i-1:i}var Ka=class Va{constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=Va._nextId++,this._onDispose=this.register(new A),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),oi(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};Ka._nextId=1;var vd=Ka,ke={},Qt=ke.B;ke[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};ke.A={"#":"£"};ke.B=void 0;ke[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};ke.C=ke[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ke.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};ke.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};ke.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};ke.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};ke.E=ke[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};ke.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};ke.H=ke[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};ke["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var ao=4294967295,lo=class{constructor(t,e,i){this._hasScrollback=t,this._optionsService=e,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=me.clone(),this.savedCharset=Qt,this.markers=[],this._nullCell=ct.fromCharData([0,ha,1,0]),this._whitespaceCell=ct.fromCharData([0,Vt,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new ks,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new oo(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new bs),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new bs),this._whitespaceCell}getBlankLine(t,e){return new Oi(this._bufferService.cols,this.getNullCell(t),e)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let t=this.ybase+this.y-this.ydisp;return t>=0&&tao?ao:e}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=me);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new oo(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,e){let i=this.getNullCell(me),s=0,r=this._getCorrectBufferLength(e);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new Oi(t,i)));else for(let o=this._rows;o>e;o--)this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=r}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,e-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=e-1,this._isReflowEnabled&&(this._reflow(t,e),this._cols>t))for(let n=0;n.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let e=0;for(;this._memoryCleanupPosition100)return!0;return t}get _isReflowEnabled(){let t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,e){this._cols!==t&&(t>this._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))}_reflowLarger(t,e){let i=this._optionsService.rawOptions.reflowCursorLine,s=_d(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(me),i);if(s.length>0){let r=fd(this.lines,s);gd(this.lines,r.layout),this._reflowLargerAdjustViewport(t,e,r.countRemoved)}}_reflowLargerAdjustViewport(t,e,i){let s=this.getNullCell(me),r=i;for(;r-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;o--){let l=this.lines.get(o);if(!l||!l.isWrapped&&l.getTrimmedLength()<=t)continue;let h=[l];for(;l.isWrapped&&o>0;)l=this.lines.get(--o),h.unshift(l);if(!i){let T=this.ybase+this.y;if(T>=o&&T0&&(r.push({start:o+h.length+n,newLines:d}),n+=d.length),h.push(...d);let m=c.length-1,y=c[m];y===0&&(m--,y=c[m]);let k=h.length-_-1,R=a;for(;k>=0;){let T=Math.min(R,y);if(h[m]===void 0)break;if(h[m].copyCellsFrom(h[k],R-T,y-T,T,!0),y-=T,y===0&&(m--,y=c[m]),R-=T,R===0){k--;let S=Math.max(k,0);R=Ki(h,S,this._cols)}}for(let T=0;T0;)this.ybase===0?this.y0){let o=[],l=[];for(let y=0;y=0;y--)if(_&&_.start>a+f){for(let k=_.newLines.length-1;k>=0;k--)this.lines.set(y--,_.newLines[k]);y++,o.push({index:a+1,amount:_.newLines.length}),f+=_.newLines.length,_=r[++c]}else this.lines.set(y,l[a--]);let d=0;for(let y=o.length-1;y>=0;y--)o[y].index+=d,this.lines.onInsertEmitter.fire(o[y]),d+=o[y].amount;let m=Math.max(0,h+n-this.lines.maxLength);m>0&&this.lines.onTrimEmitter.fire(m)}}translateBufferLineToString(t,e,i=0,s){let r=this.lines.get(t);return r?r.translateToString(e,i,s):""}getWrappedRangeForLine(t){let e=t,i=t;for(;e>0&&this.lines.get(e).isWrapped;)e--;for(;i+10;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let e=0;e{e.line-=i,e.line<0&&e.dispose()})),e.register(this.lines.onInsert(i=>{e.line>=i.index&&(e.line+=i.amount)})),e.register(this.lines.onDelete(i=>{e.line>=i.index&&e.linei.index&&(e.line-=i.amount)})),e.register(e.onDispose(()=>this._removeMarker(e))),e}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}},md=class extends j{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new A),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new lo(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new lo(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},ja=2,Ga=1,Vr=class extends j{constructor(t){super(),this.isUserScrolling=!1,this._onResize=this._register(new A),this.onResize=this._onResize.event,this._onScroll=this._register(new A),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,ja),this.rows=Math.max(t.rawOptions.rows||0,Ga),this.buffers=this._register(new md(t,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(t,e){let i=this.cols!==t,s=this.rows!==e;this.cols=t,this.rows=e,this.buffers.resize(t,e),this._onResize.fire({cols:t,rows:e,colsChanged:i,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,e=!1){let i=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==t.fg||s.getBg(0)!==t.bg)&&(s=i.getBlankLine(t,e),this._cachedBlankLine=s),s.isWrapped=e;let r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(i.scrollTop===0){let o=i.lines.isFull;n===i.lines.length-1?o?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),o?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let o=n-r+1;i.lines.shiftElements(r+1,o-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(t,e){let i=this.buffer;if(t<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else t+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let s=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+t,i.ybase),0),s!==i.ydisp&&(e||this._onScroll.fire(i.ydisp))}};Vr=ue([P(0,je)],Vr);var di={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:xs,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},wd=["normal","bold","100","200","300","400","500","600","700","800","900"],Sd=class extends j{constructor(e){super(),this._onOptionChange=this._register(new A),this.onOptionChange=this._onOptionChange.event;let i={...di};for(let s in e)if(s in i)try{let r=e[s];i[s]=this._sanitizeAndValidateOption(s,r)}catch(r){console.error(r)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(re(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(s=>{s===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(s=>{e.indexOf(s)!==-1&&i()})}_setupOptions(){let e=s=>{if(!(s in di))throw new Error(`No option with key "${s}"`);return this.rawOptions[s]},i=(s,r)=>{if(!(s in di))throw new Error(`No option with key "${s}"`);r=this._sanitizeAndValidateOption(s,r),this.rawOptions[s]!==r&&(this.rawOptions[s]=r,this._onOptionChange.fire(s))};for(let s in this.rawOptions){let r={get:e.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this.options,s,r)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=di[e]),!bd(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=di[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=wd.includes(i)?i:di[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(i*10)/10));break;case"scrollback":if(i=Math.min(i,4294967295),i<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{};break}return i}};function bd(t){return t==="block"||t==="underline"||t==="bar"}function Fi(t,e=5){if(typeof t!="object")return t;let i=Array.isArray(t)?[]:{};for(let s in t)i[s]=e<=1?t[s]:t[s]&&Fi(t[s],e-1);return i}var ho=Object.freeze({insertMode:!1}),co=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),jr=class extends j{constructor(e,i,s){super(),this._bufferService=e,this._logService=i,this._optionsService=s,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new A),this.onData=this._onData.event,this._onUserInput=this._register(new A),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new A),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new A),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Fi(ho),this.decPrivateModes=Fi(co)}reset(){this.modes=Fi(ho),this.decPrivateModes=Fi(co)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let s=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&s.ybase!==s.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(r=>r.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};jr=ue([P(0,Ve),P(1,fa),P(2,je)],jr);var uo={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button===4||t.action!==1?!1:(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>!(t.action===32&&t.button===3)},ANY:{events:31,restrict:t=>!0}};function Ks(t,e){let i=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(i|=64,i|=t.action):(i|=t.button&3,t.button&4&&(i|=64),t.button&8&&(i|=128),t.action===32?i|=32:t.action===0&&!e&&(i|=3)),i}var Vs=String.fromCharCode,_o={DEFAULT:t=>{let e=[Ks(t,!1)+32,t.col+32,t.row+32];return e[0]>255||e[1]>255||e[2]>255?"":`\x1B[M${Vs(e[0])}${Vs(e[1])}${Vs(e[2])}`},SGR:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${Ks(t,!0)};${t.col};${t.row}${e}`},SGR_PIXELS:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${Ks(t,!0)};${t.x};${t.y}${e}`}},Gr=class extends j{constructor(t,e,i){super(),this._bufferService=t,this._coreService=e,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new A),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(uo))this.addProtocol(s,uo[s]);for(let s of Object.keys(_o))this.addEncoding(s,_o[s]);this.reset()}addProtocol(t,e){this._protocols[t]=e}addEncoding(t,e){this._encodings[t]=e}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(t,e,i){if(t.deltaY===0||t.shiftKey||e===void 0||i===void 0)return 0;let s=e/i,r=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=s+0,Math.abs(t.deltaY)<50&&(r*=.3),this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(t,e){return e.altKey||e.ctrlKey||e.shiftKey?t*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:t*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;let e=this._encodings[this._activeEncoding](t);return e&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(e):this._coreService.triggerDataEvent(e,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(t&1),up:!!(t&2),drag:!!(t&4),move:!!(t&8),wheel:!!(t&16)}}_equalEvents(t,e,i){if(i){if(t.x!==e.x||t.y!==e.y)return!1}else if(t.col!==e.col||t.row!==e.row)return!1;return!(t.button!==e.button||t.action!==e.action||t.ctrl!==e.ctrl||t.alt!==e.alt||t.shift!==e.shift)}};Gr=ue([P(0,Ve),P(1,li),P(2,je)],Gr);var js=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],yd=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Ce;function Cd(t,e){let i=0,s=e.length-1,r;if(te[s][1])return!1;for(;s>=i;)if(r=i+s>>1,t>e[r][1])i=r+1;else if(t=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,i){let s=this.wcwidth(e),r=s===0&&i!==0;if(r){let n=ei.extractWidth(i);n===0?r=!1:n>s&&(s=n)}return ei.createPropertyValue(0,s,r)}},ei=class fs{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new A,this.onChange=this._onChange.event;let e=new xd;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,i,s=!1){return(e&16777215)<<3|(i&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let i=0,s=0,r=e.length;for(let n=0;n=r)return i+this.wcwidth(o);let a=e.charCodeAt(n);56320<=a&&a<=57343?o=(o-55296)*1024+a-56320+65536:i+=this.wcwidth(a)}let l=this.charProperties(o,s),h=fs.extractWidth(l);fs.extractShouldJoin(l)&&(h-=fs.extractWidth(s)),i+=h,s=l}return i}charProperties(e,i){return this._activeProvider.charProperties(e,i)}},kd=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,i){this._charsets[e]=i,this.glevel===e&&(this.charset=i)}};function fo(t){let e=t.buffer.lines.get(t.buffer.ybase+t.buffer.y-1)?.get(t.cols-1),i=t.buffer.lines.get(t.buffer.ybase+t.buffer.y);i&&e&&(i.isWrapped=e[3]!==0&&e[3]!==32)}var Ei=2147483647,Ld=256,Ya=class Yr{constructor(e=32,i=32){if(this.maxLength=e,this.maxSubParamsLength=i,i>Ld)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(e){let i=new Yr;if(!e.length)return i;for(let s=Array.isArray(e[0])?1:0;s>8,r=this._subParamsIdx[i]&255;r-s>0&&e.push(Array.prototype.slice.call(this._subParams,s,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>Ei?Ei:e}addSubParam(e){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>Ei?Ei:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let i=this._subParamsIdx[e]>>8,s=this._subParamsIdx[e]&255;return s-i>0?this._subParams.subarray(i,s):null}getSubParamsAll(){let e={};for(let i=0;i>8,r=this._subParamsIdx[i]&255;r-s>0&&(e[i]=this._subParams.slice(s,r))}return e}addDigit(e){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,r=s[i-1];s[i-1]=~r?Math.min(r*10+e,Ei):e}},Mi=[],Bd=class{constructor(){this._state=0,this._active=Mi,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(i),{dispose:()=>{let r=s.indexOf(i);r!==-1&&s.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Mi}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Mi,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Mi,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,i,s){if(!this._active.length)this._handlerFb(this._id,"PUT",Ts(e,i,s));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,i,s)}start(){this.reset(),this._state=1}put(e,i,s){if(this._state!==3){if(this._state===1)for(;i0&&this._put(e,i,s)}}end(e,i=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let s=!1,r=this._active.length-1,n=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,s=i,n=this._stack.fallThrough,this._stack.paused=!1),!n&&s===!1){for(;r>=0&&(s=this._active[r].end(e),s!==!0);r--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,s;r--}for(;r>=0;r--)if(s=this._active[r].end(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,s}this._active=Mi,this._id=-1,this._state=0}}},Je=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,i,s){this._hitLimit||(this._data+=Ts(e,i,s),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data),i instanceof Promise))return i.then(s=>(this._data="",this._hitLimit=!1,s));return this._data="",this._hitLimit=!1,i}},Ri=[],Ed=class{constructor(){this._handlers=Object.create(null),this._active=Ri,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Ri}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let s=this._handlers[e];return s.push(i),{dispose:()=>{let r=s.indexOf(i);r!==-1&&s.splice(r,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Ri,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Ri,!this._active.length)this._handlerFb(this._ident,"HOOK",i);else for(let s=this._active.length-1;s>=0;s--)this._active[s].hook(i)}put(e,i,s){if(!this._active.length)this._handlerFb(this._ident,"PUT",Ts(e,i,s));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,i,s)}unhook(e,i=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let s=!1,r=this._active.length-1,n=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,s=i,n=this._stack.fallThrough,this._stack.paused=!1),!n&&s===!1){for(;r>=0&&(s=this._active[r].unhook(e),s!==!0);r--)if(s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,s;r--}for(;r>=0;r--)if(s=this._active[r].unhook(!1),s instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,s}this._active=Ri,this._ident=0}},Ni=new Ya;Ni.addParam(0);var go=class{constructor(t){this._handler=t,this._data="",this._params=Ni,this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():Ni,this._data="",this._hitLimit=!1}put(t,e,i){this._hitLimit||(this._data+=Ts(t,e,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data,this._params),e instanceof Promise))return e.then(i=>(this._params=Ni,this._data="",this._hitLimit=!1,i));return this._params=Ni,this._data="",this._hitLimit=!1,e}},Md=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,s,r){this.table[i<<8|e]=s<<4|r}addMany(e,i,s,r){for(let n=0;nh),i=(l,h)=>e.slice(l,h),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));let n=i(0,14),o;t.setDefault(1,0),t.addMany(s,0,2,0);for(o in n)t.addMany([24,26,153,154],o,3,0),t.addMany(i(128,144),o,3,0),t.addMany(i(144,152),o,3,0),t.add(156,o,0,0),t.add(27,o,11,1),t.add(157,o,4,8),t.addMany([152,158,159],o,0,7),t.add(155,o,11,3),t.add(144,o,11,9);return t.addMany(r,0,3,0),t.addMany(r,1,3,1),t.add(127,1,0,1),t.addMany(r,8,0,8),t.addMany(r,3,3,3),t.add(127,3,0,3),t.addMany(r,4,3,4),t.add(127,4,0,4),t.addMany(r,6,3,6),t.addMany(r,5,3,5),t.add(127,5,0,5),t.addMany(r,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(s,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(i(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(s,7,0,7),t.addMany(r,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(i(64,127),3,7,0),t.addMany(i(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(i(48,60),4,8,4),t.addMany(i(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(i(32,64),6,0,6),t.add(127,6,0,6),t.addMany(i(64,127),6,0,0),t.addMany(i(32,48),3,9,5),t.addMany(i(32,48),5,9,5),t.addMany(i(48,64),5,0,6),t.addMany(i(64,127),5,7,0),t.addMany(i(32,48),4,9,5),t.addMany(i(32,48),1,9,2),t.addMany(i(32,48),2,9,2),t.addMany(i(48,127),2,10,0),t.addMany(i(48,80),1,10,0),t.addMany(i(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(i(96,127),1,10,0),t.add(80,1,11,9),t.addMany(r,9,0,9),t.add(127,9,0,9),t.addMany(i(28,32),9,0,9),t.addMany(i(32,48),9,9,12),t.addMany(i(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(r,11,0,11),t.addMany(i(32,128),11,0,11),t.addMany(i(28,32),11,0,11),t.addMany(r,10,0,10),t.add(127,10,0,10),t.addMany(i(28,32),10,0,10),t.addMany(i(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(i(32,48),10,9,12),t.addMany(r,12,0,12),t.add(127,12,0,12),t.addMany(i(28,32),12,0,12),t.addMany(i(32,48),12,9,12),t.addMany(i(48,64),12,0,11),t.addMany(i(64,127),12,12,13),t.addMany(i(64,127),10,12,13),t.addMany(i(64,127),9,12,13),t.addMany(r,13,13,13),t.addMany(s,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(lt,0,2,0),t.add(lt,8,5,8),t.add(lt,6,0,6),t.add(lt,11,0,11),t.add(lt,13,13,13),t}(),Td=class extends j{constructor(e=Rd){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new Ya,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,s,r)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,s)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(re(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new Bd),this._dcsParser=this._register(new Ed),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let s=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(s=e.prefix.charCodeAt(0),s&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let n=0;no||o>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=o}}if(e.final.length!==1)throw new Error("final must be a single byte");let r=e.final.charCodeAt(0);if(i[0]>r||r>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return s<<=8,s|=r,s}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(e&255)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let s=this._identifier(e,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);let r=this._escHandlers[s];return r.push(i),{dispose:()=>{let n=r.indexOf(i);n!==-1&&r.splice(n,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let s=this._identifier(e);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);let r=this._csiHandlers[s];return r.push(i),{dispose:()=>{let n=r.indexOf(i);n!==-1&&r.splice(n,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,i,s,r,n){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=s,this._parseStack.transition=r,this._parseStack.chunkPos=n}parse(e,i,s){let r=0,n=0,o=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let h=this._parseStack.handlers,a=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&a>-1){for(;a>=0&&(l=h[a](this._params),l!==!0);a--)if(l instanceof Promise)return this._parseStack.handlerPos=a,l}this._parseStack.handlers=[];break;case 4:if(s===!1&&a>-1){for(;a>=0&&(l=h[a](),l!==!0);a--)if(l instanceof Promise)return this._parseStack.handlerPos=a,l}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(r!==24&&r!==26,s),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],l=this._oscParser.end(r!==24&&r!==26,s),l)return l;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let h=o;h>4){case 2:for(let d=h+1;;++d){if(d>=i||(r=e[d])<32||r>126&&r=i||(r=e[d])<32||r>126&&r=i||(r=e[d])<32||r>126&&r=i||(r=e[d])<32||r>126&&r=0&&(l=a[c](this._params),l!==!0);c--)if(l instanceof Promise)return this._preserveStack(3,a,c,n,h),l;c<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++h47&&r<60);h--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let _=this._escHandlers[this._collect<<8|r],f=_?_.length-1:-1;for(;f>=0&&(l=_[f](),l!==!0);f--)if(l instanceof Promise)return this._preserveStack(4,_,f,n,h),l;f<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let d=h+1;;++d)if(d>=i||(r=e[d])===24||r===26||r===27||r>127&&r=i||(r=e[d])<32||r>127&&r>4:n>>8}return s}}function Gs(t,e){let i=t.toString(16),s=i.length<2?"0"+i:i;switch(e){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function Pd(t,e=16){let[i,s,r]=t;return`rgb:${Gs(i,e)}/${Gs(s,e)}/${Gs(r,e)}`}var $d={"(":0,")":1,"*":2,"+":3,"-":1,".":2},Nt=131072,vo=10;function mo(t,e){if(t>24)return e.setWinLines||!1;switch(t){case 1:return!!e.restoreWin;case 2:return!!e.minimizeWin;case 3:return!!e.setWinPosition;case 4:return!!e.setWinSizePixels;case 5:return!!e.raiseWin;case 6:return!!e.lowerWin;case 7:return!!e.refreshWin;case 8:return!!e.setWinSizeChars;case 9:return!!e.maximizeWin;case 10:return!!e.fullscreenWin;case 11:return!!e.getWinState;case 13:return!!e.getWinPosition;case 14:return!!e.getWinSizePixels;case 15:return!!e.getScreenSizePixels;case 16:return!!e.getCellSizePixels;case 18:return!!e.getWinSizeChars;case 19:return!!e.getScreenSizeChars;case 20:return!!e.getIconTitle;case 21:return!!e.getWinTitle;case 22:return!!e.pushTitle;case 23:return!!e.popTitle;case 24:return!!e.setWinLines}return!1}var wo=5e3,So=0,Id=class extends j{constructor(t,e,i,s,r,n,o,l,h=new Td){super(),this._bufferService=t,this._charsetService=e,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=n,this._coreMouseService=o,this._unicodeService=l,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new th,this._utf8Decoder=new ih,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=me.clone(),this._eraseAttrDataInternal=me.clone(),this._onRequestBell=this._register(new A),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new A),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new A),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new A),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new A),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new A),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new A),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new A),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new A),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new A),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new A),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new A),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new A),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Xr(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(a=>this._activeBuffer=a.activeBuffer)),this._parser.setCsiHandlerFallback((a,c)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(a),params:c.toArray()})}),this._parser.setEscHandlerFallback(a=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(a)})}),this._parser.setExecuteHandlerFallback(a=>{this._logService.debug("Unknown EXECUTE code: ",{code:a})}),this._parser.setOscHandlerFallback((a,c,_)=>{this._logService.debug("Unknown OSC code: ",{identifier:a,action:c,data:_})}),this._parser.setDcsHandlerFallback((a,c,_)=>{c==="HOOK"&&(_=_.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(a),action:c,payload:_})}),this._parser.setPrintHandler((a,c,_)=>this.print(a,c,_)),this._parser.registerCsiHandler({final:"@"},a=>this.insertChars(a)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},a=>this.scrollLeft(a)),this._parser.registerCsiHandler({final:"A"},a=>this.cursorUp(a)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},a=>this.scrollRight(a)),this._parser.registerCsiHandler({final:"B"},a=>this.cursorDown(a)),this._parser.registerCsiHandler({final:"C"},a=>this.cursorForward(a)),this._parser.registerCsiHandler({final:"D"},a=>this.cursorBackward(a)),this._parser.registerCsiHandler({final:"E"},a=>this.cursorNextLine(a)),this._parser.registerCsiHandler({final:"F"},a=>this.cursorPrecedingLine(a)),this._parser.registerCsiHandler({final:"G"},a=>this.cursorCharAbsolute(a)),this._parser.registerCsiHandler({final:"H"},a=>this.cursorPosition(a)),this._parser.registerCsiHandler({final:"I"},a=>this.cursorForwardTab(a)),this._parser.registerCsiHandler({final:"J"},a=>this.eraseInDisplay(a,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},a=>this.eraseInDisplay(a,!0)),this._parser.registerCsiHandler({final:"K"},a=>this.eraseInLine(a,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},a=>this.eraseInLine(a,!0)),this._parser.registerCsiHandler({final:"L"},a=>this.insertLines(a)),this._parser.registerCsiHandler({final:"M"},a=>this.deleteLines(a)),this._parser.registerCsiHandler({final:"P"},a=>this.deleteChars(a)),this._parser.registerCsiHandler({final:"S"},a=>this.scrollUp(a)),this._parser.registerCsiHandler({final:"T"},a=>this.scrollDown(a)),this._parser.registerCsiHandler({final:"X"},a=>this.eraseChars(a)),this._parser.registerCsiHandler({final:"Z"},a=>this.cursorBackwardTab(a)),this._parser.registerCsiHandler({final:"`"},a=>this.charPosAbsolute(a)),this._parser.registerCsiHandler({final:"a"},a=>this.hPositionRelative(a)),this._parser.registerCsiHandler({final:"b"},a=>this.repeatPrecedingCharacter(a)),this._parser.registerCsiHandler({final:"c"},a=>this.sendDeviceAttributesPrimary(a)),this._parser.registerCsiHandler({prefix:">",final:"c"},a=>this.sendDeviceAttributesSecondary(a)),this._parser.registerCsiHandler({final:"d"},a=>this.linePosAbsolute(a)),this._parser.registerCsiHandler({final:"e"},a=>this.vPositionRelative(a)),this._parser.registerCsiHandler({final:"f"},a=>this.hVPosition(a)),this._parser.registerCsiHandler({final:"g"},a=>this.tabClear(a)),this._parser.registerCsiHandler({final:"h"},a=>this.setMode(a)),this._parser.registerCsiHandler({prefix:"?",final:"h"},a=>this.setModePrivate(a)),this._parser.registerCsiHandler({final:"l"},a=>this.resetMode(a)),this._parser.registerCsiHandler({prefix:"?",final:"l"},a=>this.resetModePrivate(a)),this._parser.registerCsiHandler({final:"m"},a=>this.charAttributes(a)),this._parser.registerCsiHandler({final:"n"},a=>this.deviceStatus(a)),this._parser.registerCsiHandler({prefix:"?",final:"n"},a=>this.deviceStatusPrivate(a)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},a=>this.softReset(a)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},a=>this.setCursorStyle(a)),this._parser.registerCsiHandler({final:"r"},a=>this.setScrollRegion(a)),this._parser.registerCsiHandler({final:"s"},a=>this.saveCursor(a)),this._parser.registerCsiHandler({final:"t"},a=>this.windowOptions(a)),this._parser.registerCsiHandler({final:"u"},a=>this.restoreCursor(a)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},a=>this.insertColumns(a)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},a=>this.deleteColumns(a)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},a=>this.selectProtected(a)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},a=>this.requestMode(a,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},a=>this.requestMode(a,!1)),this._parser.setExecuteHandler(E.BEL,()=>this.bell()),this._parser.setExecuteHandler(E.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(E.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(E.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(E.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(E.BS,()=>this.backspace()),this._parser.setExecuteHandler(E.HT,()=>this.tab()),this._parser.setExecuteHandler(E.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(E.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(us.IND,()=>this.index()),this._parser.setExecuteHandler(us.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(us.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Je(a=>(this.setTitle(a),this.setIconName(a),!0))),this._parser.registerOscHandler(1,new Je(a=>this.setIconName(a))),this._parser.registerOscHandler(2,new Je(a=>this.setTitle(a))),this._parser.registerOscHandler(4,new Je(a=>this.setOrReportIndexedColor(a))),this._parser.registerOscHandler(8,new Je(a=>this.setHyperlink(a))),this._parser.registerOscHandler(10,new Je(a=>this.setOrReportFgColor(a))),this._parser.registerOscHandler(11,new Je(a=>this.setOrReportBgColor(a))),this._parser.registerOscHandler(12,new Je(a=>this.setOrReportCursorColor(a))),this._parser.registerOscHandler(104,new Je(a=>this.restoreIndexedColor(a))),this._parser.registerOscHandler(110,new Je(a=>this.restoreFgColor(a))),this._parser.registerOscHandler(111,new Je(a=>this.restoreBgColor(a))),this._parser.registerOscHandler(112,new Je(a=>this.restoreCursorColor(a))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let a in ke)this._parser.registerEscHandler({intermediates:"(",final:a},()=>this.selectCharset("("+a)),this._parser.registerEscHandler({intermediates:")",final:a},()=>this.selectCharset(")"+a)),this._parser.registerEscHandler({intermediates:"*",final:a},()=>this.selectCharset("*"+a)),this._parser.registerEscHandler({intermediates:"+",final:a},()=>this.selectCharset("+"+a)),this._parser.registerEscHandler({intermediates:"-",final:a},()=>this.selectCharset("-"+a)),this._parser.registerEscHandler({intermediates:".",final:a},()=>this.selectCharset("."+a)),this._parser.registerEscHandler({intermediates:"/",final:a},()=>this.selectCharset("/"+a));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(a=>(this._logService.error("Parsing error: ",a),a)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new go((a,c)=>this.requestStatusString(a,c)))}getAttrData(){return this._curAttrData}_preserveStack(t,e,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=t,this._parseStack.cursorStartY=e,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(t){this._logService.logLevel<=3&&Promise.race([t,new Promise((e,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),wo))]).catch(e=>{if(e!=="#SLOW_TIMEOUT")throw e;console.warn(`async parser handler taking longer than ${wo} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(t,e){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0,o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,e))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,t.length>Nt&&(n=this._parseStack.position+Nt)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof t=="string"?` "${t}"`:` "${Array.prototype.map.call(t,a=>String.fromCharCode(a)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof t=="string"?t.split("").map(a=>a.charCodeAt(0)):t),this._parseBuffer.lengthNt)for(let a=n;a0&&_.getWidth(this._activeBuffer.x-1)===2&&_.setCellFromCodepoint(this._activeBuffer.x-1,0,1,c);let f=this._parser.precedingJoinState;for(let d=e;dl){if(h){let R=_,D=this._activeBuffer.x-k;for(this._activeBuffer.x=k,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),_=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),k>0&&_ instanceof Oi&&_.copyCellsFrom(R,D,0,k,!1);D=0;)_.setCellFromCodepoint(this._activeBuffer.x++,0,0,c);continue}if(a&&(_.insertCells(this._activeBuffer.x,r-k,this._activeBuffer.getNullCell(c)),_.getWidth(l-1)===2&&_.setCellFromCodepoint(l-1,0,1,c)),_.setCellFromCodepoint(this._activeBuffer.x++,s,r,c),r>0)for(;--r;)_.setCellFromCodepoint(this._activeBuffer.x++,0,0,c)}this._parser.precedingJoinState=f,this._activeBuffer.x0&&_.getWidth(this._activeBuffer.x)===0&&!_.hasContent(this._activeBuffer.x)&&_.setCellFromCodepoint(this._activeBuffer.x,0,1,c),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(t,e){return t.final==="t"&&!t.prefix&&!t.intermediates?this._parser.registerCsiHandler(t,i=>mo(i.params[0],this._optionsService.rawOptions.windowOptions)?e(i):!0):this._parser.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._parser.registerDcsHandler(t,new go(e))}registerEscHandler(t,e){return this._parser.registerEscHandler(t,e)}registerOscHandler(t,e){return this._parser.registerOscHandler(t,new Je(e))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-t),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(t=this._bufferService.cols-1){this._activeBuffer.x=Math.min(t,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(t,e){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=t,this._activeBuffer.y=this._activeBuffer.scrollTop+e):(this._activeBuffer.x=t,this._activeBuffer.y=e),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(t,e){this._restrictCursor(),this._setCursor(this._activeBuffer.x+t,this._activeBuffer.y+e)}cursorUp(t){let e=this._activeBuffer.y-this._activeBuffer.scrollTop;return e>=0?this._moveCursor(0,-Math.min(e,t.params[0]||1)):this._moveCursor(0,-(t.params[0]||1)),!0}cursorDown(t){let e=this._activeBuffer.scrollBottom-this._activeBuffer.y;return e>=0?this._moveCursor(0,Math.min(e,t.params[0]||1)):this._moveCursor(0,t.params[0]||1),!0}cursorForward(t){return this._moveCursor(t.params[0]||1,0),!0}cursorBackward(t){return this._moveCursor(-(t.params[0]||1),0),!0}cursorNextLine(t){return this.cursorDown(t),this._activeBuffer.x=0,!0}cursorPrecedingLine(t){return this.cursorUp(t),this._activeBuffer.x=0,!0}cursorCharAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(t){return this._setCursor(t.length>=2?(t.params[1]||1)-1:0,(t.params[0]||1)-1),!0}charPosAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(t){return this._moveCursor(t.params[0]||1,0),!0}linePosAbsolute(t){return this._setCursor(this._activeBuffer.x,(t.params[0]||1)-1),!0}vPositionRelative(t){return this._moveCursor(0,t.params[0]||1),!0}hVPosition(t){return this.cursorPosition(t),!0}tabClear(t){let e=t.params[0];return e===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:e===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(t){let e=t.params[0];return e===1&&(this._curAttrData.bg|=536870912),(e===2||e===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(t,e,i,s=!1,r=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);n.replaceCells(e,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),s&&(n.isWrapped=!1)}_resetBufferLine(t,e=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),e),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+t),i.isWrapped=!1)}eraseInDisplay(t,e=!1){this._restrictCursor(this._bufferService.cols);let i;switch(t.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);i=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(t,e=!1){switch(this._restrictCursor(this._bufferService.cols),t.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,e);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,e);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(t){this._restrictCursor();let e=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let h=l;for(let a=1;a0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(E.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(E.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(t){return t.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(E.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(E.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(t.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(E.ESC+"[>83;40003;0c")),!0}_is(t){return(this._optionsService.rawOptions.termName+"").indexOf(t)===0}setMode(t){for(let e=0;e(y[y.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",y[y.SET=1]="SET",y[y.RESET=2]="RESET",y[y.PERMANENTLY_SET=3]="PERMANENTLY_SET",y[y.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||={});let s=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:n}=this._coreMouseService,o=this._coreService,{buffers:l,cols:h}=this._bufferService,{active:a,alt:c}=l,_=this._optionsService.rawOptions,f=(y,k)=>(o.triggerDataEvent(`${E.ESC}[${e?"":"?"}${y};${k}$y`),!0),d=y=>y?1:2,m=t.params[0];return e?m===2?f(m,4):m===4?f(m,d(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,d(_.convertEol)):f(m,0):m===1?f(m,d(s.applicationCursorKeys)):m===3?f(m,_.windowOptions.setWinLines?h===80?2:h===132?1:0:0):m===6?f(m,d(s.origin)):m===7?f(m,d(s.wraparound)):m===8?f(m,3):m===9?f(m,d(r==="X10")):m===12?f(m,d(_.cursorBlink)):m===25?f(m,d(!o.isCursorHidden)):m===45?f(m,d(s.reverseWraparound)):m===66?f(m,d(s.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,d(r==="VT200")):m===1002?f(m,d(r==="DRAG")):m===1003?f(m,d(r==="ANY")):m===1004?f(m,d(s.sendFocus)):m===1005?f(m,4):m===1006?f(m,d(n==="SGR")):m===1015?f(m,4):m===1016?f(m,d(n==="SGR_PIXELS")):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,d(a===c)):m===2004?f(m,d(s.bracketedPasteMode)):m===2026?f(m,d(s.synchronizedOutput)):f(m,0)}_updateAttrColor(t,e,i,s,r){return e===2?(t|=50331648,t&=-16777216,t|=ji.fromColorRGB([i,s,r])):e===5&&(t&=-50331904,t|=33554432|i&255),t}_extractColor(t,e,i){let s=[0,0,-1,0,0,0],r=0,n=0;do{if(s[n+r]=t.params[e+n],t.hasSubParams(e+n)){let o=t.getSubParams(e+n),l=0;do s[1]===5&&(r=1),s[n+l+1+r]=o[l];while(++l=2||s[1]===2&&n+r>=5)break;s[1]&&(r=1)}while(++n+e5)&&(t=1),e.extended.underlineStyle=t,e.fg|=268435456,t===0&&(e.fg&=-268435457),e.updateExtended()}_processSGR0(t){t.fg=me.fg,t.bg=me.bg,t.extended=t.extended.clone(),t.extended.underlineStyle=0,t.extended.underlineColor&=-67108864,t.updateExtended()}charAttributes(t){if(t.length===1&&t.params[0]===0)return this._processSGR0(this._curAttrData),!0;let e=t.length,i,s=this._curAttrData;for(let r=0;r=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777216|i-90|8):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777216|i-100|8):i===0?this._processSGR0(s):i===1?s.fg|=134217728:i===3?s.bg|=67108864:i===4?(s.fg|=268435456,this._processUnderline(t.hasSubParams(r)?t.getSubParams(r)[0]:1,s)):i===5?s.fg|=536870912:i===7?s.fg|=67108864:i===8?s.fg|=1073741824:i===9?s.fg|=2147483648:i===2?s.bg|=134217728:i===21?this._processUnderline(2,s):i===22?(s.fg&=-134217729,s.bg&=-134217729):i===23?s.bg&=-67108865:i===24?(s.fg&=-268435457,this._processUnderline(0,s)):i===25?s.fg&=-536870913:i===27?s.fg&=-67108865:i===28?s.fg&=-1073741825:i===29?s.fg&=2147483647:i===39?(s.fg&=-67108864,s.fg|=me.fg&16777215):i===49?(s.bg&=-67108864,s.bg|=me.bg&16777215):i===38||i===48||i===58?r+=this._extractColor(t,r,s):i===53?s.bg|=1073741824:i===55?s.bg&=-1073741825:i===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):i===100?(s.fg&=-67108864,s.fg|=me.fg&16777215,s.bg&=-67108864,s.bg|=me.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(t){switch(t.params[0]){case 5:this._coreService.triggerDataEvent(`${E.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${E.ESC}[${e};${i}R`);break}return!0}deviceStatusPrivate(t){switch(t.params[0]){case 6:let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${E.ESC}[?${e};${i}R`);break}return!0}softReset(t){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=me.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(t){let e=t.length===0?1:t.params[0];if(e===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(e){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=e%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(t){let e=t.params[0]||1,i;return(t.length<2||(i=t.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>e&&(this._activeBuffer.scrollTop=e-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(t){if(!mo(t.params[0],this._optionsService.rawOptions.windowOptions))return!0;let e=t.length>1?t.params[1]:0;switch(t.params[0]){case 14:e!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${E.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(e===0||e===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>vo&&this._windowTitleStack.shift()),(e===0||e===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>vo&&this._iconNameStack.shift());break;case 23:(e===0||e===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(e===0||e===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(t){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(t){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(t){return this._windowTitle=t,this._onTitleChange.fire(t),!0}setIconName(t){return this._iconName=t,!0}setOrReportIndexedColor(t){let e=[],i=t.split(";");for(;i.length>1;){let s=i.shift(),r=i.shift();if(/^\d+$/.exec(s)){let n=parseInt(s);if(bo(n))if(r==="?")e.push({type:0,index:n});else{let o=po(r);o&&e.push({type:1,index:n,color:o})}}}return e.length&&this._onColor.fire(e),!0}setHyperlink(t){let e=t.indexOf(";");if(e===-1)return!0;let i=t.slice(0,e).trim(),s=t.slice(e+1);return s?this._createHyperlink(i,s):i.trim()?!1:this._finishHyperlink()}_createHyperlink(t,e){this._getCurrentLinkId()&&this._finishHyperlink();let i=t.split(":"),s,r=i.findIndex(n=>n.startsWith("id="));return r!==-1&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,uri:e}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(t,e){let i=t.split(";");for(let s=0;s=this._specialColors.length);++s,++e)if(i[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[e]}]);else{let r=po(i[s]);r&&this._onColor.fire([{type:1,index:this._specialColors[e],color:r}])}return!0}setOrReportFgColor(t){return this._setOrReportSpecialColor(t,0)}setOrReportBgColor(t){return this._setOrReportSpecialColor(t,1)}setOrReportCursorColor(t){return this._setOrReportSpecialColor(t,2)}restoreIndexedColor(t){if(!t)return this._onColor.fire([{type:2}]),!0;let e=[],i=t.split(";");for(let s=0;s=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let t=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,t,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=me.clone(),this._eraseAttrDataInternal=me.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(t){return this._charsetService.setgLevel(t),!0}screenAlignmentPattern(){let t=new ct;t.content=1<<22|69,t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let e=0;e(this._coreService.triggerDataEvent(`${E.ESC}${o}${E.ESC}\\`),!0),s=this._bufferService.buffer,r=this._optionsService.rawOptions;return i(t==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:t==='"p'?'P1$r61;1"p':t==="r"?`P1$r${s.scrollTop+1};${s.scrollBottom+1}r`:t==="m"?"P1$r0m":t===" q"?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(t,e){this._dirtyRowTracker.markRangeDirty(t,e)}},Xr=class{constructor(t){this._bufferService=t,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(t){tthis.end&&(this.end=t)}markRangeDirty(t,e){t>e&&(So=t,t=e,e=So),tthis.end&&(this.end=e)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Xr=ue([P(0,Ve)],Xr);function bo(t){return 0<=t&&t<256}var Od=5e7,yo=12,Fd=50,Nd=class extends j{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new A),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){if(i!==void 0&&this._syncCalls>i){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let s;for(;s=this._writeBuffer.shift();){this._action(s);let r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,i){if(this._pendingData>Od)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let s=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let r=this._writeBuffer[this._bufferOffset],n=this._action(r,i);if(n){let l=h=>performance.now()-s>=yo?setTimeout(()=>this._innerWrite(0,h)):this._innerWrite(s,h);n.catch(h=>(queueMicrotask(()=>{throw h}),Promise.resolve(!1))).then(l);return}let o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=r.length,performance.now()-s>=yo)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>Fd&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},Jr=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let i=this._bufferService.buffer;if(e.id===void 0){let h=i.addMarker(i.ybase+i.y),a={data:e,id:this._nextId++,lines:[h]};return h.onDispose(()=>this._removeMarkerFromLink(a,h)),this._dataByLinkId.set(a.id,a),a.id}let s=e,r=this._getEntryIdKey(s),n=this._entriesWithId.get(r);if(n)return this.addLineToLink(n.id,i.ybase+i.y),n.id;let o=i.addMarker(i.ybase+i.y),l={id:this._nextId++,key:this._getEntryIdKey(s),data:s,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(l,o)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(e,i){let s=this._dataByLinkId.get(e);if(s&&s.lines.every(r=>r.line!==i)){let r=this._bufferService.buffer.addMarker(i);s.lines.push(r),r.onDispose(()=>this._removeMarkerFromLink(s,r))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,i){let s=e.lines.indexOf(i);s!==-1&&(e.lines.splice(s,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Jr=ue([P(0,Ve)],Jr);var Co=!1,Wd=class extends j{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Si),this._onBinary=this._register(new A),this.onBinary=this._onBinary.event,this._onData=this._register(new A),this.onData=this._onData.event,this._onLineFeed=this._register(new A),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new A),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new A),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new A),this._instantiationService=new cd,this.optionsService=this._register(new Sd(e)),this._instantiationService.setService(je,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Vr)),this._instantiationService.setService(Ve,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Kr)),this._instantiationService.setService(fa,this._logService),this.coreService=this._register(this._instantiationService.createInstance(jr)),this._instantiationService.setService(li,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Gr)),this._instantiationService.setService(_a,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(ei)),this._instantiationService.setService(oh,this.unicodeService),this._charsetService=this._instantiationService.createInstance(kd),this._instantiationService.setService(nh,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Jr),this._instantiationService.setService(ga,this._oscLinkService),this._inputHandler=this._register(new Id(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Fe.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Fe.forward(this._bufferService.onResize,this._onResize)),this._register(Fe.forward(this.coreService.onData,this._onData)),this._register(Fe.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new Nd((i,s)=>this._inputHandler.parse(i,s))),this._register(Fe.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new A),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!Co&&(this._logService.warn("writeSync is unreliable and will be removed soon."),Co=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,ja),i=Math.max(i,Ga),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&i.buildNumber!==void 0&&i.buildNumber!==void 0?e=i.backend==="conpty"&&i.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(fo.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(fo(this._bufferService),!1))),this._windowsWrappingHeuristics.value=re(()=>{for(let i of e)i.dispose()})}}},zd={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function Hd(t,e,i,s){let r={type:0,cancel:!1,key:void 0},n=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:t.key==="UIKeyInputUpArrow"?e?r.key=E.ESC+"OA":r.key=E.ESC+"[A":t.key==="UIKeyInputLeftArrow"?e?r.key=E.ESC+"OD":r.key=E.ESC+"[D":t.key==="UIKeyInputRightArrow"?e?r.key=E.ESC+"OC":r.key=E.ESC+"[C":t.key==="UIKeyInputDownArrow"&&(e?r.key=E.ESC+"OB":r.key=E.ESC+"[B");break;case 8:r.key=t.ctrlKey?"\b":E.DEL,t.altKey&&(r.key=E.ESC+r.key);break;case 9:if(t.shiftKey){r.key=E.ESC+"[Z";break}r.key=E.HT,r.cancel=!0;break;case 13:r.key=t.altKey?E.ESC+E.CR:E.CR,r.cancel=!0;break;case 27:r.key=E.ESC,t.altKey&&(r.key=E.ESC+E.ESC),r.cancel=!0;break;case 37:if(t.metaKey)break;n?r.key=E.ESC+"[1;"+(n+1)+"D":e?r.key=E.ESC+"OD":r.key=E.ESC+"[D";break;case 39:if(t.metaKey)break;n?r.key=E.ESC+"[1;"+(n+1)+"C":e?r.key=E.ESC+"OC":r.key=E.ESC+"[C";break;case 38:if(t.metaKey)break;n?r.key=E.ESC+"[1;"+(n+1)+"A":e?r.key=E.ESC+"OA":r.key=E.ESC+"[A";break;case 40:if(t.metaKey)break;n?r.key=E.ESC+"[1;"+(n+1)+"B":e?r.key=E.ESC+"OB":r.key=E.ESC+"[B";break;case 45:!t.shiftKey&&!t.ctrlKey&&(r.key=E.ESC+"[2~");break;case 46:n?r.key=E.ESC+"[3;"+(n+1)+"~":r.key=E.ESC+"[3~";break;case 36:n?r.key=E.ESC+"[1;"+(n+1)+"H":e?r.key=E.ESC+"OH":r.key=E.ESC+"[H";break;case 35:n?r.key=E.ESC+"[1;"+(n+1)+"F":e?r.key=E.ESC+"OF":r.key=E.ESC+"[F";break;case 33:t.shiftKey?r.type=2:t.ctrlKey?r.key=E.ESC+"[5;"+(n+1)+"~":r.key=E.ESC+"[5~";break;case 34:t.shiftKey?r.type=3:t.ctrlKey?r.key=E.ESC+"[6;"+(n+1)+"~":r.key=E.ESC+"[6~";break;case 112:n?r.key=E.ESC+"[1;"+(n+1)+"P":r.key=E.ESC+"OP";break;case 113:n?r.key=E.ESC+"[1;"+(n+1)+"Q":r.key=E.ESC+"OQ";break;case 114:n?r.key=E.ESC+"[1;"+(n+1)+"R":r.key=E.ESC+"OR";break;case 115:n?r.key=E.ESC+"[1;"+(n+1)+"S":r.key=E.ESC+"OS";break;case 116:n?r.key=E.ESC+"[15;"+(n+1)+"~":r.key=E.ESC+"[15~";break;case 117:n?r.key=E.ESC+"[17;"+(n+1)+"~":r.key=E.ESC+"[17~";break;case 118:n?r.key=E.ESC+"[18;"+(n+1)+"~":r.key=E.ESC+"[18~";break;case 119:n?r.key=E.ESC+"[19;"+(n+1)+"~":r.key=E.ESC+"[19~";break;case 120:n?r.key=E.ESC+"[20;"+(n+1)+"~":r.key=E.ESC+"[20~";break;case 121:n?r.key=E.ESC+"[21;"+(n+1)+"~":r.key=E.ESC+"[21~";break;case 122:n?r.key=E.ESC+"[23;"+(n+1)+"~":r.key=E.ESC+"[23~";break;case 123:n?r.key=E.ESC+"[24;"+(n+1)+"~":r.key=E.ESC+"[24~";break;default:if(t.ctrlKey&&!t.shiftKey&&!t.altKey&&!t.metaKey)t.keyCode>=65&&t.keyCode<=90?r.key=String.fromCharCode(t.keyCode-64):t.keyCode===32?r.key=E.NUL:t.keyCode>=51&&t.keyCode<=55?r.key=String.fromCharCode(t.keyCode-51+27):t.keyCode===56?r.key=E.DEL:t.keyCode===219?r.key=E.ESC:t.keyCode===220?r.key=E.FS:t.keyCode===221&&(r.key=E.GS);else if((!i||s)&&t.altKey&&!t.metaKey){let o=zd[t.keyCode]?.[t.shiftKey?1:0];if(o)r.key=E.ESC+o;else if(t.keyCode>=65&&t.keyCode<=90){let l=t.ctrlKey?t.keyCode-64:t.keyCode+32,h=String.fromCharCode(l);t.shiftKey&&(h=h.toUpperCase()),r.key=E.ESC+h}else if(t.keyCode===32)r.key=E.ESC+(t.ctrlKey?E.NUL:" ");else if(t.key==="Dead"&&t.code.startsWith("Key")){let l=t.code.slice(3,4);t.shiftKey||(l=l.toLowerCase()),r.key=E.ESC+l,r.cancel=!0}}else i&&!t.altKey&&!t.ctrlKey&&!t.shiftKey&&t.metaKey?t.keyCode===65&&(r.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.keyCode>=48&&t.key.length===1?r.key=t.key:t.key&&t.ctrlKey&&(t.key==="_"&&(r.key=E.US),t.key==="@"&&(r.key=E.NUL));break}return r}var ge=0,Ud=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new ks,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new ks,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((n,o)=>this._getKey(n)-this._getKey(o)),i=0,s=0,r=new Array(this._array.length+this._insertedValues.length);for(let n=0;n=this._array.length||this._getKey(e[i])<=this._getKey(this._array[s])?(r[n]=e[i],i++):r[n]=this._array[s++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let i=this._getKey(e);if(i===void 0||(ge=this._search(i),ge===-1)||this._getKey(this._array[ge])!==i)return!1;do if(this._array[ge]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(ge),!0;while(++gen-o),i=0,s=new Array(this._array.length-e.length),r=0;for(let n=0;n0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ge=this._search(e),!(ge<0||ge>=this._array.length)&&this._getKey(this._array[ge])===e))do yield this._array[ge];while(++ge=this._array.length)&&this._getKey(this._array[ge])===e))do i(this._array[ge]);while(++ge=i;){let r=i+s>>1,n=this._getKey(this._array[r]);if(n>e)s=r-1;else if(n0&&this._getKey(this._array[r-1])===e;)r--;return r}}return i}},Ys=0,xo=0,qd=class extends j{constructor(){super(),this._decorations=new Ud(t=>t?.marker.line),this._onDecorationRegistered=this._register(new A),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new A),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(re(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(t){if(t.marker.isDisposed)return;let e=new Kd(t);if(e){let i=e.marker.onDispose(()=>e.dispose()),s=e.onDispose(()=>{s.dispose(),e&&(this._decorations.delete(e)&&this._onDecorationRemoved.fire(e),i.dispose())});this._decorations.insert(e),this._onDecorationRegistered.fire(e)}return e}reset(){for(let t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,e,i){let s=0,r=0;for(let n of this._decorations.getKeyIterator(e))s=n.options.x??0,r=s+(n.options.width??1),t>=s&&t{Ys=r.options.x??0,xo=Ys+(r.options.width??1),t>=Ys&&t=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let n=r-this._lastRefreshMs,o=this._debounceThresholdMS-n;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},o)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i)}},ko=20,Ls=class extends j{constructor(t,e,i,s){super(),this._terminal=t,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let r=this._coreBrowserService.mainDocument;this._accessibilityContainer=r.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=r.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let n=0;nthis._handleBoundaryFocus(n,0),this._bottomBoundaryFocusListener=n=>this._handleBoundaryFocus(n,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=r.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new jd(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(n=>this._handleResize(n.rows))),this._register(this._terminal.onRender(n=>this._refreshRows(n.start,n.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(n=>this._handleChar(n))),this._register(this._terminal.onLineFeed(()=>this._handleChar(` -`))),this._register(this._terminal.onA11yTab(n=>this._handleTab(n))),this._register(this._terminal.onKey(n=>this._handleKey(n.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(H(r,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(re(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let e=0;e0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===ko+1&&(this._liveRegion.textContent+=vr.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,e){this._liveRegionDebouncer.refresh(t,e,this._terminal.rows)}_renderRows(t,e){let i=this._terminal.buffer,s=i.lines.length.toString();for(let r=t;r<=e;r++){let n=i.lines.get(i.ydisp+r),o=[],l=n?.translateToString(!0,void 0,void 0,o)||"",h=(i.ydisp+r+1).toString(),a=this._rowElements[r];a&&(l.length===0?(a.textContent=" ",this._rowColumns.set(a,[0,1])):(a.textContent=l,this._rowColumns.set(a,o)),a.setAttribute("aria-posinset",h),a.setAttribute("aria-setsize",s),this._alignRowWidth(a))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,e){let i=t.target,s=this._rowElements[e===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),n=e===0?"1":`${this._terminal.buffer.lines.length}`;if(r===n||t.relatedTarget!==s)return;let o,l;if(e===0?(o=i,l=this._rowElements.pop(),this._rowContainer.removeChild(l)):(o=this._rowElements.shift(),l=i,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),l.removeEventListener("focus",this._bottomBoundaryFocusListener),e===0){let h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{let h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(e===0?-1:1),this._rowElements[e===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let t=this._coreBrowserService.mainDocument.getSelection();if(!t)return;if(t.isCollapsed){this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection();return}if(!t.anchorNode||!t.focusNode){console.error("anchorNode and/or focusNode are null");return}let e={node:t.anchorNode,offset:t.anchorOffset},i={node:t.focusNode,offset:t.focusOffset};if((e.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||e.node===i.node&&e.offset>i.offset)&&([e,i]=[i,e]),e.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(e={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(e.node))return;let s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let r=({node:l,offset:h})=>{let a=l instanceof Text?l.parentNode:l,c=parseInt(a?.getAttribute("aria-posinset"),10)-1;if(isNaN(c))return console.warn("row is invalid. Race condition?"),null;let _=this._rowColumns.get(a);if(!_)return console.warn("columns is null. Race condition?"),null;let f=h<_.length?_[h]:_.slice(-1)[0]+1;return f>=this._terminal.cols&&(++c,f=0),{row:c,column:f}},n=r(e),o=r(i);if(!(!n||!o)){if(n.row>o.row||n.row===o.row&&n.column>=o.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(o.row-n.row)*this._terminal.cols-n.column+o.column)}}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;et;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let t=0;t{oi(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(H(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(H(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(H(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(H(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(t){this._lastMouseEvent=t;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;let i=t.composedPath();for(let s=0;s{s?.forEach(r=>{r.link.dispose&&r.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=t.y);let i=!1;for(let[s,r]of this._linkProviderService.linkProviders.entries())e?this._activeProviderReplies?.get(s)&&(i=this._checkLinkProviderResult(s,t,i)):r.provideLinks(t.y,n=>{if(this._isMouseOut)return;let o=n?.map(l=>({link:l}));this._activeProviderReplies?.set(s,o),i=this._checkLinkProviderResult(s,t,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(t.y,this._activeProviderReplies)})}_removeIntersectingLinks(t,e){let i=new Set;for(let s=0;st?this._bufferService.cols:o.link.range.end.x;for(let a=l;a<=h;a++){if(i.has(a)){r.splice(n--,1);break}i.add(a)}}}}_checkLinkProviderResult(t,e,i){if(!this._activeProviderReplies)return i;let s=this._activeProviderReplies.get(t),r=!1;for(let n=0;nthis._linkAtPosition(o.link,e));n&&(i=!0,this._handleNewLink(n))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let n=0;nthis._linkAtPosition(l.link,e));if(o){i=!0,this._handleNewLink(o);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(t){if(!this._currentLink)return;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);e&&this._mouseDownLink&&Gd(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(t,this._currentLink.link.text)}_clearCurrentLink(t,e){!this._currentLink||!this._lastMouseEvent||(!t||!e||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,oi(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(t){if(!this._lastMouseEvent)return;let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(t.link,e)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0?!0:t.link.decorations.underline,pointerCursor:t.link.decorations===void 0?!0:t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(t.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let s=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(s,r),this._lastMouseEvent)){let n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._askForLink(n,!1)}})))}_linkHover(t,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(i,e.text)}_fireUnderlineEvent(t,e){let i=t.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(t,e,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(i,e.text)}_linkAtPosition(t,e){let i=t.range.start.y*this._bufferService.cols+t.range.start.x,s=t.range.end.y*this._bufferService.cols+t.range.end.x,r=e.y*this._bufferService.cols+e.x;return i<=r&&r<=s}_positionFromMouseEvent(t,e,i){let s=i.getCoords(t,e,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(t,e,i,s,r){return{x1:t,y1:e,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};Zr=ue([P(1,gn),P(2,It),P(3,Ve),P(4,va)],Zr);function Gd(t,e){return t.text===e.text&&t.range.start.x===e.range.start.x&&t.range.start.y===e.range.start.y&&t.range.end.x===e.range.end.x&&t.range.end.y===e.range.end.y}var Yd=class extends Wd{constructor(e={}){super(e),this._linkifier=this._register(new Si),this.browser=Ia,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Si),this._onCursorMove=this._register(new A),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new A),this.onKey=this._onKey.event,this._onRender=this._register(new A),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new A),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new A),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new A),this.onBell=this._onBell.event,this._onFocus=this._register(new A),this._onBlur=this._register(new A),this._onA11yCharEmitter=this._register(new A),this._onA11yTabEmitter=this._register(new A),this._onWillOpen=this._register(new A),this._setup(),this._decorationService=this._instantiationService.createInstance(qd),this._instantiationService.setService(Gi,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Fc),this._instantiationService.setService(va,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(wr)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i=>this.refresh(i?.start??0,i?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(i=>this._reportWindowsOptions(i))),this._register(this._inputHandler.onColor(i=>this._handleColorEvent(i))),this._register(Fe.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Fe.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Fe.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Fe.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register(re(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let i of e){let s,r="";switch(i.index){case 256:s="foreground",r="10";break;case 257:s="background",r="11";break;case 258:s="cursor",r="12";break;default:s="ansi",r="4;"+i.index}switch(i.type){case 0:let n=ie.toColorRGB(s==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[s]);this.coreService.triggerDataEvent(`${E.ESC}]${r};${Pd(n)}${Pa.ST}`);break;case 1:if(s==="ansi")this._themeService.modifyColors(o=>o.ansi[i.index]=Se.toColor(...i.color));else{let o=s;this._themeService.modifyColors(l=>l[o]=Se.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Ls,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(E.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(E.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i=this.buffer.lines.get(e);if(!i)return;let s=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,n=i.getWidth(s),o=this._renderService.dimensions.css.cell.width*n,l=this.buffer.y*this._renderService.dimensions.css.cell.height,h=s*this._renderService.dimensions.css.cell.width;this.textarea.style.left=h+"px",this.textarea.style.top=l+"px",this.textarea.style.width=o+"px",this.textarea.style.height=r+"px",this.textarea.style.lineHeight=r+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(H(this.element,"copy",i=>{this.hasSelection()&&Ql(i,this._selectionService)}));let e=i=>eh(i,this.textarea,this.coreService,this.optionsService);this._register(H(this.textarea,"paste",e)),this._register(H(this.element,"paste",e)),Oa?this._register(H(this.element,"mousedown",i=>{i.button===2&&Pn(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(H(this.element,"contextmenu",i=>{Pn(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Cn&&this._register(H(this.element,"auxclick",i=>{i.button===1&&la(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(H(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(H(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(H(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(H(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(H(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(H(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(H(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(H(this.screenElement,"mousemove",n=>this.updateCursorStyle(n))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let s=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",pr.get()),Wa||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>s.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(Ic,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService($t,this._coreBrowserService),this._register(H(this.textarea,"focus",n=>this._handleTextAreaFocus(n))),this._register(H(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Wr,this._document,this._helperContainer),this._instantiationService.setService(Ds,this._charSizeService),this._themeService=this._instantiationService.createInstance(qr),this._instantiationService.setService(bi,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Cs),this._instantiationService.setService(pa,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Hr,this.rows,this.screenElement)),this._instantiationService.setService(It,this._renderService),this._register(this._renderService.onRenderedViewportChange(n=>this._onRender.fire(n))),this.onResize(n=>this._renderService.resize(n.cols,n.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Or,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(zr),this._instantiationService.setService(gn,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(Zr,this.screenElement));this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance($r,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(n=>{super.scrollLines(n,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Ur,this.element,this.screenElement,r)),this._instantiationService.setService(lh,this._selectionService),this._register(this._selectionService.onRequestScrollLines(n=>this.scrollLines(n.amount,n.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(n=>this._renderService.handleSelectionChanged(n.start,n.end,n.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(n=>{this.textarea.value=n,this.textarea.focus(),this.textarea.select()})),this._register(Fe.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(Ir,this.screenElement)),this._register(H(this.element,"mousedown",n=>this._selectionService.handleMouseDown(n))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Ls,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",n=>this._handleScreenReaderModeOptionChange(n))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(ys,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",n=>{!this._overviewRulerRenderer&&n&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(ys,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Nr,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function s(o){let l=e._mouseService.getMouseReportCoords(o,e.screenElement);if(!l)return!1;let h,a;switch(o.overrideType||o.type){case"mousemove":a=32,o.buttons===void 0?(h=3,o.button!==void 0&&(h=o.button<3?o.button:3)):h=o.buttons&1?0:o.buttons&4?1:o.buttons&2?2:3;break;case"mouseup":a=0,h=o.button<3?o.button:3;break;case"mousedown":a=1,h=o.button<3?o.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(o)===!1)return!1;let c=o.deltaY;if(c===0||e.coreMouseService.consumeWheelEvent(o,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;a=c<0?0:1,h=4;break;default:return!1}return a===void 0||h===void 0||h>4?!1:e.coreMouseService.triggerMouseEvent({col:l.col,row:l.row,x:l.x,y:l.y,button:h,action:a,ctrl:o.ctrlKey,alt:o.altKey,shift:o.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},n={mouseup:o=>(s(o),o.buttons||(this._document.removeEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.removeEventListener("mousemove",r.mousedrag)),this.cancel(o)),wheel:o=>(s(o),this.cancel(o,!0)),mousedrag:o=>{o.buttons&&s(o)},mousemove:o=>{o.buttons||s(o)}};this._register(this.coreMouseService.onProtocolChange(o=>{o?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(o)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),o&8?r.mousemove||(i.addEventListener("mousemove",n.mousemove),r.mousemove=n.mousemove):(i.removeEventListener("mousemove",r.mousemove),r.mousemove=null),o&16?r.wheel||(i.addEventListener("wheel",n.wheel,{passive:!1}),r.wheel=n.wheel):(i.removeEventListener("wheel",r.wheel),r.wheel=null),o&2?r.mouseup||(r.mouseup=n.mouseup):(this._document.removeEventListener("mouseup",r.mouseup),r.mouseup=null),o&4?r.mousedrag||(r.mousedrag=n.mousedrag):(this._document.removeEventListener("mousemove",r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(H(i,"mousedown",o=>{if(o.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(o)))return s(o),r.mouseup&&this._document.addEventListener("mouseup",r.mouseup),r.mousedrag&&this._document.addEventListener("mousemove",r.mousedrag),this.cancel(o)})),this._register(H(i,"wheel",o=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(o)===!1)return!1;if(!this.buffer.hasScrollback){if(o.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(o,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(o,!0);let l=E.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(o.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(l,!0),this.cancel(o,!0)}}},{passive:!1}))}refresh(e,i){this._renderService?.refreshRows(e,i)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}paste(e){aa(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,i,s){this._selectionService.setSelection(e,i,s)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,i){this._selectionService?.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!i&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let s=Hd(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),s.type===3||s.type===2){let r=this.rows-1;return this.scrollLines(s.type===2?-r:r),this.cancel(e,!0)}if(s.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(s.cancel&&this.cancel(e,!0),!s.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((s.key===E.ETX||s.key===E.CR)&&(this.textarea.value=""),this._onKey.fire({key:s.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(s.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,i){let s=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return i.type==="keypress"?s:s&&(!i.keyCode||i.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Xd(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(e.which===null||e.which===void 0)i=e.keyCode;else if(e.which!==0&&e.charCode!==0)i=e.which;else return!1;return!i||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let s={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(s),i.dispose=()=>this._wrappedAddonDispose(s),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let s=0;s=this._line.length))return i?(this._line.loadCell(e,i),i):this._line.loadCell(e,new ct)}translateToString(e,i,s){return this._line.translateToString(e,i,s)}},Lo=class{constructor(t,e){this._buffer=t,this.type=e}init(t){return this._buffer=t,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(t){let e=this._buffer.lines.get(t);if(e)return new Zd(e)}getNullCell(){return new ct}},Qd=class extends j{constructor(t){super(),this._core=t,this._onBufferChange=this._register(new A),this.onBufferChange=this._onBufferChange.event,this._normal=new Lo(this._core.buffers.normal,"normal"),this._alternate=new Lo(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},eu=class{constructor(t){this._core=t}registerCsiHandler(t,e){return this._core.registerCsiHandler(t,i=>e(i.toArray()))}addCsiHandler(t,e){return this.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._core.registerDcsHandler(t,(i,s)=>e(i,s.toArray()))}addDcsHandler(t,e){return this.registerDcsHandler(t,e)}registerEscHandler(t,e){return this._core.registerEscHandler(t,e)}addEscHandler(t,e){return this.registerEscHandler(t,e)}registerOscHandler(t,e){return this._core.registerOscHandler(t,e)}addOscHandler(t,e){return this.registerOscHandler(t,e)}},tu=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},iu=["cols","rows"],ft=0,su=class extends j{constructor(t){super(),this._core=this._register(new Yd(t)),this._addonManager=this._register(new Jd),this._publicOptions={...this._core.options};let e=s=>this._core.options[s],i=(s,r)=>{this._checkReadonlyOptions(s),this._core.options[s]=r};for(let s in this._core.options){let r={get:e.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,r)}}_checkReadonlyOptions(t){if(iu.includes(t))throw new Error(`Option "${t}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new eu(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new tu(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new Qd(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let t=this._core.coreService.decPrivateModes,e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any";break}return{applicationCursorKeysMode:t.applicationCursorKeys,applicationKeypadMode:t.applicationKeypad,bracketedPasteMode:t.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:t.origin,reverseWraparoundMode:t.reverseWraparound,sendFocusMode:t.sendFocus,synchronizedOutputMode:t.synchronizedOutput,wraparoundMode:t.wraparound}}get options(){return this._publicOptions}set options(t){for(let e in t)this._publicOptions[e]=t[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(t,e=!0){this._core.input(t,e)}resize(t,e){this._verifyIntegers(t,e),this._core.resize(t,e)}open(t){this._core.open(t)}attachCustomKeyEventHandler(t){this._core.attachCustomKeyEventHandler(t)}attachCustomWheelEventHandler(t){this._core.attachCustomWheelEventHandler(t)}registerLinkProvider(t){return this._core.registerLinkProvider(t)}registerCharacterJoiner(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)}deregisterCharacterJoiner(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)}registerMarker(t=0){return this._verifyIntegers(t),this._core.registerMarker(t)}registerDecoration(t){return this._checkProposedApi(),this._verifyPositiveIntegers(t.x??0,t.width??0,t.height??0),this._core.registerDecoration(t)}hasSelection(){return this._core.hasSelection()}select(t,e,i){this._verifyIntegers(t,e,i),this._core.select(t,e,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(t,e){this._verifyIntegers(t,e),this._core.selectLines(t,e)}dispose(){super.dispose()}scrollLines(t){this._verifyIntegers(t),this._core.scrollLines(t)}scrollPages(t){this._verifyIntegers(t),this._core.scrollPages(t)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(t){this._verifyIntegers(t),this._core.scrollToLine(t)}clear(){this._core.clear()}write(t,e){this._core.write(t,e)}writeln(t,e){this._core.write(t),this._core.write(`\r -`,e)}paste(t){this._core.paste(t)}refresh(t,e){this._verifyIntegers(t,e),this._core.refresh(t,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return{get promptLabel(){return pr.get()},set promptLabel(t){pr.set(t)},get tooMuchOutput(){return vr.get()},set tooMuchOutput(t){vr.set(t)}}}_verifyIntegers(...t){for(ft of t)if(ft===1/0||isNaN(ft)||ft%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(ft of t)if(ft&&(ft===1/0||isNaN(ft)||ft%1!==0||ft<0))throw new Error("This API only accepts positive integers")}};/** - * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. - * @license MIT - * - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * @license MIT - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - */var ru=2,nu=1,ou=class{activate(t){this._terminal=t}dispose(){}fit(){let t=this.proposeDimensions();if(!t||!this._terminal||isNaN(t.cols)||isNaN(t.rows))return;let e=this._terminal._core;(this._terminal.rows!==t.rows||this._terminal.cols!==t.cols)&&(e._renderService.clear(),this._terminal.resize(t.cols,t.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal._core._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let e=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},l=o.top+o.bottom,h=o.right+o.left,a=s-l,c=r-h-e;return{cols:Math.max(ru,Math.floor(c/t.css.cell.width)),rows:Math.max(nu,Math.floor(a/t.css.cell.height))}}};/** - * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. - * @license MIT - * - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * @license MIT - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - */var au=class{constructor(t,e,i,s={}){this._terminal=t,this._regex=e,this._handler=i,this._options=s}provideLinks(t,e){let i=hu.computeLink(t,this._regex,this._terminal,this._handler);e(this._addCallbacks(i))}_addCallbacks(t){return t.map(e=>(e.leave=this._options.leave,e.hover=(i,s)=>{if(this._options.hover){let{range:r}=e;this._options.hover(i,s,r)}},e))}};function lu(t){try{let e=new URL(t),i=e.password&&e.username?`${e.protocol}//${e.username}:${e.password}@${e.host}`:e.username?`${e.protocol}//${e.username}@${e.host}`:`${e.protocol}//${e.host}`;return t.toLocaleLowerCase().startsWith(i.toLocaleLowerCase())}catch{return!1}}var hu=class gs{static computeLink(e,i,s,r){let n=new RegExp(i.source,(i.flags||"")+"g"),[o,l]=gs._getWindowedLineStrings(e-1,s),h=o.join(""),a,c=[];for(;a=n.exec(h);){let _=a[0];if(!lu(_))continue;let[f,d]=gs._mapStrIdx(s,l,0,a.index),[m,y]=gs._mapStrIdx(s,f,d,_.length);if(f===-1||d===-1||m===-1||y===-1)continue;let k={start:{x:d+1,y:f+1},end:{x:y,y:m+1}};c.push({range:k,text:_,activate:r})}return c}static _getWindowedLineStrings(e,i){let s,r=e,n=e,o=0,l="",h=[];if(s=i.buffer.active.getLine(e)){let a=s.translateToString(!0);if(s.isWrapped&&a[0]!==" "){for(o=0;(s=i.buffer.active.getLine(--r))&&o<2048&&(l=s.translateToString(!0),o+=l.length,h.push(l),!(!s.isWrapped||l.indexOf(" ")!==-1)););h.reverse()}for(h.push(a),o=0;(s=i.buffer.active.getLine(++n))&&s.isWrapped&&o<2048&&(l=s.translateToString(!0),o+=l.length,h.push(l),l.indexOf(" ")===-1););}return[h,r]}static _mapStrIdx(e,i,s,r){let n=e.buffer.active,o=n.getNullCell(),l=s;for(;r;){let h=n.getLine(i);if(!h)return[-1,-1];for(let a=l;a`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function du(t,e){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}var uu=class{constructor(t=du,e={}){this._handler=t,this._options=e}activate(t){this._terminal=t;let e=this._options,i=e.urlRegex||cu;this._linkProvider=this._terminal.registerLinkProvider(new au(this._terminal,i,this._handler,e))}dispose(){this._linkProvider?.dispose()}};/** - * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. - * @license MIT - * - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * @license MIT - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - */var _u=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Bo.isErrorNoTelemetry(t)?new Bo(t.message+` - -`+t.stack):new Error(t.message+` - -`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},fu=new _u;function Xs(t){gu(t)||fu.onUnexpectedError(t)}var Qr="Canceled";function gu(t){return t instanceof pu?!0:t instanceof Error&&t.name===Qr&&t.message===Qr}var pu=class extends Error{constructor(){super(Qr),this.name=this.message}},Bo=class en extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof en)return e;let i=new en;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},vu;(t=>{function e(n){return n<0}t.isLessThan=e;function i(n){return n<=0}t.isLessThanOrEqual=i;function s(n){return n>0}t.isGreaterThan=s;function r(n){return n===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(vu||={});function mu(t,e){let i=this,s=!1,r;return function(){return s||(s=!0,e||(r=t.apply(i,arguments))),r}}var Xa;(t=>{function e(S){return S&&typeof S=="object"&&typeof S[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function s(){return i}t.empty=s;function*r(S){yield S}t.single=r;function n(S){return e(S)?S:r(S)}t.wrap=n;function o(S){return S||i}t.from=o;function*l(S){for(let L=S.length-1;L>=0;L--)yield S[L]}t.reverse=l;function h(S){return!S||S[Symbol.iterator]().next().done===!0}t.isEmpty=h;function a(S){return S[Symbol.iterator]().next().value}t.first=a;function c(S,L){let B=0;for(let $ of S)if(L($,B++))return!0;return!1}t.some=c;function _(S,L){for(let B of S)if(L(B))return B}t.find=_;function*f(S,L){for(let B of S)L(B)&&(yield B)}t.filter=f;function*d(S,L){let B=0;for(let $ of S)yield L($,B++)}t.map=d;function*m(S,L){let B=0;for(let $ of S)yield*L($,B++)}t.flatMap=m;function*y(...S){for(let L of S)yield*L}t.concat=y;function k(S,L,B){let $=B;for(let U of S)$=L($,U);return $}t.reduce=k;function*R(S,L,B=S.length){for(L<0&&(L+=S.length),B<0?B+=S.length:B>S.length&&(B=S.length);L1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function Ja(...t){return Ci(()=>Hi(t))}function Ci(t){return{dispose:mu(()=>{t()})}}var Za=class Qa{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Hi(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Qa.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};Za.DISABLE_DISPOSED_WARNING=!1;var xn=Za,Gt=class{constructor(){this._store=new xn,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Gt.None=Object.freeze({dispose(){}});var Bs=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},wu=globalThis.performance&&typeof globalThis.performance.now=="function",Su=class el{static create(e){return new el(e)}constructor(e){this._now=wu&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},kn;(t=>{t.None=()=>Gt.None;function e(v,u){return _(v,()=>{},0,void 0,!0,void 0,u)}t.defer=e;function i(v){return(u,p=null,g)=>{let w=!1,b;return b=v(C=>{if(!w)return b?b.dispose():w=!0,u.call(p,C)},null,g),w&&b.dispose(),b}}t.once=i;function s(v,u,p){return a((g,w=null,b)=>v(C=>g.call(w,u(C)),null,b),p)}t.map=s;function r(v,u,p){return a((g,w=null,b)=>v(C=>{u(C),g.call(w,C)},null,b),p)}t.forEach=r;function n(v,u,p){return a((g,w=null,b)=>v(C=>u(C)&&g.call(w,C),null,b),p)}t.filter=n;function o(v){return v}t.signal=o;function l(...v){return(u,p=null,g)=>{let w=Ja(...v.map(b=>b(C=>u.call(p,C))));return c(w,g)}}t.any=l;function h(v,u,p,g){let w=p;return s(v,b=>(w=u(w,b),w),g)}t.reduce=h;function a(v,u){let p,g={onWillAddFirstListener(){p=v(w.fire,w)},onDidRemoveLastListener(){p?.dispose()}},w=new vt(g);return u?.add(w),w.event}function c(v,u){return u instanceof Array?u.push(v):u&&u.add(v),v}function _(v,u,p=100,g=!1,w=!1,b,C){let x,M,F,K=0,z,pe={leakWarningThreshold:b,onWillAddFirstListener(){x=v(ne=>{K++,M=u(M,ne),g&&!F&&(q.fire(M),M=void 0),z=()=>{let O=M;M=void 0,F=void 0,(!g||K>1)&&q.fire(O),K=0},typeof p=="number"?(clearTimeout(F),F=setTimeout(z,p)):F===void 0&&(F=0,queueMicrotask(z))})},onWillRemoveListener(){w&&K>0&&z?.()},onDidRemoveLastListener(){z=void 0,x.dispose()}},q=new vt(pe);return C?.add(q),q.event}t.debounce=_;function f(v,u=0,p){return t.debounce(v,(g,w)=>g?(g.push(w),g):[w],u,void 0,!0,void 0,p)}t.accumulate=f;function d(v,u=(g,w)=>g===w,p){let g=!0,w;return n(v,b=>{let C=g||!u(b,w);return g=!1,w=b,C},p)}t.latch=d;function m(v,u,p){return[t.filter(v,u,p),t.filter(v,g=>!u(g),p)]}t.split=m;function y(v,u=!1,p=[],g){let w=p.slice(),b=v(M=>{w?w.push(M):x.fire(M)});g&&g.add(b);let C=()=>{w?.forEach(M=>x.fire(M)),w=null},x=new vt({onWillAddFirstListener(){b||(b=v(M=>x.fire(M)),g&&g.add(b))},onDidAddFirstListener(){w&&(u?setTimeout(C):C())},onDidRemoveLastListener(){b&&b.dispose(),b=null}});return g&&g.add(x),x.event}t.buffer=y;function k(v,u){return(p,g,w)=>{let b=u(new D);return v(function(C){let x=b.evaluate(C);x!==R&&p.call(g,x)},void 0,w)}}t.chain=k;let R=Symbol("HaltChainable");class D{constructor(){this.steps=[]}map(u){return this.steps.push(u),this}forEach(u){return this.steps.push(p=>(u(p),p)),this}filter(u){return this.steps.push(p=>u(p)?p:R),this}reduce(u,p){let g=p;return this.steps.push(w=>(g=u(g,w),g)),this}latch(u=(p,g)=>p===g){let p=!0,g;return this.steps.push(w=>{let b=p||!u(w,g);return p=!1,g=w,b?w:R}),this}evaluate(u){for(let p of this.steps)if(u=p(u),u===R)break;return u}}function T(v,u,p=g=>g){let g=(...x)=>C.fire(p(...x)),w=()=>v.on(u,g),b=()=>v.removeListener(u,g),C=new vt({onWillAddFirstListener:w,onDidRemoveLastListener:b});return C.event}t.fromNodeEventEmitter=T;function S(v,u,p=g=>g){let g=(...x)=>C.fire(p(...x)),w=()=>v.addEventListener(u,g),b=()=>v.removeEventListener(u,g),C=new vt({onWillAddFirstListener:w,onDidRemoveLastListener:b});return C.event}t.fromDOMEventEmitter=S;function L(v){return new Promise(u=>i(v)(u))}t.toPromise=L;function B(v){let u=new vt;return v.then(p=>{u.fire(p)},()=>{u.fire(void 0)}).finally(()=>{u.dispose()}),u.event}t.fromPromise=B;function $(v,u){return v(p=>u.fire(p))}t.forward=$;function U(v,u,p){return u(p),v(g=>u(g))}t.runAndSubscribe=U;class Y{constructor(u,p){this._observable=u,this._counter=0,this._hasChanged=!1;let g={onWillAddFirstListener:()=>{u.addObserver(this)},onDidRemoveLastListener:()=>{u.removeObserver(this)}};this.emitter=new vt(g),p&&p.add(this.emitter)}beginUpdate(u){this._counter++}handlePossibleChange(u){}handleChange(u,p){this._hasChanged=!0}endUpdate(u){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function le(v,u){return new Y(v,u).emitter.event}t.fromObservable=le;function W(v){return(u,p,g)=>{let w=0,b=!1,C={beginUpdate(){w++},endUpdate(){w--,w===0&&(v.reportChanges(),b&&(b=!1,u.call(p)))},handlePossibleChange(){},handleChange(){b=!0}};v.addObserver(C),v.reportChanges();let x={dispose(){v.removeObserver(C)}};return g instanceof xn?g.add(x):Array.isArray(g)&&g.push(x),x}}t.fromObservableLight=W})(kn||={});var tn=class sn{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${sn._idPool++}`,sn.all.add(this)}start(e){this._stopWatch=new Su,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};tn.all=new Set,tn._idPool=0;var bu=tn,yu=-1,tl=class il{constructor(e,i,s=(il._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,i){let s=this.threshold;if(s<=0||i{let n=this._stacks.get(e.value)||0;this._stacks.set(e.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[s,r]of this._stacks)(!e||i{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let h=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],a=new Lu(`${l}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||Xs)(a),Gt.None}if(this._disposed)return Gt.None;i&&(e=e.bind(i));let r=new Js(e),n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=xu.create(),n=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof Js?(this._deliveryQueue??=new Ru,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=Ci(()=>{n?.(),this._removeListener(r)});return s instanceof xn?s.add(o):Array.isArray(s)&&s.push(o),o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let i=this._listeners,s=i.indexOf(e);if(s===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[s]=void 0;let r=this._deliveryQueue.current===this;if(this._size*Eu<=i.length){let n=0;for(let o=0;o0}},Ru=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},rl=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),Tu;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof Du?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:kn.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:rl})})(Tu||={});var Du=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?rl:(this._emitter||(this._emitter=new vt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},pi="en",Zs=!1,rs,ps=pi,Eo=pi,Au,Rt,si=globalThis,Qe;typeof si.vscode<"u"&&typeof si.vscode.process<"u"?Qe=si.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(Qe=process);var Pu=typeof Qe?.versions?.electron=="string",$u=Pu&&Qe?.type==="renderer";if(typeof Qe=="object"){Qe.platform,Qe.platform,Zs=Qe.platform==="linux",Zs&&Qe.env.SNAP&&Qe.env.SNAP_REVISION,Qe.env.CI||Qe.env.BUILD_ARTIFACTSTAGINGDIRECTORY,rs=pi,ps=pi;let t=Qe.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);rs=e.userLocale,Eo=e.osLocale,ps=e.resolvedLanguage||pi,Au=e.languagePack?.translationsConfigFile}catch{}}else typeof navigator=="object"&&!$u?(Rt=navigator.userAgent,Rt.indexOf("Windows")>=0,Rt.indexOf("Macintosh")>=0,(Rt.indexOf("Macintosh")>=0||Rt.indexOf("iPad")>=0||Rt.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Zs=Rt.indexOf("Linux")>=0,Rt?.indexOf("Mobi")>=0,ps=globalThis._VSCODE_NLS_LANGUAGE||pi,rs=navigator.language.toLowerCase(),Eo=rs):console.error("Unable to resolve platform.");var bt=Rt,Wt=ps,Iu;(t=>{function e(){return Wt}t.value=e;function i(){return Wt.length===2?Wt==="en":Wt.length>=3?Wt[0]==="e"&&Wt[1]==="n"&&Wt[2]==="-":!1}t.isDefaultVariant=i;function s(){return Wt==="en"}t.isDefault=s})(Iu||={});var Ou=typeof si.postMessage=="function"&&!si.importScripts;(()=>{if(Ou){let t=[];si.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=t.length;s{let s=++e;t.push({id:s,callback:i}),si.postMessage({vscodeScheduleAsyncWork:s},"*")}}return t=>setTimeout(t)})();var Fu=!!(bt&&bt.indexOf("Chrome")>=0);bt&&bt.indexOf("Firefox")>=0;!Fu&&bt&&bt.indexOf("Safari")>=0;bt&&bt.indexOf("Edg/")>=0;bt&&bt.indexOf("Android")>=0;function nl(t,e=0,i){let s=setTimeout(()=>{t()},e);return Ci(()=>{clearTimeout(s)})}var Nu;(t=>{async function e(s){let r,n=await Promise.all(s.map(o=>o.then(l=>l,l=>{r||(r=l)})));if(typeof r<"u")throw r;return n}t.settled=e;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}t.withAsyncBody=i})(Nu||={});var Mo=class nt{static fromArray(e){return new nt(i=>{i.emitMany(e)})}static fromPromise(e){return new nt(async i=>{i.emitMany(await e)})}static fromPromises(e){return new nt(async i=>{await Promise.all(e.map(async s=>i.emitOne(await s)))})}static merge(e){return new nt(async i=>{await Promise.all(e.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new vt,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(e(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,i){return new nt(async s=>{for await(let r of e)s.emitOne(i(r))})}map(e){return nt.map(this,e)}static filter(e,i){return new nt(async s=>{for await(let r of e)i(r)&&s.emitOne(r)})}filter(e){return nt.filter(this,e)}static coalesce(e){return nt.filter(e,i=>!!i)}coalesce(){return nt.coalesce(this)}static async toPromise(e){let i=[];for await(let s of e)i.push(s);return i}toPromise(){return nt.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Mo.EMPTY=Mo.fromArray([]);var Wu=class extends Gt{constructor(e){super(),this._terminal=e,this._linesCacheTimeout=this._register(new Bs),this._linesCacheDisposables=this._register(new Bs),this._register(Ci(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=new Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=Ja(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=nl(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(e){return this._linesCache?.[e]}setLineInCache(e,i){this._linesCache&&(this._linesCache[e]=i)}translateBufferLineToStringWithWrap(e,i){let s=[],r=[0],n=this._terminal.buffer.active.getLine(e);for(;n;){let o=this._terminal.buffer.active.getLine(e+1),l=o?o.isWrapped:!1,h=n.translateToString(!l&&i);if(l&&o){let a=n.getCell(n.length-1);a&&a.getCode()===0&&a.getWidth()===1&&o.getCell(0)?.getWidth()===2&&(h=h.slice(0,-1))}if(s.push(h),l)r.push(r[r.length-1]+h.length);else break;e++,n=o}return[s.join(""),r]}},zu=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(e){this._cachedSearchTerm=e}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(e){this._lastSearchOptions=e}isValidSearchTerm(e){return!!(e&&e.length>0)}didOptionsChange(e){return this._lastSearchOptions?e?this._lastSearchOptions.caseSensitive!==e.caseSensitive||this._lastSearchOptions.regex!==e.regex||this._lastSearchOptions.wholeWord!==e.wholeWord:!1:!0}shouldUpdateHighlighting(e,i){return i?.decorations?this._cachedSearchTerm===void 0||e!==this._cachedSearchTerm||this.didOptionsChange(i):!1}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},Hu=class{constructor(e,i){this._terminal=e,this._lineCache=i}find(e,i,s,r){if(!e||e.length===0){this._terminal.clearSelection();return}if(s>this._terminal.cols)throw new Error(`Invalid col: ${s} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let n={startRow:i,startCol:s},o=this._findInLine(e,n,r);if(!o)for(let l=i+1;l=0&&(h.startRow=c,a=this._findInLine(e,h,i,l),!a);c--);}if(!a&&n!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let c=this._terminal.buffer.active.baseY+this._terminal.rows-1;c>=n&&(h.startRow=c,a=this._findInLine(e,h,i,l),!a);c--);return a}_isWholeWord(e,i,s){return(e===0||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(i[e-1]))&&(e+s.length===i.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(i[e+s.length]))}_findInLine(e,i,s={},r=!1){let n=i.startRow,o=i.startCol;if(this._terminal.buffer.active.getLine(n)?.isWrapped){if(r){i.startCol+=this._terminal.cols;return}return i.startRow--,i.startCol+=this._terminal.cols,this._findInLine(e,i,s)}let l=this._lineCache.getLineFromCache(n);l||(l=this._lineCache.translateBufferLineToStringWithWrap(n,!0),this._lineCache.setLineInCache(n,l));let[h,a]=l,c=this._bufferColsToStringOffset(n,o),_=e,f=h;s.regex||(_=s.caseSensitive?e:e.toLowerCase(),f=s.caseSensitive?h:h.toLowerCase());let d=-1;if(s.regex){let m=RegExp(_,s.caseSensitive?"g":"gi"),y;if(r)for(;y=m.exec(f.slice(0,c));)d=m.lastIndex-y[0].length,e=y[0],m.lastIndex-=e.length-1;else y=m.exec(f.slice(c)),y&&y[0].length>0&&(d=c+(m.lastIndex-y[0].length),e=y[0])}else r?c-_.length>=0&&(d=f.lastIndexOf(_,c-_.length)):d=f.indexOf(_,c);if(d>=0){if(s.wholeWord&&!this._isWholeWord(d,f,e))return;let m=0;for(;m=a[m+1];)m++;let y=m;for(;y=a[y+1];)y++;let k=d-a[m],R=d+e.length-a[y],D=this._stringLengthToBufferSize(n+m,k),T=this._stringLengthToBufferSize(n+y,R)-D+this._terminal.cols*(y-m);return{term:e,col:D,row:n+m,size:T}}}_stringLengthToBufferSize(e,i){let s=this._terminal.buffer.active.getLine(e);if(!s)return 0;for(let r=0;r1&&(i-=o.length-1);let l=s.getCell(r+1);l&&l.getWidth()===0&&i++}return i}_bufferColsToStringOffset(e,i){let s=e,r=0,n=this._terminal.buffer.active.getLine(s);for(;i>0&&n;){for(let o=0;othis.clearHighlightDecorations()))}createHighlightDecorations(t,e){this.clearHighlightDecorations();for(let i of t){let s=this._createResultDecorations(i,e,!1);if(s)for(let r of s)this._storeDecoration(r,i)}}createActiveDecoration(t,e){let i=this._createResultDecorations(t,e,!0);if(i)return{decorations:i,match:t,dispose(){Hi(i)}}}clearHighlightDecorations(){Hi(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(t,e){this._highlightedLines.add(t.marker.line),this._highlightDecorations.push({decoration:t,match:e,dispose(){t.dispose()}})}_applyStyles(t,e,i){t.classList.contains("xterm-find-result-decoration")||(t.classList.add("xterm-find-result-decoration"),e&&(t.style.outline=`1px solid ${e}`)),i&&t.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(t,e,i){let s=[],r=t.col,n=t.size,o=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+t.row;for(;n>0;){let h=Math.min(this._terminal.cols-r,n);s.push([o,r,h]),r=0,n-=h,o++}let l=[];for(let h of s){let a=this._terminal.registerMarker(h[0]),c=this._terminal.registerDecoration({marker:a,x:h[1],width:h[2],backgroundColor:i?e.activeMatchBackground:e.matchBackground,overviewRulerOptions:this._highlightedLines.has(a.line)?void 0:{color:i?e.activeMatchColorOverviewRuler:e.matchOverviewRuler,position:"center"}});if(c){let _=[];_.push(a),_.push(c.onRender(f=>this._applyStyles(f,i?e.activeMatchBorder:e.matchBorder,!1))),_.push(c.onDispose(()=>Hi(_))),l.push(c)}}return l.length===0?void 0:l}},qu=class extends Gt{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new vt)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(t){this._selectedDecoration=t}updateResults(t,e){this._searchResults=t.slice(0,e)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(t){for(let e=0;ethis._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(Ci(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=nl(()=>{let t=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(t,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(t){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),t||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(t,e,i){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=e,this._state.shouldUpdateHighlighting(t,e)&&this._highlightAllMatches(t,e);let s=this._findNextAndSelect(t,e,i);return this._fireResults(e),this._state.cachedSearchTerm=t,s}_highlightAllMatches(t,e){if(!this._terminal||!this._engine||!this._decorationManager)throw new Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(t)){this.clearDecorations();return}this.clearDecorations(!0);let i=[],s,r=this._engine.find(t,0,0,e);for(;r&&(s?.row!==r.row||s?.col!==r.col)&&!(i.length>=this._highlightLimit);)s=r,i.push(s),r=this._engine.find(t,s.col+s.term.length>=this._terminal.cols?s.row+1:s.row,s.col+s.term.length>=this._terminal.cols?0:s.col+1,e);this._resultTracker.updateResults(i,this._highlightLimit),e.decorations&&this._decorationManager.createHighlightDecorations(i,e.decorations)}_findNextAndSelect(t,e,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(t))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findNextWithSelection(t,e,this._state.cachedSearchTerm);return this._selectResult(s,e?.decorations,i?.noScroll)}findPrevious(t,e,i){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=e,this._state.shouldUpdateHighlighting(t,e)&&this._highlightAllMatches(t,e);let s=this._findPreviousAndSelect(t,e,i);return this._fireResults(e),this._state.cachedSearchTerm=t,s}_fireResults(t){this._resultTracker.fireResultsChanged(!!t?.decorations)}_findPreviousAndSelect(t,e,i){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(t))return this._terminal.clearSelection(),this.clearDecorations(),!1;let s=this._engine.findPreviousWithSelection(t,e,this._state.cachedSearchTerm);return this._selectResult(s,e?.decorations,i?.noScroll)}_selectResult(t,e,i){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!t)return this._terminal.clearSelection(),!1;if(this._terminal.select(t.col,t.row,t.size),e){let s=this._decorationManager.createActiveDecoration(t,e);s&&(this._resultTracker.selectedDecoration=s)}if(!i&&(t.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||t.rowe[s][1])return!1;for(;s>=i;)if(r=i+s>>1,t>e[r][1])i=r+1;else if(t=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,i){let s=this.wcwidth(e),r=s===0&&i!==0;if(r){let n=Ms.extractWidth(i);n===0?r=!1:n>s&&(s=n)}return Ms.createPropertyValue(0,s,r)}},Yu=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Ro.isErrorNoTelemetry(t)?new Ro(t.message+` - -`+t.stack):new Error(t.message+` - -`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},Xu=new Yu;function er(t){Ju(t)||Xu.onUnexpectedError(t)}var rn="Canceled";function Ju(t){return t instanceof Zu?!0:t instanceof Error&&t.name===rn&&t.message===rn}var Zu=class extends Error{constructor(){super(rn),this.name=this.message}},Ro=class nn extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof nn)return e;let i=new nn;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}};function Qu(t,e){let i=this,s=!1,r;return function(){return s||(s=!0,e||(r=t.apply(i,arguments))),r}}var e_;(t=>{function e(n){return n<0}t.isLessThan=e;function i(n){return n<=0}t.isLessThanOrEqual=i;function s(n){return n>0}t.isGreaterThan=s;function r(n){return n===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(e_||={});var ol;(t=>{function e(S){return S&&typeof S=="object"&&typeof S[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function s(){return i}t.empty=s;function*r(S){yield S}t.single=r;function n(S){return e(S)?S:r(S)}t.wrap=n;function o(S){return S||i}t.from=o;function*l(S){for(let L=S.length-1;L>=0;L--)yield S[L]}t.reverse=l;function h(S){return!S||S[Symbol.iterator]().next().done===!0}t.isEmpty=h;function a(S){return S[Symbol.iterator]().next().value}t.first=a;function c(S,L){let B=0;for(let $ of S)if(L($,B++))return!0;return!1}t.some=c;function _(S,L){for(let B of S)if(L(B))return B}t.find=_;function*f(S,L){for(let B of S)L(B)&&(yield B)}t.filter=f;function*d(S,L){let B=0;for(let $ of S)yield L($,B++)}t.map=d;function*m(S,L){let B=0;for(let $ of S)yield*L($,B++)}t.flatMap=m;function*y(...S){for(let L of S)yield*L}t.concat=y;function k(S,L,B){let $=B;for(let U of S)$=L($,U);return $}t.reduce=k;function*R(S,L,B=S.length){for(L<0&&(L+=S.length),B<0?B+=S.length:B>S.length&&(B=S.length);L1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function t_(...t){return ll(()=>al(t))}function ll(t){return{dispose:Qu(()=>{t()})}}var hl=class cl{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{al(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?cl.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};hl.DISABLE_DISPOSED_WARNING=!1;var Ln=hl,Es=class{constructor(){this._store=new Ln,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};Es.None=Object.freeze({dispose(){}});var i_=globalThis.performance&&typeof globalThis.performance.now=="function",s_=class dl{static create(e){return new dl(e)}constructor(e){this._now=i_&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},r_;(t=>{t.None=()=>Es.None;function e(v,u){return _(v,()=>{},0,void 0,!0,void 0,u)}t.defer=e;function i(v){return(u,p=null,g)=>{let w=!1,b;return b=v(C=>{if(!w)return b?b.dispose():w=!0,u.call(p,C)},null,g),w&&b.dispose(),b}}t.once=i;function s(v,u,p){return a((g,w=null,b)=>v(C=>g.call(w,u(C)),null,b),p)}t.map=s;function r(v,u,p){return a((g,w=null,b)=>v(C=>{u(C),g.call(w,C)},null,b),p)}t.forEach=r;function n(v,u,p){return a((g,w=null,b)=>v(C=>u(C)&&g.call(w,C),null,b),p)}t.filter=n;function o(v){return v}t.signal=o;function l(...v){return(u,p=null,g)=>{let w=t_(...v.map(b=>b(C=>u.call(p,C))));return c(w,g)}}t.any=l;function h(v,u,p,g){let w=p;return s(v,b=>(w=u(w,b),w),g)}t.reduce=h;function a(v,u){let p,g={onWillAddFirstListener(){p=v(w.fire,w)},onDidRemoveLastListener(){p?.dispose()}},w=new Ht(g);return u?.add(w),w.event}function c(v,u){return u instanceof Array?u.push(v):u&&u.add(v),v}function _(v,u,p=100,g=!1,w=!1,b,C){let x,M,F,K=0,z,pe={leakWarningThreshold:b,onWillAddFirstListener(){x=v(ne=>{K++,M=u(M,ne),g&&!F&&(q.fire(M),M=void 0),z=()=>{let O=M;M=void 0,F=void 0,(!g||K>1)&&q.fire(O),K=0},typeof p=="number"?(clearTimeout(F),F=setTimeout(z,p)):F===void 0&&(F=0,queueMicrotask(z))})},onWillRemoveListener(){w&&K>0&&z?.()},onDidRemoveLastListener(){z=void 0,x.dispose()}},q=new Ht(pe);return C?.add(q),q.event}t.debounce=_;function f(v,u=0,p){return t.debounce(v,(g,w)=>g?(g.push(w),g):[w],u,void 0,!0,void 0,p)}t.accumulate=f;function d(v,u=(g,w)=>g===w,p){let g=!0,w;return n(v,b=>{let C=g||!u(b,w);return g=!1,w=b,C},p)}t.latch=d;function m(v,u,p){return[t.filter(v,u,p),t.filter(v,g=>!u(g),p)]}t.split=m;function y(v,u=!1,p=[],g){let w=p.slice(),b=v(M=>{w?w.push(M):x.fire(M)});g&&g.add(b);let C=()=>{w?.forEach(M=>x.fire(M)),w=null},x=new Ht({onWillAddFirstListener(){b||(b=v(M=>x.fire(M)),g&&g.add(b))},onDidAddFirstListener(){w&&(u?setTimeout(C):C())},onDidRemoveLastListener(){b&&b.dispose(),b=null}});return g&&g.add(x),x.event}t.buffer=y;function k(v,u){return(p,g,w)=>{let b=u(new D);return v(function(C){let x=b.evaluate(C);x!==R&&p.call(g,x)},void 0,w)}}t.chain=k;let R=Symbol("HaltChainable");class D{constructor(){this.steps=[]}map(u){return this.steps.push(u),this}forEach(u){return this.steps.push(p=>(u(p),p)),this}filter(u){return this.steps.push(p=>u(p)?p:R),this}reduce(u,p){let g=p;return this.steps.push(w=>(g=u(g,w),g)),this}latch(u=(p,g)=>p===g){let p=!0,g;return this.steps.push(w=>{let b=p||!u(w,g);return p=!1,g=w,b?w:R}),this}evaluate(u){for(let p of this.steps)if(u=p(u),u===R)break;return u}}function T(v,u,p=g=>g){let g=(...x)=>C.fire(p(...x)),w=()=>v.on(u,g),b=()=>v.removeListener(u,g),C=new Ht({onWillAddFirstListener:w,onDidRemoveLastListener:b});return C.event}t.fromNodeEventEmitter=T;function S(v,u,p=g=>g){let g=(...x)=>C.fire(p(...x)),w=()=>v.addEventListener(u,g),b=()=>v.removeEventListener(u,g),C=new Ht({onWillAddFirstListener:w,onDidRemoveLastListener:b});return C.event}t.fromDOMEventEmitter=S;function L(v){return new Promise(u=>i(v)(u))}t.toPromise=L;function B(v){let u=new Ht;return v.then(p=>{u.fire(p)},()=>{u.fire(void 0)}).finally(()=>{u.dispose()}),u.event}t.fromPromise=B;function $(v,u){return v(p=>u.fire(p))}t.forward=$;function U(v,u,p){return u(p),v(g=>u(g))}t.runAndSubscribe=U;class Y{constructor(u,p){this._observable=u,this._counter=0,this._hasChanged=!1;let g={onWillAddFirstListener:()=>{u.addObserver(this)},onDidRemoveLastListener:()=>{u.removeObserver(this)}};this.emitter=new Ht(g),p&&p.add(this.emitter)}beginUpdate(u){this._counter++}handlePossibleChange(u){}handleChange(u,p){this._hasChanged=!0}endUpdate(u){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function le(v,u){return new Y(v,u).emitter.event}t.fromObservable=le;function W(v){return(u,p,g)=>{let w=0,b=!1,C={beginUpdate(){w++},endUpdate(){w--,w===0&&(v.reportChanges(),b&&(b=!1,u.call(p)))},handlePossibleChange(){},handleChange(){b=!0}};v.addObserver(C),v.reportChanges();let x={dispose(){v.removeObserver(C)}};return g instanceof Ln?g.add(x):Array.isArray(g)&&g.push(x),x}}t.fromObservableLight=W})(r_||={});var on=class an{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${an._idPool++}`,an.all.add(this)}start(e){this._stopWatch=new s_,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};on.all=new Set,on._idPool=0;var n_=on,o_=-1,ul=class _l{constructor(e,i,s=(_l._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,i){let s=this.threshold;if(s<=0||i{let n=this._stacks.get(e.value)||0;this._stacks.set(e.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[s,r]of this._stacks)(!e||i{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let l=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(l);let h=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],a=new c_(`${l}. HINT: Stack shows most frequent listener (${h[1]}-times)`,h[0]);return(this._options?.onListenerError||er)(a),Es.None}if(this._disposed)return Es.None;i&&(e=e.bind(i));let r=new tr(e),n;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=l_.create(),n=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof tr?(this._deliveryQueue??=new f_,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let o=ll(()=>{n?.(),this._removeListener(r)});return s instanceof Ln?s.add(o):Array.isArray(s)&&s.push(o),o},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let i=this._listeners,s=i.indexOf(e);if(s===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[s]=void 0;let r=this._deliveryQueue.current===this;if(this._size*u_<=i.length){let n=0;for(let o=0;o0}},f_=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Ms=class vs{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new Ht,this.onChange=this._onChange.event;let e=new Gu;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,i,s=!1){return(e&16777215)<<3|(i&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let i=0,s=0,r=e.length;for(let n=0;n=r)return i+this.wcwidth(o);let a=e.charCodeAt(n);56320<=a&&a<=57343?o=(o-55296)*1024+a-56320+65536:i+=this.wcwidth(a)}let l=this.charProperties(o,s),h=vs.extractWidth(l);vs.extractShouldJoin(l)&&(h-=vs.extractWidth(s)),i+=h,s=l}return i}charProperties(e,i){return this._activeProvider.charProperties(e,i)}},ir=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],g_=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],sr=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],p_=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],kt;function To(t,e){let i=0,s=e.length-1,r;if(te[s][1])return!1;for(;s>=i;)if(r=i+s>>1,t>e[r][1])i=r+1;else if(ti&&(i=r)}return Ms.createPropertyValue(0,i,s)}},m_=class{activate(t){t.unicode.register(new v_)}dispose(){}};/** - * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved. - * @license MIT - * - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * @license MIT - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - */var w_=(t,e,i,s)=>{for(var r=e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=o(r)||r);return r},S_=(t,e)=>(i,s)=>e(i,s,t),b_=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?Do.isErrorNoTelemetry(t)?new Do(t.message+` - -`+t.stack):new Error(t.message+` - -`+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},y_=new b_;function rr(t){C_(t)||y_.onUnexpectedError(t)}var ln="Canceled";function C_(t){return t instanceof x_?!0:t instanceof Error&&t.name===ln&&t.message===ln}var x_=class extends Error{constructor(){super(ln),this.name=this.message}},Do=class hn extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof hn)return e;let i=new hn;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},k_;(t=>{function e(n){return n<0}t.isLessThan=e;function i(n){return n<=0}t.isLessThanOrEqual=i;function s(n){return n>0}t.isGreaterThan=s;function r(n){return n===0}t.isNeitherLessOrGreaterThan=r,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(k_||={});function L_(t,e){let i=this,s=!1,r;return function(){return s||(s=!0,e||(r=t.apply(i,arguments))),r}}var gl;(t=>{function e(S){return S&&typeof S=="object"&&typeof S[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function s(){return i}t.empty=s;function*r(S){yield S}t.single=r;function n(S){return e(S)?S:r(S)}t.wrap=n;function o(S){return S||i}t.from=o;function*l(S){for(let L=S.length-1;L>=0;L--)yield S[L]}t.reverse=l;function h(S){return!S||S[Symbol.iterator]().next().done===!0}t.isEmpty=h;function a(S){return S[Symbol.iterator]().next().value}t.first=a;function c(S,L){let B=0;for(let $ of S)if(L($,B++))return!0;return!1}t.some=c;function _(S,L){for(let B of S)if(L(B))return B}t.find=_;function*f(S,L){for(let B of S)L(B)&&(yield B)}t.filter=f;function*d(S,L){let B=0;for(let $ of S)yield L($,B++)}t.map=d;function*m(S,L){let B=0;for(let $ of S)yield*L($,B++)}t.flatMap=m;function*y(...S){for(let L of S)yield*L}t.concat=y;function k(S,L,B){let $=B;for(let U of S)$=L($,U);return $}t.reduce=k;function*R(S,L,B=S.length){for(L<0&&(L+=S.length),B<0?B+=S.length:B>S.length&&(B=S.length);L1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function vl(...t){return We(()=>pl(t))}function We(t){return{dispose:L_(()=>{t()})}}var ml=class wl{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{pl(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?wl.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};ml.DISABLE_DISPOSED_WARNING=!1;var wi=ml,dt=class{constructor(){this._store=new wi,this._store}dispose(){this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}};dt.None=Object.freeze({dispose(){}});var Ti=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){this._isDisposed||t===this._value||(this._value?.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},Bn=typeof process<"u"&&"title"in process,$s=Bn?"node":navigator.userAgent,B_=Bn?"node":navigator.platform,E_=$s.includes("Firefox"),M_=$s.includes("Edge"),Sl=/^((?!chrome|android).)*safari/i.test($s);function R_(){if(!Sl)return 0;let t=$s.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}B_.indexOf("Linux")>=0;var T_="",Ae=0,Pe=0,$e=0,de=0,ot={css:"#00000000",rgba:0},Ke;(t=>{function e(r,n,o,l){return l!==void 0?`#${Jt(r)}${Jt(n)}${Jt(o)}${Jt(l)}`:`#${Jt(r)}${Jt(n)}${Jt(o)}`}t.toCss=e;function i(r,n,o,l=255){return(r<<24|n<<16|o<<8|l)>>>0}t.toRgba=i;function s(r,n,o,l){return{css:t.toCss(r,n,o,l),rgba:t.toRgba(r,n,o,l)}}t.toColor=s})(Ke||={});var Wi;(t=>{function e(h,a){if(de=(a.rgba&255)/255,de===1)return{css:a.css,rgba:a.rgba};let c=a.rgba>>24&255,_=a.rgba>>16&255,f=a.rgba>>8&255,d=h.rgba>>24&255,m=h.rgba>>16&255,y=h.rgba>>8&255;Ae=d+Math.round((c-d)*de),Pe=m+Math.round((_-m)*de),$e=y+Math.round((f-y)*de);let k=Ke.toCss(Ae,Pe,$e),R=Ke.toRgba(Ae,Pe,$e);return{css:k,rgba:R}}t.blend=e;function i(h){return(h.rgba&255)===255}t.isOpaque=i;function s(h,a,c){let _=ri.ensureContrastRatio(h.rgba,a.rgba,c);if(_)return Ke.toColor(_>>24&255,_>>16&255,_>>8&255)}t.ensureContrastRatio=s;function r(h){let a=(h.rgba|255)>>>0;return[Ae,Pe,$e]=ri.toChannels(a),{css:Ke.toCss(Ae,Pe,$e),rgba:a}}t.opaque=r;function n(h,a){return de=Math.round(a*255),[Ae,Pe,$e]=ri.toChannels(h.rgba),{css:Ke.toCss(Ae,Pe,$e,de),rgba:Ke.toRgba(Ae,Pe,$e,de)}}t.opacity=n;function o(h,a){return de=h.rgba&255,n(h,de*a/255)}t.multiplyOpacity=o;function l(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}t.toColorRGB=l})(Wi||={});var D_;(t=>{let e,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(e=n,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return Ae=parseInt(r.slice(1,2).repeat(2),16),Pe=parseInt(r.slice(2,3).repeat(2),16),$e=parseInt(r.slice(3,4).repeat(2),16),Ke.toColor(Ae,Pe,$e);case 5:return Ae=parseInt(r.slice(1,2).repeat(2),16),Pe=parseInt(r.slice(2,3).repeat(2),16),$e=parseInt(r.slice(3,4).repeat(2),16),de=parseInt(r.slice(4,5).repeat(2),16),Ke.toColor(Ae,Pe,$e,de);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let n=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return Ae=parseInt(n[1]),Pe=parseInt(n[2]),$e=parseInt(n[3]),de=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),Ke.toColor(Ae,Pe,$e,de);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=r,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Ae,Pe,$e,de]=e.getImageData(0,0,1,1).data,de!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ke.toRgba(Ae,Pe,$e,de),css:r}}t.toColor=s})(D_||={});var qe;(t=>{function e(s){return i(s>>16&255,s>>8&255,s&255)}t.relativeLuminance=e;function i(s,r,n){let o=s/255,l=r/255,h=n/255,a=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),c=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),_=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return a*.2126+c*.7152+_*.0722}t.relativeLuminance2=i})(qe||={});var ri;(t=>{function e(o,l){if(de=(l&255)/255,de===1)return l;let h=l>>24&255,a=l>>16&255,c=l>>8&255,_=o>>24&255,f=o>>16&255,d=o>>8&255;return Ae=_+Math.round((h-_)*de),Pe=f+Math.round((a-f)*de),$e=d+Math.round((c-d)*de),Ke.toRgba(Ae,Pe,$e)}t.blend=e;function i(o,l,h){let a=qe.relativeLuminance(o>>8),c=qe.relativeLuminance(l>>8);if(Lt(a,c)>8));if(m>8));return m>k?d:y}return d}let _=r(o,l,h),f=Lt(a,qe.relativeLuminance(_>>8));if(f>8));return f>m?_:d}return _}}t.ensureContrastRatio=i;function s(o,l,h){let a=o>>24&255,c=o>>16&255,_=o>>8&255,f=l>>24&255,d=l>>16&255,m=l>>8&255,y=Lt(qe.relativeLuminance2(f,d,m),qe.relativeLuminance2(a,c,_));for(;y0||d>0||m>0);)f-=Math.max(0,Math.ceil(f*.1)),d-=Math.max(0,Math.ceil(d*.1)),m-=Math.max(0,Math.ceil(m*.1)),y=Lt(qe.relativeLuminance2(f,d,m),qe.relativeLuminance2(a,c,_));return(f<<24|d<<16|m<<8|255)>>>0}t.reduceLuminance=s;function r(o,l,h){let a=o>>24&255,c=o>>16&255,_=o>>8&255,f=l>>24&255,d=l>>16&255,m=l>>8&255,y=Lt(qe.relativeLuminance2(f,d,m),qe.relativeLuminance2(a,c,_));for(;y>>0}t.increaseLuminance=r;function n(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=n})(ri||={});function Jt(t){let e=t.toString(16);return e.length<2?"0"+e:e}function Lt(t,e){return t=128512&&t<=128591||t>=127744&&t<=128511||t>=128640&&t<=128767||t>=9728&&t<=9983||t>=9984&&t<=10175||t>=65024&&t<=65039||t>=129280&&t<=129535||t>=127462&&t<=127487}function O_(t,e,i,s){return e===1&&i>Math.ceil(s*1.5)&&t!==void 0&&t>255&&!I_(t)&&!En(t)&&!P_(t)}function bl(t){return En(t)||$_(t)}function F_(){return{css:{canvas:ns(),cell:ns()},device:{canvas:ns(),cell:ns(),char:{width:0,height:0,left:0,top:0}}}}function ns(){return{width:0,height:0}}function N_(t,e,i=0){return(t-(Math.round(e)*2-i))%(Math.round(e)*2)}var Oe=0,Ee=0,gt=!1,Bt=!1,os=!1,Ye,nr=0,W_=class{constructor(t,e,i,s,r,n){this._terminal=t,this._optionService=e,this._selectionRenderModel=i,this._decorationService=s,this._coreBrowserService=r,this._themeService=n,this.result={fg:0,bg:0,ext:0}}resolve(t,e,i,s){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=t.bg&268435456?t.extended.ext:0,Ee=0,Oe=0,Bt=!1,gt=!1,os=!1,Ye=this._themeService.colors,nr=0,t.getCode()!==0&&t.extended.underlineStyle===4){let r=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));nr=e*s%(Math.round(r)*2)}if(this._decorationService.forEachDecorationAtCell(e,i,"bottom",r=>{r.backgroundColorRGB&&(Ee=r.backgroundColorRGB.rgba>>8&16777215,Bt=!0),r.foregroundColorRGB&&(Oe=r.foregroundColorRGB.rgba>>8&16777215,gt=!0)}),os=this._selectionRenderModel.isCellSelected(this._terminal,e,i),os){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:Ee=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Ee=(this.result.fg&16777215)<<8|255;break;case 0:default:Ee=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:Ee=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Ee=(this.result.bg&16777215)<<8|255;break}Ee=ri.blend(Ee,(this._coreBrowserService.isFocused?Ye.selectionBackgroundOpaque:Ye.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else Ee=(this._coreBrowserService.isFocused?Ye.selectionBackgroundOpaque:Ye.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Bt=!0,Ye.selectionForeground&&(Oe=Ye.selectionForeground.rgba>>8&16777215,gt=!0),bl(t.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Oe=(this._coreBrowserService.isFocused?Ye.selectionBackgroundOpaque:Ye.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Oe=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Oe=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Oe=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Oe=(this.result.fg&16777215)<<8|255;break;case 0:default:Oe=this._themeService.colors.foreground.rgba}Oe=ri.blend(Oe,(this._coreBrowserService.isFocused?Ye.selectionBackgroundOpaque:Ye.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}gt=!0}}this._decorationService.forEachDecorationAtCell(e,i,"top",r=>{r.backgroundColorRGB&&(Ee=r.backgroundColorRGB.rgba>>8&16777215,Bt=!0),r.foregroundColorRGB&&(Oe=r.foregroundColorRGB.rgba>>8&16777215,gt=!0)}),Bt&&(os?Ee=t.bg&-16777216&-134217729|Ee|50331648:Ee=t.bg&-16777216|Ee|50331648),gt&&(Oe=t.fg&-16777216&-67108865|Oe|50331648),this.result.fg&67108864&&(Bt&&!gt&&((this.result.bg&50331648)===0?Oe=this.result.fg&-134217728|Ye.background.rgba>>8&16777215&16777215|50331648:Oe=this.result.fg&-134217728|this.result.bg&67108863,gt=!0),!Bt&>&&((this.result.fg&50331648)===0?Ee=this.result.bg&-67108864|Ye.foreground.rgba>>8&16777215&16777215|50331648:Ee=this.result.bg&-67108864|this.result.fg&67108863,Bt=!0)),Ye=void 0,this.result.bg=Bt?Ee:this.result.bg,this.result.fg=gt?Oe:this.result.fg,this.result.ext&=536870911,this.result.ext|=nr<<29&3758096384}},z_=.5,yl=E_||M_?"bottom":"ideographic",H_={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},U_={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},q_={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╒":{1:(t,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(t,e)=>`M${.5-t},1 L${.5-t},.5 L1,.5 M${.5+t},.5 L${.5+t},1`},"╔":{1:(t,e)=>`M1,${.5-e} L${.5-t},${.5-e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╕":{1:(t,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(t,e)=>`M${.5+t},1 L${.5+t},.5 L0,.5 M${.5-t},.5 L${.5-t},1`},"╗":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5+t},${.5-e} L${.5+t},1`},"╘":{1:(t,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(t,e)=>`M1,.5 L${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╚":{1:(t,e)=>`M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0 M1,${.5+e} L${.5-t},${.5+e} L${.5-t},0`},"╛":{1:(t,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(t,e)=>`M0,.5 L${.5+t},.5 L${.5+t},0 M${.5-t},.5 L${.5-t},0`},"╝":{1:(t,e)=>`M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M0,${.5+e} L${.5+t},${.5+e} L${.5+t},0`},"╞":{1:(t,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1 M${.5+t},.5 L1,.5`},"╠":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╡":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(t,e)=>`M0,.5 L${.5-t},.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╣":{1:(t,e)=>`M${.5+t},0 L${.5+t},1 M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0`},"╤":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},1 M${.5+t},.5 L${.5+t},1`},"╦":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╧":{1:(t,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╩":{1:(t,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╪":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╬":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},Vi={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};Vi[""]=Vi[""];Vi[""]=Vi[""];function K_(t,e,i,s,r,n,o,l){let h=H_[e];if(h)return V_(t,h,i,s,r,n),!0;let a=U_[e];if(a)return j_(t,a,i,s,r,n),!0;let c=q_[e];if(c)return G_(t,c,i,s,r,n,l),!0;let _=Vi[e];return _?(Y_(t,_,i,s,r,n,o,l),!0):!1}function V_(t,e,i,s,r,n){for(let o=0;o7&&parseInt(l.slice(7,9),16)||1;else if(l.startsWith("rgba"))[m,y,k,R]=l.substring(5,l.length-1).split(",").map(D=>parseFloat(D));else throw new Error(`Unexpected fillStyle color format "${l}" when drawing pattern glyph`);for(let D=0;Dt.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(t,e)=>t.lineTo(e[0],e[1]),M:(t,e)=>t.moveTo(e[0],e[1])};function xl(t,e,i,s,r,n,o,l=0,h=0){let a=t.map(c=>parseFloat(c)||parseInt(c));if(a.length<2)throw new Error("Too few arguments for instruction");for(let c=0;cr){s-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-e))}ms`),this._start();return}s=r}this.clear()}},X_=class extends kl{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let e=performance.now()+t;return{timeRemaining:()=>Math.max(0,e-performance.now())}}},J_=class extends kl{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},Z_=!Bn&&"requestIdleCallback"in window?J_:X_,vi=class Ll{constructor(){this.fg=0,this.bg=0,this.extended=new Bl}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new Ll;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Bl=class El{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new El(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Q_=globalThis.performance&&typeof globalThis.performance.now=="function",ef=class Ml{static create(e){return new Ml(e)}constructor(e){this._now=Q_&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Pt;(t=>{t.None=()=>dt.None;function e(v,u){return _(v,()=>{},0,void 0,!0,void 0,u)}t.defer=e;function i(v){return(u,p=null,g)=>{let w=!1,b;return b=v(C=>{if(!w)return b?b.dispose():w=!0,u.call(p,C)},null,g),w&&b.dispose(),b}}t.once=i;function s(v,u,p){return a((g,w=null,b)=>v(C=>g.call(w,u(C)),null,b),p)}t.map=s;function r(v,u,p){return a((g,w=null,b)=>v(C=>{u(C),g.call(w,C)},null,b),p)}t.forEach=r;function n(v,u,p){return a((g,w=null,b)=>v(C=>u(C)&&g.call(w,C),null,b),p)}t.filter=n;function o(v){return v}t.signal=o;function l(...v){return(u,p=null,g)=>{let w=vl(...v.map(b=>b(C=>u.call(p,C))));return c(w,g)}}t.any=l;function h(v,u,p,g){let w=p;return s(v,b=>(w=u(w,b),w),g)}t.reduce=h;function a(v,u){let p,g={onWillAddFirstListener(){p=v(w.fire,w)},onDidRemoveLastListener(){p?.dispose()}},w=new se(g);return u?.add(w),w.event}function c(v,u){return u instanceof Array?u.push(v):u&&u.add(v),v}function _(v,u,p=100,g=!1,w=!1,b,C){let x,M,F,K=0,z,pe={leakWarningThreshold:b,onWillAddFirstListener(){x=v(ne=>{K++,M=u(M,ne),g&&!F&&(q.fire(M),M=void 0),z=()=>{let O=M;M=void 0,F=void 0,(!g||K>1)&&q.fire(O),K=0},typeof p=="number"?(clearTimeout(F),F=setTimeout(z,p)):F===void 0&&(F=0,queueMicrotask(z))})},onWillRemoveListener(){w&&K>0&&z?.()},onDidRemoveLastListener(){z=void 0,x.dispose()}},q=new se(pe);return C?.add(q),q.event}t.debounce=_;function f(v,u=0,p){return t.debounce(v,(g,w)=>g?(g.push(w),g):[w],u,void 0,!0,void 0,p)}t.accumulate=f;function d(v,u=(g,w)=>g===w,p){let g=!0,w;return n(v,b=>{let C=g||!u(b,w);return g=!1,w=b,C},p)}t.latch=d;function m(v,u,p){return[t.filter(v,u,p),t.filter(v,g=>!u(g),p)]}t.split=m;function y(v,u=!1,p=[],g){let w=p.slice(),b=v(M=>{w?w.push(M):x.fire(M)});g&&g.add(b);let C=()=>{w?.forEach(M=>x.fire(M)),w=null},x=new se({onWillAddFirstListener(){b||(b=v(M=>x.fire(M)),g&&g.add(b))},onDidAddFirstListener(){w&&(u?setTimeout(C):C())},onDidRemoveLastListener(){b&&b.dispose(),b=null}});return g&&g.add(x),x.event}t.buffer=y;function k(v,u){return(p,g,w)=>{let b=u(new D);return v(function(C){let x=b.evaluate(C);x!==R&&p.call(g,x)},void 0,w)}}t.chain=k;let R=Symbol("HaltChainable");class D{constructor(){this.steps=[]}map(u){return this.steps.push(u),this}forEach(u){return this.steps.push(p=>(u(p),p)),this}filter(u){return this.steps.push(p=>u(p)?p:R),this}reduce(u,p){let g=p;return this.steps.push(w=>(g=u(g,w),g)),this}latch(u=(p,g)=>p===g){let p=!0,g;return this.steps.push(w=>{let b=p||!u(w,g);return p=!1,g=w,b?w:R}),this}evaluate(u){for(let p of this.steps)if(u=p(u),u===R)break;return u}}function T(v,u,p=g=>g){let g=(...x)=>C.fire(p(...x)),w=()=>v.on(u,g),b=()=>v.removeListener(u,g),C=new se({onWillAddFirstListener:w,onDidRemoveLastListener:b});return C.event}t.fromNodeEventEmitter=T;function S(v,u,p=g=>g){let g=(...x)=>C.fire(p(...x)),w=()=>v.addEventListener(u,g),b=()=>v.removeEventListener(u,g),C=new se({onWillAddFirstListener:w,onDidRemoveLastListener:b});return C.event}t.fromDOMEventEmitter=S;function L(v){return new Promise(u=>i(v)(u))}t.toPromise=L;function B(v){let u=new se;return v.then(p=>{u.fire(p)},()=>{u.fire(void 0)}).finally(()=>{u.dispose()}),u.event}t.fromPromise=B;function $(v,u){return v(p=>u.fire(p))}t.forward=$;function U(v,u,p){return u(p),v(g=>u(g))}t.runAndSubscribe=U;class Y{constructor(u,p){this._observable=u,this._counter=0,this._hasChanged=!1;let g={onWillAddFirstListener:()=>{u.addObserver(this)},onDidRemoveLastListener:()=>{u.removeObserver(this)}};this.emitter=new se(g),p&&p.add(this.emitter)}beginUpdate(u){this._counter++}handlePossibleChange(u){}handleChange(u,p){this._hasChanged=!0}endUpdate(u){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function le(v,u){return new Y(v,u).emitter.event}t.fromObservable=le;function W(v){return(u,p,g)=>{let w=0,b=!1,C={beginUpdate(){w++},endUpdate(){w--,w===0&&(v.reportChanges(),b&&(b=!1,u.call(p)))},handlePossibleChange(){},handleChange(){b=!0}};v.addObserver(C),v.reportChanges();let x={dispose(){v.removeObserver(C)}};return g instanceof wi?g.add(x):Array.isArray(g)&&g.push(x),x}}t.fromObservableLight=W})(Pt||={});var cn=class dn{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${dn._idPool++}`,dn.all.add(this)}start(e){this._stopWatch=new ef,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};cn.all=new Set,cn._idPool=0;var tf=cn,sf=-1,Rl=class Tl{constructor(e,i,s=(Tl._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,i){let s=this.threshold;if(s<=0||i{let n=this._stacks.get(e.value)||0;this._stacks.set(e.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[s,r]of this._stacks)(!e||i{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let o=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(o);let l=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new af(`${o}. HINT: Stack shows most frequent listener (${l[1]}-times)`,l[0]);return(this._options?.onListenerError||rr)(h),dt.None}if(this._disposed)return dt.None;e&&(t=t.bind(e));let s=new or(t),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=nf.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof or?(this._deliveryQueue??=new df,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let n=We(()=>{r?.(),this._removeListener(s)});return i instanceof wi?i.add(n):Array.isArray(i)&&i.push(n),n},this._event}_removeListener(t){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let e=this._listeners,i=e.indexOf(t);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,e[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*hf<=e.length){let r=0;for(let n=0;n0}},df=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Oo={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},Di=2,Ai,Ut=class fi{constructor(e,i,s){this._document=e,this._config=i,this._unicodeService=s,this._didWarmUp=!1,this._cacheMap=new Io,this._cacheMapCombined=new Io,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new vi,this._textureSize=512,this._onAddTextureAtlasCanvas=new se,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new se,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=Al(e,this._config.deviceCellWidth*4+Di*2,this._config.deviceCellHeight+Di*2),this._tmpCtx=we(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let e=new Z_;for(let i=33;i<126;i++)e.enqueue(()=>{if(!this._cacheMap.get(i,0,0,0)){let s=this._drawToCache(i,0,0,0,!1,void 0);this._cacheMap.set(i,0,0,0,s)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(fi.maxAtlasPages&&this._pages.length>=Math.max(4,fi.maxAtlasPages)){let i=this._pages.filter(a=>a.canvas.width*2<=(fi.maxTextureSize||4096)).sort((a,c)=>c.canvas.width!==a.canvas.width?c.canvas.width-a.canvas.width:c.percentageUsed-a.percentageUsed),s=-1,r=0;for(let a=0;aa.glyphs[0].texturePage).sort((a,c)=>a>c?1:-1),l=this.pages.length-n.length,h=this._mergePages(n,l);h.version++;for(let a=o.length-1;a>=0;a--)this._deletePage(o[a]);this.pages.push(h),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(h.canvas)}let e=new ar(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,i){let s=e[0].canvas.width*2,r=new ar(this._document,s,e);for(let[n,o]of e.entries()){let l=n*o.canvas.width%s,h=Math.floor(n/2)*o.canvas.height;r.ctx.drawImage(o.canvas,l,h);for(let c of o.glyphs)c.texturePage=i,c.sizeClipSpace.x=c.size.x/s,c.sizeClipSpace.y=c.size.y/s,c.texturePosition.x+=l,c.texturePosition.y+=h,c.texturePositionClipSpace.x=c.texturePosition.x/s,c.texturePositionClipSpace.y=c.texturePosition.y/s;this._onRemoveTextureAtlasCanvas.fire(o.canvas);let a=this._activePages.indexOf(o);a!==-1&&this._activePages.splice(a,1)}return r}_deletePage(e){this._pages.splice(e,1);for(let i=e;i=this._config.colors.ansi.length)throw new Error("No color found for idx "+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,i,s,r){if(this._config.allowTransparency)return ot;let n;switch(e){case 16777216:case 33554432:n=this._getColorFromAnsiIndex(i);break;case 50331648:let o=vi.toColorRGB(i);n=Ke.toColor(o[0],o[1],o[2]);break;case 0:default:s?n=Wi.opaque(this._config.colors.foreground):n=this._config.colors.background;break}return this._config.allowTransparency||(n=Wi.opaque(n)),n}_getForegroundColor(e,i,s,r,n,o,l,h,a,c){let _=this._getMinimumContrastColor(e,i,s,r,n,o,l,a,h,c);if(_)return _;let f;switch(n){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&a&&o<8&&(o+=8),f=this._getColorFromAnsiIndex(o);break;case 50331648:let d=vi.toColorRGB(o);f=Ke.toColor(d[0],d[1],d[2]);break;case 0:default:l?f=this._config.colors.background:f=this._config.colors.foreground}return this._config.allowTransparency&&(f=Wi.opaque(f)),h&&(f=Wi.multiplyOpacity(f,z_)),f}_resolveBackgroundRgba(e,i,s){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;case 0:default:return s?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,i,s,r){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&r&&i<8&&(i+=8),this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;case 0:default:return s?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,i,s,r,n,o,l,h,a,c){if(this._config.minimumContrastRatio===1||c)return;let _=this._getContrastCache(a),f=_.getColor(e,r);if(f!==void 0)return f||void 0;let d=this._resolveBackgroundRgba(i,s,l),m=this._resolveForegroundRgba(n,o,l,h),y=ri.ensureContrastRatio(d,m,this._config.minimumContrastRatio/(a?2:1));if(!y){_.setColor(e,r,null);return}let k=Ke.toColor(y>>24&255,y>>16&255,y>>8&255);return _.setColor(e,r,k),k}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(e,i,s,r,n,o){let l=typeof e=="number"?String.fromCharCode(e):e;o&&this._tmpCanvas.parentElement!==o&&(this._tmpCanvas.style.display="none",o.append(this._tmpCanvas));let h=Math.min(this._config.deviceCellWidth*Math.max(l.length,2)+Di*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width=M?M*2-ne:M-ne;ne>=M||N===0?(this._tmpCtx.setLineDash([Math.round(M),Math.round(M)]),this._tmpCtx.moveTo(I+N,z),this._tmpCtx.lineTo(G,z)):(this._tmpCtx.setLineDash([Math.round(M),Math.round(M)]),this._tmpCtx.moveTo(I,z),this._tmpCtx.lineTo(I+N,z),this._tmpCtx.moveTo(I+N+M,z),this._tmpCtx.lineTo(G,z)),ne=N_(G-I,M,ne);break;case 5:let be=.6,fe=.3,ee=G-I,He=Math.floor(be*ee),ve=Math.floor(fe*ee),hi=ee-He-ve;this._tmpCtx.setLineDash([He,ve,hi]),this._tmpCtx.moveTo(I,z),this._tmpCtx.lineTo(G,z);break;case 1:default:this._tmpCtx.moveTo(I,z),this._tmpCtx.lineTo(G,z);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!v&&this._config.fontSize>=12&&!this._config.allowTransparency&&l!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let O=this._tmpCtx.measureText(l);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in O&&O.actualBoundingBoxDescent>0){this._tmpCtx.save();let I=new Path2D;I.rect(K,z-Math.ceil(M/2),this._config.deviceCellWidth*p,q-z+Math.ceil(M/2)),this._tmpCtx.clip(I),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=L.css,this._tmpCtx.strokeText(l,W,W+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(k){let M=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),F=M%2===1?.5:0;this._tmpCtx.lineWidth=M,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(W,W+F),this._tmpCtx.lineTo(W+this._config.deviceCharWidth*p,W+F),this._tmpCtx.stroke()}if(v||this._tmpCtx.fillText(l,W,W+this._config.deviceCharHeight),l==="_"&&!this._config.allowTransparency){let M=lr(this._tmpCtx.getImageData(W,W,this._config.deviceCellWidth,this._config.deviceCellHeight),L,le,u);if(M)for(let F=1;F<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(l,W,W+this._config.deviceCharHeight-F),M=lr(this._tmpCtx.getImageData(W,W,this._config.deviceCellWidth,this._config.deviceCellHeight),L,le,u),!!M);F++);}if(y){let M=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),F=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=M,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(W,W+Math.floor(this._config.deviceCharHeight/2)-F),this._tmpCtx.lineTo(W+this._config.deviceCharWidth*p,W+Math.floor(this._config.deviceCharHeight/2)-F),this._tmpCtx.stroke()}this._tmpCtx.restore();let g=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),w;if(this._config.allowTransparency?w=uf(g):w=lr(g,L,le,u),w)return Oo;let b=this._findGlyphBoundingBox(g,this._workBoundingBox,h,Y,v,W),C,x;for(;;){if(this._activePages.length===0){let M=this._createNewPage();C=M,x=M.currentRow,x.height=b.size.y;break}C=this._activePages[this._activePages.length-1],x=C.currentRow;for(let M of this._activePages)b.size.y<=M.currentRow.height&&(C=M,x=M.currentRow);for(let M=this._activePages.length-1;M>=0;M--)for(let F of this._activePages[M].fixedRows)F.height<=x.height&&b.size.y<=F.height&&(C=this._activePages[M],x=F);if(b.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new ar(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),C=this._overflowSizePage,x=this._overflowSizePage.currentRow,x.x+b.size.x>=C.canvas.width&&(x.x=0,x.y+=x.height,x.height=0);break}if(x.y+b.size.y>=C.canvas.height||x.height>b.size.y+2){let M=!1;if(C.currentRow.y+C.currentRow.height+b.size.y>=C.canvas.height){let F;for(let K of this._activePages)if(K.currentRow.y+K.currentRow.height+b.size.y=fi.maxAtlasPages&&x.y+b.size.y<=C.canvas.height&&x.height>=b.size.y&&x.x+b.size.x<=C.canvas.width)M=!0;else{let K=this._createNewPage();C=K,x=K.currentRow,x.height=b.size.y,M=!0}}M||(C.currentRow.height>0&&C.fixedRows.push(C.currentRow),x={x:0,y:C.currentRow.y+C.currentRow.height,height:b.size.y},C.fixedRows.push(x),C.currentRow={x:0,y:x.y+x.height,height:0})}if(x.x+b.size.x<=C.canvas.width)break;x===C.currentRow?(x.x=0,x.y+=x.height,x.height=0):C.fixedRows.splice(C.fixedRows.indexOf(x),1)}return b.texturePage=this._pages.indexOf(C),b.texturePosition.x=x.x,b.texturePosition.y=x.y,b.texturePositionClipSpace.x=x.x/C.canvas.width,b.texturePositionClipSpace.y=x.y/C.canvas.height,b.sizeClipSpace.x/=C.canvas.width,b.sizeClipSpace.y/=C.canvas.height,x.height=Math.max(x.height,b.size.y),x.x+=b.size.x,C.ctx.putImageData(g,b.texturePosition.x-this._workBoundingBox.left,b.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,b.size.x,b.size.y),C.addGlyph(b),C.version++,b}_findGlyphBoundingBox(e,i,s,r,n,o){i.top=0;let l=r?this._config.deviceCellHeight:this._tmpCanvas.height,h=r?this._config.deviceCellWidth:s,a=!1;for(let c=0;c=o;c--){for(let _=0;_=0;c--){for(let _=0;_>>24,n=e.rgba>>>16&255,o=e.rgba>>>8&255,l=i.rgba>>>24,h=i.rgba>>>16&255,a=i.rgba>>>8&255,c=Math.floor((Math.abs(r-l)+Math.abs(n-h)+Math.abs(o-a))/12),_=!0;for(let f=0;f0)return!1;return!0}function Al(t,e,i){let s=t.createElement("canvas");return s.width=e,s.height=i,s}function _f(t,e,i,s,r,n,o,l){let h={foreground:n.foreground,background:n.background,cursor:ot,cursorAccent:ot,selectionForeground:ot,selectionBackgroundTransparent:ot,selectionBackgroundOpaque:ot,selectionInactiveBackgroundTransparent:ot,selectionInactiveBackgroundOpaque:ot,overviewRulerBorder:ot,scrollbarSliderBackground:ot,scrollbarSliderHoverBackground:ot,scrollbarSliderActiveBackground:ot,ansi:n.ansi.slice(),contrastCache:n.contrastCache,halfContrastCache:n.halfContrastCache};return{customGlyphs:r.customGlyphs,devicePixelRatio:o,deviceMaxTextureSize:l,letterSpacing:r.letterSpacing,lineHeight:r.lineHeight,deviceCellWidth:t,deviceCellHeight:e,deviceCharWidth:i,deviceCharHeight:s,fontFamily:r.fontFamily,fontSize:r.fontSize,fontWeight:r.fontWeight,fontWeightBold:r.fontWeightBold,allowTransparency:r.allowTransparency,drawBoldTextInBrightColors:r.drawBoldTextInBrightColors,minimumContrastRatio:r.minimumContrastRatio,colors:h}}function Fo(t,e){for(let i=0;i=0){if(Fo(d.config,a))return d.atlas;d.ownedBy.length===1?(d.atlas.dispose(),ht.splice(f,1)):d.ownedBy.splice(m,1);break}}for(let f=0;f{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(t=as){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let e=as-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0){this._restartInterval(e);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let e=as-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(e);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},as)},t)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function Wo(t,e,i){let s=new e.ResizeObserver(r=>{let n=r.find(h=>h.target===t);if(!n)return;if(!("devicePixelContentBoxSize"in n)){s?.disconnect(),s=void 0;return}let o=n.devicePixelContentBoxSize[0].inlineSize,l=n.devicePixelContentBoxSize[0].blockSize;o>0&&l>0&&i(o,l)});try{s.observe(t,{box:["device-pixel-content-box"]})}catch{s.disconnect(),s=void 0}return We(()=>s?.disconnect())}function pf(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}var zo=class $l extends vi{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Bl,this.combinedData=""}static fromCharData(e){let i=new $l;return i.setFromCharData(e),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?pf(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(e[1].length===2){let s=e[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Il=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function Ol(t,e,i){let s=we(t.createProgram());if(t.attachShader(s,we(Ho(t,t.VERTEX_SHADER,e))),t.attachShader(s,we(Ho(t,t.FRAGMENT_SHADER,i))),t.linkProgram(s),t.getProgramParameter(s,t.LINK_STATUS))return s;console.error(t.getProgramInfoLog(s)),t.deleteProgram(s)}function Ho(t,e,i){let s=we(t.createShader(e));if(t.shaderSource(s,i),t.compileShader(s),t.getShaderParameter(s,t.COMPILE_STATUS))return s;console.error(t.getShaderInfoLog(s)),t.deleteShader(s)}function vf(t,e){let i=Math.min(t.length*2,e),s=new Float32Array(i);for(let r=0;rr.deleteProgram(this._program))),this._projectionLocation=we(r.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=we(r.getUniformLocation(this._program,"u_resolution")),this._textureLocation=we(r.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(We(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let l=new Uint8Array([0,1,2,3]),h=r.createBuffer();this._register(We(()=>r.deleteBuffer(h))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h),r.bufferData(r.ELEMENT_ARRAY_BUFFER,l,r.STATIC_DRAW),this._attributesBuffer=we(r.createBuffer()),this._register(We(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,2,r.FLOAT,!1,ui,0),r.vertexAttribDivisor(2,1),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,r.FLOAT,!1,ui,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(3,1),r.enableVertexAttribArray(4),r.vertexAttribPointer(4,1,r.FLOAT,!1,ui,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(4,1),r.enableVertexAttribArray(5),r.vertexAttribPointer(5,2,r.FLOAT,!1,ui,5*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(5,1),r.enableVertexAttribArray(6),r.vertexAttribPointer(6,2,r.FLOAT,!1,ui,7*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(6,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,ui,9*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.useProgram(this._program);let a=new Int32Array(Ut.maxAtlasPages);for(let c=0;cr.deleteTexture(_.texture))),r.activeTexture(r.TEXTURE0+c),r.bindTexture(r.TEXTURE_2D,_.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,1,1,0,r.RGBA,r.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[c]=_}r.enable(r.BLEND),r.blendFunc(r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(t,e,i,s,r,n,o,l,h){this._updateCell(this._vertices.attributes,t,e,i,s,r,n,o,l,h)}_updateCell(t,e,i,s,r,n,o,l,h,a){if(he=(i*this._terminal.cols+e)*qt,s===0||s===void 0){t.fill(0,he,he+qt-1-bf);return}this._atlas&&(l&&l.length>1?te=this._atlas.getRasterizedGlyphCombinedChar(l,r,n,o,!1,this._terminal.element):te=this._atlas.getRasterizedGlyph(s,r,n,o,!1,this._terminal.element),hr=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),r!==a&&te.offset.x>hr?(Pi=te.offset.x-hr,t[he]=-(te.offset.x-Pi)+this._dimensions.device.char.left,t[he+1]=-te.offset.y+this._dimensions.device.char.top,t[he+2]=(te.size.x-Pi)/this._dimensions.device.canvas.width,t[he+3]=te.size.y/this._dimensions.device.canvas.height,t[he+4]=te.texturePage,t[he+5]=te.texturePositionClipSpace.x+Pi/this._atlas.pages[te.texturePage].canvas.width,t[he+6]=te.texturePositionClipSpace.y,t[he+7]=te.sizeClipSpace.x-Pi/this._atlas.pages[te.texturePage].canvas.width,t[he+8]=te.sizeClipSpace.y):(t[he]=-te.offset.x+this._dimensions.device.char.left,t[he+1]=-te.offset.y+this._dimensions.device.char.top,t[he+2]=te.size.x/this._dimensions.device.canvas.width,t[he+3]=te.size.y/this._dimensions.device.canvas.height,t[he+4]=te.texturePage,t[he+5]=te.texturePositionClipSpace.x,t[he+6]=te.texturePositionClipSpace.y,t[he+7]=te.sizeClipSpace.x,t[he+8]=te.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&O_(s,h,te.size.x,this._dimensions.device.cell.width)&&(t[he+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let t=this._terminal,e=t.cols*t.rows*qt;this._vertices.count!==e?this._vertices.attributes=new Float32Array(e):this._vertices.attributes.fill(0);let i=0;for(;i=t.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=n,this.viewportEndRow=o,this.viewportCappedStartRow=l,this.viewportCappedEndRow=h,this.startCol=e[0],this.endCol=i[0]}isCellSelected(t,e,i){return this.hasSelection?(i-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?e>=this.startCol&&i>=this.viewportCappedStartRow&&e=this.viewportCappedStartRow&&e>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i=this.startCol&&e=this.startCol):!1}};function xf(){return new Cf}var Rs=4,ms=1,ws=2,cr=3,kf=2147483648,Lf=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=xf()}resize(t,e){let i=t*e*Rs;i!==this.cells.length&&(this.cells=new Uint32Array(i),this.lineLengths=new Uint32Array(e))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},Bf=`#version 300 es -layout (location = 0) in vec2 a_position; -layout (location = 1) in vec2 a_size; -layout (location = 2) in vec4 a_color; -layout (location = 3) in vec2 a_unitquad; - -uniform mat4 u_projection; - -out vec4 v_color; - -void main() { - vec2 zeroToOne = a_position + (a_unitquad * a_size); - gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0); - v_color = a_color; -}`,Ef=`#version 300 es -precision lowp float; - -in vec4 v_color; - -out vec4 outColor; - -void main() { - outColor = v_color; -}`,Dt=8,dr=Dt*Float32Array.BYTES_PER_ELEMENT,Mf=20*Dt,Uo=class{constructor(){this.attributes=new Float32Array(Mf),this.count=0}},Et=0,qo=0,Ko=0,Vo=0,jo=0,Go=0,Yo=0,Rf=class extends dt{constructor(t,e,i,s){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._themeService=s,this._vertices=new Uo,this._verticesCursor=new Uo;let r=this._gl;this._program=we(Ol(r,Bf,Ef)),this._register(We(()=>r.deleteProgram(this._program))),this._projectionLocation=we(r.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=r.createVertexArray(),r.bindVertexArray(this._vertexArrayObject);let n=new Float32Array([0,0,1,0,0,1,1,1]),o=r.createBuffer();this._register(We(()=>r.deleteBuffer(o))),r.bindBuffer(r.ARRAY_BUFFER,o),r.bufferData(r.ARRAY_BUFFER,n,r.STATIC_DRAW),r.enableVertexAttribArray(3),r.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let l=new Uint8Array([0,1,2,3]),h=r.createBuffer();this._register(We(()=>r.deleteBuffer(h))),r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,h),r.bufferData(r.ELEMENT_ARRAY_BUFFER,l,r.STATIC_DRAW),this._attributesBuffer=we(r.createBuffer()),this._register(We(()=>r.deleteBuffer(this._attributesBuffer))),r.bindBuffer(r.ARRAY_BUFFER,this._attributesBuffer),r.enableVertexAttribArray(0),r.vertexAttribPointer(0,2,r.FLOAT,!1,dr,0),r.vertexAttribDivisor(0,1),r.enableVertexAttribArray(1),r.vertexAttribPointer(1,2,r.FLOAT,!1,dr,2*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(1,1),r.enableVertexAttribArray(2),r.vertexAttribPointer(2,4,r.FLOAT,!1,dr,4*Float32Array.BYTES_PER_ELEMENT),r.vertexAttribDivisor(2,1),this._updateCachedColors(s.colors),this._register(this._themeService.onChangeColors(a=>{this._updateCachedColors(a),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(t){let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),e.uniformMatrix4fv(this._projectionLocation,!1,Il),e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,t.attributes,e.DYNAMIC_DRAW),e.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,t.count)}handleResize(){this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(t){this._bgFloat=this._colorToFloat32Array(t.background),this._cursorFloat=this._colorToFloat32Array(t.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(t){let e=this._terminal,i=this._vertices,s=1,r,n,o,l,h,a,c,_,f,d,m;for(r=0;r>24&255)/255,jo=(Et>>16&255)/255,Go=(Et>>8&255)/255,Yo=1,this._addRectangle(t.attributes,e,qo,Ko,(n-r)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,Vo,jo,Go,Yo)}_addRectangle(t,e,i,s,r,n,o,l,h,a){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=s/this._dimensions.device.canvas.height,t[e+2]=r/this._dimensions.device.canvas.width,t[e+3]=n/this._dimensions.device.canvas.height,t[e+4]=o,t[e+5]=l,t[e+6]=h,t[e+7]=a}_addRectangleFloat(t,e,i,s,r,n,o){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=s/this._dimensions.device.canvas.height,t[e+2]=r/this._dimensions.device.canvas.width,t[e+3]=n/this._dimensions.device.canvas.height,t[e+4]=o[0],t[e+5]=o[1],t[e+6]=o[2],t[e+7]=o[3]}_colorToFloat32Array(t){return new Float32Array([(t.rgba>>24&255)/255,(t.rgba>>16&255)/255,(t.rgba>>8&255)/255,(t.rgba&255)/255])}},Tf=class extends dt{constructor(t,e,i,s,r,n,o,l){super(),this._container=e,this._alpha=r,this._coreBrowserService=n,this._optionsService=o,this._themeService=l,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=s.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(h=>{this._refreshCharAtlas(t,h),this.reset(t)})),this._register(We(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=we(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(t){}handleFocus(t){}handleCursorMove(t){}handleGridChanged(t,e,i){}handleSelectionChanged(t,e,i,s=!1){}_setTransparency(t,e){if(e===this._alpha)return;let i=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(t,this._themeService.colors),this.handleGridChanged(t,0,t.rows-1)}_refreshCharAtlas(t,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=Pl(t,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(t,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(t,this._themeService.colors)}_fillBottomLineAtCells(t,e,i=1){this._ctx.fillRect(t*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(t,e,i,s){this._alpha?this._ctx.clearRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,s*this._deviceCellHeight))}_fillCharTrueColor(t,e,i,s){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=yl,this._clipCell(i,s,e.getWidth()),this._ctx.fillText(e.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,s*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(t,e,i){this._ctx.beginPath(),this._ctx.rect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(t,e,i){let s=e?t.options.fontWeightBold:t.options.fontWeight;return`${i?"italic":""} ${s} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}},Df=class extends Tf{constructor(t,e,i,s,r,n,o){super(i,t,"link",e,!0,r,n,o),this._register(s.onShowLinkUnderline(l=>this._handleShowLinkUnderline(l))),this._register(s.onHideLinkUnderline(l=>this._handleHideLinkUnderline(l)))}resize(t,e){super.resize(t,e),this._state=void 0}reset(t){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let t=this._state.y2-this._state.y1-1;t>0&&this._clearCells(0,this._state.y1+1,this._state.cols,t),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(t){if(t.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:t.fg!==void 0&&ff(t.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[t.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,t.y1===t.y2)this._fillBottomLineAtCells(t.x1,t.y1,t.x2-t.x1);else{this._fillBottomLineAtCells(t.x1,t.y1,t.cols-t.x1);for(let e=t.y1+1;e=0;xi.indexOf("AppleWebKit")>=0;var Pf=xi.indexOf("Chrome")>=0;!Pf&&xi.indexOf("Safari")>=0;xi.indexOf("Electron/")>=0;xi.indexOf("Android")>=0;var ur=!1;if(typeof ti.matchMedia=="function"){let t=ti.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=ti.matchMedia("(display-mode: fullscreen)");ur=t.matches,Af(ti,t,({matches:i})=>{ur&&e.matches||(ur=i)})}var mi="en",_r=!1,Nl=!1,ls,Ss=mi,Xo=mi,$f,Tt,ni=globalThis,et;typeof ni.vscode<"u"&&typeof ni.vscode.process<"u"?et=ni.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(et=process);var If=typeof et?.versions?.electron=="string",Of=If&&et?.type==="renderer";if(typeof et=="object"){et.platform,et.platform,_r=et.platform==="linux",_r&&et.env.SNAP&&et.env.SNAP_REVISION,et.env.CI||et.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ls=mi,Ss=mi;let t=et.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);ls=e.userLocale,Xo=e.osLocale,Ss=e.resolvedLanguage||mi,$f=e.languagePack?.translationsConfigFile}catch{}Nl=!0}else typeof navigator=="object"&&!Of?(Tt=navigator.userAgent,Tt.indexOf("Windows")>=0,Tt.indexOf("Macintosh")>=0,(Tt.indexOf("Macintosh")>=0||Tt.indexOf("iPad")>=0||Tt.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_r=Tt.indexOf("Linux")>=0,Tt?.indexOf("Mobi")>=0,Ss=globalThis._VSCODE_NLS_LANGUAGE||mi,ls=navigator.language.toLowerCase(),Xo=ls):console.error("Unable to resolve platform.");var Jo=Nl,yt=Tt,zt=Ss,Ff;(t=>{function e(){return zt}t.value=e;function i(){return zt.length===2?zt==="en":zt.length>=3?zt[0]==="e"&&zt[1]==="n"&&zt[2]==="-":!1}t.isDefaultVariant=i;function s(){return zt==="en"}t.isDefault=s})(Ff||={});var Nf=typeof ni.postMessage=="function"&&!ni.importScripts;(()=>{if(Nf){let t=[];ni.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=t.length;s{let s=++e;t.push({id:s,callback:i}),ni.postMessage({vscodeScheduleAsyncWork:s},"*")}}return t=>setTimeout(t)})();var Wf=!!(yt&&yt.indexOf("Chrome")>=0);yt&&yt.indexOf("Firefox")>=0;!Wf&&yt&&yt.indexOf("Safari")>=0;yt&&yt.indexOf("Edg/")>=0;yt&&yt.indexOf("Android")>=0;var _i=typeof navigator=="object"?navigator:{};Jo||document.queryCommandSupported&&document.queryCommandSupported("copy")||_i&&_i.clipboard&&_i.clipboard.writeText,Jo||_i&&_i.clipboard&&_i.clipboard.readText;var Mn=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,e){this._keyCodeToStr[t]=e,this._strToKeyCode[e.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},fr=new Mn,Zo=new Mn,Qo=new Mn;new Array(230);var zf;(t=>{function e(l){return fr.keyCodeToStr(l)}t.toString=e;function i(l){return fr.strToKeyCode(l)}t.fromString=i;function s(l){return Zo.keyCodeToStr(l)}t.toUserSettingsUS=s;function r(l){return Qo.keyCodeToStr(l)}t.toUserSettingsGeneral=r;function n(l){return Zo.strToKeyCode(l)||Qo.strToKeyCode(l)}t.fromUserSettings=n;function o(l){if(l>=98&&l<=113)return null;switch(l){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return fr.keyCodeToStr(l)}t.toElectronAccelerator=o})(zf||={});var Wl=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),Hf;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof Uf?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Pt.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Wl})})(Hf||={});var Uf=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Wl:(this._emitter||(this._emitter=new se),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},qf;(t=>{async function e(s){let r,n=await Promise.all(s.map(o=>o.then(l=>l,l=>{r||(r=l)})));if(typeof r<"u")throw r;return n}t.settled=e;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}t.withAsyncBody=i})(qf||={});var ea=class at{static fromArray(e){return new at(i=>{i.emitMany(e)})}static fromPromise(e){return new at(async i=>{i.emitMany(await e)})}static fromPromises(e){return new at(async i=>{await Promise.all(e.map(async s=>i.emitOne(await s)))})}static merge(e){return new at(async i=>{await Promise.all(e.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new se,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(e(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(e,i){return new at(async s=>{for await(let r of e)s.emitOne(i(r))})}map(e){return at.map(this,e)}static filter(e,i){return new at(async s=>{for await(let r of e)i(r)&&s.emitOne(r)})}filter(e){return at.filter(this,e)}static coalesce(e){return at.filter(e,i=>!!i)}coalesce(){return at.coalesce(this)}static async toPromise(e){let i=[];for await(let s of e)i.push(s);return i}toPromise(){return at.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};ea.EMPTY=ea.fromArray([]);var{getWindow:Kf}=function(){let t=new Map,e={window:ti,disposables:new wi};t.set(ti.vscodeWindowId,e);let i=new se,s=new se,r=new se;function n(o,l){return(typeof o=="number"?t.get(o):void 0)??(l?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(o){if(t.has(o.vscodeWindowId))return dt.None;let l=new wi,h={window:o,disposables:l.add(new wi)};return t.set(o.vscodeWindowId,h),l.add(We(()=>{t.delete(o.vscodeWindowId),s.fire(o)})),l.add(_n(o,jf.BEFORE_UNLOAD,()=>{r.fire(o)})),i.fire(h),l},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return t.has(o)},getWindowById:n,getWindow(o){let l=o;if(l?.ownerDocument?.defaultView)return l.ownerDocument.defaultView.window;let h=o;return h?.view?h.view.window:ti},getDocument(o){return Kf(o).document}}}(),Vf=class{constructor(t,e,i,s){this._node=t,this._type=e,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function _n(t,e,i,s){return new Vf(t,e,i,s)}var jf={BEFORE_UNLOAD:"beforeunload"},Gf=class extends dt{constructor(t,e,i,s,r,n,o,l,h){super(),this._terminal=t,this._characterJoinerService=e,this._charSizeService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._optionsService=o,this._themeService=l,this._cursorBlinkStateManager=new Ti,this._charAtlasDisposable=this._register(new Ti),this._observerDisposable=this._register(new Ti),this._model=new Lf,this._workCell=new zo,this._workCell2=new zo,this._rectangleRenderer=this._register(new Ti),this._glyphRenderer=this._register(new Ti),this._onChangeTextureAtlas=this._register(new se),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new se),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new se),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new se),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new se),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let a={antialias:!1,depth:!1,preserveDrawingBuffer:h};if(this._gl=this._canvas.getContext("webgl2",a),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new W_(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new Df(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=F_(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(_n(this._canvas,"webglcontextlost",c=>{console.log("webglcontextlost event received"),c.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(c)},3e3)})),this._register(_n(this._canvas,"webglcontextrestored",c=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,No(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=Wo(this._canvas,this._coreBrowserService.window,(c,_)=>this._setCanvasDevicePixelDimensions(c,_)),this._register(this._coreBrowserService.onWindowChange(c=>{this._observerDisposable.value=Wo(this._canvas,c,(_,f)=>this._setCanvasDevicePixelDimensions(_,f))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(We(()=>{for(let c of this._renderLayers)c.dispose();this._canvas.parentElement?.removeChild(this._canvas),No(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(t,e){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let i of this._renderLayers)i.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let t of this._renderLayers)t.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let t of this._renderLayers)t.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(t,e,i){for(let s of this._renderLayers)s.handleSelectionChanged(this._terminal,t,e,i);this._model.selection.update(this._core,t,e,i),this._requestRedrawViewport()}handleCursorMove(){for(let t of this._renderLayers)t.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new Rf(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new yf(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let t=Pl(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==t&&(this._onChangeTextureAtlas.fire(t.pages[0].canvas),this._charAtlasDisposable.value=vl(Pt.forward(t.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Pt.forward(t.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=t,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(t){this._model.clear(),t&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let t of this._renderLayers)t.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(t,e){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let i of this._renderLayers)i.handleGridChanged(this._terminal,t,e);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(t,e),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new gf(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(t,e){let i=this._core,s=this._workCell,r,n,o,l,h,a,c=0,_=!0,f,d,m,y,k,R,D,T,S;t=ta(t,i.rows-1,0),e=ta(e,i.rows-1,0);let L=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",B=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,$=B-i.buffer.ydisp,U=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),Y=-1,le=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let W=!1;for(n=t;n<=e;n++)for(o=n+i.buffer.ydisp,l=i.buffer.lines.get(o),this._model.lineLengths[n]=0,m=B===o,c=0,h=this._characterJoinerService.getJoinedCharacters(o),T=0;T=c,f=T,h.length>0&&T===h[0][0]&&_){d=h.shift();let v=this._model.selection.isCellSelected(this._terminal,d[0],o);for(D=d[0]+1;D=d[1],_?(a=!0,s=new Yf(s,l.translateToString(!0,d[0],d[1]),d[1]-d[0]),f=d[1]-1):c=d[1]}if(y=s.getChars(),k=s.getCode(),D=(n*i.cols+T)*Rs,this._cellColorResolver.resolve(s,T,o,this.dimensions.device.cell.width),le&&o===B&&(T===U&&(this._model.cursor={x:U,y:$,width:s.getWidth(),style:this._coreBrowserService.isFocused?L:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},Y=U+s.getWidth()-1),T>=U&&T<=Y&&(this._coreBrowserService.isFocused&&L==="block"||this._coreBrowserService.isFocused===!1&&i.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),k!==0&&(this._model.lineLengths[n]=T+1),!(this._model.cells[D]===k&&this._model.cells[D+ms]===this._cellColorResolver.result.bg&&this._model.cells[D+ws]===this._cellColorResolver.result.fg&&this._model.cells[D+cr]===this._cellColorResolver.result.ext)&&(W=!0,y.length>1&&(k|=kf),this._model.cells[D]=k,this._model.cells[D+ms]=this._cellColorResolver.result.bg,this._model.cells[D+ws]=this._cellColorResolver.result.fg,this._model.cells[D+cr]=this._cellColorResolver.result.ext,R=s.getWidth(),this._glyphRenderer.value.updateCell(T,n,k,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,y,R,r),a)){for(s=this._workCell,T++;T<=f;T++)S=(n*i.cols+T)*Rs,this._glyphRenderer.value.updateCell(T,n,0,0,0,0,T_,0,0),this._model.cells[S]=0,this._model.cells[S+ms]=this._cellColorResolver.result.bg,this._model.cells[S+ws]=this._cellColorResolver.result.fg,this._model.cells[S+cr]=this._cellColorResolver.result.ext;T--}}W&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(t,e){this._canvas.width===t&&this._canvas.height===e||(this._canvas.width=t,this._canvas.height=e,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let t=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:t,end:t})}},Yf=class extends vi{constructor(t,e,i){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=e,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function ta(t,e,i=0){return Math.max(Math.min(t,e),i)}var ia="di$target",sa="di$dependencies",gr=new Map;function Ct(t){if(gr.has(t))return gr.get(t);let e=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Xf(e,i,r)};return e._id=t,gr.set(t,e),e}function Xf(t,e,i){e[ia]===e?e[sa].push({id:t,index:i}):(e[sa]=[{id:t,index:i}],e[ia]=e)}Ct("BufferService");Ct("CoreMouseService");Ct("CoreService");Ct("CharsetService");Ct("InstantiationService");Ct("LogService");var Jf=Ct("OptionsService");Ct("OscLinkService");Ct("UnicodeService");Ct("DecorationService");var Zf={trace:0,debug:1,info:2,warn:3,error:4,off:5},Qf="xterm.js: ",ra=class extends dt{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=Zf[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;ethis.activate(t)));return}this._terminal=t;let i=e.coreService,s=e.optionsService,r=e,n=r._renderService,o=r._characterJoinerService,l=r._charSizeService,h=r._coreBrowserService,a=r._decorationService;r._logService;let c=r._themeService;this._renderer=this._register(new Gf(t,o,l,h,i,a,s,c,this._preserveDrawingBuffer)),this._register(Pt.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Pt.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Pt.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Pt.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),n.setRenderer(this._renderer),this._register(We(()=>{if(this._terminal._core._store._isDisposed)return;let _=this._terminal._core._renderService;_.setRenderer(this._terminal._core._createRenderer()),_.handleResize(t.cols,t.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}};class ze{aliases;usage;matches(e){const i=e.toLowerCase();return i===this.name.toLowerCase()||(this.aliases?.some(s=>i===s.toLowerCase())??!1)}writeLine(e,i,s){s?e.writeln(`${s}${i}\x1B[0m`):e.writeln(i)}writeSuccess(e,i){e.writeln(`\x1B[1;32m✓\x1B[0m ${i}`)}writeError(e,i){e.writeln(`\x1B[1;31m✗ Error:\x1B[0m ${i}`)}writeInfo(e,i){e.writeln(`\x1B[90m${i}\x1B[0m`)}startLoading(e,i){const s=["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"];let r=0,n=!0;const o=setInterval(()=>{if(!n){clearInterval(o);return}e.write(`\r\x1B[36m${s[r]}\x1B[0m ${i}`),r=(r+1)%s.length},80);return()=>{n=!1,clearInterval(o),e.write("\r\x1B[K")}}}class tg extends ze{constructor(e){super(),this.commands=e}name="help";description="Show available commands";aliases=["?","h"];execute({term:e,writePrompt:i}){e.writeln(""),e.writeln("\x1B[1;33mAvailable Commands:\x1B[0m"),e.writeln(""),this.commands.forEach(s=>{const r=s.aliases?.length?` (${s.aliases.join(", ")})`:"";e.writeln(` \x1B[1;36m${s.name.padEnd(15)}\x1B[0m ${s.description}${r}`)}),e.writeln(""),e.writeln("\x1B[90mTip: Use Tab for autocomplete, ↑↓ for history, Ctrl+F to search\x1B[0m"),i()}}class ig extends ze{name="clear";description="Clear terminal screen";aliases=["cls"];execute({term:e,writePrompt:i}){e.clear(),i()}}class sg extends ze{name="status";description="Show repeater status";aliases=["st"];async execute({term:e,writePrompt:i}){const s=this.startLoading(e,"Fetching status...");try{const r=await J.get("/stats");s();const n=r.success&&r.data?r.data:r;if(n&&typeof n=="object"){this.writeSuccess(e,"Repeater Status:"),e.writeln("");for(const[o,l]of Object.entries(n))e.writeln(` \x1B[36m${o.padEnd(20)}\x1B[0m ${l}`)}else this.writeError(e,"No status data available")}catch(r){s(),this.writeError(e,r instanceof Error?r.message:"Failed to fetch status")}i()}}class rg extends ze{name="uptime";description="Show system uptime";async execute({term:e,writePrompt:i}){const s=this.startLoading(e,"Fetching uptime...");try{const r=await J.get("/stats");s();const o=(r.data||r).uptime_seconds||0,l=this.formatUptime(o);this.writeSuccess(e,l)}catch(r){s(),this.writeError(e,`Failed to get uptime: ${r}`)}i()}formatUptime(e){const i=Math.floor(e/86400),s=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return i>0?`${i}d ${s}h ${r}m`:s>0?`${s}h ${r}m`:`${r}m`}}class ng extends ze{name="packets";description="Show packet statistics";isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:e,writePrompt:i}){const s=this.startLoading(e,"Fetching packet stats...");try{const r=await J.get("/stats");s();const n=r.data||r;this.writeLine(e,""),this.isMobile()?(this.writeLine(e," \x1B[1;36mPacket Statistics\x1B[0m"),this.writeLine(e," \x1B[90mRX:\x1B[0m "+(n.rx_count||0)),this.writeLine(e," \x1B[90mTX:\x1B[0m "+(n.tx_count||0)),this.writeLine(e," \x1B[90mForward:\x1B[0m "+(n.forwarded_count||0)),this.writeLine(e," \x1B[90mDropped:\x1B[0m "+(n.dropped_count||0))):(this.writeLine(e," \x1B[36m┌──────────┬──────────┐\x1B[0m"),this.writeLine(e," \x1B[36m│\x1B[0m \x1B[1mMetric\x1B[0m \x1B[36m│\x1B[0m \x1B[1mCount\x1B[0m \x1B[36m│\x1B[0m"),this.writeLine(e," \x1B[36m├──────────┼──────────┤\x1B[0m"),this.writeLine(e,` \x1B[36m│\x1B[0m RX \x1B[36m│\x1B[0m ${String(n.rx_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(e,` \x1B[36m│\x1B[0m TX \x1B[36m│\x1B[0m ${String(n.tx_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(e,` \x1B[36m│\x1B[0m Forward \x1B[36m│\x1B[0m ${String(n.forwarded_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(e,` \x1B[36m│\x1B[0m Dropped \x1B[36m│\x1B[0m ${String(n.dropped_count||0).padStart(8)} \x1B[36m│\x1B[0m`),this.writeLine(e," \x1B[36m└──────────┴──────────┘\x1B[0m")),this.writeLine(e,"")}catch(r){s(),this.writeError(e,`Failed to get packet stats: ${r}`)}i()}}class og extends ze{name="board";description="Show board information";async execute({term:e,writePrompt:i}){const s=this.startLoading(e,"Fetching board info...");try{const r=await J.get("/stats");s();const o=(r.data||r).board_info||"pyMC_Repeater (Linux/RPi)";this.writeSuccess(e,o)}catch{s(),this.writeSuccess(e,"pyMC_Repeater (Linux/RPi)")}i()}}class ag extends ze{name="advert";description="Send neighbor advert immediately";async execute({term:e,writePrompt:i}){const s=this.startLoading(e,"Sending advert...");try{const r=await J.post("/send_advert",{},{timeout:1e4});s(),r.success?this.writeSuccess(e,r.data||"Advert sent successfully"):this.writeError(e,r.error||"Failed to send advert")}catch(r){s(),this.writeError(e,`Failed to send advert: ${r}`)}i()}}class lg extends ze{name="get";description="Get configuration values (name, freq, tx, mode, duty, etc.)";matches(e){const i=e.toLowerCase();return i==="get"||i.startsWith("get ")}async execute({term:e,args:i,writePrompt:s}){const r=i[0]?.toLowerCase();if(!r){this.writeError(e,"Usage: get "),this.writeLine(e,""),this.writeInfo(e,"Available parameters:"),this.writeLine(e,""),this.writeLine(e," \x1B[36mname\x1B[0m Node name"),this.writeLine(e," \x1B[36mrole\x1B[0m Node role"),this.writeLine(e," \x1B[36mlat\x1B[0m Latitude"),this.writeLine(e," \x1B[36mlon\x1B[0m Longitude"),this.writeLine(e," \x1B[36mfreq\x1B[0m Frequency (MHz)"),this.writeLine(e," \x1B[36mtx\x1B[0m TX power (dBm)"),this.writeLine(e," \x1B[36mbw\x1B[0m Bandwidth (kHz)"),this.writeLine(e," \x1B[36msf\x1B[0m Spreading factor"),this.writeLine(e," \x1B[36mcr\x1B[0m Coding rate"),this.writeLine(e," \x1B[36mradio\x1B[0m All radio settings"),this.writeLine(e," \x1B[36mtxdelay\x1B[0m TX delay factor"),this.writeLine(e," \x1B[36mdirect.txdelay\x1B[0m Direct TX delay"),this.writeLine(e," \x1B[36mrxdelay\x1B[0m RX delay base"),this.writeLine(e," \x1B[36maf\x1B[0m Airtime factor"),this.writeLine(e," \x1B[36mmode\x1B[0m Repeater mode"),this.writeLine(e," \x1B[36mrepeat\x1B[0m Repeat on/off"),this.writeLine(e," \x1B[36mflood.max\x1B[0m Max flood hops"),this.writeLine(e," \x1B[36madvert.interval\x1B[0m Advert interval"),this.writeLine(e," \x1B[36mduty\x1B[0m Duty cycle enabled"),this.writeLine(e," \x1B[36mduty.max\x1B[0m Max airtime %"),this.writeLine(e," \x1B[36mpublic.key\x1B[0m Public key"),this.writeLine(e,""),s();return}const n=this.startLoading(e,"Fetching configuration...");try{const o=await J.get("/stats");n();const l=o.data||o,h=l.config||{},a=h.radio||{},c=h.repeater||{},_=h.delays||{},f=h.duty_cycle||{};let d="";switch(r){case"name":d=h.node_name||"Unknown";break;case"role":d="repeater";break;case"lat":d=c.latitude!=null?String(c.latitude):"not set";break;case"lon":d=c.longitude!=null?String(c.longitude):"not set";break;case"freq":d=a.frequency?`${(a.frequency/1e6).toFixed(3)} MHz`:"?";break;case"tx":d=a.tx_power!=null?`${a.tx_power}dBm`:"?";break;case"bw":d=a.bandwidth?`${a.bandwidth/1e3} kHz`:"?";break;case"sf":d=a.spreading_factor!=null?String(a.spreading_factor):"?";break;case"cr":d=a.coding_rate!=null?`4/${a.coding_rate}`:"?";break;case"radio":if(a.frequency){this.writeSuccess(e,"Radio Configuration:"),this.writeLine(e,""),this.writeLine(e,` \x1B[36mFrequency:\x1B[0m ${(a.frequency/1e6).toFixed(3)} MHz`),this.writeLine(e,` \x1B[36mBandwidth:\x1B[0m ${a.bandwidth/1e3} kHz`),this.writeLine(e,` \x1B[36mSpreading Factor:\x1B[0m ${a.spreading_factor}`),this.writeLine(e,` \x1B[36mCoding Rate:\x1B[0m 4/${a.coding_rate}`),this.writeLine(e,` \x1B[36mTX Power:\x1B[0m ${a.tx_power}dBm`),this.writeLine(e,""),s();return}else d="Radio configuration not available";break;case"af":case"txdelay":d=_.tx_delay_factor!=null?String(_.tx_delay_factor):"\x1B[90mnot set (default: 1.0)\x1B[0m";break;case"direct.txdelay":d=_.direct_tx_delay_factor!=null?String(_.direct_tx_delay_factor):"\x1B[90mnot set (default: 0.5)\x1B[0m";break;case"rxdelay":d=_.rx_delay_base!=null?`${_.rx_delay_base}s`:"\x1B[90mnot set (default: 0.0s)\x1B[0m";break;case"mode":d=c.mode!=null?c.mode:"\x1B[90mnot set (default: forward)\x1B[0m";break;case"repeat":c.mode!=null?d=c.mode==="forward"?"on":"off":d="\x1B[90mnot set (default: on)\x1B[0m";break;case"flood.max":d=c.max_flood_hops!=null?String(c.max_flood_hops):"\x1B[90mnot set (default: 3)\x1B[0m";break;case"flood.advert.interval":d=c.send_advert_interval_hours!=null?`${c.send_advert_interval_hours}h`:"\x1B[90mnot set\x1B[0m";break;case"advert.interval":d=c.advert_interval_minutes!=null?`${c.advert_interval_minutes}m`:"\x1B[90mnot set (default: 120m)\x1B[0m";break;case"duty":case"duty.enabled":d=f.enforcement_enabled!=null?f.enforcement_enabled?"on":"off":"\x1B[90mnot set (default: off)\x1B[0m";break;case"duty.max":d=f.max_airtime_percent!=null?`${f.max_airtime_percent}%`:"\x1B[90mnot set\x1B[0m";break;case"public.key":d=l.public_key||"\x1B[90mnot available\x1B[0m";break;case"prv.key":this.writeWarning(e,"Private key not exposed via API for security"),this.writeInfo(e,"Check /etc/pymc_repeater/config.yaml"),s();return;case"guest.password":case"allow.read.only":this.writeWarning(e,"Security settings not exposed via API"),this.writeInfo(e,"Check /etc/pymc_repeater/config.yaml"),s();return;default:this.writeError(e,`Unknown parameter: ${r}`),this.writeLine(e,""),this.writeInfo(e,"Available parameters:"),this.writeInfo(e," Identity: name, role, lat, lon"),this.writeInfo(e," Radio: freq, tx, bw, sf, cr, radio"),this.writeInfo(e," Timing: txdelay, direct.txdelay, rxdelay, af"),this.writeInfo(e," Repeater: mode, repeat, flood.max, advert.interval"),this.writeInfo(e," Duty: duty, duty.max"),this.writeInfo(e," Security: public.key"),s();return}this.writeSuccess(e,d)}catch(o){n(),this.writeError(e,`Failed to get ${r}: ${o}`)}s()}writeWarning(e,i){e.writeln(`\x1B[1;33m⚠ Warning:\x1B[0m ${i}`)}}class hg extends ze{name="set";description="Set configuration values (tx, txdelay, mode, duty, etc.)";matches(e){const i=e.toLowerCase();return i==="set"||i.startsWith("set ")}async execute({term:e,args:i,writePrompt:s}){const r=i[0]?.toLowerCase(),n=i.slice(1).join(" ").trim();if(!r){this.writeError(e,"Usage: set "),this.writeLine(e,""),this.writeInfo(e,"Available parameters:"),this.writeLine(e,""),this.writeLine(e," \x1B[33mRadio:\x1B[0m"),this.writeLine(e," \x1B[36mtx <2-30>\x1B[0m TX power in dBm"),this.writeLine(e," \x1B[36mfreq \x1B[0m Frequency (100-1000 MHz) *restart required*"),this.writeLine(e," \x1B[36mbw \x1B[0m Bandwidth (7.8-500 kHz) *restart required*"),this.writeLine(e," \x1B[36msf <5-12>\x1B[0m Spreading factor *restart required*"),this.writeLine(e," \x1B[36mcr <5-8>\x1B[0m Coding rate (for 4/5 to 4/8) *restart required*"),this.writeLine(e,""),this.writeLine(e," \x1B[33mTiming:\x1B[0m"),this.writeLine(e," \x1B[36mtxdelay <0.0-5.0>\x1B[0m TX delay factor"),this.writeLine(e," \x1B[36mdirect.txdelay <0.0-5.0>\x1B[0m Direct TX delay factor"),this.writeLine(e," \x1B[36mrxdelay \x1B[0m RX delay base (>= 0)"),this.writeLine(e,""),this.writeLine(e," \x1B[33mIdentity:\x1B[0m"),this.writeLine(e," \x1B[36mname \x1B[0m Node name"),this.writeLine(e," \x1B[36mlat <-90 to 90>\x1B[0m Latitude"),this.writeLine(e," \x1B[36mlon <-180 to 180>\x1B[0m Longitude"),this.writeLine(e,""),this.writeLine(e," \x1B[33mRepeater:\x1B[0m"),this.writeLine(e," \x1B[36mmode \x1B[0m Repeater mode"),this.writeLine(e," \x1B[36mduty \x1B[0m Duty cycle enforcement"),this.writeLine(e," \x1B[36mflood.max <0-64>\x1B[0m Max flood hops"),this.writeLine(e," \x1B[36madvert.interval \x1B[0m Local advert interval"),this.writeLine(e,""),s();return}const o=this.startLoading(e,"Updating configuration...");try{let l;switch(r){case"tx":{const a=parseInt(n);if(isNaN(a)||a<2||a>30){o(),this.writeError(e,"TX power must be 2-30 dBm"),s();return}l=await J.post("/update_radio_config",{tx_power:a},{timeout:3e4});break}case"freq":{const a=parseFloat(n);if(isNaN(a)||a<100||a>1e3){o(),this.writeError(e,"Frequency must be 100-1000 MHz"),s();return}l=await J.post("/update_radio_config",{frequency:a*1e6},{timeout:3e4});break}case"bw":{const a=parseFloat(n),c=[7.8,10.4,15.6,20.8,31.25,41.7,62.5,125,250,500];if(isNaN(a)||!c.includes(a)){o(),this.writeError(e,`Bandwidth must be one of: ${c.join(", ")} kHz`),s();return}l=await J.post("/update_radio_config",{bandwidth:a*1e3},{timeout:3e4});break}case"sf":{const a=parseInt(n);if(isNaN(a)||a<5||a>12){o(),this.writeError(e,"Spreading factor must be 5-12"),s();return}l=await J.post("/update_radio_config",{spreading_factor:a},{timeout:3e4});break}case"cr":{const a=parseInt(n);if(isNaN(a)||a<5||a>8){o(),this.writeError(e,"Coding rate must be 5-8 (for 4/5 to 4/8)"),s();return}l=await J.post("/update_radio_config",{coding_rate:a},{timeout:3e4});break}case"af":case"txdelay":{const a=parseFloat(n);if(isNaN(a)||a<0||a>5){o(),this.writeError(e,"TX delay factor must be 0.0-5.0"),s();return}l=await J.post("/update_radio_config",{tx_delay_factor:a},{timeout:3e4});break}case"direct.txdelay":{const a=parseFloat(n);if(isNaN(a)||a<0||a>5){o(),this.writeError(e,"Direct TX delay factor must be 0.0-5.0"),s();return}l=await J.post("/update_radio_config",{direct_tx_delay_factor:a},{timeout:3e4});break}case"rxdelay":{const a=parseFloat(n);if(isNaN(a)||a<0){o(),this.writeError(e,"RX delay must be >= 0"),s();return}l=await J.post("/update_radio_config",{rx_delay_base:a},{timeout:3e4});break}case"name":{if(!n.trim()){o(),this.writeError(e,"Node name cannot be empty"),s();return}l=await J.post("/update_radio_config",{node_name:n.trim()},{timeout:3e4});break}case"lat":{const a=parseFloat(n);if(isNaN(a)||a<-90||a>90){o(),this.writeError(e,"Latitude must be -90 to 90"),s();return}l=await J.post("/update_radio_config",{latitude:a},{timeout:3e4});break}case"lon":{const a=parseFloat(n);if(isNaN(a)||a<-180||a>180){o(),this.writeError(e,"Longitude must be -180 to 180"),s();return}l=await J.post("/update_radio_config",{longitude:a},{timeout:3e4});break}case"mode":{const a=n.toLowerCase();if(a!=="forward"&&a!=="monitor"&&a!=="no_tx"){o(),this.writeError(e,'Mode must be "forward", "monitor", or "no_tx"'),this.writeLine(e,""),this.writeInfo(e,"Valid values:"),this.writeLine(e," \x1B[36mforward\x1B[0m - Forward packets"),this.writeLine(e," \x1B[36mmonitor\x1B[0m - Monitor only (no forwarding)"),this.writeLine(e," \x1B[36mno_tx\x1B[0m - No repeat, no local TX; adverts skipped"),s();return}l=await J.post("/set_mode",{mode:a},{timeout:3e4}),l.data&&(l.data.applied=[`mode=${a}`],l.data.persisted=!0,l.data.live_update=!0);break}case"duty":{const a=n.toLowerCase();if(a!=="on"&&a!=="off"){o(),this.writeError(e,'Duty cycle must be "on" or "off"'),this.writeLine(e,""),this.writeInfo(e,"Valid values:"),this.writeLine(e," \x1B[36mon\x1B[0m - Enable duty cycle enforcement"),this.writeLine(e," \x1B[36moff\x1B[0m - Disable duty cycle enforcement"),s();return}const c=a==="on";l=await J.post("/set_duty_cycle",{enabled:c},{timeout:3e4}),l.data&&(l.data.applied=[`duty=${a}`],l.data.persisted=!0,l.data.live_update=!0);break}case"flood.max":{const a=parseInt(n);if(isNaN(a)||a<0||a>64){o(),this.writeError(e,"Max flood hops must be 0-64"),s();return}l=await J.post("/update_radio_config",{max_flood_hops:a},{timeout:3e4});break}case"flood.advert.interval":{const a=parseInt(n);if(isNaN(a)||a!==0&&(a<3||a>48)){o(),this.writeError(e,"Flood advert interval must be 0 (off) or 3-48 hours"),s();return}l=await J.post("/update_radio_config",{flood_advert_interval_hours:a},{timeout:3e4});break}case"advert.interval":{const a=parseInt(n);if(isNaN(a)||a!==0&&(a<1||a>10080)){o(),this.writeError(e,"Advert interval must be 0 (off) or 1-10080 minutes"),s();return}l=await J.post("/update_radio_config",{advert_interval_minutes:a},{timeout:3e4});break}case"log":o(),this.writeWarning(e,"Log level configuration not yet implemented"),this.writeInfo(e,"Backend endpoint /set_log_level does not exist"),s();return;default:o(),this.writeError(e,`Unknown parameter: ${r}`),this.writeLine(e,""),this.writeInfo(e,'Type "set" without arguments to see available parameters'),s();return}o();const h=l.data||l;l.success?(h.applied&&h.applied.length>0?this.writeSuccess(e,`Configuration updated: ${h.applied.join(", ")}`):this.writeSuccess(e,"Configuration updated"),h.restart_required?(this.writeLine(e,""),this.writeWarning(e,"⚠ Service restart required for changes to take effect"),this.writeInfo(e,"Run: sudo systemctl restart pymc_repeater")):h.message&&!h.live_update&&(this.writeLine(e,""),this.writeInfo(e,h.message))):this.writeError(e,l.error||"Failed to update configuration")}catch(l){o(),this.writeError(e,`Failed to update ${r}: ${l}`)}this.writeLine(e,""),s()}writeWarning(e,i){e.writeln(`\x1B[1;33m⚠ Warning:\x1B[0m ${i}`)}}class cg extends ze{name="identities";description="List all identities";aliases=["id","ids"];isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:e,writePrompt:i}){const s=this.startLoading(e,"Fetching identities...");try{const r=await J.getIdentities();s();let n=[];if(r.success&&r.data){const o=r.data,l=o.registered||[],h=o.configured||[];n=h.length>0?h:l}else Array.isArray(r)&&(n=r);n.length===0?this.writeInfo(e,"No identities found"):(this.writeSuccess(e,`Found \x1B[1m${n.length}\x1B[0m identit${n.length===1?"y":"ies"}`),e.writeln(""),this.isMobile()?n.forEach((o,l)=>{e.writeln(`\x1B[1;36m[${l+1}] ${o.name||"Unnamed"}\x1B[0m`),e.writeln(` \x1B[90mType:\x1B[0m ${o.type||"-"}`),e.writeln(` \x1B[90mHash:\x1B[0m ${o.hash||"-"}`),e.writeln(` \x1B[90mAddress:\x1B[0m ${o.address||"-"}`),e.writeln(` \x1B[90mRegistered:\x1B[0m ${o.registered?"\x1B[32myes\x1B[0m":"\x1B[31mno\x1B[0m"}`),l{const h=(l+1).toString().padEnd(2),a=(o.name||"Unnamed").padEnd(27),c=(o.type||"-").padEnd(13),_=(o.hash||"-").padEnd(4),f=(o.address||"-").padEnd(7),d=(o.registered?"yes":"no").padEnd(10);e.writeln(`\x1B[36m│\x1B[0m ${h} \x1B[36m│\x1B[0m \x1B[1m${a}\x1B[0m \x1B[36m│\x1B[0m ${c} \x1B[36m│\x1B[0m ${_} \x1B[36m│\x1B[0m ${f} \x1B[36m│\x1B[0m ${d} \x1B[36m│\x1B[0m`)}),e.writeln("\x1B[36m└────┴─────────────────────────────┴───────────────┴──────┴─────────┴────────────┘\x1B[0m")))}catch(r){s(),this.writeError(e,r instanceof Error?r.message:"Failed to fetch identities")}i()}}class dg extends ze{name="keys";description="List transport keys";async execute({term:e,writePrompt:i}){const s=this.startLoading(e,"Fetching transport keys...");try{const r=await J.getTransportKeys();s();const n=r.success&&r.data?r.data:r,o=Array.isArray(n)?n:[];o.length===0?this.writeInfo(e,"No transport keys found"):(this.writeSuccess(e,`Found \x1B[1m${o.length}\x1B[0m transport key${o.length===1?"":"s"}`),e.writeln(""),o.forEach((l,h)=>{e.writeln(`\x1B[36m${(h+1).toString().padStart(2)}.\x1B[0m \x1B[1m${l.name||"Unnamed"}\x1B[0m`),l.flood_policy&&e.writeln(` Policy: \x1B[90m${l.flood_policy}\x1B[0m`),l.parent_id&&e.writeln(` Parent: \x1B[90m${l.parent_id}\x1B[0m`),h{if(e.writeln(`\x1B[1;36m[${l+1}] ${o.node_name||"Unknown"}\x1B[0m`),e.writeln(` \x1B[90mPubKey:\x1B[0m ${o.pubkey?.substring(0,8)||"----"}`),e.writeln(` \x1B[90mType:\x1B[0m ${o.contact_type||"-"}`),o.last_seen){const h=new Date(o.last_seen*1e3).toLocaleString("en-US",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1});e.writeln(` \x1B[90mLast Seen:\x1B[0m ${h}`)}o.rssi&&e.writeln(` \x1B[90mRSSI:\x1B[0m ${o.rssi}`),o.snr&&e.writeln(` \x1B[90mSNR:\x1B[0m ${o.snr}`),e.writeln(` \x1B[90mAdverts:\x1B[0m ${o.advert_count||0}`),e.writeln(` \x1B[90mDirect:\x1B[0m ${o.zero_hop?"\x1B[32myes\x1B[0m":"\x1B[31mno\x1B[0m"}`),l{const h=(l+1).toString().padEnd(2),a=(o.node_name||"Unknown").padEnd(20),c=(o.pubkey?.substring(0,4)||"----").padEnd(6),_=(o.contact_type||"-").padEnd(12),f=o.last_seen?new Date(o.last_seen*1e3).toLocaleString("en-US",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).padEnd(20):"-".padEnd(20),d=(o.rssi?`${o.rssi}`:"-").padEnd(8),m=(o.snr?`${o.snr}`:"-").padEnd(4),y=(o.advert_count?.toString()||"0").padEnd(6),k=(o.zero_hop?"yes":"no").padEnd(6);e.writeln(`\x1B[36m│\x1B[0m ${h} \x1B[36m│\x1B[0m \x1B[1m${a}\x1B[0m \x1B[36m│\x1B[0m ${c} \x1B[36m│\x1B[0m ${_} \x1B[36m│\x1B[0m ${f} \x1B[36m│\x1B[0m ${d} \x1B[36m│\x1B[0m ${m} \x1B[36m│\x1B[0m ${y} \x1B[36m│\x1B[0m ${k} \x1B[36m│\x1B[0m`)}),e.writeln("\x1B[36m└────┴──────────────────────┴────────┴──────────────┴──────────────────────┴──────────┴──────┴────────┴────────┘\x1B[0m")),n.length>10&&(e.writeln(""),e.writeln(`\x1B[90m... and ${n.length-10} more neighbors\x1B[0m`)))}catch(r){s(),this.writeError(e,r instanceof Error?r.message:"Failed to fetch neighbors")}i()}}class _g extends ze{name="acl";description="Show ACL statistics";async execute({term:e,writePrompt:i}){const s=this.startLoading(e,"Fetching ACL stats...");try{const r=await J.getACLStats();s();const n=r.success&&r.data?r.data:r;if(n&&typeof n=="object"){this.writeSuccess(e,"ACL Statistics:"),e.writeln("");const o=(l,h=" ")=>{if(typeof l=="object"&&l!==null&&!Array.isArray(l))for(const[a,c]of Object.entries(l))typeof c=="object"&&c!==null?(e.writeln(`${h}\x1B[90m${a}:\x1B[0m`),o(c,h+" ")):e.writeln(`${h}\x1B[90m${a.padEnd(18)}\x1B[0m ${c}`);else e.writeln(`${h}${l}`)};for(const[l,h]of Object.entries(n))typeof h=="object"&&h!==null?(e.writeln(` \x1B[36m${l}\x1B[0m`),o(h," ")):e.writeln(` \x1B[36m${l.padEnd(20)}\x1B[0m ${h}`)}else this.writeError(e,"No ACL data available")}catch(r){s(),this.writeError(e,r instanceof Error?r.message:"Failed to fetch ACL stats")}i()}}class fg extends ze{name="rooms";description="List room servers";isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:e,writePrompt:i}){const s=this.startLoading(e,"Fetching room stats...");try{const r=await J.getRoomStats();s();let n=[];r.success&&r.data?n=r.data.rooms||(Array.isArray(r.data)?r.data:[]):Array.isArray(r)&&(n=r),n.length===0?this.writeInfo(e,"No room servers found"):(this.writeSuccess(e,`Found \x1B[1m${n.length}\x1B[0m room server${n.length===1?"":"s"}`),e.writeln(""),this.isMobile()?n.forEach((o,l)=>{e.writeln(`\x1B[1;36m[${l+1}] ${o.room_name||"Unnamed"}\x1B[0m`),e.writeln(` \x1B[90mMessages:\x1B[0m ${o.total_messages||0}`),e.writeln(` \x1B[90mTotal Clients:\x1B[0m ${o.total_clients||0}`),e.writeln(` \x1B[90mActive Clients:\x1B[0m ${o.active_clients||0}`),e.writeln(` \x1B[90mSync:\x1B[0m ${o.sync_running?"\x1B[32mrunning\x1B[0m":"\x1B[31mstopped\x1B[0m"}`),l{const h=(l+1).toString().padEnd(2),a=(o.room_name||"Unnamed").padEnd(27),c=(o.total_messages?.toString()||"0").padEnd(8),_=(o.total_clients?.toString()||"0").padEnd(12),f=(o.active_clients?.toString()||"0").padEnd(14),d=(o.sync_running?"running":"stopped").padEnd(8);e.writeln(`\x1B[36m│\x1B[0m ${h} \x1B[36m│\x1B[0m \x1B[1m${a}\x1B[0m \x1B[36m│\x1B[0m ${c} \x1B[36m│\x1B[0m ${_} \x1B[36m│\x1B[0m ${f} \x1B[36m│\x1B[0m ${d} \x1B[36m│\x1B[0m`)}),e.writeln("\x1B[36m└────┴─────────────────────────────┴──────────┴──────────────┴────────────────┴──────────┘\x1B[0m")))}catch(r){s(),this.writeError(e,r instanceof Error?r.message:"Failed to fetch room stats")}i()}}class gg extends ze{name="restart";description="Restart the pymc-repeater service";aliases=["reboot"];matches(e){const i=e.toLowerCase();return i==="restart"||i==="reboot"}async execute({term:e,writePrompt:i}){this.writeLine(e,""),this.writeLine(e,"\x1B[33m⚠️ This will restart the repeater service!\x1B[0m"),this.writeLine(e,""),this.writeInfo(e,"Attempting to restart service...");const s=this.startLoading(e,"Restarting...");try{const r=await J.post("/restart_service",{},{timeout:1e4});s(),r.success?(this.writeLine(e,""),this.writeSuccess(e,r.message||"Service restart initiated"),this.writeLine(e,""),this.writeInfo(e,"The service will restart momentarily. You may need to refresh this page.")):(this.writeLine(e,""),this.writeError(e,"Restart failed: "+(r.error||r.message||"Unknown error")),this.writeLine(e,""),this.writeInfo(e,"You may need to manually restart: sudo systemctl restart pymc-repeater"))}catch(r){s(),this.writeLine(e,"");const n=r;if(n.code==="ERR_NETWORK"||n.message?.includes("Network error")||n.message?.includes("ECONNRESET")||n.code==="ECONNRESET"){this.writeSuccess(e,"Service restart initiated successfully"),this.writeLine(e,""),await this.waitForServiceRestart(e,i);return}else n.code==="ECONNABORTED"||n.message?.includes("timeout")?(this.writeLine(e,"\x1B[33m⚠️ Request timed out - service may be restarting\x1B[0m"),this.writeLine(e,""),this.writeInfo(e,"Refresh the page in a few seconds to reconnect.")):n.response?.status===403||n.response?.status===401?(this.writeError(e,"Permission denied. Polkit rules may need configuration."),this.writeLine(e,""),this.writeInfo(e,"Run: sudo bash -c 'mkdir -p /etc/polkit-1/rules.d && cat > /etc/polkit-1/rules.d/10-pymc-repeater.rules <0;a--)e.write(`\r\x1B[36m⏳\x1B[0m Restarting service... ${a}s`),await new Promise(c=>setTimeout(c,1e3));e.write("\r\x1B[K");let o=4,l=0;const h="\r\x1B[36m⏳\x1B[0m Verifying restart (attempt ";for(;o<20;){l++,e.write(`${h}${l})... `);try{if((await fetch(`${window.location.protocol}//${window.location.host}/api/stats`,{signal:AbortSignal.timeout(3e3)})).ok){e.write("\r\x1B[K"),this.writeLine(e,""),this.writeSuccess(e,`Service is back online! (took ~${o}s)`),this.writeLine(e,""),i();return}}catch(a){const c=a;c.code&&!["ERR_NETWORK","ECONNREFUSED","ECONNRESET"].includes(c.code)&&e.write(`[${c.code}] `)}await new Promise(a=>setTimeout(a,1*1e3)),o+=1}e.write("\r\x1B[K"),this.writeLine(e,""),this.writeLine(e,"\x1B[33m⚠️ Service did not respond within 20 seconds\x1B[0m"),this.writeLine(e,""),this.writeInfo(e,"The service may still be starting. Try: status"),this.writeLine(e,""),i()}}class pg extends ze{name="ping";description="Ping a neighbor node to measure latency and signal quality";usage="ping [timeout_seconds]";async execute({term:e,args:i,writePrompt:s}){if(i.length===0){this.writeError(e,"Missing target node"),e.writeln(""),this.writeInfo(e,`Usage: ${this.usage}`),e.writeln(""),this.writeInfo(e,"Examples:"),this.writeInfo(e," ping MyNeighbor - Ping node by name"),this.writeInfo(e," ping 0xb5 - Ping node by pubkey hash"),this.writeInfo(e," ping MyNeighbor 20 - Ping with 20s timeout"),s();return}const r=i[0],n=i.length>1?parseInt(i[1]):10;if(isNaN(n)||n<1||n>60){this.writeError(e,"Invalid timeout. Must be between 1-60 seconds"),s();return}let o=null;const l=r.match(/^(0x)?([0-9a-fA-F]{1,2})$/);if(l)o=`0x${l[2].padStart(2,"0")}`;else{const a=this.startLoading(e,"Resolving target...");try{const c=["Chat Node","Repeater","Room Server","Hybrid Node","Unknown"];let _=!1;for(const f of c)try{const d=await J.get("/adverts_by_contact_type",{contact_type:f,hours:168}),m=d.success&&d.data?d.data:d,k=(Array.isArray(m)?m:[]).find(R=>R.node_name&&R.node_name.toLowerCase()===r.toLowerCase());if(k&&k.pubkey){o=`0x${k.pubkey.substring(0,2)}`,_=!0;break}}catch{continue}if(a(),!_){this.writeError(e,`Node '${r}' not found in neighbors`),e.writeln(""),this.writeInfo(e,"Try: neighbors - to list available nodes"),s();return}}catch(c){a(),this.writeError(e,`Failed to resolve target: ${c}`),s();return}}this.writeLine(e,`\x1B[36mPinging ${r} (${o}) with ${n}s timeout...\x1B[0m`),e.writeln("");const h=this.startLoading(e,"Waiting for response...");try{const a=await J.pingNeighbor(o,n);if(h(),a.success&&a.data){const c=a.data;this.writeSuccess(e,`Reply from ${r} (${c.target_id})`),e.writeln("");let _="\x1B[32m";if(c.rtt_ms>500?_="\x1B[31m":c.rtt_ms>250&&(_="\x1B[33m"),e.writeln(` \x1B[1mRound-Trip Time:\x1B[0m ${_}${c.rtt_ms.toFixed(2)} ms\x1B[0m`),e.writeln(` \x1B[1mRSSI:\x1B[0m ${c.rssi} dBm`),e.writeln(` \x1B[1mSNR:\x1B[0m ${c.snr_db} dB`),c.path&&c.path.length>0){const m=c.path.join(" → "),y=c.path.length;e.writeln(` \x1B[1mPath:\x1B[0m ${m}`),e.writeln(` \x1B[1mHops:\x1B[0m ${y}`)}e.writeln("");let f="Excellent",d="\x1B[32m";c.rtt_ms>500||c.rssi<-120?(f="Poor",d="\x1B[31m"):c.rtt_ms>250||c.rssi<-100?(f="Fair",d="\x1B[33m"):(c.rtt_ms>100||c.rssi<-80)&&(f="Good",d="\x1B[36m"),e.writeln(` \x1B[1mLink Quality:\x1B[0m ${d}${f}\x1B[0m`)}else this.writeError(e,a.error||"Ping failed")}catch(a){h(),this.writeError(e,`Ping failed: ${a.message||a}`)}e.writeln(""),s()}}async function na(){try{const t=["Chat Node","Repeater","Room Server","Hybrid Node","Unknown"],e=[];for(const i of t)try{const s=await J.get("/adverts_by_contact_type",{contact_type:i,hours:168}),r=s.success&&s.data?s.data:s;(Array.isArray(r)?r:[]).forEach(o=>{o.node_name&&!e.includes(o.node_name)&&e.push(o.node_name)})}catch{continue}return e.sort()}catch{return[]}}class vg{commands=[];constructor(){const e=new ig,i=new sg,s=new rg,r=new ng,n=new og,o=new ag,l=new lg,h=new hg,a=new cg,c=new dg,_=new ug,f=new _g,d=new fg,m=new gg,y=new pg,k=new tg([e,i,s,r,n,o,l,h,a,c,_,f,d,m,y]);this.commands=[k,e,i,s,r,n,o,l,h,a,c,_,f,d,m,y]}findCommand(e){return this.commands.find(i=>i.matches(e))}getAllCommands(){return this.commands}getCommandNames(){return this.commands.map(e=>e.name)}}const mg={class:"space-y-4 md:space-y-6"},wg={class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-3 md:p-4"},Sg={class:"flex items-center justify-between"},bg={class:"flex items-center gap-2 md:gap-3"},yg=["title"],Cg={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},xg={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},kg={class:"hidden sm:inline"},Lg=["title"],Bg={class:"hidden sm:inline"},Eg=["title"],Mg={key:0,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Rg={key:1,class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},Tg={class:"hidden sm:inline"},Dg={key:0,class:"glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-4"},Ag={class:"flex items-center gap-3"},Pg=["onKeydown"],$g={key:1,class:"absolute top-4 right-4 bg-black/80 backdrop-blur-sm px-3 py-2 rounded-lg border border-primary/30 flex items-center gap-2"},Ig=zl({name:"TerminalView",__name:"Terminal",setup(t){const{theme:e}=Ul(),i={background:"#1A1E1F",foreground:"#e0e0e0",cursor:"#00d9ff",cursorAccent:"#000000",selectionBackground:"#00d9ff40",selectionForeground:"#ffffff",black:"#000000",red:"#ff6b6b",green:"#51cf66",yellow:"#ffd93d",blue:"#00d9ff",magenta:"#e599f7",cyan:"#00d9ff",white:"#e0e0e0",brightBlack:"#6c757d",brightRed:"#ff8787",brightGreen:"#69db7c",brightYellow:"#ffe066",brightBlue:"#74c0fc",brightMagenta:"#f3a6ff",brightCyan:"#3bc9db",brightWhite:"#ffffff"},s={background:"#F3F4F6",foreground:"#1f2937",cursor:"#0D7377",cursorAccent:"#ffffff",selectionBackground:"#0D737740",selectionForeground:"#000000",black:"#1f2937",red:"#dc2626",green:"#15803d",yellow:"#a16207",blue:"#0D7377",magenta:"#7c3aed",cyan:"#0e7490",white:"#f3f4f6",brightBlack:"#6b7280",brightRed:"#ef4444",brightGreen:"#22c55e",brightYellow:"#eab308",brightBlue:"#0891b2",brightMagenta:"#a855f7",brightCyan:"#06b6d4",brightWhite:"#ffffff"},r=ut(null),n=ut(null),o=ut(null),l=ut(""),h=ut(!1),a=ut(!1),c=ut(!1),_=ut(!1),f=ut(!1);ut(0);let d=null,m=null,y=null,k="";const R=[];let D=-1,T="";const S=new vg,L=S.getCommandNames();let B=[],$=0;const U={get:["name","role","lat","lon","freq","tx","bw","sf","cr","radio","txdelay","direct.txdelay","rxdelay","af","mode","repeat","flood.max","advert.interval","duty","duty.max","public.key"],set:["tx","freq","bw","sf","cr","txdelay","direct.txdelay","rxdelay","name","lat","lon","mode","duty","flood.max","advert.interval","flood.advert.interval"],ping:[]},Y={set:{mode:["forward","monitor"],duty:["on","off"]}},le={get:{name:"Node name",role:"Node role",lat:"Latitude",lon:"Longitude",freq:"Frequency (MHz)",tx:"TX power (dBm)",bw:"Bandwidth (kHz)",sf:"Spreading factor",cr:"Coding rate",radio:"All radio settings",txdelay:"TX delay factor","direct.txdelay":"Direct TX delay",rxdelay:"RX delay base",af:"Airtime factor",mode:"Repeater mode",repeat:"Repeat on/off","flood.max":"Max flood hops","advert.interval":"Advert interval",duty:"Duty cycle enabled","duty.max":"Max airtime %","public.key":"Public key"},set:{tx:"TX power (2-30 dBm)",freq:"Frequency (100-1000 MHz) *restart required*",bw:"Bandwidth (7.8-500 kHz) *restart required*",sf:"Spreading factor (5-12) *restart required*",cr:"Coding rate (5-8) *restart required*",txdelay:"TX delay factor (0.0-5.0)","direct.txdelay":"Direct TX delay (0.0-5.0)",rxdelay:"RX delay base (>= 0)",name:"Node name",lat:"Latitude (-90 to 90)",lon:"Longitude (-180 to 180)",mode:"Repeater mode (forward/monitor/no_tx)",duty:"Duty cycle (on/off)","flood.max":"Max flood hops (0-64)","advert.interval":"Advert interval (0 or 1-10080 mins)","flood.advert.interval":"Flood advert (0 or 3-48 hrs)"},ping:{}};Hl(()=>{if(!r.value)return;c.value=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);const O=window.innerWidth<768;d=new su({cursorBlink:!1,cursorStyle:"underline",cursorWidth:3,fontFamily:'"JetBrains Mono", "Fira Code", Menlo, Monaco, "Courier New", monospace',fontSize:O?11:13,fontWeight:"400",fontWeightBold:"700",lineHeight:1.3,letterSpacing:.5,smoothScrollDuration:50,scrollSensitivity:3,fastScrollSensitivity:5,allowProposedApi:!0,screenReaderMode:c.value,theme:e.value==="dark"?i:s,scrollback:1e4,tabStopWidth:4,macOptionIsMeta:!0}),m=new ou,d.loadAddon(m);try{const fe=new eg;d.loadAddon(fe)}catch{console.warn("WebGL addon failed to load, falling back to canvas renderer")}const I=new uu((fe,ee)=>{window.open(ee,"_blank")});d.loadAddon(I);const G=new m_;if(d.loadAddon(G),d.unicode.activeVersion="11",y=new Ku,d.loadAddon(y),d.open(r.value),m.fit(),d.focus(),c.value&&n.value){const fe=n.value,ee=()=>{fe.focus({preventScroll:!1})};r.value?.addEventListener("click",ee),r.value?.addEventListener("touchstart",ee),fe.addEventListener("input",()=>{setTimeout(()=>{d?.scrollToBottom()},10)}),Rn(()=>{r.value?.removeEventListener("click",ee),r.value?.removeEventListener("touchstart",ee)})}const X=e.value==="dark"?"\x1B[1;37m":"\x1B[1;90m",_e=(e.value==="dark","\x1B[1;36m"),Le=(e.value==="dark","\x1B[90m"),Be="\x1B[36m",N="\x1B[0m";d.writeln(""),d.writeln(`${X} ██████ ██ ██ ███ ███ ██████${N}`),d.writeln(`${X} ██ ██ ██ ██ ████ ████ ██ ${N}`),d.writeln(`${X} ██████ ████ ██ ████ ██ ██ ${N}`),d.writeln(`${X} ██ ██ ██ ██ ██ ██ ${N}`),d.writeln(`${X} ██ ██ ██ ██ ██████${N}`),d.writeln(""),d.writeln(`${_e} Repeater Terminal${N}`),d.writeln(""),d.writeln(`${Le} Type ${Be}help${Le} for available commands${N}`),d.writeln(""),W(),d.onData(fe=>{p(fe)});const be=new ResizeObserver(()=>{m?.fit()});be.observe(r.value),Rn(()=>{be.disconnect(),d?.dispose()})});const W=()=>{d?.write(`\r -\x1B[1;36m❯\x1B[0m `)},v=O=>{if(!(!d||!O)){d.write(`\x1B[90m${O}\x1B[0m`);for(let I=0;I{if(!(!d||!T)){for(let O=0;O{if(!d)return;const I=O.charCodeAt(0);if(I===13){u(),d.write(`\r -`),k.trim()?(w(k.trim()),R.push(k.trim()),D=R.length):W(),k="";return}if(I===127){k.length>0&&(u(),k=k.slice(0,-1),d.write("\b \b"),g());return}if(I===3){u(),d.write(`^C\r -`),k="",W();return}if(I===12){d.clear(),k="",W();return}if(I===6){h.value=!h.value;return}if(O==="\x1B[A"){R.length>0&&D>0&&(u(),D--,d.write("\r\x1B[K"),W(),k=R[D],d.write(k));return}if(O==="\x1B[B"){u(),D2&&Y[_e]){const N=X[1]?.toLowerCase(),be=X.slice(2).join(" ").toLowerCase(),fe=Y[_e][N];if(fe){const ee=fe.filter(He=>He.toLowerCase().startsWith(be));if(ee.length===1){const He=X.slice(2).join(" "),ve=ee[0].slice(He.length);k+=ve,d.write(ve)}else ee.length>1&&(d.write(`\r -\r -\x1B[33mAvailable values:\x1B[0m\r -\r -`),ee.forEach(He=>{d.writeln(` \x1B[36m${He}\x1B[0m`)}),W(),d.write(k));return}}if(X.length>1&&U[_e]){if(_e==="ping"){const fe=X.slice(1).join(" ").toLowerCase(),ee=Date.now();ee-$>3e4&&na().then(ve=>{B=ve,$=ee,U.ping=ve});const He=B.filter(ve=>ve.toLowerCase().startsWith(fe));if(He.length===1){const ve=X.slice(1).join(" "),hi=He[0].slice(ve.length)+" ";k+=hi,d.write(hi)}else He.length>1?(d.write(`\r -\r -\x1B[33mAvailable neighbors:\x1B[0m\r -\r -`),He.forEach(ve=>{d.writeln(` \x1B[36m${ve}\x1B[0m`)}),W(),d.write(k)):B.length===0&&fe===""&&(d.write(`\r -\r -\x1B[33mFetching neighbors...\x1B[0m\r -`),na().then(ve=>{B=ve,$=ee,U.ping=ve,d.write(`\r -\x1B[33mAvailable neighbors:\x1B[0m\r -\r -`),ve.forEach(hi=>{d.writeln(` \x1B[36m${hi}\x1B[0m`)}),W(),d.write(k)}).catch(()=>{d.write(`\r -\x1B[31mFailed to fetch neighbors\x1B[0m\r -`),W(),d.write(k)}));return}const N=X.slice(1).join(" ").toLowerCase(),be=U[_e].filter(fe=>fe.toLowerCase().startsWith(N));if(be.length===1){const fe=X.slice(1).join(" "),ee=be[0].slice(fe.length)+" ";k+=ee,d.write(ee)}else if(be.length>1){d.write(`\r -\r -\x1B[33mAvailable parameters:\x1B[0m\r -\r -`);const fe=le[_e]||{};be.forEach(ee=>{const He=fe[ee]||"",ve=ee.padEnd(20);d.writeln(` \x1B[36m${ve}\x1B[0m\x1B[90m${He}\x1B[0m`)}),W(),d.write(k)}return}const Be=S.getAllCommands().filter(N=>!!(N.name.toLowerCase().startsWith(G)||N.aliases?.some(be=>be.toLowerCase().startsWith(G))));if(Be.length===1){const N=Be[0].name.slice(k.length)+" ";k+=N,d.write(N)}else Be.length>1&&(d.write(`\r -\r -\x1B[33mAvailable commands:\x1B[0m\r -\r -`),Be.forEach(N=>{const be=N.aliases&&N.aliases.length>0?` (${N.aliases.join(", ")})`:"";d.writeln(` \x1B[36m${N.name.padEnd(15)}\x1B[0m ${N.description}${be}`)}),W(),d.write(k));return}I>=32&&I<127&&(u(),k+=O,d.write(O),c.value||g())},g=()=>{if(k.length===0){T="";return}const O=L.filter(I=>I.startsWith(k.toLowerCase()));O.length===1&&O[0]!==k?(T=O[0].slice(k.length),v(T)):T=""},w=async O=>{if(!d)return;const I=O.trim(),[G,...X]=I.split(/\s+/),_e=S.findCommand(G);if(_e)try{await _e.execute({term:d,args:X,writePrompt:W})}catch(Le){console.error("Command execution error:",Le),d.writeln(`\x1B[1;31m✗ Error:\x1B[0m ${Le instanceof Error?Le.message:"Command failed"}`),W()}else d.writeln(`\x1B[1;31m✗ Unknown command:\x1B[0m ${G}`),d.writeln("\x1B[90mType \x1B[36mhelp\x1B[90m for available commands\x1B[0m"),W()},b=()=>{!y||!l.value||y.findNext(l.value,{caseSensitive:!1})},C=()=>{!y||!l.value||y.findPrevious(l.value,{caseSensitive:!1})},x=()=>{h.value=!1,l.value="",d?.focus()},M=async()=>{if(o.value){if(_.value)try{document.exitFullscreen&&await document.exitFullscreen(),_.value=!1}catch(O){console.error("Failed to exit fullscreen:",O)}else try{o.value.requestFullscreen&&await o.value.requestFullscreen(),_.value=!0,setTimeout(()=>{c.value&&n.value?n.value.focus():d&&d.focus()},100)}catch(O){console.error("Failed to enter fullscreen:",O)}setTimeout(()=>{m?.fit()},100)}},F=()=>{f.value=!f.value,f.value&&c.value&&setTimeout(()=>{window.scrollTo(0,1)},100),setTimeout(()=>{c.value&&n.value?n.value.focus():d?.focus(),m?.fit()},150)},K=()=>{f.value=!1,setTimeout(()=>{m?.fit()},100)};ql(e,O=>{d&&(d.options.theme=O==="dark"?i:s)}),typeof document<"u"&&(document.addEventListener("fullscreenchange",()=>{_.value=!!document.fullscreenElement,setTimeout(()=>m?.fit(),100)}),document.addEventListener("keydown",O=>{O.key==="Escape"&&f.value&&!_.value&&K()}),document.addEventListener("keydown",O=>{O.key==="Escape"&&f.value&&!_.value&&K()}));const z=()=>{c.value&&n.value&&n.value.focus()},pe=O=>{const I=O.target,G=I.value;if(G&&d){const X=G.slice(-1);p(X)}I.value=""},q=()=>{d&&p("\r"),n.value&&(n.value.value="")},ne=()=>{d&&p(""),n.value&&(n.value.value="")};return(O,I)=>(it(),tt("div",mg,[Z("div",wg,[Z("div",Sg,[I[8]||(I[8]=Z("div",null,[Z("h1",{class:"text-content-primary dark:text-content-primary text-lg md:text-xl font-semibold"},"Terminal"),Z("p",{class:"text-content-secondary dark:text-content-muted text-sm hidden md:block"},"Interactive command-line interface")],-1)),Z("div",bg,[c.value?(it(),tt("button",{key:0,onClick:F,class:"flex items-center gap-2 px-3 py-2 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors",title:f.value?"Exit fullscreen":"Enter fullscreen"},[f.value?(it(),tt("svg",xg,I[3]||(I[3]=[Z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(it(),tt("svg",Cg,I[2]||(I[2]=[Z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"},null,-1)]))),Z("span",kg,Is(f.value?"Exit":"Fullscreen"),1)],8,yg)):Yt("",!0),c.value?Yt("",!0):(it(),tt("button",{key:1,onClick:F,class:"flex items-center gap-2 px-3 py-2 md:px-4 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors",title:f.value?"Exit full window":"Full window"},[I[4]||(I[4]=Z("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z"})],-1)),Z("span",Bg,Is(f.value?"Exit Window":"Full Window"),1)],8,Lg)),c.value?Yt("",!0):(it(),tt("button",{key:2,onClick:M,class:"flex items-center gap-2 px-3 py-2 md:px-4 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors",title:_.value?"Exit fullscreen":"Fullscreen"},[_.value?(it(),tt("svg",Rg,I[6]||(I[6]=[Z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)]))):(it(),tt("svg",Mg,I[5]||(I[5]=[Z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"},null,-1)]))),Z("span",Tg,Is(_.value?"Exit Full":"Fullscreen"),1)],8,Eg)),Z("button",{onClick:I[0]||(I[0]=G=>h.value=!h.value),class:"flex items-center gap-2 px-3 py-2 md:px-4 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors"},I[7]||(I[7]=[Z("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})],-1),Z("span",{class:"hidden sm:inline"},"Search",-1)]))])])]),h.value?(it(),tt("div",Dg,[Z("div",Ag,[Kl(Z("input",{"onUpdate:modelValue":I[1]||(I[1]=G=>l.value=G),onKeydown:[Ji(b,["enter"]),Ji(x,["esc"])],type:"text",placeholder:"Search terminal output...",class:"flex-1 px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 outline-none focus:border-primary/50 transition-colors"},null,544),[[Vl,l.value]]),Z("button",{onClick:C,class:"px-3 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary transition-colors",title:"Previous (Shift+Enter)"}," ↑ "),Z("button",{onClick:b,class:"px-3 py-2 bg-primary/20 hover:bg-primary/30 border border-primary/50 rounded-lg text-primary transition-colors",title:"Next (Enter)"}," ↓ "),Z("button",{onClick:x,class:"px-3 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary transition-colors"}," ✕ ")])])):Yt("",!0),Z("div",{ref_key:"terminalContainerRef",ref:o,class:Tn(["bg-surface dark:bg-surface-elevated/80 backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] overflow-hidden relative",{"fullscreen-terminal":_.value,"full-window-terminal":f.value}])},[f.value&&!_.value?(it(),tt("button",{key:0,onClick:K,class:"absolute top-4 right-4 z-50 p-2 bg-black/80 backdrop-blur-sm hover:bg-black/90 text-white border border-white/20 rounded-lg transition-colors",title:"Exit full window (ESC)"},I[9]||(I[9]=[Z("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[Z("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)]))):Yt("",!0),Z("div",{ref_key:"terminalRef",ref:r,class:Tn(["terminal-container",{"fullscreen-content":_.value}]),onClick:z,onTouchstart:z},[c.value?(it(),tt("input",{key:0,ref_key:"mobileInputRef",ref:n,type:"text",class:"mobile-keyboard-input",onInput:pe,onKeydown:[Ji(jl(q,["prevent"]),["enter"]),Ji(ne,["delete"])],inputmode:"text",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellcheck:"false"},null,40,Pg)):Yt("",!0)],34),a.value?(it(),tt("div",$g,I[10]||(I[10]=[Z("div",{class:"w-2 h-2 bg-primary rounded-full animate-pulse"},null,-1),Z("span",{class:"text-primary text-sm font-medium"},"Processing...",-1)]))):Yt("",!0)],2)]))}}),wv=Gl(Ig,[["__scopeId","data-v-6ccf263d"]]);export{wv as default}; diff --git a/repeater/web/html/assets/Terminal-EJD8zfRC.css b/repeater/web/html/assets/Terminal-EJD8zfRC.css deleted file mode 100644 index 1227d47..0000000 --- a/repeater/web/html/assets/Terminal-EJD8zfRC.css +++ /dev/null @@ -1,32 +0,0 @@ -/** - * Copyright (c) 2014 The xterm.js authors. All rights reserved. - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * https://github.com/chjj/term.js - * @license MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - * The original design remains. The terminal itself - * has been extended to include xterm CSI codes, among - * other features. - */.xterm{cursor:text;position:relative;-moz-user-select:none;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;inset:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;inset:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::-moz-selection{color:transparent}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;-webkit-user-select:text;-moz-user-select:text;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:-moz-fit-content;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:double underline;text-decoration:double underline}.xterm-underline-3{-webkit-text-decoration:wavy underline;text-decoration:wavy underline}.xterm-underline-4{-webkit-text-decoration:dotted underline;text-decoration:dotted underline}.xterm-underline-5{-webkit-text-decoration:dashed underline;text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.terminal-container[data-v-6ccf263d]{height:calc(100vh - 220px);min-height:400px;min-height:calc(100dvh - 220px);background-color:var(--color-surface)}@media (max-width: 768px){.terminal-container[data-v-6ccf263d]{height:calc(100vh - 140px);min-height:300px;min-height:calc(100dvh - 140px)}}@media (max-width: 640px){.terminal-container[data-v-6ccf263d]{height:calc(100vh - 120px);min-height:250px;min-height:calc(100dvh - 120px)}}[data-v-6ccf263d] .xterm{padding:1.5rem;height:100%!important}@media (max-width: 768px){[data-v-6ccf263d] .xterm{padding:1rem}}@media (max-width: 640px){[data-v-6ccf263d] .xterm{padding:.75rem}}[data-v-6ccf263d] .xterm-viewport,[data-v-6ccf263d] .xterm-screen{background-color:transparent!important}[data-v-6ccf263d] .xterm-selection{background-color:#00d9ff4d!important}kbd[data-v-6ccf263d]{font-family:Menlo,Monaco,Courier New,monospace;box-shadow:0 2px 4px #0003}.mobile-keyboard-input[data-v-6ccf263d]{position:absolute;bottom:0;left:0;width:1px;height:1px;opacity:.01;border:none;padding:0;margin:0;pointer-events:none;z-index:9999}.fullscreen-terminal[data-v-6ccf263d]{position:fixed!important;inset:0!important;width:100vw!important;height:100vh!important;height:100dvh!important;margin:0!important;border-radius:0!important;z-index:9999!important;background-color:var(--color-surface)!important}.fullscreen-content[data-v-6ccf263d]{height:100%!important;min-height:100%!important}.fullscreen-terminal[data-v-6ccf263d] .xterm{padding:2rem}@media (max-width: 768px){.fullscreen-terminal[data-v-6ccf263d] .xterm{padding:1rem}}.full-window-terminal[data-v-6ccf263d]{position:fixed!important;inset:0;width:100vw!important;height:100vh!important;height:100dvh!important;max-width:100vw!important;max-height:100vh!important;max-height:100dvh!important;z-index:9998;border-radius:0!important;margin:0!important;overflow:hidden;background-color:var(--color-surface)!important}.full-window-terminal .terminal-container[data-v-6ccf263d]{height:100vh!important;height:100dvh!important;width:100vw!important;overflow:auto}.full-window-terminal[data-v-6ccf263d] .xterm{padding:1rem;height:100%!important}@media (max-width: 768px){.full-window-terminal[data-v-6ccf263d]{touch-action:none}.full-window-terminal .terminal-container[data-v-6ccf263d]{overscroll-behavior:none}.full-window-terminal[data-v-6ccf263d] .xterm{padding:.75rem}} diff --git a/repeater/web/html/assets/Terminal-G0FM7r0V.js b/repeater/web/html/assets/Terminal-G0FM7r0V.js new file mode 100644 index 0000000..539295e --- /dev/null +++ b/repeater/web/html/assets/Terminal-G0FM7r0V.js @@ -0,0 +1,198 @@ +import{C as e,S as t,dt as n,g as r,j as i,k as a,l as o,lt as s,s as c,u as l,w as u,z as d}from"./runtime-core.esm-bundler-IofF4kUm.js";import{t as f}from"./api-CrUX-ZnK.js";import{t as p}from"./_plugin-vue_export-helper-V-yks4gF.js";import{t as m}from"./useTheme-Dlt6-wEf.js";import{d as h,m as g,p as _}from"./index-CPWfwDmA.js";var v=Object.defineProperty,y=Object.getOwnPropertyDescriptor,b=(e,t)=>{for(var n in t)v(e,n,{get:t[n],enumerable:!0})},x=(e,t,n,r)=>{for(var i=r>1?void 0:r?y(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&v(t,n,i),i},S=(e,t)=>(n,r)=>t(n,r,e),ee=`Terminal input`,te={get:()=>ee,set:e=>ee=e},C=`Too much output to announce, navigate to rows manually to read`,w={get:()=>C,set:e=>C=e};function T(e){return e.replace(/\r?\n/g,`\r`)}function E(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function D(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function ne(e,t,n,r){e.stopPropagation(),e.clipboardData&&O(e.clipboardData.getData(`text/plain`),t,n,r)}function O(e,t,n,r){e=T(e),e=E(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function re(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function k(e,t,n,r,i){re(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function A(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function j(e,t=0,n=e.length){let r=``;for(let i=t;i65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var ie=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o);continue}i!==65279&&(t[r++]=i)}return r}},ae=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}else this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(c=(i&31)<<6|a&63,c<128){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},oe=``,se=` `,ce=class e{constructor(){this.fg=0,this.bg=0,this.extended=new le}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return(this.fg&50331648)==0}isBgDefault(){return(this.bg&50331648)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},le=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},M=class e extends ce{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new le,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?A(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},ue=`di$target`,de=`di$dependencies`,fe=new Map;function pe(e){return e[de]||[]}function N(e){if(fe.has(e))return fe.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);me(t,e,r)};return t._id=e,fe.set(e,t),t}function me(e,t,n){t[ue]===t?t[de].push({id:e,index:n}):(t[de]=[{id:e,index:n}],t[ue]=t)}var P=N(`BufferService`),he=N(`CoreMouseService`),ge=N(`CoreService`),_e=N(`CharsetService`),ve=N(`InstantiationService`),ye=N(`LogService`),be=N(`OptionsService`),xe=N(`OscLinkService`),Se=N(`UnicodeService`),Ce=N(`DecorationService`),we=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new M,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;ti?i.activate(e,t,a):Te(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};we=x([S(0,P),S(1,be),S(2,xe)],we);function Te(e,t){if(confirm(`Do you want to navigate to ${t}? + +WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var Ee=N(`CharSizeService`),De=N(`CoreBrowserService`),Oe=N(`MouseService`),ke=N(`RenderService`),Ae=N(`SelectionService`),je=N(`CharacterJoinerService`),Me=N(`ThemeService`),Ne=N(`LinkProviderService`),Pe=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Be.isErrorNoTelemetry(e)?new Be(e.message+` + +`+e.stack):Error(e.message+` + +`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function Fe(e){Le(e)||Pe.onUnexpectedError(e)}var Ie=`Canceled`;function Le(e){return e instanceof Re?!0:e instanceof Error&&e.name===Ie&&e.message===Ie}var Re=class extends Error{constructor(){super(Ie),this.name=this.message}};function ze(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var Be=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},Ve=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function He(e,t,n=0,r=e.length){let i=n,a=r;for(;i{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Ge||={});function Ke(e,t){return(n,r)=>t(e(n),e(r))}var qe=(e,t)=>e-t,Je=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>t(n)?e(n):!0))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>e(n)?(t=n,!1):!0),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||Ge.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};Je.empty=new Je(e=>{});function Ye(e,t){let n=Object.create(null);for(let r of e){let e=t(r),i=n[e];i||=n[e]=[],i.push(r)}return n}var Xe=class{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){let n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){let n=this.map.get(e);n&&n.forEach(t)}get(e){return this.map.get(e)||new Set}};function Ze(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var Qe;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);tt.source!==null&&!this.getRootParent(t,e).isSingleton).flatMap(([e])=>e)}computeLeakingDisposables(e=10,t){let n;if(t)n=t;else{let e=new Map,t=[...this.livingDisposables.values()].filter(t=>t.source!==null&&!this.getRootParent(t,e).isSingleton);if(t.length===0)return;let r=new Set(t.map(e=>e.value));if(n=t.filter(e=>!(e.parent&&r.has(e.parent))),n.length===0)throw Error(`There are cyclic diposable chains!`)}if(!n)return;function r(e){function t(e,t){for(;e.length>0&&t.some(t=>typeof t==`string`?t===e[0]:e[0].match(t));)e.shift()}let n=e.source.split(` +`).map(e=>e.trim().replace(`at `,``)).filter(e=>e!==``);return t(n,[`Error`,/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),n.reverse()}let i=new Xe;for(let e of n){let t=r(e);for(let n=0;n<=t.length;n++)i.add(t.slice(0,n).join(` +`),e)}n.sort(Ke(e=>e.idx,qe));let a=``,o=0;for(let t of n.slice(0,e)){o++;let e=r(t),s=[];for(let t=0;tr(e)[t]),e=>e);delete o[e[t]];for(let[e,t]of Object.entries(o))s.unshift(` - stacktraces of ${t.length} other leaks continue with ${e}`);s.unshift(a)}a+=` + + +==================== Leaking disposable ${o}/${n.length}: ${t.value.constructor.name} ==================== +${s.join(` +`)} +============================================================ + +`}return n.length>e&&(a+=` + + +... and ${n.length-e} more leaking disposables + +`),{leaks:n,details:a}}};tt.idx=0;function nt(e){et=e}if($e){let e=`__is_disposable_tracked__`;nt(new class{trackDisposable(t){let n=Error(`Potentially leaked disposable`).stack;setTimeout(()=>{t[e]||console.log(n)},3e3)}setParent(t,n){if(t&&t!==I.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==I.None)try{t[e]=!0}catch{}}markAsSingleton(e){}})}function rt(e){return et?.trackDisposable(e),e}function it(e){et?.markAsDisposed(e)}function at(e,t){et?.setParent(e,t)}function ot(e,t){if(et)for(let n of e)et.setParent(n,t)}function st(e){return et?.markAsSingleton(e),e}function ct(e){if(Qe.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function lt(...e){let t=F(()=>ct(e));return ot(e,t),t}function F(e){let t=rt({dispose:Ze(()=>{it(t),e()})});return t}var ut=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,rt(this)}dispose(){this._isDisposed||(it(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ct(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return at(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),at(e,null))}};ut.DISABLE_DISPOSED_WARNING=!1;var dt=ut,I=class{constructor(){this._store=new dt,rt(this),at(this._store,this)}dispose(){it(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}};I.None=Object.freeze({dispose(){}});var ft=class{constructor(){this._isDisposed=!1,rt(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&at(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,it(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&at(e,null),e}},pt=typeof window==`object`?window:globalThis,mt=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};mt.Undefined=new mt(void 0);var L=mt,ht=class{constructor(){this._first=L.Undefined,this._last=L.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===L.Undefined}clear(){let e=this._first;for(;e!==L.Undefined;){let t=e.next;e.prev=L.Undefined,e.next=L.Undefined,e=t}this._first=L.Undefined,this._last=L.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new L(e);if(this._first===L.Undefined)this._first=n,this._last=n;else if(t){let e=this._last;this._last=n,n.prev=e,e.next=n}else{let e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==L.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==L.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==L.Undefined&&e.next!==L.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===L.Undefined&&e.next===L.Undefined?(this._first=L.Undefined,this._last=L.Undefined):e.next===L.Undefined?(this._last=this._last.prev,this._last.next=L.Undefined):e.prev===L.Undefined&&(this._first=this._first.next,this._first.prev=L.Undefined);--this._size}*[Symbol.iterator](){let e=this._first;for(;e!==L.Undefined;)yield e.element,e=e.next}},gt=globalThis.performance&&typeof globalThis.performance.now==`function`,_t=class e{static create(t){return new e(t)}constructor(e){this._now=gt&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}},vt=!1,yt=!1,bt=!1,xt;(e=>{e.None=()=>I.None;function t(e){if(bt){let{onDidAddListener:t}=e,n=Dt.create(),r=0;e.onDidAddListener=()=>{++r===2&&(console.warn(`snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here`),n.print()),t?.()}}}function n(e,t){return f(e,()=>{},0,void 0,!0,void 0,t)}e.defer=n;function r(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=r;function i(e,t,n){return u((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=i;function a(e,t,n){return u((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=a;function o(e,t,n){return u((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=o;function s(e){return e}e.signal=s;function c(...e){return(t,n=null,r)=>d(lt(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=c;function l(e,t,n,r){let a=n;return i(e,e=>(a=t(a,e),a),r)}e.reduce=l;function u(e,n){let r,i={onWillAddFirstListener(){r=e(a.fire,a)},onDidRemoveLastListener(){r?.dispose()}};n||t(i);let a=new R(i);return n?.add(a),a.event}function d(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function f(e,n,r=100,i=!1,a=!1,o,s){let c,l,u,d=0,f,p={leakWarningThreshold:o,onWillAddFirstListener(){c=e(e=>{d++,l=n(l,e),i&&!u&&(m.fire(l),l=void 0),f=()=>{let e=l;l=void 0,u=void 0,(!i||d>1)&&m.fire(e),d=0},typeof r==`number`?(clearTimeout(u),u=setTimeout(f,r)):u===void 0&&(u=0,queueMicrotask(f))})},onWillRemoveListener(){a&&d>0&&f?.()},onDidRemoveLastListener(){f=void 0,c.dispose()}};s||t(p);let m=new R(p);return s?.add(m),m.event}e.debounce=f;function p(t,n=0,r){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,!0,void 0,r)}e.accumulate=p;function m(e,t=(e,t)=>e===t,n){let r=!0,i;return o(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=m;function h(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=h;function g(e,t=!1,n=[],r){let i=n.slice(),a=e(e=>{i?i.push(e):s.fire(e)});r&&r.add(a);let o=()=>{i?.forEach(e=>s.fire(e)),i=null},s=new R({onWillAddFirstListener(){a||(a=e(e=>s.fire(e)),r&&r.add(a))},onDidAddFirstListener(){i&&(t?setTimeout(o):o())},onDidRemoveLastListener(){a&&a.dispose(),a=null}});return r&&r.add(s),s.event}e.buffer=g;function _(e,t){return(n,r,i)=>{let a=t(new y);return e(function(e){let t=a.evaluate(e);t!==v&&n.call(r,t)},void 0,i)}}e.chain=_;let v=Symbol(`HaltChainable`);class y{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:v),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:v}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===v)break;return e}}function b(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new R({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=b;function x(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new R({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=x;function S(e){return new Promise(t=>r(e)(t))}e.toPromise=S;function ee(e){let t=new R;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event}e.fromPromise=ee;function te(e,t){return e(e=>t.fire(e))}e.forward=te;function C(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=C;class w{constructor(e,n){this._observable=e,this._counter=0,this._hasChanged=!1;let r={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};n||t(r),this.emitter=new R(r),n&&n.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function T(e,t){return new w(e,t).emitter.event}e.fromObservable=T;function E(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return r instanceof dt?r.add(s):Array.isArray(r)&&r.push(s),s}}e.fromObservableLight=E})(xt||={});var St=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new _t,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};St.all=new Set,St._idPool=0;var Ct=St,wt=-1,Tt=class e{constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t{if(e instanceof jt)t(e);else for(let n=0;n{e.length!==0&&(console.warn(`[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:`),console.warn(e.join(` +`)),e.length=0)},3e3),Pt=new FinalizationRegistry(t=>{typeof t==`string`&&e.push(t)})}var R=class{constructor(e){this._size=0,this._options=e,this._leakageMon=wt>0||this._options?.leakWarningThreshold?new Et(e?.onListenerError??Fe,this._options?.leakWarningThreshold??wt):void 0,this._perfMon=this._options?._profName?new Ct(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(yt){let e=this._listeners;queueMicrotask(()=>{Nt(e,e=>e.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new kt(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||Fe)(n),I.None}if(this._disposed)return I.None;t&&(e=e.bind(t));let r=new jt(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Dt.create(),i=this._leakageMon.check(r.stack,this._size+1)),yt&&(r.stack=Dt.create()),this._listeners?this._listeners instanceof jt?(this._deliveryQueue??=new Ft,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=F(()=>{Pt?.unregister(a),i?.(),this._removeListener(r)});if(n instanceof dt?n.add(a):Array.isArray(n)&&n.push(a),Pt){let e=Error().stack.split(` +`).slice(2,3).join(` +`).trim(),t=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(e);Pt.register(a,t?.[2]??e,a)}return a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*Mt<=t.length){let e=0;for(let n=0;n0}},Ft=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},It=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new R,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new R,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};It.INSTANCE=new It;var Lt=It;function Rt(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}Lt.INSTANCE.onDidChangeZoomLevel;function zt(e){return Lt.INSTANCE.getZoomFactor(e)}Lt.INSTANCE.onDidChangeFullscreen;var Bt=typeof navigator==`object`?navigator.userAgent:``,Vt=Bt.indexOf(`Firefox`)>=0,Ht=Bt.indexOf(`AppleWebKit`)>=0,Ut=Bt.indexOf(`Chrome`)>=0,Wt=!Ut&&Bt.indexOf(`Safari`)>=0;Bt.indexOf(`Electron/`),Bt.indexOf(`Android`);var Gt=!1;if(typeof pt.matchMedia==`function`){let e=pt.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=pt.matchMedia(`(display-mode: fullscreen)`);Gt=e.matches,Rt(pt,e,({matches:e})=>{Gt&&t.matches||(Gt=e)})}function Kt(){return Gt}var qt=`en`,Jt=!1,Yt=!1,Xt=!1,Zt=!1,Qt=!1,$t=qt,en,tn=globalThis,nn;typeof tn.vscode<`u`&&typeof tn.vscode.process<`u`?nn=tn.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(nn=process);var rn=typeof nn?.versions?.electron==`string`&&nn?.type===`renderer`;if(typeof nn==`object`){Jt=nn.platform===`win32`,Yt=nn.platform===`darwin`,Xt=nn.platform===`linux`,Xt&&nn.env.SNAP&&nn.env.SNAP_REVISION,nn.env.CI||nn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,$t=qt;let e=nn.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,$t=t.resolvedLanguage||qt,t.languagePack?.translationsConfigFile}catch{}Zt=!0}else typeof navigator==`object`&&!rn?(en=navigator.userAgent,Jt=en.indexOf(`Windows`)>=0,Yt=en.indexOf(`Macintosh`)>=0,(en.indexOf(`Macintosh`)>=0||en.indexOf(`iPad`)>=0||en.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,Xt=en.indexOf(`Linux`)>=0,en?.indexOf(`Mobi`),Qt=!0,$t=globalThis._VSCODE_NLS_LANGUAGE||qt,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var an=Jt,on=Yt,sn=Xt,cn=Zt;Qt&&typeof tn.importScripts==`function`&&tn.origin;var ln=en,un=$t,dn;(e=>{function t(){return un}e.value=t;function n(){return un.length===2?un===`en`:un.length>=3?un[0]===`e`&&un[1]===`n`&&un[2]===`-`:!1}e.isDefaultVariant=n;function r(){return un===`en`}e.isDefault=r})(dn||={});var fn=typeof tn.postMessage==`function`&&!tn.importScripts;(()=>{if(fn){let e=[];tn.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n{let r=++t;e.push({id:r,callback:n}),tn.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var pn=!!(ln&&ln.indexOf(`Chrome`)>=0);ln&&ln.indexOf(`Firefox`),!pn&&ln&&ln.indexOf(`Safari`),ln&&ln.indexOf(`Edg/`),ln&&ln.indexOf(`Android`);var mn=typeof navigator==`object`?navigator:{};cn||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||mn&&mn.clipboard&&mn.clipboard.writeText,cn||mn&&mn.clipboard&&mn.clipboard.readText,cn||Kt()||mn.keyboard,`ontouchstart`in pt||mn.maxTouchPoints,pt.PointerEvent&&(`ontouchstart`in pt||navigator.maxTouchPoints);var hn=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},gn=new hn,_n=new hn,vn=new hn,yn=Array(230),bn;(e=>{function t(e){return gn.keyCodeToStr(e)}e.toString=t;function n(e){return gn.strToKeyCode(e)}e.fromString=n;function r(e){return _n.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return vn.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return _n.strToKeyCode(e)||vn.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return gn.keyCodeToStr(e)}e.toElectronAccelerator=o})(bn||={});var xn=class e{constructor(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}equals(t){return t instanceof e&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){return`K${this.ctrlKey?`1`:`0`}${this.shiftKey?`1`:`0`}${this.altKey?`1`:`0`}${this.metaKey?`1`:`0`}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new Sn([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},Sn=class{constructor(e){if(e.length===0)throw ze(`chords`);this.chords=e}getHashCode(){let e=``;for(let t=0,n=this.chords.length;t{function t(t){return t===e.None||t===e.Cancelled||t instanceof In?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:xt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Pn})})(Fn||={});var In=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?Pn:(this._emitter||=new R,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}},Ln=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e==`function`&&typeof t==`number`&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Ve(`Calling 'cancelAndSet' on a disposed TimeoutTimer`);this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Ve(`Calling 'setIfNotSet' on a disposed TimeoutTimer`);this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},Rn=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new Ve(`Calling 'cancelAndSet' on a disposed IntervalTimer`);this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=F(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var zn;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(zn||={});var Bn=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new R,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Bn.EMPTY=Bn.fromArray([]);function Vn(e){return 55296<=e&&e<=56319}function Hn(e){return 56320<=e&&e<=57343}function Un(e,t){return(e-55296<<10)+(t-56320)+65536}function Wn(e){return Gn(e,0)}function Gn(e,t){switch(typeof e){case`object`:return e===null?Kn(349,t):Array.isArray(e)?Yn(e,t):Xn(e,t);case`string`:return Jn(e,t);case`boolean`:return qn(e,t);case`number`:return Kn(e,t);case`undefined`:return Kn(937,t);default:return Kn(617,t)}}function Kn(e,t){return(t<<5)-t+e|0}function qn(e,t){return Kn(e?433:863,t)}function Jn(e,t){t=Kn(149417,t);for(let n=0,r=e.length;nGn(t,e),t)}function Xn(e,t){return t=Kn(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=Jn(n,t),Gn(e[n],t)),t)}function Zn(e,t,n=32){let r=n-t,i=~((1<>>r)>>>0}function Qn(e,t=0,n=e.byteLength,r=0){for(let i=0;ie.toString(16).padStart(2,`0`)).join(``):$n((e>>>0).toString(16),t/4)}var tr=class e{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let t=e.length;if(t===0)return;let n=this._buff,r=this._buffLen,i=this._leftoverHighSurrogate,a,o;for(i===0?(a=e.charCodeAt(0),o=0):(a=i,o=-1,i=0);;){let s=a;if(Vn(a))if(o+1>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),er(this._h0)+er(this._h1)+er(this._h2)+er(this._h3)+er(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Qn(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Qn(this._buff));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let t=e._bigBlock32,n=this._buffDV;for(let e=0;e<64;e+=4)t.setUint32(e,n.getUint32(e,!1),!1);for(let e=64;e<320;e+=4)t.setUint32(e,Zn(t.getUint32(e-12,!1)^t.getUint32(e-32,!1)^t.getUint32(e-56,!1)^t.getUint32(e-64,!1),1),!1);let r=this._h0,i=this._h1,a=this._h2,o=this._h3,s=this._h4,c,l,u;for(let e=0;e<80;e++)e<20?(c=i&a|~i&o,l=1518500249):e<40?(c=i^a^o,l=1859775393):e<60?(c=i&a|i&o|a&o,l=2400959708):(c=i^a^o,l=3395469782),u=Zn(r,5)+c+s+l+t.getUint32(e*4,!1)&4294967295,s=o,o=a,a=Zn(i,30),i=r,r=u;this._h0=this._h0+r&4294967295,this._h1=this._h1+i&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+s&4294967295}};tr._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:nr,getWindow:rr,getDocument:ir,getWindows:ar,getWindowsCount:or,getWindowId:sr,getWindowById:cr,hasWindow:lr,onDidRegisterWindow:ur,onWillUnregisterWindow:dr,onDidUnregisterWindow:fr}=function(){let e=new Map,t={window:pt,disposables:new dt};e.set(pt.vscodeWindowId,t);let n=new R,r=new R,i=new R;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return I.None;let a=new dt,o={window:t,disposables:a.add(new dt)};return e.set(t.vscodeWindowId,o),a.add(F(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(z(t,Sr.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:pt},getDocument(e){return rr(e).document}}}(),pr=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function z(e,t,n,r){return new pr(e,t,n,r)}function mr(e,t){return function(n){return t(new Mn(e,n))}}function hr(e){return function(t){return e(new On(t))}}var gr=function(e,t,n,r){let i=n;return t===`click`||t===`mousedown`||t===`contextmenu`?i=mr(rr(e),n):(t===`keydown`||t===`keypress`||t===`keyup`)&&(i=hr(n)),z(e,t,i,r)},_r,vr=class extends Rn{constructor(e){super(),this.defaultTarget=e&&rr(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},yr=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Fe(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,i=i=>{n.set(i,!1);let a=e.get(i)??[];for(t.set(i,a),e.set(i,[]),r.set(i,!0);a.length>0;)a.sort(yr.sort),a.shift().execute();r.set(i,!1)};_r=(t,r,a=0)=>{let o=sr(t),s=new yr(r,a),c=e.get(o);return c||(c=[],e.set(o,c)),c.push(s),n.get(o)||(n.set(o,!0),t.requestAnimationFrame(()=>i(o))),s}})();var br=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};br.None=new br(0,0);function xr(e){let t=e.getBoundingClientRect(),n=rr(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=Wn(n),a=r.get(i);if(a)a.users+=1;else{let o=new R,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(F(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var Sr={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:Ht?`webkitAnimationStart`:`animationstart`,ANIMATION_END:Ht?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:Ht?`webkitAnimationIteration`:`animationiteration`},Cr=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function wr(e,t,n,...r){let i=Cr.exec(t);if(!i)throw Error(`Bad use of emmet`);let a=i[1]||`div`,o;return o=e===`http://www.w3.org/1999/xhtml`?document.createElement(a):document.createElementNS(e,a),i[3]&&(o.id=i[3]),i[4]&&(o.className=i[4].replace(/\./g,` `).trim()),n&&Object.entries(n).forEach(([e,t])=>{typeof t>`u`||(/^on\w+$/.test(e)?o[e]=t:e===`selected`?t&&o.setAttribute(e,`true`):o.setAttribute(e,t))}),o.append(...r),o}function Tr(e,t,...n){return wr(`http://www.w3.org/1999/xhtml`,e,t,...n)}Tr.SVG=function(e,t,...n){return wr(`http://www.w3.org/2000/svg`,e,t,...n)};var Er=class{constructor(e){this.domNode=e,this._maxWidth=``,this._width=``,this._height=``,this._top=``,this._left=``,this._bottom=``,this._right=``,this._paddingTop=``,this._paddingLeft=``,this._paddingBottom=``,this._paddingRight=``,this._fontFamily=``,this._fontWeight=``,this._fontSize=``,this._fontStyle=``,this._fontFeatureSettings=``,this._fontVariationSettings=``,this._textDecoration=``,this._lineHeight=``,this._letterSpacing=``,this._className=``,this._display=``,this._position=``,this._visibility=``,this._color=``,this._backgroundColor=``,this._layerHint=!1,this._contain=`none`,this._boxShadow=``}setMaxWidth(e){let t=Dr(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Dr(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Dr(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Dr(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Dr(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Dr(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Dr(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Dr(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Dr(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Dr(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Dr(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Dr(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Dr(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Dr(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?`translate3d(0px, 0px, 0px)`:``)}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Dr(e){return typeof e==`number`?`${e}px`:e}function Or(e){return new Er(e)}var kr=class{constructor(){this._hooks=new dt,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let a=e;try{e.setPointerCapture(t),this._hooks.add(F(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=rr(e)}this._hooks.add(z(a,Sr.POINTER_MOVE,e=>{if(e.buttons!==n){this.stopMonitoring(!0);return}e.preventDefault(),this._pointerMoveCallback(e)})),this._hooks.add(z(a,Sr.POINTER_UP,e=>this.stopMonitoring(!0)))}};function Ar(e,t,n){let r=null,i=null;if(typeof n.value==`function`?(r=`value`,i=n.value,i.length!==0&&console.warn(`Memoize should only be used in functions with zero parameters`)):typeof n.get==`function`&&(r=`get`,i=n.get),!i)throw Error(`not supported`);let a=`$memoize$${t}`;n[r]=function(...e){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,e)}),this[a]}}var jr;(e=>(e.Tap=`-xterm-gesturetap`,e.Change=`-xterm-gesturechange`,e.Start=`-xterm-gesturestart`,e.End=`-xterm-gesturesend`,e.Contextmenu=`-xterm-gesturecontextmenu`))(jr||={});var Mr=class e extends I{constructor(){super(),this.dispatched=!1,this.targets=new ht,this.ignoreTargets=new ht,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(xt.runAndSubscribe(ur,({window:e,disposables:t})=>{t.add(z(e.document,`touchstart`,e=>this.onTouchStart(e),{passive:!1})),t.add(z(e.document,`touchend`,t=>this.onTouchEnd(e,t))),t.add(z(e.document,`touchmove`,e=>this.onTouchMove(e),{passive:!1}))},{window:pt,disposables:this._store}))}static addTarget(t){return e.isTouchDevice()?(e.INSTANCE||=st(new e),F(e.INSTANCE.targets.push(t))):I.None}static ignoreTarget(t){return e.isTouchDevice()?(e.INSTANCE||=st(new e),F(e.INSTANCE.ignoreTargets.push(t))):I.None}static isTouchDevice(){return`ontouchstart`in pt||navigator.maxTouchPoints>0}dispose(){this.handle&&=(this.handle.dispose(),null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&=(this.handle.dispose(),null);for(let n=0,r=e.targetTouches.length;n=e.HOLD_DELAY&&Math.abs(s.initialPageX-We(s.rollingPageX))<30&&Math.abs(s.initialPageY-We(s.rollingPageY))<30){let e=this.newGestureEvent(jr.Contextmenu,s.initialTarget);e.pageX=We(s.rollingPageX),e.pageY=We(s.rollingPageY),this.dispatchEvent(e)}else if(i===1){let e=We(s.rollingPageX),n=We(s.rollingPageY),i=We(s.rollingTimestamps)-s.rollingTimestamps[0],a=e-s.rollingPageX[0],o=n-s.rollingPageY[0],c=[...this.targets].filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(t,c,r,Math.abs(a)/i,a>0?1:-1,e,Math.abs(o)/i,o>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(jr.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&=(n.preventDefault(),n.stopPropagation(),!1)}newGestureEvent(e,t){let n=document.createEvent(`CustomEvent`);return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(t){if(t.type===jr.Tap){let n=new Date().getTime(),r=0;r=n-this._lastSetTapCountTime>e.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=n,t.tapCount=r}else (t.type===jr.Change||t.type===jr.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let e of this.ignoreTargets)if(e.contains(t.initialTarget))return;let e=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let r=0,i=t.initialTarget;for(;i&&i!==n;)r++,i=i.parentElement;e.push([r,n])}e.sort((e,t)=>e[0]-t[0]);for(let[n,r]of e)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,i,a,o,s,c,l){this.handle=_r(t,()=>{let u=Date.now(),d=u-r,f=0,p=0,m=!0;i+=e.SCROLL_FRICTION*d,s+=e.SCROLL_FRICTION*d,i>0&&(m=!1,f=a*i*d),s>0&&(m=!1,p=c*s*d);let h=this.newGestureEvent(jr.Change);h.translationX=f,h.translationY=p,n.forEach(e=>e.dispatchEvent(h)),m||this.inertia(t,n,u,i,a,o+f,s,c,l+p)})}onTouchMove(e){let t=Date.now();for(let n=0,r=e.changedTouches.length;n3&&(i.rollingPageX.shift(),i.rollingPageY.shift(),i.rollingTimestamps.shift()),i.rollingPageX.push(r.pageX),i.rollingPageY.push(r.pageY),i.rollingTimestamps.push(t)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}};Mr.SCROLL_FRICTION=-.005,Mr.HOLD_DELAY=700,Mr.CLEAR_TAP_COUNT_TIME=400,x([Ar],Mr,`isTouchDevice`,1);var Nr=Mr,Pr=class extends I{onclick(e,t){this._register(z(e,Sr.CLICK,n=>t(new Mn(rr(e),n))))}onmousedown(e,t){this._register(z(e,Sr.MOUSE_DOWN,n=>t(new Mn(rr(e),n))))}onmouseover(e,t){this._register(z(e,Sr.MOUSE_OVER,n=>t(new Mn(rr(e),n))))}onmouseleave(e,t){this._register(z(e,Sr.MOUSE_LEAVE,n=>t(new Mn(rr(e),n))))}onkeydown(e,t){this._register(z(e,Sr.KEY_DOWN,e=>t(new On(e))))}onkeyup(e,t){this._register(z(e,Sr.KEY_UP,e=>t(new On(e))))}oninput(e,t){this._register(z(e,Sr.INPUT,t))}onblur(e,t){this._register(z(e,Sr.BLUR,t))}onfocus(e,t){this._register(z(e,Sr.FOCUS,t))}onchange(e,t){this._register(z(e,Sr.CHANGE,t))}ignoreGesture(e){return Nr.ignoreTarget(e)}},Fr=11,Ir=class extends Pr{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement(`div`),this.bgDomNode.className=`arrow-background`,this.bgDomNode.style.position=`absolute`,this.bgDomNode.style.width=e.bgWidth+`px`,this.bgDomNode.style.height=e.bgHeight+`px`,typeof e.top<`u`&&(this.bgDomNode.style.top=`0px`),typeof e.left<`u`&&(this.bgDomNode.style.left=`0px`),typeof e.bottom<`u`&&(this.bgDomNode.style.bottom=`0px`),typeof e.right<`u`&&(this.bgDomNode.style.right=`0px`),this.domNode=document.createElement(`div`),this.domNode.className=e.className,this.domNode.style.position=`absolute`,this.domNode.style.width=Fr+`px`,this.domNode.style.height=Fr+`px`,typeof e.top<`u`&&(this.domNode.style.top=e.top+`px`),typeof e.left<`u`&&(this.domNode.style.left=e.left+`px`),typeof e.bottom<`u`&&(this.domNode.style.bottom=e.bottom+`px`),typeof e.right<`u`&&(this.domNode.style.right=e.right+`px`),this._pointerMoveMonitor=this._register(new kr),this._register(gr(this.bgDomNode,Sr.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(gr(this.domNode,Sr.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new vr),this._pointerdownScheduleRepeatTimer=this._register(new Ln)}_arrowPointerDown(e){!e.target||!(e.target instanceof Element)||(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,rr(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}},Lr=class e{constructor(e,t,n,r,i,a,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,n|=0,r|=0,i|=0,a|=0,o|=0),this.rawScrollLeft=r,this.rawScrollTop=o,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),i<0&&(i=0),o+i>a&&(o=a-i),o<0&&(o=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=i,this.scrollHeight=a,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(t,n){return new e(this._forceIntegerValues,typeof t.width<`u`?t.width:this.width,typeof t.scrollWidth<`u`?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<`u`?t.height:this.height,typeof t.scrollHeight<`u`?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new e(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<`u`?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<`u`?t.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){let n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:i,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:s}}},Rr=class extends I{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new R),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Lr(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>`u`?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>`u`?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;r=t?new Hr(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let t=this._state.withScrollPosition(e);this._smoothScrolling=Hr.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},zr=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function Br(e,t){let n=t-e;return function(t){return e+n*Wr(t)}}function Vr(e,t,n){return function(r){return r2.5*n){let r,i;return e{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?` fade`:``)))}},Kr=140,qr=class extends Pr{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Gr(e.visibility,`visible scrollbar `+e.extraScrollbarClassName,`invisible scrollbar `+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new kr),this._shouldRender=!0,this.domNode=Or(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition(`absolute`),this._register(z(this.domNode.domNode,Sr.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let t=this._register(new Ir(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=Or(document.createElement(`div`)),this.slider.setClassName(`slider`),this.slider.setPosition(`absolute`),this.slider.setTop(e),this.slider.setLeft(t),typeof n==`number`&&this.slider.setWidth(n),typeof r==`number`&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain(`strict`),this.domNode.domNode.appendChild(this.slider.domNode),this._register(z(this.slider.domNode,Sr.POINTER_DOWN,e=>{e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);n<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX==`number`&&typeof e.offsetY==`number`)t=e.offsetX,n=e.offsetY;else{let r=xr(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName(`active`,!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let i=this._sliderOrthogonalPointerPosition(e),a=Math.abs(i-n);if(an&&a>Kr){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let o=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName(`active`,!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Jr=class e{constructor(e,t,n,r,i,a){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=i,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize===t?!1:(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){let t=Math.round(e);return this._scrollSize===t?!1:(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition===t?!1:(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,i){let a=Math.max(0,n-e),o=Math.max(0,a-2*t),s=r>0&&r>n;if(!s)return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*o/r))),l=(o-c)/(r-n),u=i*l;return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(c),computedSliderRatio:l,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,n=this._scrollPosition;return t0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),t){let r=Math.abs(e.deltaX),i=Math.abs(e.deltaY),a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),s=Math.max(Math.min(r,a),1),c=Math.max(Math.min(i,o),1),l=Math.max(r,a),u=Math.max(i,o);l%s===0&&u%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};ti.INSTANCE=new ti;var ni=ti,ri=class extends Pr{constructor(e,t,n){super(),this._onScroll=this._register(new R),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new R),this.onWillScroll=this._onWillScroll.event,this._options=ai(t),this._scrollable=n,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));let r={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Xr(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new Yr(this._scrollable,this._options,r)),this._domNode=document.createElement(`div`),this._domNode.className=`xterm-scrollable-element `+this._options.className,this._domNode.setAttribute(`role`,`presentation`),this._domNode.style.position=`relative`,this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=Or(document.createElement(`div`)),this._leftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Or(document.createElement(`div`)),this._topShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Or(document.createElement(`div`)),this._topLeftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new Ln),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=ct(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,on&&(this._options.className+=` mac`),this._domNode.className=`xterm-scrollable-element `+this._options.className}updateOptions(e){typeof e.handleMouseWheel<`u`&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<`u`&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<`u`&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<`u`&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<`u`&&(this._options.horizontal=e.horizontal),typeof e.vertical<`u`&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<`u`&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<`u`&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<`u`&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Nn(e))}_setListeningToMouseWheel(e){this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=ct(this._mouseWheelToDispose),e)&&this._mouseWheelToDispose.push(z(this._listenOnDomNode,Sr.MOUSE_WHEEL,e=>{this._onMouseWheel(new Nn(e))},{passive:!1}))}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=ni.INSTANCE;$r&&t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&i+r===0?i=r=0:Math.abs(r)>=Math.abs(i)?i=0:r=0),this._options.flipAxes&&([r,i]=[i,r]);let a=!on&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!i&&(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),s={};if(r){let e=Qr*r,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(s,t)}if(i){let e=Qr*i,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(s,t)}s=this._scrollable.validateScrollPosition(s),(o.scrollLeft!==s.scrollLeft||o.scrollTop!==s.scrollTop)&&($r&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(s):this._scrollable.setScrollPositionNow(s),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?` left`:``,i=t?` top`:``,a=n||t?` top-left-corner`:``;this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${i}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Zr)}},ii=class extends ri{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function ai(e){let t={lazyRender:typeof e.lazyRender<`u`?e.lazyRender:!1,className:typeof e.className<`u`?e.className:``,useShadows:typeof e.useShadows<`u`?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<`u`?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<`u`?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<`u`?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<`u`?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<`u`?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<`u`?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<`u`?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<`u`?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<`u`?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<`u`?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<`u`?e.listenOnDomNode:null,horizontal:typeof e.horizontal<`u`?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<`u`?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<`u`?e.horizontalHasArrows:!1,vertical:typeof e.vertical<`u`?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<`u`?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<`u`?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<`u`?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<`u`?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<`u`?e.verticalSliderSize:t.verticalScrollbarSize,on&&(t.className+=` mac`),t}var oi=class extends I{constructor(e,t,n,r,i,a,o,s){super(),this._bufferService=n,this._optionsService=o,this._renderService=s,this._onRequestScrollLines=this._register(new R),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new Rr({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:e=>_r(r.window,e)}));this._register(this._optionsService.onSpecificOptionChange(`smoothScrollDuration`,()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new ii(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange([`scrollSensitivity`,`fastScrollSensitivity`,`overviewRuler`],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(e=>{this._scrollableElement.updateOptions({handleMouseWheel:!(e&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(xt.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(F(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement(`style`),t.appendChild(this._styleElement),this._register(F(()=>this._styleElement.remove())),this._register(xt.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[`.xterm .xterm-scrollable-element > .scrollbar > .slider {`,` background: ${a.colors.scrollbarSliderBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider:hover {`,` background: ${a.colors.scrollbarSliderHoverBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider.active {`,` background: ${a.colors.scrollbarSliderActiveBackground.css};`,`}`].join(` +`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};oi=x([S(2,P),S(3,De),S(4,he),S(5,Me),S(6,be),S(7,ke)],oi);var si=class extends I{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(F(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:``:t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:``}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};si=x([S(1,P),S(2,De),S(3,Ce),S(4,ke)],si);var ci=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},li={full:0,left:0,center:0,right:0},ui={full:0,left:0,center:0,right:0},di={full:0,left:0,center:0,right:0},fi=class extends I{constructor(e,t,n,r,i,a,o,s){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=a,this._themeService=o,this._coreBrowserService=s,this._colorZoneStore=new ci,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(F(()=>this._canvas?.remove()));let c=this._canvas.getContext(`2d`);if(c)this._ctx=c;else throw Error(`Ctx cannot be null`);this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?`none`:`block`})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange(`overviewRuler`,()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);ui.full=this._canvas.width,ui.left=e,ui.center=t,ui.right=e,this._refreshDrawHeightConstants(),di.full=1,di.left=1,di.center=1+ui.left,di.right=1+ui.left+ui.center}_refreshDrawHeightConstants(){li.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);li.left=t,li.center=t,li.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*li.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*li.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*li.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*li.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(di[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-li[e.position||`full`]/2),ui[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+li[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};fi=x([S(2,P),S(3,Ce),S(4,ke),S(5,be),S(6,Me),S(7,De)],fi);var B;(e=>(e.NUL=`\0`,e.SOH=``,e.STX=``,e.ETX=``,e.EOT=``,e.ENQ=``,e.ACK=``,e.BEL=`\x07`,e.BS=`\b`,e.HT=` `,e.LF=` +`,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))(B||={});var pi;(e=>(e.PAD=`€`,e.HOP=``,e.BPH=`‚`,e.NBH=`ƒ`,e.IND=`„`,e.NEL=`…`,e.SSA=`†`,e.ESA=`‡`,e.HTS=`ˆ`,e.HTJ=`‰`,e.VTS=`Š`,e.PLD=`‹`,e.PLU=`Œ`,e.RI=``,e.SS2=`Ž`,e.SS3=``,e.DCS=``,e.PU1=`‘`,e.PU2=`’`,e.STS=`“`,e.CCH=`”`,e.MW=`•`,e.SPA=`–`,e.EPA=`—`,e.SOS=`˜`,e.SGCI=`™`,e.SCI=`š`,e.CSI=`›`,e.ST=`œ`,e.OSC=``,e.PM=`ž`,e.APC=`Ÿ`))(pi||={});var mi;(e=>e.ST=`${B.ESC}\\`)(mi||={});var hi=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.lengththis.updateCompositionElements(!0),0)}}};hi=x([S(2,P),S(3,be),S(4,ge),S(5,ke)],hi);var gi=0,_i=0,vi=0,V=0,yi={css:`#00000000`,rgba:0},H;(e=>{function t(e,t,n,r){return r===void 0?`#${Si(e)}${Si(t)}${Si(n)}`:`#${Si(e)}${Si(t)}${Si(n)}${Si(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(H||={});var U;(e=>{function t(e,t){if(V=(t.rgba&255)/255,V===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return gi=a+Math.round((n-a)*V),_i=o+Math.round((r-o)*V),vi=s+Math.round((i-s)*V),{css:H.toCss(gi,_i,vi),rgba:H.toRgba(gi,_i,vi)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=xi.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return H.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[gi,_i,vi]=xi.toChannels(t),{css:H.toCss(gi,_i,vi),rgba:t}}e.opaque=i;function a(e,t){return V=Math.round(t*255),[gi,_i,vi]=xi.toChannels(e.rgba),{css:H.toCss(gi,_i,vi,V),rgba:H.toRgba(gi,_i,vi,V)}}e.opacity=a;function o(e,t){return V=e.rgba&255,a(e,V*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(U||={});var W;(e=>{let t,n;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}catch{}function r(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return gi=parseInt(e.slice(1,2).repeat(2),16),_i=parseInt(e.slice(2,3).repeat(2),16),vi=parseInt(e.slice(3,4).repeat(2),16),H.toColor(gi,_i,vi);case 5:return gi=parseInt(e.slice(1,2).repeat(2),16),_i=parseInt(e.slice(2,3).repeat(2),16),vi=parseInt(e.slice(3,4).repeat(2),16),V=parseInt(e.slice(4,5).repeat(2),16),H.toColor(gi,_i,vi,V);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let r=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return gi=parseInt(r[1]),_i=parseInt(r[2]),vi=parseInt(r[3]),V=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),H.toColor(gi,_i,vi,V);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[gi,_i,vi,V]=t.getImageData(0,0,1,1).data,V!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:H.toRgba(gi,_i,vi,V),css:e}}e.toColor=r})(W||={});var bi;(e=>{function t(e){return n(e>>16&255,e>>8&255,e&255)}e.relativeLuminance=t;function n(e,t,n){let r=e/255,i=t/255,a=n/255,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return o*.2126+s*.7152+c*.0722}e.relativeLuminance2=n})(bi||={});var xi;(e=>{function t(e,t){if(V=(t&255)/255,V===1)return t;let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=e>>24&255,o=e>>16&255,s=e>>8&255;return gi=a+Math.round((n-a)*V),_i=o+Math.round((r-o)*V),vi=s+Math.round((i-s)*V),H.toRgba(gi,_i,vi)}e.blend=t;function n(e,t,n){let a=bi.relativeLuminance(e>>8),o=bi.relativeLuminance(t>>8);if(Ci(a,o)>8));if(sCi(a,bi.relativeLuminance(r>>8))?o:r}return o}let s=i(e,t,n),c=Ci(a,bi.relativeLuminance(s>>8));if(cCi(a,bi.relativeLuminance(i>>8))?s:i}return s}}e.ensureContrastRatio=n;function r(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=Ci(bi.relativeLuminance2(o,s,c),bi.relativeLuminance2(r,i,a));for(;l0||s>0||c>0);)o-=Math.max(0,Math.ceil(o*.1)),s-=Math.max(0,Math.ceil(s*.1)),c-=Math.max(0,Math.ceil(c*.1)),l=Ci(bi.relativeLuminance2(o,s,c),bi.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.reduceLuminance=r;function i(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=Ci(bi.relativeLuminance2(o,s,c),bi.relativeLuminance2(r,i,a));for(;l>>0}e.increaseLuminance=i;function a(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}e.toChannels=a})(xi||={});function Si(e){let t=e.toString(16);return t.length<2?`0`+t:t}function Ci(e,t){return e1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t=w,re=D,k=this._workCell;if(f.length>0&&D===f[0][0]&&O){let r=f.shift(),i=this._isCellInSelection(r[0],t);for(v=r[0]+1;v=r[1],O?(ne=!0,k=new wi(this._workCell,e.translateToString(!0,r[0],r[1]),r[1]-r[0]),re=r[1]-1,m=k.getWidth()):w=r[1]}let A=this._isCellInSelection(D,t),j=n&&D===a,ie=E&&D>=l&&D<=u,ae=!1;this._decorationService.forEachDecorationAtCell(D,t,void 0,e=>{ae=!0});let oe=k.getChars()||se;if(oe===` `&&(k.isUnderline()||k.isOverline())&&(oe=`\xA0`),C=m*s-c.get(oe,k.isBold(),k.isItalic()),!h)h=this._document.createElement(`span`);else if(g&&(A&&te||!A&&!te&&k.bg===y)&&(A&&te&&p.selectionForeground||k.fg===b)&&k.extended.ext===x&&ie===S&&C===ee&&!j&&!ne&&!ae&&O){k.isInvisible()?_+=se:_+=oe,g++;continue}else g&&(h.textContent=_),h=this._document.createElement(`span`),g=0,_=``;if(y=k.bg,b=k.fg,x=k.extended.ext,S=ie,ee=C,te=A,ne&&a>=D&&a<=re&&(a=D),!this._coreService.isCursorHidden&&j&&this._coreService.isCursorInitialized){if(T.push(`xterm-cursor`),this._coreBrowserService.isFocused)o&&T.push(`xterm-cursor-blink`),T.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:T.push(`xterm-cursor-outline`);break;case`block`:T.push(`xterm-cursor-block`);break;case`bar`:T.push(`xterm-cursor-bar`);break;case`underline`:T.push(`xterm-cursor-underline`);break;default:break}}if(k.isBold()&&T.push(`xterm-bold`),k.isItalic()&&T.push(`xterm-italic`),k.isDim()&&T.push(`xterm-dim`),_=k.isInvisible()?se:k.getChars()||se,k.isUnderline()&&(T.push(`xterm-underline-${k.extended.underlineStyle}`),_===` `&&(_=`\xA0`),!k.isUnderlineColorDefault()))if(k.isUnderlineColorRGB())h.style.textDecorationColor=`rgb(${ce.toColorRGB(k.getUnderlineColor()).join(`,`)})`;else{let e=k.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&k.isBold()&&e<8&&(e+=8),h.style.textDecorationColor=p.ansi[e].css}k.isOverline()&&(T.push(`xterm-overline`),_===` `&&(_=`\xA0`)),k.isStrikethrough()&&T.push(`xterm-strikethrough`),ie&&(h.style.textDecoration=`underline`);let le=k.getFgColor(),M=k.getFgColorMode(),ue=k.getBgColor(),de=k.getBgColorMode(),fe=!!k.isInverse();if(fe){let e=le;le=ue,ue=e;let t=M;M=de,de=t}let pe,N,me=!1;this._decorationService.forEachDecorationAtCell(D,t,void 0,e=>{e.options.layer!==`top`&&me||(e.backgroundColorRGB&&(de=50331648,ue=e.backgroundColorRGB.rgba>>8&16777215,pe=e.backgroundColorRGB),e.foregroundColorRGB&&(M=50331648,le=e.foregroundColorRGB.rgba>>8&16777215,N=e.foregroundColorRGB),me=e.options.layer===`top`)}),!me&&A&&(pe=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,ue=pe.rgba>>8&16777215,de=50331648,me=!0,p.selectionForeground&&(M=50331648,le=p.selectionForeground.rgba>>8&16777215,N=p.selectionForeground)),me&&T.push(`xterm-decoration-top`);let P;switch(de){case 16777216:case 33554432:P=p.ansi[ue],T.push(`xterm-bg-${ue}`);break;case 50331648:P=H.toColor(ue>>16,ue>>8&255,ue&255),this._addStyle(h,`background-color:#${Mi((ue>>>0).toString(16),`0`,6)}`);break;default:fe?(P=p.foreground,T.push(`xterm-bg-257`)):P=p.background}switch(pe||k.isDim()&&(pe=U.multiplyOpacity(P,.5)),M){case 16777216:case 33554432:k.isBold()&&le<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(le+=8),this._applyMinimumContrast(h,P,p.ansi[le],k,pe,void 0)||T.push(`xterm-fg-${le}`);break;case 50331648:let e=H.toColor(le>>16&255,le>>8&255,le&255);this._applyMinimumContrast(h,P,e,k,pe,N)||this._addStyle(h,`color:#${Mi(le.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(h,P,p.foreground,k,pe,N)||fe&&T.push(`xterm-fg-257`)}T.length&&=(h.className=T.join(` `),0),!j&&!ne&&!ae&&O?g++:h.textContent=_,C!==this.defaultSpacing&&(h.style.letterSpacing=`${C}px`),d.push(h),D=re}return h&&g&&(h.textContent=_),d}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||Oi(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(!i&&!a&&(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=U.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return s?(this._addStyle(e,`color:${s.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t=n[0]&&e=n[0]}};ji=x([S(1,je),S(2,be),S(3,De),S(4,ge),S(5,Ce),S(6,Me)],ji);function Mi(e,t,n){for(;e.length0&&(this._flat[r]=t),t}let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),a>0&&this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},Pi=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);if(s>=e.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n=this.startCol&&t=this.startCol):!1}};function Fi(){return new Pi}var Ii=`xterm-dom-renderer-owner-`,Li=`xterm-rows`,Ri=`xterm-fg-`,zi=`xterm-bg-`,Bi=`xterm-focus`,Vi=`xterm-selection`,Hi=1,Ui=class extends I{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=a,this._linkifier2=o,this._charSizeService=c,this._optionsService=l,this._bufferService=u,this._coreService=d,this._coreBrowserService=f,this._themeService=p,this._terminalClass=Hi++,this._rowElements=[],this._selectionRenderModel=Fi(),this.onRequestRedraw=this._register(new R).event,this._rowContainer=this._document.createElement(`div`),this._rowContainer.classList.add(Li),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement(`div`),this._selectionContainer.classList.add(Vi),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=ki(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(e=>this._injectCss(e))),this._injectCss(this._themeService.colors),this._rowFactory=s.createInstance(ji,document),this._element.classList.add(Ii+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(e=>this._handleLinkHover(e))),this._register(this._linkifier2.onHideLinkUnderline(e=>this._handleLinkLeave(e))),this._register(F(()=>{this._element.classList.remove(Ii+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new Ni(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${Li} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${Li} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${Li} .xterm-dim { color: ${U.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${Li}.${Bi} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${Li}.${Bi} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${Li}.${Bi} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${Li} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${Vi} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${Vi} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${Vi} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${Ri}${n} { color: ${r.css}; }${this._terminalSelector} .${Ri}${n}.xterm-dim { color: ${U.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${zi}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${Ri}257 { color: ${U.opaque(e.background).css}; }${this._terminalSelector} .${Ri}257.xterm-dim { color: ${U.multiplyOpacity(U.opaque(e.background),.5).css}; }${this._terminalSelector} .${zi}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=this._document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Bi),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Bi),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,s=this._document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=this._document.createElement(`div`),a=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return a+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-a),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${a}px`,i.style.width=`${o}px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Ii}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};Ui=x([S(7,ve),S(8,Ee),S(9,be),S(10,P),S(11,ge),S(12,De),S(13,Me)],Ui);var Wi=class extends I{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new R),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new qi(this._optionsService))}catch{this._measureStrategy=this._register(new Ki(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Wi=x([S(2,be)],Wi);var Gi=class extends I{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},Ki=class extends Gi{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement(`span`),this._measureElement.classList.add(`xterm-char-measure-element`),this._measureElement.textContent=`W`.repeat(32),this._measureElement.setAttribute(`aria-hidden`,`true`),this._measureElement.style.whiteSpace=`pre`,this._measureElement.style.fontKerning=`none`,this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},qi=class extends Gi{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext(`2d`);let t=this._ctx.measureText(`W`);if(!(`width`in t&&`fontBoundingBoxAscent`in t&&`fontBoundingBoxDescent`in t))throw Error(`Required font metrics not supported`)}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText(`W`);return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},Ji=class extends I{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new Yi(this._window)),this._onDprChange=this._register(new R),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new R),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this._register(xt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(z(this._textarea,`focus`,()=>this._isFocused=!0)),this._register(z(this._textarea,`blur`,()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},Yi=class extends I{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new ft),this._onDprChange=this._register(new R),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(F(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=z(this._parentWindow,`resize`,()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},Xi=class extends I{constructor(){super(),this.linkProviders=[],this._register(F(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function Zi(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}function Qi(e,t,n,r,i,a,o,s,c){if(!a)return;let l=Zi(e,t,n);if(l)return l[0]=Math.ceil((l[0]+(c?o/2:0))/o),l[1]=Math.ceil(l[1]/s),l[0]=Math.min(Math.max(l[0],1),r+(c?1:0)),l[1]=Math.min(Math.max(l[1],1),i),l}var $i=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return Qi(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=Zi(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};$i=x([S(0,ke),S(1,Ee)],$i);var ea=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},ta={};b(ta,{getSafariVersion:()=>ca,isChromeOS:()=>ma,isFirefox:()=>aa,isIpad:()=>ua,isIphone:()=>da,isLegacyEdge:()=>oa,isLinux:()=>pa,isMac:()=>la,isNode:()=>na,isSafari:()=>sa,isWindows:()=>fa});var na=typeof process<`u`&&`title`in process,ra=na?`node`:navigator.userAgent,ia=na?`node`:navigator.platform,aa=ra.includes(`Firefox`),oa=ra.includes(`Edge`),sa=/^((?!chrome|android).)*safari/i.test(ra);function ca(){if(!sa)return 0;let e=ra.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var la=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(ia),ua=ia===`iPad`,da=ia===`iPhone`,fa=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(ia),pa=ia.indexOf(`Linux`)>=0,ma=/\bCrOS\b/.test(ra),ha=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._ii){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},ga=class extends ha{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},_a=class extends ha{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},va=!na&&`requestIdleCallback`in window?_a:ga,ya=class{constructor(){this._queue=new va}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},ba=class extends I{constructor(e,t,n,r,i,a,o,s,c){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=i,this._coreBrowserService=s,this._renderer=this._register(new ft),this._pausedResizeTask=new ya,this._observerDisposable=this._register(new ft),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new R),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new R),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new R),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new R),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new ea((e,t)=>this._renderRows(e,t),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new xa(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(F(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`,`rescaleOverlappingGlyphs`],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(c.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(e=>this._registerIntersectionObserver(e,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if(`IntersectionObserver`in e){let n=new e.IntersectionObserver(e=>this._handleIntersectionChange(e[e.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=F(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};ba=x([S(2,be),S(3,Ee),S(4,ge),S(5,Ce),S(6,P),S(7,De),S(8,Me)],ba);var xa=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function Sa(e,t,n,r){let i=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return Ta(i,a,e,t,n,r)+Ea(a,t,n,r)+Da(i,a,e,t,n,r);let o;if(a===t)return o=i>e?`D`:`C`,Pa(Math.abs(i-e),Na(o,r));o=a>t?`D`:`C`;let s=Math.abs(a-t);return Pa(wa(a>t?e:i,n)+(s-1)*n.cols+1+Ca(a>t?i:e,n),Na(o,r))}function Ca(e,t){return e-1}function wa(e,t){return t.cols-e}function Ta(e,t,n,r,i,a){return Ea(t,r,i,a).length===0?``:Pa(Ma(e,t,e,t-ka(t,i),!1,i).length,Na(`D`,a))}function Ea(e,t,n,r){let i=e-ka(e,n),a=t-ka(t,n);return Pa(Math.abs(i-a)-Oa(e,t,n),Na(ja(e,t),r))}function Da(e,t,n,r,i,a){let o;o=Ea(t,r,i,a).length>0?r-ka(r,i):t;let s=r,c=Aa(e,t,n,r,i,a);return Pa(Ma(e,o,n,s,c===`C`,i).length,Na(c,a))}function Oa(e,t,n){let r=0,i=e-ka(e,n),a=t-ka(t,n);for(let o=0;o=0&&e0?r-ka(r,i):t,e=n&&ot?`A`:`B`}function Ma(e,t,n,r,i,a){let o=e,s=t,c=``;for(;(o!==n||s!==r)&&s>=0&&sa.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function Na(e,t){let n=t?`O`:`[`;return B.ESC+n+e}function Pa(e,t){e=Math.floor(e);let n=``;for(let r=0;rthis._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function Ia(e,t){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var La=50,Ra=15,za=50,Ba=500,Va=RegExp(`\xA0`,`g`),Ha=class extends I{constructor(e,t,n,r,i,a,o,s,c){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=s,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new M,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new R),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new R),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new R),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new R),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(e=>this._handleTrim(e)),this._register(this._bufferService.buffers.onBufferActivate(e=>this._handleBufferActivate(e))),this.enable(),this._model=new Fa(this._bufferService),this._activeSelectionMode=0,this._register(F(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(e=>{e.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]e.replace(Va,` `)).join(fa?`\r +`:` +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),pa&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]=t[0]&&e[0]=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=Ia(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=Zi(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-La),La),t/=La,t/Math.abs(t)+Math.round(t*(Ra-1)))}shouldForceSelection(e){return la?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),za)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(la&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&tthis._handleTrim(e))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,a=i.lines.get(e[1]);if(!a)return;let o=i.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(a,e[0]),c=s,l=e[0]-s,u=0,d=0,f=0,p=0;if(o.charAt(s)===` `){for(;s>0&&o.charAt(s-1)===` `;)s--;for(;c1&&(p+=r-1,c+=r-1);t>0&&s>0&&!this._isCharWordSeparator(a.loadCell(t-1,this._workCell));){a.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,t--):e>1&&(f+=e-1,s-=e-1),s--,t--}for(;n1&&(p+=e-1,c+=e-1),c++,n++}}c++;let m=s+l-u+f,h=Math.min(this._bufferService.cols,c-s+u+d-f-p);if(!(!t&&o.slice(s,c).trim()===``)){if(n&&m===0&&a.getCodePoint(0)!==32){let t=i.lines.get(e[1]-1);if(t&&a.isWrapped&&t.getCodePoint(this._bufferService.cols-1)!==32){let t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;m-=e,h+=e}}}if(r&&m+h===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let t=i.lines.get(e[1]+1);if(t?.isWrapped&&t.getCodePoint(0)!==32){let t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(h+=t.length)}}return{start:m,length:h}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=Ia(n,this._bufferService.cols)}};Ha=x([S(3,P),S(4,ge),S(5,Oe),S(6,be),S(7,ke),S(8,De)],Ha);var Ua=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},Wa=class{constructor(){this._color=new Ua,this._css=new Ua}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},Ga=Object.freeze((()=>{let e=[W.toColor(`#2e3436`),W.toColor(`#cc0000`),W.toColor(`#4e9a06`),W.toColor(`#c4a000`),W.toColor(`#3465a4`),W.toColor(`#75507b`),W.toColor(`#06989a`),W.toColor(`#d3d7cf`),W.toColor(`#555753`),W.toColor(`#ef2929`),W.toColor(`#8ae234`),W.toColor(`#fce94f`),W.toColor(`#729fcf`),W.toColor(`#ad7fa8`),W.toColor(`#34e2e2`),W.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:H.toCss(r,i,a),rgba:H.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+t*10;e.push({css:H.toCss(n,n,n),rgba:H.toRgba(n,n,n)})}return e})()),Ka=W.toColor(`#ffffff`),qa=W.toColor(`#000000`),Ja=W.toColor(`#ffffff`),Ya=qa,Xa={css:`rgba(255, 255, 255, 0.3)`,rgba:4294967117},Za=Ka,Qa=class extends I{constructor(e){super(),this._optionsService=e,this._contrastCache=new Wa,this._halfContrastCache=new Wa,this._onChangeColors=this._register(new R),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:Ka,background:qa,cursor:Ja,cursorAccent:Ya,selectionForeground:void 0,selectionBackgroundTransparent:Xa,selectionBackgroundOpaque:U.blend(qa,Xa),selectionInactiveBackgroundTransparent:Xa,selectionInactiveBackgroundOpaque:U.blend(qa,Xa),scrollbarSliderBackground:U.opacity(Ka,.2),scrollbarSliderHoverBackground:U.opacity(Ka,.4),scrollbarSliderActiveBackground:U.opacity(Ka,.5),overviewRulerBorder:Ka,ansi:Ga.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange(`minimumContrastRatio`,()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange(`theme`,()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=G(e.foreground,Ka),t.background=G(e.background,qa),t.cursor=U.blend(t.background,G(e.cursor,Ja)),t.cursorAccent=U.blend(t.background,G(e.cursorAccent,Ya)),t.selectionBackgroundTransparent=G(e.selectionBackground,Xa),t.selectionBackgroundOpaque=U.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=G(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=U.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?G(e.selectionForeground,yi):void 0,t.selectionForeground===yi&&(t.selectionForeground=void 0),U.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=U.opacity(t.selectionBackgroundTransparent,.3)),U.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=U.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=G(e.scrollbarSliderBackground,U.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=G(e.scrollbarSliderHoverBackground,U.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=G(e.scrollbarSliderActiveBackground,U.opacity(t.foreground,.5)),t.overviewRulerBorder=G(e.overviewRulerBorder,Za),t.ansi=Ga.slice(),t.ansi[0]=G(e.black,Ga[0]),t.ansi[1]=G(e.red,Ga[1]),t.ansi[2]=G(e.green,Ga[2]),t.ansi[3]=G(e.yellow,Ga[3]),t.ansi[4]=G(e.blue,Ga[4]),t.ansi[5]=G(e.magenta,Ga[5]),t.ansi[6]=G(e.cyan,Ga[6]),t.ansi[7]=G(e.white,Ga[7]),t.ansi[8]=G(e.brightBlack,Ga[8]),t.ansi[9]=G(e.brightRed,Ga[9]),t.ansi[10]=G(e.brightGreen,Ga[10]),t.ansi[11]=G(e.brightYellow,Ga[11]),t.ansi[12]=G(e.brightBlue,Ga[12]),t.ansi[13]=G(e.brightMagenta,Ga[13]),t.ansi[14]=G(e.brightCyan,Ga[14]),t.ansi[15]=G(e.brightWhite,Ga[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;re.index-t.index),r=[];for(let t of n){let n=this._services.get(t.id);if(!n)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id._id}.`);r.push(n)}let i=n.length>0?n[0].index:t.length;if(t.length!==i)throw Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},to={trace:0,debug:1,info:2,warn:3,error:4,off:5},no=`xterm.js: `,ro=class extends I{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),io=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=to[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;tthis._length)for(let t=this._length;t=e;t--)this._array[this._getCyclicIndex(t+n.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;tthis._maxLength){let e=this._length+n.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw Error(`start argument out of range`);if(e+n<0)throw Error(`Cannot shift elements in list beyond index 0`);if(n>0){for(let r=t-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r>22,t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,t){this._data[e*K+1]=t[0],t[1].length>1?(this._combined[e]=t[1],this._data[e*K+0]=e|2097152|t[2]<<22):this._data[e*K+0]=t[1].charCodeAt(0)|t[2]<<22}getWidth(e){return this._data[e*K+0]>>22}hasWidth(e){return this._data[e*K+0]&12582912}getFg(e){return this._data[e*K+1]}getBg(e){return this._data[e*K+2]}hasContent(e){return this._data[e*K+0]&4194303}getCodePoint(e){let t=this._data[e*K+0];return t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):t&2097151}isCombined(e){return this._data[e*K+0]&2097152}getString(e){let t=this._data[e*K+0];return t&2097152?this._combined[e]:t&2097151?A(t&2097151):``}isProtected(e){return this._data[e*K+2]&536870912}loadCell(e,t){return oo=e*K,t.content=this._data[oo+0],t.fg=this._data[oo+1],t.bg=this._data[oo+2],t.content&2097152&&(t.combinedData=this._combined[e]),t.bg&268435456&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){t.content&2097152&&(this._combined[e]=t.combinedData),t.bg&268435456&&(this._extendedAttrs[e]=t.extended),this._data[e*K+0]=t.content,this._data[e*K+1]=t.fg,this._data[e*K+2]=t.bg}setCellFromCodepoint(e,t,n,r){r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*K+0]=t|n<<22,this._data[e*K+1]=r.fg,this._data[e*K+2]=r.bg}addCodepointToCell(e,t,n){let r=this._data[e*K+0];r&2097152?this._combined[e]+=A(t):r&2097151?(this._combined[e]=A(r&2097151)+A(t),r&=-2097152,r|=2097152):r=t|1<<22,n&&(r&=-12582913,r|=n<<22),this._data[e*K+0]=r}insertCells(e,t,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(let r=0;rthis.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let e=new Uint32Array(n);e.set(this._data),this._data=e}for(let n=this.length;n=e&&delete this._combined[r]}let r=Object.keys(this._extendedAttrs);for(let t=0;t=e&&delete this._extendedAttrs[n]}}return this.length=e,n*4*so=0;--e)if(this._data[e*K+0]&4194303)return e+(this._data[e*K+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*K+0]&4194303||this._data[e*K+2]&50331648)return e+(this._data[e*K+0]>>22);return 0}copyCellsFrom(e,t,n,r,i){let a=e._data;if(i)for(let i=r-1;i>=0;i--){for(let e=0;e=t&&(this._combined[i-t+n]=e._combined[i])}}translateToString(e,t,n,r){t??=0,n??=this.length,e&&(n=Math.min(n,this.getTrimmedLength())),r&&(r.length=0);let i=``;for(;t>22||1}return r&&r.push(t),i}};function lo(e,t,n,r,i,a){let o=[];for(let s=0;s=s&&r0&&(e>d||u[e].getTrimmedLength()===0);e--)h++;h>0&&(o.push(s+u.length-h),o.push(h)),s+=u.length-1}return o}function uo(e,t){let n=[],r=0,i=t[r],a=0;for(let o=0;omo(e,r,t)).reduce((e,t)=>e+t),a=0,o=0,s=0;for(;sc&&(a-=c,o++);let l=e[o].getWidth(a-1)===2;l&&a--;let u=l?n-1:n;r.push(u),s+=u}return r}function mo(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}var ho=class e{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=e._nextId++,this._onDispose=this.register(new R),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),ct(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};ho._nextId=1;var go=ho,_o={},vo=_o.B;_o[0]={"`":`◆`,a:`▒`,b:`␉`,c:`␌`,d:`␍`,e:`␊`,f:`°`,g:`±`,h:`␤`,i:`␋`,j:`┘`,k:`┐`,l:`┌`,m:`└`,n:`┼`,o:`⎺`,p:`⎻`,q:`─`,r:`⎼`,s:`⎽`,t:`├`,u:`┤`,v:`┴`,w:`┬`,x:`│`,y:`≤`,z:`≥`,"{":`π`,"|":`≠`,"}":`£`,"~":`·`},_o.A={"#":`£`},_o.B=void 0,_o[4]={"#":`£`,"@":`¾`,"[":`ij`,"\\":`½`,"]":`|`,"{":`¨`,"|":`f`,"}":`¼`,"~":`´`},_o.C=_o[5]={"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},_o.R={"#":`£`,"@":`à`,"[":`°`,"\\":`ç`,"]":`§`,"{":`é`,"|":`ù`,"}":`è`,"~":`¨`},_o.Q={"@":`à`,"[":`â`,"\\":`ç`,"]":`ê`,"^":`î`,"`":`ô`,"{":`é`,"|":`ù`,"}":`è`,"~":`û`},_o.K={"@":`§`,"[":`Ä`,"\\":`Ö`,"]":`Ü`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`ß`},_o.Y={"#":`£`,"@":`§`,"[":`°`,"\\":`ç`,"]":`é`,"`":`ù`,"{":`à`,"|":`ò`,"}":`è`,"~":`ì`},_o.E=_o[6]={"@":`Ä`,"[":`Æ`,"\\":`Ø`,"]":`Å`,"^":`Ü`,"`":`ä`,"{":`æ`,"|":`ø`,"}":`å`,"~":`ü`},_o.Z={"#":`£`,"@":`§`,"[":`¡`,"\\":`Ñ`,"]":`¿`,"{":`°`,"|":`ñ`,"}":`ç`},_o.H=_o[7]={"@":`É`,"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},_o[`=`]={"#":`ù`,"@":`à`,"[":`é`,"\\":`ç`,"]":`ê`,"^":`î`,_:`è`,"`":`ô`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`û`};var yo=4294967295,bo=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=q.clone(),this.savedCharset=vo,this.markers=[],this._nullCell=M.fromCharData([0,oe,1,0]),this._whitespaceCell=M.fromCharData([0,se,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new va,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new ao(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new le),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new le),this._whitespaceCell}getBlankLine(e,t){return new co(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&eyo?yo:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=q);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new ao(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(q),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new co(e,n)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;t.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend===`conpty`&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=lo(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(q),n);if(r.length>0){let n=uo(this.lines,r);fo(this.lines,n.layout),this._reflowLargerAdjustViewport(e,t,n.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(q),i=n;for(;i-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;o--){let s=this.lines.get(o);if(!s||!s.isWrapped&&s.getTrimmedLength()<=e)continue;let c=[s];for(;s.isWrapped&&o>0;)s=this.lines.get(--o),c.unshift(s);if(!n){let e=this.ybase+this.y;if(e>=o&&e0&&(i.push({start:o+c.length+a,newLines:p}),a+=p.length),c.push(...p);let m=u.length-1,h=u[m];h===0&&(m--,h=u[m]);let g=c.length-d-1,_=l;for(;g>=0;){let e=Math.min(_,h);if(c[m]===void 0)break;c[m].copyCellsFrom(c[g],_-e,h-e,e,!0),h-=e,h===0&&(m--,h=u[m]),_-=e,_===0&&(g--,_=mo(c,Math.max(g,0),this._cols))}for(let t=0;t0;)this.ybase===0?this.y0){let e=[],t=[];for(let e=0;e=0;l--)if(s&&s.start>r+c){for(let e=s.newLines.length-1;e>=0;e--)this.lines.set(l--,s.newLines[e]);l++,e.push({index:r+1,amount:s.newLines.length}),c+=s.newLines.length,s=i[++o]}else this.lines.set(l,t[r--]);let l=0;for(let t=e.length-1;t>=0;t--)e[t].index+=l,this.lines.onInsertEmitter.fire(e[t]),l+=e[t].amount;let u=Math.max(0,n+a-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,t,n=0,r){let i=this.lines.get(e);return i?i.translateToString(t,n,r):``}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e??=this.x;!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t{t.line-=e,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(e=>{t.line>=e.index&&(t.line+=e.amount)})),t.register(this.lines.onDelete(e=>{t.line>=e.index&&t.linee.index&&(t.line-=e.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},xo=class extends I{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new R),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange(`scrollback`,()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange(`tabStopWidth`,()=>this.setupTabStops()))}reset(){this._normal=new bo(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new bo(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},So=2,Co=1,wo=class extends I{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new R),this.onResize=this._onResize.event,this._onScroll=this._register(new R),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,So),this.rows=Math.max(e.rawOptions.rows||0,Co),this.buffers=this._register(new xo(e,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let e=n.lines.isFull;a===n.lines.length-1?e?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),e?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let e=a-i+1;n.lines.shiftElements(i+1,e-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};wo=x([S(0,be)],wo);var To={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:la,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRuler:{}},Eo=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`],Do=class extends I{constructor(e){super(),this._onOptionChange=this._register(new R),this.onOptionChange=this._onOptionChange.event;let t={...To};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(F(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=e=>{if(!(e in To))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},t=(e,t)=>{if(!(e in To))throw Error(`No option with key "${e}"`);t=this._sanitizeAndValidateOption(e,t),this.rawOptions[e]!==t&&(this.rawOptions[e]=t,this._onOptionChange.fire(e))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case`cursorStyle`:if(t||=To[e],!Oo(t))throw Error(`"${t}" is not a valid value for ${e}`);break;case`wordSeparator`:t||=To[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof t==`number`&&1<=t&&t<=1e3)break;t=Eo.includes(t)?t:To[e];break;case`cursorWidth`:t=Math.floor(t);case`lineHeight`:case`tabStopWidth`:if(t<1)throw Error(`${e} cannot be less than 1, value: ${t}`);break;case`minimumContrastRatio`:t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case`scrollback`:if(t=Math.min(t,4294967295),t<0)throw Error(`${e} cannot be less than 0, value: ${t}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(t<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case`rows`:case`cols`:if(!t&&t!==0)throw Error(`${e} must be numeric, value: ${t}`);break;case`windowsPty`:t??={};break}return t}};function Oo(e){return e===`block`||e===`underline`||e===`bar`}function ko(e,t=5){if(typeof e!=`object`)return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&ko(e[r],t-1);return n}var Ao=Object.freeze({insertMode:!1}),jo=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Mo=class extends I{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new R),this.onData=this._onData.event,this._onUserInput=this._register(new R),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new R),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new R),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=ko(Ao),this.decPrivateModes=ko(jo)}reset(){this.modes=ko(Ao),this.decPrivateModes=ko(jo)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace(`sending data (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace(`sending binary (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}};Mo=x([S(0,P),S(1,ye),S(2,be)],Mo);var No={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Po(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var Fo=String.fromCharCode,Io={DEFAULT:e=>{let t=[Po(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`\x1B[M${Fo(t[0])}${Fo(t[1])}${Fo(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${Po(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${Po(e,!0)};${e.x};${e.y}${t}`}},Lo=class extends I{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new R),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(No))this.addProtocol(e,No[e]);for(let e of Object.keys(Io))this.addEncoding(e,Io[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol=`NONE`,this.activeEncoding=`DEFAULT`,this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=r+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding===`SGR_PIXELS`))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding===`DEFAULT`?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Lo=x([S(0,P),S(1,ge),S(2,be)],Lo);var Ro=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],zo=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],Bo;function Vo(e,t){let n=0,r=t.length-1,i;if(et[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=Uo.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return Uo.createPropertyValue(0,n,r)}},Uo=class e{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new R,this.onChange=this._onChange.event;let e=new Ho;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!=0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(e&16777215)<<3|(t&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(t){let n=0,r=0,i=t.length;for(let a=0;a=i)return n+this.wcwidth(o);let e=t.charCodeAt(a);56320<=e&&e<=57343?o=(o-55296)*1024+e-56320+65536:n+=this.wcwidth(e)}let s=this.charProperties(o,r),c=e.extractWidth(s);e.extractShouldJoin(s)&&(c-=e.extractWidth(r)),n+=c,r=s}return n}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},Wo=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function Go(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var Ko=2147483647,qo=256,Jo=class e{constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>qo)throw Error(`maxSubParamsLength must not be greater than 256`);this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new e;if(!t.length)return n;for(let e=Array.isArray(t[0])?1:0;e>8,r=this._subParamsIdx[t]&255;r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>Ko?Ko:e}addSubParam(e){if(this._digitIsSub=!0,this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>Ko?Ko:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;return n-t>0?this._subParams.subarray(t,n):null}getSubParamsAll(){let e={};for(let t=0;t>8,r=this._subParamsIdx[t]&255;r-n>0&&(e[t]=this._subParams.slice(n,r))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,r=n[t-1];n[t-1]=~r?Math.min(r*10+e,Ko):e}},Yo=[],Xo=class{constructor(){this._state=0,this._active=Yo,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Yo}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Yo,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Yo,!this._active.length)this._handlerFb(this._id,`START`);else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,`PUT`,j(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,`END`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=Yo,this._id=-1,this._state=0}}},Zo=class{constructor(e){this._handler=e,this._data=``,this._hitLimit=!1}start(){this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=j(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(e=>(this._data=``,this._hitLimit=!1,e));return this._data=``,this._hitLimit=!1,t}},Qo=[],$o=class{constructor(){this._handlers=Object.create(null),this._active=Qo,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Qo}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Qo,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Qo,!this._active.length)this._handlerFb(this._ident,`HOOK`,t);else for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,`PUT`,j(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,`UNHOOK`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=Qo,this._ident=0}},es=new Jo;es.addParam(0);var ts=class{constructor(e){this._handler=e,this._data=``,this._params=es,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():es,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=j(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(e=>(this._params=es,this._data=``,this._hitLimit=!1,e));return this._params=es,this._data=``,this._hitLimit=!1,t}},ns=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;it),n=(e,n)=>t.slice(e,n),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let a=n(0,14),o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),a)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(rs,0,2,0),e.add(rs,8,5,8),e.add(rs,6,0,6),e.add(rs,11,0,11),e.add(rs,13,13,13),e}(),as=class extends I{constructor(e=is){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new Jo,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(F(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new Xo),this._dcsParser=this._register(new $o),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:`\\`},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw Error(`only one byte as prefix supported`);if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw Error(`prefix must be in range 0x3c .. 0x3f`)}if(e.intermediates){if(e.intermediates.length>2)throw Error(`only two bytes as intermediates are supported`);for(let t=0;tr||r>47)throw Error(`intermediate must be in range 0x20 .. 0x2f`);n<<=8,n|=r}}if(e.final.length!==1)throw Error(`final must be a single byte`);let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join(``)}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r=0,i=0,a=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error(`improper continuation due to previous async handler, giving up parsing`);let t=this._parseStack.handlers,i=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](this._params),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 4:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],o=this._oscParser.end(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let n=a;n>4){case 2:for(let i=n+1;;++i){if(i>=t||(r=e[i])<32||r>126&&r=t||(r=e[i])<32||r>126&&r=t||(r=e[i])<32||r>126&&r=t||(r=e[i])<32||r>126&&r=0&&(o=a[s](this._params),o!==!0);s--)if(o instanceof Promise)return this._preserveStack(3,a,s,i,n),o;s<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++n47&&r<60);n--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let c=this._escHandlers[this._collect<<8|r],l=c?c.length-1:-1;for(;l>=0&&(o=c[l](),o!==!0);l--)if(o instanceof Promise)return this._preserveStack(4,c,l,i,n),o;l<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let i=n+1;;++i)if(i>=t||(r=e[i])===24||r===26||r===27||r>127&&r=t||(r=e[i])<32||r>127&&r>4:i>>8}return n}}function ls(e,t){let n=e.toString(16),r=n.length<2?`0`+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function us(e,t=16){let[n,r,i]=e;return`rgb:${ls(n,t)}/${ls(r,t)}/${ls(i,t)}`}var ds={"(":0,")":1,"*":2,"+":3,"-":1,".":2},fs=131072,ps=10;function ms(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var hs=5e3,gs=0,_s=class extends I{constructor(e,t,n,r,i,a,o,s,c=new as){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=a,this._coreMouseService=o,this._unicodeService=s,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new ie,this._utf8Decoder=new ae,this._windowTitle=``,this._iconName=``,this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=q.clone(),this._eraseAttrDataInternal=q.clone(),this._onRequestBell=this._register(new R),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new R),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new R),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new R),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new R),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new R),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new R),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new R),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new R),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new R),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new R),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new R),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new R),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new vs(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(e=>this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,t)=>{this._logService.debug(`Unknown CSI code: `,{identifier:this._parser.identToString(e),params:t.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug(`Unknown ESC code: `,{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug(`Unknown EXECUTE code: `,{code:e})}),this._parser.setOscHandlerFallback((e,t,n)=>{this._logService.debug(`Unknown OSC code: `,{identifier:e,action:t,data:n})}),this._parser.setDcsHandlerFallback((e,t,n)=>{t===`HOOK`&&(n=n.toArray()),this._logService.debug(`Unknown DCS code: `,{identifier:this._parser.identToString(e),action:t,payload:n})}),this._parser.setPrintHandler((e,t,n)=>this.print(e,t,n)),this._parser.registerCsiHandler({final:`@`},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:` `,final:`@`},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:`A`},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:` `,final:`A`},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:`B`},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:`C`},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:`D`},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:`E`},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:`F`},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:`G`},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:`H`},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:`I`},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:`J`},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`J`},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:`K`},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`K`},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:`L`},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:`M`},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:`P`},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:`S`},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:`T`},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:`X`},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:`Z`},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:`a`},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:`b`},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:`c`},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:`>`,final:`c`},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:`d`},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:`e`},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:`f`},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:`g`},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:`h`},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`h`},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:`l`},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`l`},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:`m`},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:`n`},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:`?`,final:`n`},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:`!`,final:`p`},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:` `,final:`q`},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:`r`},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:`s`},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:`t`},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:`u`},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`}`},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`~`},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:`"`,final:`q`},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:`$`,final:`p`},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:`?`,intermediates:`$`,final:`p`},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler(B.BEL,()=>this.bell()),this._parser.setExecuteHandler(B.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(B.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(B.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(B.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(B.BS,()=>this.backspace()),this._parser.setExecuteHandler(B.HT,()=>this.tab()),this._parser.setExecuteHandler(B.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(B.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(pi.IND,()=>this.index()),this._parser.setExecuteHandler(pi.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(pi.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Zo(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new Zo(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new Zo(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new Zo(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new Zo(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new Zo(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new Zo(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new Zo(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new Zo(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new Zo(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new Zo(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new Zo(e=>this.restoreCursorColor(e))),this._parser.registerEscHandler({final:`7`},()=>this.saveCursor()),this._parser.registerEscHandler({final:`8`},()=>this.restoreCursor()),this._parser.registerEscHandler({final:`D`},()=>this.index()),this._parser.registerEscHandler({final:`E`},()=>this.nextLine()),this._parser.registerEscHandler({final:`H`},()=>this.tabSet()),this._parser.registerEscHandler({final:`M`},()=>this.reverseIndex()),this._parser.registerEscHandler({final:`=`},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:`>`},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:`c`},()=>this.fullReset()),this._parser.registerEscHandler({final:`n`},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:`o`},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:`|`},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:`}`},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:`~`},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:`%`,final:`@`},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:`%`,final:`G`},()=>this.selectDefaultCharset());for(let e in _o)this._parser.registerEscHandler({intermediates:`(`,final:e},()=>this.selectCharset(`(`+e)),this._parser.registerEscHandler({intermediates:`)`,final:e},()=>this.selectCharset(`)`+e)),this._parser.registerEscHandler({intermediates:`*`,final:e},()=>this.selectCharset(`*`+e)),this._parser.registerEscHandler({intermediates:`+`,final:e},()=>this.selectCharset(`+`+e)),this._parser.registerEscHandler({intermediates:`-`,final:e},()=>this.selectCharset(`-`+e)),this._parser.registerEscHandler({intermediates:`.`,final:e},()=>this.selectCharset(`.`+e)),this._parser.registerEscHandler({intermediates:`/`,final:e},()=>this.selectCharset(`/`+e));this._parser.registerEscHandler({intermediates:`#`,final:`8`},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error(`Parsing error: `,e),e)),this._parser.registerDcsHandler({intermediates:`$`,final:`q`},new ts((e,t)=>this.requestStatusString(e,t)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((e,t)=>setTimeout(()=>t(`#SLOW_TIMEOUT`),hs))]).catch(e=>{if(e!==`#SLOW_TIMEOUT`)throw e;console.warn(`async parser handler taking longer than ${hs} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,a=0,o=this._parseStack.paused;if(o){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>fs&&(a=this._parseStack.position+fs)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e==`string`?` "${e}"`:` "${Array.prototype.map.call(e,e=>String.fromCharCode(e)).join(``)}"`}`),this._logService.logLevel===0&&this._logService.trace(`parsing data (codes)`,typeof e==`string`?e.split(``).map(e=>e.charCodeAt(0)):e),this._parseBuffer.lengthfs)for(let t=a;t0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let f=this._parser.precedingJoinState;for(let p=t;ps){if(c){let e=d,t=this._activeBuffer.x-m;for(this._activeBuffer.x=m,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),m>0&&d instanceof co&&d.copyCellsFrom(e,t,0,m,!1);t=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u);continue}if(l&&(d.insertCells(this._activeBuffer.x,i-m,this._activeBuffer.getNullCell(u)),d.getWidth(s-1)===2&&d.setCellFromCodepoint(s-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,r,i,u),i>0)for(;--i;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=f,this._activeBuffer.x0&&d.getWidth(this._activeBuffer.x)===0&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final===`t`&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,e=>ms(e.params[0],this._optionsService.rawOptions.windowOptions)?t(e):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new ts(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Zo(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,i=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),i),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.getTrimmedLength(););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let c=s;for(let e=1;e0||(this._is(`xterm`)||this._is(`rxvt-unicode`)||this._is(`screen`)?this._coreService.triggerDataEvent(B.ESC+`[?1;2c`):this._is(`linux`)&&this._coreService.triggerDataEvent(B.ESC+`[?6c`)),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is(`xterm`)?this._coreService.triggerDataEvent(B.ESC+`[>0;276;0c`):this._is(`rxvt-unicode`)?this._coreService.triggerDataEvent(B.ESC+`[>85;95;0c`):this._is(`linux`)?this._coreService.triggerDataEvent(e.params[0]+`c`):this._is(`screen`)&&this._coreService.triggerDataEvent(B.ESC+`[>83;40003;0c`)),!0}_is(e){return(this._optionsService.rawOptions.termName+``).indexOf(e)===0}setMode(e){for(let t=0;t(e[e.NOT_RECOGNIZED=0]=`NOT_RECOGNIZED`,e[e.SET=1]=`SET`,e[e.RESET=2]=`RESET`,e[e.PERMANENTLY_SET=3]=`PERMANENTLY_SET`,e[e.PERMANENTLY_RESET=4]=`PERMANENTLY_RESET`))(n||={});let r=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:a}=this._coreMouseService,o=this._coreService,{buffers:s,cols:c}=this._bufferService,{active:l,alt:u}=s,d=this._optionsService.rawOptions,f=(e,n)=>(o.triggerDataEvent(`${B.ESC}[${t?``:`?`}${e};${n}$y`),!0),p=e=>e?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,p(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,p(d.convertEol)):f(m,0):m===1?f(m,p(r.applicationCursorKeys)):m===3?f(m,d.windowOptions.setWinLines?c===80?2:c===132?1:0:0):m===6?f(m,p(r.origin)):m===7?f(m,p(r.wraparound)):m===8?f(m,3):m===9?f(m,p(i===`X10`)):m===12?f(m,p(d.cursorBlink)):m===25?f(m,p(!o.isCursorHidden)):m===45?f(m,p(r.reverseWraparound)):m===66?f(m,p(r.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,p(i===`VT200`)):m===1002?f(m,p(i===`DRAG`)):m===1003?f(m,p(i===`ANY`)):m===1004?f(m,p(r.sendFocus)):m===1005?f(m,4):m===1006?f(m,p(a===`SGR`)):m===1015?f(m,4):m===1016?f(m,p(a===`SGR_PIXELS`)):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,p(l===u)):m===2004?f(m,p(r.bracketedPasteMode)):m===2026?f(m,p(r.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=ce.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,a=0;do{if(r[a+i]=e.params[t+a],e.hasSubParams(t+a)){let n=e.getSubParams(t+a),o=0;do r[1]===5&&(i=1),r[a+o+1+i]=n[o];while(++o=2||r[1]===2&&a+i>=5)break;r[1]&&(i=1)}while(++a+t5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=q.fg,e.bg=q.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let i=0;i=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=n-90|16777224):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=n-100|16777224):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=q.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=q.bg&16777215):n===38||n===48||n===58?i+=this._extractColor(e,i,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=q.fg&16777215,r.bg&=-67108864,r.bg|=q.bg&16777215):this._logService.debug(`Unknown SGR attribute: %d.`,n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${B.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${B.ESC}[${e};${t}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${B.ESC}[?${e};${t}R`);break;case 15:break;case 25:break;case 26:break;case 53:break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=q.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle=`block`;break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle=`underline`;break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle=`bar`;break}let e=t%2==1;this._coreService.decPrivateModes.cursorBlink=e}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!ms(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${B.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>ps&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>ps&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(`;`);for(;n.length>1;){let e=n.shift(),r=n.shift();if(/^\d+$/.exec(e)){let n=parseInt(e);if(ys(n))if(r===`?`)t.push({type:0,index:n});else{let e=cs(r);e&&t.push({type:1,index:n,color:e})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(`;`);if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):n.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(`:`),r,i=n.findIndex(e=>e.startsWith(`id=`));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(`;`);for(let e=0;e=this._specialColors.length);++e,++t)if(n[e]===`?`)this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=cs(n[e]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(`;`);for(let e=0;e=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=q.clone(),this._eraseAttrDataInternal=q.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new M;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t(this._coreService.triggerDataEvent(`${B.ESC}${e}${B.ESC}\\`),!0),r=this._bufferService.buffer,i=this._optionsService.rawOptions;return n(e===`"q`?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e===`"p`?`P1$r61;1"p`:e===`r`?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e===`m`?`P1$r0m`:e===` q`?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-(i.cursorBlink?1:0)} q`:`P0$r`)}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},vs=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){ethis.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(gs=e,e=t,t=gs),ethis.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};vs=x([S(0,P)],vs);function ys(e){return 0<=e&&e<256}var bs=5e7,xs=12,Ss=50,Cs=class extends I{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new R),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>bs)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],r=this._action(e,t);if(r){r.catch(e=>(queueMicrotask(()=>{throw e}),Promise.resolve(!1))).then(e=>performance.now()-n>=xs?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(n,e));return}let i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,performance.now()-n>=xs)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>Ss&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},ws=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let n=t.addMarker(t.ybase+t.y),r={data:e,id:this._nextId++,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(r,n)),this._dataByLinkId.set(r.id,r),r.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let a=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(o,a)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(e=>e.line!==t)){let e=this._bufferService.buffer.addMarker(t);n.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(n,e))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};ws=x([S(0,P)],ws);var Ts=!1,Es=class extends I{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new ft),this._onBinary=this._register(new R),this.onBinary=this._onBinary.event,this._onData=this._register(new R),this.onData=this._onData.event,this._onLineFeed=this._register(new R),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new R),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new R),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new R),this._instantiationService=new eo,this.optionsService=this._register(new Do(e)),this._instantiationService.setService(be,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(wo)),this._instantiationService.setService(P,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(ro)),this._instantiationService.setService(ye,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Mo)),this._instantiationService.setService(ge,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Lo)),this._instantiationService.setService(he,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Uo)),this._instantiationService.setService(Se,this.unicodeService),this._charsetService=this._instantiationService.createInstance(Wo),this._instantiationService.setService(_e,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(ws),this._instantiationService.setService(xe,this._oscLinkService),this._inputHandler=this._register(new _s(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(xt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(xt.forward(this._bufferService.onResize,this._onResize)),this._register(xt.forward(this.coreService.onData,this._onData)),this._register(xt.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange([`windowsMode`,`windowsPty`],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new Cs((e,t)=>this._inputHandler.parse(e,t))),this._register(xt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new R),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!Ts&&(this._logService.warn(`writeSync is unreliable and will be removed soon.`),Ts=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,So),t=Math.max(t,Co),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend===`conpty`&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(Go.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:`H`},()=>(Go(this._bufferService),!1))),this._windowsWrappingHeuristics.value=F(()=>{for(let t of e)t.dispose()})}}},Ds={48:[`0`,`)`],49:[`1`,`!`],50:[`2`,`@`],51:[`3`,`#`],52:[`4`,`$`],53:[`5`,`%`],54:[`6`,`^`],55:[`7`,`&`],56:[`8`,`*`],57:[`9`,`(`],186:[`;`,`:`],187:[`=`,`+`],188:[`,`,`<`],189:[`-`,`_`],190:[`.`,`>`],191:[`/`,`?`],192:["`",`~`],219:[`[`,`{`],220:[`\\`,`|`],221:[`]`,`}`],222:[`'`,`"`]};function Os(e,t,n,r){let i={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?t?i.key=B.ESC+`OA`:i.key=B.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?t?i.key=B.ESC+`OD`:i.key=B.ESC+`[D`:e.key===`UIKeyInputRightArrow`?t?i.key=B.ESC+`OC`:i.key=B.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(t?i.key=B.ESC+`OB`:i.key=B.ESC+`[B`);break;case 8:i.key=e.ctrlKey?`\b`:B.DEL,e.altKey&&(i.key=B.ESC+i.key);break;case 9:if(e.shiftKey){i.key=B.ESC+`[Z`;break}i.key=B.HT,i.cancel=!0;break;case 13:i.key=e.altKey?B.ESC+B.CR:B.CR,i.cancel=!0;break;case 27:i.key=B.ESC,e.altKey&&(i.key=B.ESC+B.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;a?i.key=B.ESC+`[1;`+(a+1)+`D`:t?i.key=B.ESC+`OD`:i.key=B.ESC+`[D`;break;case 39:if(e.metaKey)break;a?i.key=B.ESC+`[1;`+(a+1)+`C`:t?i.key=B.ESC+`OC`:i.key=B.ESC+`[C`;break;case 38:if(e.metaKey)break;a?i.key=B.ESC+`[1;`+(a+1)+`A`:t?i.key=B.ESC+`OA`:i.key=B.ESC+`[A`;break;case 40:if(e.metaKey)break;a?i.key=B.ESC+`[1;`+(a+1)+`B`:t?i.key=B.ESC+`OB`:i.key=B.ESC+`[B`;break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=B.ESC+`[2~`);break;case 46:a?i.key=B.ESC+`[3;`+(a+1)+`~`:i.key=B.ESC+`[3~`;break;case 36:a?i.key=B.ESC+`[1;`+(a+1)+`H`:t?i.key=B.ESC+`OH`:i.key=B.ESC+`[H`;break;case 35:a?i.key=B.ESC+`[1;`+(a+1)+`F`:t?i.key=B.ESC+`OF`:i.key=B.ESC+`[F`;break;case 33:e.shiftKey?i.type=2:e.ctrlKey?i.key=B.ESC+`[5;`+(a+1)+`~`:i.key=B.ESC+`[5~`;break;case 34:e.shiftKey?i.type=3:e.ctrlKey?i.key=B.ESC+`[6;`+(a+1)+`~`:i.key=B.ESC+`[6~`;break;case 112:a?i.key=B.ESC+`[1;`+(a+1)+`P`:i.key=B.ESC+`OP`;break;case 113:a?i.key=B.ESC+`[1;`+(a+1)+`Q`:i.key=B.ESC+`OQ`;break;case 114:a?i.key=B.ESC+`[1;`+(a+1)+`R`:i.key=B.ESC+`OR`;break;case 115:a?i.key=B.ESC+`[1;`+(a+1)+`S`:i.key=B.ESC+`OS`;break;case 116:a?i.key=B.ESC+`[15;`+(a+1)+`~`:i.key=B.ESC+`[15~`;break;case 117:a?i.key=B.ESC+`[17;`+(a+1)+`~`:i.key=B.ESC+`[17~`;break;case 118:a?i.key=B.ESC+`[18;`+(a+1)+`~`:i.key=B.ESC+`[18~`;break;case 119:a?i.key=B.ESC+`[19;`+(a+1)+`~`:i.key=B.ESC+`[19~`;break;case 120:a?i.key=B.ESC+`[20;`+(a+1)+`~`:i.key=B.ESC+`[20~`;break;case 121:a?i.key=B.ESC+`[21;`+(a+1)+`~`:i.key=B.ESC+`[21~`;break;case 122:a?i.key=B.ESC+`[23;`+(a+1)+`~`:i.key=B.ESC+`[23~`;break;case 123:a?i.key=B.ESC+`[24;`+(a+1)+`~`:i.key=B.ESC+`[24~`;break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=B.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=B.DEL:e.keyCode===219?i.key=B.ESC:e.keyCode===220?i.key=B.FS:e.keyCode===221&&(i.key=B.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let t=Ds[e.keyCode]?.[e.shiftKey?1:0];if(t)i.key=B.ESC+t;else if(e.keyCode>=65&&e.keyCode<=90){let t=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(t);e.shiftKey&&(n=n.toUpperCase()),i.key=B.ESC+n}else if(e.keyCode===32)i.key=B.ESC+(e.ctrlKey?B.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),i.key=B.ESC+t,i.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(i.key=B.US),e.key===`@`&&(i.key=B.NUL));break}return i}var J=0,ks=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new va,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new va,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((e,t)=>this._getKey(e)-this._getKey(t)),t=0,n=0,r=Array(this._array.length+this._insertedValues.length);for(let i=0;i=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[i]=e[t],t++):r[i]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(J=this._search(t),J===-1)||this._getKey(this._array[J])!==t)return!1;do if(this._array[J]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(J),!0;while(++Je-t),t=0,n=Array(this._array.length-e.length),r=0;for(let i=0;i0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(J=this._search(e),!(J<0||J>=this._array.length)&&this._getKey(this._array[J])===e))do yield this._array[J];while(++J=this._array.length)&&this._getKey(this._array[J])===e))do t(this._array[J]);while(++J=t;){let r=t+n>>1,i=this._getKey(this._array[r]);if(i>e)n=r-1;else if(i0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},As=0,js=0,Ms=class extends I{constructor(){super(),this._decorations=new ks(e=>e?.marker.line),this._onDecorationRegistered=this._register(new R),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new R),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(F(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new Ns(e);if(t){let e=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,i=r+(a.options.width??1),e>=r&&e{As=t.options.x??0,js=As+(t.options.width??1),e>=As&&e=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Is=20,Ls=!1,Rs=class extends I{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``;let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=i.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;ethis._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=i.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new Fs(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);Ls?(this._accessibilityContainer.classList.add(`debug`),this._rowContainer.classList.add(`debug`),this._debugRootContainer=i.createElement(`div`),this._debugRootContainer.classList.add(`xterm`),this._debugRootContainer.appendChild(i.createTextNode(`------start a11y------`)),this._debugRootContainer.appendChild(this._accessibilityContainer),this._debugRootContainer.appendChild(i.createTextNode(`------end a11y------`)),this._terminal.element.insertAdjacentElement(`afterend`,this._debugRootContainer)):this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this._register(this._terminal.onResize(e=>this._handleResize(e.rows))),this._register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(e=>this._handleChar(e))),this._register(this._terminal.onLineFeed(()=>this._handleChar(` +`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(z(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(F(()=>{Ls?this._debugRootContainer.remove():this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===` +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Is+1&&(this._liveRegion.textContent+=w.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(!(!a||!o)){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;ee;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e{ct(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(z(this._element,`mouseleave`,()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(z(this._element,`mousemove`,this._handleMouseMove.bind(this))),this._register(z(this._element,`mousedown`,this._handleMouseDown.bind(this))),this._register(z(this._element,`mouseup`,this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,t=>{if(this._isMouseOut)return;let i=t?.map(e=>({link:e}));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;re?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;tthis._linkAtPosition(e.link,t));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let e=0;ethis._linkAtPosition(e.link,t));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&Bs(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,ct(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};zs=x([S(1,Oe),S(2,ke),S(3,P),S(4,Ne)],zs);function Bs(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var Vs=class extends Es{constructor(e={}){super(e),this._linkifier=this._register(new ft),this.browser=ta,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new ft),this._onCursorMove=this._register(new R),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new R),this.onKey=this._onKey.event,this._onRender=this._register(new R),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new R),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new R),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new R),this.onBell=this._onBell.event,this._onFocus=this._register(new R),this._onBlur=this._register(new R),this._onA11yCharEmitter=this._register(new R),this._onA11yTabEmitter=this._register(new R),this._onWillOpen=this._register(new R),this._setup(),this._decorationService=this._instantiationService.createInstance(Ms),this._instantiationService.setService(Ce,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(Xi),this._instantiationService.setService(Ne,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(we)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(xt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(xt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(xt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(xt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(F(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=U.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${B.ESC}]${n};${us(r)}${mi.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors(e=>e.ansi[t.index]=H.toColor(...t.color));else{let n=e;this._themeService.modifyColors(e=>e[n]=H.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Rs,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(B.ESC+`[I`),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(B.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this._register(z(this.element,`copy`,e=>{this.hasSelection()&&D(e,this._selectionService)}));let e=e=>ne(e,this.textarea,this.coreService,this.optionsService);this._register(z(this.textarea,`paste`,e)),this._register(z(this.element,`paste`,e)),aa?this._register(z(this.element,`mousedown`,e=>{e.button===2&&k(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(z(this.element,`contextmenu`,e=>{k(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),pa&&this._register(z(this.element,`auxclick`,e=>{e.button===1&&re(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(z(this.textarea,`keyup`,e=>this._keyUp(e),!0)),this._register(z(this.textarea,`keydown`,e=>this._keyDown(e),!0)),this._register(z(this.textarea,`keypress`,e=>this._keyPress(e),!0)),this._register(z(this.textarea,`compositionstart`,()=>this._compositionHelper.compositionstart())),this._register(z(this.textarea,`compositionupdate`,e=>this._compositionHelper.compositionupdate(e))),this._register(z(this.textarea,`compositionend`,()=>this._compositionHelper.compositionend())),this._register(z(this.textarea,`input`,e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._register(z(this.screenElement,`mousemove`,e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement(`textarea`);this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,te.get()),ma||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange(`disableStdin`,()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(Ji,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(De,this._coreBrowserService),this._register(z(this.textarea,`focus`,e=>this._handleTextAreaFocus(e))),this._register(z(this.textarea,`blur`,()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Wi,this._document,this._helperContainer),this._instantiationService.setService(Ee,this._charSizeService),this._themeService=this._instantiationService.createInstance(Qa),this._instantiationService.setService(Me,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Ti),this._instantiationService.setService(je,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(ba,this.rows,this.screenElement)),this._instantiationService.setService(ke,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(hi,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance($i),this._instantiationService.setService(Oe,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(zs,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(oi,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Ha,this.element,this.screenElement,r)),this._instantiationService.setService(Ae,this._selectionService),this._register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this._register(xt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(si,this.screenElement)),this._register(z(this.element,`mousedown`,e=>this._selectionService.handleMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Rs,this)),this._register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(fi,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRuler`,e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(fi,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Ui,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=t.buttons&1?0:t.buttons&4?1:t.buttons&2?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e._customWheelEventHandler&&e._customWheelEventHandler(t)===!1)return!1;let n=t.deltaY;if(n===0||e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;i=n<0?0:1,r=4;break;default:return!1}return i===void 0||r===void 0||r>4?!1:e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this._register(this.coreMouseService.onProtocolChange(e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),e&8?r.mousemove||=(t.addEventListener(`mousemove`,i.mousemove),i.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),e&16?r.wheel||=(t.addEventListener(`wheel`,i.wheel,{passive:!1}),i.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),e&2?r.mouseup||=i.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),e&4?r.mousedrag||=i.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(z(t,`mousedown`,e=>{if(e.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(e)))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)})),this._register(z(t,`wheel`,t=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(t)===!1)return!1;if(!this.buffer.hasScrollback){if(t.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(t,!0);let n=B.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(t.deltaY<0?`A`:`B`);return this.coreService.triggerDataEvent(n,!0),this.cancel(t,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){O(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key===`Dead`||e.key===`AltGraph`)&&(this._unprocessedDeadKey=!0);let n=Os(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===B.ETX||n.key===B.CR)&&(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(Hs(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new M)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},Gs=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new Ws(t)}getNullCell(){return new M}},Ks=class extends I{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new R),this.onBufferChange=this._onBufferChange.event,this._normal=new Gs(this._core.buffers.normal,`normal`),this._alternate=new Gs(this._core.buffers.alt,`alternate`),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error(`Active buffer is neither normal nor alternate`)}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},qs=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,e=>t(e.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(e,n)=>t(e,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},Js=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},Ys=[`cols`,`rows`],Xs=0,Zs=class extends I{constructor(e){super(),this._core=this._register(new Vs(e)),this._addonManager=this._register(new Us),this._publicOptions={...this._core.options};let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(Ys.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error(`You must set the allowProposedApi option to true to use proposed API`)}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||=new qs(this._core),this._parser}get unicode(){return this._checkProposedApi(),new Js(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||=this._register(new Ks(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`;break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r +`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return te.get()},set promptLabel(e){te.set(e)},get tooMuchOutput(){return w.get()},set tooMuchOutput(e){w.set(e)}}}_verifyIntegers(...e){for(Xs of e)if(Xs===1/0||isNaN(Xs)||Xs%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(Xs of e)if(Xs&&(Xs===1/0||isNaN(Xs)||Xs%1!=0||Xs<0))throw Error(`This API only accepts positive integers`)}},Qs=2,$s=1,ec=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(Qs,Math.floor(u/e.css.cell.width)),rows:Math.max($s,Math.floor(l/e.css.cell.height))}}},tc=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=rc.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function nc(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var rc=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!nc(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),!(!n.isWrapped||o.indexOf(` `)!==-1)););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function ac(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var oc=class{constructor(e=ac,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||ic;this._linkProvider=this._terminal.registerLinkProvider(new tc(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}},sc=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?fc.isErrorNoTelemetry(e)?new fc(e.message+` + +`+e.stack):Error(e.message+` + +`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function cc(e){uc(e)||sc.onUnexpectedError(e)}var lc=`Canceled`;function uc(e){return e instanceof dc?!0:e instanceof Error&&e.name===lc&&e.message===lc}var dc=class extends Error{constructor(){super(lc),this.name=this.message}},fc=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}};function pc(e,t,n=0,r=e.length){let i=n,a=r;for(;i{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(hc||={});function gc(e,t){return(n,r)=>t(e(n),e(r))}var _c=(e,t)=>e-t,vc=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>t(n)?e(n):!0))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>e(n)?(t=n,!1):!0),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||hc.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};vc.empty=new vc(e=>{});function yc(e,t){let n=Object.create(null);for(let r of e){let e=t(r),i=n[e];i||=n[e]=[],i.push(r)}return n}var bc=class{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){let n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){let n=this.map.get(e);n&&n.forEach(t)}get(e){return this.map.get(e)||new Set}};function xc(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var Sc;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);tt.source!==null&&!this.getRootParent(t,e).isSingleton).flatMap(([e])=>e)}computeLeakingDisposables(e=10,t){let n;if(t)n=t;else{let e=new Map,t=[...this.livingDisposables.values()].filter(t=>t.source!==null&&!this.getRootParent(t,e).isSingleton);if(t.length===0)return;let r=new Set(t.map(e=>e.value));if(n=t.filter(e=>!(e.parent&&r.has(e.parent))),n.length===0)throw Error(`There are cyclic diposable chains!`)}if(!n)return;function r(e){function t(e,t){for(;e.length>0&&t.some(t=>typeof t==`string`?t===e[0]:e[0].match(t));)e.shift()}let n=e.source.split(` +`).map(e=>e.trim().replace(`at `,``)).filter(e=>e!==``);return t(n,[`Error`,/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),n.reverse()}let i=new bc;for(let e of n){let t=r(e);for(let n=0;n<=t.length;n++)i.add(t.slice(0,n).join(` +`),e)}n.sort(gc(e=>e.idx,_c));let a=``,o=0;for(let t of n.slice(0,e)){o++;let e=r(t),s=[];for(let t=0;tr(e)[t]),e=>e);delete o[e[t]];for(let[e,t]of Object.entries(o))s.unshift(` - stacktraces of ${t.length} other leaks continue with ${e}`);s.unshift(a)}a+=` + + +==================== Leaking disposable ${o}/${n.length}: ${t.value.constructor.name} ==================== +${s.join(` +`)} +============================================================ + +`}return n.length>e&&(a+=` + + +... and ${n.length-e} more leaking disposables + +`),{leaks:n,details:a}}};Tc.idx=0;function Ec(e){wc=e}if(Cc){let e=`__is_disposable_tracked__`;Ec(new class{trackDisposable(t){let n=Error(`Potentially leaked disposable`).stack;setTimeout(()=>{t[e]||console.log(n)},3e3)}setParent(t,n){if(t&&t!==Ic.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==Ic.None)try{t[e]=!0}catch{}}markAsSingleton(e){}})}function Dc(e){return wc?.trackDisposable(e),e}function Oc(e){wc?.markAsDisposed(e)}function kc(e,t){wc?.setParent(e,t)}function Ac(e,t){if(wc)for(let n of e)wc.setParent(n,t)}function jc(e){if(Sc.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Mc(...e){let t=Nc(()=>jc(e));return Ac(e,t),t}function Nc(e){let t=Dc({dispose:xc(()=>{Oc(t),e()})});return t}var Pc=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,Dc(this)}dispose(){this._isDisposed||(Oc(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{jc(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return kc(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),kc(e,null))}};Pc.DISABLE_DISPOSED_WARNING=!1;var Fc=Pc,Ic=class{constructor(){this._store=new Fc,Dc(this),kc(this._store,this)}dispose(){Oc(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}};Ic.None=Object.freeze({dispose(){}});var Lc=class{constructor(){this._isDisposed=!1,Dc(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&kc(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,Oc(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&kc(e,null),e}},Rc=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};Rc.Undefined=new Rc(void 0);var zc=globalThis.performance&&typeof globalThis.performance.now==`function`,Bc=class e{static create(t){return new e(t)}constructor(e){this._now=zc&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}},Vc=!1,Hc=!1,Uc=!1,Wc;(e=>{e.None=()=>Ic.None;function t(e){if(Uc){let{onDidAddListener:t}=e,n=Xc.create(),r=0;e.onDidAddListener=()=>{++r===2&&(console.warn(`snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here`),n.print()),t?.()}}}function n(e,t){return f(e,()=>{},0,void 0,!0,void 0,t)}e.defer=n;function r(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=r;function i(e,t,n){return u((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=i;function a(e,t,n){return u((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=a;function o(e,t,n){return u((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=o;function s(e){return e}e.signal=s;function c(...e){return(t,n=null,r)=>d(Mc(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=c;function l(e,t,n,r){let a=n;return i(e,e=>(a=t(a,e),a),r)}e.reduce=l;function u(e,n){let r,i={onWillAddFirstListener(){r=e(a.fire,a)},onDidRemoveLastListener(){r?.dispose()}};n||t(i);let a=new il(i);return n?.add(a),a.event}function d(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function f(e,n,r=100,i=!1,a=!1,o,s){let c,l,u,d=0,f,p={leakWarningThreshold:o,onWillAddFirstListener(){c=e(e=>{d++,l=n(l,e),i&&!u&&(m.fire(l),l=void 0),f=()=>{let e=l;l=void 0,u=void 0,(!i||d>1)&&m.fire(e),d=0},typeof r==`number`?(clearTimeout(u),u=setTimeout(f,r)):u===void 0&&(u=0,queueMicrotask(f))})},onWillRemoveListener(){a&&d>0&&f?.()},onDidRemoveLastListener(){f=void 0,c.dispose()}};s||t(p);let m=new il(p);return s?.add(m),m.event}e.debounce=f;function p(t,n=0,r){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,!0,void 0,r)}e.accumulate=p;function m(e,t=(e,t)=>e===t,n){let r=!0,i;return o(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=m;function h(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=h;function g(e,t=!1,n=[],r){let i=n.slice(),a=e(e=>{i?i.push(e):s.fire(e)});r&&r.add(a);let o=()=>{i?.forEach(e=>s.fire(e)),i=null},s=new il({onWillAddFirstListener(){a||(a=e(e=>s.fire(e)),r&&r.add(a))},onDidAddFirstListener(){i&&(t?setTimeout(o):o())},onDidRemoveLastListener(){a&&a.dispose(),a=null}});return r&&r.add(s),s.event}e.buffer=g;function _(e,t){return(n,r,i)=>{let a=t(new y);return e(function(e){let t=a.evaluate(e);t!==v&&n.call(r,t)},void 0,i)}}e.chain=_;let v=Symbol(`HaltChainable`);class y{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:v),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:v}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===v)break;return e}}function b(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new il({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=b;function x(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new il({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=x;function S(e){return new Promise(t=>r(e)(t))}e.toPromise=S;function ee(e){let t=new il;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event}e.fromPromise=ee;function te(e,t){return e(e=>t.fire(e))}e.forward=te;function C(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=C;class w{constructor(e,n){this._observable=e,this._counter=0,this._hasChanged=!1;let r={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};n||t(r),this.emitter=new il(r),n&&n.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function T(e,t){return new w(e,t).emitter.event}e.fromObservable=T;function E(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return r instanceof Fc?r.add(s):Array.isArray(r)&&r.push(s),s}}e.fromObservableLight=E})(Wc||={});var Gc=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new Bc,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};Gc.all=new Set,Gc._idPool=0;var Kc=Gc,qc=-1,Jc=class e{constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t{if(e instanceof el)t(e);else for(let n=0;n{e.length!==0&&(console.warn(`[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:`),console.warn(e.join(` +`)),e.length=0)},3e3),rl=new FinalizationRegistry(t=>{typeof t==`string`&&e.push(t)})}var il=class{constructor(e){this._size=0,this._options=e,this._leakageMon=qc>0||this._options?.leakWarningThreshold?new Yc(e?.onListenerError??cc,this._options?.leakWarningThreshold??qc):void 0,this._perfMon=this._options?._profName?new Kc(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(Hc){let e=this._listeners;queueMicrotask(()=>{nl(e,e=>e.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new Qc(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||cc)(n),Ic.None}if(this._disposed)return Ic.None;t&&(e=e.bind(t));let r=new el(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Xc.create(),i=this._leakageMon.check(r.stack,this._size+1)),Hc&&(r.stack=Xc.create()),this._listeners?this._listeners instanceof el?(this._deliveryQueue??=new al,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=Nc(()=>{rl?.unregister(a),i?.(),this._removeListener(r)});if(n instanceof Fc?n.add(a):Array.isArray(n)&&n.push(a),rl){let e=Error().stack.split(` +`).slice(2,3).join(` +`).trim(),t=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(e);rl.register(a,t?.[2]??e,a)}return a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*tl<=t.length){let e=0;for(let n=0;n0}},al=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},ol=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),sl;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof cl?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Wc.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:ol})})(sl||={});var cl=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?ol:(this._emitter||=new il,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}},ll=`en`,ul=!1,dl=!1,fl=ll,pl,ml=globalThis,hl;typeof ml.vscode<`u`&&typeof ml.vscode.process<`u`?hl=ml.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(hl=process);var gl=typeof hl?.versions?.electron==`string`&&hl?.type===`renderer`;if(typeof hl==`object`){hl.platform,hl.platform,ul=hl.platform===`linux`,ul&&hl.env.SNAP&&hl.env.SNAP_REVISION,hl.env.CI||hl.env.BUILD_ARTIFACTSTAGINGDIRECTORY,fl=ll;let e=hl.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,fl=t.resolvedLanguage||ll,t.languagePack?.translationsConfigFile}catch{}}else typeof navigator==`object`&&!gl?(pl=navigator.userAgent,pl.indexOf(`Windows`),pl.indexOf(`Macintosh`),(pl.indexOf(`Macintosh`)>=0||pl.indexOf(`iPad`)>=0||pl.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,ul=pl.indexOf(`Linux`)>=0,pl?.indexOf(`Mobi`),dl=!0,fl=globalThis._VSCODE_NLS_LANGUAGE||ll,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);dl&&typeof ml.importScripts==`function`&&ml.origin;var _l=pl,vl=fl,yl;(e=>{function t(){return vl}e.value=t;function n(){return vl.length===2?vl===`en`:vl.length>=3?vl[0]===`e`&&vl[1]===`n`&&vl[2]===`-`:!1}e.isDefaultVariant=n;function r(){return vl===`en`}e.isDefault=r})(yl||={});var bl=typeof ml.postMessage==`function`&&!ml.importScripts;(()=>{if(bl){let e=[];ml.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n{let r=++t;e.push({id:r,callback:n}),ml.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var xl=!!(_l&&_l.indexOf(`Chrome`)>=0);_l&&_l.indexOf(`Firefox`),!xl&&_l&&_l.indexOf(`Safari`),_l&&_l.indexOf(`Edg/`),_l&&_l.indexOf(`Android`);function Sl(e,t=0,n){let r=setTimeout(()=>{e(),n&&i.dispose()},t),i=Nc(()=>{clearTimeout(r),n?.deleteAndLeak(i)});return n?.add(i),i}(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var Cl;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(Cl||={});var wl=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new il,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};wl.EMPTY=wl.fromArray([]);var Tl=class extends Ic{constructor(e){super(),this._terminal=e,this._linesCacheTimeout=this._register(new Lc),this._linesCacheDisposables=this._register(new Lc),this._register(Nc(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=Mc(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=Sl(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(e){return this._linesCache?.[e]}setLineInCache(e,t){this._linesCache&&(this._linesCache[e]=t)}translateBufferLineToStringWithWrap(e,t){let n=[],r=[0],i=this._terminal.buffer.active.getLine(e);for(;i;){let a=this._terminal.buffer.active.getLine(e+1),o=a?a.isWrapped:!1,s=i.translateToString(!o&&t);if(o&&a){let e=i.getCell(i.length-1);e&&e.getCode()===0&&e.getWidth()===1&&a.getCell(0)?.getWidth()===2&&(s=s.slice(0,-1))}if(n.push(s),o)r.push(r[r.length-1]+s.length);else break;e++,i=a}return[n.join(``),r]}},El=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(e){this._cachedSearchTerm=e}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(e){this._lastSearchOptions=e}isValidSearchTerm(e){return!!(e&&e.length>0)}didOptionsChange(e){return this._lastSearchOptions?e?this._lastSearchOptions.caseSensitive!==e.caseSensitive||this._lastSearchOptions.regex!==e.regex||this._lastSearchOptions.wholeWord!==e.wholeWord:!1:!0}shouldUpdateHighlighting(e,t){return t?.decorations?this._cachedSearchTerm===void 0||e!==this._cachedSearchTerm||this.didOptionsChange(t):!1}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},Dl=class{constructor(e,t){this._terminal=e,this._lineCache=t}find(e,t,n,r){if(!e||e.length===0){this._terminal.clearSelection();return}if(n>this._terminal.cols)throw Error(`Invalid col: ${n} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let i={startRow:t,startCol:n},a=this._findInLine(e,i,r);if(!a)for(let n=t+1;n=0&&(o.startRow=n,s=this._findInLine(e,o,t,!0),!s);n--);}if(!s&&i!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let n=this._terminal.buffer.active.baseY+this._terminal.rows-1;n>=i&&(o.startRow=n,s=this._findInLine(e,o,t,!0),!s);n--);return s}_isWholeWord(e,t,n){return(e===0||` ~!@#$%^&*()+\`-=[]{}|\\;:"',./<>?`.includes(t[e-1]))&&(e+n.length===t.length||` ~!@#$%^&*()+\`-=[]{}|\\;:"',./<>?`.includes(t[e+n.length]))}_findInLine(e,t,n={},r=!1){let i=t.startRow,a=t.startCol;if(this._terminal.buffer.active.getLine(i)?.isWrapped){if(r){t.startCol+=this._terminal.cols;return}return t.startRow--,t.startCol+=this._terminal.cols,this._findInLine(e,t,n)}let o=this._lineCache.getLineFromCache(i);o||(o=this._lineCache.translateBufferLineToStringWithWrap(i,!0),this._lineCache.setLineInCache(i,o));let[s,c]=o,l=this._bufferColsToStringOffset(i,a),u=e,d=s;n.regex||(u=n.caseSensitive?e:e.toLowerCase(),d=n.caseSensitive?s:s.toLowerCase());let f=-1;if(n.regex){let t=RegExp(u,n.caseSensitive?`g`:`gi`),i;if(r)for(;i=t.exec(d.slice(0,l));)f=t.lastIndex-i[0].length,e=i[0],t.lastIndex-=e.length-1;else i=t.exec(d.slice(l)),i&&i[0].length>0&&(f=l+(t.lastIndex-i[0].length),e=i[0])}else r?l-u.length>=0&&(f=d.lastIndexOf(u,l-u.length)):f=d.indexOf(u,l);if(f>=0){if(n.wholeWord&&!this._isWholeWord(f,d,e))return;let t=0;for(;t=c[t+1];)t++;let r=t;for(;r=c[r+1];)r++;let a=f-c[t],o=f+e.length-c[r],s=this._stringLengthToBufferSize(i+t,a),l=this._stringLengthToBufferSize(i+r,o)-s+this._terminal.cols*(r-t);return{term:e,col:s,row:i+t,size:l}}}_stringLengthToBufferSize(e,t){let n=this._terminal.buffer.active.getLine(e);if(!n)return 0;for(let e=0;e1&&(t-=i.length-1);let a=n.getCell(e+1);a&&a.getWidth()===0&&t++}return t}_bufferColsToStringOffset(e,t){let n=e,r=0,i=this._terminal.buffer.active.getLine(n);for(;t>0&&i;){for(let e=0;ethis.clearHighlightDecorations()))}createHighlightDecorations(e,t){this.clearHighlightDecorations();for(let n of e){let e=this._createResultDecorations(n,t,!1);if(e)for(let t of e)this._storeDecoration(t,n)}}createActiveDecoration(e,t){let n=this._createResultDecorations(e,t,!0);if(n)return{decorations:n,match:e,dispose(){jc(n)}}}clearHighlightDecorations(){jc(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(e,t){this._highlightedLines.add(e.marker.line),this._highlightDecorations.push({decoration:e,match:t,dispose(){e.dispose()}})}_applyStyles(e,t,n){e.classList.contains(`xterm-find-result-decoration`)||(e.classList.add(`xterm-find-result-decoration`),t&&(e.style.outline=`1px solid ${t}`)),n&&e.classList.add(`xterm-find-active-result-decoration`)}_createResultDecorations(e,t,n){let r=[],i=e.col,a=e.size,o=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+e.row;for(;a>0;){let e=Math.min(this._terminal.cols-i,a);r.push([o,i,e]),i=0,a-=e,o++}let s=[];for(let e of r){let r=this._terminal.registerMarker(e[0]),i=this._terminal.registerDecoration({marker:r,x:e[1],width:e[2],backgroundColor:n?t.activeMatchBackground:t.matchBackground,overviewRulerOptions:this._highlightedLines.has(r.line)?void 0:{color:n?t.activeMatchColorOverviewRuler:t.matchOverviewRuler,position:`center`}});if(i){let e=[];e.push(r),e.push(i.onRender(e=>this._applyStyles(e,n?t.activeMatchBorder:t.matchBorder,!1))),e.push(i.onDispose(()=>jc(e))),s.push(i)}}return s.length===0?void 0:s}},kl=class extends Ic{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new il)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(e){this._selectedDecoration=e}updateResults(e,t){this._searchResults=e.slice(0,t)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&=(this._selectedDecoration.dispose(),void 0)}findResultIndex(e){for(let t=0;tthis._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(Nc(()=>this.clearDecorations()))}_updateMatches(){this._highlightTimeout.clear(),this._state.cachedSearchTerm&&this._state.lastSearchOptions?.decorations&&(this._highlightTimeout.value=Sl(()=>{let e=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(e,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(e){this._resultTracker.clearSelectedDecoration(),this._decorationManager?.clearHighlightDecorations(),this._resultTracker.clearResults(),e||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(e,t,n){if(!this._terminal||!this._engine)throw Error(`Cannot use addon until it has been loaded`);this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let r=this._findNextAndSelect(e,t,n);return this._fireResults(t),this._state.cachedSearchTerm=e,r}_highlightAllMatches(e,t){if(!this._terminal||!this._engine||!this._decorationManager)throw Error(`Cannot use addon until it has been loaded`);if(!this._state.isValidSearchTerm(e)){this.clearDecorations();return}this.clearDecorations(!0);let n=[],r,i=this._engine.find(e,0,0,t);for(;i&&(r?.row!==i.row||r?.col!==i.col)&&!(n.length>=this._highlightLimit);)r=i,n.push(r),i=this._engine.find(e,r.col+r.term.length>=this._terminal.cols?r.row+1:r.row,r.col+r.term.length>=this._terminal.cols?0:r.col+1,t);this._resultTracker.updateResults(n,this._highlightLimit),t.decorations&&this._decorationManager.createHighlightDecorations(n,t.decorations)}_findNextAndSelect(e,t,n){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let r=this._engine.findNextWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(r,t?.decorations,n?.noScroll)}findPrevious(e,t,n){if(!this._terminal||!this._engine)throw Error(`Cannot use addon until it has been loaded`);this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let r=this._findPreviousAndSelect(e,t,n);return this._fireResults(t),this._state.cachedSearchTerm=e,r}_fireResults(e){this._resultTracker.fireResultsChanged(!!e?.decorations)}_findPreviousAndSelect(e,t,n){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let r=this._engine.findPreviousWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(r,t?.decorations,n?.noScroll)}_selectResult(e,t,n){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!e)return this._terminal.clearSelection(),!1;if(this._terminal.select(e.col,e.row,e.size),t){let n=this._decorationManager.createActiveDecoration(e,t);n&&(this._resultTracker.selectedDecoration=n)}if(!n&&(e.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||e.rowt[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=Pu.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return Pu.createPropertyValue(0,n,r)}},Il=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Vl.isErrorNoTelemetry(e)?new Vl(e.message+` + +`+e.stack):Error(e.message+` + +`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function Ll(e){zl(e)||Il.onUnexpectedError(e)}var Rl=`Canceled`;function zl(e){return e instanceof Bl?!0:e instanceof Error&&e.name===Rl&&e.message===Rl}var Bl=class extends Error{constructor(){super(Rl),this.name=this.message}},Vl=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}};function Hl(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}function Ul(e,t,n=0,r=e.length){let i=n,a=r;for(;i{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Gl||={});function Kl(e,t){return(n,r)=>t(e(n),e(r))}var ql=(e,t)=>e-t,Jl=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>t(n)?e(n):!0))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>e(n)?(t=n,!1):!0),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||Gl.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};Jl.empty=new Jl(e=>{});function Yl(e,t){let n=Object.create(null);for(let r of e){let e=t(r),i=n[e];i||=n[e]=[],i.push(r)}return n}var Xl=class{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){let n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){let n=this.map.get(e);n&&n.forEach(t)}get(e){return this.map.get(e)||new Set}},Zl;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);tt.source!==null&&!this.getRootParent(t,e).isSingleton).flatMap(([e])=>e)}computeLeakingDisposables(e=10,t){let n;if(t)n=t;else{let e=new Map,t=[...this.livingDisposables.values()].filter(t=>t.source!==null&&!this.getRootParent(t,e).isSingleton);if(t.length===0)return;let r=new Set(t.map(e=>e.value));if(n=t.filter(e=>!(e.parent&&r.has(e.parent))),n.length===0)throw Error(`There are cyclic diposable chains!`)}if(!n)return;function r(e){function t(e,t){for(;e.length>0&&t.some(t=>typeof t==`string`?t===e[0]:e[0].match(t));)e.shift()}let n=e.source.split(` +`).map(e=>e.trim().replace(`at `,``)).filter(e=>e!==``);return t(n,[`Error`,/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),n.reverse()}let i=new Xl;for(let e of n){let t=r(e);for(let n=0;n<=t.length;n++)i.add(t.slice(0,n).join(` +`),e)}n.sort(Kl(e=>e.idx,ql));let a=``,o=0;for(let t of n.slice(0,e)){o++;let e=r(t),s=[];for(let t=0;tr(e)[t]),e=>e);delete o[e[t]];for(let[e,t]of Object.entries(o))s.unshift(` - stacktraces of ${t.length} other leaks continue with ${e}`);s.unshift(a)}a+=` + + +==================== Leaking disposable ${o}/${n.length}: ${t.value.constructor.name} ==================== +${s.join(` +`)} +============================================================ + +`}return n.length>e&&(a+=` + + +... and ${n.length-e} more leaking disposables + +`),{leaks:n,details:a}}};eu.idx=0;function tu(e){$l=e}if(Ql){let e=`__is_disposable_tracked__`;tu(new class{trackDisposable(t){let n=Error(`Potentially leaked disposable`).stack;setTimeout(()=>{t[e]||console.log(n)},3e3)}setParent(t,n){if(t&&t!==du.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==du.None)try{t[e]=!0}catch{}}markAsSingleton(e){}})}function nu(e){return $l?.trackDisposable(e),e}function ru(e){$l?.markAsDisposed(e)}function iu(e,t){$l?.setParent(e,t)}function au(e,t){if($l)for(let n of e)$l.setParent(n,t)}function ou(e){if(Zl.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function su(...e){let t=cu(()=>ou(e));return au(e,t),t}function cu(e){let t=nu({dispose:Hl(()=>{ru(t),e()})});return t}var lu=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,nu(this)}dispose(){this._isDisposed||(ru(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ou(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return iu(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),iu(e,null))}};lu.DISABLE_DISPOSED_WARNING=!1;var uu=lu,du=class{constructor(){this._store=new uu,nu(this),iu(this._store,this)}dispose(){ru(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}};du.None=Object.freeze({dispose(){}});var fu=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};fu.Undefined=new fu(void 0);var pu=globalThis.performance&&typeof globalThis.performance.now==`function`,mu=class e{static create(t){return new e(t)}constructor(e){this._now=pu&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}},hu=!1,gu=!1,_u=!1,vu;(e=>{e.None=()=>du.None;function t(e){if(_u){let{onDidAddListener:t}=e,n=wu.create(),r=0;e.onDidAddListener=()=>{++r===2&&(console.warn(`snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here`),n.print()),t?.()}}}function n(e,t){return f(e,()=>{},0,void 0,!0,void 0,t)}e.defer=n;function r(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=r;function i(e,t,n){return u((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=i;function a(e,t,n){return u((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=a;function o(e,t,n){return u((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=o;function s(e){return e}e.signal=s;function c(...e){return(t,n=null,r)=>d(su(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=c;function l(e,t,n,r){let a=n;return i(e,e=>(a=t(a,e),a),r)}e.reduce=l;function u(e,n){let r,i={onWillAddFirstListener(){r=e(a.fire,a)},onDidRemoveLastListener(){r?.dispose()}};n||t(i);let a=new Mu(i);return n?.add(a),a.event}function d(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function f(e,n,r=100,i=!1,a=!1,o,s){let c,l,u,d=0,f,p={leakWarningThreshold:o,onWillAddFirstListener(){c=e(e=>{d++,l=n(l,e),i&&!u&&(m.fire(l),l=void 0),f=()=>{let e=l;l=void 0,u=void 0,(!i||d>1)&&m.fire(e),d=0},typeof r==`number`?(clearTimeout(u),u=setTimeout(f,r)):u===void 0&&(u=0,queueMicrotask(f))})},onWillRemoveListener(){a&&d>0&&f?.()},onDidRemoveLastListener(){f=void 0,c.dispose()}};s||t(p);let m=new Mu(p);return s?.add(m),m.event}e.debounce=f;function p(t,n=0,r){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,!0,void 0,r)}e.accumulate=p;function m(e,t=(e,t)=>e===t,n){let r=!0,i;return o(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=m;function h(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=h;function g(e,t=!1,n=[],r){let i=n.slice(),a=e(e=>{i?i.push(e):s.fire(e)});r&&r.add(a);let o=()=>{i?.forEach(e=>s.fire(e)),i=null},s=new Mu({onWillAddFirstListener(){a||(a=e(e=>s.fire(e)),r&&r.add(a))},onDidAddFirstListener(){i&&(t?setTimeout(o):o())},onDidRemoveLastListener(){a&&a.dispose(),a=null}});return r&&r.add(s),s.event}e.buffer=g;function _(e,t){return(n,r,i)=>{let a=t(new y);return e(function(e){let t=a.evaluate(e);t!==v&&n.call(r,t)},void 0,i)}}e.chain=_;let v=Symbol(`HaltChainable`);class y{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:v),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:v}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===v)break;return e}}function b(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new Mu({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=b;function x(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new Mu({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=x;function S(e){return new Promise(t=>r(e)(t))}e.toPromise=S;function ee(e){let t=new Mu;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event}e.fromPromise=ee;function te(e,t){return e(e=>t.fire(e))}e.forward=te;function C(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=C;class w{constructor(e,n){this._observable=e,this._counter=0,this._hasChanged=!1;let r={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};n||t(r),this.emitter=new Mu(r),n&&n.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function T(e,t){return new w(e,t).emitter.event}e.fromObservable=T;function E(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return r instanceof uu?r.add(s):Array.isArray(r)&&r.push(s),s}}e.fromObservableLight=E})(vu||={});var yu=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new mu,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};yu.all=new Set,yu._idPool=0;var bu=yu,xu=-1,Su=class e{constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t{if(e instanceof Ou)t(e);else for(let n=0;n{e.length!==0&&(console.warn(`[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:`),console.warn(e.join(` +`)),e.length=0)},3e3),ju=new FinalizationRegistry(t=>{typeof t==`string`&&e.push(t)})}var Mu=class{constructor(e){this._size=0,this._options=e,this._leakageMon=xu>0||this._options?.leakWarningThreshold?new Cu(e?.onListenerError??Ll,this._options?.leakWarningThreshold??xu):void 0,this._perfMon=this._options?._profName?new bu(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(gu){let e=this._listeners;queueMicrotask(()=>{Au(e,e=>e.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new Eu(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||Ll)(n),du.None}if(this._disposed)return du.None;t&&(e=e.bind(t));let r=new Ou(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=wu.create(),i=this._leakageMon.check(r.stack,this._size+1)),gu&&(r.stack=wu.create()),this._listeners?this._listeners instanceof Ou?(this._deliveryQueue??=new Nu,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=cu(()=>{ju?.unregister(a),i?.(),this._removeListener(r)});if(n instanceof uu?n.add(a):Array.isArray(n)&&n.push(a),ju){let e=Error().stack.split(` +`).slice(2,3).join(` +`).trim(),t=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(e);ju.register(a,t?.[2]??e,a)}return a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*ku<=t.length){let e=0;for(let n=0;n0}},Nu=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Pu=class e{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new Mu,this.onChange=this._onChange.event;let e=new Fl;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!=0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(e&16777215)<<3|(t&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(t){let n=0,r=0,i=t.length;for(let a=0;a=i)return n+this.wcwidth(o);let e=t.charCodeAt(a);56320<=e&&e<=57343?o=(o-55296)*1024+e-56320+65536:n+=this.wcwidth(e)}let s=this.charProperties(o,r),c=e.extractWidth(s);e.extractShouldJoin(s)&&(c-=e.extractWidth(r)),n+=c,r=s}return n}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},Fu=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],Iu=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],Lu=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],Ru=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]],zu;function Bu(e,t){let n=0,r=t.length-1,i;if(et[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(en&&(n=e)}return Pu.createPropertyValue(0,n,r)}},Hu=class{activate(e){e.unicode.register(new Vu)}dispose(){}},Uu=Object.defineProperty,Wu=Object.getOwnPropertyDescriptor,Gu=(e,t,n,r)=>{for(var i=r>1?void 0:r?Wu(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&Uu(t,n,i),i},Ku=(e,t)=>(n,r)=>t(n,r,e),qu=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Qu.isErrorNoTelemetry(e)?new Qu(e.message+` + +`+e.stack):Error(e.message+` + +`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function Ju(e){Xu(e)||qu.onUnexpectedError(e)}var Yu=`Canceled`;function Xu(e){return e instanceof Zu?!0:e instanceof Error&&e.name===Yu&&e.message===Yu}var Zu=class extends Error{constructor(){super(Yu),this.name=this.message}},Qu=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}};function $u(e,t,n=0,r=e.length){let i=n,a=r;for(;i{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(td||={});function nd(e,t){return(n,r)=>t(e(n),e(r))}var rd=(e,t)=>e-t,id=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>t(n)?e(n):!0))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>e(n)?(t=n,!1):!0),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||td.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};id.empty=new id(e=>{});function ad(e,t){let n=Object.create(null);for(let r of e){let e=t(r),i=n[e];i||=n[e]=[],i.push(r)}return n}var od=class{constructor(){this.map=new Map}add(e,t){let n=this.map.get(e);n||(n=new Set,this.map.set(e,n)),n.add(t)}delete(e,t){let n=this.map.get(e);n&&(n.delete(t),n.size===0&&this.map.delete(e))}forEach(e,t){let n=this.map.get(e);n&&n.forEach(t)}get(e){return this.map.get(e)||new Set}};function sd(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var cd;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);tt.source!==null&&!this.getRootParent(t,e).isSingleton).flatMap(([e])=>e)}computeLeakingDisposables(e=10,t){let n;if(t)n=t;else{let e=new Map,t=[...this.livingDisposables.values()].filter(t=>t.source!==null&&!this.getRootParent(t,e).isSingleton);if(t.length===0)return;let r=new Set(t.map(e=>e.value));if(n=t.filter(e=>!(e.parent&&r.has(e.parent))),n.length===0)throw Error(`There are cyclic diposable chains!`)}if(!n)return;function r(e){function t(e,t){for(;e.length>0&&t.some(t=>typeof t==`string`?t===e[0]:e[0].match(t));)e.shift()}let n=e.source.split(` +`).map(e=>e.trim().replace(`at `,``)).filter(e=>e!==``);return t(n,[`Error`,/^trackDisposable \(.*\)$/,/^DisposableTracker.trackDisposable \(.*\)$/]),n.reverse()}let i=new od;for(let e of n){let t=r(e);for(let n=0;n<=t.length;n++)i.add(t.slice(0,n).join(` +`),e)}n.sort(nd(e=>e.idx,rd));let a=``,o=0;for(let t of n.slice(0,e)){o++;let e=r(t),s=[];for(let t=0;tr(e)[t]),e=>e);delete o[e[t]];for(let[e,t]of Object.entries(o))s.unshift(` - stacktraces of ${t.length} other leaks continue with ${e}`);s.unshift(a)}a+=` + + +==================== Leaking disposable ${o}/${n.length}: ${t.value.constructor.name} ==================== +${s.join(` +`)} +============================================================ + +`}return n.length>e&&(a+=` + + +... and ${n.length-e} more leaking disposables + +`),{leaks:n,details:a}}};dd.idx=0;function fd(e){ud=e}if(ld){let e=`__is_disposable_tracked__`;fd(new class{trackDisposable(t){let n=Error(`Potentially leaked disposable`).stack;setTimeout(()=>{t[e]||console.log(n)},3e3)}setParent(t,n){if(t&&t!==Sd.None)try{t[e]=!0}catch{}}markAsDisposed(t){if(t&&t!==Sd.None)try{t[e]=!0}catch{}}markAsSingleton(e){}})}function pd(e){return ud?.trackDisposable(e),e}function md(e){ud?.markAsDisposed(e)}function hd(e,t){ud?.setParent(e,t)}function gd(e,t){if(ud)for(let n of e)ud.setParent(n,t)}function _d(e){if(cd.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function vd(...e){let t=yd(()=>_d(e));return gd(e,t),t}function yd(e){let t=pd({dispose:sd(()=>{md(t),e()})});return t}var bd=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,pd(this)}dispose(){this._isDisposed||(md(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{_d(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return hd(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),hd(e,null))}};bd.DISABLE_DISPOSED_WARNING=!1;var xd=bd,Sd=class{constructor(){this._store=new xd,pd(this),hd(this._store,this)}dispose(){md(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}};Sd.None=Object.freeze({dispose(){}});var Cd=class{constructor(){this._isDisposed=!1,pd(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&hd(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,md(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&hd(e,null),e}},wd=typeof process<`u`&&`title`in process,Td=wd?`node`:navigator.userAgent,Ed=wd?`node`:navigator.platform,Dd=Td.includes(`Firefox`),Od=Td.includes(`Edge`),kd=/^((?!chrome|android).)*safari/i.test(Td);function Ad(){if(!kd)return 0;let e=Td.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(Ed),[`Windows`,`Win16`,`Win32`,`WinCE`].includes(Ed),Ed.indexOf(`Linux`),/\bCrOS\b/.test(Td);var jd=``,Md=0,Nd=0,Pd=0,Y=0,Fd={css:`#00000000`,rgba:0},Id;(e=>{function t(e,t,n,r){return r===void 0?`#${Vd(e)}${Vd(t)}${Vd(n)}`:`#${Vd(e)}${Vd(t)}${Vd(n)}${Vd(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(Id||={});var Ld;(e=>{function t(e,t){if(Y=(t.rgba&255)/255,Y===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return Md=a+Math.round((n-a)*Y),Nd=o+Math.round((r-o)*Y),Pd=s+Math.round((i-s)*Y),{css:Id.toCss(Md,Nd,Pd),rgba:Id.toRgba(Md,Nd,Pd)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=Bd.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return Id.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[Md,Nd,Pd]=Bd.toChannels(t),{css:Id.toCss(Md,Nd,Pd),rgba:t}}e.opaque=i;function a(e,t){return Y=Math.round(t*255),[Md,Nd,Pd]=Bd.toChannels(e.rgba),{css:Id.toCss(Md,Nd,Pd,Y),rgba:Id.toRgba(Md,Nd,Pd,Y)}}e.opacity=a;function o(e,t){return Y=e.rgba&255,a(e,Y*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(Ld||={});var Rd;(e=>{let t,n;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}catch{}function r(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return Md=parseInt(e.slice(1,2).repeat(2),16),Nd=parseInt(e.slice(2,3).repeat(2),16),Pd=parseInt(e.slice(3,4).repeat(2),16),Id.toColor(Md,Nd,Pd);case 5:return Md=parseInt(e.slice(1,2).repeat(2),16),Nd=parseInt(e.slice(2,3).repeat(2),16),Pd=parseInt(e.slice(3,4).repeat(2),16),Y=parseInt(e.slice(4,5).repeat(2),16),Id.toColor(Md,Nd,Pd,Y);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let r=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return Md=parseInt(r[1]),Nd=parseInt(r[2]),Pd=parseInt(r[3]),Y=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),Id.toColor(Md,Nd,Pd,Y);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[Md,Nd,Pd,Y]=t.getImageData(0,0,1,1).data,Y!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:Id.toRgba(Md,Nd,Pd,Y),css:e}}e.toColor=r})(Rd||={});var zd;(e=>{function t(e){return n(e>>16&255,e>>8&255,e&255)}e.relativeLuminance=t;function n(e,t,n){let r=e/255,i=t/255,a=n/255,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return o*.2126+s*.7152+c*.0722}e.relativeLuminance2=n})(zd||={});var Bd;(e=>{function t(e,t){if(Y=(t&255)/255,Y===1)return t;let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=e>>24&255,o=e>>16&255,s=e>>8&255;return Md=a+Math.round((n-a)*Y),Nd=o+Math.round((r-o)*Y),Pd=s+Math.round((i-s)*Y),Id.toRgba(Md,Nd,Pd)}e.blend=t;function n(e,t,n){let a=zd.relativeLuminance(e>>8),o=zd.relativeLuminance(t>>8);if(Hd(a,o)>8));if(sHd(a,zd.relativeLuminance(r>>8))?o:r}return o}let s=i(e,t,n),c=Hd(a,zd.relativeLuminance(s>>8));if(cHd(a,zd.relativeLuminance(i>>8))?s:i}return s}}e.ensureContrastRatio=n;function r(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=Hd(zd.relativeLuminance2(o,s,c),zd.relativeLuminance2(r,i,a));for(;l0||s>0||c>0);)o-=Math.max(0,Math.ceil(o*.1)),s-=Math.max(0,Math.ceil(s*.1)),c-=Math.max(0,Math.ceil(c*.1)),l=Hd(zd.relativeLuminance2(o,s,c),zd.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.reduceLuminance=r;function i(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=Hd(zd.relativeLuminance2(o,s,c),zd.relativeLuminance2(r,i,a));for(;l>>0}e.increaseLuminance=i;function a(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}e.toChannels=a})(Bd||={});function Vd(e){let t=e.toString(16);return t.length<2?`0`+t:t}function Hd(e,t){return e=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}function Jd(e,t,n,r){return t===1&&n>Math.ceil(r*1.5)&&e!==void 0&&e>255&&!qd(e)&&!Ud(e)&&!Gd(e)}function Yd(e){return Ud(e)||Kd(e)}function Xd(){return{css:{canvas:Zd(),cell:Zd()},device:{canvas:Zd(),cell:Zd(),char:{width:0,height:0,left:0,top:0}}}}function Zd(){return{width:0,height:0}}function Qd(e,t,n=0){return(e-(Math.round(t)*2-n))%(Math.round(t)*2)}var $d=0,ef=0,tf=!1,nf=!1,rf=!1,af,of=0,sf=class{constructor(e,t,n,r,i,a){this._terminal=e,this._optionService=t,this._selectionRenderModel=n,this._decorationService=r,this._coreBrowserService=i,this._themeService=a,this.result={fg:0,bg:0,ext:0}}resolve(e,t,n,r){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,ef=0,$d=0,nf=!1,tf=!1,rf=!1,af=this._themeService.colors,of=0,e.getCode()!==0&&e.extended.underlineStyle===4){let e=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));of=t*r%(Math.round(e)*2)}if(this._decorationService.forEachDecorationAtCell(t,n,`bottom`,e=>{e.backgroundColorRGB&&(ef=e.backgroundColorRGB.rgba>>8&16777215,nf=!0),e.foregroundColorRGB&&($d=e.foregroundColorRGB.rgba>>8&16777215,tf=!0)}),rf=this._selectionRenderModel.isCellSelected(this._terminal,t,n),rf){if(this.result.fg&67108864||this.result.bg&50331648){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:ef=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:ef=(this.result.fg&16777215)<<8|255;break;case 0:default:ef=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:ef=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:ef=(this.result.bg&16777215)<<8|255;break}ef=Bd.blend(ef,(this._coreBrowserService.isFocused?af.selectionBackgroundOpaque:af.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else ef=(this._coreBrowserService.isFocused?af.selectionBackgroundOpaque:af.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(nf=!0,af.selectionForeground&&($d=af.selectionForeground.rgba>>8&16777215,tf=!0),Yd(e.getCode())){if(this.result.fg&67108864&&!(this.result.bg&50331648))$d=(this._coreBrowserService.isFocused?af.selectionBackgroundOpaque:af.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:$d=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:$d=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:$d=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:$d=(this.result.fg&16777215)<<8|255;break;case 0:default:$d=this._themeService.colors.foreground.rgba}$d=Bd.blend($d,(this._coreBrowserService.isFocused?af.selectionBackgroundOpaque:af.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}tf=!0}}this._decorationService.forEachDecorationAtCell(t,n,`top`,e=>{e.backgroundColorRGB&&(ef=e.backgroundColorRGB.rgba>>8&16777215,nf=!0),e.foregroundColorRGB&&($d=e.foregroundColorRGB.rgba>>8&16777215,tf=!0)}),nf&&(ef=rf?e.bg&-150994944|ef|50331648:e.bg&-16777216|ef|50331648),tf&&($d=e.fg&-83886080|$d|50331648),this.result.fg&67108864&&(nf&&!tf&&($d=this.result.bg&50331648?this.result.fg&-134217728|this.result.bg&67108863:this.result.fg&-134217728|af.background.rgba>>8&16777215|50331648,tf=!0),!nf&&tf&&(ef=this.result.fg&50331648?this.result.bg&-67108864|this.result.fg&67108863:this.result.bg&-67108864|af.foreground.rgba>>8&16777215|50331648,nf=!0)),af=void 0,this.result.bg=nf?ef:this.result.bg,this.result.fg=tf?$d:this.result.fg,this.result.ext&=536870911,this.result.ext|=of<<29&3758096384}},cf=.5,lf=Dd||Od?`bottom`:`ideographic`,uf={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},df={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},ff={"─":{1:`M0,.5 L1,.5`},"━":{3:`M0,.5 L1,.5`},"│":{1:`M.5,0 L.5,1`},"┃":{3:`M.5,0 L.5,1`},"┌":{1:`M0.5,1 L.5,.5 L1,.5`},"┏":{3:`M0.5,1 L.5,.5 L1,.5`},"┐":{1:`M0,.5 L.5,.5 L.5,1`},"┓":{3:`M0,.5 L.5,.5 L.5,1`},"└":{1:`M.5,0 L.5,.5 L1,.5`},"┗":{3:`M.5,0 L.5,.5 L1,.5`},"┘":{1:`M.5,0 L.5,.5 L0,.5`},"┛":{3:`M.5,0 L.5,.5 L0,.5`},"├":{1:`M.5,0 L.5,1 M.5,.5 L1,.5`},"┣":{3:`M.5,0 L.5,1 M.5,.5 L1,.5`},"┤":{1:`M.5,0 L.5,1 M.5,.5 L0,.5`},"┫":{3:`M.5,0 L.5,1 M.5,.5 L0,.5`},"┬":{1:`M0,.5 L1,.5 M.5,.5 L.5,1`},"┳":{3:`M0,.5 L1,.5 M.5,.5 L.5,1`},"┴":{1:`M0,.5 L1,.5 M.5,.5 L.5,0`},"┻":{3:`M0,.5 L1,.5 M.5,.5 L.5,0`},"┼":{1:`M0,.5 L1,.5 M.5,0 L.5,1`},"╋":{3:`M0,.5 L1,.5 M.5,0 L.5,1`},"╴":{1:`M.5,.5 L0,.5`},"╸":{3:`M.5,.5 L0,.5`},"╵":{1:`M.5,.5 L.5,0`},"╹":{3:`M.5,.5 L.5,0`},"╶":{1:`M.5,.5 L1,.5`},"╺":{3:`M.5,.5 L1,.5`},"╷":{1:`M.5,.5 L.5,1`},"╻":{3:`M.5,.5 L.5,1`},"═":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"║":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,t)=>`M.5,1 L.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╓":{1:(e,t)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,t)=>`M1,${.5-t} L${.5-e},${.5-t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╕":{1:(e,t)=>`M0,${.5-t} L.5,${.5-t} L.5,1 M0,${.5+t} L.5,${.5+t}`},"╖":{1:(e,t)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5+e},${.5-t} L${.5+e},1`},"╘":{1:(e,t)=>`M.5,0 L.5,${.5+t} L1,${.5+t} M.5,${.5-t} L1,${.5-t}`},"╙":{1:(e,t)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,t)=>`M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0 M1,${.5+t} L${.5-e},${.5+t} L${.5-e},0`},"╛":{1:(e,t)=>`M0,${.5+t} L.5,${.5+t} L.5,0 M0,${.5-t} L.5,${.5-t}`},"╜":{1:(e,t)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,t)=>`M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M0,${.5+t} L${.5+e},${.5+t} L${.5+e},0`},"╞":{1:(e,t)=>`M.5,0 L.5,1 M.5,${.5-t} L1,${.5-t} M.5,${.5+t} L1,${.5+t}`},"╟":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,t)=>`M${.5-e},0 L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╡":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L.5,${.5-t} M0,${.5+t} L.5,${.5+t}`},"╢":{1:(e,t)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,t)=>`M${.5+e},0 L${.5+e},1 M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0`},"╤":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t} M.5,${.5+t} L.5,1`},"╥":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,t)=>`M0,${.5-t} L1,${.5-t} M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1`},"╧":{1:(e,t)=>`M.5,0 L.5,${.5-t} M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╨":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,t)=>`M0,${.5+t} L1,${.5+t} M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╪":{1:(e,t)=>`M.5,0 L.5,1 M0,${.5-t} L1,${.5-t} M0,${.5+t} L1,${.5+t}`},"╫":{1:(e,t)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,t)=>`M0,${.5+t} L${.5-e},${.5+t} L${.5-e},1 M1,${.5+t} L${.5+e},${.5+t} L${.5+e},1 M0,${.5-t} L${.5-e},${.5-t} L${.5-e},0 M1,${.5-t} L${.5+e},${.5-t} L${.5+e},0`},"╱":{1:`M1,0 L0,1`},"╲":{1:`M0,0 L1,1`},"╳":{1:`M1,0 L0,1 M0,0 L1,1`},"╼":{1:`M.5,.5 L0,.5`,3:`M.5,.5 L1,.5`},"╽":{1:`M.5,.5 L.5,0`,3:`M.5,.5 L.5,1`},"╾":{1:`M.5,.5 L1,.5`,3:`M.5,.5 L0,.5`},"╿":{1:`M.5,.5 L.5,1`,3:`M.5,.5 L.5,0`},"┍":{1:`M.5,.5 L.5,1`,3:`M.5,.5 L1,.5`},"┎":{1:`M.5,.5 L1,.5`,3:`M.5,.5 L.5,1`},"┑":{1:`M.5,.5 L.5,1`,3:`M.5,.5 L0,.5`},"┒":{1:`M.5,.5 L0,.5`,3:`M.5,.5 L.5,1`},"┕":{1:`M.5,.5 L.5,0`,3:`M.5,.5 L1,.5`},"┖":{1:`M.5,.5 L1,.5`,3:`M.5,.5 L.5,0`},"┙":{1:`M.5,.5 L.5,0`,3:`M.5,.5 L0,.5`},"┚":{1:`M.5,.5 L0,.5`,3:`M.5,.5 L.5,0`},"┝":{1:`M.5,0 L.5,1`,3:`M.5,.5 L1,.5`},"┞":{1:`M0.5,1 L.5,.5 L1,.5`,3:`M.5,.5 L.5,0`},"┟":{1:`M.5,0 L.5,.5 L1,.5`,3:`M.5,.5 L.5,1`},"┠":{1:`M.5,.5 L1,.5`,3:`M.5,0 L.5,1`},"┡":{1:`M.5,.5 L.5,1`,3:`M.5,0 L.5,.5 L1,.5`},"┢":{1:`M.5,.5 L.5,0`,3:`M0.5,1 L.5,.5 L1,.5`},"┥":{1:`M.5,0 L.5,1`,3:`M.5,.5 L0,.5`},"┦":{1:`M0,.5 L.5,.5 L.5,1`,3:`M.5,.5 L.5,0`},"┧":{1:`M.5,0 L.5,.5 L0,.5`,3:`M.5,.5 L.5,1`},"┨":{1:`M.5,.5 L0,.5`,3:`M.5,0 L.5,1`},"┩":{1:`M.5,.5 L.5,1`,3:`M.5,0 L.5,.5 L0,.5`},"┪":{1:`M.5,.5 L.5,0`,3:`M0,.5 L.5,.5 L.5,1`},"┭":{1:`M0.5,1 L.5,.5 L1,.5`,3:`M.5,.5 L0,.5`},"┮":{1:`M0,.5 L.5,.5 L.5,1`,3:`M.5,.5 L1,.5`},"┯":{1:`M.5,.5 L.5,1`,3:`M0,.5 L1,.5`},"┰":{1:`M0,.5 L1,.5`,3:`M.5,.5 L.5,1`},"┱":{1:`M.5,.5 L1,.5`,3:`M0,.5 L.5,.5 L.5,1`},"┲":{1:`M.5,.5 L0,.5`,3:`M0.5,1 L.5,.5 L1,.5`},"┵":{1:`M.5,0 L.5,.5 L1,.5`,3:`M.5,.5 L0,.5`},"┶":{1:`M.5,0 L.5,.5 L0,.5`,3:`M.5,.5 L1,.5`},"┷":{1:`M.5,.5 L.5,0`,3:`M0,.5 L1,.5`},"┸":{1:`M0,.5 L1,.5`,3:`M.5,.5 L.5,0`},"┹":{1:`M.5,.5 L1,.5`,3:`M.5,0 L.5,.5 L0,.5`},"┺":{1:`M.5,.5 L0,.5`,3:`M.5,0 L.5,.5 L1,.5`},"┽":{1:`M.5,0 L.5,1 M.5,.5 L1,.5`,3:`M.5,.5 L0,.5`},"┾":{1:`M.5,0 L.5,1 M.5,.5 L0,.5`,3:`M.5,.5 L1,.5`},"┿":{1:`M.5,0 L.5,1`,3:`M0,.5 L1,.5`},"╀":{1:`M0,.5 L1,.5 M.5,.5 L.5,1`,3:`M.5,.5 L.5,0`},"╁":{1:`M.5,.5 L.5,0 M0,.5 L1,.5`,3:`M.5,.5 L.5,1`},"╂":{1:`M0,.5 L1,.5`,3:`M.5,0 L.5,1`},"╃":{1:`M0.5,1 L.5,.5 L1,.5`,3:`M.5,0 L.5,.5 L0,.5`},"╄":{1:`M0,.5 L.5,.5 L.5,1`,3:`M.5,0 L.5,.5 L1,.5`},"╅":{1:`M.5,0 L.5,.5 L1,.5`,3:`M0,.5 L.5,.5 L.5,1`},"╆":{1:`M.5,0 L.5,.5 L0,.5`,3:`M0.5,1 L.5,.5 L1,.5`},"╇":{1:`M.5,.5 L.5,1`,3:`M.5,.5 L.5,0 M0,.5 L1,.5`},"╈":{1:`M.5,.5 L.5,0`,3:`M0,.5 L1,.5 M.5,.5 L.5,1`},"╉":{1:`M.5,.5 L1,.5`,3:`M.5,0 L.5,1 M.5,.5 L0,.5`},"╊":{1:`M.5,.5 L0,.5`,3:`M.5,0 L.5,1 M.5,.5 L1,.5`},"╌":{1:`M.1,.5 L.4,.5 M.6,.5 L.9,.5`},"╍":{3:`M.1,.5 L.4,.5 M.6,.5 L.9,.5`},"┄":{1:`M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5`},"┅":{3:`M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5`},"┈":{1:`M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5`},"┉":{3:`M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5`},"╎":{1:`M.5,.1 L.5,.4 M.5,.6 L.5,.9`},"╏":{3:`M.5,.1 L.5,.4 M.5,.6 L.5,.9`},"┆":{1:`M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333`},"┇":{3:`M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333`},"┊":{1:`M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95`},"┋":{3:`M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95`},"╭":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,1,.5`},"╮":{1:(e,t)=>`M.5,1 L.5,${.5+t/.15*.5} C.5,${.5+t/.15*.5},.5,.5,0,.5`},"╯":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,0,.5`},"╰":{1:(e,t)=>`M.5,0 L.5,${.5-t/.15*.5} C.5,${.5-t/.15*.5},.5,.5,1,.5`}},pf={"":{d:`M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655`,type:0},"":{d:`M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5`,type:0},"":{d:`M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82`,type:0},"":{d:`M0,0 L1,.5 L0,1`,type:0,rightPadding:2},"":{d:`M-1,-.5 L1,.5 L-1,1.5`,type:1,leftPadding:1,rightPadding:1},"":{d:`M1,0 L0,.5 L1,1`,type:0,leftPadding:2},"":{d:`M2,-.5 L0,.5 L2,1.5`,type:1,leftPadding:1,rightPadding:1},"":{d:`M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0`,type:0,rightPadding:1},"":{d:`M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0`,type:1,rightPadding:1},"":{d:`M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0`,type:0,leftPadding:1},"":{d:`M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0`,type:1,leftPadding:1},"":{d:`M-.5,-.5 L1.5,1.5 L-.5,1.5`,type:0},"":{d:`M-.5,-.5 L1.5,1.5`,type:1,leftPadding:1,rightPadding:1},"":{d:`M1.5,-.5 L-.5,1.5 L1.5,1.5`,type:0},"":{d:`M1.5,-.5 L-.5,1.5 L-.5,-.5`,type:0},"":{d:`M1.5,-.5 L-.5,1.5`,type:1,leftPadding:1,rightPadding:1},"":{d:`M-.5,-.5 L1.5,1.5 L1.5,-.5`,type:0}};pf[``]=pf[``],pf[``]=pf[``];function mf(e,t,n,r,i,a,o,s){let c=uf[t];if(c)return hf(e,c,n,r,i,a),!0;let l=df[t];if(l)return _f(e,l,n,r,i,a),!0;let u=ff[t];if(u)return vf(e,u,n,r,i,a,s),!0;let d=pf[t];return d?(yf(e,d,n,r,i,a,o,s),!0):!1}function hf(e,t,n,r,i,a){for(let o=0;o7&&parseInt(s.slice(7,9),16)||1;else if(s.startsWith(`rgba`))[u,d,f,p]=s.substring(5,s.length-1).split(`,`).map(e=>parseFloat(e));else throw Error(`Unexpected fillStyle color format "${s}" when drawing pattern glyph`);for(let e=0;ee.bezierCurveTo(t[0],t[1],t[2],t[3],t[4],t[5]),L:(e,t)=>e.lineTo(t[0],t[1]),M:(e,t)=>e.moveTo(t[0],t[1])};function Sf(e,t,n,r,i,a,o,s=0,c=0){let l=e.map(e=>parseFloat(e)||parseInt(e));if(l.length<2)throw Error(`Too few arguments for instruction`);for(let e=0;ei){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},Ef=class extends Tf{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},Df=class extends Tf{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},Of=!wd&&`requestIdleCallback`in window?Df:Ef,kf=class e{constructor(){this.fg=0,this.bg=0,this.extended=new Af}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return(this.fg&50331648)==0}isBgDefault(){return(this.bg&50331648)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Af=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},jf=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};jf.Undefined=new jf(void 0);var Mf=globalThis.performance&&typeof globalThis.performance.now==`function`,Nf=class e{static create(t){return new e(t)}constructor(e){this._now=Mf&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}},Pf=!1,Ff=!1,If=!1,Lf;(e=>{e.None=()=>Sd.None;function t(e){if(If){let{onDidAddListener:t}=e,n=Uf.create(),r=0;e.onDidAddListener=()=>{++r===2&&(console.warn(`snapshotted emitter LIKELY used public and SHOULD HAVE BEEN created with DisposableStore. snapshotted here`),n.print()),t?.()}}}function n(e,t){return f(e,()=>{},0,void 0,!0,void 0,t)}e.defer=n;function r(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=r;function i(e,t,n){return u((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=i;function a(e,t,n){return u((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=a;function o(e,t,n){return u((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=o;function s(e){return e}e.signal=s;function c(...e){return(t,n=null,r)=>d(vd(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=c;function l(e,t,n,r){let a=n;return i(e,e=>(a=t(a,e),a),r)}e.reduce=l;function u(e,n){let r,i={onWillAddFirstListener(){r=e(a.fire,a)},onDidRemoveLastListener(){r?.dispose()}};n||t(i);let a=new Z(i);return n?.add(a),a.event}function d(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function f(e,n,r=100,i=!1,a=!1,o,s){let c,l,u,d=0,f,p={leakWarningThreshold:o,onWillAddFirstListener(){c=e(e=>{d++,l=n(l,e),i&&!u&&(m.fire(l),l=void 0),f=()=>{let e=l;l=void 0,u=void 0,(!i||d>1)&&m.fire(e),d=0},typeof r==`number`?(clearTimeout(u),u=setTimeout(f,r)):u===void 0&&(u=0,queueMicrotask(f))})},onWillRemoveListener(){a&&d>0&&f?.()},onDidRemoveLastListener(){f=void 0,c.dispose()}};s||t(p);let m=new Z(p);return s?.add(m),m.event}e.debounce=f;function p(t,n=0,r){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,!0,void 0,r)}e.accumulate=p;function m(e,t=(e,t)=>e===t,n){let r=!0,i;return o(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=m;function h(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=h;function g(e,t=!1,n=[],r){let i=n.slice(),a=e(e=>{i?i.push(e):s.fire(e)});r&&r.add(a);let o=()=>{i?.forEach(e=>s.fire(e)),i=null},s=new Z({onWillAddFirstListener(){a||(a=e(e=>s.fire(e)),r&&r.add(a))},onDidAddFirstListener(){i&&(t?setTimeout(o):o())},onDidRemoveLastListener(){a&&a.dispose(),a=null}});return r&&r.add(s),s.event}e.buffer=g;function _(e,t){return(n,r,i)=>{let a=t(new y);return e(function(e){let t=a.evaluate(e);t!==v&&n.call(r,t)},void 0,i)}}e.chain=_;let v=Symbol(`HaltChainable`);class y{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:v),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:v}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===v)break;return e}}function b(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new Z({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=b;function x(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new Z({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=x;function S(e){return new Promise(t=>r(e)(t))}e.toPromise=S;function ee(e){let t=new Z;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event}e.fromPromise=ee;function te(e,t){return e(e=>t.fire(e))}e.forward=te;function C(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=C;class w{constructor(e,n){this._observable=e,this._counter=0,this._hasChanged=!1;let r={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};n||t(r),this.emitter=new Z(r),n&&n.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function T(e,t){return new w(e,t).emitter.event}e.fromObservable=T;function E(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return r instanceof xd?r.add(s):Array.isArray(r)&&r.push(s),s}}e.fromObservableLight=E})(Lf||={});var Rf=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new Nf,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};Rf.all=new Set,Rf._idPool=0;var zf=Rf,Bf=-1,Vf=class e{constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t{if(e instanceof qf)t(e);else for(let n=0;n{e.length!==0&&(console.warn(`[LEAKING LISTENERS] GC'ed these listeners that were NOT yet disposed:`),console.warn(e.join(` +`)),e.length=0)},3e3),Xf=new FinalizationRegistry(t=>{typeof t==`string`&&e.push(t)})}var Z=class{constructor(e){this._size=0,this._options=e,this._leakageMon=Bf>0||this._options?.leakWarningThreshold?new Hf(e?.onListenerError??Ju,this._options?.leakWarningThreshold??Bf):void 0,this._perfMon=this._options?._profName?new zf(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){if(!this._disposed){if(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners){if(Ff){let e=this._listeners;queueMicrotask(()=>{Yf(e,e=>e.stack?.print())})}this._listeners=void 0,this._size=0}this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose()}}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new Gf(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||Ju)(n),Sd.None}if(this._disposed)return Sd.None;t&&(e=e.bind(t));let r=new qf(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=Uf.create(),i=this._leakageMon.check(r.stack,this._size+1)),Ff&&(r.stack=Uf.create()),this._listeners?this._listeners instanceof qf?(this._deliveryQueue??=new Zf,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=yd(()=>{Xf?.unregister(a),i?.(),this._removeListener(r)});if(n instanceof xd?n.add(a):Array.isArray(n)&&n.push(a),Xf){let e=Error().stack.split(` +`).slice(2,3).join(` +`).trim(),t=/(file:|vscode-file:\/\/vscode-app)?(\/[^:]*:\d+:\d+)/.exec(e);Xf.register(a,t?.[2]??e,a)}return a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*Jf<=t.length){let e=0;for(let n=0;n0}},Zf=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Qf={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},$f=2,ep,tp=class e{constructor(e,t,n){this._document=e,this._config=t,this._unicodeService=n,this._didWarmUp=!1,this._cacheMap=new wf,this._cacheMapCombined=new wf,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new kf,this._textureSize=512,this._onAddTextureAtlasCanvas=new Z,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Z,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=ap(e,this._config.deviceCellWidth*4+$f*2,this._config.deviceCellHeight+$f*2),this._tmpCtx=X(this._tmpCanvas.getContext(`2d`,{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||=(this._doWarmUp(),!0)}_doWarmUp(){let e=new Of;for(let t=33;t<126;t++)e.enqueue(()=>{if(!this._cacheMap.get(t,0,0,0)){let e=this._drawToCache(t,0,0,0,!1,void 0);this._cacheMap.set(t,0,0,0,e)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(e.maxAtlasPages&&this._pages.length>=Math.max(4,e.maxAtlasPages)){let t=this._pages.filter(t=>t.canvas.width*2<=(e.maxTextureSize||4096)).sort((e,t)=>t.canvas.width===e.canvas.width?t.percentageUsed-e.percentageUsed:t.canvas.width-e.canvas.width),n=-1,r=0;for(let e=0;ee.glyphs[0].texturePage).sort((e,t)=>e>t?1:-1),o=this.pages.length-i.length,s=this._mergePages(i,o);s.version++;for(let e=a.length-1;e>=0;e--)this._deletePage(a[e]);this.pages.push(s),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(s.canvas)}let t=new np(this._document,this._textureSize);return this._pages.push(t),this._activePages.push(t),this._onAddTextureAtlasCanvas.fire(t.canvas),t}_mergePages(e,t){let n=e[0].canvas.width*2,r=new np(this._document,n,e);for(let[i,a]of e.entries()){let e=i*a.canvas.width%n,o=Math.floor(i/2)*a.canvas.height;r.ctx.drawImage(a.canvas,e,o);for(let r of a.glyphs)r.texturePage=t,r.sizeClipSpace.x=r.size.x/n,r.sizeClipSpace.y=r.size.y/n,r.texturePosition.x+=e,r.texturePosition.y+=o,r.texturePositionClipSpace.x=r.texturePosition.x/n,r.texturePositionClipSpace.y=r.texturePosition.y/n;this._onRemoveTextureAtlasCanvas.fire(a.canvas);let s=this._activePages.indexOf(a);s!==-1&&this._activePages.splice(s,1)}return r}_deletePage(e){this._pages.splice(e,1);for(let t=e;t=this._config.colors.ansi.length)throw Error(`No color found for idx `+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,t,n,r){if(this._config.allowTransparency)return Fd;let i;switch(e){case 16777216:case 33554432:i=this._getColorFromAnsiIndex(t);break;case 50331648:let e=kf.toColorRGB(t);i=Id.toColor(e[0],e[1],e[2]);break;default:i=n?Ld.opaque(this._config.colors.foreground):this._config.colors.background;break}return this._config.allowTransparency||(i=Ld.opaque(i)),i}_getForegroundColor(e,t,n,r,i,a,o,s,c,l){let u=this._getMinimumContrastColor(e,t,n,r,i,a,o,c,s,l);if(u)return u;let d;switch(i){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&c&&a<8&&(a+=8),d=this._getColorFromAnsiIndex(a);break;case 50331648:let e=kf.toColorRGB(a);d=Id.toColor(e[0],e[1],e[2]);break;default:d=o?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(d=Ld.opaque(d)),s&&(d=Ld.multiplyOpacity(d,cf)),d}_resolveBackgroundRgba(e,t,n){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return n?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,t,n,r){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&r&&t<8&&(t+=8),this._getColorFromAnsiIndex(t).rgba;case 50331648:return t<<8;default:return n?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,t,n,r,i,a,o,s,c,l){if(this._config.minimumContrastRatio===1||l)return;let u=this._getContrastCache(c),d=u.getColor(e,r);if(d!==void 0)return d||void 0;let f=this._resolveBackgroundRgba(t,n,o),p=this._resolveForegroundRgba(i,a,o,s),m=Bd.ensureContrastRatio(f,p,this._config.minimumContrastRatio/(c?2:1));if(!m){u.setColor(e,r,null);return}let h=Id.toColor(m>>24&255,m>>16&255,m>>8&255);return u.setColor(e,r,h),h}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(t,n,r,i,a,o){let s=typeof t==`number`?String.fromCharCode(t):t;o&&this._tmpCanvas.parentElement!==o&&(this._tmpCanvas.style.display=`none`,o.append(this._tmpCanvas));let c=Math.min(this._config.deviceCellWidth*Math.max(s.length,2)+$f*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width=e?e*2-c:e-c;c>=e||f===0?(this._tmpCtx.setLineDash([Math.round(e),Math.round(e)]),this._tmpCtx.moveTo(s+f,r),this._tmpCtx.lineTo(l,r)):(this._tmpCtx.setLineDash([Math.round(e),Math.round(e)]),this._tmpCtx.moveTo(s,r),this._tmpCtx.lineTo(s+f,r),this._tmpCtx.moveTo(s+f+e,r),this._tmpCtx.lineTo(l,r)),c=Qd(l-s,e,c);break;case 5:let p=l-s,m=Math.floor(.6*p),h=Math.floor(.3*p),g=p-m-h;this._tmpCtx.setLineDash([m,h,g]),this._tmpCtx.moveTo(s,r),this._tmpCtx.lineTo(l,r);break;default:this._tmpCtx.moveTo(s,r),this._tmpCtx.lineTo(l,r);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!E&&this._config.fontSize>=12&&!this._config.allowTransparency&&s!==` `){this._tmpCtx.save(),this._tmpCtx.textBaseline=`alphabetic`;let t=this._tmpCtx.measureText(s);if(this._tmpCtx.restore(),`actualBoundingBoxDescent`in t&&t.actualBoundingBoxDescent>0){this._tmpCtx.save();let t=new Path2D;t.rect(n,r-Math.ceil(e/2),this._config.deviceCellWidth*ne,o-r+Math.ceil(e/2)),this._tmpCtx.clip(t),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=x.css,this._tmpCtx.strokeText(s,T,T+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(g){let e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),t=e%2==1?.5:0;this._tmpCtx.lineWidth=e,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(T,T+t),this._tmpCtx.lineTo(T+this._config.deviceCharWidth*ne,T+t),this._tmpCtx.stroke()}if(E||this._tmpCtx.fillText(s,T,T+this._config.deviceCharHeight),s===`_`&&!this._config.allowTransparency){let e=rp(this._tmpCtx.getImageData(T,T,this._config.deviceCellWidth,this._config.deviceCellHeight),x,w,D);if(e)for(let t=1;t<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=x.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(s,T,T+this._config.deviceCharHeight-t),e=rp(this._tmpCtx.getImageData(T,T,this._config.deviceCellWidth,this._config.deviceCellHeight),x,w,D),e);t++);}if(h){let e=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),t=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=e,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(T,T+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.lineTo(T+this._config.deviceCharWidth*ne,T+Math.floor(this._config.deviceCharHeight/2)-t),this._tmpCtx.stroke()}this._tmpCtx.restore();let O=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),re;if(re=this._config.allowTransparency?ip(O):rp(O,x,w,D),re)return Qf;let k=this._findGlyphBoundingBox(O,this._workBoundingBox,c,C,E,T),A,j;for(;;){if(this._activePages.length===0){let e=this._createNewPage();A=e,j=e.currentRow,j.height=k.size.y;break}A=this._activePages[this._activePages.length-1],j=A.currentRow;for(let e of this._activePages)k.size.y<=e.currentRow.height&&(A=e,j=e.currentRow);for(let e=this._activePages.length-1;e>=0;e--)for(let t of this._activePages[e].fixedRows)t.height<=j.height&&k.size.y<=t.height&&(A=this._activePages[e],j=t);if(k.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new np(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),A=this._overflowSizePage,j=this._overflowSizePage.currentRow,j.x+k.size.x>=A.canvas.width&&(j.x=0,j.y+=j.height,j.height=0);break}if(j.y+k.size.y>=A.canvas.height||j.height>k.size.y+2){let t=!1;if(A.currentRow.y+A.currentRow.height+k.size.y>=A.canvas.height){let n;for(let e of this._activePages)if(e.currentRow.y+e.currentRow.height+k.size.y=e.maxAtlasPages&&j.y+k.size.y<=A.canvas.height&&j.height>=k.size.y&&j.x+k.size.x<=A.canvas.width)t=!0;else{let e=this._createNewPage();A=e,j=e.currentRow,j.height=k.size.y,t=!0}}t||(A.currentRow.height>0&&A.fixedRows.push(A.currentRow),j={x:0,y:A.currentRow.y+A.currentRow.height,height:k.size.y},A.fixedRows.push(j),A.currentRow={x:0,y:j.y+j.height,height:0})}if(j.x+k.size.x<=A.canvas.width)break;j===A.currentRow?(j.x=0,j.y+=j.height,j.height=0):A.fixedRows.splice(A.fixedRows.indexOf(j),1)}return k.texturePage=this._pages.indexOf(A),k.texturePosition.x=j.x,k.texturePosition.y=j.y,k.texturePositionClipSpace.x=j.x/A.canvas.width,k.texturePositionClipSpace.y=j.y/A.canvas.height,k.sizeClipSpace.x/=A.canvas.width,k.sizeClipSpace.y/=A.canvas.height,j.height=Math.max(j.height,k.size.y),j.x+=k.size.x,A.ctx.putImageData(O,k.texturePosition.x-this._workBoundingBox.left,k.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,k.size.x,k.size.y),A.addGlyph(k),A.version++,k}_findGlyphBoundingBox(e,t,n,r,i,a){t.top=0;let o=r?this._config.deviceCellHeight:this._tmpCanvas.height,s=r?this._config.deviceCellWidth:n,c=!1;for(let n=0;n=a;n--){for(let r=0;r=0;n--){for(let r=0;r>>24,a=t.rgba>>>16&255,o=t.rgba>>>8&255,s=n.rgba>>>24,c=n.rgba>>>16&255,l=n.rgba>>>8&255,u=Math.floor((Math.abs(i-s)+Math.abs(a-c)+Math.abs(o-l))/12),d=!0;for(let t=0;t0)return!1;return!0}function ap(e,t,n){let r=e.createElement(`canvas`);return r.width=t,r.height=n,r}function op(e,t,n,r,i,a,o,s){let c={foreground:a.foreground,background:a.background,cursor:Fd,cursorAccent:Fd,selectionForeground:Fd,selectionBackgroundTransparent:Fd,selectionBackgroundOpaque:Fd,selectionInactiveBackgroundTransparent:Fd,selectionInactiveBackgroundOpaque:Fd,overviewRulerBorder:Fd,scrollbarSliderBackground:Fd,scrollbarSliderHoverBackground:Fd,scrollbarSliderActiveBackground:Fd,ansi:a.ansi.slice(),contrastCache:a.contrastCache,halfContrastCache:a.halfContrastCache};return{customGlyphs:i.customGlyphs,devicePixelRatio:o,deviceMaxTextureSize:s,letterSpacing:i.letterSpacing,lineHeight:i.lineHeight,deviceCellWidth:e,deviceCellHeight:t,deviceCharWidth:n,deviceCharHeight:r,fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,fontWeightBold:i.fontWeightBold,allowTransparency:i.allowTransparency,drawBoldTextInBrightColors:i.drawBoldTextInBrightColors,minimumContrastRatio:i.minimumContrastRatio,colors:c}}function sp(e,t){for(let n=0;n=0){if(sp(n.config,l))return n.atlas;n.ownedBy.length===1?(n.atlas.dispose(),lp.splice(t,1)):n.ownedBy.splice(r,1);break}}for(let t=0;t{this._renderCallback(),this._animationFrame=void 0}))}_restartInterval(e=fp){this._blinkInterval&&=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let e=fp-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0){this._restartInterval(e);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let e=fp-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(e);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},fp)},e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&=(this._coreBrowserService.window.clearInterval(this._blinkInterval),void 0),this._blinkStartTimeout&&=(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),void 0),this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function mp(e,t,n){let r=new t.ResizeObserver(t=>{let i=t.find(t=>t.target===e);if(!i)return;if(!(`devicePixelContentBoxSize`in i)){r?.disconnect(),r=void 0;return}let a=i.devicePixelContentBoxSize[0].inlineSize,o=i.devicePixelContentBoxSize[0].blockSize;a>0&&o>0&&n(a,o)});try{r.observe(e,{box:[`device-pixel-content-box`]})}catch{r.disconnect(),r=void 0}return yd(()=>r?.disconnect())}function hp(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var gp=class e extends kf{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Af,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?hp(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},_p=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function vp(e,t,n){let r=X(e.createProgram());if(e.attachShader(r,X(yp(e,e.VERTEX_SHADER,t))),e.attachShader(r,X(yp(e,e.FRAGMENT_SHADER,n))),e.linkProgram(r),e.getProgramParameter(r,e.LINK_STATUS))return r;console.error(e.getProgramInfoLog(r)),e.deleteProgram(r)}function yp(e,t,n){let r=X(e.createShader(t));if(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS))return r;console.error(e.getShaderInfoLog(r)),e.deleteShader(r)}function bp(e,t){let n=Math.min(e.length*2,t),r=new Float32Array(n);for(let t=0;ti.deleteProgram(this._program))),this._projectionLocation=X(i.getUniformLocation(this._program,`u_projection`)),this._resolutionLocation=X(i.getUniformLocation(this._program,`u_resolution`)),this._textureLocation=X(i.getUniformLocation(this._program,`u_texture`)),this._vertexArrayObject=i.createVertexArray(),i.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),o=i.createBuffer();this._register(yd(()=>i.deleteBuffer(o))),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferData(i.ARRAY_BUFFER,a,i.STATIC_DRAW),i.enableVertexAttribArray(0),i.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),c=i.createBuffer();this._register(yd(()=>i.deleteBuffer(c))),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c),i.bufferData(i.ELEMENT_ARRAY_BUFFER,s,i.STATIC_DRAW),this._attributesBuffer=X(i.createBuffer()),this._register(yd(()=>i.deleteBuffer(this._attributesBuffer))),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.enableVertexAttribArray(2),i.vertexAttribPointer(2,2,i.FLOAT,!1,Tp,0),i.vertexAttribDivisor(2,1),i.enableVertexAttribArray(3),i.vertexAttribPointer(3,2,i.FLOAT,!1,Tp,2*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(3,1),i.enableVertexAttribArray(4),i.vertexAttribPointer(4,1,i.FLOAT,!1,Tp,4*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(4,1),i.enableVertexAttribArray(5),i.vertexAttribPointer(5,2,i.FLOAT,!1,Tp,5*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(5,1),i.enableVertexAttribArray(6),i.vertexAttribPointer(6,2,i.FLOAT,!1,Tp,7*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(6,1),i.enableVertexAttribArray(1),i.vertexAttribPointer(1,2,i.FLOAT,!1,Tp,9*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(1,1),i.useProgram(this._program);let l=new Int32Array(tp.maxAtlasPages);for(let e=0;ei.deleteTexture(t.texture))),i.activeTexture(i.TEXTURE0+e),i.bindTexture(i.TEXTURE_2D,t.texture),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[e]=t}i.enable(i.BLEND),i.blendFunc(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,t,n,r,i,a,o,s,c){this._updateCell(this._vertices.attributes,e,t,n,r,i,a,o,s,c)}_updateCell(e,t,n,r,i,a,o,s,c,l){if(Q=(n*this._terminal.cols+t)*wp,r===0||r===void 0){e.fill(0,Q,Q+wp-1-Ep);return}this._atlas&&($=s&&s.length>1?this._atlas.getRasterizedGlyphCombinedChar(s,i,a,o,!1,this._terminal.element):this._atlas.getRasterizedGlyph(r,i,a,o,!1,this._terminal.element),Dp=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),i!==l&&$.offset.x>Dp?(Op=$.offset.x-Dp,e[Q]=-($.offset.x-Op)+this._dimensions.device.char.left,e[Q+1]=-$.offset.y+this._dimensions.device.char.top,e[Q+2]=($.size.x-Op)/this._dimensions.device.canvas.width,e[Q+3]=$.size.y/this._dimensions.device.canvas.height,e[Q+4]=$.texturePage,e[Q+5]=$.texturePositionClipSpace.x+Op/this._atlas.pages[$.texturePage].canvas.width,e[Q+6]=$.texturePositionClipSpace.y,e[Q+7]=$.sizeClipSpace.x-Op/this._atlas.pages[$.texturePage].canvas.width,e[Q+8]=$.sizeClipSpace.y):(e[Q]=-$.offset.x+this._dimensions.device.char.left,e[Q+1]=-$.offset.y+this._dimensions.device.char.top,e[Q+2]=$.size.x/this._dimensions.device.canvas.width,e[Q+3]=$.size.y/this._dimensions.device.canvas.height,e[Q+4]=$.texturePage,e[Q+5]=$.texturePositionClipSpace.x,e[Q+6]=$.texturePositionClipSpace.y,e[Q+7]=$.sizeClipSpace.x,e[Q+8]=$.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&Jd(r,c,$.size.x,this._dimensions.device.cell.width)&&(e[Q+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,t=e.cols*e.rows*wp;this._vertices.count===t?this._vertices.attributes.fill(0):this._vertices.attributes=new Float32Array(t);let n=0;for(;n=e.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0]}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n=this.startCol&&t=this.startCol):!1}};function jp(){return new Ap}var Mp=4,Np=1,Pp=2,Fp=3,Ip=2147483648,Lp=class{constructor(){this.cells=new Uint32Array,this.lineLengths=new Uint32Array,this.selection=jp()}resize(e,t){let n=e*t*Mp;n!==this.cells.length&&(this.cells=new Uint32Array(n),this.lineLengths=new Uint32Array(t))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},Rp=`#version 300 es +layout (location = 0) in vec2 a_position; +layout (location = 1) in vec2 a_size; +layout (location = 2) in vec4 a_color; +layout (location = 3) in vec2 a_unitquad; + +uniform mat4 u_projection; + +out vec4 v_color; + +void main() { + vec2 zeroToOne = a_position + (a_unitquad * a_size); + gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0); + v_color = a_color; +}`,zp=`#version 300 es +precision lowp float; + +in vec4 v_color; + +out vec4 outColor; + +void main() { + outColor = v_color; +}`,Bp=8,Vp=Bp*Float32Array.BYTES_PER_ELEMENT,Hp=20*Bp,Up=class{constructor(){this.attributes=new Float32Array(Hp),this.count=0}},Wp=0,Gp=0,Kp=0,qp=0,Jp=0,Yp=0,Xp=0,Zp=class extends Sd{constructor(e,t,n,r){super(),this._terminal=e,this._gl=t,this._dimensions=n,this._themeService=r,this._vertices=new Up,this._verticesCursor=new Up;let i=this._gl;this._program=X(vp(i,Rp,zp)),this._register(yd(()=>i.deleteProgram(this._program))),this._projectionLocation=X(i.getUniformLocation(this._program,`u_projection`)),this._vertexArrayObject=i.createVertexArray(),i.bindVertexArray(this._vertexArrayObject);let a=new Float32Array([0,0,1,0,0,1,1,1]),o=i.createBuffer();this._register(yd(()=>i.deleteBuffer(o))),i.bindBuffer(i.ARRAY_BUFFER,o),i.bufferData(i.ARRAY_BUFFER,a,i.STATIC_DRAW),i.enableVertexAttribArray(3),i.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let s=new Uint8Array([0,1,2,3]),c=i.createBuffer();this._register(yd(()=>i.deleteBuffer(c))),i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,c),i.bufferData(i.ELEMENT_ARRAY_BUFFER,s,i.STATIC_DRAW),this._attributesBuffer=X(i.createBuffer()),this._register(yd(()=>i.deleteBuffer(this._attributesBuffer))),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.enableVertexAttribArray(0),i.vertexAttribPointer(0,2,i.FLOAT,!1,Vp,0),i.vertexAttribDivisor(0,1),i.enableVertexAttribArray(1),i.vertexAttribPointer(1,2,i.FLOAT,!1,Vp,2*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(1,1),i.enableVertexAttribArray(2),i.vertexAttribPointer(2,4,i.FLOAT,!1,Vp,4*Float32Array.BYTES_PER_ELEMENT),i.vertexAttribDivisor(2,1),this._updateCachedColors(r.colors),this._register(this._themeService.onChangeColors(e=>{this._updateCachedColors(e),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let t=this._gl;t.useProgram(this._program),t.bindVertexArray(this._vertexArrayObject),t.uniformMatrix4fv(this._projectionLocation,!1,_p),t.bindBuffer(t.ARRAY_BUFFER,this._attributesBuffer),t.bufferData(t.ARRAY_BUFFER,e.attributes,t.DYNAMIC_DRAW),t.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,t.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let t=this._terminal,n=this._vertices,r=1,i,a,o,s,c,l,u,d,f,p,m;for(i=0;i>24&255)/255,Jp=(Wp>>16&255)/255,Yp=(Wp>>8&255)/255,Xp=1,this._addRectangle(e.attributes,t,Gp,Kp,(a-i)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,qp,Jp,Yp,Xp)}_addRectangle(e,t,n,r,i,a,o,s,c,l){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o,e[t+5]=s,e[t+6]=c,e[t+7]=l}_addRectangleFloat(e,t,n,r,i,a,o){e[t]=n/this._dimensions.device.canvas.width,e[t+1]=r/this._dimensions.device.canvas.height,e[t+2]=i/this._dimensions.device.canvas.width,e[t+3]=a/this._dimensions.device.canvas.height,e[t+4]=o[0],e[t+5]=o[1],e[t+6]=o[2],e[t+7]=o[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},Qp=class extends Sd{constructor(e,t,n,r,i,a,o,s){super(),this._container=t,this._alpha=i,this._coreBrowserService=a,this._optionsService=o,this._themeService=s,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-${n}-layer`),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(t=>{this._refreshCharAtlas(e,t),this.reset(e)})),this._register(yd(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=X(this._canvas.getContext(`2d`,{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,t,n){}handleSelectionChanged(e,t,n,r=!1){}_setTransparency(e,t){if(t===this._alpha)return;let n=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,t){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=up(e,this._optionsService.rawOptions,t,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,t){this._deviceCellWidth=t.device.cell.width,this._deviceCellHeight=t.device.cell.height,this._deviceCharWidth=t.device.char.width,this._deviceCharHeight=t.device.char.height,this._deviceCharLeft=t.device.char.left,this._deviceCharTop=t.device.char.top,this._canvas.width=t.device.canvas.width,this._canvas.height=t.device.canvas.height,this._canvas.style.width=`${t.css.canvas.width}px`,this._canvas.style.height=`${t.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,t,n=1){this._ctx.fillRect(e*this._deviceCellWidth,(t+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,n*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,t,n,r){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,r*this._deviceCellHeight))}_fillCharTrueColor(e,t,n,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=lf,this._clipCell(n,r,t.getWidth()),this._ctx.fillText(t.getChars(),n*this._deviceCellWidth+this._deviceCharLeft,r*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,t,n){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,t*this._deviceCellHeight,n*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,t,n){let r=t?e.options.fontWeightBold:e.options.fontWeight;return`${n?`italic`:``} ${r} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},$p=class extends Qp{constructor(e,t,n,r,i,a,o){super(n,e,`link`,t,!0,i,a,o),this._register(r.onShowLinkUnderline(e=>this._handleShowLinkUnderline(e))),this._register(r.onHideLinkUnderline(e=>this._handleHideLinkUnderline(e)))}resize(e,t){super.resize(e,t),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&cp(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let t=e.y1+1;t=0;!(im.indexOf(`Chrome`)>=0)&&im.indexOf(`Safari`),im.indexOf(`Electron/`),im.indexOf(`Android`);var om=!1;if(typeof em.matchMedia==`function`){let e=em.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=em.matchMedia(`(display-mode: fullscreen)`);om=e.matches,rm(em,e,({matches:e})=>{om&&t.matches||(om=e)})}function sm(){return om}var cm=`en`,lm=!1,um=!1,dm=!1,fm=cm,pm,mm=globalThis,hm;typeof mm.vscode<`u`&&typeof mm.vscode.process<`u`?hm=mm.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(hm=process);var gm=typeof hm?.versions?.electron==`string`&&hm?.type===`renderer`;if(typeof hm==`object`){hm.platform,hm.platform,lm=hm.platform===`linux`,lm&&hm.env.SNAP&&hm.env.SNAP_REVISION,hm.env.CI||hm.env.BUILD_ARTIFACTSTAGINGDIRECTORY,fm=cm;let e=hm.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,fm=t.resolvedLanguage||cm,t.languagePack?.translationsConfigFile}catch{}um=!0}else typeof navigator==`object`&&!gm?(pm=navigator.userAgent,pm.indexOf(`Windows`),pm.indexOf(`Macintosh`),(pm.indexOf(`Macintosh`)>=0||pm.indexOf(`iPad`)>=0||pm.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,lm=pm.indexOf(`Linux`)>=0,pm?.indexOf(`Mobi`),dm=!0,fm=globalThis._VSCODE_NLS_LANGUAGE||cm,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var _m=um;dm&&typeof mm.importScripts==`function`&&mm.origin;var vm=pm,ym=fm,bm;(e=>{function t(){return ym}e.value=t;function n(){return ym.length===2?ym===`en`:ym.length>=3?ym[0]===`e`&&ym[1]===`n`&&ym[2]===`-`:!1}e.isDefaultVariant=n;function r(){return ym===`en`}e.isDefault=r})(bm||={});var xm=typeof mm.postMessage==`function`&&!mm.importScripts;(()=>{if(xm){let e=[];mm.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n{let r=++t;e.push({id:r,callback:n}),mm.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var Sm=!!(vm&&vm.indexOf(`Chrome`)>=0);vm&&vm.indexOf(`Firefox`),!Sm&&vm&&vm.indexOf(`Safari`),vm&&vm.indexOf(`Edg/`),vm&&vm.indexOf(`Android`);var Cm=typeof navigator==`object`?navigator:{};_m||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||Cm&&Cm.clipboard&&Cm.clipboard.writeText,_m||Cm&&Cm.clipboard&&Cm.clipboard.readText,_m||sm()||Cm.keyboard,`ontouchstart`in em||Cm.maxTouchPoints,em.PointerEvent&&(`ontouchstart`in em||navigator.maxTouchPoints);var wm=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Tm=new wm,Em=new wm,Dm=new wm;Array(230);var Om;(e=>{function t(e){return Tm.keyCodeToStr(e)}e.toString=t;function n(e){return Tm.strToKeyCode(e)}e.fromString=n;function r(e){return Em.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return Dm.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return Em.strToKeyCode(e)||Dm.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return Tm.keyCodeToStr(e)}e.toElectronAccelerator=o})(Om||={});var km=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),Am;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof jm?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Lf.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:km})})(Am||={});var jm=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?km:(this._emitter||=new Z,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var Mm;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(Mm||={});var Nm=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Z,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};Nm.EMPTY=Nm.fromArray([]);function Pm(e){return 55296<=e&&e<=56319}function Fm(e){return 56320<=e&&e<=57343}function Im(e,t){return(e-55296<<10)+(t-56320)+65536}function Lm(e){return Rm(e,0)}function Rm(e,t){switch(typeof e){case`object`:return e===null?zm(349,t):Array.isArray(e)?Hm(e,t):Um(e,t);case`string`:return Vm(e,t);case`boolean`:return Bm(e,t);case`number`:return zm(e,t);case`undefined`:return zm(937,t);default:return zm(617,t)}}function zm(e,t){return(t<<5)-t+e|0}function Bm(e,t){return zm(e?433:863,t)}function Vm(e,t){t=zm(149417,t);for(let n=0,r=e.length;nRm(t,e),t)}function Um(e,t){return t=zm(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=Vm(n,t),Rm(e[n],t)),t)}function Wm(e,t,n=32){let r=n-t,i=~((1<>>r)>>>0}function Gm(e,t=0,n=e.byteLength,r=0){for(let i=0;ie.toString(16).padStart(2,`0`)).join(``):Km((e>>>0).toString(16),t/4)}var Jm=class e{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){let t=e.length;if(t===0)return;let n=this._buff,r=this._buffLen,i=this._leftoverHighSurrogate,a,o;for(i===0?(a=e.charCodeAt(0),o=0):(a=i,o=-1,i=0);;){let s=a;if(Pm(a))if(o+1>>6,e[t++]=128|(n&63)>>>0):n<65536?(e[t++]=224|(n&61440)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0):(e[t++]=240|(n&1835008)>>>18,e[t++]=128|(n&258048)>>>12,e[t++]=128|(n&4032)>>>6,e[t++]=128|(n&63)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),qm(this._h0)+qm(this._h1)+qm(this._h2)+qm(this._h3)+qm(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,Gm(this._buff,this._buffLen),this._buffLen>56&&(this._step(),Gm(this._buff));let e=8*this._totalLen;this._buffDV.setUint32(56,Math.floor(e/4294967296),!1),this._buffDV.setUint32(60,e%4294967296,!1),this._step()}_step(){let t=e._bigBlock32,n=this._buffDV;for(let e=0;e<64;e+=4)t.setUint32(e,n.getUint32(e,!1),!1);for(let e=64;e<320;e+=4)t.setUint32(e,Wm(t.getUint32(e-12,!1)^t.getUint32(e-32,!1)^t.getUint32(e-56,!1)^t.getUint32(e-64,!1),1),!1);let r=this._h0,i=this._h1,a=this._h2,o=this._h3,s=this._h4,c,l,u;for(let e=0;e<80;e++)e<20?(c=i&a|~i&o,l=1518500249):e<40?(c=i^a^o,l=1859775393):e<60?(c=i&a|i&o|a&o,l=2400959708):(c=i^a^o,l=3395469782),u=Wm(r,5)+c+s+l+t.getUint32(e*4,!1)&4294967295,s=o,o=a,a=Wm(i,30),i=r,r=u;this._h0=this._h0+r&4294967295,this._h1=this._h1+i&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+o&4294967295,this._h4=this._h4+s&4294967295}};Jm._bigBlock32=new DataView(new ArrayBuffer(320));var{registerWindow:Ym,getWindow:Xm,getDocument:Zm,getWindows:Qm,getWindowsCount:$m,getWindowId:eh,getWindowById:th,hasWindow:nh,onDidRegisterWindow:rh,onWillUnregisterWindow:ih,onDidUnregisterWindow:ah}=function(){let e=new Map,t={window:em,disposables:new xd};e.set(em.vscodeWindowId,t);let n=new Z,r=new Z,i=new Z;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return Sd.None;let a=new xd,o={window:t,disposables:a.add(new xd)};return e.set(t.vscodeWindowId,o),a.add(yd(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(sh(t,lh.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:em},getDocument(e){return Xm(e).document}}}(),oh=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function sh(e,t,n,r){return new oh(e,t,n,r)}var ch=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};ch.None=new ch(0,0),new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=Lm(n),a=r.get(i);if(a)a.users+=1;else{let o=new Z,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(yd(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var lh={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:am?`webkitAnimationStart`:`animationstart`,ANIMATION_END:am?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:am?`webkitAnimationIteration`:`animationiteration`},uh=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;function dh(e,t,n,...r){let i=uh.exec(t);if(!i)throw Error(`Bad use of emmet`);let a=i[1]||`div`,o;return o=e===`http://www.w3.org/1999/xhtml`?document.createElement(a):document.createElementNS(e,a),i[3]&&(o.id=i[3]),i[4]&&(o.className=i[4].replace(/\./g,` `).trim()),n&&Object.entries(n).forEach(([e,t])=>{typeof t>`u`||(/^on\w+$/.test(e)?o[e]=t:e===`selected`?t&&o.setAttribute(e,`true`):o.setAttribute(e,t))}),o.append(...r),o}function fh(e,t,...n){return dh(`http://www.w3.org/1999/xhtml`,e,t,...n)}fh.SVG=function(e,t,...n){return dh(`http://www.w3.org/2000/svg`,e,t,...n)};var ph=class extends Sd{constructor(e,t,n,r,i,a,o,s,c){super(),this._terminal=e,this._characterJoinerService=t,this._charSizeService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._optionsService=o,this._themeService=s,this._cursorBlinkStateManager=new Cd,this._charAtlasDisposable=this._register(new Cd),this._observerDisposable=this._register(new Cd),this._model=new Lp,this._workCell=new gp,this._workCell2=new gp,this._rectangleRenderer=this._register(new Cd),this._glyphRenderer=this._register(new Cd),this._onChangeTextureAtlas=this._register(new Z),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Z),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Z),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Z),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Z),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`);let l={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext(`webgl2`,l),!this._gl)throw Error(`WebGL2 not supported `+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new sf(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new $p(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=Xd(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(sh(this._canvas,`webglcontextlost`,e=>{console.log(`webglcontextlost event received`),e.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn(`webgl context not restored; firing onContextLoss`),this._onContextLoss.fire(e)},3e3)})),this._register(sh(this._canvas,`webglcontextrestored`,e=>{console.warn(`webglcontextrestored event received`),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,dp(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=mp(this._canvas,this._coreBrowserService.window,(e,t)=>this._setCanvasDevicePixelDimensions(e,t)),this._register(this._coreBrowserService.onWindowChange(e=>{this._observerDisposable.value=mp(this._canvas,e,(e,t)=>this._setCanvasDevicePixelDimensions(e,t))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(yd(()=>{for(let e of this._renderLayers)e.dispose();this._canvas.parentElement?.removeChild(this._canvas),dp(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,t){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let e of this._renderLayers)e.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,t,n){for(let r of this._renderLayers)r.handleSelectionChanged(this._terminal,e,t,n);this._model.selection.update(this._core,e,t,n),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new Zp(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new kp(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=up(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=vd(Lf.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Lf.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,t){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let n of this._renderLayers)n.handleGridChanged(this._terminal,e,t);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,t),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new pp(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,t){let n=this._core,r=this._workCell,i,a,o,s,c,l,u=0,d=!0,f,p,m,h,g,_,v,y,b;e=hh(e,n.rows-1,0),t=hh(t,n.rows-1,0);let x=this._coreService.decPrivateModes.cursorStyle??n.options.cursorStyle??`block`,S=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ee=S-n.buffer.ydisp,te=Math.min(this._terminal.buffer.active.cursorX,n.cols-1),C=-1,w=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let T=!1;for(a=e;a<=t;a++)for(o=a+n.buffer.ydisp,s=n.buffer.lines.get(o),this._model.lineLengths[a]=0,m=S===o,u=0,c=this._characterJoinerService.getJoinedCharacters(o),y=0;y=u,f=y,c.length>0&&y===c[0][0]&&d){p=c.shift();let e=this._model.selection.isCellSelected(this._terminal,p[0],o);for(v=p[0]+1;v=p[1],d?(l=!0,r=new mh(r,s.translateToString(!0,p[0],p[1]),p[1]-p[0]),f=p[1]-1):u=p[1]}if(h=r.getChars(),g=r.getCode(),v=(a*n.cols+y)*Mp,this._cellColorResolver.resolve(r,y,o,this.dimensions.device.cell.width),w&&o===S&&(y===te&&(this._model.cursor={x:te,y:ee,width:r.getWidth(),style:this._coreBrowserService.isFocused?x:n.options.cursorInactiveStyle,cursorWidth:n.options.cursorWidth,dpr:this._devicePixelRatio},C=te+r.getWidth()-1),y>=te&&y<=C&&(this._coreBrowserService.isFocused&&x===`block`||this._coreBrowserService.isFocused===!1&&n.options.cursorInactiveStyle===`block`)&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),g!==0&&(this._model.lineLengths[a]=y+1),!(this._model.cells[v]===g&&this._model.cells[v+Np]===this._cellColorResolver.result.bg&&this._model.cells[v+Pp]===this._cellColorResolver.result.fg&&this._model.cells[v+Fp]===this._cellColorResolver.result.ext)&&(T=!0,h.length>1&&(g|=Ip),this._model.cells[v]=g,this._model.cells[v+Np]=this._cellColorResolver.result.bg,this._model.cells[v+Pp]=this._cellColorResolver.result.fg,this._model.cells[v+Fp]=this._cellColorResolver.result.ext,_=r.getWidth(),this._glyphRenderer.value.updateCell(y,a,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,h,_,i),l)){for(r=this._workCell,y++;y<=f;y++)b=(a*n.cols+y)*Mp,this._glyphRenderer.value.updateCell(y,a,0,0,0,0,jd,0,0),this._model.cells[b]=0,this._model.cells[b+Np]=this._cellColorResolver.result.bg,this._model.cells[b+Pp]=this._cellColorResolver.result.fg,this._model.cells[b+Fp]=this._cellColorResolver.result.ext;y--}}T&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,t){this._canvas.width===e&&this._canvas.height===t||(this._canvas.width=e,this._canvas.height=t,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},mh=class extends kf{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function hh(e,t,n=0){return Math.max(Math.min(e,t),n)}var gh=`di$target`,_h=`di$dependencies`,vh=new Map;function yh(e){if(vh.has(e))return vh.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);bh(t,e,r)};return t._id=e,vh.set(e,t),t}function bh(e,t,n){t[gh]===t?t[_h].push({id:e,index:n}):(t[_h]=[{id:e,index:n}],t[gh]=t)}yh(`BufferService`),yh(`CoreMouseService`),yh(`CoreService`),yh(`CharsetService`),yh(`InstantiationService`),yh(`LogService`);var xh=yh(`OptionsService`);yh(`OscLinkService`),yh(`UnicodeService`),yh(`DecorationService`);var Sh={trace:0,debug:1,info:2,warn:3,error:4,off:5},Ch=`xterm.js: `,wh=class extends Sd{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),Th=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=Sh[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;tthis.activate(e)));return}this._terminal=e;let n=t.coreService,r=t.optionsService,i=t,a=i._renderService,o=i._characterJoinerService,s=i._charSizeService,c=i._coreBrowserService,l=i._decorationService;i._logService;let u=i._themeService;this._renderer=this._register(new ph(e,o,s,c,n,l,r,u,this._preserveDrawingBuffer)),this._register(Lf.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Lf.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Lf.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Lf.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),a.setRenderer(this._renderer),this._register(yd(()=>{if(this._terminal._core._store._isDisposed)return;let t=this._terminal._core._renderService;t.setRenderer(this._terminal._core._createRenderer()),t.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},Dh=class{aliases;usage;matches(e){let t=e.toLowerCase();return t===this.name.toLowerCase()||(this.aliases?.some(e=>t===e.toLowerCase())??!1)}writeLine(e,t,n){n?e.writeln(`${n}${t}\x1b[0m`):e.writeln(t)}writeSuccess(e,t){e.writeln(`\x1b[1;32m✓\x1b[0m ${t}`)}writeError(e,t){e.writeln(`\x1b[1;31m✗ Error:\x1b[0m ${t}`)}writeInfo(e,t){e.writeln(`\x1b[90m${t}\x1b[0m`)}startLoading(e,t){let n=[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`],r=0,i=!0,a=setInterval(()=>{if(!i){clearInterval(a);return}e.write(`\r\x1b[36m${n[r]}\x1b[0m ${t}`),r=(r+1)%n.length},80);return()=>{i=!1,clearInterval(a),e.write(`\r\x1B[K`)}}},Oh=class extends Dh{name=`help`;description=`Show available commands`;aliases=[`?`,`h`];constructor(e){super(),this.commands=e}execute({term:e,writePrompt:t}){e.writeln(``),e.writeln(`\x1B[1;33mAvailable Commands:\x1B[0m`),e.writeln(``),this.commands.forEach(t=>{let n=t.aliases?.length?` (${t.aliases.join(`, `)})`:``;e.writeln(` \x1b[1;36m${t.name.padEnd(15)}\x1b[0m ${t.description}${n}`)}),e.writeln(``),e.writeln(`\x1B[90mTip: Use Tab for autocomplete, ↑↓ for history, Ctrl+F to search\x1B[0m`),t()}},kh=class extends Dh{name=`clear`;description=`Clear terminal screen`;aliases=[`cls`];execute({term:e,writePrompt:t}){e.clear(),t()}},Ah=class extends Dh{name=`status`;description=`Show repeater status`;aliases=[`st`];async execute({term:e,writePrompt:t}){let n=this.startLoading(e,`Fetching status...`);try{let t=await f.get(`/stats`);n();let r=t.success&&t.data?t.data:t;if(r&&typeof r==`object`){this.writeSuccess(e,`Repeater Status:`),e.writeln(``);for(let[t,n]of Object.entries(r))e.writeln(` \x1b[36m${t.padEnd(20)}\x1b[0m ${n}`)}else this.writeError(e,`No status data available`)}catch(t){n(),this.writeError(e,t instanceof Error?t.message:`Failed to fetch status`)}t()}},jh=class extends Dh{name=`uptime`;description=`Show system uptime`;async execute({term:e,writePrompt:t}){let n=this.startLoading(e,`Fetching uptime...`);try{let t=await f.get(`/stats`);n();let r=(t.data||t).uptime_seconds||0,i=this.formatUptime(r);this.writeSuccess(e,i)}catch(t){n(),this.writeError(e,`Failed to get uptime: ${t}`)}t()}formatUptime(e){let t=Math.floor(e/86400),n=Math.floor(e%86400/3600),r=Math.floor(e%3600/60);return t>0?`${t}d ${n}h ${r}m`:n>0?`${n}h ${r}m`:`${r}m`}},Mh=class extends Dh{name=`packets`;description=`Show packet statistics`;isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:e,writePrompt:t}){let n=this.startLoading(e,`Fetching packet stats...`);try{let t=await f.get(`/stats`);n();let r=t.data||t;this.writeLine(e,``),this.isMobile()?(this.writeLine(e,` \x1B[1;36mPacket Statistics\x1B[0m`),this.writeLine(e,` \x1B[90mRX:\x1B[0m `+(r.rx_count||0)),this.writeLine(e,` \x1B[90mTX:\x1B[0m `+(r.tx_count||0)),this.writeLine(e,` \x1B[90mForward:\x1B[0m `+(r.forwarded_count||0)),this.writeLine(e,` \x1B[90mDropped:\x1B[0m `+(r.dropped_count||0))):(this.writeLine(e,` \x1B[36m┌──────────┬──────────┐\x1B[0m`),this.writeLine(e,` \x1B[36m│\x1B[0m \x1B[1mMetric\x1B[0m \x1B[36m│\x1B[0m \x1B[1mCount\x1B[0m \x1B[36m│\x1B[0m`),this.writeLine(e,` \x1B[36m├──────────┼──────────┤\x1B[0m`),this.writeLine(e,` \x1b[36m│\x1b[0m RX \x1b[36m│\x1b[0m ${String(r.rx_count||0).padStart(8)} \x1b[36m│\x1b[0m`),this.writeLine(e,` \x1b[36m│\x1b[0m TX \x1b[36m│\x1b[0m ${String(r.tx_count||0).padStart(8)} \x1b[36m│\x1b[0m`),this.writeLine(e,` \x1b[36m│\x1b[0m Forward \x1b[36m│\x1b[0m ${String(r.forwarded_count||0).padStart(8)} \x1b[36m│\x1b[0m`),this.writeLine(e,` \x1b[36m│\x1b[0m Dropped \x1b[36m│\x1b[0m ${String(r.dropped_count||0).padStart(8)} \x1b[36m│\x1b[0m`),this.writeLine(e,` \x1B[36m└──────────┴──────────┘\x1B[0m`)),this.writeLine(e,``)}catch(t){n(),this.writeError(e,`Failed to get packet stats: ${t}`)}t()}},Nh=class extends Dh{name=`board`;description=`Show board information`;async execute({term:e,writePrompt:t}){let n=this.startLoading(e,`Fetching board info...`);try{let t=await f.get(`/stats`);n();let r=(t.data||t).board_info||`pyMC_Repeater (Linux/RPi)`;this.writeSuccess(e,r)}catch{n(),this.writeSuccess(e,`pyMC_Repeater (Linux/RPi)`)}t()}},Ph=class extends Dh{name=`advert`;description=`Send neighbor advert immediately`;async execute({term:e,writePrompt:t}){let n=this.startLoading(e,`Sending advert...`);try{let t=await f.post(`/send_advert`,{},{timeout:1e4});n(),t.success?this.writeSuccess(e,t.data||`Advert sent successfully`):this.writeError(e,t.error||`Failed to send advert`)}catch(t){n(),this.writeError(e,`Failed to send advert: ${t}`)}t()}},Fh=class extends Dh{name=`get`;description=`Get configuration values (name, freq, tx, mode, duty, etc.)`;matches(e){let t=e.toLowerCase();return t===`get`||t.startsWith(`get `)}async execute({term:e,args:t,writePrompt:n}){let r=t[0]?.toLowerCase();if(!r){this.writeError(e,`Usage: get `),this.writeLine(e,``),this.writeInfo(e,`Available parameters:`),this.writeLine(e,``),this.writeLine(e,` \x1B[36mname\x1B[0m Node name`),this.writeLine(e,` \x1B[36mrole\x1B[0m Node role`),this.writeLine(e,` \x1B[36mlat\x1B[0m Latitude`),this.writeLine(e,` \x1B[36mlon\x1B[0m Longitude`),this.writeLine(e,` \x1B[36mfreq\x1B[0m Frequency (MHz)`),this.writeLine(e,` \x1B[36mtx\x1B[0m TX power (dBm)`),this.writeLine(e,` \x1B[36mbw\x1B[0m Bandwidth (kHz)`),this.writeLine(e,` \x1B[36msf\x1B[0m Spreading factor`),this.writeLine(e,` \x1B[36mcr\x1B[0m Coding rate`),this.writeLine(e,` \x1B[36mradio\x1B[0m All radio settings`),this.writeLine(e,` \x1B[36mtxdelay\x1B[0m TX delay factor`),this.writeLine(e,` \x1B[36mdirect.txdelay\x1B[0m Direct TX delay`),this.writeLine(e,` \x1B[36mrxdelay\x1B[0m RX delay base`),this.writeLine(e,` \x1B[36maf\x1B[0m Airtime factor`),this.writeLine(e,` \x1B[36mmode\x1B[0m Repeater mode`),this.writeLine(e,` \x1B[36mrepeat\x1B[0m Repeat on/off`),this.writeLine(e,` \x1B[36mflood.max\x1B[0m Max flood hops`),this.writeLine(e,` \x1B[36madvert.interval\x1B[0m Advert interval`),this.writeLine(e,` \x1B[36mduty\x1B[0m Duty cycle enabled`),this.writeLine(e,` \x1B[36mduty.max\x1B[0m Max airtime %`),this.writeLine(e,` \x1B[36mpublic.key\x1B[0m Public key`),this.writeLine(e,``),n();return}let i=this.startLoading(e,`Fetching configuration...`);try{let t=await f.get(`/stats`);i();let a=t.data||t,o=a.config||{},s=o.radio||{},c=o.repeater||{},l=o.delays||{},u=o.duty_cycle||{},d=``;switch(r){case`name`:d=o.node_name||`Unknown`;break;case`role`:d=`repeater`;break;case`lat`:d=c.latitude==null?`not set`:String(c.latitude);break;case`lon`:d=c.longitude==null?`not set`:String(c.longitude);break;case`freq`:d=s.frequency?`${(s.frequency/1e6).toFixed(3)} MHz`:`?`;break;case`tx`:d=s.tx_power==null?`?`:`${s.tx_power}dBm`;break;case`bw`:d=s.bandwidth?`${s.bandwidth/1e3} kHz`:`?`;break;case`sf`:d=s.spreading_factor==null?`?`:String(s.spreading_factor);break;case`cr`:d=s.coding_rate==null?`?`:`4/${s.coding_rate}`;break;case`radio`:if(s.frequency){this.writeSuccess(e,`Radio Configuration:`),this.writeLine(e,``),this.writeLine(e,` \x1b[36mFrequency:\x1b[0m ${(s.frequency/1e6).toFixed(3)} MHz`),this.writeLine(e,` \x1b[36mBandwidth:\x1b[0m ${s.bandwidth/1e3} kHz`),this.writeLine(e,` \x1b[36mSpreading Factor:\x1b[0m ${s.spreading_factor}`),this.writeLine(e,` \x1b[36mCoding Rate:\x1b[0m 4/${s.coding_rate}`),this.writeLine(e,` \x1b[36mTX Power:\x1b[0m ${s.tx_power}dBm`),this.writeLine(e,``),n();return}else d=`Radio configuration not available`;break;case`af`:case`txdelay`:d=l.tx_delay_factor==null?`\x1B[90mnot set (default: 1.0)\x1B[0m`:String(l.tx_delay_factor);break;case`direct.txdelay`:d=l.direct_tx_delay_factor==null?`\x1B[90mnot set (default: 0.5)\x1B[0m`:String(l.direct_tx_delay_factor);break;case`rxdelay`:d=l.rx_delay_base==null?`\x1B[90mnot set (default: 0.0s)\x1B[0m`:`${l.rx_delay_base}s`;break;case`mode`:d=c.mode==null?`\x1B[90mnot set (default: forward)\x1B[0m`:c.mode;break;case`repeat`:d=c.mode==null?`\x1B[90mnot set (default: on)\x1B[0m`:c.mode===`forward`?`on`:`off`;break;case`flood.max`:d=c.max_flood_hops==null?`\x1B[90mnot set (default: 3)\x1B[0m`:String(c.max_flood_hops);break;case`flood.advert.interval`:d=c.send_advert_interval_hours==null?`\x1B[90mnot set\x1B[0m`:`${c.send_advert_interval_hours}h`;break;case`advert.interval`:d=c.advert_interval_minutes==null?`\x1B[90mnot set (default: 120m)\x1B[0m`:`${c.advert_interval_minutes}m`;break;case`duty`:case`duty.enabled`:d=u.enforcement_enabled==null?`\x1B[90mnot set (default: off)\x1B[0m`:u.enforcement_enabled?`on`:`off`;break;case`duty.max`:d=u.max_airtime_percent==null?`\x1B[90mnot set\x1B[0m`:`${u.max_airtime_percent}%`;break;case`public.key`:d=a.public_key||`\x1B[90mnot available\x1B[0m`;break;case`prv.key`:this.writeWarning(e,`Private key not exposed via API for security`),this.writeInfo(e,`Check /etc/pymc_repeater/config.yaml`),n();return;case`guest.password`:case`allow.read.only`:this.writeWarning(e,`Security settings not exposed via API`),this.writeInfo(e,`Check /etc/pymc_repeater/config.yaml`),n();return;default:this.writeError(e,`Unknown parameter: ${r}`),this.writeLine(e,``),this.writeInfo(e,`Available parameters:`),this.writeInfo(e,` Identity: name, role, lat, lon`),this.writeInfo(e,` Radio: freq, tx, bw, sf, cr, radio`),this.writeInfo(e,` Timing: txdelay, direct.txdelay, rxdelay, af`),this.writeInfo(e,` Repeater: mode, repeat, flood.max, advert.interval`),this.writeInfo(e,` Duty: duty, duty.max`),this.writeInfo(e,` Security: public.key`),n();return}this.writeSuccess(e,d)}catch(t){i(),this.writeError(e,`Failed to get ${r}: ${t}`)}n()}writeWarning(e,t){e.writeln(`\x1b[1;33m⚠ Warning:\x1b[0m ${t}`)}},Ih=class extends Dh{name=`set`;description=`Set configuration values (tx, txdelay, mode, duty, etc.)`;matches(e){let t=e.toLowerCase();return t===`set`||t.startsWith(`set `)}async execute({term:e,args:t,writePrompt:n}){let r=t[0]?.toLowerCase(),i=t.slice(1).join(` `).trim();if(!r){this.writeError(e,`Usage: set `),this.writeLine(e,``),this.writeInfo(e,`Available parameters:`),this.writeLine(e,``),this.writeLine(e,` \x1B[33mRadio:\x1B[0m`),this.writeLine(e,` \x1B[36mtx <2-30>\x1B[0m TX power in dBm`),this.writeLine(e,` \x1B[36mfreq \x1B[0m Frequency (100-1000 MHz) *restart required*`),this.writeLine(e,` \x1B[36mbw \x1B[0m Bandwidth (7.8-500 kHz) *restart required*`),this.writeLine(e,` \x1B[36msf <5-12>\x1B[0m Spreading factor *restart required*`),this.writeLine(e,` \x1B[36mcr <5-8>\x1B[0m Coding rate (for 4/5 to 4/8) *restart required*`),this.writeLine(e,``),this.writeLine(e,` \x1B[33mTiming:\x1B[0m`),this.writeLine(e,` \x1B[36mtxdelay <0.0-5.0>\x1B[0m TX delay factor`),this.writeLine(e,` \x1B[36mdirect.txdelay <0.0-5.0>\x1B[0m Direct TX delay factor`),this.writeLine(e,` \x1B[36mrxdelay \x1B[0m RX delay base (>= 0)`),this.writeLine(e,``),this.writeLine(e,` \x1B[33mIdentity:\x1B[0m`),this.writeLine(e,` \x1B[36mname \x1B[0m Node name`),this.writeLine(e,` \x1B[36mlat <-90 to 90>\x1B[0m Latitude`),this.writeLine(e,` \x1B[36mlon <-180 to 180>\x1B[0m Longitude`),this.writeLine(e,``),this.writeLine(e,` \x1B[33mRepeater:\x1B[0m`),this.writeLine(e,` \x1B[36mmode \x1B[0m Repeater mode`),this.writeLine(e,` \x1B[36mduty \x1B[0m Duty cycle enforcement`),this.writeLine(e,` \x1B[36mflood.max <0-64>\x1B[0m Max flood hops`),this.writeLine(e,` \x1B[36madvert.interval \x1B[0m Local advert interval`),this.writeLine(e,``),n();return}let a=this.startLoading(e,`Updating configuration...`);try{let t;switch(r){case`tx`:{let r=parseInt(i);if(isNaN(r)||r<2||r>30){a(),this.writeError(e,`TX power must be 2-30 dBm`),n();return}t=await f.post(`/update_radio_config`,{tx_power:r},{timeout:3e4});break}case`freq`:{let r=parseFloat(i);if(isNaN(r)||r<100||r>1e3){a(),this.writeError(e,`Frequency must be 100-1000 MHz`),n();return}t=await f.post(`/update_radio_config`,{frequency:r*1e6},{timeout:3e4});break}case`bw`:{let r=parseFloat(i),o=[7.8,10.4,15.6,20.8,31.25,41.7,62.5,125,250,500];if(isNaN(r)||!o.includes(r)){a(),this.writeError(e,`Bandwidth must be one of: ${o.join(`, `)} kHz`),n();return}t=await f.post(`/update_radio_config`,{bandwidth:r*1e3},{timeout:3e4});break}case`sf`:{let r=parseInt(i);if(isNaN(r)||r<5||r>12){a(),this.writeError(e,`Spreading factor must be 5-12`),n();return}t=await f.post(`/update_radio_config`,{spreading_factor:r},{timeout:3e4});break}case`cr`:{let r=parseInt(i);if(isNaN(r)||r<5||r>8){a(),this.writeError(e,`Coding rate must be 5-8 (for 4/5 to 4/8)`),n();return}t=await f.post(`/update_radio_config`,{coding_rate:r},{timeout:3e4});break}case`af`:case`txdelay`:{let r=parseFloat(i);if(isNaN(r)||r<0||r>5){a(),this.writeError(e,`TX delay factor must be 0.0-5.0`),n();return}t=await f.post(`/update_radio_config`,{tx_delay_factor:r},{timeout:3e4});break}case`direct.txdelay`:{let r=parseFloat(i);if(isNaN(r)||r<0||r>5){a(),this.writeError(e,`Direct TX delay factor must be 0.0-5.0`),n();return}t=await f.post(`/update_radio_config`,{direct_tx_delay_factor:r},{timeout:3e4});break}case`rxdelay`:{let r=parseFloat(i);if(isNaN(r)||r<0){a(),this.writeError(e,`RX delay must be >= 0`),n();return}t=await f.post(`/update_radio_config`,{rx_delay_base:r},{timeout:3e4});break}case`name`:if(!i.trim()){a(),this.writeError(e,`Node name cannot be empty`),n();return}t=await f.post(`/update_radio_config`,{node_name:i.trim()},{timeout:3e4});break;case`lat`:{let r=parseFloat(i);if(isNaN(r)||r<-90||r>90){a(),this.writeError(e,`Latitude must be -90 to 90`),n();return}t=await f.post(`/update_radio_config`,{latitude:r},{timeout:3e4});break}case`lon`:{let r=parseFloat(i);if(isNaN(r)||r<-180||r>180){a(),this.writeError(e,`Longitude must be -180 to 180`),n();return}t=await f.post(`/update_radio_config`,{longitude:r},{timeout:3e4});break}case`mode`:{let r=i.toLowerCase();if(r!==`forward`&&r!==`monitor`&&r!==`no_tx`){a(),this.writeError(e,`Mode must be "forward", "monitor", or "no_tx"`),this.writeLine(e,``),this.writeInfo(e,`Valid values:`),this.writeLine(e,` \x1B[36mforward\x1B[0m - Forward packets`),this.writeLine(e,` \x1B[36mmonitor\x1B[0m - Monitor only (no forwarding)`),this.writeLine(e,` \x1B[36mno_tx\x1B[0m - No repeat, no local TX; adverts skipped`),n();return}t=await f.post(`/set_mode`,{mode:r},{timeout:3e4}),t.data&&(t.data.applied=[`mode=${r}`],t.data.persisted=!0,t.data.live_update=!0);break}case`duty`:{let r=i.toLowerCase();if(r!==`on`&&r!==`off`){a(),this.writeError(e,`Duty cycle must be "on" or "off"`),this.writeLine(e,``),this.writeInfo(e,`Valid values:`),this.writeLine(e,` \x1B[36mon\x1B[0m - Enable duty cycle enforcement`),this.writeLine(e,` \x1B[36moff\x1B[0m - Disable duty cycle enforcement`),n();return}let o=r===`on`;t=await f.post(`/set_duty_cycle`,{enabled:o},{timeout:3e4}),t.data&&(t.data.applied=[`duty=${r}`],t.data.persisted=!0,t.data.live_update=!0);break}case`flood.max`:{let r=parseInt(i);if(isNaN(r)||r<0||r>64){a(),this.writeError(e,`Max flood hops must be 0-64`),n();return}t=await f.post(`/update_radio_config`,{max_flood_hops:r},{timeout:3e4});break}case`flood.advert.interval`:{let r=parseInt(i);if(isNaN(r)||r!==0&&(r<3||r>48)){a(),this.writeError(e,`Flood advert interval must be 0 (off) or 3-48 hours`),n();return}t=await f.post(`/update_radio_config`,{flood_advert_interval_hours:r},{timeout:3e4});break}case`advert.interval`:{let r=parseInt(i);if(isNaN(r)||r!==0&&(r<1||r>10080)){a(),this.writeError(e,`Advert interval must be 0 (off) or 1-10080 minutes`),n();return}t=await f.post(`/update_radio_config`,{advert_interval_minutes:r},{timeout:3e4});break}case`log`:a(),this.writeWarning(e,`Log level configuration not yet implemented`),this.writeInfo(e,`Backend endpoint /set_log_level does not exist`),n();return;default:a(),this.writeError(e,`Unknown parameter: ${r}`),this.writeLine(e,``),this.writeInfo(e,`Type "set" without arguments to see available parameters`),n();return}a();let o=t.data||t;t.success?(o.applied&&o.applied.length>0?this.writeSuccess(e,`Configuration updated: ${o.applied.join(`, `)}`):this.writeSuccess(e,`Configuration updated`),o.restart_required?(this.writeLine(e,``),this.writeWarning(e,`⚠ Service restart required for changes to take effect`),this.writeInfo(e,`Run: sudo systemctl restart pymc_repeater`)):o.message&&!o.live_update&&(this.writeLine(e,``),this.writeInfo(e,o.message))):this.writeError(e,t.error||`Failed to update configuration`)}catch(t){a(),this.writeError(e,`Failed to update ${r}: ${t}`)}this.writeLine(e,``),n()}writeWarning(e,t){e.writeln(`\x1b[1;33m⚠ Warning:\x1b[0m ${t}`)}},Lh=class extends Dh{name=`identities`;description=`List all identities`;aliases=[`id`,`ids`];isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:e,writePrompt:t}){let n=this.startLoading(e,`Fetching identities...`);try{let t=await f.getIdentities();n();let r=[];if(t.success&&t.data){let e=t.data,n=e.registered||[],i=e.configured||[];r=i.length>0?i:n}else Array.isArray(t)&&(r=t);r.length===0?this.writeInfo(e,`No identities found`):(this.writeSuccess(e,`Found \x1b[1m${r.length}\x1b[0m identit${r.length===1?`y`:`ies`}`),e.writeln(``),this.isMobile()?r.forEach((t,n)=>{e.writeln(`\x1b[1;36m[${n+1}] ${t.name||`Unnamed`}\x1b[0m`),e.writeln(` \x1b[90mType:\x1b[0m ${t.type||`-`}`),e.writeln(` \x1b[90mHash:\x1b[0m ${t.hash||`-`}`),e.writeln(` \x1b[90mAddress:\x1b[0m ${t.address||`-`}`),e.writeln(` \x1b[90mRegistered:\x1b[0m ${t.registered?`\x1B[32myes\x1B[0m`:`\x1B[31mno\x1B[0m`}`),n{let r=(n+1).toString().padEnd(2),i=(t.name||`Unnamed`).padEnd(27),a=(t.type||`-`).padEnd(13),o=(t.hash||`-`).padEnd(4),s=(t.address||`-`).padEnd(7),c=(t.registered?`yes`:`no`).padEnd(10);e.writeln(`\x1b[36m│\x1b[0m ${r} \x1b[36m│\x1b[0m \x1b[1m${i}\x1b[0m \x1b[36m│\x1b[0m ${a} \x1b[36m│\x1b[0m ${o} \x1b[36m│\x1b[0m ${s} \x1b[36m│\x1b[0m ${c} \x1b[36m│\x1b[0m`)}),e.writeln(`\x1B[36m└────┴─────────────────────────────┴───────────────┴──────┴─────────┴────────────┘\x1B[0m`)))}catch(t){n(),this.writeError(e,t instanceof Error?t.message:`Failed to fetch identities`)}t()}},Rh=class extends Dh{name=`keys`;description=`List transport keys`;async execute({term:e,writePrompt:t}){let n=this.startLoading(e,`Fetching transport keys...`);try{let t=await f.getTransportKeys();n();let r=t.success&&t.data?t.data:t,i=Array.isArray(r)?r:[];i.length===0?this.writeInfo(e,`No transport keys found`):(this.writeSuccess(e,`Found \x1b[1m${i.length}\x1b[0m transport key${i.length===1?``:`s`}`),e.writeln(``),i.forEach((t,n)=>{e.writeln(`\x1b[36m${(n+1).toString().padStart(2)}.\x1b[0m \x1b[1m${t.name||`Unnamed`}\x1b[0m`),t.flood_policy&&e.writeln(` Policy: \x1b[90m${t.flood_policy}\x1b[0m`),t.parent_id&&e.writeln(` Parent: \x1b[90m${t.parent_id}\x1b[0m`),n{if(e.writeln(`\x1b[1;36m[${n+1}] ${t.node_name||`Unknown`}\x1b[0m`),e.writeln(` \x1b[90mPubKey:\x1b[0m ${t.pubkey?.substring(0,8)||`----`}`),e.writeln(` \x1b[90mType:\x1b[0m ${t.contact_type||`-`}`),t.last_seen){let n=new Date(t.last_seen*1e3).toLocaleString(`en-US`,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1});e.writeln(` \x1b[90mLast Seen:\x1b[0m ${n}`)}t.rssi&&e.writeln(` \x1b[90mRSSI:\x1b[0m ${t.rssi}`),t.snr&&e.writeln(` \x1b[90mSNR:\x1b[0m ${t.snr}`),e.writeln(` \x1b[90mAdverts:\x1b[0m ${t.advert_count||0}`),e.writeln(` \x1b[90mDirect:\x1b[0m ${t.zero_hop?`\x1B[32myes\x1B[0m`:`\x1B[31mno\x1B[0m`}`),n{let r=(n+1).toString().padEnd(2),i=(t.node_name||`Unknown`).padEnd(20),a=(t.pubkey?.substring(0,4)||`----`).padEnd(6),o=(t.contact_type||`-`).padEnd(12),s=t.last_seen?new Date(t.last_seen*1e3).toLocaleString(`en-US`,{month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hour12:!1}).padEnd(20):`-`.padEnd(20),c=(t.rssi?`${t.rssi}`:`-`).padEnd(8),l=(t.snr?`${t.snr}`:`-`).padEnd(4),u=(t.advert_count?.toString()||`0`).padEnd(6),d=(t.zero_hop?`yes`:`no`).padEnd(6);e.writeln(`\x1b[36m│\x1b[0m ${r} \x1b[36m│\x1b[0m \x1b[1m${i}\x1b[0m \x1b[36m│\x1b[0m ${a} \x1b[36m│\x1b[0m ${o} \x1b[36m│\x1b[0m ${s} \x1b[36m│\x1b[0m ${c} \x1b[36m│\x1b[0m ${l} \x1b[36m│\x1b[0m ${u} \x1b[36m│\x1b[0m ${d} \x1b[36m│\x1b[0m`)}),e.writeln(`\x1B[36m└────┴──────────────────────┴────────┴──────────────┴──────────────────────┴──────────┴──────┴────────┴────────┘\x1B[0m`)),r.length>10&&(e.writeln(``),e.writeln(`\x1b[90m... and ${r.length-10} more neighbors\x1b[0m`)))}catch(t){n(),this.writeError(e,t instanceof Error?t.message:`Failed to fetch neighbors`)}t()}},Bh=class extends Dh{name=`acl`;description=`Show ACL statistics`;async execute({term:e,writePrompt:t}){let n=this.startLoading(e,`Fetching ACL stats...`);try{let t=await f.getACLStats();n();let r=t.success&&t.data?t.data:t;if(r&&typeof r==`object`){this.writeSuccess(e,`ACL Statistics:`),e.writeln(``);let t=(n,r=` `)=>{if(typeof n==`object`&&n&&!Array.isArray(n))for(let[i,a]of Object.entries(n))typeof a==`object`&&a?(e.writeln(`${r}\x1b[90m${i}:\x1b[0m`),t(a,r+` `)):e.writeln(`${r}\x1b[90m${i.padEnd(18)}\x1b[0m ${a}`);else e.writeln(`${r}${n}`)};for(let[n,i]of Object.entries(r))typeof i==`object`&&i?(e.writeln(` \x1b[36m${n}\x1b[0m`),t(i,` `)):e.writeln(` \x1b[36m${n.padEnd(20)}\x1b[0m ${i}`)}else this.writeError(e,`No ACL data available`)}catch(t){n(),this.writeError(e,t instanceof Error?t.message:`Failed to fetch ACL stats`)}t()}},Vh=class extends Dh{name=`rooms`;description=`List room servers`;isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)||window.innerWidth<768}async execute({term:e,writePrompt:t}){let n=this.startLoading(e,`Fetching room stats...`);try{let t=await f.getRoomStats();n();let r=[];t.success&&t.data?r=t.data.rooms||(Array.isArray(t.data)?t.data:[]):Array.isArray(t)&&(r=t),r.length===0?this.writeInfo(e,`No room servers found`):(this.writeSuccess(e,`Found \x1b[1m${r.length}\x1b[0m room server${r.length===1?``:`s`}`),e.writeln(``),this.isMobile()?r.forEach((t,n)=>{e.writeln(`\x1b[1;36m[${n+1}] ${t.room_name||`Unnamed`}\x1b[0m`),e.writeln(` \x1b[90mMessages:\x1b[0m ${t.total_messages||0}`),e.writeln(` \x1b[90mTotal Clients:\x1b[0m ${t.total_clients||0}`),e.writeln(` \x1b[90mActive Clients:\x1b[0m ${t.active_clients||0}`),e.writeln(` \x1b[90mSync:\x1b[0m ${t.sync_running?`\x1B[32mrunning\x1B[0m`:`\x1B[31mstopped\x1B[0m`}`),n{let r=(n+1).toString().padEnd(2),i=(t.room_name||`Unnamed`).padEnd(27),a=(t.total_messages?.toString()||`0`).padEnd(8),o=(t.total_clients?.toString()||`0`).padEnd(12),s=(t.active_clients?.toString()||`0`).padEnd(14),c=(t.sync_running?`running`:`stopped`).padEnd(8);e.writeln(`\x1b[36m│\x1b[0m ${r} \x1b[36m│\x1b[0m \x1b[1m${i}\x1b[0m \x1b[36m│\x1b[0m ${a} \x1b[36m│\x1b[0m ${o} \x1b[36m│\x1b[0m ${s} \x1b[36m│\x1b[0m ${c} \x1b[36m│\x1b[0m`)}),e.writeln(`\x1B[36m└────┴─────────────────────────────┴──────────┴──────────────┴────────────────┴──────────┘\x1B[0m`)))}catch(t){n(),this.writeError(e,t instanceof Error?t.message:`Failed to fetch room stats`)}t()}},Hh=class extends Dh{name=`restart`;description=`Restart the pymc-repeater service`;aliases=[`reboot`];matches(e){let t=e.toLowerCase();return t===`restart`||t===`reboot`}async execute({term:e,writePrompt:t}){this.writeLine(e,``),this.writeLine(e,`\x1B[33m⚠️ This will restart the repeater service!\x1B[0m`),this.writeLine(e,``),this.writeInfo(e,`Attempting to restart service...`);let n=this.startLoading(e,`Restarting...`);try{let t=await f.post(`/restart_service`,{},{timeout:1e4});n(),t.success?(this.writeLine(e,``),this.writeSuccess(e,t.message||`Service restart initiated`),this.writeLine(e,``),this.writeInfo(e,`The service will restart momentarily. You may need to refresh this page.`)):(this.writeLine(e,``),this.writeError(e,`Restart failed: `+(t.error||t.message||`Unknown error`)),this.writeLine(e,``),this.writeInfo(e,`You may need to manually restart: sudo systemctl restart pymc-repeater`))}catch(r){n(),this.writeLine(e,``);let i=r;if(i.code===`ERR_NETWORK`||i.message?.includes(`Network error`)||i.message?.includes(`ECONNRESET`)||i.code===`ECONNRESET`){this.writeSuccess(e,`Service restart initiated successfully`),this.writeLine(e,``),await this.waitForServiceRestart(e,t);return}else i.code===`ECONNABORTED`||i.message?.includes(`timeout`)?(this.writeLine(e,`\x1B[33m⚠️ Request timed out - service may be restarting\x1B[0m`),this.writeLine(e,``),this.writeInfo(e,`Refresh the page in a few seconds to reconnect.`)):i.response?.status===403||i.response?.status===401?(this.writeError(e,`Permission denied. Polkit rules may need configuration.`),this.writeLine(e,``),this.writeInfo(e,`Run: sudo bash -c 'mkdir -p /etc/polkit-1/rules.d && cat > /etc/polkit-1/rules.d/10-pymc-repeater.rules <0;t--)e.write(`\r\x1b[36m⏳\x1b[0m Restarting service... ${t}s`),await new Promise(e=>setTimeout(e,1e3));e.write(`\r\x1B[K`);let n=4,r=0;for(;n<20;){r++,e.write(` ⏳ Verifying restart (attempt ${r})... `);try{if((await fetch(`${window.location.protocol}//${window.location.host}/api/stats`,{signal:AbortSignal.timeout(3e3)})).ok){e.write(`\r\x1B[K`),this.writeLine(e,``),this.writeSuccess(e,`Service is back online! (took ~${n}s)`),this.writeLine(e,``),t();return}}catch(t){let n=t;n.code&&![`ERR_NETWORK`,`ECONNREFUSED`,`ECONNRESET`].includes(n.code)&&e.write(`[${n.code}] `)}await new Promise(e=>setTimeout(e,1*1e3)),n+=1}e.write(`\r\x1B[K`),this.writeLine(e,``),this.writeLine(e,`\x1B[33m⚠️ Service did not respond within 20 seconds\x1B[0m`),this.writeLine(e,``),this.writeInfo(e,`The service may still be starting. Try: status`),this.writeLine(e,``),t()}},Uh=class extends Dh{name=`ping`;description=`Ping a neighbor node to measure latency and signal quality`;usage=`ping [timeout_seconds]`;async execute({term:e,args:t,writePrompt:n}){if(t.length===0){this.writeError(e,`Missing target node`),e.writeln(``),this.writeInfo(e,`Usage: ${this.usage}`),e.writeln(``),this.writeInfo(e,`Examples:`),this.writeInfo(e,` ping MyNeighbor - Ping node by name`),this.writeInfo(e,` ping 0xb5 - Ping node by pubkey hash`),this.writeInfo(e,` ping MyNeighbor 20 - Ping with 20s timeout`),n();return}let r=t[0],i=t.length>1?parseInt(t[1]):10;if(isNaN(i)||i<1||i>60){this.writeError(e,`Invalid timeout. Must be between 1-60 seconds`),n();return}let a=null,o=r.match(/^(0x)?([0-9a-fA-F]{1,2})$/);if(o)a=`0x${o[2].padStart(2,`0`)}`;else{let t=this.startLoading(e,`Resolving target...`);try{let i=[`Chat Node`,`Repeater`,`Room Server`,`Hybrid Node`,`Unknown`],o=!1;for(let e of i)try{let t=await f.get(`/adverts_by_contact_type`,{contact_type:e,hours:168}),n=t.success&&t.data?t.data:t,i=(Array.isArray(n)?n:[]).find(e=>e.node_name&&e.node_name.toLowerCase()===r.toLowerCase());if(i&&i.pubkey){a=`0x${i.pubkey.substring(0,2)}`,o=!0;break}}catch{continue}if(t(),!o){this.writeError(e,`Node '${r}' not found in neighbors`),e.writeln(``),this.writeInfo(e,`Try: neighbors - to list available nodes`),n();return}}catch(r){t(),this.writeError(e,`Failed to resolve target: ${r}`),n();return}}this.writeLine(e,`\x1b[36mPinging ${r} (${a}) with ${i}s timeout...\x1b[0m`),e.writeln(``);let s=this.startLoading(e,`Waiting for response...`);try{let t=await f.pingNeighbor(a,i);if(s(),t.success&&t.data){let n=t.data;this.writeSuccess(e,`Reply from ${r} (${n.target_id})`),e.writeln(``);let i=`\x1B[32m`;if(n.rtt_ms>500?i=`\x1B[31m`:n.rtt_ms>250&&(i=`\x1B[33m`),e.writeln(` \x1b[1mRound-Trip Time:\x1b[0m ${i}${n.rtt_ms.toFixed(2)} ms\x1b[0m`),e.writeln(` \x1b[1mRSSI:\x1b[0m ${n.rssi} dBm`),e.writeln(` \x1b[1mSNR:\x1b[0m ${n.snr_db} dB`),n.path&&n.path.length>0){let t=n.path.join(` → `),r=n.path.length;e.writeln(` \x1b[1mPath:\x1b[0m ${t}`),e.writeln(` \x1b[1mHops:\x1b[0m ${r}`)}e.writeln(``);let a=`Excellent`,o=`\x1B[32m`;n.rtt_ms>500||n.rssi<-120?(a=`Poor`,o=`\x1B[31m`):n.rtt_ms>250||n.rssi<-100?(a=`Fair`,o=`\x1B[33m`):(n.rtt_ms>100||n.rssi<-80)&&(a=`Good`,o=`\x1B[36m`),e.writeln(` \x1b[1mLink Quality:\x1b[0m ${o}${a}\x1b[0m`)}else this.writeError(e,t.error||`Ping failed`)}catch(t){s(),this.writeError(e,`Ping failed: ${t.message||t}`)}e.writeln(``),n()}};async function Wh(){try{let e=[`Chat Node`,`Repeater`,`Room Server`,`Hybrid Node`,`Unknown`],t=[];for(let n of e)try{let e=await f.get(`/adverts_by_contact_type`,{contact_type:n,hours:168}),r=e.success&&e.data?e.data:e;(Array.isArray(r)?r:[]).forEach(e=>{e.node_name&&!t.includes(e.node_name)&&t.push(e.node_name)})}catch{continue}return t.sort()}catch{return[]}}var Gh=class{commands=[];constructor(){let e=new kh,t=new Ah,n=new jh,r=new Mh,i=new Nh,a=new Ph,o=new Fh,s=new Ih,c=new Lh,l=new Rh,u=new zh,d=new Bh,f=new Vh,p=new Hh,m=new Uh;this.commands=[new Oh([e,t,n,r,i,a,o,s,c,l,u,d,f,p,m]),e,t,n,r,i,a,o,s,c,l,u,d,f,p,m]}findCommand(e){return this.commands.find(t=>t.matches(e))}getAllCommands(){return this.commands}getCommandNames(){return this.commands.map(e=>e.name)}},Kh={class:`space-y-4 md:space-y-6`},qh={class:`glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-3 md:p-4`},Jh={class:`flex items-center justify-between`},Yh={class:`flex items-center gap-2 md:gap-3`},Xh=[`title`],Zh={key:0,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},Qh={key:1,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},$h={class:`hidden sm:inline`},eg=[`title`],tg={class:`hidden sm:inline`},ng=[`title`],rg={key:0,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},ig={key:1,class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},ag={class:`hidden sm:inline`},og={key:0,class:`glass-card backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] p-4`},sg={class:`flex items-center gap-3`},cg=[`onKeydown`],lg={key:1,class:`absolute top-4 right-4 bg-black/80 backdrop-blur-sm px-3 py-2 rounded-lg border border-primary/30 flex items-center gap-2`},ug=p(r({name:`TerminalView`,__name:`Terminal`,setup(r){let{theme:f}=m(),p={background:`#1A1E1F`,foreground:`#e0e0e0`,cursor:`#00d9ff`,cursorAccent:`#000000`,selectionBackground:`#00d9ff40`,selectionForeground:`#ffffff`,black:`#000000`,red:`#ff6b6b`,green:`#51cf66`,yellow:`#ffd93d`,blue:`#00d9ff`,magenta:`#e599f7`,cyan:`#00d9ff`,white:`#e0e0e0`,brightBlack:`#6c757d`,brightRed:`#ff8787`,brightGreen:`#69db7c`,brightYellow:`#ffe066`,brightBlue:`#74c0fc`,brightMagenta:`#f3a6ff`,brightCyan:`#3bc9db`,brightWhite:`#ffffff`},v={background:`#F3F4F6`,foreground:`#1f2937`,cursor:`#0D7377`,cursorAccent:`#ffffff`,selectionBackground:`#0D737740`,selectionForeground:`#000000`,black:`#1f2937`,red:`#dc2626`,green:`#15803d`,yellow:`#a16207`,blue:`#0D7377`,magenta:`#7c3aed`,cyan:`#0e7490`,white:`#f3f4f6`,brightBlack:`#6b7280`,brightRed:`#ef4444`,brightGreen:`#22c55e`,brightYellow:`#eab308`,brightBlue:`#0891b2`,brightMagenta:`#a855f7`,brightCyan:`#06b6d4`,brightWhite:`#ffffff`},y=d(null),b=d(null),x=d(null),S=d(``),ee=d(!1),te=d(!1),C=d(!1),w=d(!1),T=d(!1);d(0);let E=null,D=null,ne=null,O=``,re=[],k=-1,A=``,j=new Gh,ie=j.getCommandNames(),ae=[],oe=0,se={get:[`name`,`role`,`lat`,`lon`,`freq`,`tx`,`bw`,`sf`,`cr`,`radio`,`txdelay`,`direct.txdelay`,`rxdelay`,`af`,`mode`,`repeat`,`flood.max`,`advert.interval`,`duty`,`duty.max`,`public.key`],set:[`tx`,`freq`,`bw`,`sf`,`cr`,`txdelay`,`direct.txdelay`,`rxdelay`,`name`,`lat`,`lon`,`mode`,`duty`,`flood.max`,`advert.interval`,`flood.advert.interval`],ping:[]},ce={set:{mode:[`forward`,`monitor`],duty:[`on`,`off`]}},le={get:{name:`Node name`,role:`Node role`,lat:`Latitude`,lon:`Longitude`,freq:`Frequency (MHz)`,tx:`TX power (dBm)`,bw:`Bandwidth (kHz)`,sf:`Spreading factor`,cr:`Coding rate`,radio:`All radio settings`,txdelay:`TX delay factor`,"direct.txdelay":`Direct TX delay`,rxdelay:`RX delay base`,af:`Airtime factor`,mode:`Repeater mode`,repeat:`Repeat on/off`,"flood.max":`Max flood hops`,"advert.interval":`Advert interval`,duty:`Duty cycle enabled`,"duty.max":`Max airtime %`,"public.key":`Public key`},set:{tx:`TX power (2-30 dBm)`,freq:`Frequency (100-1000 MHz) *restart required*`,bw:`Bandwidth (7.8-500 kHz) *restart required*`,sf:`Spreading factor (5-12) *restart required*`,cr:`Coding rate (5-8) *restart required*`,txdelay:`TX delay factor (0.0-5.0)`,"direct.txdelay":`Direct TX delay (0.0-5.0)`,rxdelay:`RX delay base (>= 0)`,name:`Node name`,lat:`Latitude (-90 to 90)`,lon:`Longitude (-180 to 180)`,mode:`Repeater mode (forward/monitor/no_tx)`,duty:`Duty cycle (on/off)`,"flood.max":`Max flood hops (0-64)`,"advert.interval":`Advert interval (0 or 1-10080 mins)`,"flood.advert.interval":`Flood advert (0 or 3-48 hrs)`},ping:{}};t(()=>{if(!y.value)return;C.value=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),E=new Zs({cursorBlink:!1,cursorStyle:`underline`,cursorWidth:3,fontFamily:`"JetBrains Mono", "Fira Code", Menlo, Monaco, "Courier New", monospace`,fontSize:window.innerWidth<768?11:13,fontWeight:`400`,fontWeightBold:`700`,lineHeight:1.3,letterSpacing:.5,smoothScrollDuration:50,scrollSensitivity:3,fastScrollSensitivity:5,allowProposedApi:!0,screenReaderMode:C.value,theme:f.value===`dark`?p:v,scrollback:1e4,tabStopWidth:4,macOptionIsMeta:!0}),D=new ec,E.loadAddon(D);try{let e=new Eh;E.loadAddon(e)}catch{console.warn(`WebGL addon failed to load, falling back to canvas renderer`)}let t=new oc((e,t)=>{window.open(t,`_blank`)});E.loadAddon(t);let n=new Hu;if(E.loadAddon(n),E.unicode.activeVersion=`11`,ne=new Al,E.loadAddon(ne),E.open(y.value),D.fit(),E.focus(),C.value&&b.value){let t=b.value,n=()=>{t.focus({preventScroll:!1})};y.value?.addEventListener(`click`,n),y.value?.addEventListener(`touchstart`,n),t.addEventListener(`input`,()=>{setTimeout(()=>{E?.scrollToBottom()},10)}),e(()=>{y.value?.removeEventListener(`click`,n),y.value?.removeEventListener(`touchstart`,n)})}let r=f.value===`dark`?`\x1B[1;37m`:`\x1B[1;90m`;f.value;let i=(f.value,`\x1B[90m`),a=`\x1B[0m`;E.writeln(``),E.writeln(`${r} ██████ ██ ██ ███ ███ ██████${a}`),E.writeln(`${r} ██ ██ ██ ██ ████ ████ ██ ${a}`),E.writeln(`${r} ██████ ████ ██ ████ ██ ██ ${a}`),E.writeln(`${r} ██ ██ ██ ██ ██ ██ ${a}`),E.writeln(`${r} ██ ██ ██ ██ ██████${a}`),E.writeln(``),E.writeln(` Repeater Terminal${a}`),E.writeln(``),E.writeln(`${i} Type help${i} for available commands${a}`),E.writeln(``),M(),E.onData(e=>{fe(e)});let o=new ResizeObserver(()=>{D?.fit()});o.observe(y.value),e(()=>{o.disconnect(),E?.dispose()})});let M=()=>{E?.write(`\r +\x1B[1;36m❯\x1B[0m `)},ue=e=>{if(!(!E||!e)){E.write(`\x1b[90m${e}\x1b[0m`);for(let t=0;t{if(!(!E||!A)){for(let e=0;e{if(!E)return;let t=e.charCodeAt(0);if(t===13){de(),E.write(`\r +`),O.trim()?(N(O.trim()),re.push(O.trim()),k=re.length):M(),O=``;return}if(t===127){O.length>0&&(de(),O=O.slice(0,-1),E.write(`\b \b`),pe());return}if(t===3){de(),E.write(`^C\r +`),O=``,M();return}if(t===12){E.clear(),O=``,M();return}if(t===6){ee.value=!ee.value;return}if(e===`\x1B[A`){re.length>0&&k>0&&(de(),k--,E.write(`\r\x1B[K`),M(),O=re[k],E.write(O));return}if(e===`\x1B[B`){de(),k2&&ce[n]){let e=t[1]?.toLowerCase(),r=t.slice(2).join(` `).toLowerCase(),i=ce[n][e];if(i){let e=i.filter(e=>e.toLowerCase().startsWith(r));if(e.length===1){let n=t.slice(2).join(` `),r=e[0].slice(n.length);O+=r,E.write(r)}else e.length>1&&(E.write(`\r +\r +\x1B[33mAvailable values:\x1B[0m\r +\r +`),e.forEach(e=>{E.writeln(` \x1b[36m${e}\x1b[0m`)}),M(),E.write(O));return}}if(t.length>1&&se[n]){if(n===`ping`){let e=t.slice(1).join(` `).toLowerCase(),n=Date.now();n-oe>3e4&&Wh().then(e=>{ae=e,oe=n,se.ping=e});let r=ae.filter(t=>t.toLowerCase().startsWith(e));if(r.length===1){let e=t.slice(1).join(` `),n=r[0].slice(e.length)+` `;O+=n,E.write(n)}else r.length>1?(E.write(`\r +\r +\x1B[33mAvailable neighbors:\x1B[0m\r +\r +`),r.forEach(e=>{E.writeln(` \x1b[36m${e}\x1b[0m`)}),M(),E.write(O)):ae.length===0&&e===``&&(E.write(`\r +\r +\x1B[33mFetching neighbors...\x1B[0m\r +`),Wh().then(e=>{ae=e,oe=n,se.ping=e,E.write(`\r +\x1B[33mAvailable neighbors:\x1B[0m\r +\r +`),e.forEach(e=>{E.writeln(` \x1b[36m${e}\x1b[0m`)}),M(),E.write(O)}).catch(()=>{E.write(`\r +\x1B[31mFailed to fetch neighbors\x1B[0m\r +`),M(),E.write(O)}));return}let e=t.slice(1).join(` `).toLowerCase(),r=se[n].filter(t=>t.toLowerCase().startsWith(e));if(r.length===1){let e=t.slice(1).join(` `),n=r[0].slice(e.length)+` `;O+=n,E.write(n)}else if(r.length>1){E.write(`\r +\r +\x1B[33mAvailable parameters:\x1B[0m\r +\r +`);let e=le[n]||{};r.forEach(t=>{let n=e[t]||``,r=t.padEnd(20);E.writeln(` \x1b[36m${r}\x1b[0m\x1b[90m${n}\x1b[0m`)}),M(),E.write(O)}return}let r=j.getAllCommands().filter(t=>!!(t.name.toLowerCase().startsWith(e)||t.aliases?.some(t=>t.toLowerCase().startsWith(e))));if(r.length===1){let e=r[0].name.slice(O.length)+` `;O+=e,E.write(e)}else r.length>1&&(E.write(`\r +\r +\x1B[33mAvailable commands:\x1B[0m\r +\r +`),r.forEach(e=>{let t=e.aliases&&e.aliases.length>0?` (${e.aliases.join(`, `)})`:``;E.writeln(` \x1b[36m${e.name.padEnd(15)}\x1b[0m ${e.description}${t}`)}),M(),E.write(O));return}t>=32&&t<127&&(de(),O+=e,E.write(e),C.value||pe())},pe=()=>{if(O.length===0){A=``;return}let e=ie.filter(e=>e.startsWith(O.toLowerCase()));e.length===1&&e[0]!==O?(A=e[0].slice(O.length),ue(A)):A=``},N=async e=>{if(!E)return;let[t,...n]=e.trim().split(/\s+/),r=j.findCommand(t);if(r)try{await r.execute({term:E,args:n,writePrompt:M})}catch(e){console.error(`Command execution error:`,e),E.writeln(`\x1b[1;31m✗ Error:\x1b[0m ${e instanceof Error?e.message:`Command failed`}`),M()}else E.writeln(`\x1b[1;31m✗ Unknown command:\x1b[0m ${t}`),E.writeln(`\x1B[90mType \x1B[36mhelp\x1B[90m for available commands\x1B[0m`),M()},me=()=>{!ne||!S.value||ne.findNext(S.value,{caseSensitive:!1})},P=()=>{!ne||!S.value||ne.findPrevious(S.value,{caseSensitive:!1})},he=()=>{ee.value=!1,S.value=``,E?.focus()},ge=async()=>{if(x.value){if(w.value)try{document.exitFullscreen&&await document.exitFullscreen(),w.value=!1}catch(e){console.error(`Failed to exit fullscreen:`,e)}else try{x.value.requestFullscreen&&await x.value.requestFullscreen(),w.value=!0,setTimeout(()=>{C.value&&b.value?b.value.focus():E&&E.focus()},100)}catch(e){console.error(`Failed to enter fullscreen:`,e)}setTimeout(()=>{D?.fit()},100)}},_e=()=>{T.value=!T.value,T.value&&C.value&&setTimeout(()=>{window.scrollTo(0,1)},100),setTimeout(()=>{C.value&&b.value?b.value.focus():E?.focus(),D?.fit()},150)},ve=()=>{T.value=!1,setTimeout(()=>{D?.fit()},100)};a(f,e=>{E&&(E.options.theme=e===`dark`?p:v)}),typeof document<`u`&&(document.addEventListener(`fullscreenchange`,()=>{w.value=!!document.fullscreenElement,setTimeout(()=>D?.fit(),100)}),document.addEventListener(`keydown`,e=>{e.key===`Escape`&&T.value&&!w.value&&ve()}),document.addEventListener(`keydown`,e=>{e.key===`Escape`&&T.value&&!w.value&&ve()}));let ye=()=>{C.value&&b.value&&b.value.focus()},be=e=>{let t=e.target,n=t.value;n&&E&&fe(n.slice(-1)),t.value=``},xe=()=>{E&&fe(`\r`),b.value&&(b.value.value=``)},Se=()=>{E&&fe(``),b.value&&(b.value.value=``)};return(e,t)=>(u(),l(`div`,Kh,[c(`div`,qh,[c(`div`,Jh,[t[8]||=c(`div`,null,[c(`h1`,{class:`text-content-primary dark:text-content-primary text-lg md:text-xl font-semibold`},` Terminal `),c(`p`,{class:`text-content-secondary dark:text-content-muted text-sm hidden md:block`},` Interactive command-line interface `)],-1),c(`div`,Yh,[C.value?(u(),l(`button`,{key:0,onClick:_e,class:`flex items-center gap-2 px-3 py-2 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors`,title:T.value?`Exit fullscreen`:`Enter fullscreen`},[T.value?(u(),l(`svg`,Qh,[...t[3]||=[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`},null,-1)]])):(u(),l(`svg`,Zh,[...t[2]||=[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4`},null,-1)]])),c(`span`,$h,n(T.value?`Exit`:`Fullscreen`),1)],8,Xh)):o(``,!0),C.value?o(``,!0):(u(),l(`button`,{key:1,onClick:_e,class:`flex items-center gap-2 px-3 py-2 md:px-4 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors`,title:T.value?`Exit full window`:`Full window`},[t[4]||=c(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 5a1 1 0 011-1h14a1 1 0 011 1v2a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM4 13a1 1 0 011-1h6a1 1 0 011 1v6a1 1 0 01-1 1H5a1 1 0 01-1-1v-6zM16 13a1 1 0 011-1h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6z`})],-1),c(`span`,tg,n(T.value?`Exit Window`:`Full Window`),1)],8,eg)),C.value?o(``,!0):(u(),l(`button`,{key:2,onClick:ge,class:`flex items-center gap-2 px-3 py-2 md:px-4 bg-accent-purple/20 hover:bg-accent-purple/30 text-accent-purple border border-accent-purple/50 rounded-lg transition-colors`,title:w.value?`Exit fullscreen`:`Fullscreen`},[w.value?(u(),l(`svg`,ig,[...t[6]||=[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`},null,-1)]])):(u(),l(`svg`,rg,[...t[5]||=[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4`},null,-1)]])),c(`span`,ag,n(w.value?`Exit Full`:`Fullscreen`),1)],8,ng)),c(`button`,{onClick:t[0]||=e=>ee.value=!ee.value,class:`flex items-center gap-2 px-3 py-2 md:px-4 bg-primary/20 hover:bg-primary/30 text-primary border border-primary/50 rounded-lg transition-colors`},[...t[7]||=[c(`svg`,{class:`w-4 h-4`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z`})],-1),c(`span`,{class:`hidden sm:inline`},`Search`,-1)]])])])]),ee.value?(u(),l(`div`,og,[c(`div`,sg,[i(c(`input`,{"onUpdate:modelValue":t[1]||=e=>S.value=e,onKeydown:[_(me,[`enter`]),_(he,[`esc`])],type:`text`,placeholder:`Search terminal output...`,class:`flex-1 px-4 py-2 bg-white dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary placeholder-gray-500 dark:placeholder-white/40 outline-none focus:border-primary/50 transition-colors`},null,544),[[h,S.value]]),c(`button`,{onClick:P,class:`px-3 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary transition-colors`,title:`Previous (Shift+Enter)`},` ↑ `),c(`button`,{onClick:me,class:`px-3 py-2 bg-primary/20 hover:bg-primary/30 border border-primary/50 rounded-lg text-primary transition-colors`,title:`Next (Enter)`},` ↓ `),c(`button`,{onClick:he,class:`px-3 py-2 bg-background-mute dark:bg-white/5 hover:bg-stroke-subtle dark:hover:bg-white/10 border border-stroke-subtle dark:border-stroke/10 rounded-lg text-content-primary dark:text-content-primary transition-colors`},` ✕ `)])])):o(``,!0),c(`div`,{ref_key:`terminalContainerRef`,ref:x,class:s([`bg-surface dark:bg-surface-elevated/80 backdrop-blur-xl border border-stroke-subtle dark:border-white/10 rounded-[15px] overflow-hidden relative`,{"fullscreen-terminal":w.value,"full-window-terminal":T.value}])},[T.value&&!w.value?(u(),l(`button`,{key:0,onClick:ve,class:`absolute top-4 right-4 z-50 p-2 bg-black/80 backdrop-blur-sm hover:bg-black/90 text-white border border-white/20 rounded-lg transition-colors`,title:`Exit full window (ESC)`},[...t[9]||=[c(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[c(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])):o(``,!0),c(`div`,{ref_key:`terminalRef`,ref:y,class:s([`terminal-container`,{"fullscreen-content":w.value}]),onClick:ye,onTouchstart:ye},[C.value?(u(),l(`input`,{key:0,ref_key:`mobileInputRef`,ref:b,type:`text`,class:`mobile-keyboard-input`,onInput:be,onKeydown:[_(g(xe,[`prevent`]),[`enter`]),_(Se,[`delete`])],inputmode:`text`,autocomplete:`off`,autocorrect:`off`,autocapitalize:`off`,spellcheck:`false`},null,40,cg)):o(``,!0)],34),te.value?(u(),l(`div`,lg,[...t[10]||=[c(`div`,{class:`w-2 h-2 bg-primary rounded-full animate-pulse`},null,-1),c(`span`,{class:`text-primary text-sm font-medium`},`Processing...`,-1)]])):o(``,!0)],2)]))}}),[[`__scopeId`,`data-v-e270e599`]]);export{ug as default}; \ No newline at end of file diff --git a/repeater/web/html/assets/Terminal-tmed9q5z.css b/repeater/web/html/assets/Terminal-tmed9q5z.css new file mode 100644 index 0000000..abb5b36 --- /dev/null +++ b/repeater/web/html/assets/Terminal-tmed9q5z.css @@ -0,0 +1 @@ +.xterm{cursor:text;-webkit-user-select:none;user-select:none;position:relative}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{z-index:5;position:absolute;top:0}.xterm .xterm-helper-textarea{opacity:0;z-index:-5;white-space:nowrap;resize:none;border:0;width:0;height:0;margin:0;padding:0;position:absolute;top:0;left:-9999em;overflow:hidden}.xterm .composition-view{color:#fff;white-space:nowrap;z-index:1;background:#000;display:none;position:absolute}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{cursor:default;background-color:#000;position:absolute;inset:0;overflow-y:scroll}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;top:0;left:0}.xterm-char-measure-element{visibility:hidden;line-height:normal;display:inline-block;position:absolute;top:0;left:-9999em}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{z-index:10;color:#0000;pointer-events:none;position:absolute;inset:0}.xterm .xterm-accessibility-tree:not(.debug) ::selection{color:#0000}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre;font-family:monospace}.xterm .xterm-accessibility-tree>div{transform-origin:0;width:fit-content}.xterm .live-region{width:1px;height:1px;position:absolute;left:-9999px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{-webkit-text-decoration:underline double;text-decoration:underline double}.xterm-underline-3{-webkit-text-decoration:underline wavy;text-decoration:underline wavy}.xterm-underline-4{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.xterm-underline-5{-webkit-text-decoration:underline dashed;text-decoration:underline dashed}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:underline overline}.xterm-overline.xterm-underline-2{-webkit-text-decoration:overline double underline;text-decoration:overline double underline}.xterm-overline.xterm-underline-3{-webkit-text-decoration:overline wavy underline;text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{-webkit-text-decoration:overline dotted underline;text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{-webkit-text-decoration:overline dashed underline;text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;pointer-events:none;position:absolute;top:0;right:0}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;z-index:11;background:0 0;transition:opacity .1s linear}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{display:none;position:absolute}.xterm .xterm-scrollable-element>.shadow.top{width:100%;height:3px;box-shadow:var(--vscode-scrollbar-shadow,#000) 0 6px 6px -6px inset;display:block;top:0;left:3px}.xterm .xterm-scrollable-element>.shadow.left{width:3px;height:100%;box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset;display:block;top:3px;left:0}.xterm .xterm-scrollable-element>.shadow.top-left-corner{width:3px;height:3px;display:block;top:0;left:0}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow,#000) 6px 0 6px -6px inset}.terminal-container[data-v-e270e599]{background-color:var(--color-surface);height:calc(100vh - 220px);min-height:calc(100dvh - 220px)}@media (width<=768px){.terminal-container[data-v-e270e599]{height:calc(100vh - 140px);min-height:calc(100dvh - 140px)}}@media (width<=640px){.terminal-container[data-v-e270e599]{height:calc(100vh - 120px);min-height:calc(100dvh - 120px)}}[data-v-e270e599] .xterm{padding:1.5rem;height:100%!important}@media (width<=768px){[data-v-e270e599] .xterm{padding:1rem}}@media (width<=640px){[data-v-e270e599] .xterm{padding:.75rem}}[data-v-e270e599] .xterm-viewport,[data-v-e270e599] .xterm-screen{background-color:#0000!important}[data-v-e270e599] .xterm-selection{background-color:#00d9ff4d!important}kbd[data-v-e270e599]{font-family:Menlo,Monaco,Courier New,monospace;box-shadow:0 2px 4px #0003}.mobile-keyboard-input[data-v-e270e599]{opacity:.01;pointer-events:none;z-index:9999;border:none;width:1px;height:1px;margin:0;padding:0;position:absolute;bottom:0;left:0}.fullscreen-terminal[data-v-e270e599]{z-index:9999!important;background-color:var(--color-surface)!important;border-radius:0!important;width:100vw!important;height:100dvh!important;margin:0!important;position:fixed!important;inset:0!important}.fullscreen-content[data-v-e270e599]{height:100%!important;min-height:100%!important}.fullscreen-terminal[data-v-e270e599] .xterm{padding:2rem}@media (width<=768px){.fullscreen-terminal[data-v-e270e599] .xterm{padding:1rem}}.full-window-terminal[data-v-e270e599]{z-index:9998;inset:0;overflow:hidden;background-color:var(--color-surface)!important;border-radius:0!important;width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;margin:0!important;position:fixed!important}.full-window-terminal .terminal-container[data-v-e270e599]{overflow:auto;width:100vw!important;height:100dvh!important}.full-window-terminal[data-v-e270e599] .xterm{padding:1rem;height:100%!important}@media (width<=768px){.full-window-terminal[data-v-e270e599]{touch-action:none}.full-window-terminal .terminal-container[data-v-e270e599]{overscroll-behavior:none}.full-window-terminal[data-v-e270e599] .xterm{padding:.75rem}} diff --git a/repeater/web/html/assets/_commonjsHelpers-CqkleIqs.js b/repeater/web/html/assets/_commonjsHelpers-CqkleIqs.js deleted file mode 100644 index dbbfc19..0000000 --- a/repeater/web/html/assets/_commonjsHelpers-CqkleIqs.js +++ /dev/null @@ -1 +0,0 @@ -function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}export{e as g}; diff --git a/repeater/web/html/assets/_plugin-vue_export-helper-V-yks4gF.js b/repeater/web/html/assets/_plugin-vue_export-helper-V-yks4gF.js new file mode 100644 index 0000000..4374bdd --- /dev/null +++ b/repeater/web/html/assets/_plugin-vue_export-helper-V-yks4gF.js @@ -0,0 +1 @@ +var e=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n};export{e as t}; \ No newline at end of file diff --git a/repeater/web/html/assets/api-CrUX-ZnK.js b/repeater/web/html/assets/api-CrUX-ZnK.js new file mode 100644 index 0000000..52e5763 --- /dev/null +++ b/repeater/web/html/assets/api-CrUX-ZnK.js @@ -0,0 +1,7 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Setup-wQ-fEW9F.js","assets/_plugin-vue_export-helper-V-yks4gF.js","assets/index-CPWfwDmA.js","assets/runtime-core.esm-bundler-IofF4kUm.js","assets/pinia-BrpcNUEi.js","assets/vue-router-BsDVl_JC.js","assets/useTheme-Dlt6-wEf.js","assets/packets-BxrAyCoo.js","assets/system-CCY_Ibb-.js","assets/index-C29IW84J.css","assets/Setup-DiRq9fgD.css","assets/Login-Ci7Po_oi.js","assets/Login-BTzcMhpV.css","assets/Dashboard-CtkpxqA5.js","assets/chart-DdrINt9G.js","assets/useSignalQuality-hIA9BjQx.js","assets/preferences-N3Pls1rF.js","assets/Dashboard-CUPKHF02.css","assets/Neighbors-tK0iZybD.js","assets/chunk-DECur_0Z.js","assets/leaflet-src-BtX0-WJ4.js","assets/Neighbors-Cfo189NY.css","assets/leaflet-vh-t_kPv.css","assets/Statistics-m6h9b_Wm.js","assets/chartjs-adapter-date-fns.esm-CONKmChq.js","assets/chartjs-adapter-date-fns-BqJ94ASW.css","assets/plotly.min-Bnm7le34.js","assets/Statistics-2MFwNAp1.css","assets/SystemStats-DE5yghoc.js","assets/SystemStats-Dnc1_s5j.css","assets/Configuration-Db8EsEJI.js","assets/ConfirmDialog-BRvNEHEy.js","assets/Configuration-DavFlb5x.css","assets/CADCalibration-HkcF2-GW.js","assets/CADCalibration-gZQwotT3.css","assets/Sessions-B4giR55K.js","assets/RoomServers-CheebdAq.js","assets/MessageDialog-CSjABYko.js","assets/Companions-Cx-FcUOx.js","assets/Logs-Deot7VVG.js","assets/Terminal-G0FM7r0V.js","assets/Terminal-tmed9q5z.css","assets/Help-1i4KzGWQ.js"])))=>i.map(i=>d[i]); +import{n as e}from"./chunk-DECur_0Z.js";import{n as t,t as n}from"./vue-router-BsDVl_JC.js";function r(e,t){return function(){return e.apply(t,arguments)}}var{toString:i}=Object.prototype,{getPrototypeOf:a}=Object,{iterator:o,toStringTag:s}=Symbol,c=(e=>t=>{let n=i.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),l=e=>(e=e.toLowerCase(),t=>c(t)===e),u=e=>t=>typeof t===e,{isArray:d}=Array,f=u(`undefined`);function p(e){return e!==null&&!f(e)&&e.constructor!==null&&!f(e.constructor)&&_(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var m=l(`ArrayBuffer`);function h(e){let t;return t=typeof ArrayBuffer<`u`&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer),t}var g=u(`string`),_=u(`function`),v=u(`number`),y=e=>typeof e==`object`&&!!e,ee=e=>e===!0||e===!1,b=e=>{if(c(e)!==`object`)return!1;let t=a(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(s in e)&&!(o in e)},x=e=>{if(!y(e)||p(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},S=l(`Date`),C=l(`File`),te=e=>!!(e&&e.uri!==void 0),ne=e=>e&&e.getParts!==void 0,re=l(`Blob`),ie=l(`FileList`),ae=e=>y(e)&&_(e.pipe);function oe(){return typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{}}var se=oe(),ce=se.FormData===void 0?void 0:se.FormData,le=e=>{let t;return e&&(ce&&e instanceof ce||_(e.append)&&((t=c(e))===`formdata`||t===`object`&&_(e.toString)&&e.toString()===`[object FormData]`))},ue=l(`URLSearchParams`),[de,fe,pe,me]=[`ReadableStream`,`Request`,`Response`,`Headers`].map(l),he=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,``);function w(e,t,{allOwnKeys:n=!1}={}){if(e==null)return;let r,i;if(typeof e!=`object`&&(e=[e]),d(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}var T=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,_e=e=>!f(e)&&e!==T;function ve(){let{caseless:e,skipUndefined:t}=_e(this)&&this||{},n={},r=(r,i)=>{if(i===`__proto__`||i===`constructor`||i===`prototype`)return;let a=e&&ge(n,i)||i;b(n[a])&&b(r)?n[a]=ve(n[a],r):b(r)?n[a]=ve({},r):d(r)?n[a]=r.slice():(!t||!f(r))&&(n[a]=r)};for(let e=0,t=arguments.length;e(w(t,(t,i)=>{n&&_(t)?Object.defineProperty(e,i,{value:r(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,i,{value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:i}),e),be=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),xe=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,`constructor`,{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,`super`,{value:t.prototype}),n&&Object.assign(e.prototype,n)},Se=(e,t,n,r)=>{let i,o,s,c={};if(t||={},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!c[s]&&(t[s]=e[s],c[s]=!0);e=n!==!1&&a(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ce=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;let r=e.indexOf(t,n);return r!==-1&&r===n},we=e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!v(t))return null;let n=Array(t);for(;t-- >0;)n[t]=e[t];return n},Te=(e=>t=>e&&t instanceof e)(typeof Uint8Array<`u`&&a(Uint8Array)),Ee=(e,t)=>{let n=(e&&e[o]).call(e),r;for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},De=(e,t)=>{let n,r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Oe=l(`HTMLFormElement`),ke=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),Ae=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),je=l(`RegExp`),Me=(e,t)=>{let n=Object.getOwnPropertyDescriptors(e),r={};w(n,(n,i)=>{let a;(a=t(n,i,e))!==!1&&(r[i]=a||n)}),Object.defineProperties(e,r)},Ne=e=>{Me(e,(t,n)=>{if(_(e)&&[`arguments`,`caller`,`callee`].indexOf(n)!==-1)return!1;let r=e[n];if(_(r)){if(t.enumerable=!1,`writable`in t){t.writable=!1;return}t.set||=()=>{throw Error(`Can not rewrite read-only method '`+n+`'`)}}})},Pe=(e,t)=>{let n={},r=e=>{e.forEach(e=>{n[e]=!0})};return d(e)?r(e):r(String(e).split(t)),n},Fe=()=>{},Ie=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Le(e){return!!(e&&_(e.append)&&e[s]===`FormData`&&e[o])}var Re=e=>{let t=Array(10),n=(e,r)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(p(e))return e;if(!(`toJSON`in e)){t[r]=e;let i=d(e)?[]:{};return w(e,(e,t)=>{let a=n(e,r+1);!f(a)&&(i[t]=a)}),t[r]=void 0,i}}return e};return n(e,0)},ze=l(`AsyncFunction`),Be=e=>e&&(y(e)||_(e))&&_(e.then)&&_(e.catch),Ve=((e,t)=>e?setImmediate:t?((e,t)=>(T.addEventListener(`message`,({source:n,data:r})=>{n===T&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),T.postMessage(e,`*`)}))(`axios@${Math.random()}`,[]):e=>setTimeout(e))(typeof setImmediate==`function`,_(T.postMessage)),E={isArray:d,isArrayBuffer:m,isBuffer:p,isFormData:le,isArrayBufferView:h,isString:g,isNumber:v,isBoolean:ee,isObject:y,isPlainObject:b,isEmptyObject:x,isReadableStream:de,isRequest:fe,isResponse:pe,isHeaders:me,isUndefined:f,isDate:S,isFile:C,isReactNativeBlob:te,isReactNative:ne,isBlob:re,isRegExp:je,isFunction:_,isStream:ae,isURLSearchParams:ue,isTypedArray:Te,isFileList:ie,forEach:w,merge:ve,extend:ye,trim:he,stripBOM:be,inherits:xe,toFlatObject:Se,kindOf:c,kindOfTest:l,endsWith:Ce,toArray:we,forEachEntry:Ee,matchAll:De,isHTMLForm:Oe,hasOwnProperty:Ae,hasOwnProp:Ae,reduceDescriptors:Me,freezeMethods:Ne,toObjectSet:Pe,toCamelCase:ke,noop:Fe,toFiniteNumber:Ie,findKey:ge,global:T,isContextDefined:_e,isSpecCompliantForm:Le,toJSONObject:Re,isAsyncFn:ze,isThenable:Be,setImmediate:Ve,asap:typeof queueMicrotask<`u`?queueMicrotask.bind(T):typeof process<`u`&&process.nextTick||Ve,isIterable:e=>e!=null&&_(e[o])},D=class e extends Error{static from(t,n,r,i,a,o){let s=new e(t.message,n||t.code,r,i,a);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),o&&Object.assign(s,o),s}constructor(e,t,n,r,i){super(e),Object.defineProperty(this,`message`,{value:e,enumerable:!0,writable:!0,configurable:!0}),this.name=`AxiosError`,this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status)}toJSON(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:E.toJSONObject(this.config),code:this.code,status:this.status}}};D.ERR_BAD_OPTION_VALUE=`ERR_BAD_OPTION_VALUE`,D.ERR_BAD_OPTION=`ERR_BAD_OPTION`,D.ECONNABORTED=`ECONNABORTED`,D.ETIMEDOUT=`ETIMEDOUT`,D.ERR_NETWORK=`ERR_NETWORK`,D.ERR_FR_TOO_MANY_REDIRECTS=`ERR_FR_TOO_MANY_REDIRECTS`,D.ERR_DEPRECATED=`ERR_DEPRECATED`,D.ERR_BAD_RESPONSE=`ERR_BAD_RESPONSE`,D.ERR_BAD_REQUEST=`ERR_BAD_REQUEST`,D.ERR_CANCELED=`ERR_CANCELED`,D.ERR_NOT_SUPPORT=`ERR_NOT_SUPPORT`,D.ERR_INVALID_URL=`ERR_INVALID_URL`;function O(e){return E.isPlainObject(e)||E.isArray(e)}function He(e){return E.endsWith(e,`[]`)?e.slice(0,-2):e}function k(e,t,n){return e?e.concat(t).map(function(e,t){return e=He(e),!n&&t?`[`+e+`]`:e}).join(n?`.`:``):t}function Ue(e){return E.isArray(e)&&!e.some(O)}var We=E.toFlatObject(E,{},null,function(e){return/^is[A-Z]/.test(e)});function A(e,t,n){if(!E.isObject(e))throw TypeError(`target must be an object`);t||=new FormData,n=E.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!E.isUndefined(t[e])});let r=n.metaTokens,i=n.visitor||l,a=n.dots,o=n.indexes,s=(n.Blob||typeof Blob<`u`&&Blob)&&E.isSpecCompliantForm(t);if(!E.isFunction(i))throw TypeError(`visitor must be a function`);function c(e){if(e===null)return``;if(E.isDate(e))return e.toISOString();if(E.isBoolean(e))return e.toString();if(!s&&E.isBlob(e))throw new D(`Blob is not supported. Use a Buffer instead.`);return E.isArrayBuffer(e)||E.isTypedArray(e)?s&&typeof Blob==`function`?new Blob([e]):Buffer.from(e):e}function l(e,n,i){let s=e;if(E.isReactNative(t)&&E.isReactNativeBlob(e))return t.append(k(i,n,a),c(e)),!1;if(e&&!i&&typeof e==`object`){if(E.endsWith(n,`{}`))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(E.isArray(e)&&Ue(e)||(E.isFileList(e)||E.endsWith(n,`[]`))&&(s=E.toArray(e)))return n=He(n),s.forEach(function(e,r){!(E.isUndefined(e)||e===null)&&t.append(o===!0?k([n],r,a):o===null?n:n+`[]`,c(e))}),!1}return O(e)?!0:(t.append(k(i,n,a),c(e)),!1)}let u=[],d=Object.assign(We,{defaultVisitor:l,convertValue:c,isVisitable:O});function f(e,n){if(!E.isUndefined(e)){if(u.indexOf(e)!==-1)throw Error(`Circular reference detected in `+n.join(`.`));u.push(e),E.forEach(e,function(e,r){(!(E.isUndefined(e)||e===null)&&i.call(t,e,E.isString(r)?r.trim():r,n,d))===!0&&f(e,n?n.concat(r):[r])}),u.pop()}}if(!E.isObject(e))throw TypeError(`data must be an object`);return f(e),t}function Ge(e){let t={"!":`%21`,"'":`%27`,"(":`%28`,")":`%29`,"~":`%7E`,"%20":`+`,"%00":`\0`};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function j(e,t){this._pairs=[],e&&A(e,this,t)}var Ke=j.prototype;Ke.append=function(e,t){this._pairs.push([e,t])},Ke.toString=function(e){let t=e?function(t){return e.call(this,t,Ge)}:Ge;return this._pairs.map(function(e){return t(e[0])+`=`+t(e[1])},``).join(`&`)};function qe(e){return encodeURIComponent(e).replace(/%3A/gi,`:`).replace(/%24/g,`$`).replace(/%2C/gi,`,`).replace(/%20/g,`+`)}function Je(e,t,n){if(!t)return e;let r=n&&n.encode||qe,i=E.isFunction(n)?{serialize:n}:n,a=i&&i.serialize,o;if(o=a?a(t,i):E.isURLSearchParams(t)?t.toString():new j(t,i).toString(r),o){let t=e.indexOf(`#`);t!==-1&&(e=e.slice(0,t)),e+=(e.indexOf(`?`)===-1?`?`:`&`)+o}return e}var Ye=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&=[]}forEach(e){E.forEach(this.handlers,function(t){t!==null&&e(t)})}},Xe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0},Ze={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<`u`?URLSearchParams:j,FormData:typeof FormData<`u`?FormData:null,Blob:typeof Blob<`u`?Blob:null},protocols:[`http`,`https`,`file`,`blob`,`url`,`data`]},Qe=e({hasBrowserEnv:()=>$e,hasStandardBrowserEnv:()=>tt,hasStandardBrowserWebWorkerEnv:()=>nt,navigator:()=>et,origin:()=>rt}),$e=typeof window<`u`&&typeof document<`u`,et=typeof navigator==`object`&&navigator||void 0,tt=$e&&(!et||[`ReactNative`,`NativeScript`,`NS`].indexOf(et.product)<0),nt=typeof WorkerGlobalScope<`u`&&self instanceof WorkerGlobalScope&&typeof self.importScripts==`function`,rt=$e&&window.location.href||`http://localhost`,M={...Qe,...Ze};function it(e,t){return A(e,new M.classes.URLSearchParams,{visitor:function(e,t,n,r){return M.isNode&&E.isBuffer(e)?(this.append(t,e.toString(`base64`)),!1):r.defaultVisitor.apply(this,arguments)},...t})}function at(e){return E.matchAll(/\w+|\[(\w*)]/g,e).map(e=>e[0]===`[]`?``:e[1]||e[0])}function ot(e){let t={},n=Object.keys(e),r,i=n.length,a;for(r=0;r=e.length;return a=!a&&E.isArray(r)?r.length:a,s?(E.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o):((!r[a]||!E.isObject(r[a]))&&(r[a]=[]),t(e,n,r[a],i)&&E.isArray(r[a])&&(r[a]=ot(r[a])),!o)}if(E.isFormData(e)&&E.isFunction(e.entries)){let n={};return E.forEachEntry(e,(e,r)=>{t(at(e),r,n,0)}),n}return null}function ct(e,t,n){if(E.isString(e))try{return(t||JSON.parse)(e),E.trim(e)}catch(e){if(e.name!==`SyntaxError`)throw e}return(n||JSON.stringify)(e)}var N={transitional:Xe,adapter:[`xhr`,`http`,`fetch`],transformRequest:[function(e,t){let n=t.getContentType()||``,r=n.indexOf(`application/json`)>-1,i=E.isObject(e);if(i&&E.isHTMLForm(e)&&(e=new FormData(e)),E.isFormData(e))return r?JSON.stringify(st(e)):e;if(E.isArrayBuffer(e)||E.isBuffer(e)||E.isStream(e)||E.isFile(e)||E.isBlob(e)||E.isReadableStream(e))return e;if(E.isArrayBufferView(e))return e.buffer;if(E.isURLSearchParams(e))return t.setContentType(`application/x-www-form-urlencoded;charset=utf-8`,!1),e.toString();let a;if(i){if(n.indexOf(`application/x-www-form-urlencoded`)>-1)return it(e,this.formSerializer).toString();if((a=E.isFileList(e))||n.indexOf(`multipart/form-data`)>-1){let t=this.env&&this.env.FormData;return A(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType(`application/json`,!1),ct(e)):e}],transformResponse:[function(e){let t=this.transitional||N.transitional,n=t&&t.forcedJSONParsing,r=this.responseType===`json`;if(E.isResponse(e)||E.isReadableStream(e))return e;if(e&&E.isString(e)&&(n&&!this.responseType||r)){let n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(e){if(n)throw e.name===`SyntaxError`?D.from(e,D.ERR_BAD_RESPONSE,this,null,this.response):e}}return e}],timeout:0,xsrfCookieName:`XSRF-TOKEN`,xsrfHeaderName:`X-XSRF-TOKEN`,maxContentLength:-1,maxBodyLength:-1,env:{FormData:M.classes.FormData,Blob:M.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:`application/json, text/plain, */*`,"Content-Type":void 0}}};E.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`],e=>{N.headers[e]={}});var lt=E.toObjectSet([`age`,`authorization`,`content-length`,`content-type`,`etag`,`expires`,`from`,`host`,`if-modified-since`,`if-unmodified-since`,`last-modified`,`location`,`max-forwards`,`proxy-authorization`,`referer`,`retry-after`,`user-agent`]),ut=e=>{let t={},n,r,i;return e&&e.split(` +`).forEach(function(e){i=e.indexOf(`:`),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!(!n||t[n]&<[n])&&(n===`set-cookie`?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+`, `+r:r)}),t},dt=Symbol(`internals`);function P(e){return e&&String(e).trim().toLowerCase()}function F(e){return e===!1||e==null?e:E.isArray(e)?e.map(F):String(e).replace(/[\r\n]+$/,``)}function ft(e){let t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}var pt=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function mt(e,t,n,r,i){if(E.isFunction(r))return r.call(this,t,n);if(i&&(t=n),E.isString(t)){if(E.isString(r))return t.indexOf(r)!==-1;if(E.isRegExp(r))return r.test(t)}}function ht(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function gt(e,t){let n=E.toCamelCase(` `+t);[`get`,`set`,`has`].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}var I=class{constructor(e){e&&this.set(e)}set(e,t,n){let r=this;function i(e,t,n){let i=P(t);if(!i)throw Error(`header name must be a non-empty string`);let a=E.findKey(r,i);(!a||r[a]===void 0||n===!0||n===void 0&&r[a]!==!1)&&(r[a||t]=F(e))}let a=(e,t)=>E.forEach(e,(e,n)=>i(e,n,t));if(E.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(E.isString(e)&&(e=e.trim())&&!pt(e))a(ut(e),t);else if(E.isObject(e)&&E.isIterable(e)){let n={},r,i;for(let t of e){if(!E.isArray(t))throw TypeError(`Object iterator must return a key-value pair`);n[i=t[0]]=(r=n[i])?E.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}a(n,t)}else e!=null&&i(t,e,n);return this}get(e,t){if(e=P(e),e){let n=E.findKey(this,e);if(n){let e=this[n];if(!t)return e;if(t===!0)return ft(e);if(E.isFunction(t))return t.call(this,e,n);if(E.isRegExp(t))return t.exec(e);throw TypeError(`parser must be boolean|regexp|function`)}}}has(e,t){if(e=P(e),e){let n=E.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||mt(this,this[n],n,t)))}return!1}delete(e,t){let n=this,r=!1;function i(e){if(e=P(e),e){let i=E.findKey(n,e);i&&(!t||mt(n,n[i],i,t))&&(delete n[i],r=!0)}}return E.isArray(e)?e.forEach(i):i(e),r}clear(e){let t=Object.keys(this),n=t.length,r=!1;for(;n--;){let i=t[n];(!e||mt(this,this[i],i,e,!0))&&(delete this[i],r=!0)}return r}normalize(e){let t=this,n={};return E.forEach(this,(r,i)=>{let a=E.findKey(n,i);if(a){t[a]=F(r),delete t[i];return}let o=e?ht(i):String(i).trim();o!==i&&delete t[i],t[o]=F(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return E.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&E.isArray(n)?n.join(`, `):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+`: `+t).join(` +`)}getSetCookie(){return this.get(`set-cookie`)||[]}get[Symbol.toStringTag](){return`AxiosHeaders`}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){let t=(this[dt]=this[dt]={accessors:{}}).accessors,n=this.prototype;function r(e){let r=P(e);t[r]||(gt(n,e),t[r]=!0)}return E.isArray(e)?e.forEach(r):r(e),this}};I.accessor([`Content-Type`,`Content-Length`,`Accept`,`Accept-Encoding`,`User-Agent`,`Authorization`]),E.reduceDescriptors(I.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),E.freezeMethods(I);function _t(e,t){let n=this||N,r=t||n,i=I.from(r.headers),a=r.data;return E.forEach(e,function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function vt(e){return!!(e&&e.__CANCEL__)}var L=class extends D{constructor(e,t,n){super(e??`canceled`,D.ERR_CANCELED,t,n),this.name=`CanceledError`,this.__CANCEL__=!0}};function yt(e,t,n){let r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new D(`Request failed with status code `+n.status,[D.ERR_BAD_REQUEST,D.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function bt(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||``}function xt(e,t){e||=10;let n=Array(e),r=Array(e),i=0,a=0,o;return t=t===void 0?1e3:t,function(s){let c=Date.now(),l=r[a];o||=c,n[i]=s,r[i]=c;let u=a,d=0;for(;u!==i;)d+=n[u++],u%=e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),c-o{n=r,i=null,a&&=(clearTimeout(a),null),e(...t)};return[(...e)=>{let t=Date.now(),s=t-n;s>=r?o(e,t):(i=e,a||=setTimeout(()=>{a=null,o(i)},r-s))},()=>i&&o(i)]}var R=(e,t,n=3)=>{let r=0,i=xt(50,250);return St(n=>{let a=n.loaded,o=n.lengthComputable?n.total:void 0,s=a-r,c=i(s),l=a<=o;r=a,e({loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&l?(o-a)/c:void 0,event:n,lengthComputable:o!=null,[t?`download`:`upload`]:!0})},n)},Ct=(e,t)=>{let n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},wt=e=>(...t)=>E.asap(()=>e(...t)),Tt=M.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,M.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(M.origin),M.navigator&&/(msie|trident)/i.test(M.navigator.userAgent)):()=>!0,Et=M.hasStandardBrowserEnv?{write(e,t,n,r,i,a,o){if(typeof document>`u`)return;let s=[`${e}=${encodeURIComponent(t)}`];E.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),E.isString(r)&&s.push(`path=${r}`),E.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push(`secure`),E.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join(`; `)},read(e){if(typeof document>`u`)return null;let t=document.cookie.match(RegExp(`(?:^|; )`+e+`=([^;]*)`));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,``,Date.now()-864e5,`/`)}}:{write(){},read(){return null},remove(){}};function Dt(e){return typeof e==`string`?/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e):!1}function Ot(e,t){return t?e.replace(/\/?\/$/,``)+`/`+t.replace(/^\/+/,``):e}function kt(e,t,n){let r=!Dt(t);return e&&(r||n==0)?Ot(e,t):t}var At=e=>e instanceof I?{...e}:e;function z(e,t){t||={};let n={};function r(e,t,n,r){return E.isPlainObject(e)&&E.isPlainObject(t)?E.merge.call({caseless:r},e,t):E.isPlainObject(t)?E.merge({},t):E.isArray(t)?t.slice():t}function i(e,t,n,i){if(!E.isUndefined(t))return r(e,t,n,i);if(!E.isUndefined(e))return r(void 0,e,n,i)}function a(e,t){if(!E.isUndefined(t))return r(void 0,t)}function o(e,t){if(!E.isUndefined(t))return r(void 0,t);if(!E.isUndefined(e))return r(void 0,e)}function s(n,i,a){if(a in t)return r(n,i);if(a in e)return r(void 0,n)}let c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t,n)=>i(At(e),At(t),n,!0)};return E.forEach(Object.keys({...e,...t}),function(r){if(r===`__proto__`||r===`constructor`||r===`prototype`)return;let a=E.hasOwnProp(c,r)?c[r]:i,o=a(e[r],t[r],r);E.isUndefined(o)&&a!==s||(n[r]=o)}),n}var jt=e=>{let t=z({},e),{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;if(t.headers=o=I.from(o),t.url=Je(kt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set(`Authorization`,`Basic `+btoa((s.username||``)+`:`+(s.password?unescape(encodeURIComponent(s.password)):``))),E.isFormData(n)){if(M.hasStandardBrowserEnv||M.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(E.isFunction(n.getHeaders)){let e=n.getHeaders(),t=[`content-type`,`content-length`];Object.entries(e).forEach(([e,n])=>{t.includes(e.toLowerCase())&&o.set(e,n)})}}if(M.hasStandardBrowserEnv&&(r&&E.isFunction(r)&&(r=r(t)),r||r!==!1&&Tt(t.url))){let e=i&&a&&Et.read(a);e&&o.set(i,e)}return t},Mt=typeof XMLHttpRequest<`u`&&function(e){return new Promise(function(t,n){let r=jt(e),i=r.data,a=I.from(r.headers).normalize(),{responseType:o,onUploadProgress:s,onDownloadProgress:c}=r,l,u,d,f,p;function m(){f&&f(),p&&p(),r.cancelToken&&r.cancelToken.unsubscribe(l),r.signal&&r.signal.removeEventListener(`abort`,l)}let h=new XMLHttpRequest;h.open(r.method.toUpperCase(),r.url,!0),h.timeout=r.timeout;function g(){if(!h)return;let r=I.from(`getAllResponseHeaders`in h&&h.getAllResponseHeaders());yt(function(e){t(e),m()},function(e){n(e),m()},{data:!o||o===`text`||o===`json`?h.responseText:h.response,status:h.status,statusText:h.statusText,headers:r,config:e,request:h}),h=null}`onloadend`in h?h.onloadend=g:h.onreadystatechange=function(){!h||h.readyState!==4||h.status===0&&!(h.responseURL&&h.responseURL.indexOf(`file:`)===0)||setTimeout(g)},h.onabort=function(){h&&=(n(new D(`Request aborted`,D.ECONNABORTED,e,h)),null)},h.onerror=function(t){let r=new D(t&&t.message?t.message:`Network Error`,D.ERR_NETWORK,e,h);r.event=t||null,n(r),h=null},h.ontimeout=function(){let t=r.timeout?`timeout of `+r.timeout+`ms exceeded`:`timeout exceeded`,i=r.transitional||Xe;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new D(t,i.clarifyTimeoutError?D.ETIMEDOUT:D.ECONNABORTED,e,h)),h=null},i===void 0&&a.setContentType(null),`setRequestHeader`in h&&E.forEach(a.toJSON(),function(e,t){h.setRequestHeader(t,e)}),E.isUndefined(r.withCredentials)||(h.withCredentials=!!r.withCredentials),o&&o!==`json`&&(h.responseType=r.responseType),c&&([d,p]=R(c,!0),h.addEventListener(`progress`,d)),s&&h.upload&&([u,f]=R(s),h.upload.addEventListener(`progress`,u),h.upload.addEventListener(`loadend`,f)),(r.cancelToken||r.signal)&&(l=t=>{h&&=(n(!t||t.type?new L(null,e,h):t),h.abort(),null)},r.cancelToken&&r.cancelToken.subscribe(l),r.signal&&(r.signal.aborted?l():r.signal.addEventListener(`abort`,l)));let _=bt(r.url);if(_&&M.protocols.indexOf(_)===-1){n(new D(`Unsupported protocol `+_+`:`,D.ERR_BAD_REQUEST,e));return}h.send(i||null)})},Nt=(e,t)=>{let{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n=new AbortController,r,i=function(e){if(!r){r=!0,o();let t=e instanceof Error?e:this.reason;n.abort(t instanceof D?t:new L(t instanceof Error?t.message:t))}},a=t&&setTimeout(()=>{a=null,i(new D(`timeout of ${t}ms exceeded`,D.ETIMEDOUT))},t),o=()=>{e&&=(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener(`abort`,i)}),null)};e.forEach(e=>e.addEventListener(`abort`,i));let{signal:s}=n;return s.unsubscribe=()=>E.asap(o),s}},Pt=function*(e,t){let n=e.byteLength;if(!t||n{let i=Ft(e,t),a=0,o,s=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{let{done:t,value:r}=await i.next();if(t){s(),e.close();return}let o=r.byteLength;n&&n(a+=o),e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel(e){return s(e),i.return()}},{highWaterMark:2})},Rt=64*1024,{isFunction:B}=E,zt=(({Request:e,Response:t})=>({Request:e,Response:t}))(E.global),{ReadableStream:Bt,TextEncoder:Vt}=E.global,Ht=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Ut=e=>{e=E.merge.call({skipUndefined:!0},zt,e);let{fetch:t,Request:n,Response:r}=e,i=t?B(t):typeof fetch==`function`,a=B(n),o=B(r);if(!i)return!1;let s=i&&B(Bt),c=i&&(typeof Vt==`function`?(e=>t=>e.encode(t))(new Vt):async e=>new Uint8Array(await new n(e).arrayBuffer())),l=a&&s&&Ht(()=>{let e=!1,t=new Bt,r=new n(M.origin,{body:t,method:`POST`,get duplex(){return e=!0,`half`}}).headers.has(`Content-Type`);return t.cancel(),e&&!r}),u=o&&s&&Ht(()=>E.isReadableStream(new r(``).body)),d={stream:u&&(e=>e.body)};i&&[`text`,`arrayBuffer`,`blob`,`formData`,`stream`].forEach(e=>{!d[e]&&(d[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new D(`Response type '${e}' is not supported`,D.ERR_NOT_SUPPORT,n)})});let f=async e=>{if(e==null)return 0;if(E.isBlob(e))return e.size;if(E.isSpecCompliantForm(e))return(await new n(M.origin,{method:`POST`,body:e}).arrayBuffer()).byteLength;if(E.isArrayBufferView(e)||E.isArrayBuffer(e))return e.byteLength;if(E.isURLSearchParams(e)&&(e+=``),E.isString(e))return(await c(e)).byteLength},p=async(e,t)=>E.toFiniteNumber(e.getContentLength())??f(t);return async e=>{let{url:i,method:o,data:s,signal:c,cancelToken:f,timeout:m,onDownloadProgress:h,onUploadProgress:g,responseType:_,headers:v,withCredentials:y=`same-origin`,fetchOptions:ee}=jt(e),b=t||fetch;_=_?(_+``).toLowerCase():`text`;let x=Nt([c,f&&f.toAbortSignal()],m),S=null,C=x&&x.unsubscribe&&(()=>{x.unsubscribe()}),te;try{if(g&&l&&o!==`get`&&o!==`head`&&(te=await p(v,s))!==0){let e=new n(i,{method:`POST`,body:s,duplex:`half`}),t;if(E.isFormData(s)&&(t=e.headers.get(`content-type`))&&v.setContentType(t),e.body){let[t,n]=Ct(te,R(wt(g)));s=Lt(e.body,Rt,t,n)}}E.isString(y)||(y=y?`include`:`omit`);let t=a&&`credentials`in n.prototype,c={...ee,signal:x,method:o.toUpperCase(),headers:v.normalize().toJSON(),body:s,duplex:`half`,credentials:t?y:void 0};S=a&&new n(i,c);let f=await(a?b(S,ee):b(i,c)),m=u&&(_===`stream`||_===`response`);if(u&&(h||m&&C)){let e={};[`status`,`statusText`,`headers`].forEach(t=>{e[t]=f[t]});let t=E.toFiniteNumber(f.headers.get(`content-length`)),[n,i]=h&&Ct(t,R(wt(h),!0))||[];f=new r(Lt(f.body,Rt,n,()=>{i&&i(),C&&C()}),e)}_||=`text`;let ne=await d[E.findKey(d,_)||`text`](f,e);return!m&&C&&C(),await new Promise((t,n)=>{yt(t,n,{data:ne,headers:I.from(f.headers),status:f.status,statusText:f.statusText,config:e,request:S})})}catch(t){throw C&&C(),t&&t.name===`TypeError`&&/Load failed|fetch/i.test(t.message)?Object.assign(new D(`Network Error`,D.ERR_NETWORK,e,S,t&&t.response),{cause:t.cause||t}):D.from(t,t&&t.code,e,S,t&&t.response)}}},Wt=new Map,Gt=e=>{let t=e&&e.env||{},{fetch:n,Request:r,Response:i}=t,a=[r,i,n],o=a.length,s,c,l=Wt;for(;o--;)s=a[o],c=l.get(s),c===void 0&&l.set(s,c=o?new Map:Ut(t)),l=c;return c};Gt();var Kt={http:null,xhr:Mt,fetch:{get:Gt}};E.forEach(Kt,(e,t)=>{if(e){try{Object.defineProperty(e,`name`,{value:t})}catch{}Object.defineProperty(e,`adapterName`,{value:t})}});var qt=e=>`- ${e}`,Jt=e=>E.isFunction(e)||e===null||e===!1;function Yt(e,t){e=E.isArray(e)?e:[e];let{length:n}=e,r,i,a={};for(let o=0;o`adapter ${e} `+(t===!1?`is not supported by the environment`:`is not available in the build`));throw new D(`There is no suitable adapter to dispatch the request `+(n?e.length>1?`since : +`+e.map(qt).join(` +`):` `+qt(e[0]):`as no adapter specified`),`ERR_NOT_SUPPORT`)}return i}var Xt={getAdapter:Yt,adapters:Kt};function Zt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new L(null,e)}function Qt(e){return Zt(e),e.headers=I.from(e.headers),e.data=_t.call(e,e.transformRequest),[`post`,`put`,`patch`].indexOf(e.method)!==-1&&e.headers.setContentType(`application/x-www-form-urlencoded`,!1),Xt.getAdapter(e.adapter||N.adapter,e)(e).then(function(t){return Zt(e),t.data=_t.call(e,e.transformResponse,t),t.headers=I.from(t.headers),t},function(t){return vt(t)||(Zt(e),t&&t.response&&(t.response.data=_t.call(e,e.transformResponse,t.response),t.response.headers=I.from(t.response.headers))),Promise.reject(t)})}var $t=`1.14.0`,V={};[`object`,`boolean`,`number`,`function`,`string`,`symbol`].forEach((e,t)=>{V[e]=function(n){return typeof n===e||`a`+(t<1?`n `:` `)+e}});var en={};V.transitional=function(e,t,n){function r(e,t){return`[Axios v`+$t+`] Transitional option '`+e+`'`+t+(n?`. `+n:``)}return(n,i,a)=>{if(e===!1)throw new D(r(i,` has been removed`+(t?` in `+t:``)),D.ERR_DEPRECATED);return t&&!en[i]&&(en[i]=!0,console.warn(r(i,` has been deprecated since v`+t+` and will be removed in the near future`))),e?e(n,i,a):!0}},V.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function tn(e,t,n){if(typeof e!=`object`)throw new D(`options must be an object`,D.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),i=r.length;for(;i-- >0;){let a=r[i],o=t[a];if(o){let t=e[a],n=t===void 0||o(t,a,e);if(n!==!0)throw new D(`option `+a+` must be `+n,D.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new D(`Unknown option `+a,D.ERR_BAD_OPTION)}}var H={assertOptions:tn,validators:V},U=H.validators,W=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Ye,response:new Ye}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=Error();let n=t.stack?t.stack.replace(/^.+\n/,``):``;try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,``))&&(e.stack+=` +`+n):e.stack=n}catch{}}throw e}}_request(e,t){typeof e==`string`?(t||={},t.url=e):t=e||{},t=z(this.defaults,t);let{transitional:n,paramsSerializer:r,headers:i}=t;n!==void 0&&H.assertOptions(n,{silentJSONParsing:U.transitional(U.boolean),forcedJSONParsing:U.transitional(U.boolean),clarifyTimeoutError:U.transitional(U.boolean),legacyInterceptorReqResOrdering:U.transitional(U.boolean)},!1),r!=null&&(E.isFunction(r)?t.paramsSerializer={serialize:r}:H.assertOptions(r,{encode:U.function,serialize:U.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls===void 0?t.allowAbsoluteUrls=!0:t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls),H.assertOptions(t,{baseUrl:U.spelling(`baseURL`),withXsrfToken:U.spelling(`withXSRFToken`)},!0),t.method=(t.method||this.defaults.method||`get`).toLowerCase();let a=i&&E.merge(i.common,i[t.method]);i&&E.forEach([`delete`,`get`,`head`,`post`,`put`,`patch`,`common`],e=>{delete i[e]}),t.headers=I.concat(a,i);let o=[],s=!0;this.interceptors.request.forEach(function(e){if(typeof e.runWhen==`function`&&e.runWhen(t)===!1)return;s&&=e.synchronous;let n=t.transitional||Xe;n&&n.legacyInterceptorReqResOrdering?o.unshift(e.fulfilled,e.rejected):o.push(e.fulfilled,e.rejected)});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let l,u=0,d;if(!s){let e=[Qt.bind(this),void 0];for(e.unshift(...o),e.push(...c),d=e.length,l=Promise.resolve(t);u{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t,r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new L(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){let e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;return{token:new e(function(e){t=e}),cancel:t}}};function rn(e){return function(t){return e.apply(null,t)}}function an(e){return E.isObject(e)&&e.isAxiosError===!0}var on={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(on).forEach(([e,t])=>{on[t]=e});function sn(e){let t=new W(e),n=r(W.prototype.request,t);return E.extend(n,W.prototype,t,{allOwnKeys:!0}),E.extend(n,t,null,{allOwnKeys:!0}),n.create=function(t){return sn(z(e,t))},n}var G=sn(N);G.Axios=W,G.CanceledError=L,G.CancelToken=nn,G.isCancel=vt,G.VERSION=$t,G.toFormData=A,G.AxiosError=D,G.Cancel=G.CanceledError,G.all=function(e){return Promise.all(e)},G.spread=rn,G.isAxiosError=an,G.mergeConfig=z,G.AxiosHeaders=I,G.formToJSON=e=>st(E.isHTMLForm(e)?new FormData(e):e),G.getAdapter=Xt.getAdapter,G.HttpStatusCode=on,G.default=G;var K=`pymc_jwt_token`,cn=`pymc_client_id`;function ln(){let e=localStorage.getItem(cn);return e||(e=`${Date.now()}-${Math.random().toString(36).substring(2,15)}`,localStorage.setItem(cn,e)),e}function q(){return localStorage.getItem(K)}function un(e){localStorage.setItem(K,e)}function J(){localStorage.removeItem(K)}function dn(){return q()!==null}function fn(e){try{let t=e.split(`.`)[1].replace(/-/g,`+`).replace(/_/g,`/`),n=decodeURIComponent(atob(t).split(``).map(e=>`%`+(`00`+e.charCodeAt(0).toString(16)).slice(-2)).join(``));return JSON.parse(n)}catch{return null}}function pn(){let e=q();if(!e)return!0;let t=fn(e);return!t||!t.exp?!0:Date.now()>=t.exp*1e3-3e4}function mn(){let e=q();if(!e)return!1;let t=fn(e);if(!t||!t.exp)return!1;let n=t.exp*1e3-Date.now();return n>0&&n<3e5}function hn(){let e=q();if(!e)return null;let t=fn(e);return!t||!t.sub?null:t.sub}var gn=`modulepreload`,_n=function(e){return`/`+e},vn={},Y=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=_n(t,n),t in vn)return;vn[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:gn,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},X=n({history:t(`/`),routes:[{path:`/setup`,name:`setup`,component:()=>Y(()=>import(`./Setup-wQ-fEW9F.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])),meta:{requiresAuth:!1,requiresSetup:!1}},{path:`/login`,name:`login`,component:()=>Y(()=>import(`./Login-Ci7Po_oi.js`),__vite__mapDeps([11,1,2,3,4,5,6,7,8,9,12])),meta:{requiresAuth:!1}},{path:`/`,name:`dashboard`,component:()=>Y(()=>import(`./Dashboard-CtkpxqA5.js`),__vite__mapDeps([13,1,2,3,4,5,6,7,8,9,14,15,16,17])),meta:{requiresAuth:!0}},{path:`/neighbors`,name:`neighbors`,component:()=>Y(()=>import(`./Neighbors-tK0iZybD.js`),__vite__mapDeps([18,1,19,2,3,4,5,6,7,8,9,20,15,16,21,22])),meta:{requiresAuth:!0}},{path:`/statistics`,name:`statistics`,component:()=>Y(()=>import(`./Statistics-m6h9b_Wm.js`),__vite__mapDeps([23,1,19,2,3,4,5,6,7,8,9,14,24,25,26,16,27])),meta:{requiresAuth:!0}},{path:`/system-stats`,name:`system-stats`,component:()=>Y(()=>import(`./SystemStats-DE5yghoc.js`),__vite__mapDeps([28,1,19,14,3,24,25,29])),meta:{requiresAuth:!0}},{path:`/configuration`,name:`configuration`,component:()=>Y(()=>import(`./Configuration-Db8EsEJI.js`),__vite__mapDeps([30,1,19,2,3,4,5,6,7,8,9,31,16,32,22])),meta:{requiresAuth:!0}},{path:`/cad-calibration`,name:`cad-calibration`,component:()=>Y(()=>import(`./CADCalibration-HkcF2-GW.js`),__vite__mapDeps([33,1,19,3,26,8,4,34])),meta:{requiresAuth:!0}},{path:`/sessions`,name:`sessions`,component:()=>Y(()=>import(`./Sessions-B4giR55K.js`),__vite__mapDeps([35,2,1,3,4,5,6,7,8,9])),meta:{requiresAuth:!0}},{path:`/room-servers`,name:`room-servers`,component:()=>Y(()=>import(`./RoomServers-CheebdAq.js`),__vite__mapDeps([36,2,1,3,4,5,6,7,8,9,31,37,16])),meta:{requiresAuth:!0}},{path:`/companions`,name:`companions`,component:()=>Y(()=>import(`./Companions-Cx-FcUOx.js`),__vite__mapDeps([38,2,1,3,4,5,6,7,8,9,31,37])),meta:{requiresAuth:!0}},{path:`/logs`,name:`logs`,component:()=>Y(()=>import(`./Logs-Deot7VVG.js`),__vite__mapDeps([39,3])),meta:{requiresAuth:!0}},{path:`/terminal`,name:`terminal`,component:()=>Y(()=>import(`./Terminal-G0FM7r0V.js`),__vite__mapDeps([40,1,2,3,4,5,6,7,8,9,41])),meta:{requiresAuth:!0}},{path:`/help`,name:`help`,component:()=>Y(()=>import(`./Help-1i4KzGWQ.js`),__vite__mapDeps([42,3])),meta:{requiresAuth:!0}}]});async function yn(){try{let e=await fetch(`/api/needs_setup`,{headers:{Accept:`application/json`}});return e.ok?(await e.json()).needs_setup===!0:(console.error(`Setup check failed:`,e.status),!1)}catch(e){return console.error(`Error checking setup status:`,e),!1}}X.beforeEach(async(e,t,n)=>{let r=e.meta.requiresAuth!==!1,i=dn();if(e.path!==`/setup`&&await yn()){n(`/setup`);return}if(e.path===`/setup`&&!await yn()){n(`/login`);return}r&&!i?n(`/login`):e.path===`/login`&&i?n(`/`):n()});var bn=`/api`,Z=!1,Q=null;async function xn(){return Z&&Q?Q:(Z=!0,Q=(async()=>{try{let e=q();if(!e)throw Error(`No token to refresh`);let t=ln(),n=await G.post(`/auth/refresh`,{client_id:t},{headers:{Authorization:`Bearer ${e}`,"Content-Type":`application/json`}});if(n.data.success&&n.data.token){let e=n.data.token;return un(e),e}else throw Error(`Token refresh failed`)}catch(e){throw console.error(`Token refresh error:`,e),J(),X.push(`/login`),e}finally{Z=!1,Q=null}})(),Q)}var $=G.create({baseURL:bn,timeout:5e3,headers:{"Content-Type":`application/json`}}),Sn=G.create({baseURL:``,timeout:5e3,headers:{"Content-Type":`application/json`}});Sn.interceptors.request.use(async e=>{if(e.url?.includes(`/auth/login`)||e.url?.includes(`/auth/refresh`))return e;let t=q();if(t){if(mn())try{let t=await xn();return e.headers.Authorization=`Bearer ${t}`,e}catch(e){return Promise.reject(e)}if(pn())return J(),X.push(`/login`),Promise.reject(Error(`Token expired`));e.headers.Authorization=`Bearer ${t}`}return e},e=>(console.error(`Auth API Request Error:`,e),Promise.reject(e))),Sn.interceptors.response.use(e=>e,e=>(e.response?.status===401&&(J(),X.currentRoute.value.path!==`/login`&&X.push(`/login`)),console.error(`Auth API Response Error:`,e.response?.data||e.message),Promise.reject(e))),$.interceptors.request.use(async e=>{if(e.url?.includes(`/auth/login`))return e;let t=q();if(t){if(mn())try{let t=await xn();return e.headers.Authorization=`Bearer ${t}`,e}catch(e){return Promise.reject(e)}if(pn())return J(),X.push(`/login`),Promise.reject(Error(`Token expired`));e.headers.Authorization=`Bearer ${t}`}return e},e=>(console.error(`API Request Error:`,e),Promise.reject(e))),$.interceptors.response.use(e=>e,e=>(e.response?.status===401&&(J(),X.currentRoute.value.path!==`/login`&&X.push(`/login`)),console.error(`API Response Error:`,e.response?.data||e.message),Promise.reject(e)));var Cn=class{static async get(e,t){try{return(await $.get(e,{params:t})).data}catch(e){throw this.handleError(e)}}static async post(e,t,n){try{return(await $.post(e,t,n)).data}catch(e){throw this.handleError(e)}}static async put(e,t,n){try{return(await $.put(e,t,n)).data}catch(e){throw this.handleError(e)}}static async delete(e,t){try{return(await $.delete(e,t)).data}catch(e){throw this.handleError(e)}}static async getTransportKeys(){return this.get(`transport_keys`)}static async sendAdvert(){return this.post(`send_advert`,{},{headers:{"Content-Type":`application/json`}})}static async createTransportKey(e,t,n,r,i){let a={name:e,flood_policy:t,parent_id:r,last_used:i};return n!==void 0&&(a.transport_key=n),this.post(`transport_keys`,a)}static async getTransportKey(e){return this.get(`transport_key/${e}`)}static async updateTransportKey(e,t,n,r,i,a){return this.put(`transport_key/${e}`,{name:t,flood_policy:n,transport_key:r,parent_id:i,last_used:a})}static async deleteTransportKey(e){return this.delete(`transport_key/${e}`)}static async updateUnscopedFloodPolicy(e){return this.post(`unscoped_flood_policy`,{unscoped_flood_allow:e})}static async getLogs(){try{return(await $.get(`logs`)).data}catch(e){throw this.handleError(e)}}static async deleteAdvert(e){return this.delete(`advert/${e}`)}static async pingNeighbor(e,t=10){return this.post(`ping_neighbor`,{target_id:e,timeout:t})}static async getIdentities(){return this.get(`identities`)}static async getIdentity(e){return this.get(`identity`,{name:e})}static async createIdentity(e){return this.post(`create_identity`,e)}static async updateIdentity(e){return this.put(`update_identity`,e)}static async deleteIdentity(e,t=`room_server`){let n=new URLSearchParams({name:e});return t===`companion`&&n.set(`type`,`companion`),this.delete(`delete_identity?${n.toString()}`)}static async sendRoomServerAdvert(e){return this.post(`send_room_server_advert`,{name:e})}static async importRepeaterContacts(e){return this.post(`companion/import_repeater_contacts`,e)}static async getACLInfo(){return this.get(`acl_info`)}static async getACLClients(e){return this.get(`acl_clients`,e)}static async removeACLClient(e){return this.post(`acl_remove_client`,e)}static async getACLStats(){return this.get(`acl_stats`)}static async getRoomMessages(e){return this.get(`room_messages`,e)}static async postRoomMessage(e){return this.post(`room_post_message`,e)}static async deleteRoomMessage(e){return this.delete(`room_message?room_name=${encodeURIComponent(e.room_name)}&message_id=${e.message_id}`)}static async clearRoomMessages(e){return this.delete(`room_messages?room_name=${encodeURIComponent(e)}`)}static async getRoomStats(e){return this.get(`room_stats`,e?{room_name:e}:void 0)}static async getRoomClients(e){return this.get(`room_clients`,{room_name:e})}static async exportConfig(e=!1){let t=e?`config_export?include_secrets=true`:`config_export`;return this.get(t)}static async importConfig(e){return this.post(`config_import`,{config:e})}static async exportIdentityKey(){return this.get(`identity_export`)}static async generateVanityKey(e,t=!1){return this.post(`generate_vanity_key`,{prefix:e,apply:t})}static async getDbStats(){return this.get(`db_stats`)}static async purgeTable(e){return this.post(`db_purge`,{tables:e})}static async vacuumDb(){return this.post(`db_vacuum`,{})}static handleError(e){if(G.isAxiosError(e)){if(e.response){let t=e.response.data?.error||e.response.data?.message||`HTTP ${e.response.status}`;return Error(t)}else if(e.request)return Error(`Network error - no response received`)}return Error(e instanceof Error?e.message:`Unknown error occurred`)}};export{J as a,hn as c,Y as i,dn as l,Sn as n,ln as o,X as r,q as s,Cn as t,un as u}; \ No newline at end of file diff --git a/repeater/web/html/assets/chart-B185MtDy.js b/repeater/web/html/assets/chart-B185MtDy.js deleted file mode 100644 index e3e48ba..0000000 --- a/repeater/web/html/assets/chart-B185MtDy.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * @kurkle/color v0.3.4 - * https://github.com/kurkle/color#readme - * (c) 2024 Jukka Kurkela - * Released under the MIT License - */function ae(i){return i+.5|0}const ut=(i,t,e)=>Math.max(Math.min(i,e),t);function Ut(i){return ut(ae(i*2.55),0,255)}function mt(i){return ut(ae(i*255),0,255)}function ct(i){return ut(ae(i/2.55)/100,0,1)}function Mi(i){return ut(ae(i*100),0,100)}const Z={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Ze=[..."0123456789ABCDEF"],In=i=>Ze[i&15],Fn=i=>Ze[(i&240)>>4]+Ze[i&15],he=i=>(i&240)>>4===(i&15),zn=i=>he(i.r)&&he(i.g)&&he(i.b)&&he(i.a);function Bn(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&Z[i[1]]*17,g:255&Z[i[2]]*17,b:255&Z[i[3]]*17,a:t===5?Z[i[4]]*17:255}:(t===7||t===9)&&(e={r:Z[i[1]]<<4|Z[i[2]],g:Z[i[3]]<<4|Z[i[4]],b:Z[i[5]]<<4|Z[i[6]],a:t===9?Z[i[7]]<<4|Z[i[8]]:255})),e}const Wn=(i,t)=>i<255?t(i):"";function Hn(i){var t=zn(i)?In:Fn;return i?"#"+t(i.r)+t(i.g)+t(i.b)+Wn(i.a,t):void 0}const Vn=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Vs(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function Nn(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function jn(i,t,e){const s=Vs(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function $n(i,t,e,s,n){return i===n?(t-e)/s+(t.5?h/(2-o-r):h/(o+r),l=$n(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function ai(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(mt)}function li(i,t,e){return ai(Vs,i,t,e)}function Yn(i,t,e){return ai(jn,i,t,e)}function Xn(i,t,e){return ai(Nn,i,t,e)}function Ns(i){return(i%360+360)%360}function Un(i){const t=Vn.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Ut(+t[5]):mt(+t[5]));const n=Ns(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=Yn(n,o,r):t[1]==="hsv"?s=Xn(n,o,r):s=li(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function Kn(i,t){var e=ri(i);e[0]=Ns(e[0]+t),e=li(e),i.r=e[0],i.g=e[1],i.b=e[2]}function qn(i){if(!i)return;const t=ri(i),e=t[0],s=Mi(t[1]),n=Mi(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${ct(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Si={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},ki={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Gn(){const i={},t=Object.keys(ki),e=Object.keys(Si);let s,n,o,r,a;for(s=0;s>16&255,o>>8&255,o&255]}return i}let de;function Jn(i){de||(de=Gn(),de.transparent=[0,0,0,0]);const t=de[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Zn=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Qn(i){const t=Zn.exec(i);let e=255,s,n,o;if(t){if(t[7]!==s){const r=+t[7];e=t[8]?Ut(r):ut(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Ut(s):ut(s,0,255)),n=255&(t[4]?Ut(n):ut(n,0,255)),o=255&(t[6]?Ut(o):ut(o,0,255)),{r:s,g:n,b:o,a:e}}}function to(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${ct(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Be=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Rt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function eo(i,t,e){const s=Rt(ct(i.r)),n=Rt(ct(i.g)),o=Rt(ct(i.b));return{r:mt(Be(s+e*(Rt(ct(t.r))-s))),g:mt(Be(n+e*(Rt(ct(t.g))-n))),b:mt(Be(o+e*(Rt(ct(t.b))-o))),a:i.a+e*(t.a-i.a)}}function fe(i,t,e){if(i){let s=ri(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=li(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function js(i,t){return i&&Object.assign(t||{},i)}function wi(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=mt(i[3]))):(t=js(i,{r:0,g:0,b:0,a:1}),t.a=mt(t.a)),t}function io(i){return i.charAt(0)==="r"?Qn(i):Un(i)}class te{constructor(t){if(t instanceof te)return t;const e=typeof t;let s;e==="object"?s=wi(t):e==="string"&&(s=Bn(t)||Jn(t)||io(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=js(this._rgb);return t&&(t.a=ct(t.a)),t}set rgb(t){this._rgb=wi(t)}rgbString(){return this._valid?to(this._rgb):void 0}hexString(){return this._valid?Hn(this._rgb):void 0}hslString(){return this._valid?qn(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=eo(this._rgb,t._rgb,e)),this}clone(){return new te(this.rgb)}alpha(t){return this._rgb.a=mt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ae(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return fe(this._rgb,2,t),this}darken(t){return fe(this._rgb,2,-t),this}saturate(t){return fe(this._rgb,1,t),this}desaturate(t){return fe(this._rgb,1,-t),this}rotate(t){return Kn(this._rgb,t),this}}/*! - * Chart.js v4.5.1 - * https://www.chartjs.org - * (c) 2025 Chart.js Contributors - * Released under the MIT License - */function rt(){}const so=(()=>{let i=0;return()=>i++})();function T(i){return i==null}function H(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function C(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function U(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function it(i,t){return U(i)?i:t}function P(i,t){return typeof i>"u"?t:i}const no=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,$s=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function I(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function R(i,t,e,s){let n,o,r;if(H(i))for(o=i.length,n=0;ni,x:i=>i.x,y:i=>i.y};function ao(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function lo(i){const t=ao(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function Dt(i,t){return(Pi[t]||(Pi[t]=lo(t)))(i)}function ci(i){return i.charAt(0).toUpperCase()+i.slice(1)}const ie=i=>typeof i<"u",bt=i=>typeof i=="function",Di=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function co(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const L=Math.PI,z=2*L,ho=z+L,De=Number.POSITIVE_INFINITY,fo=L/180,V=L/2,yt=L/4,Oi=L*2/3,Xs=Math.log10,ot=Math.sign;function Jt(i,t,e){return Math.abs(i-t)n-o).pop(),t}function go(i){return typeof i=="symbol"||typeof i=="object"&&i!==null&&!(Symbol.toPrimitive in i||"toString"in i||"valueOf"in i)}function Ft(i){return!go(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function po(i,t){const e=Math.round(i);return e-t<=i&&e+t>=i}function mo(i,t,e){let s,n,o;for(s=0,n=i.length;sl&&c=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function hi(i,t,e){e=e||(r=>i[r]1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const wt=(i,t,e,s)=>hi(i,e,s?n=>{const o=i[n][t];return oi[n][t]hi(i,e,s=>i[s][t]>=e);function vo(i,t,e){let s=0,n=i.length;for(;ss&&i[n-1]>e;)n--;return s>0||n{const s="_onData"+ci(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function Ti(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Ks.forEach(o=>{delete i[o]}),delete i._chartjs)}function qs(i){const t=new Set(i);return t.size===i.length?i:Array.from(t)}const Gs=function(){return typeof window>"u"?function(i){return i()}:window.requestAnimationFrame}();function Js(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,Gs.call(window,()=>{s=!1,i.apply(t,e)}))}}function So(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const di=i=>i==="start"?"left":i==="end"?"right":"center",$=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,ko=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function Zs(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,vScale:a,_parsed:l}=i,c=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,h=r.axis,{min:d,max:f,minDefined:u,maxDefined:p}=r.getUserBounds();if(u){if(n=Math.min(wt(l,h,d).lo,e?s:wt(t,h,r.getPixelForValue(d)).lo),c){const g=l.slice(0,n+1).reverse().findIndex(m=>!T(m[a.axis]));n-=Math.max(0,g)}n=Y(n,0,s-1)}if(p){let g=Math.max(wt(l,r.axis,f,!0).hi+1,e?0:wt(t,h,r.getPixelForValue(f),!0).hi+1);if(c){const m=l.slice(g-1).findIndex(b=>!T(b[a.axis]));g+=Math.max(0,m)}o=Y(g,n,s)-n}else o=s-n}return{start:n,count:o}}function Qs(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const ue=i=>i===0||i===1,Ri=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*z/e)),Li=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*z/e)+1,Zt={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*V)+1,easeOutSine:i=>Math.sin(i*V),easeInOutSine:i=>-.5*(Math.cos(L*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>ue(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>ue(i)?i:Ri(i,.075,.3),easeOutElastic:i=>ue(i)?i:Li(i,.075,.3),easeInOutElastic(i){return ue(i)?i:i<.5?.5*Ri(i*2,.1125,.45):.5+.5*Li(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Zt.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Zt.easeInBounce(i*2)*.5:Zt.easeOutBounce(i*2-1)*.5+.5};function fi(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ei(i){return fi(i)?i:new te(i)}function We(i){return fi(i)?i:new te(i).saturate(.5).darken(.1).hexString()}const wo=["x","y","borderWidth","radius","tension"],Po=["color","borderColor","backgroundColor"];function Do(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:Po},numbers:{type:"number",properties:wo}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function Oo(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Ii=new Map;function Co(i,t){t=t||{};const e=i+JSON.stringify(t);let s=Ii.get(e);return s||(s=new Intl.NumberFormat(i,t),Ii.set(e,s)),s}function ui(i,t,e){return Co(t,e).format(i)}const Ao={values(i){return H(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=To(i,e)}const r=Xs(Math.abs(o)),a=isNaN(r)?1:Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ui(i,s,l)}};function To(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var tn={formatters:Ao};function Ro(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:tn.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const Ot=Object.create(null),ti=Object.create(null);function Qt(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;ss.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>We(n.backgroundColor),this.hoverBorderColor=(s,n)=>We(n.borderColor),this.hoverColor=(s,n)=>We(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return He(this,t,e)}get(t){return Qt(this,t)}describe(t,e){return He(ti,t,e)}override(t,e){return He(Ot,t,e)}route(t,e,s,n){const o=Qt(this,t),r=Qt(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return C(l)?Object.assign({},c,l):P(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(e=>e(this))}}var W=new Lo({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[Do,Oo,Ro]);function Eo(i){return!i||T(i.size)||T(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Fi(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function vt(i,t,e){const s=i.currentDevicePixelRatio,n=e!==0?Math.max(e/2,.5):0;return Math.round((t-n)*s)/s+n}function zi(i,t){!t&&!i||(t=t||i.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,i.width,i.height),t.restore())}function ei(i,t,e,s){en(i,t,e,s,null)}function en(i,t,e,s,n){let o,r,a,l,c,h,d,f;const u=t.pointStyle,p=t.rotation,g=t.radius;let m=(p||0)*fo;if(u&&typeof u=="object"&&(o=u.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){i.save(),i.translate(e,s),i.rotate(m),i.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),i.restore();return}if(!(isNaN(g)||g<=0)){switch(i.beginPath(),u){default:n?i.ellipse(e,s,n/2,g,0,0,z):i.arc(e,s,g,0,z),i.closePath();break;case"triangle":h=n?n/2:g,i.moveTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Oi,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),m+=Oi,i.lineTo(e+Math.sin(m)*h,s-Math.cos(m)*g),i.closePath();break;case"rectRounded":c=g*.516,l=g-c,r=Math.cos(m+yt)*l,d=Math.cos(m+yt)*(n?n/2-c:l),a=Math.sin(m+yt)*l,f=Math.sin(m+yt)*(n?n/2-c:l),i.arc(e-d,s-a,c,m-L,m-V),i.arc(e+f,s-r,c,m-V,m),i.arc(e+d,s+a,c,m,m+V),i.arc(e-f,s+r,c,m+V,m+L),i.closePath();break;case"rect":if(!p){l=Math.SQRT1_2*g,h=n?n/2:l,i.rect(e-h,s-l,2*h,2*l);break}m+=yt;case"rectRot":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+f,s-r),i.lineTo(e+d,s+a),i.lineTo(e-f,s+r),i.closePath();break;case"crossRot":m+=yt;case"cross":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r);break;case"star":d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r),m+=yt,d=Math.cos(m)*(n?n/2:g),r=Math.cos(m)*g,a=Math.sin(m)*g,f=Math.sin(m)*(n?n/2:g),i.moveTo(e-d,s-a),i.lineTo(e+d,s+a),i.moveTo(e+f,s-r),i.lineTo(e-f,s+r);break;case"line":r=n?n/2:Math.cos(m)*g,a=Math.sin(m)*g,i.moveTo(e-r,s-a),i.lineTo(e+r,s+a);break;case"dash":i.moveTo(e,s),i.lineTo(e+Math.cos(m)*(n?n/2:g),s+Math.sin(m)*g);break;case!1:i.closePath();break}i.fill(),t.borderWidth>0&&i.stroke()}}function ne(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,zo(i,o),l=0;l+i||0;function gi(i,t){const e={},s=C(t),n=s?Object.keys(t):t,o=C(i)?s?r=>P(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=jo(o(r));return e}function sn(i){return gi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Et(i){return gi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function tt(i){const t=sn(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function X(i,t){i=i||{},t=t||W.font;let e=P(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=P(i.style,t.style);s&&!(""+s).match(Vo)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);const n={family:P(i.family,t.family),lineHeight:No(P(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:P(i.weight,t.weight),string:""};return n.string=Eo(n),n}function ge(i,t,e,s){let n,o,r;for(n=0,o=i.length;ne&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function Ct(i,t){return Object.assign(Object.create(i),t)}function pi(i,t=[""],e,s,n=()=>i[0]){const o=e||i;typeof s>"u"&&(s=an("_fallback",i));const r={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:a=>pi([a,...i],t,o,s)};return new Proxy(r,{deleteProperty(a,l){return delete a[l],delete a._keys,delete i[0][l],!0},get(a,l){return on(a,l,()=>Zo(l,t,i,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(a,l){return Wi(a).includes(l)},ownKeys(a){return Wi(a)},set(a,l,c){const h=a._storage||(a._storage=n());return a[l]=h[l]=c,delete a._keys,!0}})}function zt(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:nn(i,s),setContext:o=>zt(i,o,e,s),override:o=>zt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return on(o,r,()=>Xo(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function nn(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:bt(e)?e:()=>e,isIndexable:bt(s)?s:()=>s}}const Yo=(i,t)=>i?i+ci(t):t,mi=(i,t)=>C(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function on(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];const s=e();return i[t]=s,s}function Xo(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return bt(a)&&r.isScriptable(t)&&(a=Uo(t,a,i,e)),H(a)&&a.length&&(a=Ko(t,a,i,r.isIndexable)),mi(t,a)&&(a=zt(a,n,o&&o[t],r)),a}function Uo(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);a.add(i);let l=t(o,r||s);return a.delete(i),mi(i,l)&&(l=bi(n._scopes,n,i,l)),l}function Ko(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(typeof o.index<"u"&&s(i))return t[o.index%t.length];if(C(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=bi(c,n,i,h);t.push(zt(d,o,r&&r[i],a))}}return t}function rn(i,t,e){return bt(i)?i(t,e):i}const qo=(i,t)=>i===!0?t:typeof i=="string"?Dt(t,i):void 0;function Go(i,t,e,s,n){for(const o of t){const r=qo(e,o);if(r){i.add(r);const a=rn(r._fallback,e,n);if(typeof a<"u"&&a!==e&&a!==s)return a}else if(r===!1&&typeof s<"u"&&e!==s)return null}return!1}function bi(i,t,e,s){const n=t._rootScopes,o=rn(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=Bi(a,r,e,o||e,s);return l===null||typeof o<"u"&&o!==e&&(l=Bi(a,r,o,l,s),l===null)?!1:pi(Array.from(a),[""],n,o,()=>Jo(t,e,s))}function Bi(i,t,e,s,n){for(;e;)e=Go(i,t,e,s,n);return e}function Jo(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return H(n)&&C(e)?e:n||{}}function Zo(i,t,e,s){let n;for(const o of t)if(n=an(Yo(o,i),e),typeof n<"u")return mi(i,n)?bi(e,s,i,n):n}function an(i,t){for(const e of t){if(!e)continue;const s=e[i];if(typeof s<"u")return s}}function Wi(i){let t=i._keys;return t||(t=i._keys=Qo(i._scopes)),t}function Qo(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}const tr=Number.EPSILON||1e-14,Bt=(i,t)=>ti==="x"?"y":"x";function er(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=Qe(o,n),l=Qe(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,f=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+f*(r.x-n.x),y:o.y+f*(r.y-n.y)}}}function ir(i,t,e){const s=i.length;let n,o,r,a,l,c=Bt(i,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")nr(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;oi.ownerDocument.defaultView.getComputedStyle(i,null);function ar(i,t){return Ee(i).getPropertyValue(t)}const lr=["top","right","bottom","left"];function Pt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=lr[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const cr=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function hr(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(cr(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function St(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Ee(e),o=n.boxSizing==="border-box",r=Pt(n,"padding"),a=Pt(n,"border","width"),{x:l,y:c,box:h}=hr(i,e),d=r.left+(h&&a.left),f=r.top+(h&&a.top);let{width:u,height:p}=t;return o&&(u-=r.width+a.width,p-=r.height+a.height),{x:Math.round((l-d)/u*e.width/s),y:Math.round((c-f)/p*e.height/s)}}function dr(i,t,e){let s,n;if(t===void 0||e===void 0){const o=i&&xi(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Ee(o),l=Pt(a,"border","width"),c=Pt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=Ce(a.maxWidth,o,"clientWidth"),n=Ce(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||De,maxHeight:n||De}}const gt=i=>Math.round(i*10)/10;function fr(i,t,e,s){const n=Ee(i),o=Pt(n,"margin"),r=Ce(n.maxWidth,i,"clientWidth")||De,a=Ce(n.maxHeight,i,"clientHeight")||De,l=dr(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const f=Pt(n,"border","width"),u=Pt(n,"padding");c-=u.width+f.width,h-=u.height+f.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?c/s:h-o.height),c=gt(Math.min(c,r,l.maxWidth)),h=gt(Math.min(h,a,l.maxHeight)),c&&!h&&(h=gt(c/2)),(t!==void 0||e!==void 0)&&s&&l.height&&h>l.height&&(h=l.height,c=gt(Math.floor(h*s))),{width:c,height:h}}function Hi(i,t,e){const s=t||1,n=gt(i.height*s),o=gt(i.width*s);i.height=gt(i.height),i.width=gt(i.width);const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const ur=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};_i()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function Vi(i,t){const e=ar(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function kt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function gr(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function pr(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=kt(i,n,e),a=kt(n,o,e),l=kt(o,t,e),c=kt(r,a,e),h=kt(a,l,e);return kt(c,h,e)}const mr=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},br=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function It(i,t,e){return i?mr(t,e):br()}function cn(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function hn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function dn(i){return i==="angle"?{between:se,compare:_o,normalize:J}:{between:dt,compare:(t,e)=>t-e,normalize:t=>t}}function Ni({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function _r(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=dn(s),l=t.length;let{start:c,end:h,loop:d}=i,f,u;if(d){for(c+=l,h+=l,f=0,u=l;fl(n,v,b)&&a(n,v)!==0,x=()=>a(o,b)===0||l(o,v,b),M=()=>g||y(),S=()=>!g||x();for(let k=h,w=h;k<=d;++k)_=t[k%r],!_.skip&&(b=c(_[s]),b!==v&&(g=l(b,n,o),m===null&&M()&&(m=a(b,n)===0?k:w),m!==null&&S()&&(p.push(Ni({start:m,end:k,loop:f,count:r,style:u})),m=null),w=k,v=b));return m!==null&&p.push(Ni({start:m,end:d,loop:f,count:r,style:u})),p}function un(i,t){const e=[],s=i.segments;for(let n=0;nn&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function yr(i,t,e,s){const n=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function vr(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=xr(e,n,o,s);if(s===!0)return ji(i,[{start:r,end:a,loop:o}],e,t);const l=aa({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Gs.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var at=new wr;const Yi="transparent",Pr={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=Ei(i||Yi),n=s.valid&&Ei(t||Yi);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Dr{constructor(t,e,s,n){const o=e[s];n=ge([t.to,n,o,t.from]);const r=ge([t.from,o,n]);this._active=!0,this._fn=t.fn||Pr[t.type||typeof r],this._easing=Zt[t.easing]||Zt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ge([t.to,e,n,t.from]),this._from=ge([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;n{const o=t[n];if(!C(o))return;const r={};for(const a of e)r[a]=o[a];(H(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!s.has(a))&&s.set(a,r)})})}_animateOptions(t,e){const s=e.options,n=Cr(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Or(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const f=s.get(c);if(d)if(f&&d.active()){d.update(f,h,a);continue}else d.cancel();if(!f||!f.duration){t[c]=h;continue}o[c]=d=new Dr(f,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return at.add(this._chart,s),!0}}function Or(i,t){const e=[],s=Object.keys(t);for(let n=0;n0||!e&&o<0)return n.index}return null}function qi(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=Lr(o,r,s),d=t.length;let f;for(let u=0;ue[s].axis===t).shift()}function Fr(i,t){return Ct(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function zr(i,t,e){return Ct(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Nt(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}const je=i=>i==="reset"||i==="none",Gi=(i,t)=>t?i:Object.assign({},i),Br=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:mn(e,!0),values:null};class le{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ve(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Nt(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,f,u,p)=>d==="x"?f:d==="r"?p:u,o=e.xAxisID=P(s.xAxisID,Ne(t,"x")),r=e.yAxisID=P(s.yAxisID,Ne(t,"y")),a=e.rAxisID=P(s.rAxisID,Ne(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Ti(this._data,this),t._stacked&&Nt(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(C(e)){const n=this._cachedMeta;this._data=Rr(e,n)}else if(s!==e){if(s){Ti(s,this);const n=this._cachedMeta;Nt(n),n._parsed=[]}e&&Object.isExtensible(e)&&Mo(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Ve(e.vScale,e),e.stack!==s.stack&&(n=!0,Nt(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&(qi(this,e._parsed),e._stacked=Ve(e.vScale,e))}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,f;if(this._parsing===!1)s._parsed=n,s._sorted=!0,f=n;else{H(n[t])?f=this.parseArrayData(s,n,t,e):C(n[t])?f=this.parseObjectData(s,n,t,e):f=this.parsePrimitiveData(s,n,t,e);const u=()=>d[a]===null||c&&d[a]g||d=0;--f)if(!p()){this.updateRangeFromParsed(c,t,u,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n=0&&tthis.getContext(s,n,e),g=c.resolveNamedOptions(f,u,p,d);return g.$shared&&(g.$shared=l,o[r]=Object.freeze(Gi(g,l))),g}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),f=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(f,this.getContext(t,s,e))}const c=new pn(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||je(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){je(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!je(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;an-o))}return i._cache.$bar}function Hr(i){const t=i.iScale,e=Wr(t,i.type);let s=t._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(ie(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(n=0,o=e.length;n0?n[i-1]:null,a=iMath.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:r,max:a}}function bn(i,t,e,s){return H(i)?jr(i,t,e,s):t[e.axis]=e.parse(i,s),t}function Ji(i,t,e,s){const n=i.iScale,o=i.vScale,r=n.getLabels(),a=n===o,l=[];let c,h,d,f;for(c=e,h=e+s;c=e?1:-1)}function Yr(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.baseh.controller.options.grouped),o=s.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[s.axis],c=h=>{const d=h._parsed.find(u=>u[s.axis]===l),f=d&&d[h.vScale.axis];if(T(f)||isNaN(f))return!0};for(const h of n)if(!(e!==void 0&&c(h))&&((o===!1||r.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&r.push(h.stack),h.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,e=this.chart.options.indexAxis;return Object.keys(t).filter(s=>t[s].axis===e).shift()}_getAxis(){const t={},e=this.getFirstScaleIdForIndexAxis();for(const s of this.chart.data.datasets)t[P(this.chart.options.indexAxis==="x"?s.xAxisID:s.yAxisID,e)]=!0;return Object.keys(t)}_getStackIndex(t,e,s){const n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,n=[];let o,r;for(o=0,r=e.data.length;ose(v,a,l,!0)?1:Math.max(y,y*e,x,x*e),p=(v,y,x)=>se(v,a,l,!0)?-1:Math.min(y,y*e,x,x*e),g=u(0,c,d),m=u(V,h,f),b=p(L,c,d),_=p(L+V,h,f);s=(g-b)/2,n=(m-_)/2,o=-(g+b)/2,r=-(m+_)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:r}}class uc extends le{static id="doughnut";static defaults={datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"};static descriptors={_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data,{labels:{pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=t.legend.options;return e.labels.length&&e.datasets.length?e.labels.map((l,c)=>{const d=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(c),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:n,pointStyle:s,borderRadius:r&&(a||d.borderRadius),index:c}}):[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=l=>+s[l];if(C(s[t])){const{key:l="value"}=this._parsing;o=c=>+Dt(s[c],l)}let r,a;for(r=t,a=t+e;r0&&!isNaN(t)?z*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=ui(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,o,r,a,l;if(!t){for(n=0,o=s.data.datasets.length;n0&&this.getParsed(e-1);for(let x=0;x=_){S.skip=!0;continue}const k=this.getParsed(x),w=T(k[u]),D=S[f]=r.getPixelForValue(k[f],x),O=S[u]=o||w?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[u],x);S.skip=isNaN(D)||isNaN(O)||w,S.stop=x>0&&Math.abs(k[f]-y[f])>m,g&&(S.parsed=k,S.raw=c.data[x]),d&&(S.options=h||this.resolveDataElementOptions(x,M.active?"active":n)),b||this.updateElement(M,x,S,n),y=k}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}class pc extends le{static id="scatter";static defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};static overrides={interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}};getLabelAndValue(t){const e=this._cachedMeta,s=this.chart.data.labels||[],{xScale:n,yScale:o}=e,r=this.getParsed(t),a=n.getLabelForValue(r.x),l=o.getLabelForValue(r.y);return{label:s[t]||"",value:"("+a+", "+l+")"}}update(t){const e=this._cachedMeta,{data:s=[]}=e,n=this.chart._animationsDisabled;let{start:o,count:r}=Zs(e,s,n);if(this._drawStart=o,this._drawCount=r,Qs(e)&&(o=0,r=s.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=e;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=s;const c=this.resolveDatasetElementOptions(t);c.segment=this.options.segment,this.updateElement(a,void 0,{animated:!n,options:c},t)}else this.datasetElementType&&(delete e.dataset,this.datasetElementType=!1);this.updateElements(s,o,r,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,n),d=this.getSharedOptions(h),f=this.includeOptions(n,d),u=r.axis,p=a.axis,{spanGaps:g,segment:m}=this.options,b=Ft(g)?g:Number.POSITIVE_INFINITY,_=this.chart._animationsDisabled||o||n==="none";let v=e>0&&this.getParsed(e-1);for(let y=e;y0&&Math.abs(M[u]-v[u])>b,m&&(S.parsed=M,S.raw=c.data[y]),f&&(S.options=d||this.resolveDataElementOptions(y,x.active?"active":n)),_||this.updateElement(x,y,S,n),v=M}this.updateSharedOptions(d,n,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const s=t.dataset,n=s.options&&s.options.borderWidth||0;if(!e.length)return n;const o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,o,r)/2}}function Mt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class yi{static override(t){Object.assign(yi.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Mt()}parse(){return Mt()}format(){return Mt()}add(){return Mt()}diff(){return Mt()}startOf(){return Mt()}endOf(){return Mt()}}var Gr={_date:yi};function Jr(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale,l=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const c=a._reversePixels?yo:wt;if(s){if(n._sharedOptions){const h=o[0],d=typeof h.getRange=="function"&&h.getRange(t);if(d){const f=c(o,t,e-d),u=c(o,t,e+d);return{lo:f.lo,hi:u.hi}}}}else{const h=c(o,t,e);if(l){const{vScale:d}=n._cachedMeta,{_parsed:f}=i,u=f.slice(0,h.lo+1).reverse().findIndex(g=>!T(g[d.axis]));h.lo-=Math.max(0,u);const p=f.slice(h.hi).findIndex(g=>!T(g[d.axis]));h.hi+=Math.max(0,p)}return h}}return{lo:0,hi:o.length-1}}function Ie(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a{l[r]&&l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var ea={modes:{index(i,t,e,s){const n=St(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?Ye(i,n,o,s,r):Xe(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=St(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?Ye(i,n,o,s,r):Xe(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function es(i,t){return i.filter(e=>_n.indexOf(e.pos)===-1&&e.box.axis===t)}function $t(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function ia(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;ec.box.fullSize),!0),s=$t(jt(t,"left"),!0),n=$t(jt(t,"right")),o=$t(jt(t,"top"),!0),r=$t(jt(t,"bottom")),a=es(t,"x"),l=es(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:jt(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function is(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function xn(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function ra(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!C(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&xn(r,o.getPadding());const a=Math.max(0,t.outerWidth-is(r,i,"left","right")),l=Math.max(0,t.outerHeight-is(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function aa(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function la(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function Kt(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o{typeof g.beforeLayout=="function"&&g.beforeLayout()});const h=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),f=Object.assign({},n);xn(f,tt(s));const u=Object.assign({maxPadding:f,w:o,h:r,x:n.left,y:n.top},n),p=na(l.concat(c),d);Kt(a.fullSize,u,d,p),Kt(l,u,d,p),Kt(c,u,d,p)&&Kt(l,u,d,p),aa(u),ss(a.leftAndTop,u,d,p),u.x+=u.w,u.y+=u.h,ss(a.rightAndBottom,u,d,p),i.chartArea={left:u.left,top:u.top,right:u.left+u.w,bottom:u.top+u.h,height:u.h,width:u.w},R(a.chartArea,g=>{const m=g.box;Object.assign(m,i.chartArea),m.update(u.w,u.h,{left:0,top:0,right:0,bottom:0})})}};class yn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class ca extends yn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Se="$chartjs",ha={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ns=i=>i===null||i==="";function da(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[Se]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",ns(n)){const o=Vi(i,"width");o!==void 0&&(i.width=o)}if(ns(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Vi(i,"height");o!==void 0&&(i.height=o)}return i}const vn=ur?{passive:!0}:!1;function fa(i,t,e){i&&i.addEventListener(t,e,vn)}function ua(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,vn)}function ga(i,t){const e=ha[i.type]||i.type,{x:s,y:n}=St(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Ae(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function pa(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ae(a.addedNodes,s),r=r&&!Ae(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function ma(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ae(a.removedNodes,s),r=r&&!Ae(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const re=new Map;let os=0;function Mn(){const i=window.devicePixelRatio;i!==os&&(os=i,re.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function ba(i,t){re.size||window.addEventListener("resize",Mn),re.set(i,t)}function _a(i){re.delete(i),re.size||window.removeEventListener("resize",Mn)}function xa(i,t,e){const s=i.canvas,n=s&&xi(s);if(!n)return;const o=Js((a,l)=>{const c=n.clientWidth;e(a,l),c{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),ba(i,o),r}function Ue(i,t,e){e&&e.disconnect(),t==="resize"&&_a(i)}function ya(i,t,e){const s=i.canvas,n=Js(o=>{i.ctx!==null&&e(ga(o,i))},i);return fa(s,t,n),n}class va extends yn{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(da(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[Se])return!1;const s=e[Se].initial;["height","width"].forEach(o=>{const r=s[o];T(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Se],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:pa,detach:ma,resize:xa}[e]||ya;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:Ue,detach:Ue,resize:Ue}[e]||ua)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return fr(t,e,s,n)}isAttached(t){const e=t&&xi(t);return!!(e&&e.isConnected)}}function Ma(i){return!_i()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?ca:va}class ft{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return Ft(this.x)&&Ft(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}function Sa(i,t){const e=i.options.ticks,s=ka(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?Pa(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return Da(t,c,o,r/n),c;const h=wa(o,t,n);if(r>0){let d,f;const u=r>1?Math.round((l-a)/(r-1)):null;for(_e(t,c,h,T(u)?0:a-u,a),d=0,f=r-1;dn)return l}return Math.max(n,1)}function Pa(i){const t=[];let e,s;for(e=0,s=i.length;ei==="left"?"right":i==="right"?"left":i,rs=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e,as=(i,t)=>Math.min(t||i,i);function ls(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;or+a)))return l}function Ta(i,t){R(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;os?s:e,s=n&&e>s?e:s,{min:it(e,it(s,e)),max:it(s,it(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){I(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=$o(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,f=h.highest.height,u=Y(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:u/(s-1),d+6>a&&(a=u/(s-(t.offset?.5:1)),l=this.maxHeight-Yt(t.grid)-e.padding-cs(t.title,this.chart.options.font),c=Math.sqrt(d*d+f*f),r=bo(Math.min(Math.asin(Y((h.highest.height+6)/a,-1,1)),Math.asin(Y(l/c,-1,1))-Math.asin(Y(f/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=cs(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Yt(o)+l):(t.height=this.maxHeight,t.width=Yt(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:f}=this._getLabelSizes(),u=s.padding*2,p=ht(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(a){const b=s.mirror?0:m*d.width+g*f.height;t.height=Math.min(this.maxHeight,t.height+b+u)}else{const b=s.mirror?0:g*d.width+m*f.height;t.width=Math.min(this.maxWidth,t.width+b+u)}this._calculatePadding(c,h,m,g)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,u=0;l?c?(f=n*t.width,u=s*e.height):(f=s*t.height,u=n*e.width):o==="start"?u=e.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,u=e.width/2),this.paddingLeft=Math.max((f-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((u-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){I(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e({width:r[w]||0,height:a[w]||0});return{first:k(0),last:k(e-1),widest:k(M),highest:k(S),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return xo(this._alignToPixels?vt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*n?a/s:l/n:l*n0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Yt(o),u=[],p=a.setContext(this.getContext()),g=p.display?p.width:0,m=g/2,b=function(F){return vt(s,F,g)};let _,v,y,x,M,S,k,w,D,O,A,N;if(r==="top")_=b(this.bottom),S=this.bottom-f,w=_-m,O=b(t.top)+m,N=t.bottom;else if(r==="bottom")_=b(this.top),O=t.top,N=b(t.bottom)-m,S=_+m,w=this.top+f;else if(r==="left")_=b(this.right),M=this.right-f,k=_-m,D=b(t.left)+m,A=t.right;else if(r==="right")_=b(this.left),D=t.left,A=b(t.right)-m,M=_+m,k=this.left+f;else if(e==="x"){if(r==="center")_=b((t.top+t.bottom)/2+.5);else if(C(r)){const F=Object.keys(r)[0],B=r[F];_=b(this.chart.scales[F].getPixelForValue(B))}O=t.top,N=t.bottom,S=_+m,w=S+f}else if(e==="y"){if(r==="center")_=b((t.left+t.right)/2);else if(C(r)){const F=Object.keys(r)[0],B=r[F];_=b(this.chart.scales[F].getPixelForValue(B))}M=_-m,k=M-f,D=t.left,A=t.right}const G=P(n.ticks.maxTicksLimit,d),E=Math.max(1,Math.ceil(d/G));for(v=0;v0&&(xt-=_t/2);break}ce={left:xt,top:Vt,width:_t+Tt.width,height:Ht+Tt.height,color:E.backdropColor}}m.push({label:y,font:w,textOffset:A,options:{rotation:g,color:B,strokeColor:et,strokeWidth:j,textAlign:At,textBaseline:N,translation:[x,M],backdrop:ce}})}return m}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-ht(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?c="right":s==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,s==="near"?c="left":s==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o{this.draw(o)}}]:[{z:s,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");W.route(o,n,l,a)})}function Ba(i){return"id"in i&&"defaults"in i}class Wa{constructor(){this.controllers=new xe(le,"datasets",!0),this.elements=new xe(ft,"elements"),this.plugins=new xe(Object,"plugins"),this.scales=new xe(Wt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):R(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=ci(t);I(s["before"+n],[],s),e[t](s),I(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;eo.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function Va(i){const t={},e=[],s=Object.keys(nt.plugins.items);for(let o=0;o1&&hs(i[0].toLowerCase());if(s)return s}throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function ds(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function Ka(i,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(s=>s.xAxisID===i||s.yAxisID===i);if(e.length)return ds(i,"x",e[0])||ds(i,"y",e[0])}return{}}function qa(i,t){const e=Ot[i.type]||{scales:{}},s=t.scales||{},n=ii(i.type,t),o=Object.create(null);return Object.keys(s).forEach(r=>{const a=s[r];if(!C(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=si(r,a,Ka(r,i),W.scales[a.type]),c=Xa(l,n),h=e.scales||{};o[r]=Gt(Object.create(null),[{axis:l},a,h[l],h[c]])}),i.data.datasets.forEach(r=>{const a=r.type||i.type,l=r.indexAxis||ii(a,t),h=(Ot[a]||{}).scales||{};Object.keys(h).forEach(d=>{const f=Ya(d,l),u=r[f+"AxisID"]||f;o[u]=o[u]||Object.create(null),Gt(o[u],[{axis:f},s[u],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];Gt(a,[W.scales[a.type],W.scale])}),o}function Sn(i){const t=i.options||(i.options={});t.plugins=P(t.plugins,{}),t.scales=qa(i,t)}function kn(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function Ga(i){return i=i||{},i.data=kn(i.data),Sn(i),i}const fs=new Map,wn=new Set;function ye(i,t){let e=fs.get(i);return e||(e=t(),fs.set(i,e),wn.add(e)),e}const Xt=(i,t,e)=>{const s=Dt(t,e);s!==void 0&&i.add(s)};class Ja{constructor(t){this._config=Ga(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=kn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Sn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ye(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ye(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ye(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return ye(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Xt(l,t,d))),h.forEach(d=>Xt(l,n,d)),h.forEach(d=>Xt(l,Ot[o]||{},d)),h.forEach(d=>Xt(l,W,d)),h.forEach(d=>Xt(l,ti,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),wn.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ot[e]||{},W.datasets[e]||{},{type:e},W,ti]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=us(this._resolverCache,t,n);let l=r;if(Qa(r,e)){o.$shared=!1,s=bt(s)?s():s;const c=this.createResolver(t,s,a);l=zt(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=us(this._resolverCache,t,s);return C(e)?zt(o,e,void 0,n):o}}function us(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:pi(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const Za=i=>C(i)&&Object.getOwnPropertyNames(i).some(t=>bt(i[t]));function Qa(i,t){const{isScriptable:e,isIndexable:s}=nn(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(bt(a)||Za(a))||r&&H(a))return!0}return!1}var tl="4.5.1";const el=["top","bottom","left","right","chartArea"];function gs(i,t){return i==="top"||i==="bottom"||el.indexOf(i)===-1&&t==="x"}function ps(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function ms(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),I(e&&e.onComplete,[i],t)}function il(i){const t=i.chart,e=t.options.animation;I(e&&e.onProgress,[i],t)}function Pn(i){return _i()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const ke={},bs=i=>{const t=Pn(i);return Object.values(ke).filter(e=>e.canvas===t).pop()};function sl(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function nl(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}class ol{static defaults=W;static instances=ke;static overrides=Ot;static registry=nt;static version=tl;static getChart=bs;static register(...t){nt.add(...t),_s()}static unregister(...t){nt.remove(...t),_s()}constructor(t,e){const s=this.config=new Ja(e),n=Pn(t),o=bs(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Ma(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=so(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ha,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=So(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],ke[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}at.listen(this,"complete",ms),at.listen(this,"progress",il),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return T(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return nt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Hi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return zi(this.canvas,this.ctx),this}stop(){return at.stop(this),this}resize(t,e){at.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Hi(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),I(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};R(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=si(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),R(o,r=>{const a=r.options,l=a.id,c=si(l,a),h=P(a.type,r.dtype);(a.position===void 0||gs(a.position,c)!==gs(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const f=nt.getScale(h);d=new f({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),R(n,(r,a)=>{r||delete s[a]}),R(s,r=>{Q.configure(this,r,r.options),Q.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(ps("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){R(this.scales,t=>{Q.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!Di(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;sl(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Q.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],R(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s={meta:t,index:t.index,cancelable:!0},n=gn(this,t);this.notifyPlugins("beforeDatasetDraw",s)!==!1&&(n&&Re(e,n),t.controller.draw(),n&&Le(e),s.cancelable=!1,this.notifyPlugins("afterDatasetDraw",s))}isPointInArea(t){return ne(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=ea.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=Ct(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);ie(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),at.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};R(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){R(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},R(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!we(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=co(t),c=nl(t,this._lastEvent,s,l);s&&(this._lastEvent=null,I(o.onHover,[t,a,this],this),l&&I(o.onClick,[t,a,this],this));const h=!we(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}function _s(){return R(ol.instances,i=>i._plugins.invalidate())}function rl(i,t,e){const{startAngle:s,x:n,y:o,outerRadius:r,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:h}=l,d=Math.min(c/r,J(s-e));if(i.beginPath(),i.arc(n,o,r-c/2,s+d/2,e-d/2),a>0){const f=Math.min(c/a,J(s-e));i.arc(n,o,a+c/2,e-f/2,s+f/2,!0)}else{const f=Math.min(c/2,r*J(s-e));if(h==="round")i.arc(n,o,f,e-L/2,s+L/2,!0);else if(h==="bevel"){const u=2*f*f,p=-u*Math.cos(e+L/2)+n,g=-u*Math.sin(e+L/2)+o,m=u*Math.cos(s+L/2)+n,b=u*Math.sin(s+L/2)+o;i.lineTo(p,g),i.lineTo(m,b)}}i.closePath(),i.moveTo(0,0),i.rect(0,0,i.canvas.width,i.canvas.height),i.clip("evenodd")}function al(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=n/a;i.beginPath(),i.arc(o,r,a,s-c,e+c),l>n?(c=n/l,i.arc(o,r,l,e+c,s-c,!0)):i.arc(o,r,n,e+V,s-V),i.closePath(),i.clip()}function ll(i){return gi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function cl(i,t,e,s){const n=ll(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,s*t/2),a=l=>{const c=(e-Math.min(o,l))*s/2;return Y(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:Y(n.innerStart,0,r),innerEnd:Y(n.innerEnd,0,r)}}function Lt(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function Te(i,t,e,s,n,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),f=h>0?h+s+e+c:0;let u=0;const p=n-l;if(s){const E=h>0?h-s:0,F=d>0?d-s:0,B=(E+F)/2,et=B!==0?p*B/(B+s):p;u=(p-et)/2}const g=Math.max(.001,p*d-e/L)/d,m=(p-g)/2,b=l+m+u,_=n-m-u,{outerStart:v,outerEnd:y,innerStart:x,innerEnd:M}=cl(t,f,d,_-b),S=d-v,k=d-y,w=b+v/S,D=_-y/k,O=f+x,A=f+M,N=b+x/O,G=_-M/A;if(i.beginPath(),o){const E=(w+D)/2;if(i.arc(r,a,d,w,E),i.arc(r,a,d,E,D),y>0){const j=Lt(k,D,r,a);i.arc(j.x,j.y,y,D,_+V)}const F=Lt(A,_,r,a);if(i.lineTo(F.x,F.y),M>0){const j=Lt(A,G,r,a);i.arc(j.x,j.y,M,_+V,G+Math.PI)}const B=(_-M/f+(b+x/f))/2;if(i.arc(r,a,f,_-M/f,B,!0),i.arc(r,a,f,B,b+x/f,!0),x>0){const j=Lt(O,N,r,a);i.arc(j.x,j.y,x,N+Math.PI,b-V)}const et=Lt(S,b,r,a);if(i.lineTo(et.x,et.y),v>0){const j=Lt(S,w,r,a);i.arc(j.x,j.y,v,b-V,w)}}else{i.moveTo(r,a);const E=Math.cos(w)*d+r,F=Math.sin(w)*d+a;i.lineTo(E,F);const B=Math.cos(D)*d+r,et=Math.sin(D)*d+a;i.lineTo(B,et)}i.closePath()}function hl(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){Te(i,t,e,s,l,n);for(let c=0;c=L&&u===0&&h!=="miter"&&rl(i,t,g),o||(Te(i,t,e,s,g,n),i.stroke())}class mc extends ft{static id="arc";static defaults={borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:"backgroundColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(t){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,t&&Object.assign(this,t)}inRange(t,e,s){const n=this.getProps(["x","y"],s),{angle:o,distance:r}=Us(n,{x:t,y:e}),{startAngle:a,endAngle:l,innerRadius:c,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),f=(this.options.spacing+this.options.borderWidth)/2,u=P(d,l-a),p=se(o,a,l)&&a!==l,g=u>=z||p,m=dt(r,c+f,h+f);return g&&m}getCenterPoint(t){const{x:e,y:s,startAngle:n,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],t),{offset:l,spacing:c}=this.options,h=(n+o)/2,d=(r+a+c+l)/2;return{x:e+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:s}=this,n=(e.offset||0)/4,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=s>z?Math.floor(s/z):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();const a=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(a)*n,Math.sin(a)*n);const l=1-Math.sin(Math.min(L,s||0)),c=n*l;t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor,hl(t,this,c,o,r),dl(t,this,c,o,r),t.restore()}}function Dn(i,t,e=t){i.lineCap=P(e.borderCapStyle,t.borderCapStyle),i.setLineDash(P(e.borderDash,t.borderDash)),i.lineDashOffset=P(e.borderDashOffset,t.borderDashOffset),i.lineJoin=P(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=P(e.borderWidth,t.borderWidth),i.strokeStyle=P(e.borderColor,t.borderColor)}function fl(i,t,e){i.lineTo(e.x,e.y)}function ul(i){return i.stepped?Io:i.tension||i.cubicInterpolationMode==="monotone"?Fo:fl}function On(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=na&&o>a;return{count:s,start:l,loop:t.loop,ilen:c(r+(c?a-y:y))%o,v=()=>{g!==m&&(i.lineTo(h,m),i.lineTo(h,g),i.lineTo(h,b))};for(l&&(u=n[_(0)],i.moveTo(u.x,u.y)),f=0;f<=a;++f){if(u=n[_(f)],u.skip)continue;const y=u.x,x=u.y,M=y|0;M===p?(xm&&(m=x),h=(d*h+y)/++d):(v(),i.lineTo(y,x),p=M,d=0,g=m=x),b=x}v()}function ni(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?pl:gl}function ml(i){return i.stepped?gr:i.tension||i.cubicInterpolationMode==="monotone"?pr:kt}function bl(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Dn(i,t.options),i.stroke(n)}function _l(i,t,e,s){const{segments:n,options:o}=t,r=ni(t);for(const a of n)Dn(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const xl=typeof Path2D=="function";function yl(i,t,e,s){xl&&!t.options.segment?bl(i,t,e,s):_l(i,t,e,s)}class vi extends ft{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;rr(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=vr(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=un(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=ml(s);let c,h;for(c=0,h=r.length;c{a=Fe(r,a,n);const l=n[r],c=n[a];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Fe(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function ys(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function An(i,t){let e=[],s=!1;return H(i)?(s=!0,e=i):e=Dl(i,t),e.length?new vi({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function vs(i){return i&&i.fill!==!1}function Ol(i,t,e){let n=i[t].fill;const o=[t];let r;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!U(n))return n;if(r=i[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function Cl(i,t,e){const s=Ll(i);if(C(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return U(n)&&Math.floor(n)===n?Al(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Al(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function Tl(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:C(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Rl(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:C(i)?s=i.value:s=t.getBaseValue(),s}function Ll(i){const t=i.options,e=t.fill;let s=P(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function El(i){const{scale:t,index:e,line:s}=i,n=[],o=s.segments,r=s.points,a=Il(t,e);a.push(An({x:null,y:t.bottom},s));for(let l=0;l=0;--r){const a=n[r].$filler;a&&(a.line.updateControlPoints(o,a.axis),s&&a.fill&&Ge(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const o=s[n].$filler;vs(o)&&Ge(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!vs(s)||e.drawTime!=="beforeDatasetDraw"||Ge(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const ws=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},Yl=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Ps extends ft{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=I(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=X(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=ws(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,u=-h;return this.legendItems.forEach((p,g)=>{const m=s+e/2+o.measureText(p.text).width;(g===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(g>0?0:1)]=0,u+=h,f++),l[g]={left:0,top:u,row:f,width:m,height:n},c[c.length-1]+=m+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,f=0,u=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{const{itemWidth:_,itemHeight:v}=Xl(s,e,o,m,n);b>0&&u+v+2*a>h&&(d+=f+a,c.push({width:f,height:u}),p+=f+a,g++,f=u=0),l[b]={left:p,top:u,col:g,width:_,height:v},f=Math.max(f,_),u+=v+a}),d+=f,c.push({width:f,height:u}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=It(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=$(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=$(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=$(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=$(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Re(t,this),this._draw(),Le(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=W.color,l=It(t.rtl,this.left,this.width),c=X(r.font),{padding:h}=r,d=c.size,f=d/2;let u;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:g,itemHeight:m}=ws(r,d),b=function(M,S,k){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();const w=P(k.lineWidth,1);if(n.fillStyle=P(k.fillStyle,a),n.lineCap=P(k.lineCap,"butt"),n.lineDashOffset=P(k.lineDashOffset,0),n.lineJoin=P(k.lineJoin,"miter"),n.lineWidth=w,n.strokeStyle=P(k.strokeStyle,a),n.setLineDash(P(k.lineDash,[])),r.usePointStyle){const D={radius:g*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:w},O=l.xPlus(M,p/2),A=S+f;en(n,D,O,A,r.pointStyleWidth&&p)}else{const D=S+Math.max((d-g)/2,0),O=l.leftForLtr(M,p),A=Et(k.borderRadius);n.beginPath(),Object.values(A).some(N=>N!==0)?Oe(n,{x:O,y:D,w:p,h:g,radius:A}):n.rect(O,D,p,g),n.fill(),w!==0&&n.stroke()}n.restore()},_=function(M,S,k){oe(n,k.text,M,S+m/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();v?u={x:$(o,this.left+h,this.right-s[0]),y:this.top+h+y,line:0}:u={x:this.left+h,y:$(o,this.top+y+h,this.bottom-e[0].height),line:0},cn(this.ctx,t.textDirection);const x=m+h;this.legendItems.forEach((M,S)=>{n.strokeStyle=M.fontColor,n.fillStyle=M.fontColor;const k=n.measureText(M.text).width,w=l.textAlign(M.textAlign||(M.textAlign=r.textAlign)),D=p+f+k;let O=u.x,A=u.y;l.setWidth(this.width),v?S>0&&O+D+h>this.right&&(A=u.y+=x,u.line++,O=u.x=$(o,this.left+h,this.right-s[u.line])):S>0&&A+x>this.bottom&&(O=u.x=O+e[u.line].width+h,u.line++,A=u.y=$(o,this.top+y+h,this.bottom-e[u.line].height));const N=l.x(O);if(b(N,A,M),O=ko(w,O+p+f,v?O+D:this.right,t.rtl),_(l.x(O),A,M),v)u.x+=D+h;else if(typeof M.text!="string"){const G=c.lineHeight;u.y+=Rn(M,G)+h}else u.y+=x}),hn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=X(e.font),n=tt(e.padding);if(!e.display)return;const o=It(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),h=this.top+c,d=$(t.align,d,this.right-f);else{const p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);h=c+$(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}const u=$(a,d,d+f);r.textAlign=o.textAlign(di(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,oe(r,e.text,u,h,s)}_computeTitleHeight(){const t=this.options.title,e=X(t.font),s=tt(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(dt(t,this.left,this.right)&&dt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;so.length>r.length?o:r)),t+e.size/2+s.measureText(n).width}function Kl(i,t,e){let s=i;return typeof t.text!="string"&&(s=Rn(t,e)),s}function Rn(i,t){const e=i.text?i.text.length:0;return t*e}function ql(i,t){return!!((i==="mousemove"||i==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(i==="click"||i==="mouseup"))}var yc={id:"legend",_element:Ps,start(i,t,e){const s=i.legend=new Ps({ctx:i.ctx,options:e,chart:i});Q.configure(i,s,e),Q.addBox(i,s)},stop(i){Q.removeBox(i,i.legend),delete i.legend},beforeUpdate(i,t,e){const s=i.legend;Q.configure(i,s,e),s.options=e},afterUpdate(i){const t=i.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(i,t){t.replay||i.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(i,t,e){const s=t.datasetIndex,n=e.chart;n.isDatasetVisible(s)?(n.hide(s),t.hidden=!0):(n.show(s),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:i=>i.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=tt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:s||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class Ln extends ft{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const s=this.options;if(this.left=0,this.top=0,!s.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=H(s.text)?s.text.length:1;this._padding=tt(s.padding);const o=n*X(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:s,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=$(a,s,o),d=e+t,c=o-s):(r.position==="left"?(h=s+t,d=$(a,n,e),l=L*-.5):(h=o-t,d=$(a,e,n),l=L*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const s=X(e.font),o=s.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);oe(t,e.text,0,0,s,{color:e.color,maxWidth:l,rotation:c,textAlign:di(e.align),textBaseline:"middle",translation:[r,a]})}}function Gl(i,t){const e=new Ln({ctx:i.ctx,options:t,chart:i});Q.configure(i,e,t),Q.addBox(i,e),i.titleBlock=e}var vc={id:"title",_element:Ln,start(i,t,e){Gl(i,e)},stop(i){const t=i.titleBlock;Q.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){const s=i.titleBlock;Q.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const qt={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;ta+l)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e=t.x,s=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=i.length;o-1?i.split(` -`):i}function Jl(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Ds(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=X(t.bodyFont),c=X(t.titleFont),h=X(t.footerFont),d=o.length,f=n.length,u=s.length,p=tt(t.padding);let g=p.height,m=0,b=s.reduce((y,x)=>y+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(g+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const y=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;g+=u*y+(b-u)*l.lineHeight+(b-1)*t.bodySpacing}f&&(g+=t.footerMarginTop+f*h.lineHeight+(f-1)*t.footerSpacing);let _=0;const v=function(y){m=Math.max(m,e.measureText(y).width+_)};return e.save(),e.font=c.string,R(i.title,v),e.font=l.string,R(i.beforeBody.concat(i.afterBody),v),_=t.displayColors?r+2+t.boxPadding:0,R(s,y=>{R(y.before,v),R(y.lines,v),R(y.after,v)}),_=0,e.font=h.string,R(i.footer,v),e.restore(),m+=p.width,{width:m,height:g}}function Zl(i,t){const{y:e,height:s}=t;return ei.height-s/2?"bottom":"center"}function Ql(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function tc(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),Ql(c,i,t,e)&&(c="center"),c}function Os(i,t,e){const s=e.yAlign||t.yAlign||Zl(i,e);return{xAlign:e.xAlign||t.xAlign||tc(i,t,e,s),yAlign:s}}function ec(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function ic(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Cs(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:f,bottomRight:u}=Et(r);let p=ec(t,a);const g=ic(t,l,c);return l==="center"?a==="left"?p+=c:a==="right"&&(p-=c):a==="left"?p-=Math.max(h,f)+n:a==="right"&&(p+=Math.max(d,u)+n),{x:Y(p,0,s.width-t.width),y:Y(g,0,s.height-t.height)}}function ve(i,t,e){const s=tt(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function As(i){return st([],lt(i))}function sc(i,t,e){return Ct(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ts(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}const En={beforeTitle:rt,title(i){if(i.length>0){const t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex"u"?En[t].call(e,s):n}class Rs extends ft{static positioners=qt;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new pn(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=sc(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=K(s,"beforeTitle",this,t),o=K(s,"title",this,t),r=K(s,"afterTitle",this,t);let a=[];return a=st(a,lt(n)),a=st(a,lt(o)),a=st(a,lt(r)),a}getBeforeBody(t,e){return As(K(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:s}=e,n=[];return R(t,o=>{const r={before:[],lines:[],after:[]},a=Ts(s,o);st(r.before,lt(K(a,"beforeLabel",this,o))),st(r.lines,K(a,"label",this,o)),st(r.after,lt(K(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return As(K(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:s}=e,n=K(s,"beforeFooter",this,t),o=K(s,"footer",this,t),r=K(s,"afterFooter",this,t);let a=[];return a=st(a,lt(n)),a=st(a,lt(o)),a=st(a,lt(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;lt.filter(h,d,f,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),R(a,h=>{const d=Ts(t.callbacks,h);n.push(K(d,"labelColor",this,h)),o.push(K(d,"labelPointStyle",this,h)),r.push(K(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=qt[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=Ds(this,s),c=Object.assign({},a,l),h=Os(this.chart,s,c),d=Cs(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Et(a),{x:f,y:u}=t,{width:p,height:g}=e;let m,b,_,v,y,x;return o==="center"?(y=u+g/2,n==="left"?(m=f,b=m-r,v=y+r,x=y-r):(m=f+p,b=m+r,v=y-r,x=y+r),_=m):(n==="left"?b=f+Math.max(l,h)+r:n==="right"?b=f+p-Math.max(c,d)-r:b=this.caretX,o==="top"?(v=u,y=v-r,m=b-r,_=b+r):(v=u+g,y=v+r,m=b+r,_=b-r),x=v),{x1:m,x2:b,x3:_,y1:v,y2:y,y3:x}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=It(s.rtl,this.x,this.width);for(t.x=ve(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=X(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;l_!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,Oe(t,{x:g,y:p,w:c,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),Oe(t,{x:m,y:p+1,w:c-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,c,l),t.strokeRect(g,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(m,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=X(s.bodyFont);let f=d.lineHeight,u=0;const p=It(s.rtl,this.x,this.width),g=function(k){e.fillText(k,p.x(t.x+u),t.y+f/2),t.y+=f+o},m=p.textAlign(r);let b,_,v,y,x,M,S;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=ve(this,m,s),e.fillStyle=s.bodyColor,R(this.beforeBody,g),u=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,y=0,M=n.length;y0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=qt[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Ds(this,t),l=Object.assign({},r,this._size),c=Os(e,t,l),h=Cs(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=tt(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),cn(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),hn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!we(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!we(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=qt[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}var Mc={id:"tooltip",_element:Rs,positioners:qt,afterInit(i,t,e){e&&(i.tooltip=new Rs({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){const t=i.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){const e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:En},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const nc=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function oc(i,t,e,s){const n=i.indexOf(t);if(n===-1)return nc(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const rc=(i,t)=>i===null?null:Y(Math.round(i),0,t);function Ls(i){const t=this.getLabels();return i>=0&&ie.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function ac(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:f}=i,u=o||1,p=h-1,{min:g,max:m}=t,b=!T(r),_=!T(a),v=!T(c),y=(m-g)/(d+1);let x=Ci((m-g)/p/u)*u,M,S,k,w;if(x<1e-14&&!b&&!_)return[{value:g},{value:m}];w=Math.ceil(m/x)-Math.floor(g/x),w>p&&(x=Ci(w*x/p/u)*u),T(l)||(M=Math.pow(10,l),x=Math.ceil(x*M)/M),n==="ticks"?(S=Math.floor(g/x)*x,k=Math.ceil(m/x)*x):(S=g,k=m),b&&_&&o&&po((a-r)/o,x/1e3)?(w=Math.round(Math.min((a-r)/x,h)),x=(a-r)/w,S=r,k=a):v?(S=b?r:S,k=_?a:k,w=c-1,x=(k-S)/w):(w=(k-S)/x,Jt(w,Math.round(w),x/1e3)?w=Math.round(w):w=Math.ceil(w));const D=Math.max(Ai(x),Ai(S));M=Math.pow(10,T(l)?D:l),S=Math.round(S*M)/M,k=Math.round(k*M)/M;let O=0;for(b&&(f&&S!==r?(e.push({value:r}),Sa)break;e.push({value:A})}return _&&f&&k!==a?e.length&&Jt(e[e.length-1].value,a,Es(a,y,i))?e[e.length-1].value=a:e.push({value:a}):(!_||k===a)&&e.push({value:k}),e}function Es(i,t,{horizontal:e,minRotation:s}){const n=ht(s),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+i).length;return Math.min(t/o,r)}class lc extends Wt{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return T(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:s}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=s?o:l;if(t){const l=ot(n),c=ot(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=ac(n,o);return t.bounds==="ticks"&&mo(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return ui(t,this.chart.options.locale,this.options.ticks.format)}}class kc extends lc{static id="linear";static defaults={ticks:{callback:tn.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=U(t)?t:0,this.max=U(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=ht(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const ze={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},q=Object.keys(ze);function Is(i,t){return i-t}function Fs(i,t){if(T(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),U(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Ft(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function zs(i,t,e,s){const n=q.length;for(let o=q.indexOf(i);o=q.indexOf(e);o--){const r=q[o];if(ze[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return q[e?q.indexOf(e):0]}function hc(i){for(let t=q.indexOf(i)+1,e=q.length;t=t?e[s]:e[n];i[o]=!0}}function dc(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function Ws(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=Y(e,0,r),s=Y(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||zs(o.minUnit,e,s,this._getLabelCapacity(e)),a=P(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Ft(l)||l===!0,h={};let d=e,f,u;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const p=n.ticks.source==="data"&&this.getDataTimestamps();for(f=d,u=0;f+g)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.ticks.callback;if(r)return I(r,[t,e,s],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],f=s[e],u=c&&d&&f&&f.major;return this._adapter.format(t,n||(u?d:h))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=wt(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=wt(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class wc extends Hs{static id="timeseries";static defaults=Hs.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Me(e,this.min),this._tableRange=Me(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;rn-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),s=this.getLabelTimestamps();return e.length&&s.length?t=this.normalize(e.concat(s)):t=e.length?e:s,t=this._cache.all=t,t}getDecimalForValue(t){return(Me(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,s=this.getDecimalForPixel(t)/e.factor-e.end;return Me(this._table,s*this._tableRange+this._minPos,!0)}}export{mc as A,fc as B,ol as C,uc as D,kc as L,bc as P,pc as S,Hs as T,Sc as a,vi as b,gc as c,Mc as d,yc as e,_c as f,Gr as g,xc as i,vc as p}; diff --git a/repeater/web/html/assets/chart-DdrINt9G.js b/repeater/web/html/assets/chart-DdrINt9G.js new file mode 100644 index 0000000..bc5f155 --- /dev/null +++ b/repeater/web/html/assets/chart-DdrINt9G.js @@ -0,0 +1,3 @@ +function e(e){return e+.5|0}var t=(e,t,n)=>Math.max(Math.min(e,n),t);function n(n){return t(e(n*2.55),0,255)}function r(n){return t(e(n*255),0,255)}function i(n){return t(e(n/2.55)/100,0,1)}function a(n){return t(e(n*100),0,100)}var o={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},s=[...`0123456789ABCDEF`],c=e=>s[e&15],l=e=>s[(e&240)>>4]+s[e&15],u=e=>(e&240)>>4==(e&15),d=e=>u(e.r)&&u(e.g)&&u(e.b)&&u(e.a);function f(e){var t=e.length,n;return e[0]===`#`&&(t===4||t===5?n={r:255&o[e[1]]*17,g:255&o[e[2]]*17,b:255&o[e[3]]*17,a:t===5?o[e[4]]*17:255}:(t===7||t===9)&&(n={r:o[e[1]]<<4|o[e[2]],g:o[e[3]]<<4|o[e[4]],b:o[e[5]]<<4|o[e[6]],a:t===9?o[e[7]]<<4|o[e[8]]:255})),n}var p=(e,t)=>e<255?t(e):``;function m(e){var t=d(e)?c:l;return e?`#`+t(e.r)+t(e.g)+t(e.b)+p(e.a,t):void 0}var h=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function g(e,t,n){let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0),i(8),i(4)]}function _(e,t,n){let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function v(e,t,n){let r=g(e,1,.5),i;for(t+n>1&&(i=1/(t+n),t*=i,n*=i),i=0;i<3;i++)r[i]*=1-t-n,r[i]+=t;return r}function y(e,t,n,r,i){return e===i?(t-n)/r+(t.5?l/(2-i-a):l/(i+a),s=y(t,n,r,l,i),s=s*60+.5),[s|0,c||0,o]}function x(e,t,n,i){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,i)).map(r)}function S(e,t,n){return x(g,e,t,n)}function C(e,t,n){return x(v,e,t,n)}function w(e,t,n){return x(_,e,t,n)}function T(e){return(e%360+360)%360}function E(e){let t=h.exec(e),i=255,a;if(!t)return;t[5]!==a&&(i=t[6]?n(+t[5]):r(+t[5]));let o=T(+t[2]),s=t[3]/100,c=t[4]/100;return a=t[1]===`hwb`?C(o,s,c):t[1]===`hsv`?w(o,s,c):S(o,s,c),{r:a[0],g:a[1],b:a[2],a:i}}function D(e,t){var n=b(e);n[0]=T(n[0]+t),n=S(n),e.r=n[0],e.g=n[1],e.b=n[2]}function ee(e){if(!e)return;let t=b(e),n=t[0],r=a(t[1]),o=a(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${o}%, ${i(e.a)})`:`hsl(${n}, ${r}%, ${o}%)`}var O={x:`dark`,Z:`light`,Y:`re`,X:`blu`,W:`gr`,V:`medium`,U:`slate`,A:`ee`,T:`ol`,S:`or`,B:`ra`,C:`lateg`,D:`ights`,R:`in`,Q:`turquois`,E:`hi`,P:`ro`,O:`al`,N:`le`,M:`de`,L:`yello`,F:`en`,K:`ch`,G:`arks`,H:`ea`,I:`ightg`,J:`wh`},te={OiceXe:`f0f8ff`,antiquewEte:`faebd7`,aqua:`ffff`,aquamarRe:`7fffd4`,azuY:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`0`,blanKedOmond:`ffebcd`,Xe:`ff`,XeviTet:`8a2be2`,bPwn:`a52a2a`,burlywood:`deb887`,caMtXe:`5f9ea0`,KartYuse:`7fff00`,KocTate:`d2691e`,cSO:`ff7f50`,cSnflowerXe:`6495ed`,cSnsilk:`fff8dc`,crimson:`dc143c`,cyan:`ffff`,xXe:`8b`,xcyan:`8b8b`,xgTMnPd:`b8860b`,xWay:`a9a9a9`,xgYF:`6400`,xgYy:`a9a9a9`,xkhaki:`bdb76b`,xmagFta:`8b008b`,xTivegYF:`556b2f`,xSange:`ff8c00`,xScEd:`9932cc`,xYd:`8b0000`,xsOmon:`e9967a`,xsHgYF:`8fbc8f`,xUXe:`483d8b`,xUWay:`2f4f4f`,xUgYy:`2f4f4f`,xQe:`ced1`,xviTet:`9400d3`,dAppRk:`ff1493`,dApskyXe:`bfff`,dimWay:`696969`,dimgYy:`696969`,dodgerXe:`1e90ff`,fiYbrick:`b22222`,flSOwEte:`fffaf0`,foYstWAn:`228b22`,fuKsia:`ff00ff`,gaRsbSo:`dcdcdc`,ghostwEte:`f8f8ff`,gTd:`ffd700`,gTMnPd:`daa520`,Way:`808080`,gYF:`8000`,gYFLw:`adff2f`,gYy:`808080`,honeyMw:`f0fff0`,hotpRk:`ff69b4`,RdianYd:`cd5c5c`,Rdigo:`4b0082`,ivSy:`fffff0`,khaki:`f0e68c`,lavFMr:`e6e6fa`,lavFMrXsh:`fff0f5`,lawngYF:`7cfc00`,NmoncEffon:`fffacd`,ZXe:`add8e6`,ZcSO:`f08080`,Zcyan:`e0ffff`,ZgTMnPdLw:`fafad2`,ZWay:`d3d3d3`,ZgYF:`90ee90`,ZgYy:`d3d3d3`,ZpRk:`ffb6c1`,ZsOmon:`ffa07a`,ZsHgYF:`20b2aa`,ZskyXe:`87cefa`,ZUWay:`778899`,ZUgYy:`778899`,ZstAlXe:`b0c4de`,ZLw:`ffffe0`,lime:`ff00`,limegYF:`32cd32`,lRF:`faf0e6`,magFta:`ff00ff`,maPon:`800000`,VaquamarRe:`66cdaa`,VXe:`cd`,VScEd:`ba55d3`,VpurpN:`9370db`,VsHgYF:`3cb371`,VUXe:`7b68ee`,VsprRggYF:`fa9a`,VQe:`48d1cc`,VviTetYd:`c71585`,midnightXe:`191970`,mRtcYam:`f5fffa`,mistyPse:`ffe4e1`,moccasR:`ffe4b5`,navajowEte:`ffdead`,navy:`80`,Tdlace:`fdf5e6`,Tive:`808000`,TivedBb:`6b8e23`,Sange:`ffa500`,SangeYd:`ff4500`,ScEd:`da70d6`,pOegTMnPd:`eee8aa`,pOegYF:`98fb98`,pOeQe:`afeeee`,pOeviTetYd:`db7093`,papayawEp:`ffefd5`,pHKpuff:`ffdab9`,peru:`cd853f`,pRk:`ffc0cb`,plum:`dda0dd`,powMrXe:`b0e0e6`,purpN:`800080`,YbeccapurpN:`663399`,Yd:`ff0000`,Psybrown:`bc8f8f`,PyOXe:`4169e1`,saddNbPwn:`8b4513`,sOmon:`fa8072`,sandybPwn:`f4a460`,sHgYF:`2e8b57`,sHshell:`fff5ee`,siFna:`a0522d`,silver:`c0c0c0`,skyXe:`87ceeb`,UXe:`6a5acd`,UWay:`708090`,UgYy:`708090`,snow:`fffafa`,sprRggYF:`ff7f`,stAlXe:`4682b4`,tan:`d2b48c`,teO:`8080`,tEstN:`d8bfd8`,tomato:`ff6347`,Qe:`40e0d0`,viTet:`ee82ee`,JHt:`f5deb3`,wEte:`ffffff`,wEtesmoke:`f5f5f5`,Lw:`ffff00`,LwgYF:`9acd32`};function ne(){let e={},t=Object.keys(te),n=Object.keys(O),r,i,a,o,s;for(r=0;r>16&255,a>>8&255,a&255]}return e}var re;function ie(e){re||(re=ne(),re.transparent=[0,0,0,0]);let t=re[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}var ae=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function oe(e){let r=ae.exec(e),i=255,a,o,s;if(r){if(r[7]!==a){let e=+r[7];i=r[8]?n(e):t(e*255,0,255)}return a=+r[1],o=+r[3],s=+r[5],a=255&(r[2]?n(a):t(a,0,255)),o=255&(r[4]?n(o):t(o,0,255)),s=255&(r[6]?n(s):t(s,0,255)),{r:a,g:o,b:s,a:i}}}function se(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${i(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var ce=e=>e<=.0031308?e*12.92:e**(1/2.4)*1.055-.055,le=e=>e<=.04045?e/12.92:((e+.055)/1.055)**2.4;function ue(e,t,n){let a=le(i(e.r)),o=le(i(e.g)),s=le(i(e.b));return{r:r(ce(a+n*(le(i(t.r))-a))),g:r(ce(o+n*(le(i(t.g))-o))),b:r(ce(s+n*(le(i(t.b))-s))),a:e.a+n*(t.a-e.a)}}function de(e,t,n){if(e){let r=b(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=S(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function fe(e,t){return e&&Object.assign(t||{},e)}function pe(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=r(e[3]))):(t=fe(e,{r:0,g:0,b:0,a:1}),t.a=r(t.a)),t}function me(e){return e.charAt(0)===`r`?oe(e):E(e)}var he=class t{constructor(e){if(e instanceof t)return e;let n=typeof e,r;n===`object`?r=pe(e):n===`string`&&(r=f(e)||ie(e)||me(e)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var e=fe(this._rgb);return e&&(e.a=i(e.a)),e}set rgb(e){this._rgb=pe(e)}rgbString(){return this._valid?se(this._rgb):void 0}hexString(){return this._valid?m(this._rgb):void 0}hslString(){return this._valid?ee(this._rgb):void 0}mix(e,t){if(e){let n=this.rgb,r=e.rgb,i,a=t===i?.5:t,o=2*a-1,s=n.a-r.a,c=((o*s===-1?o:(o+s)/(1+o*s))+1)/2;i=1-c,n.r=255&c*n.r+i*r.r+.5,n.g=255&c*n.g+i*r.g+.5,n.b=255&c*n.b+i*r.b+.5,n.a=a*n.a+(1-a)*r.a,this.rgb=n}return this}interpolate(e,t){return e&&(this._rgb=ue(this._rgb,e._rgb,t)),this}clone(){return new t(this.rgb)}alpha(e){return this._rgb.a=r(e),this}clearer(e){let t=this._rgb;return t.a*=1-e,this}greyscale(){let t=this._rgb;return t.r=t.g=t.b=e(t.r*.3+t.g*.59+t.b*.11),this}opaquer(e){let t=this._rgb;return t.a*=1+e,this}negate(){let e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return de(this._rgb,2,e),this}darken(e){return de(this._rgb,2,-e),this}saturate(e){return de(this._rgb,1,e),this}desaturate(e){return de(this._rgb,1,-e),this}rotate(e){return D(this._rgb,e),this}};function ge(){}var _e=(()=>{let e=0;return()=>e++})();function k(e){return e==null}function A(e){if(Array.isArray&&Array.isArray(e))return!0;let t=Object.prototype.toString.call(e);return t.slice(0,7)===`[object`&&t.slice(-6)===`Array]`}function j(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function M(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function N(e,t){return M(e)?e:t}function P(e,t){return e===void 0?t:e}var ve=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/t,ye=(e,t)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*t:+e;function F(e,t,n){if(e&&typeof e.call==`function`)return e.apply(n,t)}function I(e,t,n,r){let i,a,o;if(A(e))if(a=e.length,r)for(i=a-1;i>=0;i--)t.call(n,e[i],i);else for(i=0;ie,x:e=>e.x,y:e=>e.y};function Oe(e){let t=e.split(`.`),n=[],r=``;for(let e of t)r+=e,r.endsWith(`\\`)?r=r.slice(0,-1)+`.`:(n.push(r),r=``);return n}function ke(e){let t=Oe(e);return e=>{for(let n of t){if(n===``)break;e&&=e[n]}return e}}function Ae(e,t){return(De[t]||(De[t]=ke(t)))(e)}function je(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Me=e=>e!==void 0,Ne=e=>typeof e==`function`,Pe=(e,t)=>{if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0};function Fe(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var L=Math.PI,R=2*L,Ie=R+L,Le=1/0,Re=L/180,z=L/2,ze=L/4,Be=L*2/3,Ve=Math.log10,B=Math.sign;function He(e,t,n){return Math.abs(e-t)e-t).pop(),t}function Ge(e){return typeof e==`symbol`||typeof e==`object`&&!!e&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function Ke(e){return!Ge(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function qe(e,t){let n=Math.round(e);return n-t<=e&&n+t>=e}function Je(e,t,n){let r,i,a;for(r=0,i=e.length;rc&&l=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function rt(e,t,n){n||=(n=>e[n]1;)a=i+r>>1,n(a)?i=a:r=a;return{lo:i,hi:r}}var it=(e,t,n,r)=>rt(e,n,r?r=>{let i=e[r][t];return ie[r][t]rt(e,n,r=>e[r][t]>=n);function ot(e,t,n){let r=0,i=e.length;for(;rr&&e[i-1]>n;)i--;return r>0||i{let n=`_onData`+je(t),r=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...t){let i=r.apply(this,t);return e._chartjs.listeners.forEach(e=>{typeof e[n]==`function`&&e[n](...t)}),i}})})}function lt(e,t){let n=e._chartjs;if(!n)return;let r=n.listeners,i=r.indexOf(t);i!==-1&&r.splice(i,1),!(r.length>0)&&(st.forEach(t=>{delete e[t]}),delete e._chartjs)}function ut(e){let t=new Set(e);return t.size===e.length?e:Array.from(t)}var dt=function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame}();function ft(e,t){let n=[],r=!1;return function(...i){n=i,r||(r=!0,dt.call(window,()=>{r=!1,e.apply(t,n)}))}}function pt(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}var mt=e=>e===`start`?`left`:e===`end`?`right`:`center`,W=(e,t,n)=>e===`start`?t:e===`end`?n:(t+n)/2,ht=(e,t,n,r)=>e===(r?`left`:`right`)?n:e===`center`?(t+n)/2:t;function gt(e,t,n){let r=t.length,i=0,a=r;if(e._sorted){let{iScale:o,vScale:s,_parsed:c}=e,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,u=o.axis,{min:d,max:f,minDefined:p,maxDefined:m}=o.getUserBounds();if(p){if(i=Math.min(it(c,u,d).lo,n?r:it(t,u,o.getPixelForValue(d)).lo),l){let e=c.slice(0,i+1).reverse().findIndex(e=>!k(e[s.axis]));i-=Math.max(0,e)}i=U(i,0,r-1)}if(m){let e=Math.max(it(c,o.axis,f,!0).hi+1,n?0:it(t,u,o.getPixelForValue(f),!0).hi+1);if(l){let t=c.slice(e-1).findIndex(e=>!k(e[s.axis]));e+=Math.max(0,t)}a=U(e,i,r)-i}else a=r-i}return{start:i,count:a}}function _t(e){let{xScale:t,yScale:n,_scaleRanges:r}=e,i={xmin:t.min,xmax:t.max,ymin:n.min,ymax:n.max};if(!r)return e._scaleRanges=i,!0;let a=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==n.min||r.ymax!==n.max;return Object.assign(r,i),a}var vt=e=>e===0||e===1,yt=(e,t,n)=>-(2**(10*--e)*Math.sin((e-t)*R/n)),bt=(e,t,n)=>2**(-10*e)*Math.sin((e-t)*R/n)+1,xt={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>--e*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-(--e*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>--e*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*z)+1,easeOutSine:e=>Math.sin(e*z),easeInOutSine:e=>-.5*(Math.cos(L*e)-1),easeInExpo:e=>e===0?0:2**(10*(e-1)),easeOutExpo:e=>e===1?1:-(2**(-10*e))+1,easeInOutExpo:e=>vt(e)?e:e<.5?.5*2**(10*(e*2-1)):.5*(-(2**(-10*(e*2-1)))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1- --e*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>vt(e)?e:yt(e,.075,.3),easeOutElastic:e=>vt(e)?e:bt(e,.075,.3),easeInOutElastic(e){let t=.1125,n=.45;return vt(e)?e:e<.5?.5*yt(e*2,t,n):.5+.5*bt(e*2-1,t,n)},easeInBack(e){let t=1.70158;return e*e*((t+1)*e-t)},easeOutBack(e){let t=1.70158;return--e*e*((t+1)*e+t)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-xt.easeOutBounce(1-e),easeOutBounce(e){let t=7.5625,n=2.75;return e<1/n?t*e*e:e<2/n?t*(e-=1.5/n)*e+.75:e<2.5/n?t*(e-=2.25/n)*e+.9375:t*(e-=2.625/n)*e+.984375},easeInOutBounce:e=>e<.5?xt.easeInBounce(e*2)*.5:xt.easeOutBounce(e*2-1)*.5+.5};function St(e){if(e&&typeof e==`object`){let t=e.toString();return t===`[object CanvasPattern]`||t===`[object CanvasGradient]`}return!1}function Ct(e){return St(e)?e:new he(e)}function wt(e){return St(e)?e:new he(e).saturate(.5).darken(.1).hexString()}var Tt=[`x`,`y`,`borderWidth`,`radius`,`tension`],Et=[`color`,`borderColor`,`backgroundColor`];function Dt(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:e=>e!==`onProgress`&&e!==`onComplete`&&e!==`fn`}),e.set(`animations`,{colors:{type:`color`,properties:Et},numbers:{type:`number`,properties:Tt}}),e.describe(`animations`,{_fallback:`animation`}),e.set(`transitions`,{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:`transparent`},visible:{type:`boolean`,duration:0}}},hide:{animations:{colors:{to:`transparent`},visible:{type:`boolean`,easing:`linear`,fn:e=>e|0}}}})}function Ot(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var kt=new Map;function At(e,t){t||={};let n=e+JSON.stringify(t),r=kt.get(n);return r||(r=new Intl.NumberFormat(e,t),kt.set(n,r)),r}function jt(e,t,n){return At(t,n).format(e)}var Mt={values(e){return A(e)?e:``+e},numeric(e,t,n){if(e===0)return`0`;let r=this.chart.options.locale,i,a=e;if(n.length>1){let t=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(t<1e-4||t>0x38d7ea4c68000)&&(i=`scientific`),a=Nt(e,n)}let o=Ve(Math.abs(a)),s=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:i,minimumFractionDigits:s,maximumFractionDigits:s};return Object.assign(c,this.options.ticks.format),jt(e,r,c)},logarithmic(e,t,n){if(e===0)return`0`;let r=n[t].significand||e/10**Math.floor(Ve(e));return[1,2,3,5,10,15].includes(r)||t>.8*n.length?Mt.numeric.call(this,e,t,n):``}};function Nt(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var Pt={formatters:Mt};function Ft(e){e.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Pt.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:e=>!e.startsWith(`before`)&&!e.startsWith(`after`)&&e!==`callback`&&e!==`parser`,_indexable:e=>e!==`borderDash`&&e!==`tickBorderDash`&&e!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:e=>e!==`backdropPadding`&&e!==`callback`,_indexable:e=>e!==`backdropPadding`})}var It=Object.create(null),Lt=Object.create(null);function Rt(e,t){if(!t)return e;let n=t.split(`.`);for(let t=0,r=n.length;te.chart.platform.getDevicePixelRatio(),this.elements={},this.events=[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`],this.font={family:`'Helvetica Neue', 'Helvetica', 'Arial', sans-serif`,size:12,style:`normal`,lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,t)=>wt(t.backgroundColor),this.hoverBorderColor=(e,t)=>wt(t.borderColor),this.hoverColor=(e,t)=>wt(t.color),this.indexAxis=`x`,this.interaction={mode:`nearest`,intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e),this.apply(t)}set(e,t){return zt(this,e,t)}get(e){return Rt(this,e)}describe(e,t){return zt(Lt,e,t)}override(e,t){return zt(It,e,t)}route(e,t,n,r){let i=Rt(this,e),a=Rt(this,n),o=`_`+t;Object.defineProperties(i,{[o]:{value:i[t],writable:!0},[t]:{enumerable:!0,get(){let e=this[o],t=a[r];return j(e)?Object.assign({},t,e):P(e,t)},set(e){this[o]=e}}})}apply(e){e.forEach(e=>e(this))}}({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[Dt,Ot,Ft]);function Bt(e){return!e||k(e.size)||k(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function Vt(e,t,n,r,i){let a=t[i];return a||(a=t[i]=e.measureText(i).width,n.push(i)),a>r&&(r=a),r}function Ht(e,t,n,r){r||={};let i=r.data=r.data||{},a=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(i=r.data={},a=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let o=0,s=n.length,c,l,u,d,f;for(c=0;cn.length){for(c=0;c0&&e.stroke()}}function K(e,t,n){return n||=.5,!t||e&&e.x>t.left-n&&e.xt.top-n&&e.y0&&a.strokeColor!==``,c,l;for(e.save(),e.font=i.string,Zt(e,a),c=0;c+e||0;function sn(e,t){let n={},r=j(t),i=r?Object.keys(t):t,a=j(e)?r?n=>P(e[n],e[t[n]]):t=>e[t]:()=>e;for(let e of i)n[e]=on(a(e));return n}function cn(e){return sn(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function ln(e){return sn(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function q(e){let t=cn(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function J(e,t){e||={},t||=G.font;let n=P(e.size,t.size);typeof n==`string`&&(n=parseInt(n,10));let r=P(e.style,t.style);r&&!(``+r).match(rn)&&(console.warn(`Invalid font style specified: "`+r+`"`),r=void 0);let i={family:P(e.family,t.family),lineHeight:an(P(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:P(e.weight,t.weight),string:``};return i.string=Bt(i),i}function un(e,t,n,r){let i=!0,a,o,s;for(a=0,o=e.length;an&&e===0?0:e+t;return{min:o(r,-Math.abs(a)),max:o(i,a)}}function fn(e,t){return Object.assign(Object.create(e),t)}function pn(e,t=[``],n,r,i=()=>e[0]){let a=n||e;return r===void 0&&(r=kn(`_fallback`,e)),new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:a,_fallback:r,_getTarget:i,override:n=>pn([n,...e],t,a,r)},{deleteProperty(t,n){return delete t[n],delete t._keys,delete e[0][n],!0},get(n,r){return vn(n,r,()=>On(r,t,e,n))},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(e._scopes[0],t)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(e,t){return An(e).includes(t)},ownKeys(e){return An(e)},set(e,t,n){let r=e._storage||=i();return e[t]=r[t]=n,delete e._keys,!0}})}function mn(e,t,n,r){let i={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:hn(e,r),setContext:t=>mn(e,t,n,r),override:i=>mn(e.override(i),t,n,r)};return new Proxy(i,{deleteProperty(t,n){return delete t[n],delete e[n],!0},get(e,t,n){return vn(e,t,()=>yn(e,t,n))},getOwnPropertyDescriptor(t,n){return t._descriptors.allKeys?Reflect.has(e,n)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,n)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(t,n){return Reflect.has(e,n)},ownKeys(){return Reflect.ownKeys(e)},set(t,n,r){return e[n]=r,delete t[n],!0}})}function hn(e,t={scriptable:!0,indexable:!0}){let{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:i=t.allKeys}=e;return{allKeys:i,scriptable:n,indexable:r,isScriptable:Ne(n)?n:()=>n,isIndexable:Ne(r)?r:()=>r}}var gn=(e,t)=>e?e+je(t):t,_n=(e,t)=>j(t)&&e!==`adapters`&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function vn(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t===`constructor`)return e[t];let r=n();return e[t]=r,r}function yn(e,t,n){let{_proxy:r,_context:i,_subProxy:a,_descriptors:o}=e,s=r[t];return Ne(s)&&o.isScriptable(t)&&(s=bn(t,s,e,n)),A(s)&&s.length&&(s=xn(t,s,e,o.isIndexable)),_n(t,s)&&(s=mn(s,i,a&&a[t],o)),s}function bn(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_stack:s}=n;if(s.has(e))throw Error(`Recursion detected: `+Array.from(s).join(`->`)+`->`+e);s.add(e);let c=t(a,o||r);return s.delete(e),_n(e,c)&&(c=Tn(i._scopes,i,e,c)),c}function xn(e,t,n,r){let{_proxy:i,_context:a,_subProxy:o,_descriptors:s}=n;if(a.index!==void 0&&r(e))return t[a.index%t.length];if(j(t[0])){let n=t,r=i._scopes.filter(e=>e!==n);t=[];for(let c of n){let n=Tn(r,i,e,c);t.push(mn(n,a,o&&o[e],s))}}return t}function Sn(e,t,n){return Ne(e)?e(t,n):e}var Cn=(e,t)=>e===!0?t:typeof e==`string`?Ae(t,e):void 0;function wn(e,t,n,r,i){for(let a of t){let t=Cn(n,a);if(t){e.add(t);let a=Sn(t._fallback,n,i);if(a!==void 0&&a!==n&&a!==r)return a}else if(t===!1&&r!==void 0&&n!==r)return null}return!1}function Tn(e,t,n,r){let i=t._rootScopes,a=Sn(t._fallback,n,r),o=[...e,...i],s=new Set;s.add(r);let c=En(s,o,n,a||n,r);return c===null||a!==void 0&&a!==n&&(c=En(s,o,a,c,r),c===null)?!1:pn(Array.from(s),[``],i,a,()=>Dn(t,n,r))}function En(e,t,n,r,i){for(;n;)n=wn(e,t,n,r,i);return n}function Dn(e,t,n){let r=e._getTarget();t in r||(r[t]={});let i=r[t];return A(i)&&j(n)?n:i||{}}function On(e,t,n,r){let i;for(let a of t)if(i=kn(gn(a,e),n),i!==void 0)return _n(e,i)?Tn(n,r,e,i):i}function kn(e,t){for(let n of t){if(!n)continue;let t=n[e];if(t!==void 0)return t}}function An(e){let t=e._keys;return t||=e._keys=jn(e._scopes),t}function jn(e){let t=new Set;for(let n of e)for(let e of Object.keys(n).filter(e=>!e.startsWith(`_`)))t.add(e);return Array.from(t)}var Mn=2**-52||1e-14,Nn=(e,t)=>te===`x`?`y`:`x`;function Fn(e,t,n,r){let i=e.skip?t:e,a=t,o=n.skip?t:n,s=Qe(a,i),c=Qe(o,a),l=s/(s+c),u=c/(s+c);l=isNaN(l)?0:l,u=isNaN(u)?0:u;let d=r*l,f=r*u;return{previous:{x:a.x-d*(o.x-i.x),y:a.y-d*(o.y-i.y)},next:{x:a.x+f*(o.x-i.x),y:a.y+f*(o.y-i.y)}}}function In(e,t,n){let r=e.length,i,a,o,s,c,l=Nn(e,0);for(let u=0;u!e.skip)),t.cubicInterpolationMode===`monotone`)Rn(e,i);else{let n=r?e[e.length-1]:e[0];for(a=0,o=e.length;ae.ownerDocument.defaultView.getComputedStyle(e,null);function Kn(e,t){return Gn(e).getPropertyValue(t)}var qn=[`top`,`right`,`bottom`,`left`];function Jn(e,t,n){let r={};n=n?`-`+n:``;for(let i=0;i<4;i++){let a=qn[i];r[a]=parseFloat(e[t+`-`+a+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}var Yn=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function Xn(e,t){let n=e.touches,r=n&&n.length?n[0]:e,{offsetX:i,offsetY:a}=r,o=!1,s,c;if(Yn(i,a,e.target))s=i,c=a;else{let e=t.getBoundingClientRect();s=r.clientX-e.left,c=r.clientY-e.top,o=!0}return{x:s,y:c,box:o}}function Zn(e,t){if(`native`in e)return e;let{canvas:n,currentDevicePixelRatio:r}=t,i=Gn(n),a=i.boxSizing===`border-box`,o=Jn(i,`padding`),s=Jn(i,`border`,`width`),{x:c,y:l,box:u}=Xn(e,n),d=o.left+(u&&s.left),f=o.top+(u&&s.top),{width:p,height:m}=t;return a&&(p-=o.width+s.width,m-=o.height+s.height),{x:Math.round((c-d)/p*n.width/r),y:Math.round((l-f)/m*n.height/r)}}function Qn(e,t,n){let r,i;if(t===void 0||n===void 0){let a=e&&Un(e);if(!a)t=e.clientWidth,n=e.clientHeight;else{let e=a.getBoundingClientRect(),o=Gn(a),s=Jn(o,`border`,`width`),c=Jn(o,`padding`);t=e.width-c.width-s.width,n=e.height-c.height-s.height,r=Wn(o.maxWidth,a,`clientWidth`),i=Wn(o.maxHeight,a,`clientHeight`)}}return{width:t,height:n,maxWidth:r||Le,maxHeight:i||Le}}var $n=e=>Math.round(e*10)/10;function er(e,t,n,r){let i=Gn(e),a=Jn(i,`margin`),o=Wn(i.maxWidth,e,`clientWidth`)||Le,s=Wn(i.maxHeight,e,`clientHeight`)||Le,c=Qn(e,t,n),{width:l,height:u}=c;if(i.boxSizing===`content-box`){let e=Jn(i,`border`,`width`),t=Jn(i,`padding`);l-=t.width+e.width,u-=t.height+e.height}return l=Math.max(0,l-a.width),u=Math.max(0,r?l/r:u-a.height),l=$n(Math.min(l,o,c.maxWidth)),u=$n(Math.min(u,s,c.maxHeight)),l&&!u&&(u=$n(l/2)),(t!==void 0||n!==void 0)&&r&&c.height&&u>c.height&&(u=c.height,l=$n(Math.floor(u*r))),{width:l,height:u}}function tr(e,t,n){let r=t||1,i=$n(e.height*r),a=$n(e.width*r);e.height=$n(e.height),e.width=$n(e.width);let o=e.canvas;return o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||o.height!==i||o.width!==a?(e.currentDevicePixelRatio=r,o.height=i,o.width=a,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}var nr=function(){let e=!1;try{let t={get passive(){return e=!0,!1}};Hn()&&(window.addEventListener(`test`,null,t),window.removeEventListener(`test`,null,t))}catch{}return e}();function rr(e,t){let n=Kn(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function ir(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:e.y+n*(t.y-e.y)}}function ar(e,t,n,r){return{x:e.x+n*(t.x-e.x),y:r===`middle`?n<.5?e.y:t.y:r===`after`?n<1?e.y:t.y:n>0?t.y:e.y}}function or(e,t,n,r){let i={x:e.cp2x,y:e.cp2y},a={x:t.cp1x,y:t.cp1y},o=ir(e,i,n),s=ir(i,a,n),c=ir(a,t,n);return ir(ir(o,s,n),ir(s,c,n),n)}var sr=function(e,t){return{x(n){return e+e+t-n},setWidth(e){t=e},textAlign(e){return e===`center`?e:e===`right`?`left`:`right`},xPlus(e,t){return e-t},leftForLtr(e,t){return e-t}}},cr=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function lr(e,t,n){return e?sr(t,n):cr()}function ur(e,t){let n,r;(t===`ltr`||t===`rtl`)&&(n=e.canvas.style,r=[n.getPropertyValue(`direction`),n.getPropertyPriority(`direction`)],n.setProperty(`direction`,t,`important`),e.prevTextDirection=r)}function dr(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,t[0],t[1]))}function fr(e){return e===`angle`?{between:et,compare:$e,normalize:H}:{between:nt,compare:(e,t)=>e-t,normalize:e=>e}}function pr({start:e,end:t,count:n,loop:r,style:i}){return{start:e%n,end:t%n,loop:r&&(t-e+1)%n===0,style:i}}function mr(e,t,n){let{property:r,start:i,end:a}=n,{between:o,normalize:s}=fr(r),c=t.length,{start:l,end:u,loop:d}=e,f,p;if(d){for(l+=c,u+=c,f=0,p=c;fc(i,y,_)&&s(i,y)!==0,x=()=>s(a,_)===0||c(a,y,_),S=()=>h||b(),C=()=>!h||x();for(let e=u,n=u;e<=d;++e)v=t[e%o],!v.skip&&(_=l(v[r]),_!==y&&(h=c(_,i,a),g===null&&S()&&(g=s(_,i)===0?e:n),g!==null&&C()&&(m.push(pr({start:g,end:e,loop:f,count:o,style:p})),g=null),n=e,y=_));return g!==null&&m.push(pr({start:g,end:d,loop:f,count:o,style:p})),m}function gr(e,t){let n=[],r=e.segments;for(let i=0;ii&&e[a%t].skip;)a--;return a%=t,{start:i,end:a}}function vr(e,t,n,r){let i=e.length,a=[],o=t,s=e[t],c;for(c=t+1;c<=n;++c){let n=e[c%i];n.skip||n.stop?s.skip||(r=!1,a.push({start:t%i,end:(c-1)%i,loop:r}),t=o=n.stop?c:null):(o=c,s.skip&&(t=c)),s=n}return o!==null&&a.push({start:t%i,end:o%i,loop:r}),a}function yr(e,t){let n=e.points,r=e.options.spanGaps,i=n.length;if(!i)return[];let a=!!e._loop,{start:o,end:s}=_r(n,i,a,r);return r===!0?br(e,[{start:o,end:s,loop:a}],n,t):br(e,vr(n,o,sr({chart:e,initial:t.initial,numSteps:a,currentStep:Math.min(n-t.start,a)}))}_refresh(){this._request||=(this._running=!0,dt.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((n,r)=>{if(!n.running||!n.items.length)return;let i=n.items,a=i.length-1,o=!1,s;for(;a>=0;--a)s=i[a],s._active?(s._total>n.duration&&(n.duration=s._total),s.tick(e),o=!0):(i[a]=i[i.length-1],i.pop());o&&(r.draw(),this._notify(r,n,e,`progress`)),i.length||(n.running=!1,this._notify(r,n,e,`complete`),n.initial=!1),t+=i.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){let t=this._charts,n=t.get(e);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,n)),n}listen(e,t,n){this._getAnims(e).listeners[t].push(n)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){let t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((e,t)=>Math.max(e,t._duration),0),this._refresh())}running(e){if(!this._running)return!1;let t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){let t=this._charts.get(e);if(!t||!t.items.length)return;let n=t.items,r=n.length-1;for(;r>=0;--r)n[r].cancel();t.items=[],this._notify(e,t,Date.now(),`complete`)}remove(e){return this._charts.delete(e)}},Or=`transparent`,kr={boolean(e,t,n){return n>.5?t:e},color(e,t,n){let r=Ct(e||Or),i=r.valid&&Ct(t||Or);return i&&i.valid?i.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}},Ar=class{constructor(e,t,n,r){let i=t[n];r=un([e.to,r,i,e.from]);let a=un([e.from,i,r]);this._active=!0,this._fn=e.fn||kr[e.type||typeof a],this._easing=xt[e.easing]||xt.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=n,this._from=a,this._to=r,this._promises=void 0}active(){return this._active}update(e,t,n){if(this._active){this._notify(!1);let r=this._target[this._prop],i=n-this._start,a=this._duration-i;this._start=n,this._duration=Math.floor(Math.max(a,e.duration)),this._total+=i,this._loop=!!e.loop,this._to=un([e.to,t,r,e.from]),this._from=un([e.from,r,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){let t=e-this._start,n=this._duration,r=this._prop,i=this._from,a=this._loop,o=this._to,s;if(this._active=i!==o&&(a||t1?2-s:s,s=this._easing(Math.min(1,Math.max(0,s))),this._target[r]=this._fn(i,o,s)}wait(){let e=this._promises||=[];return new Promise((t,n)=>{e.push({res:t,rej:n})})}_notify(e){let t=e?`res`:`rej`,n=this._promises||[];for(let e=0;e{let i=e[r];if(!j(i))return;let a={};for(let e of t)a[e]=i[e];(A(i.properties)&&i.properties||[r]).forEach(e=>{(e===r||!n.has(e))&&n.set(e,a)})})}_animateOptions(e,t){let n=t.options,r=Nr(e,n);if(!r)return[];let i=this._createAnimations(r,n);return n.$shared&&Mr(e.options.$animations,n).then(()=>{e.options=n},()=>{}),i}_createAnimations(e,t){let n=this._properties,r=[],i=e.$animations||={},a=Object.keys(t),o=Date.now(),s;for(s=a.length-1;s>=0;--s){let c=a[s];if(c.charAt(0)===`$`)continue;if(c===`options`){r.push(...this._animateOptions(e,t));continue}let l=t[c],u=i[c],d=n.get(c);if(u)if(d&&u.active()){u.update(d,l,o);continue}else u.cancel();if(!d||!d.duration){e[c]=l;continue}i[c]=u=new Ar(d,e,c,l),r.push(u)}return r}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}let n=this._createAnimations(e,t);if(n.length)return Dr.add(this._chart,n),!0}};function Mr(e,t){let n=[],r=Object.keys(t);for(let t=0;t0||!n&&t<0)return i.index}return null}function Gr(e,t){let{chart:n,_cachedMeta:r}=e,i=n._stacks||={},{iScale:a,vScale:o,index:s}=r,c=a.axis,l=o.axis,u=Vr(a,o,r),d=t.length,f;for(let e=0;en[e].axis===t).shift()}function qr(e,t){return fn(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:`default`,type:`dataset`})}function Jr(e,t,n){return fn(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:`default`,type:`data`})}function Yr(e,t){let n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t||=e._parsed;for(let e of t){let t=e._stacks;if(!t||t[r]===void 0||t[r][n]===void 0)return;delete t[r][n],t[r]._visualValues!==void 0&&t[r]._visualValues[n]!==void 0&&delete t[r]._visualValues[n]}}}var Xr=e=>e===`reset`||e===`none`,Zr=(e,t)=>t?e:Object.assign({},e),Qr=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:Lr(n,!0),values:null},$r=class{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(e,t){this.chart=e,this._ctx=e.ctx,this.index=t,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=Br(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled(`filler`)&&console.warn(`Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options`)}updateIndex(e){this.index!==e&&Yr(this._cachedMeta),this.index=e}linkScales(){let e=this.chart,t=this._cachedMeta,n=this.getDataset(),r=(e,t,n,r)=>e===`x`?t:e===`r`?r:n,i=t.xAxisID=P(n.xAxisID,Kr(e,`x`)),a=t.yAxisID=P(n.yAxisID,Kr(e,`y`)),o=t.rAxisID=P(n.rAxisID,Kr(e,`r`)),s=t.indexAxis,c=t.iAxisID=r(s,i,a,o),l=t.vAxisID=r(s,a,i,o);t.xScale=this.getScaleForId(i),t.yScale=this.getScaleForId(a),t.rScale=this.getScaleForId(o),t.iScale=this.getScaleForId(c),t.vScale=this.getScaleForId(l)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){let t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update(`reset`)}_destroy(){let e=this._cachedMeta;this._data&<(this._data,this),e._stacked&&Yr(e)}_dataCheck(){let e=this.getDataset(),t=e.data||=[],n=this._data;if(j(t)){let e=this._cachedMeta;this._data=zr(t,e)}else if(n!==t){if(n){lt(n,this);let e=this._cachedMeta;Yr(e),e._parsed=[]}t&&Object.isExtensible(t)&&ct(t,this),this._syncList=[],this._data=t}}addElements(){let e=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(e.dataset=new this.datasetElementType)}buildOrUpdateElements(e){let t=this._cachedMeta,n=this.getDataset(),r=!1;this._dataCheck();let i=t._stacked;t._stacked=Br(t.vScale,t),t.stack!==n.stack&&(r=!0,Yr(t),t.stack=n.stack),this._resyncElements(e),(r||i!==t._stacked)&&(Gr(this,t._parsed),t._stacked=Br(t.vScale,t))}configure(){let e=this.chart.config,t=e.datasetScopeKeys(this._type),n=e.getOptionScopes(this.getDataset(),t,!0);this.options=e.createResolver(n,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(e,t){let{_cachedMeta:n,_data:r}=this,{iScale:i,_stacked:a}=n,o=i.axis,s=e===0&&t===r.length?!0:n._sorted,c=e>0&&n._parsed[e-1],l,u,d;if(this._parsing===!1)n._parsed=r,n._sorted=!0,d=r;else{d=A(r[e])?this.parseArrayData(n,r,e,t):j(r[e])?this.parseObjectData(n,r,e,t):this.parsePrimitiveData(n,r,e,t);let i=()=>u[o]===null||c&&u[o]t||u=0;--d)if(!p()){this.updateRangeFromParsed(c,e,f,s);break}}return c}getAllParsedValues(e){let t=this._cachedMeta._parsed,n=[],r,i,a;for(r=0,i=t.length;r=0&&ethis.getContext(n,r,t),u);return p.$shared&&(p.$shared=s,i[a]=Object.freeze(Zr(p,s))),p}_resolveAnimations(e,t,n){let r=this.chart,i=this._cachedDataOpts,a=`animation-${t}`,o=i[a];if(o)return o;let s;if(r.options.animation!==!1){let r=this.chart.config,i=r.datasetAnimationScopeKeys(this._type,t),a=r.getOptionScopes(this.getDataset(),i);s=r.createResolver(a,this.getContext(e,n,t))}let c=new jr(r,s&&s.animations);return s&&s._cacheable&&(i[a]=Object.freeze(c)),c}getSharedOptions(e){if(e.$shared)return this._sharedOptions||=Object.assign({},e)}includeOptions(e,t){return!t||Xr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){let n=this.resolveDataElementOptions(e,t),r=this._sharedOptions,i=this.getSharedOptions(n),a=this.includeOptions(t,i)||i!==r;return this.updateSharedOptions(i,t,n),{sharedOptions:i,includeOptions:a}}updateElement(e,t,n,r){Xr(r)?Object.assign(e,n):this._resolveAnimations(t,r).update(e,n)}updateSharedOptions(e,t,n){e&&!Xr(t)&&this._resolveAnimations(void 0,t).update(e,n)}_setStyle(e,t,n,r){e.active=r;let i=this.getStyle(t,r);this._resolveAnimations(t,n,r).update(e,{options:!r&&this.getSharedOptions(i)||i})}removeHoverStyle(e,t,n){this._setStyle(e,n,`active`,!1)}setHoverStyle(e,t,n){this._setStyle(e,n,`active`,!0)}_removeDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!1)}_setDatasetHoverStyle(){let e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,`active`,!0)}_resyncElements(e){let t=this._data,n=this._cachedMeta.data;for(let[e,t,n]of this._syncList)this[e](t,n);this._syncList=[];let r=n.length,i=t.length,a=Math.min(i,r);a&&this.parse(0,a),i>r?this._insertElements(r,i-r,e):i{for(e.length+=t,o=e.length-1;o>=a;o--)e[o]=e[o-t]};for(s(i),o=e;oe-t))}return e._cache.$bar}function ti(e){let t=e.iScale,n=ei(t,e.type),r=t._length,i,a,o,s,c=()=>{o===32767||o===-32768||(Me(s)&&(r=Math.min(r,Math.abs(o-s)||r)),s=o)};for(i=0,a=n.length;i0?i[e-1]:null,s=eMath.abs(s)&&(c=s,l=o),t[n.axis]=l,t._custom={barStart:c,barEnd:l,start:i,end:a,min:o,max:s}}function ai(e,t,n,r){return A(e)?ii(e,t,n,r):t[n.axis]=n.parse(e,r),t}function oi(e,t,n,r){let i=e.iScale,a=e.vScale,o=i.getLabels(),s=i===a,c=[],l,u,d,f;for(l=n,u=n+r;l=n?1:-1):B(e)}function li(e){let t,n,r,i,a;return e.horizontal?(t=e.base>e.x,n=`left`,r=`right`):(t=e.basee.controller.options.grouped),i=n.options.stacked,a=[],o=this._cachedMeta.controller.getParsed(t),s=o&&o[n.axis],c=e=>{let t=e._parsed.find(e=>e[n.axis]===s),r=t&&t[e.vScale.axis];if(k(r)||isNaN(r))return!0};for(let n of r)if(!(t!==void 0&&c(n))&&((i===!1||a.indexOf(n.stack)===-1||i===void 0&&n.stack===void 0)&&a.push(n.stack),n.index===e))break;return a.length||a.push(void 0),a}_getStackCount(e){return this._getStacks(void 0,e).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){let e=this.chart.scales,t=this.chart.options.indexAxis;return Object.keys(e).filter(n=>e[n].axis===t).shift()}_getAxis(){let e={},t=this.getFirstScaleIdForIndexAxis();for(let n of this.chart.data.datasets)e[P(this.chart.options.indexAxis===`x`?n.xAxisID:n.yAxisID,t)]=!0;return Object.keys(e)}_getStackIndex(e,t,n){let r=this._getStacks(e,n),i=t===void 0?-1:r.indexOf(t);return i===-1?r.length-1:i}_getRuler(){let e=this.options,t=this._cachedMeta,n=t.iScale,r=[],i,a;for(i=0,a=t.data.length;iet(e,s,c,!0)?1:Math.max(t,t*n,r,r*n),m=(e,t,r)=>et(e,s,c,!0)?-1:Math.min(t,t*n,r,r*n),h=p(0,l,d),g=p(z,u,f),_=m(L,l,d),v=m(L+z,u,f);r=(h-_)/2,i=(g-v)/2,a=-(h+_)/2,o=-(g+v)/2}return{ratioX:r,ratioY:i,offsetX:a,offsetY:o}}var _i=class extends $r{static id=`doughnut`;static defaults={datasetElementType:!1,dataElementType:`arc`,animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:`number`,properties:[`circumference`,`endAngle`,`innerRadius`,`outerRadius`,`startAngle`,`x`,`y`,`offset`,`borderWidth`,`spacing`]}},cutout:`50%`,rotation:0,circumference:360,radius:`100%`,spacing:0,indexAxis:`r`};static descriptors={_scriptable:e=>e!==`spacing`,_indexable:e=>e!==`spacing`&&!e.startsWith(`borderDash`)&&!e.startsWith(`hoverBorderDash`)};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(e){let t=e.data,{labels:{pointStyle:n,textAlign:r,color:i,useBorderRadius:a,borderRadius:o}}=e.legend.options;return t.labels.length&&t.datasets.length?t.labels.map((t,s)=>{let c=e.getDatasetMeta(0).controller.getStyle(s);return{text:t,fillStyle:c.backgroundColor,fontColor:i,hidden:!e.getDataVisibility(s),lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:c.borderWidth,strokeStyle:c.borderColor,textAlign:r,pointStyle:n,borderRadius:a&&(o||c.borderRadius),index:s}}):[]}},onClick(e,t,n){n.chart.toggleDataVisibility(t.index),n.chart.update()}}}};constructor(e,t){super(e,t),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(e,t){let n=this.getDataset().data,r=this._cachedMeta;if(this._parsing===!1)r._parsed=n;else{let i=e=>+n[e];if(j(n[e])){let{key:e=`value`}=this._parsing;i=t=>+Ae(n[t],e)}let a,o;for(a=e,o=e+t;a0&&!isNaN(e)?Math.abs(e)/t*R:0}getLabelAndValue(e){let t=this._cachedMeta,n=this.chart,r=n.data.labels||[],i=jt(t._parsed[e],n.options.locale);return{label:r[e]||``,value:i}}getMaxBorderWidth(e){let t=0,n=this.chart,r,i,a,o,s;if(!e){for(r=0,i=n.data.datasets.length;r0&&this.getParsed(t-1);for(let n=0;n=_){v.skip=!0;continue}let b=this.getParsed(n),x=k(b[f]),S=v[d]=a.getPixelForValue(b[d],n),C=v[f]=i||x?o.getBasePixel():o.getPixelForValue(s?this.applyStack(o,b,s):b[f],n);v.skip=isNaN(S)||isNaN(C)||x,v.stop=n>0&&Math.abs(b[d]-y[d])>h,m&&(v.parsed=b,v.raw=c.data[n]),u&&(v.options=l||this.resolveDataElementOptions(n,p.active?`active`:r)),g||this.updateElement(p,n,v,r),y=b}}getMaxOverflow(){let e=this._cachedMeta,t=e.dataset,n=t.options&&t.options.borderWidth||0,r=e.data||[];if(!r.length)return n;let i=r[0].size(this.resolveDataElementOptions(0)),a=r[r.length-1].size(this.resolveDataElementOptions(r.length-1));return Math.max(n,i,a)/2}draw(){let e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}},yi=class extends $r{static id=`scatter`;static defaults={datasetElementType:!1,dataElementType:`point`,showLine:!1,fill:!1};static overrides={interaction:{mode:`point`},scales:{x:{type:`linear`},y:{type:`linear`}}};getLabelAndValue(e){let t=this._cachedMeta,n=this.chart.data.labels||[],{xScale:r,yScale:i}=t,a=this.getParsed(e),o=r.getLabelForValue(a.x),s=i.getLabelForValue(a.y);return{label:n[e]||``,value:`(`+o+`, `+s+`)`}}update(e){let t=this._cachedMeta,{data:n=[]}=t,r=this.chart._animationsDisabled,{start:i,count:a}=gt(t,n,r);if(this._drawStart=i,this._drawCount=a,_t(t)&&(i=0,a=n.length),this.options.showLine){this.datasetElementType||this.addElements();let{dataset:i,_dataset:a}=t;i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!a._decimated,i.points=n;let o=this.resolveDatasetElementOptions(e);o.segment=this.options.segment,this.updateElement(i,void 0,{animated:!r,options:o},e)}else this.datasetElementType&&=(delete t.dataset,!1);this.updateElements(n,i,a,e)}addElements(){let{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=this.chart.registry.getElement(`line`)),super.addElements()}updateElements(e,t,n,r){let i=r===`reset`,{iScale:a,vScale:o,_stacked:s,_dataset:c}=this._cachedMeta,l=this.resolveDataElementOptions(t,r),u=this.getSharedOptions(l),d=this.includeOptions(r,u),f=a.axis,p=o.axis,{spanGaps:m,segment:h}=this.options,g=Ke(m)?m:1/0,_=this.chart._animationsDisabled||i||r===`none`,v=t>0&&this.getParsed(t-1);for(let l=t;l0&&Math.abs(n[f]-v[f])>g,h&&(m.parsed=n,m.raw=c.data[l]),d&&(m.options=u||this.resolveDataElementOptions(l,t.active?`active`:r)),_||this.updateElement(t,l,m,r),v=n}this.updateSharedOptions(u,r,l)}getMaxOverflow(){let e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let e=0;for(let n=t.length-1;n>=0;--n)e=Math.max(e,t[n].size(this.resolveDataElementOptions(n))/2);return e>0&&e}let n=e.dataset,r=n.options&&n.options.borderWidth||0;if(!t.length)return r;let i=t[0].size(this.resolveDataElementOptions(0)),a=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(r,i,a)/2}};function bi(){throw Error(`This method is not implemented: Check that a complete date adapter is provided.`)}var xi={_date:class e{static override(t){Object.assign(e.prototype,t)}options;constructor(e){this.options=e||{}}init(){}formats(){return bi()}parse(){return bi()}format(){return bi()}add(){return bi()}diff(){return bi()}startOf(){return bi()}endOf(){return bi()}}};function Si(e,t,n,r){let{controller:i,data:a,_sorted:o}=e,s=i._cachedMeta.iScale,c=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(s&&t===s.axis&&t!==`r`&&o&&a.length){let o=s._reversePixels?at:it;if(!r){let r=o(a,t,n);if(c){let{vScale:t}=i._cachedMeta,{_parsed:n}=e,a=n.slice(0,r.lo+1).reverse().findIndex(e=>!k(e[t.axis]));r.lo-=Math.max(0,a);let o=n.slice(r.hi).findIndex(e=>!k(e[t.axis]));r.hi+=Math.max(0,o)}return r}else if(i._sharedOptions){let e=a[0],r=typeof e.getRange==`function`&&e.getRange(t);if(r){let e=o(a,t,n-r),i=o(a,t,n+r);return{lo:e.lo,hi:i.hi}}}}return{lo:0,hi:a.length-1}}function Ci(e,t,n,r,i){let a=e.getSortedVisibleDatasetMetas(),o=n[t];for(let e=0,n=a.length;e{e[o]&&e[o](t[n],i)&&(a.push({element:e,datasetIndex:r,index:c}),s||=e.inRange(t.x,t.y,i))}),r&&!s?[]:a}var Ai={evaluateInteractionItems:Ci,modes:{index(e,t,n,r){let i=Zn(t,e),a=n.axis||`x`,o=n.includeInvisible||!1,s=n.intersect?Ti(e,i,a,r,o):Oi(e,i,a,!1,r,o),c=[];return s.length?(e.getSortedVisibleDatasetMetas().forEach(e=>{let t=s[0].index,n=e.data[t];n&&!n.skip&&c.push({element:n,datasetIndex:e.index,index:t})}),c):[]},dataset(e,t,n,r){let i=Zn(t,e),a=n.axis||`xy`,o=n.includeInvisible||!1,s=n.intersect?Ti(e,i,a,r,o):Oi(e,i,a,!1,r,o);if(s.length>0){let t=s[0].datasetIndex,n=e.getDatasetMeta(t).data;s=[];for(let e=0;ee.pos===t)}function Ni(e,t){return e.filter(e=>ji.indexOf(e.pos)===-1&&e.box.axis===t)}function Pi(e,t){return e.sort((e,n)=>{let r=t?n:e,i=t?e:n;return r.weight===i.weight?r.index-i.index:r.weight-i.weight})}function Fi(e){let t=[],n,r,i,a,o,s;for(n=0,r=(e||[]).length;ne.box.fullSize),!0),r=Pi(Mi(t,`left`),!0),i=Pi(Mi(t,`right`)),a=Pi(Mi(t,`top`),!0),o=Pi(Mi(t,`bottom`)),s=Ni(t,`x`),c=Ni(t,`y`);return{fullSize:n,leftAndTop:r.concat(a),rightAndBottom:i.concat(c).concat(o).concat(s),chartArea:Mi(t,`chartArea`),vertical:r.concat(i).concat(c),horizontal:a.concat(o).concat(s)}}function zi(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Bi(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function Vi(e,t,n,r){let{pos:i,box:a}=n,o=e.maxPadding;if(!j(i)){n.size&&(e[i]-=n.size);let t=r[n.stack]||{size:0,count:1};t.size=Math.max(t.size,n.horizontal?a.height:a.width),n.size=t.size/t.count,e[i]+=n.size}a.getPadding&&Bi(o,a.getPadding());let s=Math.max(0,t.outerWidth-zi(o,e,`left`,`right`)),c=Math.max(0,t.outerHeight-zi(o,e,`top`,`bottom`)),l=s!==e.w,u=c!==e.h;return e.w=s,e.h=c,n.horizontal?{same:l,other:u}:{same:u,other:l}}function Hi(e){let t=e.maxPadding;function n(n){let r=Math.max(t[n]-e[n],0);return e[n]+=r,r}e.y+=n(`top`),e.x+=n(`left`),n(`right`),n(`bottom`)}function Ui(e,t){let n=t.maxPadding;function r(e){let r={left:0,top:0,right:0,bottom:0};return e.forEach(e=>{r[e]=Math.max(t[e],n[e])}),r}return r(e?[`left`,`right`]:[`top`,`bottom`])}function Wi(e,t,n,r){let i=[],a,o,s,c,l,u;for(a=0,o=e.length,l=0;a{typeof e.beforeLayout==`function`&&e.beforeLayout()});let u=c.reduce((e,t)=>t.box.options&&t.box.options.display===!1?e:e+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:n,padding:i,availableWidth:a,availableHeight:o,vBoxMaxWidth:a/2/u,hBoxMaxHeight:o/2}),f=Object.assign({},i);Bi(f,q(r));let p=Object.assign({maxPadding:f,w:a,h:o,x:i.left,y:i.top},i),m=Li(c.concat(l),d);Wi(s.fullSize,p,d,m),Wi(c,p,d,m),Wi(l,p,d,m)&&Wi(c,p,d,m),Hi(p),Ki(s.leftAndTop,p,d,m),p.x+=p.w,p.y+=p.h,Ki(s.rightAndBottom,p,d,m),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},I(s.chartArea,t=>{let n=t.box;Object.assign(n,e.chartArea),n.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}},qi=class{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,n){}removeEventListener(e,t,n){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,n,r){return t=Math.max(0,t||e.width),n||=e.height,{width:t,height:Math.max(0,r?Math.floor(t/r):n)}}isAttached(e){return!0}updateConfig(e){}},Ji=class extends qi{acquireContext(e){return e&&e.getContext&&e.getContext(`2d`)||null}updateConfig(e){e.options.animation=!1}},Yi=`$chartjs`,Xi={touchstart:`mousedown`,touchmove:`mousemove`,touchend:`mouseup`,pointerenter:`mouseenter`,pointerdown:`mousedown`,pointermove:`mousemove`,pointerup:`mouseup`,pointerleave:`mouseout`,pointerout:`mouseout`},Zi=e=>e===null||e===``;function Qi(e,t){let n=e.style,r=e.getAttribute(`height`),i=e.getAttribute(`width`);if(e[Yi]={initial:{height:r,width:i,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||`block`,n.boxSizing=n.boxSizing||`border-box`,Zi(i)){let t=rr(e,`width`);t!==void 0&&(e.width=t)}if(Zi(r))if(e.style.height===``)e.height=e.width/(t||2);else{let t=rr(e,`height`);t!==void 0&&(e.height=t)}return e}var $i=nr?{passive:!0}:!1;function ea(e,t,n){e&&e.addEventListener(t,n,$i)}function ta(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,$i)}function na(e,t){let n=Xi[e.type]||e.type,{x:r,y:i}=Zn(e,t);return{type:n,chart:t,native:e,x:r===void 0?null:r,y:i===void 0?null:i}}function ra(e,t){for(let n of e)if(n===t||n.contains(t))return!0}function ia(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ra(n.addedNodes,r),t&&=!ra(n.removedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}function aa(e,t,n){let r=e.canvas,i=new MutationObserver(e=>{let t=!1;for(let n of e)t||=ra(n.removedNodes,r),t&&=!ra(n.addedNodes,r);t&&n()});return i.observe(document,{childList:!0,subtree:!0}),i}var oa=new Map,sa=0;function ca(){let e=window.devicePixelRatio;e!==sa&&(sa=e,oa.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function la(e,t){oa.size||window.addEventListener(`resize`,ca),oa.set(e,t)}function ua(e){oa.delete(e),oa.size||window.removeEventListener(`resize`,ca)}function da(e,t,n){let r=e.canvas,i=r&&Un(r);if(!i)return;let a=ft((e,t)=>{let r=i.clientWidth;n(e,t),r{let t=e[0],n=t.contentRect.width,r=t.contentRect.height;n===0&&r===0||a(n,r)});return o.observe(i),la(e,a),o}function fa(e,t,n){n&&n.disconnect(),t===`resize`&&ua(e)}function pa(e,t,n){let r=e.canvas,i=ft(t=>{e.ctx!==null&&n(na(t,e))},e);return ea(r,t,i),i}var ma=class extends qi{acquireContext(e,t){let n=e&&e.getContext&&e.getContext(`2d`);return n&&n.canvas===e?(Qi(e,t),n):null}releaseContext(e){let t=e.canvas;if(!t[Yi])return!1;let n=t[Yi].initial;[`height`,`width`].forEach(e=>{let r=n[e];k(r)?t.removeAttribute(e):t.setAttribute(e,r)});let r=n.style||{};return Object.keys(r).forEach(e=>{t.style[e]=r[e]}),t.width=t.width,delete t[Yi],!0}addEventListener(e,t,n){this.removeEventListener(e,t);let r=e.$proxies||={};r[t]=({attach:ia,detach:aa,resize:da}[t]||pa)(e,t,n)}removeEventListener(e,t){let n=e.$proxies||={},r=n[t];r&&(({attach:fa,detach:fa,resize:fa}[t]||ta)(e,t,r),n[t]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,n,r){return er(e,t,n,r)}isAttached(e){let t=e&&Un(e);return!!(t&&t.isConnected)}};function ha(e){return!Hn()||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas?Ji:ma}var ga=class{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(e){let{x:t,y:n}=this.getProps([`x`,`y`],e);return{x:t,y:n}}hasValue(){return Ke(this.x)&&Ke(this.y)}getProps(e,t){let n=this.$animations;if(!t||!n)return this;let r={};return e.forEach(e=>{r[e]=n[e]&&n[e].active()?n[e]._to:this[e]}),r}};function _a(e,t){let n=e.options.ticks,r=va(e),i=Math.min(n.maxTicksLimit||r,r),a=n.major.enabled?ba(t):[],o=a.length,s=a[0],c=a[o-1],l=[];if(o>i)return xa(t,l,a,o/i),l;let u=ya(a,t,i);if(o>0){let e,n,r=o>1?Math.round((c-s)/(o-1)):null;for(Sa(t,l,u,k(r)?0:s-r,s),e=0,n=o-1;ei)return t}return Math.max(i,1)}function ba(e){let t=[],n,r;for(n=0,r=e.length;ne===`left`?`right`:e===`right`?`left`:e,Ta=(e,t,n)=>t===`top`||t===`left`?e[t]+n:e[t]-n,Ea=(e,t)=>Math.min(t||e,e);function Da(e,t){let n=[],r=e.length/t,i=e.length,a=0;for(;ao+s)))return c}function ka(e,t){I(e,e=>{let n=e.gc,r=n.length/2,i;if(r>t){for(i=0;in?n:t,n=r&&t>n?t:n,{min:N(t,N(n,t)),max:N(n,N(t,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let e=this.chart.data;return this.options.labels||(this.isHorizontal()?e.xLabels:e.yLabels)||e.labels||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||=this._computeLabelItems(e)}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){F(this.options.beforeUpdate,[this])}update(e,t,n){let{beginAtZero:r,grace:i,ticks:a}=this.options,o=a.sampleSize;this.beforeUpdate(),this.maxWidth=e,this.maxHeight=t,this._margins=n=Object.assign({left:0,right:0,top:0,bottom:0},n),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+n.left+n.right:this.height+n.top+n.bottom,this._dataLimitsCached||=(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=dn(this,i,r),!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let s=o=i||n<=1||!this.isHorizontal()){this.labelRotation=r;return}let l=this._getLabelSizes(),u=l.widest.width,d=l.highest.height,f=U(this.chart.width-u,0,this.maxWidth);o=e.offset?this.maxWidth/n:f/(n-1),u+6>o&&(o=f/(n-(e.offset?.5:1)),s=this.maxHeight-Aa(e.grid)-t.padding-ja(e.title,this.chart.options.font),c=Math.sqrt(u*u+d*d),a=Ye(Math.min(Math.asin(U((l.highest.height+6)/o,-1,1)),Math.asin(U(s/c,-1,1))-Math.asin(U(d/c,-1,1)))),a=Math.max(r,Math.min(i,a))),this.labelRotation=a}afterCalculateLabelRotation(){F(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){F(this.options.beforeFit,[this])}fit(){let e={width:0,height:0},{chart:t,options:{ticks:n,title:r,grid:i}}=this,a=this._isVisible(),o=this.isHorizontal();if(a){let a=ja(r,t.options.font);if(o?(e.width=this.maxWidth,e.height=Aa(i)+a):(e.height=this.maxHeight,e.width=Aa(i)+a),n.display&&this.ticks.length){let{first:t,last:r,widest:i,highest:a}=this._getLabelSizes(),s=n.padding*2,c=V(this.labelRotation),l=Math.cos(c),u=Math.sin(c);if(o){let t=n.mirror?0:u*i.width+l*a.height;e.height=Math.min(this.maxHeight,e.height+t+s)}else{let t=n.mirror?0:l*i.width+u*a.height;e.width=Math.min(this.maxWidth,e.width+t+s)}this._calculatePadding(t,r,u,l)}}this._handleMargins(),o?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,n,r){let{ticks:{align:i,padding:a},position:o}=this.options,s=this.labelRotation!==0,c=o!==`top`&&this.axis===`x`;if(this.isHorizontal()){let o=this.getPixelForTick(0)-this.left,l=this.right-this.getPixelForTick(this.ticks.length-1),u=0,d=0;s?c?(u=r*e.width,d=n*t.height):(u=n*e.height,d=r*t.width):i===`start`?d=t.width:i===`end`?u=e.width:i!==`inner`&&(u=e.width/2,d=t.width/2),this.paddingLeft=Math.max((u-o+a)*this.width/(this.width-o),0),this.paddingRight=Math.max((d-l+a)*this.width/(this.width-l),0)}else{let n=t.height/2,r=e.height/2;i===`start`?(n=0,r=e.height):i===`end`&&(n=t.height,r=0),this.paddingTop=n+a,this.paddingBottom=r+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){F(this.options.afterFit,[this])}isHorizontal(){let{axis:e,position:t}=this.options;return t===`top`||t===`bottom`||e===`x`}isFullSize(){return this.options.fullSize}_convertTicksToLabels(e){this.beforeTickToLabelConversion(),this.generateTickLabels(e);let t,n;for(t=0,n=e.length;t({width:a[e]||0,height:o[e]||0});return{first:C(0),last:C(t-1),widest:C(x),highest:C(S),widths:a,heights:o}}getLabelForValue(e){return e}getPixelForValue(e,t){return NaN}getValueForPixel(e){}getPixelForTick(e){let t=this.ticks;return e<0||e>t.length-1?null:this.getPixelForValue(t[e].value)}getPixelForDecimal(e){this._reversePixels&&(e=1-e);let t=this._startPixel+e*this._length;return tt(this._alignToPixels?Ut(this.chart,t,0):t)}getDecimalForPixel(e){let t=(e-this._startPixel)/this._length;return this._reversePixels?1-t:t}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:e,max:t}=this;return e<0&&t<0?t:e>0&&t>0?e:0}getContext(e){let t=this.ticks||[];if(e>=0&&eo*r?o/n:s/r:s*r0:!!e}_computeGridLineItems(e){let t=this.axis,n=this.chart,r=this.options,{grid:i,position:a,border:o}=r,s=i.offset,c=this.isHorizontal(),l=this.ticks.length+(s?1:0),u=Aa(i),d=[],f=o.setContext(this.getContext()),p=f.display?f.width:0,m=p/2,h=function(e){return Ut(n,e,p)},g,_,v,y,b,x,S,C,w,T,E,D;if(a===`top`)g=h(this.bottom),x=this.bottom-u,C=g-m,T=h(e.top)+m,D=e.bottom;else if(a===`bottom`)g=h(this.top),T=e.top,D=h(e.bottom)-m,x=g+m,C=this.top+u;else if(a===`left`)g=h(this.right),b=this.right-u,S=g-m,w=h(e.left)+m,E=e.right;else if(a===`right`)g=h(this.left),w=e.left,E=h(e.right)-m,b=g+m,S=this.left+u;else if(t===`x`){if(a===`center`)g=h((e.top+e.bottom)/2+.5);else if(j(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}T=e.top,D=e.bottom,x=g+m,C=x+u}else if(t===`y`){if(a===`center`)g=h((e.left+e.right)/2);else if(j(a)){let e=Object.keys(a)[0],t=a[e];g=h(this.chart.scales[e].getPixelForValue(t))}b=g-m,S=b-u,w=e.left,E=e.right}let ee=P(r.ticks.maxTicksLimit,l),O=Math.max(1,Math.ceil(l/ee));for(_=0;_0&&(a-=r/2);break}f={left:a,top:i,width:r+t.width,height:n+t.height,color:e.backdropColor}}h.push({label:y,font:w,textOffset:D,options:{rotation:m,color:n,strokeColor:s,strokeWidth:l,textAlign:d,textBaseline:ee,translation:[b,x],backdrop:f}})}return h}_getXAxisLabelAlignment(){let{position:e,ticks:t}=this.options;if(-V(this.labelRotation))return e===`top`?`left`:`right`;let n=`center`;return t.align===`start`?n=`left`:t.align===`end`?n=`right`:t.align===`inner`&&(n=`inner`),n}_getYAxisLabelAlignment(e){let{position:t,ticks:{crossAlign:n,mirror:r,padding:i}}=this.options,a=this._getLabelSizes(),o=e+i,s=a.widest.width,c,l;return t===`left`?r?(l=this.right+i,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l+=s)):(l=this.right-o,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l=this.left)):t===`right`?r?(l=this.left+i,n===`near`?c=`right`:n===`center`?(c=`center`,l-=s/2):(c=`left`,l-=s)):(l=this.left+o,n===`near`?c=`left`:n===`center`?(c=`center`,l+=s/2):(c=`right`,l=this.right)):c=`right`,{textAlign:c,x:l}}_computeLabelArea(){if(this.options.ticks.mirror)return;let e=this.chart,t=this.options.position;if(t===`left`||t===`right`)return{top:0,left:this.left,bottom:e.height,right:this.right};if(t===`top`||t===`bottom`)return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){let{ctx:e,options:{backgroundColor:t},left:n,top:r,width:i,height:a}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(n,r,i,a),e.restore())}getLineWidthForValue(e){let t=this.options.grid;if(!this._isVisible()||!t.display)return 0;let n=this.ticks.findIndex(t=>t.value===e);return n>=0?t.setContext(this.getContext(n)).lineWidth:0}drawGrid(e){let t=this.options.grid,n=this.ctx,r=this._gridLineItems||=this._computeGridLineItems(e),i,a,o=(e,t,r)=>{!r.width||!r.color||(n.save(),n.lineWidth=r.width,n.strokeStyle=r.color,n.setLineDash(r.borderDash||[]),n.lineDashOffset=r.borderDashOffset,n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.stroke(),n.restore())};if(t.display)for(i=0,a=r.length;i{this.draw(e)}}]:[{z:r,draw:e=>{this.drawBackground(),this.drawGrid(e),this.drawTitle()}},{z:i,draw:()=>{this.drawBorder()}},{z:n,draw:e=>{this.drawLabels(e)}}]}getMatchingVisibleMetas(e){let t=this.chart.getSortedVisibleDatasetMetas(),n=this.axis+`AxisID`,r=[],i,a;for(i=0,a=t.length;i{let r=n.split(`.`),i=r.pop(),a=[e].concat(r).join(`.`),o=t[n].split(`.`),s=o.pop(),c=o.join(`.`);G.route(a,i,c,s)})}function Ba(e){return`id`in e&&`defaults`in e}var X=new class{constructor(){this.controllers=new La($r,`datasets`,!0),this.elements=new La(ga,`elements`),this.plugins=new La(Object,`plugins`),this.scales=new La(Ia,`scales`),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...e){this._each(`register`,e)}remove(...e){this._each(`unregister`,e)}addControllers(...e){this._each(`register`,e,this.controllers)}addElements(...e){this._each(`register`,e,this.elements)}addPlugins(...e){this._each(`register`,e,this.plugins)}addScales(...e){this._each(`register`,e,this.scales)}getController(e){return this._get(e,this.controllers,`controller`)}getElement(e){return this._get(e,this.elements,`element`)}getPlugin(e){return this._get(e,this.plugins,`plugin`)}getScale(e){return this._get(e,this.scales,`scale`)}removeControllers(...e){this._each(`unregister`,e,this.controllers)}removeElements(...e){this._each(`unregister`,e,this.elements)}removePlugins(...e){this._each(`unregister`,e,this.plugins)}removeScales(...e){this._each(`unregister`,e,this.scales)}_each(e,t,n){[...t].forEach(t=>{let r=n||this._getRegistryForType(t);n||r.isForType(t)||r===this.plugins&&t.id?this._exec(e,r,t):I(t,t=>{let r=n||this._getRegistryForType(t);this._exec(e,r,t)})})}_exec(e,t,n){let r=je(e);F(n[`before`+r],[],n),t[e](n),F(n[`after`+r],[],n)}_getRegistryForType(e){for(let t=0;te.filter(e=>!t.some(t=>e.plugin.id===t.plugin.id));this._notify(r(t,n),e,`stop`),this._notify(r(n,t),e,`start`)}};function Ha(e){let t={},n=[],r=Object.keys(X.plugins.items);for(let e=0;e1&&Ya(e[0].toLowerCase());if(t)return t}throw Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Qa(e,t,n){if(n[t+`AxisID`]===e)return{axis:t}}function $a(e,t){if(t.data&&t.data.datasets){let n=t.data.datasets.filter(t=>t.xAxisID===e||t.yAxisID===e);if(n.length)return Qa(e,`x`,n[0])||Qa(e,`y`,n[0])}return{}}function eo(e,t){let n=It[e.type]||{scales:{}},r=t.scales||{},i=Ka(e.type,t),a=Object.create(null);return Object.keys(r).forEach(t=>{let o=r[t];if(!j(o))return console.error(`Invalid scale configuration for scale: ${t}`);if(o._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);let s=Za(t,o,$a(t,e),G.scales[o.type]),c=Ja(s,i),l=n.scales||{};a[t]=Te(Object.create(null),[{axis:s},o,l[s],l[c]])}),e.data.datasets.forEach(n=>{let i=n.type||e.type,o=n.indexAxis||Ka(i,t),s=(It[i]||{}).scales||{};Object.keys(s).forEach(e=>{let t=qa(e,o),i=n[t+`AxisID`]||t;a[i]=a[i]||Object.create(null),Te(a[i],[{axis:t},r[i],s[e]])})}),Object.keys(a).forEach(e=>{let t=a[e];Te(t,[G.scales[t.type],G.scale])}),a}function to(e){let t=e.options||={};t.plugins=P(t.plugins,{}),t.scales=eo(e,t)}function no(e){return e||={},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function ro(e){return e||={},e.data=no(e.data),to(e),e}var io=new Map,ao=new Set;function oo(e,t){let n=io.get(e);return n||(n=t(),io.set(e,n),ao.add(n)),n}var so=(e,t,n)=>{let r=Ae(t,n);r!==void 0&&e.add(r)},co=class{constructor(e){this._config=ro(e),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(e){this._config.type=e}get data(){return this._config.data}set data(e){this._config.data=no(e)}get options(){return this._config.options}set options(e){this._config.options=e}get plugins(){return this._config.plugins}update(){let e=this._config;this.clearCache(),to(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return oo(e,()=>[[`datasets.${e}`,``]])}datasetAnimationScopeKeys(e,t){return oo(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,``]])}datasetElementScopeKeys(e,t){return oo(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,``]])}pluginScopeKeys(e){let t=e.id,n=this.type;return oo(`${n}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){let n=this._scopeCache,r=n.get(e);return(!r||t)&&(r=new Map,n.set(e,r)),r}getOptionScopes(e,t,n){let{options:r,type:i}=this,a=this._cachedScopes(e,n),o=a.get(t);if(o)return o;let s=new Set;t.forEach(t=>{e&&(s.add(e),t.forEach(t=>so(s,e,t))),t.forEach(e=>so(s,r,e)),t.forEach(e=>so(s,It[i]||{},e)),t.forEach(e=>so(s,G,e)),t.forEach(e=>so(s,Lt,e))});let c=Array.from(s);return c.length===0&&c.push(Object.create(null)),ao.has(t)&&a.set(t,c),c}chartOptionScopes(){let{options:e,type:t}=this;return[e,It[t]||{},G.datasets[t]||{},{type:t},G,Lt]}resolveNamedOptions(e,t,n,r=[``]){let i={$shared:!0},{resolver:a,subPrefixes:o}=lo(this._resolverCache,e,r),s=a;if(fo(a,t)){i.$shared=!1,n=Ne(n)?n():n;let t=this.createResolver(e,n,o);s=mn(a,n,t)}for(let e of t)i[e]=s[e];return i}createResolver(e,t,n=[``],r){let{resolver:i}=lo(this._resolverCache,e,n);return j(t)?mn(i,t,void 0,r):i}};function lo(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));let i=n.join(),a=r.get(i);return a||(a={resolver:pn(t,n),subPrefixes:n.filter(e=>!e.toLowerCase().includes(`hover`))},r.set(i,a)),a}var uo=e=>j(e)&&Object.getOwnPropertyNames(e).some(t=>Ne(e[t]));function fo(e,t){let{isScriptable:n,isIndexable:r}=hn(e);for(let i of t){let t=n(i),a=r(i),o=(a||t)&&e[i];if(t&&(Ne(o)||uo(o))||a&&A(o))return!0}return!1}var po=`4.5.1`,mo=[`top`,`bottom`,`left`,`right`,`chartArea`];function ho(e,t){return e===`top`||e===`bottom`||mo.indexOf(e)===-1&&t===`x`}function go(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function _o(e){let t=e.chart,n=t.options.animation;t.notifyPlugins(`afterRender`),F(n&&n.onComplete,[e],t)}function vo(e){let t=e.chart,n=t.options.animation;F(n&&n.onProgress,[e],t)}function yo(e){return Hn()&&typeof e==`string`?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}var bo={},xo=e=>{let t=yo(e);return Object.values(bo).filter(e=>e.canvas===t).pop()};function So(e,t,n){let r=Object.keys(e);for(let i of r){let r=+i;if(r>=t){let a=e[i];delete e[i],(n>0||r>t)&&(e[r+n]=a)}}}function Co(e,t,n,r){return!n||e.type===`mouseout`?null:r?t:e}var wo=class{static defaults=G;static instances=bo;static overrides=It;static registry=X;static version=po;static getChart=xo;static register(...e){X.add(...e),To()}static unregister(...e){X.remove(...e),To()}constructor(e,t){let n=this.config=new co(t),r=yo(e),i=xo(r);if(i)throw Error(`Canvas is already in use. Chart with ID '`+i.id+`' must be destroyed before the canvas with ID '`+i.canvas.id+`' can be reused.`);let a=n.createResolver(n.chartOptionScopes(),this.getContext());this.platform=new(n.platform||(ha(r))),this.platform.updateConfig(n);let o=this.platform.acquireContext(r,a.aspectRatio),s=o&&o.canvas,c=s&&s.height,l=s&&s.width;if(this.id=_e(),this.ctx=o,this.canvas=s,this.width=l,this.height=c,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Va,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=pt(e=>this.update(e),a.resizeDelay||0),this._dataChanges=[],bo[this.id]=this,!o||!s){console.error(`Failed to create chart: can't acquire context from the given item`);return}Dr.listen(this,`complete`,_o),Dr.listen(this,`progress`,vo),this._initialize(),this.attached&&this.update()}get aspectRatio(){let{options:{aspectRatio:e,maintainAspectRatio:t},width:n,height:r,_aspectRatio:i}=this;return k(e)?t&&i?i:r?n/r:null:e}get data(){return this.config.data}set data(e){this.config.data=e}get options(){return this._options}set options(e){this.config.options=e}get registry(){return X}_initialize(){return this.notifyPlugins(`beforeInit`),this.options.responsive?this.resize():tr(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins(`afterInit`),this}clear(){return Wt(this.canvas,this.ctx),this}stop(){return Dr.stop(this),this}resize(e,t){Dr.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){let n=this.options,r=this.canvas,i=n.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(r,e,t,i),o=n.devicePixelRatio||this.platform.getDevicePixelRatio(),s=this.width?`resize`:`attach`;this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,tr(this,o,!0)&&(this.notifyPlugins(`resize`,{size:a}),F(n.onResize,[this,a],this),this.attached&&this._doResize(s)&&this.render())}ensureScalesHaveIDs(){I(this.options.scales||{},(e,t)=>{e.id=t})}buildOrUpdateScales(){let e=this.options,t=e.scales,n=this.scales,r=Object.keys(n).reduce((e,t)=>(e[t]=!1,e),{}),i=[];t&&(i=i.concat(Object.keys(t).map(e=>{let n=t[e],r=Za(e,n),i=r===`r`,a=r===`x`;return{options:n,dposition:i?`chartArea`:a?`bottom`:`left`,dtype:i?`radialLinear`:a?`category`:`linear`}}))),I(i,t=>{let i=t.options,a=i.id,o=Za(a,i),s=P(i.type,t.dtype);(i.position===void 0||ho(i.position,o)!==ho(t.dposition))&&(i.position=t.dposition),r[a]=!0;let c=null;a in n&&n[a].type===s?c=n[a]:(c=new(X.getScale(s))({id:a,type:s,ctx:this.ctx,chart:this}),n[c.id]=c),c.init(i,e)}),I(r,(e,t)=>{e||delete n[t]}),I(n,e=>{Y.configure(this,e,e.options),Y.addBox(this,e)})}_updateMetasets(){let e=this._metasets,t=this.data.datasets.length,n=e.length;if(e.sort((e,t)=>e.index-t.index),n>t){for(let e=t;et.length&&delete this._stacks,e.forEach((e,n)=>{t.filter(t=>t===e._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let e=[],t=this.data.datasets,n,r;for(this._removeUnreferencedMetasets(),n=0,r=t.length;n{this.getDatasetMeta(t).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins(`reset`)}update(e){let t=this.config;t.update();let n=this._options=t.createResolver(t.chartOptionScopes(),this.getContext()),r=this._animationsDisabled=!n.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins(`beforeUpdate`,{mode:e,cancelable:!0})===!1)return;let i=this.buildOrUpdateControllers();this.notifyPlugins(`beforeElementsUpdate`);let a=0;for(let e=0,t=this.data.datasets.length;e{e.reset()}),this._updateDatasets(e),this.notifyPlugins(`afterUpdate`,{mode:e}),this._layers.sort(go(`z`,`_idx`));let{_active:o,_lastEvent:s}=this;s?this._eventHandler(s,!0):o.length&&this._updateHoverStyles(o,o,!0),this.render()}_updateScales(){I(this.scales,e=>{Y.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let e=this.options;(!Pe(new Set(Object.keys(this._listeners)),new Set(e.events))||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(let{method:n,start:r,count:i}of t)So(e,r,n===`_removeElements`?-i:i)}_getUniformDataChanges(){let e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];let t=this.data.datasets.length,n=t=>new Set(e.filter(e=>e[0]===t).map((e,t)=>t+`,`+e.splice(1).join(`,`))),r=n(0);for(let e=1;ee.split(`,`)).map(e=>({method:e[1],start:+e[2],count:+e[3]}))}_updateLayout(e){if(this.notifyPlugins(`beforeLayout`,{cancelable:!0})===!1)return;Y.update(this,this.width,this.height,e);let t=this.chartArea,n=t.width<=0||t.height<=0;this._layers=[],I(this.boxes,e=>{n&&e.position===`chartArea`||(e.configure&&e.configure(),this._layers.push(...e._layers()))},this),this._layers.forEach((e,t)=>{e._idx=t}),this.notifyPlugins(`afterLayout`)}_updateDatasets(e){if(this.notifyPlugins(`beforeDatasetsUpdate`,{mode:e,cancelable:!0})!==!1){for(let e=0,t=this.data.datasets.length;e=0;--t)this._drawDataset(e[t]);this.notifyPlugins(`afterDatasetsDraw`)}_drawDataset(e){let t=this.ctx,n={meta:e,index:e.index,cancelable:!0},r=Er(this,e);this.notifyPlugins(`beforeDatasetDraw`,n)!==!1&&(r&&qt(t,r),e.controller.draw(),r&&Jt(t),n.cancelable=!1,this.notifyPlugins(`afterDatasetDraw`,n))}isPointInArea(e){return K(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,n,r){let i=Ai.modes[t];return typeof i==`function`?i(this,e,n,r):[]}getDatasetMeta(e){let t=this.data.datasets[e],n=this._metasets,r=n.filter(e=>e&&e._dataset===t).pop();return r||(r={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:t&&t.order||0,index:e,_dataset:t,_parsed:[],_sorted:!1},n.push(r)),r}getContext(){return this.$context||=fn(null,{chart:this,type:`chart`})}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(e){let t=this.data.datasets[e];if(!t)return!1;let n=this.getDatasetMeta(e);return typeof n.hidden==`boolean`?!n.hidden:!t.hidden}setDatasetVisibility(e,t){let n=this.getDatasetMeta(e);n.hidden=!t}toggleDataVisibility(e){this._hiddenIndices[e]=!this._hiddenIndices[e]}getDataVisibility(e){return!this._hiddenIndices[e]}_updateVisibility(e,t,n){let r=n?`show`:`hide`,i=this.getDatasetMeta(e),a=i.controller._resolveAnimations(void 0,r);Me(t)?(i.data[t].hidden=!n,this.update()):(this.setDatasetVisibility(e,n),a.update(i,{visible:n}),this.update(t=>t.datasetIndex===e?r:void 0))}hide(e,t){this._updateVisibility(e,t,!1)}show(e,t){this._updateVisibility(e,t,!0)}_destroyDatasetMeta(e){let t=this._metasets[e];t&&t.controller&&t.controller._destroy(),delete this._metasets[e]}_stop(){let e,t;for(this.stop(),Dr.remove(this),e=0,t=this.data.datasets.length;e{t.addEventListener(this,n,r),e[n]=r},r=(e,t,n)=>{e.offsetX=t,e.offsetY=n,this._eventHandler(e)};I(this.options.events,e=>n(e,r))}bindResponsiveEvents(){this._responsiveListeners||={};let e=this._responsiveListeners,t=this.platform,n=(n,r)=>{t.addEventListener(this,n,r),e[n]=r},r=(n,r)=>{e[n]&&(t.removeEventListener(this,n,r),delete e[n])},i=(e,t)=>{this.canvas&&this.resize(e,t)},a,o=()=>{r(`attach`,o),this.attached=!0,this.resize(),n(`resize`,i),n(`detach`,a)};a=()=>{this.attached=!1,r(`resize`,i),this._stop(),this._resize(0,0),n(`attach`,o)},t.isAttached(this.canvas)?o():a()}unbindEvents(){I(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},I(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,n){let r=n?`set`:`remove`,i,a,o,s;for(t===`dataset`&&(i=this.getDatasetMeta(e[0].datasetIndex),i.controller[`_`+r+`DatasetHoverStyle`]()),o=0,s=e.length;o{let n=this.getDatasetMeta(e);if(!n)throw Error(`No dataset found at index `+e);return{datasetIndex:e,element:n.data[t],index:t}});be(n,t)||(this._active=n,this._lastEvent=null,this._updateHoverStyles(n,t))}notifyPlugins(e,t,n){return this._plugins.notify(this,e,t,n)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,n){let r=this.options.hover,i=(e,t)=>e.filter(e=>!t.some(t=>e.datasetIndex===t.datasetIndex&&e.index===t.index)),a=i(t,e),o=n?e:i(e,t);a.length&&this.updateHoverStyle(a,r.mode,!1),o.length&&r.mode&&this.updateHoverStyle(o,r.mode,!0)}_eventHandler(e,t){let n={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},r=t=>(t.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins(`beforeEvent`,n,r)===!1)return;let i=this._handleEvent(e,t,n.inChartArea);return n.cancelable=!1,this.notifyPlugins(`afterEvent`,n,r),(i||n.changed)&&this.render(),this}_handleEvent(e,t,n){let{_active:r=[],options:i}=this,a=t,o=this._getActiveElements(e,r,n,a),s=Fe(e),c=Co(e,this._lastEvent,n,s);n&&(this._lastEvent=null,F(i.onHover,[e,o,this],this),s&&F(i.onClick,[e,o,this],this));let l=!be(o,r);return(l||t)&&(this._active=o,this._updateHoverStyles(o,r,t)),this._lastEvent=c,l}_getActiveElements(e,t,n,r){if(e.type===`mouseout`)return[];if(!n)return t;let i=this.options.hover;return this.getElementsAtEventForMode(e,i.mode,i,r)}};function To(){return I(wo.instances,e=>e._plugins.invalidate())}function Eo(e,t,n){let{startAngle:r,x:i,y:a,outerRadius:o,innerRadius:s,options:c}=t,{borderWidth:l,borderJoinStyle:u}=c,d=Math.min(l/o,H(r-n));if(e.beginPath(),e.arc(i,a,o-l/2,r+d/2,n-d/2),s>0){let t=Math.min(l/s,H(r-n));e.arc(i,a,s+l/2,n-t/2,r+t/2,!0)}else{let t=Math.min(l/2,o*H(r-n));if(u===`round`)e.arc(i,a,t,n-L/2,r+L/2,!0);else if(u===`bevel`){let o=2*t*t,s=-o*Math.cos(n+L/2)+i,c=-o*Math.sin(n+L/2)+a,l=o*Math.cos(r+L/2)+i,u=o*Math.sin(r+L/2)+a;e.lineTo(s,c),e.lineTo(l,u)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip(`evenodd`)}function Do(e,t,n){let{startAngle:r,pixelMargin:i,x:a,y:o,outerRadius:s,innerRadius:c}=t,l=i/s;e.beginPath(),e.arc(a,o,s,r-l,n+l),c>i?(l=i/c,e.arc(a,o,c,n+l,r-l,!0)):e.arc(a,o,i,n+z,r-z),e.closePath(),e.clip()}function Oo(e){return sn(e,[`outerStart`,`outerEnd`,`innerStart`,`innerEnd`])}function ko(e,t,n,r){let i=Oo(e.options.borderRadius),a=(n-t)/2,o=Math.min(a,r*t/2),s=e=>{let t=(n-Math.min(a,e))*r/2;return U(e,0,Math.min(a,t))};return{outerStart:s(i.outerStart),outerEnd:s(i.outerEnd),innerStart:U(i.innerStart,0,o),innerEnd:U(i.innerEnd,0,o)}}function Ao(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function jo(e,t,n,r,i,a){let{x:o,y:s,startAngle:c,pixelMargin:l,innerRadius:u}=t,d=Math.max(t.outerRadius+r+n-l,0),f=u>0?u+r+n+l:0,p=0,m=i-c;if(r){let e=((u>0?u-r:0)+(d>0?d-r:0))/2;p=(m-(e===0?m:m*e/(e+r)))/2}let h=(m-Math.max(.001,m*d-n/L)/d)/2,g=c+h+p,_=i-h-p,{outerStart:v,outerEnd:y,innerStart:b,innerEnd:x}=ko(t,f,d,_-g),S=d-v,C=d-y,w=g+v/S,T=_-y/C,E=f+b,D=f+x,ee=g+b/E,O=_-x/D;if(e.beginPath(),a){let t=(w+T)/2;if(e.arc(o,s,d,w,t),e.arc(o,s,d,t,T),y>0){let t=Ao(C,T,o,s);e.arc(t.x,t.y,y,T,_+z)}let n=Ao(D,_,o,s);if(e.lineTo(n.x,n.y),x>0){let t=Ao(D,O,o,s);e.arc(t.x,t.y,x,_+z,O+Math.PI)}let r=(_-x/f+(g+b/f))/2;if(e.arc(o,s,f,_-x/f,r,!0),e.arc(o,s,f,r,g+b/f,!0),b>0){let t=Ao(E,ee,o,s);e.arc(t.x,t.y,b,ee+Math.PI,g-z)}let i=Ao(S,g,o,s);if(e.lineTo(i.x,i.y),v>0){let t=Ao(S,w,o,s);e.arc(t.x,t.y,v,g-z,w)}}else{e.moveTo(o,s);let t=Math.cos(w)*d+o,n=Math.sin(w)*d+s;e.lineTo(t,n);let r=Math.cos(T)*d+o,i=Math.sin(T)*d+s;e.lineTo(r,i)}e.closePath()}function Mo(e,t,n,r,i){let{fullCircles:a,startAngle:o,circumference:s}=t,c=t.endAngle;if(a){jo(e,t,n,r,c,i);for(let t=0;t=L&&p===0&&u!==`miter`&&Eo(e,t,h),a||(jo(e,t,n,r,h,i),e.stroke())}var Po=class extends ga{static id=`arc`;static defaults={borderAlign:`center`,borderColor:`#fff`,borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1};static defaultRoutes={backgroundColor:`backgroundColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,n){let{angle:r,distance:i}=Ze(this.getProps([`x`,`y`],n),{x:e,y:t}),{startAngle:a,endAngle:o,innerRadius:s,outerRadius:c,circumference:l}=this.getProps([`startAngle`,`endAngle`,`innerRadius`,`outerRadius`,`circumference`],n),u=(this.options.spacing+this.options.borderWidth)/2,d=P(l,o-a),f=et(r,a,o)&&a!==o,p=d>=R||f,m=nt(i,s+u,c+u);return p&&m}getCenterPoint(e){let{x:t,y:n,startAngle:r,endAngle:i,innerRadius:a,outerRadius:o}=this.getProps([`x`,`y`,`startAngle`,`endAngle`,`innerRadius`,`outerRadius`],e),{offset:s,spacing:c}=this.options,l=(r+i)/2,u=(a+o+c+s)/2;return{x:t+Math.cos(l)*u,y:n+Math.sin(l)*u}}tooltipPosition(e){return this.getCenterPoint(e)}draw(e){let{options:t,circumference:n}=this,r=(t.offset||0)/4,i=(t.spacing||0)/2,a=t.circular;if(this.pixelMargin=t.borderAlign===`inner`?.33:0,this.fullCircles=n>R?Math.floor(n/R):0,n===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(o)*r,Math.sin(o)*r);let s=r*(1-Math.sin(Math.min(L,n||0)));e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor,Mo(e,this,s,i,a),No(e,this,s,i,a),e.restore()}};function Fo(e,t,n=t){e.lineCap=P(n.borderCapStyle,t.borderCapStyle),e.setLineDash(P(n.borderDash,t.borderDash)),e.lineDashOffset=P(n.borderDashOffset,t.borderDashOffset),e.lineJoin=P(n.borderJoinStyle,t.borderJoinStyle),e.lineWidth=P(n.borderWidth,t.borderWidth),e.strokeStyle=P(n.borderColor,t.borderColor)}function Io(e,t,n){e.lineTo(n.x,n.y)}function Lo(e){return e.stepped?Yt:e.tension||e.cubicInterpolationMode===`monotone`?Xt:Io}function Ro(e,t,n={}){let r=e.length,{start:i=0,end:a=r-1}=n,{start:o,end:s}=t,c=Math.max(i,o),l=Math.min(a,s),u=is&&a>s;return{count:r,start:c,loop:t.loop,ilen:l(o+(l?s-e:e))%a,y=()=>{h!==g&&(e.lineTo(u,g),e.lineTo(u,h),e.lineTo(u,_))};for(c&&(p=i[v(0)],e.moveTo(p.x,p.y)),f=0;f<=s;++f){if(p=i[v(f)],p.skip)continue;let t=p.x,n=p.y,r=t|0;r===m?(ng&&(g=n),u=(d*u+t)/++d):(y(),e.lineTo(t,n),m=r,d=0,h=g=n),_=n}y()}function Vo(e){let t=e.options,n=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!==`monotone`&&!t.stepped&&!n?Bo:zo}function Ho(e){return e.stepped?ar:e.tension||e.cubicInterpolationMode===`monotone`?or:ir}function Uo(e,t,n,r){let i=t._path;i||(i=t._path=new Path2D,t.path(i,n,r)&&i.closePath()),Fo(e,t.options),e.stroke(i)}function Wo(e,t,n,r){let{segments:i,options:a}=t,o=Vo(t);for(let s of i)Fo(e,a,s.style),e.beginPath(),o(e,t,s,{start:n,end:n+r-1})&&e.closePath(),e.stroke()}var Go=typeof Path2D==`function`;function Ko(e,t,n,r){Go&&!t.options.segment?Uo(e,t,n,r):Wo(e,t,n,r)}var qo=class extends ga{static id=`line`;static defaults={borderCapStyle:`butt`,borderDash:[],borderDashOffset:0,borderJoinStyle:`miter`,borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:`default`,fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:`backgroundColor`,borderColor:`borderColor`};static descriptors={_scriptable:!0,_indexable:e=>e!==`borderDash`&&e!==`fill`};constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){let n=this.options;if((n.tension||n.cubicInterpolationMode===`monotone`)&&!n.stepped&&!this._pointsUpdated){let r=n.spanGaps?this._loop:this._fullLoop;Vn(this._points,n,e,r,t),this._pointsUpdated=!0}}set points(e){this._points=e,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||=yr(this,this.options.segment)}first(){let e=this.segments,t=this.points;return e.length&&t[e[0].start]}last(){let e=this.segments,t=this.points,n=e.length;return n&&t[e[n-1].end]}interpolate(e,t){let n=this.options,r=e[t],i=this.points,a=gr(this,{property:t,start:r,end:r});if(!a.length)return;let o=[],s=Ho(n),c,l;for(c=0,l=a.length;c{t=ls(e,t,i);let o=i[e],s=i[t];r===null?n!==null&&(a.push({x:n,y:o.y}),a.push({x:n,y:s.y})):(a.push({x:o.x,y:r}),a.push({x:s.x,y:r}))}),a}function ls(e,t,n){for(;t>e;t--){let e=n[t];if(!isNaN(e.x)&&!isNaN(e.y))break}return t}function us(e,t,n,r){return e&&t?r(e[n],t[n]):e?e[n]:t?t[n]:0}function ds(e,t){let n=[],r=!1;return A(e)?(r=!0,n=e):n=cs(e,t),n.length?new qo({points:n,options:{tension:0},_loop:r,_fullLoop:r}):null}function fs(e){return e&&e.fill!==!1}function ps(e,t,n){let r=e[t].fill,i=[t],a;if(!n)return r;for(;r!==!1&&i.indexOf(r)===-1;){if(!M(r))return r;if(a=e[r],!a)return!1;if(a.visible)return r;i.push(r),r=a.fill}return!1}function ms(e,t,n){let r=vs(e);if(j(r))return isNaN(r.value)?!1:r;let i=parseFloat(r);return M(i)&&Math.floor(i)===i?hs(r[0],t,i,n):[`origin`,`start`,`end`,`stack`,`shape`].indexOf(r)>=0&&r}function hs(e,t,n,r){return(e===`-`||e===`+`)&&(n=t+n),n===t||n<0||n>=r?!1:n}function gs(e,t){let n=null;return e===`start`?n=t.bottom:e===`end`?n=t.top:j(e)?n=t.getPixelForValue(e.value):t.getBasePixel&&(n=t.getBasePixel()),n}function _s(e,t,n){let r;return r=e===`start`?n:e===`end`?t.options.reverse?t.min:t.max:j(e)?e.value:t.getBaseValue(),r}function vs(e){let t=e.options,n=t.fill,r=P(n&&n.target,n);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?`origin`:r}function ys(e){let{scale:t,index:n,line:r}=e,i=[],a=r.segments,o=r.points,s=bs(t,n);s.push(ds({x:null,y:t.bottom},r));for(let e=0;e=0;--t){let n=i[t].$filler;n&&(n.line.updateControlPoints(a,n.axis),r&&n.fill&&ks(e.ctx,n,a))}},beforeDatasetsDraw(e,t,n){if(n.drawTime!==`beforeDatasetsDraw`)return;let r=e.getSortedVisibleDatasetMetas();for(let t=r.length-1;t>=0;--t){let n=r[t].$filler;fs(n)&&ks(e.ctx,n,e.chartArea)}},beforeDatasetDraw(e,t,n){let r=t.meta.$filler;!fs(r)||n.drawTime!==`beforeDatasetDraw`||ks(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:`beforeDatasetDraw`}},Ls=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},Rs=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index,zs=class extends ga{constructor(e){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t,n){this.maxWidth=e,this.maxHeight=t,this._margins=n,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let e=this.options.labels||{},t=F(e.generateLabels,[this.chart],this)||[];e.filter&&(t=t.filter(t=>e.filter(t,this.chart.data))),e.sort&&(t=t.sort((t,n)=>e.sort(t,n,this.chart.data))),this.options.reverse&&t.reverse(),this.legendItems=t}fit(){let{options:e,ctx:t}=this;if(!e.display){this.width=this.height=0;return}let n=e.labels,r=J(n.font),i=r.size,a=this._computeTitleHeight(),{boxWidth:o,itemHeight:s}=Ls(n,i),c,l;t.font=r.string,this.isHorizontal()?(c=this.maxWidth,l=this._fitRows(a,i,o,s)+10):(l=this.maxHeight,c=this._fitCols(a,r,o,s)+10),this.width=Math.min(c,e.maxWidth||this.maxWidth),this.height=Math.min(l,e.maxHeight||this.maxHeight)}_fitRows(e,t,n,r){let{ctx:i,maxWidth:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.lineWidths=[0],l=r+o,u=e;i.textAlign=`left`,i.textBaseline=`middle`;let d=-1,f=-l;return this.legendItems.forEach((e,p)=>{let m=n+t/2+i.measureText(e.text).width;(p===0||c[c.length-1]+m+2*o>a)&&(u+=l,c[c.length-(p>0?0:1)]=0,f+=l,d++),s[p]={left:0,top:f,row:d,width:m,height:r},c[c.length-1]+=m+o}),u}_fitCols(e,t,n,r){let{ctx:i,maxHeight:a,options:{labels:{padding:o}}}=this,s=this.legendHitBoxes=[],c=this.columnSizes=[],l=a-e,u=o,d=0,f=0,p=0,m=0;return this.legendItems.forEach((e,a)=>{let{itemWidth:h,itemHeight:g}=Bs(n,t,i,e,r);a>0&&f+g+2*o>l&&(u+=d+o,c.push({width:d,height:f}),p+=d+o,m++,d=f=0),s[a]={left:p,top:f,col:m,width:h,height:g},d=Math.max(d,h),f+=g+o}),u+=d,c.push({width:d,height:f}),u}adjustHitBoxes(){if(!this.options.display)return;let e=this._computeTitleHeight(),{legendHitBoxes:t,options:{align:n,labels:{padding:r},rtl:i}}=this,a=lr(i,this.left,this.width);if(this.isHorizontal()){let i=0,o=W(n,this.left+r,this.right-this.lineWidths[i]);for(let s of t)i!==s.row&&(i=s.row,o=W(n,this.left+r,this.right-this.lineWidths[i])),s.top+=this.top+e+r,s.left=a.leftForLtr(a.x(o),s.width),o+=s.width+r}else{let i=0,o=W(n,this.top+e+r,this.bottom-this.columnSizes[i].height);for(let s of t)s.col!==i&&(i=s.col,o=W(n,this.top+e+r,this.bottom-this.columnSizes[i].height)),s.top=o,s.left+=this.left+r,s.left=a.leftForLtr(a.x(s.left),s.width),o+=s.height+r}}isHorizontal(){return this.options.position===`top`||this.options.position===`bottom`}draw(){if(this.options.display){let e=this.ctx;qt(e,this),this._draw(),Jt(e)}}_draw(){let{options:e,columnSizes:t,lineWidths:n,ctx:r}=this,{align:i,labels:a}=e,o=G.color,s=lr(e.rtl,this.left,this.width),c=J(a.font),{padding:l}=a,u=c.size,d=u/2,f;this.drawTitle(),r.textAlign=s.textAlign(`left`),r.textBaseline=`middle`,r.lineWidth=.5,r.font=c.string;let{boxWidth:p,boxHeight:m,itemHeight:h}=Ls(a,u),g=function(e,t,n){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;r.save();let i=P(n.lineWidth,1);if(r.fillStyle=P(n.fillStyle,o),r.lineCap=P(n.lineCap,`butt`),r.lineDashOffset=P(n.lineDashOffset,0),r.lineJoin=P(n.lineJoin,`miter`),r.lineWidth=i,r.strokeStyle=P(n.strokeStyle,o),r.setLineDash(P(n.lineDash,[])),a.usePointStyle)Kt(r,{radius:m*Math.SQRT2/2,pointStyle:n.pointStyle,rotation:n.rotation,borderWidth:i},s.xPlus(e,p/2),t+d,a.pointStyleWidth&&p);else{let a=t+Math.max((u-m)/2,0),o=s.leftForLtr(e,p),c=ln(n.borderRadius);r.beginPath(),Object.values(c).some(e=>e!==0)?tn(r,{x:o,y:a,w:p,h:m,radius:c}):r.rect(o,a,p,m),r.fill(),i!==0&&r.stroke()}r.restore()},_=function(e,t,n){en(r,n.text,e,t+h/2,c,{strikethrough:n.hidden,textAlign:s.textAlign(n.textAlign)})},v=this.isHorizontal(),y=this._computeTitleHeight();f=v?{x:W(i,this.left+l,this.right-n[0]),y:this.top+l+y,line:0}:{x:this.left+l,y:W(i,this.top+y+l,this.bottom-t[0].height),line:0},ur(this.ctx,e.textDirection);let b=h+l;this.legendItems.forEach((o,u)=>{r.strokeStyle=o.fontColor,r.fillStyle=o.fontColor;let m=r.measureText(o.text).width,h=s.textAlign(o.textAlign||=a.textAlign),x=p+d+m,S=f.x,C=f.y;if(s.setWidth(this.width),v?u>0&&S+x+l>this.right&&(C=f.y+=b,f.line++,S=f.x=W(i,this.left+l,this.right-n[f.line])):u>0&&C+b>this.bottom&&(S=f.x=S+t[f.line].width+l,f.line++,C=f.y=W(i,this.top+y+l,this.bottom-t[f.line].height)),g(s.x(S),C,o),S=ht(h,S+p+d,v?S+x:this.right,e.rtl),_(s.x(S),C,o),v)f.x+=x+l;else if(typeof o.text!=`string`){let e=c.lineHeight;f.y+=Us(o,e)+l}else f.y+=b}),dr(this.ctx,e.textDirection)}drawTitle(){let e=this.options,t=e.title,n=J(t.font),r=q(t.padding);if(!t.display)return;let i=lr(e.rtl,this.left,this.width),a=this.ctx,o=t.position,s=n.size/2,c=r.top+s,l,u=this.left,d=this.width;if(this.isHorizontal())d=Math.max(...this.lineWidths),l=this.top+c,u=W(e.align,u,this.right-d);else{let t=this.columnSizes.reduce((e,t)=>Math.max(e,t.height),0);l=c+W(e.align,this.top,this.bottom-t-e.labels.padding-this._computeTitleHeight())}let f=W(o,u,u+d);a.textAlign=i.textAlign(mt(o)),a.textBaseline=`middle`,a.strokeStyle=t.color,a.fillStyle=t.color,a.font=n.string,en(a,t.text,f,l,n)}_computeTitleHeight(){let e=this.options.title,t=J(e.font),n=q(e.padding);return e.display?t.lineHeight+n.height:0}_getLegendItemAt(e,t){let n,r,i;if(nt(e,this.left,this.right)&&nt(t,this.top,this.bottom)){for(i=this.legendHitBoxes,n=0;ne.length>t.length?e:t)),t+n.size/2+r.measureText(i).width}function Hs(e,t,n){let r=e;return typeof t.text!=`string`&&(r=Us(t,n)),r}function Us(e,t){return t*(e.text?e.text.length:0)}function Ws(e,t){return!!((e===`mousemove`||e===`mouseout`)&&(t.onHover||t.onLeave)||t.onClick&&(e===`click`||e===`mouseup`))}var Gs={id:`legend`,_element:zs,start(e,t,n){let r=e.legend=new zs({ctx:e.ctx,options:n,chart:e});Y.configure(e,r,n),Y.addBox(e,r)},stop(e){Y.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){let r=e.legend;Y.configure(e,r,n),r.options=n},afterUpdate(e){let t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:`top`,align:`center`,fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){let r=t.datasetIndex,i=n.chart;i.isDatasetVisible(r)?(i.hide(r),t.hidden=!0):(i.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){let t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:i,color:a,useBorderRadius:o,borderRadius:s}}=e.legend.options;return e._getSortedDatasetMetas().map(e=>{let c=e.controller.getStyle(n?0:void 0),l=q(c.borderWidth);return{text:t[e.index].label,fillStyle:c.backgroundColor,fontColor:a,hidden:!e.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:i||c.textAlign,borderRadius:o&&(s||c.borderRadius),datasetIndex:e.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:`center`,text:``}},descriptors:{_scriptable:e=>!e.startsWith(`on`),labels:{_scriptable:e=>![`generateLabels`,`filter`,`sort`].includes(e)}}},Ks=class extends ga{constructor(e){super(),this.chart=e.chart,this.options=e.options,this.ctx=e.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(e,t){let n=this.options;if(this.left=0,this.top=0,!n.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=e,this.height=this.bottom=t;let r=A(n.text)?n.text.length:1;this._padding=q(n.padding);let i=r*J(n.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=i:this.width=i}isHorizontal(){let e=this.options.position;return e===`top`||e===`bottom`}_drawArgs(e){let{top:t,left:n,bottom:r,right:i,options:a}=this,o=a.align,s=0,c,l,u;return this.isHorizontal()?(l=W(o,n,i),u=t+e,c=i-n):(a.position===`left`?(l=n+e,u=W(o,r,t),s=L*-.5):(l=i-e,u=W(o,t,r),s=L*.5),c=r-t),{titleX:l,titleY:u,maxWidth:c,rotation:s}}draw(){let e=this.ctx,t=this.options;if(!t.display)return;let n=J(t.font),r=n.lineHeight/2+this._padding.top,{titleX:i,titleY:a,maxWidth:o,rotation:s}=this._drawArgs(r);en(e,t.text,0,0,n,{color:t.color,maxWidth:o,rotation:s,textAlign:mt(t.align),textBaseline:`middle`,translation:[i,a]})}};function qs(e,t){let n=new Ks({ctx:e.ctx,options:t,chart:e});Y.configure(e,n,t),Y.addBox(e,n),e.titleBlock=n}var Js={id:`title`,_element:Ks,start(e,t,n){qs(e,n)},stop(e){let t=e.titleBlock;Y.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,n){let r=e.titleBlock;Y.configure(e,r,n),r.options=n},defaults:{align:`center`,display:!1,font:{weight:`bold`},fullSize:!0,padding:10,position:`top`,text:``,weight:2e3},defaultRoutes:{color:`color`},descriptors:{_scriptable:!0,_indexable:!1}},Ys={average(e){if(!e.length)return!1;let t,n,r=new Set,i=0,a=0;for(t=0,n=e.length;te+t)/r.size,y:i/a}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,i=1/0,a,o,s;for(a=0,o=e.length;a-1?e.split(` +`):e}function Zs(e,t){let{element:n,datasetIndex:r,index:i}=t,a=e.getDatasetMeta(r).controller,{label:o,value:s}=a.getLabelAndValue(i);return{chart:e,label:o,parsed:a.getParsed(i),raw:e.data.datasets[r].data[i],formattedValue:s,dataset:a.getDataset(),dataIndex:i,datasetIndex:r,element:n}}function Qs(e,t){let n=e.chart.ctx,{body:r,footer:i,title:a}=e,{boxWidth:o,boxHeight:s}=t,c=J(t.bodyFont),l=J(t.titleFont),u=J(t.footerFont),d=a.length,f=i.length,p=r.length,m=q(t.padding),h=m.height,g=0,_=r.reduce((e,t)=>e+t.before.length+t.lines.length+t.after.length,0);if(_+=e.beforeBody.length+e.afterBody.length,d&&(h+=d*l.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){let e=t.displayColors?Math.max(s,c.lineHeight):c.lineHeight;h+=p*e+(_-p)*c.lineHeight+(_-1)*t.bodySpacing}f&&(h+=t.footerMarginTop+f*u.lineHeight+(f-1)*t.footerSpacing);let v=0,y=function(e){g=Math.max(g,n.measureText(e).width+v)};return n.save(),n.font=l.string,I(e.title,y),n.font=c.string,I(e.beforeBody.concat(e.afterBody),y),v=t.displayColors?o+2+t.boxPadding:0,I(r,e=>{I(e.before,y),I(e.lines,y),I(e.after,y)}),v=0,n.font=u.string,I(e.footer,y),n.restore(),g+=m.width,{width:g,height:h}}function $s(e,t){let{y:n,height:r}=t;return ne.height-r/2?`bottom`:`center`}function ec(e,t,n,r){let{x:i,width:a}=r,o=n.caretSize+n.caretPadding;if(e===`left`&&i+a+o>t.width||e===`right`&&i-a-o<0)return!0}function tc(e,t,n,r){let{x:i,width:a}=n,{width:o,chartArea:{left:s,right:c}}=e,l=`center`;return r===`center`?l=i<=(s+c)/2?`left`:`right`:i<=a/2?l=`left`:i>=o-a/2&&(l=`right`),ec(l,e,t,n)&&(l=`center`),l}function nc(e,t,n){let r=n.yAlign||t.yAlign||$s(e,n);return{xAlign:n.xAlign||t.xAlign||tc(e,t,n,r),yAlign:r}}function rc(e,t){let{x:n,width:r}=e;return t===`right`?n-=r:t===`center`&&(n-=r/2),n}function ic(e,t,n){let{y:r,height:i}=e;return t===`top`?r+=n:t===`bottom`?r-=i+n:r-=i/2,r}function ac(e,t,n,r){let{caretSize:i,caretPadding:a,cornerRadius:o}=e,{xAlign:s,yAlign:c}=n,l=i+a,{topLeft:u,topRight:d,bottomLeft:f,bottomRight:p}=ln(o),m=rc(t,s),h=ic(t,c,l);return c===`center`?s===`left`?m+=l:s===`right`&&(m-=l):s===`left`?m-=Math.max(u,f)+i:s===`right`&&(m+=Math.max(d,p)+i),{x:U(m,0,r.width-t.width),y:U(h,0,r.height-t.height)}}function oc(e,t,n){let r=q(n.padding);return t===`center`?e.x+e.width/2:t===`right`?e.x+e.width-r.right:e.x+r.left}function sc(e){return Z([],Xs(e))}function cc(e,t,n){return fn(e,{tooltip:t,tooltipItems:n,type:`tooltip`})}function lc(e,t){let n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}var uc={beforeTitle:ge,title(e){if(e.length>0){let t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode===`dataset`)return t.dataset.label||``;if(t.label)return t.label;if(r>0&&t.dataIndex{let t={before:[],lines:[],after:[]},i=lc(n,e);Z(t.before,Xs(Q(i,`beforeLabel`,this,e))),Z(t.lines,Q(i,`label`,this,e)),Z(t.after,Xs(Q(i,`afterLabel`,this,e))),r.push(t)}),r}getAfterBody(e,t){return sc(Q(t.callbacks,`afterBody`,this,e))}getFooter(e,t){let{callbacks:n}=t,r=Q(n,`beforeFooter`,this,e),i=Q(n,`footer`,this,e),a=Q(n,`afterFooter`,this,e),o=[];return o=Z(o,Xs(r)),o=Z(o,Xs(i)),o=Z(o,Xs(a)),o}_createItems(e){let t=this._active,n=this.chart.data,r=[],i=[],a=[],o=[],s,c;for(s=0,c=t.length;se.filter(t,r,i,n))),e.itemSort&&(o=o.sort((t,r)=>e.itemSort(t,r,n))),I(o,t=>{let n=lc(e.callbacks,t);r.push(Q(n,`labelColor`,this,t)),i.push(Q(n,`labelPointStyle`,this,t)),a.push(Q(n,`labelTextColor`,this,t))}),this.labelColors=r,this.labelPointStyles=i,this.labelTextColors=a,this.dataPoints=o,o}update(e,t){let n=this.options.setContext(this.getContext()),r=this._active,i,a=[];if(!r.length)this.opacity!==0&&(i={opacity:0});else{let e=Ys[n.position].call(this,r,this._eventPosition);a=this._createItems(n),this.title=this.getTitle(a,n),this.beforeBody=this.getBeforeBody(a,n),this.body=this.getBody(a,n),this.afterBody=this.getAfterBody(a,n),this.footer=this.getFooter(a,n);let t=this._size=Qs(this,n),o=Object.assign({},e,t),s=nc(this.chart,n,o),c=ac(n,o,s,this.chart);this.xAlign=s.xAlign,this.yAlign=s.yAlign,i={opacity:1,x:c.x,y:c.y,width:t.width,height:t.height,caretX:e.x,caretY:e.y}}this._tooltipItems=a,this.$context=void 0,i&&this._resolveAnimations().update(this,i),e&&n.external&&n.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,n,r){let i=this.getCaretPosition(e,n,r);t.lineTo(i.x1,i.y1),t.lineTo(i.x2,i.y2),t.lineTo(i.x3,i.y3)}getCaretPosition(e,t,n){let{xAlign:r,yAlign:i}=this,{caretSize:a,cornerRadius:o}=n,{topLeft:s,topRight:c,bottomLeft:l,bottomRight:u}=ln(o),{x:d,y:f}=e,{width:p,height:m}=t,h,g,_,v,y,b;return i===`center`?(y=f+m/2,r===`left`?(h=d,g=h-a,v=y+a,b=y-a):(h=d+p,g=h+a,v=y-a,b=y+a),_=h):(g=r===`left`?d+Math.max(s,l)+a:r===`right`?d+p-Math.max(c,u)-a:this.caretX,i===`top`?(v=f,y=v-a,h=g-a,_=g+a):(v=f+m,y=v+a,h=g+a,_=g-a),b=v),{x1:h,x2:g,x3:_,y1:v,y2:y,y3:b}}drawTitle(e,t,n){let r=this.title,i=r.length,a,o,s;if(i){let c=lr(n.rtl,this.x,this.width);for(e.x=oc(this,n.titleAlign,n),t.textAlign=c.textAlign(n.titleAlign),t.textBaseline=`middle`,a=J(n.titleFont),o=n.titleSpacing,t.fillStyle=n.titleColor,t.font=a.string,s=0;se!==0)?(e.beginPath(),e.fillStyle=i.multiKeyBackground,tn(e,{x:t,y:p,w:c,h:s,radius:o}),e.fill(),e.stroke(),e.fillStyle=a.backgroundColor,e.beginPath(),tn(e,{x:n,y:p+1,w:c-2,h:s-2,radius:o}),e.fill()):(e.fillStyle=i.multiKeyBackground,e.fillRect(t,p,c,s),e.strokeRect(t,p,c,s),e.fillStyle=a.backgroundColor,e.fillRect(n,p+1,c-2,s-2))}e.fillStyle=this.labelTextColors[n]}drawBody(e,t,n){let{body:r}=this,{bodySpacing:i,bodyAlign:a,displayColors:o,boxHeight:s,boxWidth:c,boxPadding:l}=n,u=J(n.bodyFont),d=u.lineHeight,f=0,p=lr(n.rtl,this.x,this.width),m=function(n){t.fillText(n,p.x(e.x+f),e.y+d/2),e.y+=d+i},h=p.textAlign(a),g,_,v,y,b,x,S;for(t.textAlign=a,t.textBaseline=`middle`,t.font=u.string,e.x=oc(this,h,n),t.fillStyle=n.bodyColor,I(this.beforeBody,m),f=o&&h!==`right`?a===`center`?c/2+l:c+2+l:0,y=0,x=r.length;y0&&t.stroke()}_updateAnimationTarget(e){let t=this.chart,n=this.$animations,r=n&&n.x,i=n&&n.y;if(r||i){let n=Ys[e.position].call(this,this._active,this._eventPosition);if(!n)return;let a=this._size=Qs(this,e),o=Object.assign({},n,this._size),s=nc(t,e,o),c=ac(e,o,s,t);(r._to!==c.x||i._to!==c.y)&&(this.xAlign=s.xAlign,this.yAlign=s.yAlign,this.width=a.width,this.height=a.height,this.caretX=n.x,this.caretY=n.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(e){let t=this.options.setContext(this.getContext()),n=this.opacity;if(!n)return;this._updateAnimationTarget(t);let r={width:this.width,height:this.height},i={x:this.x,y:this.y};n=Math.abs(n)<.001?0:n;let a=q(t.padding),o=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;t.enabled&&o&&(e.save(),e.globalAlpha=n,this.drawBackground(i,e,r,t),ur(e,t.textDirection),i.y+=a.top,this.drawTitle(i,e,t),this.drawBody(i,e,t),this.drawFooter(i,e,t),dr(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){let n=this._active,r=e.map(({datasetIndex:e,index:t})=>{let n=this.chart.getDatasetMeta(e);if(!n)throw Error(`Cannot find a dataset at index `+e);return{datasetIndex:e,element:n.data[t],index:t}}),i=!be(n,r),a=this._positionChanged(r,t);(i||a)&&(this._active=r,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,n=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let r=this.options,i=this._active||[],a=this._getActiveElements(e,i,t,n),o=this._positionChanged(a,e),s=t||!be(a,i)||o;return s&&(this._active=a,(r.enabled||r.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),s}_getActiveElements(e,t,n,r){let i=this.options;if(e.type===`mouseout`)return[];if(!r)return t.filter(e=>this.chart.data.datasets[e.datasetIndex]&&this.chart.getDatasetMeta(e.datasetIndex).controller.getParsed(e.index)!==void 0);let a=this.chart.getElementsAtEventForMode(e,i.mode,i,n);return i.reverse&&a.reverse(),a}_positionChanged(e,t){let{caretX:n,caretY:r,options:i}=this,a=Ys[i.position].call(this,e,t);return a!==!1&&(n!==a.x||r!==a.y)}},fc={id:`tooltip`,_element:dc,positioners:Ys,afterInit(e,t,n){n&&(e.tooltip=new dc({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){let t=e.tooltip;if(t&&t._willRender()){let n={tooltip:t};if(e.notifyPlugins(`beforeTooltipDraw`,{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins(`afterTooltipDraw`,n)}},afterEvent(e,t){if(e.tooltip){let n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:`average`,backgroundColor:`rgba(0,0,0,0.8)`,titleColor:`#fff`,titleFont:{weight:`bold`},titleSpacing:2,titleMarginBottom:6,titleAlign:`left`,bodyColor:`#fff`,bodySpacing:2,bodyFont:{},bodyAlign:`left`,footerColor:`#fff`,footerSpacing:2,footerMarginTop:6,footerFont:{weight:`bold`},footerAlign:`left`,padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:`#fff`,displayColors:!0,boxPadding:0,borderColor:`rgba(0,0,0,0)`,borderWidth:0,animation:{duration:400,easing:`easeOutQuart`},animations:{numbers:{type:`number`,properties:[`x`,`y`,`width`,`height`,`caretX`,`caretY`]},opacity:{easing:`linear`,duration:200}},callbacks:uc},defaultRoutes:{bodyFont:`font`,footerFont:`font`,titleFont:`font`},descriptors:{_scriptable:e=>e!==`filter`&&e!==`itemSort`&&e!==`external`,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:`animation`}},additionalOptionScopes:[`interaction`]},pc=(e,t,n,r)=>(typeof t==`string`?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function mc(e,t,n,r){let i=e.indexOf(t);return i===-1?pc(e,t,n,r):i===e.lastIndexOf(t)?i:n}var hc=(e,t)=>e===null?null:U(Math.round(e),0,t);function gc(e){let t=this.getLabels();return e>=0&&et.length-1?null:this.getPixelForValue(t[e].value)}getValueForPixel(e){return Math.round(this._startValue+this.getDecimalForPixel(e)*this._valueRange)}getBasePixel(){return this.bottom}};function vc(e,t){let n=[],{bounds:r,step:i,min:a,max:o,precision:s,count:c,maxTicks:l,maxDigits:u,includeBounds:d}=e,f=i||1,p=l-1,{min:m,max:h}=t,g=!k(a),_=!k(o),v=!k(c),y=(h-m)/(u+1),b=Ue((h-m)/p/f)*f,x,S,C,w;if(b<1e-14&&!g&&!_)return[{value:m},{value:h}];w=Math.ceil(h/b)-Math.floor(m/b),w>p&&(b=Ue(w*b/p/f)*f),k(s)||(x=10**s,b=Math.ceil(b*x)/x),r===`ticks`?(S=Math.floor(m/b)*b,C=Math.ceil(h/b)*b):(S=m,C=h),g&&_&&i&&qe((o-a)/i,b/1e3)?(w=Math.round(Math.min((o-a)/b,l)),b=(o-a)/w,S=a,C=o):v?(S=g?a:S,C=_?o:C,w=c-1,b=(C-S)/w):(w=(C-S)/b,w=He(w,Math.round(w),b/1e3)?Math.round(w):Math.ceil(w));let T=Math.max(Xe(b),Xe(S));x=10**(k(s)?T:s),S=Math.round(S*x)/x,C=Math.round(C*x)/x;let E=0;for(g&&(d&&S!==a?(n.push({value:a}),So)break;n.push({value:e})}return _&&d&&C!==o?n.length&&He(n[n.length-1].value,o,yc(o,y,e))?n[n.length-1].value=o:n.push({value:o}):(!_||C===o)&&n.push({value:C}),n}function yc(e,t,{horizontal:n,minRotation:r}){let i=V(r),a=(n?Math.sin(i):Math.cos(i))||.001,o=.75*t*(``+e).length;return Math.min(t/a,o)}var bc=class extends Ia{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(e,t){return k(e)||(typeof e==`number`||e instanceof Number)&&!isFinite(+e)?null:+e}handleTickRangeOptions(){let{beginAtZero:e}=this.options,{minDefined:t,maxDefined:n}=this.getUserBounds(),{min:r,max:i}=this,a=e=>r=t?r:e,o=e=>i=n?i:e;if(e){let e=B(r),t=B(i);e<0&&t<0?o(0):e>0&&t>0&&a(0)}if(r===i){let t=i===0?1:Math.abs(i*.05);o(i+t),e||a(r-t)}this.min=r,this.max=i}getTickLimit(){let{maxTicksLimit:e,stepSize:t}=this.options.ticks,n;return t?(n=Math.ceil(this.max/t)-Math.floor(this.min/t)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${t} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e||=11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return 1/0}buildTicks(){let e=this.options,t=e.ticks,n=this.getTickLimit();n=Math.max(2,n);let r=vc({maxTicks:n,bounds:e.bounds,min:e.min,max:e.max,precision:t.precision,step:t.stepSize,count:t.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:t.minRotation||0,includeBounds:t.includeBounds!==!1},this._range||this);return e.bounds===`ticks`&&Je(r,this,`value`),e.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){let e=this.ticks,t=this.min,n=this.max;if(super.configure(),this.options.offset&&e.length){let r=(n-t)/Math.max(e.length-1,1)/2;t-=r,n+=r}this._startValue=t,this._endValue=n,this._valueRange=n-t}getLabelForValue(e){return jt(e,this.chart.options.locale,this.options.ticks.format)}},xc=class extends bc{static id=`linear`;static defaults={ticks:{callback:Pt.formatters.numeric}};determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=M(e)?e:0,this.max=M(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){let e=this.isHorizontal(),t=e?this.width:this.height,n=V(this.options.ticks.minRotation),r=(e?Math.sin(n):Math.cos(n))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,i.lineHeight/r))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}},Sc=e=>Math.floor(Ve(e)),Cc=(e,t)=>10**(Sc(e)+t);function wc(e){return e/10**Sc(e)==1}function Tc(e,t,n){let r=10**n,i=Math.floor(e/r);return Math.ceil(t/r)-i}function Ec(e,t){let n=Sc(t-e);for(;Tc(e,t,n)>10;)n++;for(;Tc(e,t,n)<10;)n--;return Math.min(n,Sc(e))}function Dc(e,{min:t,max:n}){t=N(e.min,t);let r=[],i=Sc(t),a=Ec(t,n),o=a<0?10**Math.abs(a):1,s=10**a,c=i>a?10**i:0,l=Math.round((t-c)*o)/o,u=Math.floor((t-c)/s/10)*s*10,d=Math.floor((l-u)/10**a),f=N(e.min,Math.round((c+u+d*10**a)*o)/o);for(;f=10?d=d<15?15:20:d++,d>=20&&(a++,d=2,o=a>=0?1:o),f=Math.round((c+u+d*10**a)*o)/o;let p=N(e.max,f);return r.push({value:p,major:wc(p),significand:d}),r}(class extends Ia{static id=`logarithmic`;static defaults={ticks:{callback:Pt.formatters.logarithmic,major:{enabled:!0}}};constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){let n=bc.prototype.parse.apply(this,[e,t]);if(n===0){this._zero=!0;return}return M(n)&&n>0?n:null}determineDataLimits(){let{min:e,max:t}=this.getMinMax(!0);this.min=M(e)?Math.max(0,e):null,this.max=M(t)?Math.max(0,t):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!M(this._userMin)&&(this.min=e===Cc(this.min,0)?Cc(this.min,-1):Cc(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:e,maxDefined:t}=this.getUserBounds(),n=this.min,r=this.max,i=t=>n=e?n:t,a=e=>r=t?r:e;n===r&&(n<=0?(i(1),a(10)):(i(Cc(n,-1)),a(Cc(r,1)))),n<=0&&i(Cc(r,-1)),r<=0&&a(Cc(n,1)),this.min=n,this.max=r}buildTicks(){let e=this.options,t=Dc({min:this._userMin,max:this._userMax},this);return e.bounds===`ticks`&&Je(t,this,`value`),e.reverse?(t.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),t}getLabelForValue(e){return e===void 0?`0`:jt(e,this.chart.options.locale,this.options.ticks.format)}configure(){let e=this.min;super.configure(),this._startValue=Ve(e),this._valueRange=Ve(this.max)-Ve(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(Ve(e)-this._startValue)/this._valueRange)}getValueForPixel(e){let t=this.getDecimalForPixel(e);return 10**(this._startValue+t*this._valueRange)}});function Oc(e){let t=e.ticks;if(t.display&&e.display){let e=q(t.backdropPadding);return P(t.font&&t.font.size,G.font.size)+e.height}return 0}function kc(e,t,n){return n=A(n)?n:[n],{w:Ht(e,t.string,n),h:n.length*t.lineHeight}}function Ac(e,t,n,r,i){return e===r||e===i?{start:t-n/2,end:t+n/2}:ei?{start:t-n,end:t}:{start:t,end:t+n}}function jc(e){let t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},n=Object.assign({},t),r=[],i=[],a=e._pointLabels.length,o=e.options.pointLabels,s=o.centerPointLabels?L/a:0;for(let c=0;ct.r&&(s=(r.end-t.r)/a,e.r=Math.max(e.r,t.r+s)),i.startt.b&&(c=(i.end-t.b)/o,e.b=Math.max(e.b,t.b+c))}function Nc(e,t,n){let r=e.drawingArea,{extra:i,additionalAngle:a,padding:o,size:s}=n,c=e.getPointPosition(t,r+i+o,a),l=Math.round(Ye(H(c.angle+z))),u=Rc(c.y,s.h,l),d=Ic(l),f=Lc(c.x,s.w,d);return{visible:!0,x:c.x,y:u,textAlign:d,left:f,top:u,right:f+s.w,bottom:u+s.h}}function Pc(e,t){if(!t)return!0;let{left:n,top:r,right:i,bottom:a}=e;return!(K({x:n,y:r},t)||K({x:n,y:a},t)||K({x:i,y:r},t)||K({x:i,y:a},t))}function Fc(e,t,n){let r=[],i=e._pointLabels.length,a=e.options,{centerPointLabels:o,display:s}=a.pointLabels,c={extra:Oc(a)/2,additionalAngle:o?L/i:0},l;for(let a=0;a270||n<90)&&(e-=t),e}function zc(e,t,n){let{left:r,top:i,right:a,bottom:o}=n,{backdropColor:s}=t;if(!k(s)){let n=ln(t.borderRadius),c=q(t.backdropPadding);e.fillStyle=s;let l=r-c.left,u=i-c.top,d=a-r+c.width,f=o-i+c.height;Object.values(n).some(e=>e!==0)?(e.beginPath(),tn(e,{x:l,y:u,w:d,h:f,radius:n}),e.fill()):e.fillRect(l,u,d,f)}}function Bc(e,t){let{ctx:n,options:{pointLabels:r}}=e;for(let i=t-1;i>=0;i--){let t=e._pointLabelItems[i];if(!t.visible)continue;let a=r.setContext(e.getPointLabelContext(i));zc(n,a,t);let o=J(a.font),{x:s,y:c,textAlign:l}=t;en(n,e._pointLabels[i],s,c+o.lineHeight/2,o,{color:a.color,textAlign:l,textBaseline:`middle`})}}function Vc(e,t,n,r){let{ctx:i}=e;if(n)i.arc(e.xCenter,e.yCenter,t,0,R);else{let n=e.getPointPosition(0,t);i.moveTo(n.x,n.y);for(let a=1;a{let n=F(this.options.pointLabels.callback,[e,t],this);return n||n===0?n:``}).filter((e,t)=>this.chart.getDataVisibility(t))}fit(){let e=this.options;e.display&&e.pointLabels.display?jc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(e,t,n,r){this.xCenter+=Math.floor((e-t)/2),this.yCenter+=Math.floor((n-r)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(e,t,n,r))}getIndexAngle(e){let t=R/(this._pointLabels.length||1),n=this.options.startAngle||0;return H(e*t+V(n))}getDistanceFromCenterForValue(e){if(k(e))return NaN;let t=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-e)*t:(e-this.min)*t}getValueForDistanceFromCenter(e){if(k(e))return NaN;let t=e/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-t:this.min+t}getPointLabelContext(e){let t=this._pointLabels||[];if(e>=0&&e{if(t!==0||t===0&&this.min<0){s=this.getDistanceFromCenterForValue(e.value);let n=this.getContext(t),o=r.setContext(n),c=i.setContext(n);Hc(this,o,s,a,c)}}),n.display){for(e.save(),o=a-1;o>=0;o--){let r=n.setContext(this.getPointLabelContext(o)),{color:i,lineWidth:a}=r;!a||!i||(e.lineWidth=a,e.strokeStyle=i,e.setLineDash(r.borderDash),e.lineDashOffset=r.borderDashOffset,s=this.getDistanceFromCenterForValue(t.reverse?this.min:this.max),c=this.getPointPosition(o,s),e.beginPath(),e.moveTo(this.xCenter,this.yCenter),e.lineTo(c.x,c.y),e.stroke())}e.restore()}}drawBorder(){}drawLabels(){let e=this.ctx,t=this.options,n=t.ticks;if(!n.display)return;let r=this.getIndexAngle(0),i,a;e.save(),e.translate(this.xCenter,this.yCenter),e.rotate(r),e.textAlign=`center`,e.textBaseline=`middle`,this.ticks.forEach((r,o)=>{if(o===0&&this.min>=0&&!t.reverse)return;let s=n.setContext(this.getContext(o)),c=J(s.font);if(i=this.getDistanceFromCenterForValue(this.ticks[o].value),s.showLabelBackdrop){e.font=c.string,a=e.measureText(r.label).width,e.fillStyle=s.backdropColor;let t=q(s.backdropPadding);e.fillRect(-a/2-t.left,-i-c.size/2-t.top,a+t.width,c.size+t.height)}en(e,r.label,0,-i,c,{color:s.color,strokeColor:s.textStrokeColor,strokeWidth:s.textStrokeWidth})}),e.restore()}drawTitle(){}});var Wc={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},$=Object.keys(Wc);function Gc(e,t){return e-t}function Kc(e,t){if(k(t))return null;let n=e._adapter,{parser:r,round:i,isoWeekday:a}=e._parseOpts,o=t;return typeof r==`function`&&(o=r(o)),M(o)||(o=typeof r==`string`?n.parse(o,r):n.parse(o)),o===null?null:(i&&(o=i===`week`&&(Ke(a)||a===!0)?n.startOf(o,`isoWeek`,a):n.startOf(o,i)),+o)}function qc(e,t,n,r){let i=$.length;for(let a=$.indexOf(e);a=$.indexOf(n);a--){let n=$[a];if(Wc[n].common&&e._adapter.diff(i,r,n)>=t-1)return n}return $[n?$.indexOf(n):0]}function Yc(e){for(let t=$.indexOf(e)+1,n=$.length;t=t?n[r]:n[i];e[a]=!0}}function Zc(e,t,n,r){let i=e._adapter,a=+i.startOf(t[0].value,r),o=t[t.length-1].value,s,c;for(s=a;s<=o;s=+i.add(s,1,r))c=n[s],c>=0&&(t[c].major=!0);return t}function Qc(e,t,n){let r=[],i={},a=t.length,o,s;for(o=0;o+e.value))}initOffsets(e=[]){let t=0,n=0,r,i;this.options.offset&&e.length&&(r=this.getDecimalForValue(e[0]),t=e.length===1?1-r:(this.getDecimalForValue(e[1])-r)/2,i=this.getDecimalForValue(e[e.length-1]),n=e.length===1?i:(i-this.getDecimalForValue(e[e.length-2]))/2);let a=e.length<3?.5:.25;t=U(t,0,a),n=U(n,0,a),this._offsets={start:t,end:n,factor:1/(t+1+n)}}_generate(){let e=this._adapter,t=this.min,n=this.max,r=this.options,i=r.time,a=i.unit||qc(i.minUnit,t,n,this._getLabelCapacity(t)),o=P(r.ticks.stepSize,1),s=a===`week`?i.isoWeekday:!1,c=Ke(s)||s===!0,l={},u=t,d,f;if(c&&(u=+e.startOf(u,`isoWeek`,s)),u=+e.startOf(u,c?`day`:a),e.diff(n,t,a)>1e5*o)throw Error(t+` and `+n+` are too far apart with stepSize of `+o+` `+a);let p=r.ticks.source===`data`&&this.getDataTimestamps();for(d=u,f=0;d+e)}getLabelForValue(e){let t=this._adapter,n=this.options.time;return n.tooltipFormat?t.format(e,n.tooltipFormat):t.format(e,n.displayFormats.datetime)}format(e,t){let n=this.options.time.displayFormats,r=this._unit,i=t||n[r];return this._adapter.format(e,i)}_tickFormatFunction(e,t,n,r){let i=this.options,a=i.ticks.callback;if(a)return F(a,[e,t,n],this);let o=i.time.displayFormats,s=this._unit,c=this._majorUnit,l=s&&o[s],u=c&&o[c],d=n[t],f=c&&u&&d&&d.major;return this._adapter.format(e,r||(f?u:l))}generateTickLabels(e){let t,n,r;for(t=0,n=e.length;t0?o:1}getDataTimestamps(){let e=this._cache.data||[],t,n;if(e.length)return e;let r=this.getMatchingVisibleMetas();if(this._normalized&&r.length)return this._cache.data=r[0].controller.getAllParsedValues(this);for(t=0,n=r.length;t=e[r].pos&&t<=e[i].pos&&({lo:r,hi:i}=it(e,`pos`,t)),{pos:a,time:s}=e[r],{pos:o,time:c}=e[i]):(t>=e[r].time&&t<=e[i].time&&({lo:r,hi:i}=it(e,`time`,t)),{time:a,pos:s}=e[r],{time:o,pos:c}=e[i]);let l=o-a;return l?s+(c-s)*(t-a)/l:s}(class extends $c{static id=`timeseries`;static defaults=$c.defaults;constructor(e){super(e),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let e=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(e);this._minPos=el(t,this.min),this._tableRange=el(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){let{min:t,max:n}=this,r=[],i=[],a,o,s,c,l;for(a=0,o=e.length;a=t&&c<=n&&r.push(c);if(r.length<2)return[{time:t,pos:0},{time:n,pos:1}];for(a=0,o=r.length;ae-t)}_getTimestampsForTable(){let e=this._cache.all||[];if(e.length)return e;let t=this.getDataTimestamps(),n=this.getLabelTimestamps();return e=t.length&&n.length?this.normalize(t.concat(n)):t.length?t:n,e=this._cache.all=e,e}getDecimalForValue(e){return(el(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){let t=this._offsets,n=this.getDecimalForPixel(e)/t.factor-t.end;return el(this._table,n*this._tableRange+this._minPos,!0)}});export{fc as _,wo as a,qo as c,yi as d,$c as f,Js as g,Gs as h,_c as i,xc as l,Is as m,hi as n,_i as o,xi as p,as as r,vi as s,Po as t,Yo as u}; \ No newline at end of file diff --git a/repeater/web/html/assets/chartjs-adapter-date-fns-BqJ94ASW.css b/repeater/web/html/assets/chartjs-adapter-date-fns-BqJ94ASW.css new file mode 100644 index 0000000..b8a6947 --- /dev/null +++ b/repeater/web/html/assets/chartjs-adapter-date-fns-BqJ94ASW.css @@ -0,0 +1 @@ +.sparkline-card[data-v-dfc36682]{-webkit-backdrop-filter:blur(50px);backdrop-filter:blur(50px);background:#ffffffbf;border:1px solid #0000000f;border-radius:12px;padding:12px 14px;transition:background .3s,border-color .3s,box-shadow .3s;overflow:hidden;box-shadow:0 4px 16px #0000000a,0 1px 3px #00000005}.dark .sparkline-card[data-v-dfc36682]{background:#0006;border:1px solid #ffffff0d;box-shadow:0 4px 16px #0003}.card-header[data-v-dfc36682]{justify-content:space-between;align-items:baseline;margin-bottom:8px;display:flex}.card-title[data-v-dfc36682]{color:#4b5563b3;text-transform:uppercase;letter-spacing:.05em;font-size:11px;font-weight:500;transition:color .3s}.dark .card-title[data-v-dfc36682]{color:#fff9}.card-subtitle[data-v-dfc36682]{color:#4b556380;margin-top:2px;font-size:9px;font-weight:400;transition:color .3s}.dark .card-subtitle[data-v-dfc36682]{color:#fff6}.card-value[data-v-dfc36682]{font-variant-numeric:tabular-nums;font-size:22px;font-weight:700;line-height:1}.card-chart[data-v-dfc36682]{width:100%;height:28px;overflow:hidden}.chart-svg[data-v-dfc36682]{width:100%;height:100%}.chart-loader[data-v-dfc36682]{justify-content:center;align-items:center;height:100%;display:flex}.loader-spinner[data-v-dfc36682]{border:2px solid #fff3;border-radius:50%;width:18px;height:18px;animation:1s linear infinite spin-dfc36682}.chart-text[data-v-dfc36682]{justify-content:center;align-items:center;height:100%;display:flex}.percent-value[data-v-dfc36682]{color:#ffffff80;font-variant-numeric:tabular-nums;font-size:20px;font-weight:500}.sparkline-path[data-v-dfc36682]{transition:d 1s ease-out}@keyframes spin-dfc36682{to{transform:rotate(360deg)}}@media (width>=1024px){.sparkline-card[data-v-dfc36682]{padding:14px 16px}.card-header[data-v-dfc36682]{margin-bottom:10px}.card-title[data-v-dfc36682]{font-size:12px}.card-value[data-v-dfc36682]{font-size:26px}.card-chart[data-v-dfc36682]{height:32px}.percent-value[data-v-dfc36682]{font-size:24px}} diff --git a/repeater/web/html/assets/chartjs-adapter-date-fns-kwjCs6JU.css b/repeater/web/html/assets/chartjs-adapter-date-fns-kwjCs6JU.css deleted file mode 100644 index 11a5362..0000000 --- a/repeater/web/html/assets/chartjs-adapter-date-fns-kwjCs6JU.css +++ /dev/null @@ -1 +0,0 @@ -.sparkline-card[data-v-257cbdca]{background:#ffffffbf;border:1px solid rgba(0,0,0,.06);border-radius:12px;padding:12px 14px;-webkit-backdrop-filter:blur(50px);backdrop-filter:blur(50px);overflow:hidden;transition:background .3s ease,border-color .3s ease,box-shadow .3s ease;box-shadow:0 4px 16px #0000000a,0 1px 3px #00000005}.dark .sparkline-card[data-v-257cbdca]{background:#0006;border:1px solid rgba(255,255,255,.05);box-shadow:0 4px 16px #0003}.card-header[data-v-257cbdca]{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:8px}.card-title[data-v-257cbdca]{color:#4b5563b3;font-size:11px;font-weight:500;text-transform:uppercase;letter-spacing:.05em;transition:color .3s ease}.dark .card-title[data-v-257cbdca]{color:#fff9}.card-subtitle[data-v-257cbdca]{color:#4b556380;font-size:9px;font-weight:400;margin-top:2px;transition:color .3s ease}.dark .card-subtitle[data-v-257cbdca]{color:#fff6}.card-value[data-v-257cbdca]{font-size:22px;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}.card-chart[data-v-257cbdca]{width:100%;height:28px;overflow:hidden}.chart-svg[data-v-257cbdca]{width:100%;height:100%}.chart-loader[data-v-257cbdca]{display:flex;align-items:center;justify-content:center;height:100%}.loader-spinner[data-v-257cbdca]{width:18px;height:18px;border:2px solid rgba(255,255,255,.2);border-radius:50%;animation:spin-257cbdca 1s linear infinite}.chart-text[data-v-257cbdca]{display:flex;align-items:center;justify-content:center;height:100%}.percent-value[data-v-257cbdca]{font-size:20px;font-weight:500;color:#ffffff80;font-variant-numeric:tabular-nums}.sparkline-path[data-v-257cbdca]{transition:d 1s ease-out}@keyframes spin-257cbdca{to{transform:rotate(360deg)}}@media (min-width: 1024px){.sparkline-card[data-v-257cbdca]{padding:14px 16px}.card-header[data-v-257cbdca]{margin-bottom:10px}.card-title[data-v-257cbdca]{font-size:12px}.card-value[data-v-257cbdca]{font-size:26px}.card-chart[data-v-257cbdca]{height:32px}.percent-value[data-v-257cbdca]{font-size:24px}} diff --git a/repeater/web/html/assets/chartjs-adapter-date-fns.esm-CONKmChq.js b/repeater/web/html/assets/chartjs-adapter-date-fns.esm-CONKmChq.js new file mode 100644 index 0000000..49f115e --- /dev/null +++ b/repeater/web/html/assets/chartjs-adapter-date-fns.esm-CONKmChq.js @@ -0,0 +1 @@ +import{dt as e,g as t,l as n,o as r,r as i,s as a,u as o,ut as s,w as c}from"./runtime-core.esm-bundler-IofF4kUm.js";import{t as l}from"./_plugin-vue_export-helper-V-yks4gF.js";import{p as u}from"./chart-DdrINt9G.js";var ee={class:`sparkline-card`},d={class:`card-header`},te={class:`card-title`},f={key:0,class:`card-subtitle`},p={key:0,class:`card-chart`},ne={key:0,class:`chart-loader`},re={key:1,class:`chart-text`},ie={class:`percent-value`},ae=[`id`,`viewBox`],oe=[`d`,`fill`],se=[`d`,`stroke`],m=100,h=40,g=l(t({name:`SparklineChart`,__name:`Sparkline`,props:{title:{},value:{},color:{},data:{default:()=>[]},showChart:{type:Boolean,default:!0},variant:{default:`smooth`},loading:{type:Boolean,default:!1},centerText:{default:``},subtitle:{default:``}},setup(t){let l=t,u=e=>{if(e.length<3)return e;let t=Math.min(15,Math.max(3,Math.floor(e.length*.2))),n=[];for(let r=0;re+t,0)/s.length)}let r=Math.min(10,n.length),i=n.length/r,a=[];for(let e=0;e!l.data||l.data.length===0?[]:l.variant===`smooth`?u(l.data):l.data),ce=e=>{if(e.length<2)return``;let t=Math.max(...e),n=Math.min(...e),r=t-n||1,i=l.variant===`classic`?4:2,a=``;return e.forEach((t,o)=>{let s=o/(e.length-1)*m,c=(t-n)/r,l=i+(h-i*2)*(1-c);if(o===0)a+=`M ${s.toFixed(2)} ${l.toFixed(2)}`;else{let t=((o-1)/(e.length-1)*m+s)/2;a+=` Q ${t.toFixed(2)} ${l.toFixed(2)} ${s.toFixed(2)} ${l.toFixed(2)}`}}),a},_=r(()=>ce(g.value)),le=r(()=>_.value?`${_.value} L ${m} ${h} L 0 ${h} Z`:``),v=r(()=>`sparkline-${l.title.replace(/\s+/g,`-`).toLowerCase()}`);return(r,l)=>(c(),o(`div`,ee,[a(`div`,d,[a(`div`,null,[a(`p`,te,e(t.title),1),t.subtitle?(c(),o(`p`,f,e(t.subtitle),1)):n(``,!0)]),a(`span`,{class:`card-value`,style:s({color:t.color})},e(typeof t.value==`number`?t.value.toLocaleString():t.value),5)]),t.showChart?(c(),o(`div`,p,[t.loading&&t.variant===`classic`?(c(),o(`div`,ne,[a(`div`,{class:`loader-spinner`,style:s({borderTopColor:t.color})},null,4)])):t.centerText?(c(),o(`div`,re,[a(`span`,ie,e(t.centerText),1)])):(c(),o(`svg`,{key:2,id:v.value,class:`chart-svg`,viewBox:`0 0 ${m} ${h}`,preserveAspectRatio:`none`},[t.variant===`classic`?(c(),o(i,{key:0},[g.value.length>1?(c(),o(`path`,{key:0,d:le.value,fill:t.color,"fill-opacity":`0.8`,class:`sparkline-path`},null,8,oe)):n(``,!0)],64)):(c(),o(i,{key:1},[g.value.length>1?(c(),o(`path`,{key:0,d:_.value,stroke:t.color,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`,fill:`none`,class:`sparkline-path`},null,8,se)):n(``,!0)],64))],8,ae))])):n(``,!0)]))}}),[[`__scopeId`,`data-v-dfc36682`]]),ce=365.2425,_=6048e5,le=864e5,v=6e4,y=36e5,ue=1e3,de=3600*24;de*7,de*ce/12*3;var fe=Symbol.for(`constructDateFrom`);function b(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&fe in e?e[fe](t):e instanceof Date?new e.constructor(t):new Date(t)}function x(e,t){return b(t||e,e)}function S(e,t,n){let r=x(e,n?.in);return isNaN(t)?b(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function C(e,t,n){let r=x(e,n?.in);if(isNaN(t))return b(n?.in||e,NaN);if(!t)return r;let i=r.getDate(),a=b(n?.in||e,r.getTime());return a.setMonth(r.getMonth()+t+1,0),i>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}function w(e,t,n){return b(n?.in||e,+x(e)+t)}function pe(e,t,n){return w(e,t*y,n)}var me={};function T(){return me}function E(e,t){let n=T(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=x(e,t?.in),a=i.getDay(),o=(a=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function O(e){let t=x(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function k(e,...t){let n=b.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function ge(e,t){let n=x(e,t?.in);return n.setHours(0,0,0,0),n}function _e(e,t,n){let[r,i]=k(n?.in,e,t),a=ge(r),o=ge(i),s=+a-O(a),c=+o-O(o);return Math.round((s-c)/le)}function ve(e,t){let n=he(e,t),r=b(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),D(r)}function ye(e,t,n){let r=x(e,n?.in);return r.setTime(r.getTime()+t*v),r}function be(e,t,n){return C(e,t*3,n)}function xe(e,t,n){return w(e,t*1e3,n)}function Se(e,t,n){return S(e,t*7,n)}function Ce(e,t,n){return C(e,t*12,n)}function A(e,t){let n=x(e)-+x(t);return n<0?-1:n>0?1:n}function we(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function Te(e){return!(!we(e)&&typeof e!=`number`||isNaN(+x(e)))}function Ee(e,t,n){let[r,i]=k(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function De(e,t,n){let[r,i]=k(n?.in,e,t);return r.getFullYear()-i.getFullYear()}function Oe(e,t,n){let[r,i]=k(n?.in,e,t),a=ke(r,i),o=Math.abs(_e(r,i));r.setDate(r.getDate()-a*o);let s=a*(o-Number(ke(r,i)===-a));return s===0?0:s}function ke(e,t){let n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function j(e){return t=>{let n=(e?Math[e]:Math.trunc)(t);return n===0?0:n}}function Ae(e,t,n){let[r,i]=k(n?.in,e,t),a=(r-+i)/y;return j(n?.roundingMethod)(a)}function M(e,t){return x(e)-+x(t)}function je(e,t,n){let r=M(e,t)/v;return j(n?.roundingMethod)(r)}function Me(e,t){let n=x(e,t?.in);return n.setHours(23,59,59,999),n}function Ne(e,t){let n=x(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function Pe(e,t){let n=x(e,t?.in);return+Me(n,t)==+Ne(n,t)}function Fe(e,t,n){let[r,i,a]=k(n?.in,e,e,t),o=A(i,a),s=Math.abs(Ee(i,a));if(s<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-o*s);let c=A(i,a)===-o;Pe(r)&&s===1&&A(r,a)===1&&(c=!1);let l=o*(s-+c);return l===0?0:l}function Ie(e,t,n){let r=Fe(e,t,n)/3;return j(n?.roundingMethod)(r)}function Le(e,t,n){let r=M(e,t)/1e3;return j(n?.roundingMethod)(r)}function Re(e,t,n){let r=Oe(e,t,n)/7;return j(n?.roundingMethod)(r)}function ze(e,t,n){let[r,i]=k(n?.in,e,t),a=A(r,i),o=Math.abs(De(r,i));r.setFullYear(1584),i.setFullYear(1584);let s=a*(o-+(A(r,i)===-a));return s===0?0:s}function Be(e,t){let n=x(e,t?.in),r=n.getMonth(),i=r-r%3;return n.setMonth(i,1),n.setHours(0,0,0,0),n}function Ve(e,t){let n=x(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function He(e,t){let n=x(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function Ue(e,t){let n=x(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function We(e,t){let n=x(e,t?.in);return n.setMinutes(59,59,999),n}function Ge(e,t){let n=T(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=x(e,t?.in),a=i.getDay(),o=(a{let r,i=Ye[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function N(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var Ze={date:N({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:N({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:N({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},Qe={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},$e=(e,t,n,r)=>Qe[e];function P(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var et={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:P({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:P({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:P({values:{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`]},defaultWidth:`wide`}),day:P({values:{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`]},defaultWidth:`wide`}),dayPeriod:P({values:{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`}},defaultWidth:`wide`,formattingValues:{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`}},defaultFormattingWidth:`wide`})};function F(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?nt(s,e=>e.test(o)):tt(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function tt(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function nt(e,t){for(let n=0;n{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var it={code:`en-US`,formatDistance:Xe,formatLong:Ze,formatRelative:$e,localize:et,match:{ordinalNumber:rt({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:F({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:F({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:F({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),day:F({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),dayPeriod:F({matchPatterns:{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},defaultMatchWidth:`any`,parsePatterns:{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}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function at(e,t){let n=x(e,t?.in);return _e(n,Ue(n))+1}function ot(e,t){let n=x(e,t?.in),r=D(n)-+ve(n);return Math.round(r/_)+1}function I(e,t){let n=x(e,t?.in),r=n.getFullYear(),i=T(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=b(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=E(o,t),c=b(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=E(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function st(e,t){let n=T(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=I(e,t),a=b(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),E(a,t)}function ct(e,t){let n=x(e,t?.in),r=E(n,t)-+st(n,t);return Math.round(r/_)+1}function L(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var R={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return L(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):L(n+1,2)},d(e,t){return L(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return L(e.getHours()%12||12,t.length)},H(e,t){return L(e.getHours(),t.length)},m(e,t){return L(e.getMinutes(),t.length)},s(e,t){return L(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return L(Math.trunc(r*10**(n-3)),t.length)}},z={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},lt={G:function(e,t,n){let r=e.getFullYear()>0?1:0;switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return R.y(e,t)},Y:function(e,t,n,r){let i=I(e,r),a=i>0?i:1-i;return t===`YY`?L(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):L(a,t.length)},R:function(e,t){return L(he(e),t.length)},u:function(e,t){return L(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return L(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return L(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return R.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return L(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=ct(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):L(i,t.length)},I:function(e,t,n){let r=ot(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):L(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):R.d(e,t)},D:function(e,t,n){let r=at(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):L(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return L(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});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`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return L(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return L(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?z.noon:r===0?z.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?z.evening:r>=12?z.afternoon:r>=4?z.morning:z.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return R.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):R.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):L(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):L(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):R.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):R.s(e,t)},S:function(e,t){return R.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return dt(r);case`XXXX`:case`XX`:return B(r);default:return B(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return dt(r);case`xxxx`:case`xx`:return B(r);default:return B(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+ut(r,`:`);default:return`GMT`+B(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+ut(r,`:`);default:return`GMT`+B(r,`:`)}},t:function(e,t,n){return L(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return L(+e,t.length)}};function ut(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+L(a,2)}function dt(e,t){return e%60==0?(e>0?`-`:`+`)+L(Math.abs(e)/60,2):B(e,t)}function B(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=L(Math.trunc(r/60),2),a=L(r%60,2);return n+i+t+a}var ft=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},pt=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},V={p:pt,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return ft(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,ft(r,t)).replace(`{{time}}`,pt(i,t))}},mt=/^D+$/,ht=/^Y+$/,gt=[`D`,`DD`,`YY`,`YYYY`];function _t(e){return mt.test(e)}function vt(e){return ht.test(e)}function H(e,t,n){let r=yt(e,t,n);if(console.warn(r),gt.includes(e))throw RangeError(r)}function yt(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var bt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,St=/^'([^]*?)'?$/,Ct=/''/g,wt=/[a-zA-Z]/;function Tt(e,t,n){let r=T(),i=n?.locale??r.locale??it,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=x(e,n?.in);if(!Te(s))throw RangeError(`Invalid time value`);let c=t.match(xt).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=V[t];return n(e,i.formatLong)}return e}).join(``).match(bt).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:Et(e)};if(lt[t])return{isToken:!0,value:e};if(t.match(wt))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&vt(a)||!n?.useAdditionalDayOfYearTokens&&_t(a))&&H(a,t,String(e));let o=lt[a[0]];return o(s,a,i.localize,l)}).join(``)}function Et(e){let t=e.match(St);return t?t[1].replace(Ct,`'`):e}function Dt(){return Object.assign({},T())}function Ot(e,t){let n=x(e,t?.in).getDay();return n===0?7:n}function kt(e,t){let n=At(t)?new t(0):b(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function At(e){return typeof e==`function`&&e.prototype?.constructor===e}var jt=10,Mt=class{subPriority=0;validate(e,t){return!0}},Nt=class extends Mt{constructor(e,t,n,r,i){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=r,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}},Pt=class extends Mt{priority=jt;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>b(t,e))}set(e,t){return t.timestampIsSet?e:b(e,kt(e,this.context))}},U=class{run(e,t,n,r){let i=this.parse(e,t,n,r);return i?{setter:new Nt(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,n){return!0}},Ft=class extends U{priority=140;parse(e,t,n){switch(t){case`G`:case`GG`:case`GGG`:return n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`});case`GGGGG`:return n.era(e,{width:`narrow`});default:return n.era(e,{width:`wide`})||n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`R`,`u`,`t`,`T`]},W={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},G={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function K(e,t){return e&&{value:t(e.value),rest:e.rest}}function q(e,t){let n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function J(e,t){let n=t.match(e);if(!n)return null;if(n[0]===`Z`)return{value:0,rest:t.slice(1)};let r=n[1]===`+`?1:-1,i=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:r*(i*y+a*v+o*ue),rest:t.slice(n[0].length)}}function It(e){return q(W.anyDigitsSigned,e)}function Y(e,t){switch(e){case 1:return q(W.singleDigit,t);case 2:return q(W.twoDigits,t);case 3:return q(W.threeDigits,t);case 4:return q(W.fourDigits,t);default:return q(RegExp(`^\\d{1,`+e+`}`),t)}}function Lt(e,t){switch(e){case 1:return q(W.singleDigitSigned,t);case 2:return q(W.twoDigitsSigned,t);case 3:return q(W.threeDigitsSigned,t);case 4:return q(W.fourDigitsSigned,t);default:return q(RegExp(`^-?\\d{1,`+e+`}`),t)}}function X(e){switch(e){case`morning`:return 4;case`evening`:return 17;case`pm`:case`noon`:case`afternoon`:return 12;default:return 0}}function Rt(e,t){let n=t>0,r=n?t:1-t,i;if(r<=50)i=e||100;else{let t=r+50,n=Math.trunc(t/100)*100,a=e>=t%100;i=e+n-(a?100:0)}return n?i:1-i}function zt(e){return e%400==0||e%4==0&&e%100!=0}var Bt=class extends U{priority=130;incompatibleTokens=[`Y`,`R`,`u`,`w`,`I`,`i`,`e`,`c`,`t`,`T`];parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`yy`});switch(t){case`y`:return K(Y(4,e),r);case`yo`:return K(n.ordinalNumber(e,{unit:`year`}),r);default:return K(Y(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){let r=e.getFullYear();if(n.isTwoDigitYear){let t=Rt(n.year,r);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}let i=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}},Vt=class extends U{priority=130;parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`YY`});switch(t){case`Y`:return K(Y(4,e),r);case`Yo`:return K(n.ordinalNumber(e,{unit:`year`}),r);default:return K(Y(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,r){let i=I(e,r);if(n.isTwoDigitYear){let t=Rt(n.year,i);return e.setFullYear(t,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),E(e,r)}let a=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),E(e,r)}incompatibleTokens=[`y`,`R`,`u`,`Q`,`q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]},Ht=class extends U{priority=130;parse(e,t){return Lt(t===`R`?4:t.length,e)}set(e,t,n){let r=b(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),D(r)}incompatibleTokens=[`G`,`y`,`Y`,`u`,`Q`,`q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},Ut=class extends U{priority=130;parse(e,t){return Lt(t===`u`?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`G`,`y`,`Y`,`R`,`w`,`I`,`i`,`e`,`c`,`t`,`T`]},Wt=class extends U{priority=120;parse(e,t,n){switch(t){case`Q`:case`QQ`:return Y(t.length,e);case`Qo`:return n.ordinalNumber(e,{unit:`quarter`});case`QQQ`:return n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`});case`QQQQQ`:return n.quarter(e,{width:`narrow`,context:`formatting`});default:return n.quarter(e,{width:`wide`,context:`formatting`})||n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},Gt=class extends U{priority=120;parse(e,t,n){switch(t){case`q`:case`qq`:return Y(t.length,e);case`qo`:return n.ordinalNumber(e,{unit:`quarter`});case`qqq`:return n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`});case`qqqqq`:return n.quarter(e,{width:`narrow`,context:`standalone`});default:return n.quarter(e,{width:`wide`,context:`standalone`})||n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`Q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},Kt=class extends U{incompatibleTokens=[`Y`,`R`,`q`,`Q`,`L`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`];priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`M`:return K(q(W.month,e),r);case`MM`:return K(Y(2,e),r);case`Mo`:return K(n.ordinalNumber(e,{unit:`month`}),r);case`MMM`:return n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`});case`MMMMM`:return n.month(e,{width:`narrow`,context:`formatting`});default:return n.month(e,{width:`wide`,context:`formatting`})||n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}},qt=class extends U{priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`L`:return K(q(W.month,e),r);case`LL`:return K(Y(2,e),r);case`Lo`:return K(n.ordinalNumber(e,{unit:`month`}),r);case`LLL`:return n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`});case`LLLLL`:return n.month(e,{width:`narrow`,context:`standalone`});default:return n.month(e,{width:`wide`,context:`standalone`})||n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]};function Jt(e,t,n){let r=x(e,n?.in),i=ct(r,n)-t;return r.setDate(r.getDate()-i*7),x(r,n?.in)}var Yt=class extends U{priority=100;parse(e,t,n){switch(t){case`w`:return q(W.week,e);case`wo`:return n.ordinalNumber(e,{unit:`week`});default:return Y(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,r){return E(Jt(e,n,r),r)}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]};function Xt(e,t,n){let r=x(e,n?.in),i=ot(r,n)-t;return r.setDate(r.getDate()-i*7),r}var Zt=class extends U{priority=100;parse(e,t,n){switch(t){case`I`:return q(W.week,e);case`Io`:return n.ordinalNumber(e,{unit:`week`});default:return Y(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return D(Xt(e,n))}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},Qt=[31,28,31,30,31,30,31,31,30,31,30,31],$t=[31,29,31,30,31,30,31,31,30,31,30,31],en=class extends U{priority=90;subPriority=1;parse(e,t,n){switch(t){case`d`:return q(W.date,e);case`do`:return n.ordinalNumber(e,{unit:`date`});default:return Y(t.length,e)}}validate(e,t){let n=zt(e.getFullYear()),r=e.getMonth();return n?t>=1&&t<=$t[r]:t>=1&&t<=Qt[r]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]},tn=class extends U{priority=90;subpriority=1;parse(e,t,n){switch(t){case`D`:case`DD`:return q(W.dayOfYear,e);case`Do`:return n.ordinalNumber(e,{unit:`date`});default:return Y(t.length,e)}}validate(e,t){return zt(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`L`,`w`,`I`,`d`,`E`,`i`,`e`,`c`,`t`,`T`]};function nn(e,t,n){let r=T(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=x(e,n?.in),o=a.getDay(),s=(t%7+7)%7,c=7-i;return S(a,t<0||t>6?t-(o+c)%7:(s+c)%7-(o+c)%7,n)}var rn=class extends U{priority=90;parse(e,t,n){switch(t){case`E`:case`EE`:case`EEE`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`EEEEE`:return n.day(e,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=nn(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`D`,`i`,`e`,`c`,`t`,`T`]},an=class extends U{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`e`:case`ee`:return K(Y(t.length,e),i);case`eo`:return K(n.ordinalNumber(e,{unit:`day`}),i);case`eee`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`eeeee`:return n.day(e,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=nn(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`c`,`t`,`T`]},on=class extends U{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`c`:case`cc`:return K(Y(t.length,e),i);case`co`:return K(n.ordinalNumber(e,{unit:`day`}),i);case`ccc`:return n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});case`ccccc`:return n.day(e,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});default:return n.day(e,{width:`wide`,context:`standalone`})||n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=nn(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`e`,`t`,`T`]};function sn(e,t,n){let r=x(e,n?.in);return S(r,t-Ot(r,n),n)}var cn=class extends U{priority=90;parse(e,t,n){let r=e=>e===0?7:e;switch(t){case`i`:case`ii`:return Y(t.length,e);case`io`:return n.ordinalNumber(e,{unit:`day`});case`iii`:return K(n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiii`:return K(n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiiii`:return K(n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);default:return K(n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return e=sn(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`E`,`e`,`c`,`t`,`T`]},ln=class extends U{priority=80;parse(e,t,n){switch(t){case`a`:case`aa`:case`aaa`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`aaaaa`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(X(n),0,0,0),e}incompatibleTokens=[`b`,`B`,`H`,`k`,`t`,`T`]},un=class extends U{priority=80;parse(e,t,n){switch(t){case`b`:case`bb`:case`bbb`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`bbbbb`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(X(n),0,0,0),e}incompatibleTokens=[`a`,`B`,`H`,`k`,`t`,`T`]},dn=class extends U{priority=80;parse(e,t,n){switch(t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`BBBBB`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(X(n),0,0,0),e}incompatibleTokens=[`a`,`b`,`t`,`T`]},fn=class extends U{priority=70;parse(e,t,n){switch(t){case`h`:return q(W.hour12h,e);case`ho`:return n.ordinalNumber(e,{unit:`hour`});default:return Y(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){let r=e.getHours()>=12;return r&&n<12?e.setHours(n+12,0,0,0):!r&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`H`,`K`,`k`,`t`,`T`]},pn=class extends U{priority=70;parse(e,t,n){switch(t){case`H`:return q(W.hour23h,e);case`Ho`:return n.ordinalNumber(e,{unit:`hour`});default:return Y(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`K`,`k`,`t`,`T`]},mn=class extends U{priority=70;parse(e,t,n){switch(t){case`K`:return q(W.hour11h,e);case`Ko`:return n.ordinalNumber(e,{unit:`hour`});default:return Y(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`h`,`H`,`k`,`t`,`T`]},hn=class extends U{priority=70;parse(e,t,n){switch(t){case`k`:return q(W.hour24h,e);case`ko`:return n.ordinalNumber(e,{unit:`hour`});default:return Y(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){let r=n<=24?n%24:n;return e.setHours(r,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`H`,`K`,`t`,`T`]},gn=class extends U{priority=60;parse(e,t,n){switch(t){case`m`:return q(W.minute,e);case`mo`:return n.ordinalNumber(e,{unit:`minute`});default:return Y(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=[`t`,`T`]},_n=class extends U{priority=50;parse(e,t,n){switch(t){case`s`:return q(W.second,e);case`so`:return n.ordinalNumber(e,{unit:`second`});default:return Y(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=[`t`,`T`]},vn=class extends U{priority=30;parse(e,t){return K(Y(t.length,e),e=>Math.trunc(e*10**(-t.length+3)))}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=[`t`,`T`]},yn=class extends U{priority=10;parse(e,t){switch(t){case`X`:return J(G.basicOptionalMinutes,e);case`XX`:return J(G.basic,e);case`XXXX`:return J(G.basicOptionalSeconds,e);case`XXXXX`:return J(G.extendedOptionalSeconds,e);default:return J(G.extended,e)}}set(e,t,n){return t.timestampIsSet?e:b(e,e.getTime()-O(e)-n)}incompatibleTokens=[`t`,`T`,`x`]},bn=class extends U{priority=10;parse(e,t){switch(t){case`x`:return J(G.basicOptionalMinutes,e);case`xx`:return J(G.basic,e);case`xxxx`:return J(G.basicOptionalSeconds,e);case`xxxxx`:return J(G.extendedOptionalSeconds,e);default:return J(G.extended,e)}}set(e,t,n){return t.timestampIsSet?e:b(e,e.getTime()-O(e)-n)}incompatibleTokens=[`t`,`T`,`X`]},xn=class extends U{priority=40;parse(e){return It(e)}set(e,t,n){return[b(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens=`*`},Sn=class extends U{priority=20;parse(e){return It(e)}set(e,t,n){return[b(e,n),{timestampIsSet:!0}]}incompatibleTokens=`*`},Cn={G:new Ft,y:new Bt,Y:new Vt,R:new Ht,u:new Ut,Q:new Wt,q:new Gt,M:new Kt,L:new qt,w:new Yt,I:new Zt,d:new en,D:new tn,E:new rn,e:new an,c:new on,i:new cn,a:new ln,b:new un,B:new dn,h:new fn,H:new pn,K:new mn,k:new hn,m:new gn,s:new _n,S:new vn,X:new yn,x:new bn,t:new xn,T:new Sn},wn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Tn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,En=/^'([^]*?)'?$/,Dn=/''/g,On=/\S/,kn=/[a-zA-Z]/;function An(e,t,n,r){let i=()=>b(r?.in||n,NaN),a=Dt(),o=r?.locale??a.locale??it,s=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,c=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(!t)return e?i():x(n,r?.in);let l={firstWeekContainsDate:s,weekStartsOn:c,locale:o},u=[new Pt(r?.in,n)],ee=t.match(Tn).map(e=>{let t=e[0];if(t in V){let n=V[t];return n(e,o.formatLong)}return e}).join(``).match(wn),d=[];for(let n of ee){!r?.useAdditionalWeekYearTokens&&vt(n)&&H(n,t,e),!r?.useAdditionalDayOfYearTokens&&_t(n)&&H(n,t,e);let a=n[0],s=Cn[a];if(s){let{incompatibleTokens:t}=s;if(Array.isArray(t)){let e=d.find(e=>t.includes(e.token)||e.token===a);if(e)throw RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${n}\` at the same time`)}else if(s.incompatibleTokens===`*`&&d.length>0)throw RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);d.push({token:a,fullToken:n});let r=s.run(e,n,o.match,l);if(!r)return i();u.push(r.setter),e=r.rest}else{if(a.match(kn))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");if(n===`''`?n=`'`:a===`'`&&(n=jn(n)),e.indexOf(n)===0)e=e.slice(n.length);else return i()}}if(e.length>0&&On.test(e))return i();let te=u.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,n)=>n.indexOf(e)===t).map(e=>u.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]),f=x(n,r?.in);if(isNaN(+f))return i();let p={};for(let e of te){if(!e.validate(f,l))return i();let t=e.set(f,p,l);Array.isArray(t)?(f=t[0],Object.assign(p,t[1])):f=t}return f}function jn(e){return e.match(En)[1].replace(Dn,`'`)}function Mn(e,t){let n=x(e,t?.in);return n.setMinutes(0,0,0),n}function Nn(e,t){let n=x(e,t?.in);return n.setSeconds(0,0),n}function Pn(e,t){let n=x(e,t?.in);return n.setMilliseconds(0),n}function Fn(e,t){let n=()=>b(t?.in,NaN),r=t?.additionalDigits??2,i=zn(e),a;if(i.date){let e=Bn(i.date,r);a=Vn(e.restDateString,e.year)}if(!a||isNaN(+a))return n();let o=+a,s=0,c;if(i.time&&(s=Hn(i.time),isNaN(s)))return n();if(i.timezone){if(c=Un(i.timezone),isNaN(c))return n()}else{let e=new Date(o+s),n=x(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return x(o+s+c,t?.in)}var Z={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},In=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Ln=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Rn=/^([+-])(\d{2})(?::?(\d{2}))?$/;function zn(e){let t={},n=e.split(Z.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],Z.timeZoneDelimiter.test(t.date)&&(t.date=e.split(Z.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){let e=Z.timezone.exec(r);e?(t.time=r.replace(e[1],``),t.timezone=e[1]):t.time=r}return t}function Bn(e,t){let n=RegExp(`^(?:(\\d{4}|[+-]\\d{`+(4+t)+`})|(\\d{2}|[+-]\\d{`+(2+t)+`})$)`),r=e.match(n);if(!r)return{year:NaN,restDateString:``};let i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((r[1]||r[2]).length)}}function Vn(e,t){if(t===null)return new Date(NaN);let n=e.match(In);if(!n)return new Date(NaN);let r=!!n[4],i=Q(n[1]),a=Q(n[2])-1,o=Q(n[3]),s=Q(n[4]),c=Q(n[5])-1;if(r)return Yn(t,s,c)?Wn(t,s,c):new Date(NaN);{let e=new Date(0);return!qn(t,a,o)||!Jn(t,i)?new Date(NaN):(e.setUTCFullYear(t,a,Math.max(i,o)),e)}}function Q(e){return e?parseInt(e):1}function Hn(e){let t=e.match(Ln);if(!t)return NaN;let n=$(t[1]),r=$(t[2]),i=$(t[3]);return Xn(n,r,i)?n*y+r*v+i*1e3:NaN}function $(e){return e&&parseFloat(e.replace(`,`,`.`))||0}function Un(e){if(e===`Z`)return 0;let t=e.match(Rn);if(!t)return 0;let n=t[1]===`+`?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return Zn(r,i)?n*(r*y+i*v):NaN}function Wn(e,t,n){let r=new Date(0);r.setUTCFullYear(e,0,4);let i=r.getUTCDay()||7,a=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var Gn=[31,null,31,30,31,30,31,31,30,31,30,31];function Kn(e){return e%400==0||e%4==0&&e%100!=0}function qn(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(Gn[t]||(Kn(e)?29:28))}function Jn(e,t){return t>=1&&t<=(Kn(e)?366:365)}function Yn(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function Xn(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function Zn(e,t){return t>=0&&t<=59}var Qn={datetime:`MMM d, yyyy, h:mm:ss aaaa`,millisecond:`h:mm:ss.SSS aaaa`,second:`h:mm:ss aaaa`,minute:`h:mm aaaa`,hour:`ha`,day:`MMM d`,week:`PP`,month:`MMM yyyy`,quarter:`qqq - yyyy`,year:`yyyy`};u._date.override({_id:`date-fns`,formats:function(){return Qn},parse:function(e,t){if(e==null)return null;let n=typeof e;return n===`number`||e instanceof Date?e=x(e):n===`string`&&(e=typeof t==`string`?An(e,t,new Date,this.options):Fn(e,this.options)),Te(e)?e.getTime():null},format:function(e,t){return Tt(e,t,this.options)},add:function(e,t,n){switch(n){case`millisecond`:return w(e,t);case`second`:return xe(e,t);case`minute`:return ye(e,t);case`hour`:return pe(e,t);case`day`:return S(e,t);case`week`:return Se(e,t);case`month`:return C(e,t);case`quarter`:return be(e,t);case`year`:return Ce(e,t);default:return e}},diff:function(e,t,n){switch(n){case`millisecond`:return M(e,t);case`second`:return Le(e,t);case`minute`:return je(e,t);case`hour`:return Ae(e,t);case`day`:return Oe(e,t);case`week`:return Re(e,t);case`month`:return Fe(e,t);case`quarter`:return Ie(e,t);case`year`:return ze(e,t);default:return 0}},startOf:function(e,t,n){switch(t){case`second`:return Pn(e);case`minute`:return Nn(e);case`hour`:return Mn(e);case`day`:return ge(e);case`week`:return E(e);case`isoWeek`:return E(e,{weekStartsOn:+n});case`month`:return Ve(e);case`quarter`:return Be(e);case`year`:return Ue(e);default:return e}},endOf:function(e,t){switch(t){case`second`:return Je(e);case`minute`:return Ke(e);case`hour`:return We(e);case`day`:return Me(e);case`week`:return Ge(e);case`month`:return Ne(e);case`quarter`:return qe(e);case`year`:return He(e);default:return e}}});export{g as t}; \ No newline at end of file diff --git a/repeater/web/html/assets/chartjs-adapter-date-fns.esm-DJ3p4DO2.js b/repeater/web/html/assets/chartjs-adapter-date-fns.esm-DJ3p4DO2.js deleted file mode 100644 index 2a6cce2..0000000 --- a/repeater/web/html/assets/chartjs-adapter-date-fns.esm-DJ3p4DO2.js +++ /dev/null @@ -1,6 +0,0 @@ -import{a as Ae,c as j,e as O,f as I,h as U,t as Z,n as ye,F as ge,q as Y,y as Ge}from"./index-xzvnOpJo.js";import{g as Ve}from"./chart-B185MtDy.js";const ze={class:"sparkline-card"},je={class:"card-header"},Ue={class:"card-title"},Ze={key:0,class:"card-subtitle"},Je={key:0,class:"card-chart"},Ke={key:0,class:"chart-loader"},Se={key:1,class:"chart-text"},et={class:"percent-value"},tt=["id","viewBox"],nt=["d","fill"],rt=["d","stroke"],J=100,K=40,at=Ae({name:"SparklineChart",__name:"Sparkline",props:{title:{},value:{},color:{},data:{default:()=>[]},showChart:{type:Boolean,default:!0},variant:{default:"smooth"},loading:{type:Boolean,default:!1},centerText:{default:""},subtitle:{default:""}},setup(r){const e=r,t=i=>{if(i.length<3)return i;const d=Math.min(15,Math.max(3,Math.floor(i.length*.2))),f=[];for(let D=0;DR+q,0)/k.length)}const y=Math.min(10,f.length),T=f.length/y,N=[];for(let D=0;D!e.data||e.data.length===0?[]:e.variant==="smooth"?t(e.data):e.data),a=i=>{if(i.length<2)return"";const d=Math.max(...i),f=Math.min(...i),y=d-f||1,T=e.variant==="classic"?4:2;let N="";return i.forEach((D,P)=>{const l=P/(i.length-1)*J,w=(D-f)/y,k=T+(K-T*2)*(1-w);if(P===0)N+=`M ${l.toFixed(2)} ${k.toFixed(2)}`;else{const q=((P-1)/(i.length-1)*J+l)/2;N+=` Q ${q.toFixed(2)} ${k.toFixed(2)} ${l.toFixed(2)} ${k.toFixed(2)}`}}),N},s=j(()=>a(n.value)),o=j(()=>s.value?`${s.value} L ${J} ${K} L 0 ${K} Z`:""),c=j(()=>`sparkline-${e.title.replace(/\s+/g,"-").toLowerCase()}`);return(i,d)=>(Y(),O("div",ze,[I("div",je,[I("div",null,[I("p",Ue,Z(i.title),1),i.subtitle?(Y(),O("p",Ze,Z(i.subtitle),1)):U("",!0)]),I("span",{class:"card-value",style:ye({color:i.color})},Z(typeof i.value=="number"?i.value.toLocaleString():i.value),5)]),i.showChart?(Y(),O("div",Je,[i.loading&&i.variant==="classic"?(Y(),O("div",Ke,[I("div",{class:"loader-spinner",style:ye({borderTopColor:i.color})},null,4)])):i.centerText?(Y(),O("div",Se,[I("span",et,Z(i.centerText),1)])):(Y(),O("svg",{key:2,id:c.value,class:"chart-svg",viewBox:`0 0 ${J} ${K}`,preserveAspectRatio:"none"},[i.variant==="classic"?(Y(),O(ge,{key:0},[n.value.length>1?(Y(),O("path",{key:0,d:o.value,fill:i.color,"fill-opacity":"0.8",class:"sparkline-path"},null,8,nt)):U("",!0)],64)):(Y(),O(ge,{key:1},[n.value.length>1?(Y(),O("path",{key:0,d:s.value,stroke:i.color,"stroke-width":"2.5","stroke-linecap":"round","stroke-linejoin":"round",fill:"none",class:"sparkline-path"},null,8,rt)):U("",!0)],64))],8,tt))])):U("",!0)]))}}),Vr=Ge(at,[["__scopeId","data-v-257cbdca"]]),Te=6048e5,st=864e5,G=6e4,V=36e5,ot=1e3,pe=Symbol.for("constructDateFrom");function p(r,e){return typeof r=="function"?r(e):r&&typeof r=="object"&&pe in r?r[pe](e):r instanceof Date?new r.constructor(e):new Date(e)}function u(r,e){return p(e||r,r)}function ne(r,e,t){const n=u(r,t?.in);return isNaN(e)?p(t?.in||r,NaN):(e&&n.setDate(n.getDate()+e),n)}function ce(r,e,t){const n=u(r,t?.in);if(isNaN(e))return p(r,NaN);if(!e)return n;const a=n.getDate(),s=p(r,n.getTime());s.setMonth(n.getMonth()+e+1,0);const o=s.getDate();return a>=o?s:(n.setFullYear(s.getFullYear(),s.getMonth(),a),n)}function ue(r,e,t){return p(r,+u(r)+e)}function it(r,e,t){return ue(r,e*V)}let ct={};function F(){return ct}function W(r,e){const t=F(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??t.weekStartsOn??t.locale?.options?.weekStartsOn??0,a=u(r,e?.in),s=a.getDay(),o=(s=s.getTime()?n+1:t.getTime()>=c.getTime()?n:n-1}function ee(r){const e=u(r),t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+r-+t}function C(r,...e){const t=p.bind(null,e.find(n=>typeof n=="object"));return e.map(t)}function se(r,e){const t=u(r,e?.in);return t.setHours(0,0,0,0),t}function Oe(r,e,t){const[n,a]=C(t?.in,r,e),s=se(n),o=se(a),c=+s-ee(s),i=+o-ee(o);return Math.round((c-i)/st)}function ut(r,e){const t=Pe(r,e),n=p(r,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Q(n)}function dt(r,e,t){const n=u(r,t?.in);return n.setTime(n.getTime()+e*G),n}function lt(r,e,t){return ce(r,e*3,t)}function ft(r,e,t){return ue(r,e*1e3)}function ht(r,e,t){return ne(r,e*7,t)}function mt(r,e,t){return ce(r,e*12,t)}function A(r,e){const t=+u(r)-+u(e);return t<0?-1:t>0?1:t}function wt(r){return r instanceof Date||typeof r=="object"&&Object.prototype.toString.call(r)==="[object Date]"}function Ye(r){return!(!wt(r)&&typeof r!="number"||isNaN(+u(r)))}function yt(r,e,t){const[n,a]=C(t?.in,r,e),s=n.getFullYear()-a.getFullYear(),o=n.getMonth()-a.getMonth();return s*12+o}function gt(r,e,t){const[n,a]=C(t?.in,r,e);return n.getFullYear()-a.getFullYear()}function ve(r,e,t){const[n,a]=C(t?.in,r,e),s=be(n,a),o=Math.abs(Oe(n,a));n.setDate(n.getDate()-s*o);const c=+(be(n,a)===-s),i=s*(o-c);return i===0?0:i}function be(r,e){const t=r.getFullYear()-e.getFullYear()||r.getMonth()-e.getMonth()||r.getDate()-e.getDate()||r.getHours()-e.getHours()||r.getMinutes()-e.getMinutes()||r.getSeconds()-e.getSeconds()||r.getMilliseconds()-e.getMilliseconds();return t<0?-1:t>0?1:t}function z(r){return e=>{const n=(r?Math[r]:Math.trunc)(e);return n===0?0:n}}function pt(r,e,t){const[n,a]=C(t?.in,r,e),s=(+n-+a)/V;return z(t?.roundingMethod)(s)}function de(r,e){return+u(r)-+u(e)}function bt(r,e,t){const n=de(r,e)/G;return z(t?.roundingMethod)(n)}function _e(r,e){const t=u(r,e?.in);return t.setHours(23,59,59,999),t}function We(r,e){const t=u(r,e?.in),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function xt(r,e){const t=u(r,e?.in);return+_e(t,e)==+We(t,e)}function Ne(r,e,t){const[n,a,s]=C(t?.in,r,r,e),o=A(a,s),c=Math.abs(yt(a,s));if(c<1)return 0;a.getMonth()===1&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-o*c);let i=A(a,s)===-o;xt(n)&&c===1&&A(n,s)===1&&(i=!1);const d=o*(c-+i);return d===0?0:d}function Mt(r,e,t){const n=Ne(r,e,t)/3;return z(t?.roundingMethod)(n)}function Dt(r,e,t){const n=de(r,e)/1e3;return z(t?.roundingMethod)(n)}function kt(r,e,t){const n=ve(r,e,t)/7;return z(t?.roundingMethod)(n)}function Tt(r,e,t){const[n,a]=C(t?.in,r,e),s=A(n,a),o=Math.abs(gt(n,a));n.setFullYear(1584),a.setFullYear(1584);const c=A(n,a)===-s,i=s*(o-+c);return i===0?0:i}function Pt(r,e){const t=u(r,e?.in),n=t.getMonth(),a=n-n%3;return t.setMonth(a,1),t.setHours(0,0,0,0),t}function Ot(r,e){const t=u(r,e?.in);return t.setDate(1),t.setHours(0,0,0,0),t}function Yt(r,e){const t=u(r,e?.in),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}function Ee(r,e){const t=u(r,e?.in);return t.setFullYear(t.getFullYear(),0,1),t.setHours(0,0,0,0),t}function vt(r,e){const t=u(r,e?.in);return t.setMinutes(59,59,999),t}function _t(r,e){const t=F(),n=t.weekStartsOn??t.locale?.options?.weekStartsOn??0,a=u(r,e?.in),s=a.getDay(),o=(s{let n;const a=qt[r];return typeof a=="string"?n=a:e===1?n=a.one:n=a.other.replace("{{count}}",e.toString()),t?.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};function re(r){return(e={})=>{const t=e.width?String(e.width):r.defaultWidth;return r.formats[t]||r.formats[r.defaultWidth]}}const Ft={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Ct={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},It={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Lt={date:re({formats:Ft,defaultWidth:"full"}),time:re({formats:Ct,defaultWidth:"full"}),dateTime:re({formats:It,defaultWidth:"full"})},Qt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Rt=(r,e,t,n)=>Qt[r];function B(r){return(e,t)=>{const n=t?.context?String(t.context):"standalone";let a;if(n==="formatting"&&r.formattingValues){const o=r.defaultFormattingWidth||r.defaultWidth,c=t?.width?String(t.width):o;a=r.formattingValues[c]||r.formattingValues[o]}else{const o=r.defaultWidth,c=t?.width?String(t.width):r.defaultWidth;a=r.values[c]||r.values[o]}const s=r.argumentCallback?r.argumentCallback(e):e;return a[s]}}const Bt={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Xt={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$t={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"]},At={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"]},Gt={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"}},Vt={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"}},zt=(r,e)=>{const t=Number(r),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},jt={ordinalNumber:zt,era:B({values:Bt,defaultWidth:"wide"}),quarter:B({values:Xt,defaultWidth:"wide",argumentCallback:r=>r-1}),month:B({values:$t,defaultWidth:"wide"}),day:B({values:At,defaultWidth:"wide"}),dayPeriod:B({values:Gt,defaultWidth:"wide",formattingValues:Vt,defaultFormattingWidth:"wide"})};function X(r){return(e,t={})=>{const n=t.width,a=n&&r.matchPatterns[n]||r.matchPatterns[r.defaultMatchWidth],s=e.match(a);if(!s)return null;const o=s[0],c=n&&r.parsePatterns[n]||r.parsePatterns[r.defaultParseWidth],i=Array.isArray(c)?Zt(c,y=>y.test(o)):Ut(c,y=>y.test(o));let d;d=r.valueCallback?r.valueCallback(i):i,d=t.valueCallback?t.valueCallback(d):d;const f=e.slice(o.length);return{value:d,rest:f}}}function Ut(r,e){for(const t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&e(r[t]))return t}function Zt(r,e){for(let t=0;t{const n=e.match(r.matchPattern);if(!n)return null;const a=n[0],s=e.match(r.parsePattern);if(!s)return null;let o=r.valueCallback?r.valueCallback(s[0]):s[0];o=t.valueCallback?t.valueCallback(o):o;const c=e.slice(a.length);return{value:o,rest:c}}}const Kt=/^(\d+)(th|st|nd|rd)?/i,St=/\d+/i,en={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},tn={any:[/^b/i,/^(a|c)/i]},nn={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},rn={any:[/1/i,/2/i,/3/i,/4/i]},an={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},sn={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]},on={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},cn={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]},un={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},dn={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}},ln={ordinalNumber:Jt({matchPattern:Kt,parsePattern:St,valueCallback:r=>parseInt(r,10)}),era:X({matchPatterns:en,defaultMatchWidth:"wide",parsePatterns:tn,defaultParseWidth:"any"}),quarter:X({matchPatterns:nn,defaultMatchWidth:"wide",parsePatterns:rn,defaultParseWidth:"any",valueCallback:r=>r+1}),month:X({matchPatterns:an,defaultMatchWidth:"wide",parsePatterns:sn,defaultParseWidth:"any"}),day:X({matchPatterns:on,defaultMatchWidth:"wide",parsePatterns:cn,defaultParseWidth:"any"}),dayPeriod:X({matchPatterns:un,defaultMatchWidth:"any",parsePatterns:dn,defaultParseWidth:"any"})},qe={code:"en-US",formatDistance:Ht,formatLong:Lt,formatRelative:Rt,localize:jt,match:ln,options:{weekStartsOn:0,firstWeekContainsDate:1}};function fn(r,e){const t=u(r,e?.in);return Oe(t,Ee(t))+1}function He(r,e){const t=u(r,e?.in),n=+Q(t)-+ut(t);return Math.round(n/Te)+1}function le(r,e){const t=u(r,e?.in),n=t.getFullYear(),a=F(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,o=p(e?.in||r,0);o.setFullYear(n+1,0,s),o.setHours(0,0,0,0);const c=W(o,e),i=p(e?.in||r,0);i.setFullYear(n,0,s),i.setHours(0,0,0,0);const d=W(i,e);return+t>=+c?n+1:+t>=+d?n:n-1}function hn(r,e){const t=F(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??t.firstWeekContainsDate??t.locale?.options?.firstWeekContainsDate??1,a=le(r,e),s=p(e?.in||r,0);return s.setFullYear(a,0,n),s.setHours(0,0,0,0),W(s,e)}function Fe(r,e){const t=u(r,e?.in),n=+W(t,e)-+hn(t,e);return Math.round(n/Te)+1}function m(r,e){const t=r<0?"-":"",n=Math.abs(r).toString().padStart(e,"0");return t+n}const E={y(r,e){const t=r.getFullYear(),n=t>0?t:1-t;return m(e==="yy"?n%100:n,e.length)},M(r,e){const t=r.getMonth();return e==="M"?String(t+1):m(t+1,2)},d(r,e){return m(r.getDate(),e.length)},a(r,e){const t=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.toUpperCase();case"aaa":return t;case"aaaaa":return t[0];case"aaaa":default:return t==="am"?"a.m.":"p.m."}},h(r,e){return m(r.getHours()%12||12,e.length)},H(r,e){return m(r.getHours(),e.length)},m(r,e){return m(r.getMinutes(),e.length)},s(r,e){return m(r.getSeconds(),e.length)},S(r,e){const t=e.length,n=r.getMilliseconds(),a=Math.trunc(n*Math.pow(10,t-3));return m(a,e.length)}},L={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},xe={G:function(r,e,t){const n=r.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return t.era(n,{width:"abbreviated"});case"GGGGG":return t.era(n,{width:"narrow"});case"GGGG":default:return t.era(n,{width:"wide"})}},y:function(r,e,t){if(e==="yo"){const n=r.getFullYear(),a=n>0?n:1-n;return t.ordinalNumber(a,{unit:"year"})}return E.y(r,e)},Y:function(r,e,t,n){const a=le(r,n),s=a>0?a:1-a;if(e==="YY"){const o=s%100;return m(o,2)}return e==="Yo"?t.ordinalNumber(s,{unit:"year"}):m(s,e.length)},R:function(r,e){const t=Pe(r);return m(t,e.length)},u:function(r,e){const t=r.getFullYear();return m(t,e.length)},Q:function(r,e,t){const n=Math.ceil((r.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return m(n,2);case"Qo":return t.ordinalNumber(n,{unit:"quarter"});case"QQQ":return t.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return t.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return t.quarter(n,{width:"wide",context:"formatting"})}},q:function(r,e,t){const n=Math.ceil((r.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return m(n,2);case"qo":return t.ordinalNumber(n,{unit:"quarter"});case"qqq":return t.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return t.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return t.quarter(n,{width:"wide",context:"standalone"})}},M:function(r,e,t){const n=r.getMonth();switch(e){case"M":case"MM":return E.M(r,e);case"Mo":return t.ordinalNumber(n+1,{unit:"month"});case"MMM":return t.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return t.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return t.month(n,{width:"wide",context:"formatting"})}},L:function(r,e,t){const n=r.getMonth();switch(e){case"L":return String(n+1);case"LL":return m(n+1,2);case"Lo":return t.ordinalNumber(n+1,{unit:"month"});case"LLL":return t.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return t.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return t.month(n,{width:"wide",context:"standalone"})}},w:function(r,e,t,n){const a=Fe(r,n);return e==="wo"?t.ordinalNumber(a,{unit:"week"}):m(a,e.length)},I:function(r,e,t){const n=He(r);return e==="Io"?t.ordinalNumber(n,{unit:"week"}):m(n,e.length)},d:function(r,e,t){return e==="do"?t.ordinalNumber(r.getDate(),{unit:"date"}):E.d(r,e)},D:function(r,e,t){const n=fn(r);return e==="Do"?t.ordinalNumber(n,{unit:"dayOfYear"}):m(n,e.length)},E:function(r,e,t){const n=r.getDay();switch(e){case"E":case"EE":case"EEE":return t.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return t.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return t.day(n,{width:"short",context:"formatting"});case"EEEE":default:return t.day(n,{width:"wide",context:"formatting"})}},e:function(r,e,t,n){const a=r.getDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return m(s,2);case"eo":return t.ordinalNumber(s,{unit:"day"});case"eee":return t.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return t.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return t.day(a,{width:"short",context:"formatting"});case"eeee":default:return t.day(a,{width:"wide",context:"formatting"})}},c:function(r,e,t,n){const a=r.getDay(),s=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return m(s,e.length);case"co":return t.ordinalNumber(s,{unit:"day"});case"ccc":return t.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return t.day(a,{width:"narrow",context:"standalone"});case"cccccc":return t.day(a,{width:"short",context:"standalone"});case"cccc":default:return t.day(a,{width:"wide",context:"standalone"})}},i:function(r,e,t){const n=r.getDay(),a=n===0?7:n;switch(e){case"i":return String(a);case"ii":return m(a,e.length);case"io":return t.ordinalNumber(a,{unit:"day"});case"iii":return t.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return t.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return t.day(n,{width:"short",context:"formatting"});case"iiii":default:return t.day(n,{width:"wide",context:"formatting"})}},a:function(r,e,t){const a=r.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(r,e,t){const n=r.getHours();let a;switch(n===12?a=L.noon:n===0?a=L.midnight:a=n/12>=1?"pm":"am",e){case"b":case"bb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(r,e,t){const n=r.getHours();let a;switch(n>=17?a=L.evening:n>=12?a=L.afternoon:n>=4?a=L.morning:a=L.night,e){case"B":case"BB":case"BBB":return t.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return t.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return t.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(r,e,t){if(e==="ho"){let n=r.getHours()%12;return n===0&&(n=12),t.ordinalNumber(n,{unit:"hour"})}return E.h(r,e)},H:function(r,e,t){return e==="Ho"?t.ordinalNumber(r.getHours(),{unit:"hour"}):E.H(r,e)},K:function(r,e,t){const n=r.getHours()%12;return e==="Ko"?t.ordinalNumber(n,{unit:"hour"}):m(n,e.length)},k:function(r,e,t){let n=r.getHours();return n===0&&(n=24),e==="ko"?t.ordinalNumber(n,{unit:"hour"}):m(n,e.length)},m:function(r,e,t){return e==="mo"?t.ordinalNumber(r.getMinutes(),{unit:"minute"}):E.m(r,e)},s:function(r,e,t){return e==="so"?t.ordinalNumber(r.getSeconds(),{unit:"second"}):E.s(r,e)},S:function(r,e){return E.S(r,e)},X:function(r,e,t){const n=r.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return De(n);case"XXXX":case"XX":return H(n);case"XXXXX":case"XXX":default:return H(n,":")}},x:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"x":return De(n);case"xxxx":case"xx":return H(n);case"xxxxx":case"xxx":default:return H(n,":")}},O:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Me(n,":");case"OOOO":default:return"GMT"+H(n,":")}},z:function(r,e,t){const n=r.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Me(n,":");case"zzzz":default:return"GMT"+H(n,":")}},t:function(r,e,t){const n=Math.trunc(+r/1e3);return m(n,e.length)},T:function(r,e,t){return m(+r,e.length)}};function Me(r,e=""){const t=r>0?"-":"+",n=Math.abs(r),a=Math.trunc(n/60),s=n%60;return s===0?t+String(a):t+String(a)+e+m(s,2)}function De(r,e){return r%60===0?(r>0?"-":"+")+m(Math.abs(r)/60,2):H(r,e)}function H(r,e=""){const t=r>0?"-":"+",n=Math.abs(r),a=m(Math.trunc(n/60),2),s=m(n%60,2);return t+a+e+s}const ke=(r,e)=>{switch(r){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"})}},Ce=(r,e)=>{switch(r){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"})}},mn=(r,e)=>{const t=r.match(/(P+)(p+)?/)||[],n=t[1],a=t[2];if(!a)return ke(r,e);let s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",ke(n,e)).replace("{{time}}",Ce(a,e))},oe={p:Ce,P:mn},wn=/^D+$/,yn=/^Y+$/,gn=["D","DD","YY","YYYY"];function Ie(r){return wn.test(r)}function Le(r){return yn.test(r)}function ie(r,e,t){const n=pn(r,e,t);if(console.warn(n),gn.includes(r))throw new RangeError(n)}function pn(r,e,t){const n=r[0]==="Y"?"years":"days of the month";return`Use \`${r.toLowerCase()}\` instead of \`${r}\` (in \`${e}\`) for formatting ${n} to the input \`${t}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const bn=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,xn=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Mn=/^'([^]*?)'?$/,Dn=/''/g,kn=/[a-zA-Z]/;function Tn(r,e,t){const n=F(),a=t?.locale??n.locale??qe,s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,o=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,c=u(r,t?.in);if(!Ye(c))throw new RangeError("Invalid time value");let i=e.match(xn).map(f=>{const y=f[0];if(y==="p"||y==="P"){const T=oe[y];return T(f,a.formatLong)}return f}).join("").match(bn).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const y=f[0];if(y==="'")return{isToken:!1,value:Pn(f)};if(xe[y])return{isToken:!0,value:f};if(y.match(kn))throw new RangeError("Format string contains an unescaped latin alphabet character `"+y+"`");return{isToken:!1,value:f}});a.localize.preprocessor&&(i=a.localize.preprocessor(c,i));const d={firstWeekContainsDate:s,weekStartsOn:o,locale:a};return i.map(f=>{if(!f.isToken)return f.value;const y=f.value;(!t?.useAdditionalWeekYearTokens&&Le(y)||!t?.useAdditionalDayOfYearTokens&&Ie(y))&&ie(y,e,String(r));const T=xe[y[0]];return T(c,y,a.localize,d)}).join("")}function Pn(r){const e=r.match(Mn);return e?e[1].replace(Dn,"'"):r}function On(){return Object.assign({},F())}function Yn(r,e){const t=u(r,e?.in).getDay();return t===0?7:t}function vn(r,e){const t=_n(e)?new e(0):p(e,0);return t.setFullYear(r.getFullYear(),r.getMonth(),r.getDate()),t.setHours(r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),t}function _n(r){return typeof r=="function"&&r.prototype?.constructor===r}const Wn=10;class Qe{subPriority=0;validate(e,t){return!0}}class Nn extends Qe{constructor(e,t,n,a,s){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=a,s&&(this.subPriority=s)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}}class En extends Qe{priority=Wn;subPriority=-1;constructor(e,t){super(),this.context=e||(n=>p(t,n))}set(e,t){return t.timestampIsSet?e:p(e,vn(e,this.context))}}class h{run(e,t,n,a){const s=this.parse(e,t,n,a);return s?{setter:new Nn(s.value,this.validate,this.set,this.priority,this.subPriority),rest:s.rest}:null}validate(e,t,n){return!0}}class qn extends h{priority=140;parse(e,t,n){switch(t){case"G":case"GG":case"GGG":return n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"});case"GGGGG":return n.era(e,{width:"narrow"});case"GGGG":default:return n.era(e,{width:"wide"})||n.era(e,{width:"abbreviated"})||n.era(e,{width:"narrow"})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["R","u","t","T"]}const x={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},v={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function M(r,e){return r&&{value:e(r.value),rest:r.rest}}function g(r,e){const t=e.match(r);return t?{value:parseInt(t[0],10),rest:e.slice(t[0].length)}:null}function _(r,e){const t=e.match(r);if(!t)return null;if(t[0]==="Z")return{value:0,rest:e.slice(1)};const n=t[1]==="+"?1:-1,a=t[2]?parseInt(t[2],10):0,s=t[3]?parseInt(t[3],10):0,o=t[5]?parseInt(t[5],10):0;return{value:n*(a*V+s*G+o*ot),rest:e.slice(t[0].length)}}function Re(r){return g(x.anyDigitsSigned,r)}function b(r,e){switch(r){case 1:return g(x.singleDigit,e);case 2:return g(x.twoDigits,e);case 3:return g(x.threeDigits,e);case 4:return g(x.fourDigits,e);default:return g(new RegExp("^\\d{1,"+r+"}"),e)}}function te(r,e){switch(r){case 1:return g(x.singleDigitSigned,e);case 2:return g(x.twoDigitsSigned,e);case 3:return g(x.threeDigitsSigned,e);case 4:return g(x.fourDigitsSigned,e);default:return g(new RegExp("^-?\\d{1,"+r+"}"),e)}}function fe(r){switch(r){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function Be(r,e){const t=e>0,n=t?e:1-e;let a;if(n<=50)a=r||100;else{const s=n+50,o=Math.trunc(s/100)*100,c=r>=s%100;a=r+o-(c?100:0)}return t?a:1-a}function Xe(r){return r%400===0||r%4===0&&r%100!==0}class Hn extends h{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(e,t,n){const a=s=>({year:s,isTwoDigitYear:t==="yy"});switch(t){case"y":return M(b(4,e),a);case"yo":return M(n.ordinalNumber(e,{unit:"year"}),a);default:return M(b(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){const a=e.getFullYear();if(n.isTwoDigitYear){const o=Be(n.year,a);return e.setFullYear(o,0,1),e.setHours(0,0,0,0),e}const s=!("era"in t)||t.era===1?n.year:1-n.year;return e.setFullYear(s,0,1),e.setHours(0,0,0,0),e}}class Fn extends h{priority=130;parse(e,t,n){const a=s=>({year:s,isTwoDigitYear:t==="YY"});switch(t){case"Y":return M(b(4,e),a);case"Yo":return M(n.ordinalNumber(e,{unit:"year"}),a);default:return M(b(t.length,e),a)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,a){const s=le(e,a);if(n.isTwoDigitYear){const c=Be(n.year,s);return e.setFullYear(c,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),W(e,a)}const o=!("era"in t)||t.era===1?n.year:1-n.year;return e.setFullYear(o,0,a.firstWeekContainsDate),e.setHours(0,0,0,0),W(e,a)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class Cn extends h{priority=130;parse(e,t){return te(t==="R"?4:t.length,e)}set(e,t,n){const a=p(e,0);return a.setFullYear(n,0,4),a.setHours(0,0,0,0),Q(a)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class In extends h{priority=130;parse(e,t){return te(t==="u"?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class Ln extends h{priority=120;parse(e,t,n){switch(t){case"Q":case"QQ":return b(t.length,e);case"Qo":return n.ordinalNumber(e,{unit:"quarter"});case"QQQ":return n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQQ":return n.quarter(e,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(e,{width:"wide",context:"formatting"})||n.quarter(e,{width:"abbreviated",context:"formatting"})||n.quarter(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class Qn extends h{priority=120;parse(e,t,n){switch(t){case"q":case"qq":return b(t.length,e);case"qo":return n.ordinalNumber(e,{unit:"quarter"});case"qqq":return n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"});case"qqqqq":return n.quarter(e,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(e,{width:"wide",context:"standalone"})||n.quarter(e,{width:"abbreviated",context:"standalone"})||n.quarter(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class Rn extends h{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(e,t,n){const a=s=>s-1;switch(t){case"M":return M(g(x.month,e),a);case"MM":return M(b(2,e),a);case"Mo":return M(n.ordinalNumber(e,{unit:"month"}),a);case"MMM":return n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"});case"MMMMM":return n.month(e,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(e,{width:"wide",context:"formatting"})||n.month(e,{width:"abbreviated",context:"formatting"})||n.month(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}}class Bn extends h{priority=110;parse(e,t,n){const a=s=>s-1;switch(t){case"L":return M(g(x.month,e),a);case"LL":return M(b(2,e),a);case"Lo":return M(n.ordinalNumber(e,{unit:"month"}),a);case"LLL":return n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"});case"LLLLL":return n.month(e,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(e,{width:"wide",context:"standalone"})||n.month(e,{width:"abbreviated",context:"standalone"})||n.month(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function Xn(r,e,t){const n=u(r,t?.in),a=Fe(n,t)-e;return n.setDate(n.getDate()-a*7),u(n,t?.in)}class $n extends h{priority=100;parse(e,t,n){switch(t){case"w":return g(x.week,e);case"wo":return n.ordinalNumber(e,{unit:"week"});default:return b(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,a){return W(Xn(e,n,a),a)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function An(r,e,t){const n=u(r,t?.in),a=He(n,t)-e;return n.setDate(n.getDate()-a*7),n}class Gn extends h{priority=100;parse(e,t,n){switch(t){case"I":return g(x.week,e);case"Io":return n.ordinalNumber(e,{unit:"week"});default:return b(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return Q(An(e,n))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const Vn=[31,28,31,30,31,30,31,31,30,31,30,31],zn=[31,29,31,30,31,30,31,31,30,31,30,31];class jn extends h{priority=90;subPriority=1;parse(e,t,n){switch(t){case"d":return g(x.date,e);case"do":return n.ordinalNumber(e,{unit:"date"});default:return b(t.length,e)}}validate(e,t){const n=e.getFullYear(),a=Xe(n),s=e.getMonth();return a?t>=1&&t<=zn[s]:t>=1&&t<=Vn[s]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class Un extends h{priority=90;subpriority=1;parse(e,t,n){switch(t){case"D":case"DD":return g(x.dayOfYear,e);case"Do":return n.ordinalNumber(e,{unit:"date"});default:return b(t.length,e)}}validate(e,t){const n=e.getFullYear();return Xe(n)?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function he(r,e,t){const n=F(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,s=u(r,t?.in),o=s.getDay(),i=(e%7+7)%7,d=7-a,f=e<0||e>6?e-(o+d)%7:(i+d)%7-(o+d)%7;return ne(s,f,t)}class Zn extends h{priority=90;parse(e,t,n){switch(t){case"E":case"EE":case"EEE":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEEE":return n.day(e,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"EEEE":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,a){return e=he(e,n,a),e.setHours(0,0,0,0),e}incompatibleTokens=["D","i","e","c","t","T"]}class Jn extends h{priority=90;parse(e,t,n,a){const s=o=>{const c=Math.floor((o-1)/7)*7;return(o+a.weekStartsOn+6)%7+c};switch(t){case"e":case"ee":return M(b(t.length,e),s);case"eo":return M(n.ordinalNumber(e,{unit:"day"}),s);case"eee":return n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeeee":return n.day(e,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"});case"eeee":default:return n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,a){return e=he(e,n,a),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class Kn extends h{priority=90;parse(e,t,n,a){const s=o=>{const c=Math.floor((o-1)/7)*7;return(o+a.weekStartsOn+6)%7+c};switch(t){case"c":case"cc":return M(b(t.length,e),s);case"co":return M(n.ordinalNumber(e,{unit:"day"}),s);case"ccc":return n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"ccccc":return n.day(e,{width:"narrow",context:"standalone"});case"cccccc":return n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"});case"cccc":default:return n.day(e,{width:"wide",context:"standalone"})||n.day(e,{width:"abbreviated",context:"standalone"})||n.day(e,{width:"short",context:"standalone"})||n.day(e,{width:"narrow",context:"standalone"})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,a){return e=he(e,n,a),e.setHours(0,0,0,0),e}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function Sn(r,e,t){const n=u(r,t?.in),a=Yn(n,t),s=e-a;return ne(n,s,t)}class er extends h{priority=90;parse(e,t,n){const a=s=>s===0?7:s;switch(t){case"i":case"ii":return b(t.length,e);case"io":return n.ordinalNumber(e,{unit:"day"});case"iii":return M(n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),a);case"iiiii":return M(n.day(e,{width:"narrow",context:"formatting"}),a);case"iiiiii":return M(n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),a);case"iiii":default:return M(n.day(e,{width:"wide",context:"formatting"})||n.day(e,{width:"abbreviated",context:"formatting"})||n.day(e,{width:"short",context:"formatting"})||n.day(e,{width:"narrow",context:"formatting"}),a)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return e=Sn(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class tr extends h{priority=80;parse(e,t,n){switch(t){case"a":case"aa":case"aaa":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaaa":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(fe(n),0,0,0),e}incompatibleTokens=["b","B","H","k","t","T"]}class nr extends h{priority=80;parse(e,t,n){switch(t){case"b":case"bb":case"bbb":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbbb":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(fe(n),0,0,0),e}incompatibleTokens=["a","B","H","k","t","T"]}class rr extends h{priority=80;parse(e,t,n){switch(t){case"B":case"BB":case"BBB":return n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBBB":return n.dayPeriod(e,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(e,{width:"wide",context:"formatting"})||n.dayPeriod(e,{width:"abbreviated",context:"formatting"})||n.dayPeriod(e,{width:"narrow",context:"formatting"})}}set(e,t,n){return e.setHours(fe(n),0,0,0),e}incompatibleTokens=["a","b","t","T"]}class ar extends h{priority=70;parse(e,t,n){switch(t){case"h":return g(x.hour12h,e);case"ho":return n.ordinalNumber(e,{unit:"hour"});default:return b(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){const a=e.getHours()>=12;return a&&n<12?e.setHours(n+12,0,0,0):!a&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["H","K","k","t","T"]}class sr extends h{priority=70;parse(e,t,n){switch(t){case"H":return g(x.hour23h,e);case"Ho":return n.ordinalNumber(e,{unit:"hour"});default:return b(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=["a","b","h","K","k","t","T"]}class or extends h{priority=70;parse(e,t,n){switch(t){case"K":return g(x.hour11h,e);case"Ko":return n.ordinalNumber(e,{unit:"hour"});default:return b(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=["h","H","k","t","T"]}class ir extends h{priority=70;parse(e,t,n){switch(t){case"k":return g(x.hour24h,e);case"ko":return n.ordinalNumber(e,{unit:"hour"});default:return b(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){const a=n<=24?n%24:n;return e.setHours(a,0,0,0),e}incompatibleTokens=["a","b","h","H","K","t","T"]}class cr extends h{priority=60;parse(e,t,n){switch(t){case"m":return g(x.minute,e);case"mo":return n.ordinalNumber(e,{unit:"minute"});default:return b(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=["t","T"]}class ur extends h{priority=50;parse(e,t,n){switch(t){case"s":return g(x.second,e);case"so":return n.ordinalNumber(e,{unit:"second"});default:return b(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=["t","T"]}class dr extends h{priority=30;parse(e,t){const n=a=>Math.trunc(a*Math.pow(10,-t.length+3));return M(b(t.length,e),n)}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=["t","T"]}class lr extends h{priority=10;parse(e,t){switch(t){case"X":return _(v.basicOptionalMinutes,e);case"XX":return _(v.basic,e);case"XXXX":return _(v.basicOptionalSeconds,e);case"XXXXX":return _(v.extendedOptionalSeconds,e);case"XXX":default:return _(v.extended,e)}}set(e,t,n){return t.timestampIsSet?e:p(e,e.getTime()-ee(e)-n)}incompatibleTokens=["t","T","x"]}class fr extends h{priority=10;parse(e,t){switch(t){case"x":return _(v.basicOptionalMinutes,e);case"xx":return _(v.basic,e);case"xxxx":return _(v.basicOptionalSeconds,e);case"xxxxx":return _(v.extendedOptionalSeconds,e);case"xxx":default:return _(v.extended,e)}}set(e,t,n){return t.timestampIsSet?e:p(e,e.getTime()-ee(e)-n)}incompatibleTokens=["t","T","X"]}class hr extends h{priority=40;parse(e){return Re(e)}set(e,t,n){return[p(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class mr extends h{priority=20;parse(e){return Re(e)}set(e,t,n){return[p(e,n),{timestampIsSet:!0}]}incompatibleTokens="*"}const wr={G:new qn,y:new Hn,Y:new Fn,R:new Cn,u:new In,Q:new Ln,q:new Qn,M:new Rn,L:new Bn,w:new $n,I:new Gn,d:new jn,D:new Un,E:new Zn,e:new Jn,c:new Kn,i:new er,a:new tr,b:new nr,B:new rr,h:new ar,H:new sr,K:new or,k:new ir,m:new cr,s:new ur,S:new dr,X:new lr,x:new fr,t:new hr,T:new mr},yr=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gr=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pr=/^'([^]*?)'?$/,br=/''/g,xr=/\S/,Mr=/[a-zA-Z]/;function Dr(r,e,t,n){const a=()=>p(n?.in||t,NaN),s=On(),o=n?.locale??s.locale??qe,c=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??s.weekStartsOn??s.locale?.options?.weekStartsOn??0;if(!e)return r?a():u(t,n?.in);const d={firstWeekContainsDate:c,weekStartsOn:i,locale:o},f=[new En(n?.in,t)],y=e.match(gr).map(l=>{const w=l[0];if(w in oe){const k=oe[w];return k(l,o.formatLong)}return l}).join("").match(yr),T=[];for(let l of y){!n?.useAdditionalWeekYearTokens&&Le(l)&&ie(l,e,r),!n?.useAdditionalDayOfYearTokens&&Ie(l)&&ie(l,e,r);const w=l[0],k=wr[w];if(k){const{incompatibleTokens:R}=k;if(Array.isArray(R)){const me=T.find(we=>R.includes(we.token)||we.token===w);if(me)throw new RangeError(`The format string mustn't contain \`${me.fullToken}\` and \`${l}\` at the same time`)}else if(k.incompatibleTokens==="*"&&T.length>0)throw new RangeError(`The format string mustn't contain \`${l}\` and any other token at the same time`);T.push({token:w,fullToken:l});const q=k.run(r,l,o.match,d);if(!q)return a();f.push(q.setter),r=q.rest}else{if(w.match(Mr))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");if(l==="''"?l="'":w==="'"&&(l=kr(l)),r.indexOf(l)===0)r=r.slice(l.length);else return a()}}if(r.length>0&&xr.test(r))return a();const N=f.map(l=>l.priority).sort((l,w)=>w-l).filter((l,w,k)=>k.indexOf(l)===w).map(l=>f.filter(w=>w.priority===l).sort((w,k)=>k.subPriority-w.subPriority)).map(l=>l[0]);let D=u(t,n?.in);if(isNaN(+D))return a();const P={};for(const l of N){if(!l.validate(D,d))return a();const w=l.set(D,P,d);Array.isArray(w)?(D=w[0],Object.assign(P,w[1])):D=w}return D}function kr(r){return r.match(pr)[1].replace(br,"'")}function Tr(r,e){const t=u(r,e?.in);return t.setMinutes(0,0,0),t}function Pr(r,e){const t=u(r,e?.in);return t.setSeconds(0,0),t}function Or(r,e){const t=u(r,e?.in);return t.setMilliseconds(0),t}function Yr(r,e){const t=()=>p(e?.in,NaN),n=e?.additionalDigits??2,a=Nr(r);let s;if(a.date){const d=Er(a.date,n);s=qr(d.restDateString,d.year)}if(!s||isNaN(+s))return t();const o=+s;let c=0,i;if(a.time&&(c=Hr(a.time),isNaN(c)))return t();if(a.timezone){if(i=Fr(a.timezone),isNaN(i))return t()}else{const d=new Date(o+c),f=u(0,e?.in);return f.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),f.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),f}return u(o+c+i,e?.in)}const S={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},vr=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,_r=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Wr=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Nr(r){const e={},t=r.split(S.dateTimeDelimiter);let n;if(t.length>2)return e;if(/:/.test(t[0])?n=t[0]:(e.date=t[0],n=t[1],S.timeZoneDelimiter.test(e.date)&&(e.date=r.split(S.timeZoneDelimiter)[0],n=r.substr(e.date.length,r.length))),n){const a=S.timezone.exec(n);a?(e.time=n.replace(a[1],""),e.timezone=a[1]):e.time=n}return e}function Er(r,e){const t=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=r.match(t);if(!n)return{year:NaN,restDateString:""};const a=n[1]?parseInt(n[1]):null,s=n[2]?parseInt(n[2]):null;return{year:s===null?a:s*100,restDateString:r.slice((n[1]||n[2]).length)}}function qr(r,e){if(e===null)return new Date(NaN);const t=r.match(vr);if(!t)return new Date(NaN);const n=!!t[4],a=$(t[1]),s=$(t[2])-1,o=$(t[3]),c=$(t[4]),i=$(t[5])-1;if(n)return Rr(e,c,i)?Cr(e,c,i):new Date(NaN);{const d=new Date(0);return!Lr(e,s,o)||!Qr(e,a)?new Date(NaN):(d.setUTCFullYear(e,s,Math.max(a,o)),d)}}function $(r){return r?parseInt(r):1}function Hr(r){const e=r.match(_r);if(!e)return NaN;const t=ae(e[1]),n=ae(e[2]),a=ae(e[3]);return Br(t,n,a)?t*V+n*G+a*1e3:NaN}function ae(r){return r&&parseFloat(r.replace(",","."))||0}function Fr(r){if(r==="Z")return 0;const e=r.match(Wr);if(!e)return 0;const t=e[1]==="+"?-1:1,n=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return Xr(n,a)?t*(n*V+a*G):NaN}function Cr(r,e,t){const n=new Date(0);n.setUTCFullYear(r,0,4);const a=n.getUTCDay()||7,s=(e-1)*7+t+1-a;return n.setUTCDate(n.getUTCDate()+s),n}const Ir=[31,null,31,30,31,30,31,31,30,31,30,31];function $e(r){return r%400===0||r%4===0&&r%100!==0}function Lr(r,e,t){return e>=0&&e<=11&&t>=1&&t<=(Ir[e]||($e(r)?29:28))}function Qr(r,e){return e>=1&&e<=($e(r)?366:365)}function Rr(r,e,t){return e>=1&&e<=53&&t>=0&&t<=6}function Br(r,e,t){return r===24?e===0&&t===0:t>=0&&t<60&&e>=0&&e<60&&r>=0&&r<25}function Xr(r,e){return e>=0&&e<=59}/*! - * chartjs-adapter-date-fns v3.0.0 - * https://www.chartjs.org - * (c) 2022 chartjs-adapter-date-fns Contributors - * Released under the MIT license - */const $r={datetime:"MMM d, yyyy, h:mm:ss aaaa",millisecond:"h:mm:ss.SSS aaaa",second:"h:mm:ss aaaa",minute:"h:mm aaaa",hour:"ha",day:"MMM d",week:"PP",month:"MMM yyyy",quarter:"qqq - yyyy",year:"yyyy"};Ve._date.override({_id:"date-fns",formats:function(){return $r},parse:function(r,e){if(r===null||typeof r>"u")return null;const t=typeof r;return t==="number"||r instanceof Date?r=u(r):t==="string"&&(typeof e=="string"?r=Dr(r,e,new Date,this.options):r=Yr(r,this.options)),Ye(r)?r.getTime():null},format:function(r,e){return Tn(r,e,this.options)},add:function(r,e,t){switch(t){case"millisecond":return ue(r,e);case"second":return ft(r,e);case"minute":return dt(r,e);case"hour":return it(r,e);case"day":return ne(r,e);case"week":return ht(r,e);case"month":return ce(r,e);case"quarter":return lt(r,e);case"year":return mt(r,e);default:return r}},diff:function(r,e,t){switch(t){case"millisecond":return de(r,e);case"second":return Dt(r,e);case"minute":return bt(r,e);case"hour":return pt(r,e);case"day":return ve(r,e);case"week":return kt(r,e);case"month":return Ne(r,e);case"quarter":return Mt(r,e);case"year":return Tt(r,e);default:return 0}},startOf:function(r,e,t){switch(e){case"second":return Or(r);case"minute":return Pr(r);case"hour":return Tr(r);case"day":return se(r);case"week":return W(r);case"isoWeek":return W(r,{weekStartsOn:+t});case"month":return Ot(r);case"quarter":return Pt(r);case"year":return Ee(r);default:return r}},endOf:function(r,e){switch(e){case"second":return Et(r);case"minute":return Wt(r);case"hour":return vt(r);case"day":return _e(r);case"week":return _t(r);case"month":return We(r);case"quarter":return Nt(r);case"year":return Yt(r);default:return r}}});export{Vr as S}; diff --git a/repeater/web/html/assets/chunk-DECur_0Z.js b/repeater/web/html/assets/chunk-DECur_0Z.js new file mode 100644 index 0000000..c7f3090 --- /dev/null +++ b/repeater/web/html/assets/chunk-DECur_0Z.js @@ -0,0 +1 @@ +var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));export{s as n,l as r,o as t}; \ No newline at end of file diff --git a/repeater/web/html/assets/index-C29IW84J.css b/repeater/web/html/assets/index-C29IW84J.css new file mode 100644 index 0000000..3d9f8e5 --- /dev/null +++ b/repeater/web/html/assets/index-C29IW84J.css @@ -0,0 +1,2 @@ +/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */ +@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-y-reverse:0;--tw-border-style:solid;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial}}}@layer theme{:root,:host{--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50:oklch(97.1% .013 17.38);--color-red-100:oklch(93.6% .032 17.717);--color-red-200:oklch(88.5% .062 18.334);--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-red-900:oklch(39.6% .141 25.723);--color-orange-50:oklch(98% .016 73.684);--color-orange-100:oklch(95.4% .038 75.164);--color-orange-200:oklch(90.1% .076 70.697);--color-orange-400:oklch(75% .183 55.934);--color-orange-500:oklch(70.5% .213 47.604);--color-orange-600:oklch(64.6% .222 41.116);--color-orange-700:oklch(55.3% .195 38.402);--color-amber-50:oklch(98.7% .022 95.277);--color-amber-100:oklch(96.2% .059 95.617);--color-amber-200:oklch(92.4% .12 95.746);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-amber-600:oklch(66.6% .179 58.318);--color-amber-700:oklch(55.5% .163 48.998);--color-amber-800:oklch(47.3% .137 46.201);--color-amber-900:oklch(41.4% .112 45.904);--color-yellow-50:oklch(98.7% .026 102.212);--color-yellow-100:oklch(97.3% .071 103.193);--color-yellow-200:oklch(94.5% .129 101.54);--color-yellow-300:oklch(90.5% .182 98.111);--color-yellow-400:oklch(85.2% .199 91.936);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-yellow-700:oklch(55.4% .135 66.442);--color-yellow-800:oklch(47.6% .114 61.907);--color-yellow-900:oklch(42.1% .095 57.708);--color-green-50:oklch(98.2% .018 155.826);--color-green-100:oklch(96.2% .044 156.743);--color-green-200:oklch(92.5% .084 155.995);--color-green-300:oklch(87.1% .15 154.449);--color-green-400:oklch(79.2% .209 151.711);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-green-700:oklch(52.7% .154 150.069);--color-green-800:oklch(44.8% .119 151.328);--color-green-900:oklch(39.3% .095 152.535);--color-emerald-200:oklch(90.5% .093 164.15);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-600:oklch(59.6% .145 163.225);--color-teal-100:oklch(95.3% .051 180.801);--color-teal-500:oklch(70.4% .14 182.503);--color-teal-600:oklch(60% .118 184.704);--color-teal-700:oklch(51.1% .096 186.391);--color-cyan-50:oklch(98.4% .019 200.873);--color-cyan-200:oklch(91.7% .08 205.041);--color-cyan-300:oklch(86.5% .127 207.078);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-cyan-600:oklch(60.9% .126 221.723);--color-cyan-700:oklch(52% .105 223.128);--color-cyan-800:oklch(45% .085 224.283);--color-cyan-900:oklch(39.8% .07 227.392);--color-blue-50:oklch(97% .014 254.604);--color-blue-100:oklch(93.2% .032 255.585);--color-blue-200:oklch(88.2% .059 254.128);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-400:oklch(70.7% .165 254.624);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-blue-700:oklch(48.8% .243 264.376);--color-blue-800:oklch(42.4% .199 265.638);--color-blue-900:oklch(37.9% .146 265.522);--color-violet-300:oklch(81.1% .111 293.571);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-violet-700:oklch(49.1% .27 292.581);--color-purple-200:oklch(90.2% .063 306.703);--color-purple-400:oklch(71.4% .203 305.504);--color-purple-500:oklch(62.7% .265 303.9);--color-purple-600:oklch(55.8% .288 302.321);--color-pink-100:oklch(94.8% .028 342.258);--color-gray-50:oklch(98.5% .002 247.839);--color-gray-100:oklch(96.7% .003 264.542);--color-gray-200:oklch(92.8% .006 264.531);--color-gray-300:oklch(87.2% .01 258.338);--color-gray-400:oklch(70.7% .022 261.325);--color-gray-500:oklch(55.1% .027 264.364);--color-gray-600:oklch(44.6% .03 256.802);--color-gray-700:oklch(37.3% .034 259.733);--color-gray-800:oklch(27.8% .033 256.848);--color-gray-900:oklch(21% .034 264.665);--color-zinc-900:oklch(21% .006 285.885);--color-neutral-900:oklch(20.5% 0 0);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--container-2xl:42rem;--container-3xl:48rem;--container-4xl:56rem;--container-5xl:64rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height:calc(2.25 / 1.875);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--font-weight-extrabold:800;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-relaxed:1.625;--radius-sm:.25rem;--radius-md:.375rem;--radius-lg:.5rem;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-xs:4px;--blur-sm:8px;--blur-md:12px;--blur-lg:16px;--blur-xl:24px;--blur-3xl:64px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:Noto Sans,-apple-system,Roboto,Helvetica,sans-serif;line-height:1.5}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.glass-card{--tw-backdrop-blur:blur(50px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);background:var(--color-glass-bg);border:1px solid var(--color-glass-border);box-shadow:var(--color-glass-shadow);border-radius:10px}.glass-card-green{--tw-backdrop-blur:blur(50px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);background:var(--color-glass-green-bg);border:1px solid var(--color-glass-green-border);box-shadow:var(--color-glass-green-shadow);border-radius:10px}.glass-card-orange{--tw-backdrop-blur:blur(50px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);background:var(--color-glass-orange-bg);border:1px solid var(--color-glass-orange-border);box-shadow:var(--color-glass-orange-shadow);border-radius:10px}.bg-mode-segment-forward{background-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.bg-mode-segment-forward{background-color:color-mix(in srgb, var(--color-accent-green) 35%, transparent)}}.bg-mode-segment-no-tx{background-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.bg-mode-segment-no-tx{background-color:color-mix(in srgb, var(--color-accent-red) 35%, transparent)}}}.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.end{inset-inline-end:var(--spacing)}.-top-1{top:calc(var(--spacing) * -1)}.-top-\[79px\]{top:-79px}.-top-\[94px\]{top:-94px}.top-0{top:calc(var(--spacing) * 0)}.top-1\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-3{top:calc(var(--spacing) * 3)}.top-4{top:calc(var(--spacing) * 4)}.top-10{top:calc(var(--spacing) * 10)}.top-14{top:calc(var(--spacing) * 14)}.top-\[373px\]{top:373px}.top-full{top:100%}.-right-1{right:calc(var(--spacing) * -1)}.-right-6{right:calc(var(--spacing) * -6)}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.right-4{right:calc(var(--spacing) * 4)}.right-6{right:calc(var(--spacing) * 6)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-2{bottom:calc(var(--spacing) * 2)}.bottom-3{bottom:calc(var(--spacing) * 3)}.bottom-\[1px\]{bottom:1px}.bottom-full{bottom:100%}.-left-\[92px\]{left:-92px}.left-0{left:calc(var(--spacing) * 0)}.left-1\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-3{left:calc(var(--spacing) * 3)}.left-\[246px\]{left:246px}.left-\[575px\]{left:575px}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[60\]{z-index:60}.z-\[100\]{z-index:100}.z-\[1001\]{z-index:1001}.z-\[1010\]{z-index:1010}.z-\[9998\]{z-index:9998}.z-\[9999\]{z-index:9999}.z-\[99999\]{z-index:99999}.z-\[999999\]{z-index:999999}.col-span-1{grid-column:span 1/span 1}.col-span-2{grid-column:span 2/span 2}.container{width:100%}@media (width>=40rem){.container{max-width:40rem}}@media (width>=48rem){.container{max-width:48rem}}@media (width>=64rem){.container{max-width:64rem}}@media (width>=80rem){.container{max-width:80rem}}@media (width>=96rem){.container{max-width:96rem}}.-mx-3{margin-inline:calc(var(--spacing) * -3)}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mx-4{margin-inline:calc(var(--spacing) * 4)}.mx-auto{margin-inline:auto}.my-8{margin-block:calc(var(--spacing) * 8)}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-1\.5{margin-top:calc(var(--spacing) * 1.5)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-6{margin-top:calc(var(--spacing) * 6)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mr-1{margin-right:calc(var(--spacing) * 1)}.mr-1\.5{margin-right:calc(var(--spacing) * 1.5)}.mr-2{margin-right:calc(var(--spacing) * 2)}.mr-3{margin-right:calc(var(--spacing) * 3)}.mr-6{margin-right:calc(var(--spacing) * 6)}.mb-0{margin-bottom:calc(var(--spacing) * 0)}.mb-0\.5{margin-bottom:calc(var(--spacing) * .5)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-1\.5{margin-bottom:calc(var(--spacing) * 1.5)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-5{margin-bottom:calc(var(--spacing) * 5)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.mb-12{margin-bottom:calc(var(--spacing) * 12)}.ml-0{margin-left:calc(var(--spacing) * 0)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:calc(var(--spacing) * 1)}.ml-1\.5{margin-left:calc(var(--spacing) * 1.5)}.ml-2{margin-left:calc(var(--spacing) * 2)}.ml-4{margin-left:calc(var(--spacing) * 4)}.ml-6{margin-left:calc(var(--spacing) * 6)}.ml-8{margin-left:calc(var(--spacing) * 8)}.ml-12{margin-left:calc(var(--spacing) * 12)}.ml-16{margin-left:calc(var(--spacing) * 16)}.ml-20{margin-left:calc(var(--spacing) * 20)}.ml-24{margin-left:calc(var(--spacing) * 24)}.ml-28{margin-left:calc(var(--spacing) * 28)}.ml-32{margin-left:calc(var(--spacing) * 32)}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.table{display:table}.h-1{height:calc(var(--spacing) * 1)}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-12{height:calc(var(--spacing) * 12)}.h-16{height:calc(var(--spacing) * 16)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-32{height:calc(var(--spacing) * 32)}.h-40{height:calc(var(--spacing) * 40)}.h-48{height:calc(var(--spacing) * 48)}.h-52{height:calc(var(--spacing) * 52)}.h-96{height:calc(var(--spacing) * 96)}.h-\[35px\]{height:35px}.h-\[50px\]{height:50px}.h-\[85vh\]{height:85vh}.h-\[512px\]{height:512px}.h-full{height:100%}.h-px{height:1px}.max-h-0{max-height:calc(var(--spacing) * 0)}.max-h-32{max-height:calc(var(--spacing) * 32)}.max-h-40{max-height:calc(var(--spacing) * 40)}.max-h-52{max-height:calc(var(--spacing) * 52)}.max-h-\[80vh\]{max-height:80vh}.max-h-\[90vh\]{max-height:90vh}.max-h-\[600px\]{max-height:600px}.max-h-screen{max-height:100vh}.min-h-\[12rem\]{min-height:12rem}.min-h-\[400px\]{min-height:400px}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing) * 1)}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-5{width:calc(var(--spacing) * 5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-11{width:calc(var(--spacing) * 11)}.w-12{width:calc(var(--spacing) * 12)}.w-16{width:calc(var(--spacing) * 16)}.w-20{width:calc(var(--spacing) * 20)}.w-24{width:calc(var(--spacing) * 24)}.w-28{width:calc(var(--spacing) * 28)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-48{width:calc(var(--spacing) * 48)}.w-64{width:calc(var(--spacing) * 64)}.w-72{width:calc(var(--spacing) * 72)}.w-80{width:calc(var(--spacing) * 80)}.w-\[35px\]{width:35px}.w-\[285px\]{width:285px}.w-\[705px\]{width:705px}.w-full{width:100%}.w-px{width:1px}.max-w-2xl{max-width:var(--container-2xl)}.max-w-3xl{max-width:var(--container-3xl)}.max-w-4xl{max-width:var(--container-4xl)}.max-w-5xl{max-width:var(--container-5xl)}.max-w-32{max-width:calc(var(--spacing) * 32)}.max-w-\[80px\]{max-width:80px}.max-w-\[140px\]{max-width:140px}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-48{min-width:calc(var(--spacing) * 48)}.min-w-\[100px\]{min-width:100px}.min-w-\[120px\]{min-width:120px}.min-w-full{min-width:100%}.flex-1{flex:1}.flex-shrink{flex-shrink:1}.flex-shrink-0,.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-full{--tw-translate-x:-100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:calc(var(--spacing) * 0);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-5{--tw-translate-x:calc(var(--spacing) * 5);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y:calc(calc(1 / 2 * 100%) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-0{--tw-scale-x:0%;--tw-scale-y:0%;--tw-scale-z:0%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-95{--tw-scale-x:95%;--tw-scale-y:95%;--tw-scale-z:95%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-100{--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-105{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.-rotate-\[24\.22deg\]{rotate:-24.22deg}.rotate-0{rotate:0deg}.rotate-90{rotate:90deg}.rotate-180{rotate:180deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-default{cursor:default}.cursor-help{cursor:help}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.resize{resize:both}.resize-none{resize:none}.list-inside{list-style-position:inside}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-evenly{justify-content:space-evenly}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.gap-x-4{column-gap:calc(var(--spacing) * 4)}.gap-x-8{column-gap:calc(var(--spacing) * 8)}:where(.space-x-2>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)))}:where(.space-x-3>:not(:last-child)){--tw-space-x-reverse:0;margin-inline-start:calc(calc(var(--spacing) * 3) * var(--tw-space-x-reverse));margin-inline-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-x-reverse)))}.gap-y-2{row-gap:calc(var(--spacing) * 2)}.gap-y-3{row-gap:calc(var(--spacing) * 3)}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-gray-200>:not(:last-child)){border-color:var(--color-gray-200)}:where(.divide-stroke-subtle>:not(:last-child)){border-color:var(--color-border-subtle)}.self-center{align-self:center}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-\[\.625rem\]{border-radius:.625rem}.rounded-\[5px\]{border-radius:5px}.rounded-\[8px\]{border-radius:8px}.rounded-\[10px\]{border-radius:10px}.rounded-\[12px\]{border-radius:12px}.rounded-\[15px\]{border-radius:15px}.rounded-\[16px\]{border-radius:16px}.rounded-\[20px\]{border-radius:20px}.rounded-\[24px\]{border-radius:24px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-b-\[15px\]{border-bottom-right-radius:15px;border-bottom-left-radius:15px}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-3{border-style:var(--tw-border-style);border-width:3px}.border-4{border-style:var(--tw-border-style);border-width:4px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-accent-cyan,.border-accent-cyan\/20{border-color:var(--color-accent-cyan)}@supports (color:color-mix(in lab, red, red)){.border-accent-cyan\/20{border-color:color-mix(in oklab, var(--color-accent-cyan) 20%, transparent)}}.border-accent-cyan\/30{border-color:var(--color-accent-cyan)}@supports (color:color-mix(in lab, red, red)){.border-accent-cyan\/30{border-color:color-mix(in oklab, var(--color-accent-cyan) 30%, transparent)}}.border-accent-cyan\/50{border-color:var(--color-accent-cyan)}@supports (color:color-mix(in lab, red, red)){.border-accent-cyan\/50{border-color:color-mix(in oklab, var(--color-accent-cyan) 50%, transparent)}}.border-accent-green,.border-accent-green\/20{border-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.border-accent-green\/20{border-color:color-mix(in oklab, var(--color-accent-green) 20%, transparent)}}.border-accent-green\/30{border-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.border-accent-green\/30{border-color:color-mix(in oklab, var(--color-accent-green) 30%, transparent)}}.border-accent-green\/40{border-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.border-accent-green\/40{border-color:color-mix(in oklab, var(--color-accent-green) 40%, transparent)}}.border-accent-green\/50{border-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.border-accent-green\/50{border-color:color-mix(in oklab, var(--color-accent-green) 50%, transparent)}}.border-accent-green\/60{border-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.border-accent-green\/60{border-color:color-mix(in oklab, var(--color-accent-green) 60%, transparent)}}.border-accent-purple\/50{border-color:var(--color-accent-purple)}@supports (color:color-mix(in lab, red, red)){.border-accent-purple\/50{border-color:color-mix(in oklab, var(--color-accent-purple) 50%, transparent)}}.border-accent-red\/20{border-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.border-accent-red\/20{border-color:color-mix(in oklab, var(--color-accent-red) 20%, transparent)}}.border-accent-red\/30{border-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.border-accent-red\/30{border-color:color-mix(in oklab, var(--color-accent-red) 30%, transparent)}}.border-accent-red\/40{border-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.border-accent-red\/40{border-color:color-mix(in oklab, var(--color-accent-red) 40%, transparent)}}.border-accent-red\/50{border-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.border-accent-red\/50{border-color:color-mix(in oklab, var(--color-accent-red) 50%, transparent)}}.border-amber-200{border-color:var(--color-amber-200)}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab, red, red)){.border-amber-500\/30{border-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)}}.border-amber-500\/50{border-color:#f99c0080}@supports (color:color-mix(in lab, red, red)){.border-amber-500\/50{border-color:color-mix(in oklab, var(--color-amber-500) 50%, transparent)}}.border-black\/6{border-color:#0000000f}@supports (color:color-mix(in lab, red, red)){.border-black\/6{border-color:color-mix(in oklab, var(--color-black) 6%, transparent)}}.border-blue-200{border-color:var(--color-blue-200)}.border-blue-500{border-color:var(--color-blue-500)}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab, red, red)){.border-blue-500\/30{border-color:color-mix(in oklab, var(--color-blue-500) 30%, transparent)}}.border-blue-500\/50{border-color:#3080ff80}@supports (color:color-mix(in lab, red, red)){.border-blue-500\/50{border-color:color-mix(in oklab, var(--color-blue-500) 50%, transparent)}}.border-current{border-color:currentColor}.border-cyan-200{border-color:var(--color-cyan-200)}.border-cyan-400{border-color:var(--color-cyan-400)}.border-cyan-400\/30{border-color:#00d2ef4d}@supports (color:color-mix(in lab, red, red)){.border-cyan-400\/30{border-color:color-mix(in oklab, var(--color-cyan-400) 30%, transparent)}}.border-cyan-400\/40{border-color:#00d2ef66}@supports (color:color-mix(in lab, red, red)){.border-cyan-400\/40{border-color:color-mix(in oklab, var(--color-cyan-400) 40%, transparent)}}.border-cyan-500{border-color:var(--color-cyan-500)}.border-cyan-500\/50{border-color:#00b7d780}@supports (color:color-mix(in lab, red, red)){.border-cyan-500\/50{border-color:color-mix(in oklab, var(--color-cyan-500) 50%, transparent)}}.border-cyan-600{border-color:var(--color-cyan-600)}.border-gray-200{border-color:var(--color-gray-200)}.border-gray-400{border-color:var(--color-gray-400)}.border-gray-400\/30{border-color:#99a1af4d}@supports (color:color-mix(in lab, red, red)){.border-gray-400\/30{border-color:color-mix(in oklab, var(--color-gray-400) 30%, transparent)}}.border-gray-500{border-color:var(--color-gray-500)}.border-gray-500\/50{border-color:#6a728280}@supports (color:color-mix(in lab, red, red)){.border-gray-500\/50{border-color:color-mix(in oklab, var(--color-gray-500) 50%, transparent)}}.border-green-200{border-color:var(--color-green-200)}.border-green-300{border-color:var(--color-green-300)}.border-green-500{border-color:var(--color-green-500)}.border-green-500\/20{border-color:#00c75833}@supports (color:color-mix(in lab, red, red)){.border-green-500\/20{border-color:color-mix(in oklab, var(--color-green-500) 20%, transparent)}}.border-green-500\/30{border-color:#00c7584d}@supports (color:color-mix(in lab, red, red)){.border-green-500\/30{border-color:color-mix(in oklab, var(--color-green-500) 30%, transparent)}}.border-green-500\/50{border-color:#00c75880}@supports (color:color-mix(in lab, red, red)){.border-green-500\/50{border-color:color-mix(in oklab, var(--color-green-500) 50%, transparent)}}.border-green-600\/40{border-color:#00a54466}@supports (color:color-mix(in lab, red, red)){.border-green-600\/40{border-color:color-mix(in oklab, var(--color-green-600) 40%, transparent)}}.border-orange-200{border-color:var(--color-orange-200)}.border-orange-500{border-color:var(--color-orange-500)}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab, red, red)){.border-orange-500\/30{border-color:color-mix(in oklab, var(--color-orange-500) 30%, transparent)}}.border-primary,.border-primary\/20{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.border-primary\/20{border-color:color-mix(in oklab, var(--color-primary) 20%, transparent)}}.border-primary\/30{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.border-primary\/30{border-color:color-mix(in oklab, var(--color-primary) 30%, transparent)}}.border-primary\/40{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.border-primary\/40{border-color:color-mix(in oklab, var(--color-primary) 40%, transparent)}}.border-primary\/50{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.border-primary\/50{border-color:color-mix(in oklab, var(--color-primary) 50%, transparent)}}.border-primary\/60{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.border-primary\/60{border-color:color-mix(in oklab, var(--color-primary) 60%, transparent)}}.border-purple-500\/50{border-color:#ac4bff80}@supports (color:color-mix(in lab, red, red)){.border-purple-500\/50{border-color:color-mix(in oklab, var(--color-purple-500) 50%, transparent)}}.border-red-200{border-color:var(--color-red-200)}.border-red-300{border-color:var(--color-red-300)}.border-red-300\/60{border-color:#ffa3a399}@supports (color:color-mix(in lab, red, red)){.border-red-300\/60{border-color:color-mix(in oklab, var(--color-red-300) 60%, transparent)}}.border-red-500{border-color:var(--color-red-500)}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab, red, red)){.border-red-500\/30{border-color:color-mix(in oklab, var(--color-red-500) 30%, transparent)}}.border-red-500\/50{border-color:#fb2c3680}@supports (color:color-mix(in lab, red, red)){.border-red-500\/50{border-color:color-mix(in oklab, var(--color-red-500) 50%, transparent)}}.border-secondary,.border-secondary\/30{border-color:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.border-secondary\/30{border-color:color-mix(in oklab, var(--color-secondary) 30%, transparent)}}.border-secondary\/40{border-color:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.border-secondary\/40{border-color:color-mix(in oklab, var(--color-secondary) 40%, transparent)}}.border-secondary\/50{border-color:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.border-secondary\/50{border-color:color-mix(in oklab, var(--color-secondary) 50%, transparent)}}.border-secondary\/70{border-color:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.border-secondary\/70{border-color:color-mix(in oklab, var(--color-secondary) 70%, transparent)}}.border-stroke{border-color:var(--color-border)}.border-stroke-subtle,.border-stroke-subtle\/50{border-color:var(--color-border-subtle)}@supports (color:color-mix(in lab, red, red)){.border-stroke-subtle\/50{border-color:color-mix(in oklab, var(--color-border-subtle) 50%, transparent)}}.border-stroke\/20{border-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.border-stroke\/20{border-color:color-mix(in oklab, var(--color-border) 20%, transparent)}}.border-transparent{border-color:#0000}.border-white{border-color:var(--color-white)}.border-white\/10{border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.border-white\/10{border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.border-white\/20{border-color:#fff3}@supports (color:color-mix(in lab, red, red)){.border-white\/20{border-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.border-white\/30{border-color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.border-white\/30{border-color:color-mix(in oklab, var(--color-white) 30%, transparent)}}.border-yellow-200{border-color:var(--color-yellow-200)}.border-yellow-300{border-color:var(--color-yellow-300)}.border-yellow-400{border-color:var(--color-yellow-400)}.border-yellow-500{border-color:var(--color-yellow-500)}.border-yellow-500\/30{border-color:#edb2004d}@supports (color:color-mix(in lab, red, red)){.border-yellow-500\/30{border-color:color-mix(in oklab, var(--color-yellow-500) 30%, transparent)}}.border-yellow-500\/50{border-color:#edb20080}@supports (color:color-mix(in lab, red, red)){.border-yellow-500\/50{border-color:color-mix(in oklab, var(--color-yellow-500) 50%, transparent)}}.border-yellow-600{border-color:var(--color-yellow-600)}.border-t-amber-600{border-top-color:var(--color-amber-600)}.border-t-content-primary{border-top-color:var(--color-text-primary)}.border-t-cyan-500{border-top-color:var(--color-cyan-500)}.border-t-gray-900{border-top-color:var(--color-gray-900)}.border-t-green-400{border-top-color:var(--color-green-400)}.border-t-green-600{border-top-color:var(--color-green-600)}.border-t-orange-400{border-top-color:var(--color-orange-400)}.border-t-primary{border-top-color:var(--color-primary)}.border-t-purple-600{border-top-color:var(--color-purple-600)}.border-t-transparent{border-top-color:#0000}.border-l-accent-cyan{border-left-color:var(--color-accent-cyan)}.border-l-accent-green{border-left-color:var(--color-accent-green)}.border-l-accent-purple{border-left-color:var(--color-accent-purple)}.border-l-accent-red{border-left-color:var(--color-accent-red)}.border-l-amber-500{border-left-color:var(--color-amber-500)}.border-l-gray-500{border-left-color:var(--color-gray-500)}.border-l-green-600{border-left-color:var(--color-green-600)}.border-l-primary{border-left-color:var(--color-primary)}.border-l-secondary{border-left-color:var(--color-secondary)}.bg-accent-cyan,.bg-accent-cyan\/5{background-color:var(--color-accent-cyan)}@supports (color:color-mix(in lab, red, red)){.bg-accent-cyan\/5{background-color:color-mix(in oklab, var(--color-accent-cyan) 5%, transparent)}}.bg-accent-cyan\/10{background-color:var(--color-accent-cyan)}@supports (color:color-mix(in lab, red, red)){.bg-accent-cyan\/10{background-color:color-mix(in oklab, var(--color-accent-cyan) 10%, transparent)}}.bg-accent-cyan\/20{background-color:var(--color-accent-cyan)}@supports (color:color-mix(in lab, red, red)){.bg-accent-cyan\/20{background-color:color-mix(in oklab, var(--color-accent-cyan) 20%, transparent)}}.bg-accent-green,.bg-accent-green\/10{background-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.bg-accent-green\/10{background-color:color-mix(in oklab, var(--color-accent-green) 10%, transparent)}}.bg-accent-green\/20{background-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.bg-accent-green\/20{background-color:color-mix(in oklab, var(--color-accent-green) 20%, transparent)}}.bg-accent-green\/50{background-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.bg-accent-green\/50{background-color:color-mix(in oklab, var(--color-accent-green) 50%, transparent)}}.bg-accent-purple,.bg-accent-purple\/20{background-color:var(--color-accent-purple)}@supports (color:color-mix(in lab, red, red)){.bg-accent-purple\/20{background-color:color-mix(in oklab, var(--color-accent-purple) 20%, transparent)}}.bg-accent-red,.bg-accent-red\/10{background-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.bg-accent-red\/10{background-color:color-mix(in oklab, var(--color-accent-red) 10%, transparent)}}.bg-accent-red\/15{background-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.bg-accent-red\/15{background-color:color-mix(in oklab, var(--color-accent-red) 15%, transparent)}}.bg-accent-red\/20{background-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.bg-accent-red\/20{background-color:color-mix(in oklab, var(--color-accent-red) 20%, transparent)}}.bg-amber-50{background-color:var(--color-amber-50)}.bg-amber-100{background-color:var(--color-amber-100)}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/10{background-color:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab, red, red)){.bg-amber-500\/20{background-color:color-mix(in oklab, var(--color-amber-500) 20%, transparent)}}.bg-amber-600{background-color:var(--color-amber-600)}.bg-background{background-color:var(--color-background)}.bg-background-mute,.bg-background-mute\/60{background-color:var(--color-background-mute)}@supports (color:color-mix(in lab, red, red)){.bg-background-mute\/60{background-color:color-mix(in oklab, var(--color-background-mute) 60%, transparent)}}.bg-background\/50{background-color:var(--color-background)}@supports (color:color-mix(in lab, red, red)){.bg-background\/50{background-color:color-mix(in oklab, var(--color-background) 50%, transparent)}}.bg-badge-cyan-bg{background-color:var(--color-badge-cyan-bg)}.bg-badge-neutral-bg{background-color:var(--color-badge-neutral-bg)}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab, red, red)){.bg-black\/20{background-color:color-mix(in oklab, var(--color-black) 20%, transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab, red, red)){.bg-black\/30{background-color:color-mix(in oklab, var(--color-black) 30%, transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab, red, red)){.bg-black\/40{background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab, red, red)){.bg-black\/60{background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab, red, red)){.bg-black\/70{background-color:color-mix(in oklab, var(--color-black) 70%, transparent)}}.bg-black\/80{background-color:#000c}@supports (color:color-mix(in lab, red, red)){.bg-black\/80{background-color:color-mix(in oklab, var(--color-black) 80%, transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-100{background-color:var(--color-blue-100)}.bg-blue-400{background-color:var(--color-blue-400)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-blue-500\/10{background-color:#3080ff1a}@supports (color:color-mix(in lab, red, red)){.bg-blue-500\/10{background-color:color-mix(in oklab, var(--color-blue-500) 10%, transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab, red, red)){.bg-blue-500\/20{background-color:color-mix(in oklab, var(--color-blue-500) 20%, transparent)}}.bg-blue-900\/20{background-color:#1c398e33}@supports (color:color-mix(in lab, red, red)){.bg-blue-900\/20{background-color:color-mix(in oklab, var(--color-blue-900) 20%, transparent)}}.bg-content-muted\/50{background-color:var(--color-text-muted)}@supports (color:color-mix(in lab, red, red)){.bg-content-muted\/50{background-color:color-mix(in oklab, var(--color-text-muted) 50%, transparent)}}.bg-content-primary{background-color:var(--color-text-primary)}.bg-current,.bg-current\/10{background-color:currentColor}@supports (color:color-mix(in lab, red, red)){.bg-current\/10{background-color:color-mix(in oklab, currentcolor 10%, transparent)}}.bg-cyan-50{background-color:var(--color-cyan-50)}.bg-cyan-400{background-color:var(--color-cyan-400)}.bg-cyan-400\/20{background-color:#00d2ef33}@supports (color:color-mix(in lab, red, red)){.bg-cyan-400\/20{background-color:color-mix(in oklab, var(--color-cyan-400) 20%, transparent)}}.bg-cyan-500\/10{background-color:#00b7d71a}@supports (color:color-mix(in lab, red, red)){.bg-cyan-500\/10{background-color:color-mix(in oklab, var(--color-cyan-500) 10%, transparent)}}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab, red, red)){.bg-cyan-500\/20{background-color:color-mix(in oklab, var(--color-cyan-500) 20%, transparent)}}.bg-cyan-600{background-color:var(--color-cyan-600)}.bg-dark-card\/30{background-color:var(--color-surface)}@supports (color:color-mix(in lab, red, red)){.bg-dark-card\/30{background-color:color-mix(in oklab, var(--color-surface) 30%, transparent)}}.bg-gray-50{background-color:var(--color-gray-50)}.bg-gray-100{background-color:var(--color-gray-100)}.bg-gray-100\/50{background-color:#f3f4f680}@supports (color:color-mix(in lab, red, red)){.bg-gray-100\/50{background-color:color-mix(in oklab, var(--color-gray-100) 50%, transparent)}}.bg-gray-200{background-color:var(--color-gray-200)}.bg-gray-300{background-color:var(--color-gray-300)}.bg-gray-400{background-color:var(--color-gray-400)}.bg-gray-500{background-color:var(--color-gray-500)}.bg-gray-500\/20{background-color:#6a728233}@supports (color:color-mix(in lab, red, red)){.bg-gray-500\/20{background-color:color-mix(in oklab, var(--color-gray-500) 20%, transparent)}}.bg-gray-900\/20{background-color:#10182833}@supports (color:color-mix(in lab, red, red)){.bg-gray-900\/20{background-color:color-mix(in oklab, var(--color-gray-900) 20%, transparent)}}.bg-green-50{background-color:var(--color-green-50)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-400{background-color:var(--color-green-400)}.bg-green-400\/20{background-color:#05df7233}@supports (color:color-mix(in lab, red, red)){.bg-green-400\/20{background-color:color-mix(in oklab, var(--color-green-400) 20%, transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-green-500\/5{background-color:#00c7580d}@supports (color:color-mix(in lab, red, red)){.bg-green-500\/5{background-color:color-mix(in oklab, var(--color-green-500) 5%, transparent)}}.bg-green-500\/10{background-color:#00c7581a}@supports (color:color-mix(in lab, red, red)){.bg-green-500\/10{background-color:color-mix(in oklab, var(--color-green-500) 10%, transparent)}}.bg-neutral-900{background-color:var(--color-neutral-900)}.bg-orange-50{background-color:var(--color-orange-50)}.bg-orange-100{background-color:var(--color-orange-100)}.bg-orange-400{background-color:var(--color-orange-400)}.bg-orange-400\/20{background-color:#ff8b1a33}@supports (color:color-mix(in lab, red, red)){.bg-orange-400\/20{background-color:color-mix(in oklab, var(--color-orange-400) 20%, transparent)}}.bg-primary,.bg-primary\/5{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.bg-primary\/5{background-color:color-mix(in oklab, var(--color-primary) 5%, transparent)}}.bg-primary\/10{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.bg-primary\/10{background-color:color-mix(in oklab, var(--color-primary) 10%, transparent)}}.bg-primary\/20{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.bg-primary\/20{background-color:color-mix(in oklab, var(--color-primary) 20%, transparent)}}.bg-primary\/30{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.bg-primary\/30{background-color:color-mix(in oklab, var(--color-primary) 30%, transparent)}}.bg-primary\/70{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.bg-primary\/70{background-color:color-mix(in oklab, var(--color-primary) 70%, transparent)}}.bg-purple-400{background-color:var(--color-purple-400)}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab, red, red)){.bg-purple-500\/20{background-color:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-red-400{background-color:var(--color-red-400)}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/10{background-color:color-mix(in oklab, var(--color-red-500) 10%, transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab, red, red)){.bg-red-500\/20{background-color:color-mix(in oklab, var(--color-red-500) 20%, transparent)}}.bg-red-600{background-color:var(--color-red-600)}.bg-red-600\/20{background-color:#e4001433}@supports (color:color-mix(in lab, red, red)){.bg-red-600\/20{background-color:color-mix(in oklab, var(--color-red-600) 20%, transparent)}}.bg-red-900\/20{background-color:#82181a33}@supports (color:color-mix(in lab, red, red)){.bg-red-900\/20{background-color:color-mix(in oklab, var(--color-red-900) 20%, transparent)}}.bg-secondary{background-color:var(--color-secondary)}.bg-secondary-bg\/20{background-color:var(--color-secondary-bg)}@supports (color:color-mix(in lab, red, red)){.bg-secondary-bg\/20{background-color:color-mix(in oklab, var(--color-secondary-bg) 20%, transparent)}}.bg-secondary\/20{background-color:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.bg-secondary\/20{background-color:color-mix(in oklab, var(--color-secondary) 20%, transparent)}}.bg-secondary\/40{background-color:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.bg-secondary\/40{background-color:color-mix(in oklab, var(--color-secondary) 40%, transparent)}}.bg-stroke-subtle{background-color:var(--color-border-subtle)}.bg-surface,.bg-surface\/50{background-color:var(--color-surface)}@supports (color:color-mix(in lab, red, red)){.bg-surface\/50{background-color:color-mix(in oklab, var(--color-surface) 50%, transparent)}}.bg-violet-500\/20{background-color:#8d54ff33}@supports (color:color-mix(in lab, red, red)){.bg-violet-500\/20{background-color:color-mix(in oklab, var(--color-violet-500) 20%, transparent)}}.bg-white{background-color:var(--color-white)}.bg-white\/5{background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.bg-white\/5{background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.bg-white\/10{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.bg-white\/10{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.bg-white\/20{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.bg-white\/20{background-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.bg-white\/50{background-color:#ffffff80}@supports (color:color-mix(in lab, red, red)){.bg-white\/50{background-color:color-mix(in oklab, var(--color-white) 50%, transparent)}}.bg-white\/95{background-color:#fffffff2}@supports (color:color-mix(in lab, red, red)){.bg-white\/95{background-color:color-mix(in oklab, var(--color-white) 95%, transparent)}}.bg-yellow-50{background-color:var(--color-yellow-50)}.bg-yellow-100{background-color:var(--color-yellow-100)}.bg-yellow-400{background-color:var(--color-yellow-400)}.bg-yellow-400\/20{background-color:#fac80033}@supports (color:color-mix(in lab, red, red)){.bg-yellow-400\/20{background-color:color-mix(in oklab, var(--color-yellow-400) 20%, transparent)}}.bg-yellow-500{background-color:var(--color-yellow-500)}.bg-yellow-500\/10{background-color:#edb2001a}@supports (color:color-mix(in lab, red, red)){.bg-yellow-500\/10{background-color:color-mix(in oklab, var(--color-yellow-500) 10%, transparent)}}.bg-yellow-500\/20{background-color:#edb20033}@supports (color:color-mix(in lab, red, red)){.bg-yellow-500\/20{background-color:color-mix(in oklab, var(--color-yellow-500) 20%, transparent)}}.bg-yellow-900\/20{background-color:#733e0a33}@supports (color:color-mix(in lab, red, red)){.bg-yellow-900\/20{background-color:color-mix(in oklab, var(--color-yellow-900) 20%, transparent)}}.bg-zinc-900{background-color:var(--color-zinc-900)}.bg-gradient-to-b{--tw-gradient-position:to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-br{--tw-gradient-position:to bottom right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-t{--tw-gradient-position:to top in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-tl{--tw-gradient-position:to top left in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-accent-green\/10{--tw-gradient-from:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.from-accent-green\/10{--tw-gradient-from:color-mix(in oklab, var(--color-accent-green) 10%, transparent)}}.from-accent-green\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-blue-500\/20{--tw-gradient-from:#3080ff33}@supports (color:color-mix(in lab, red, red)){.from-blue-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-blue-500) 20%, transparent)}}.from-blue-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-cyan-200\/30{--tw-gradient-from:#a2f4fd4d}@supports (color:color-mix(in lab, red, red)){.from-cyan-200\/30{--tw-gradient-from:color-mix(in oklab, var(--color-cyan-200) 30%, transparent)}}.from-cyan-200\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-cyan-400{--tw-gradient-from:var(--color-cyan-400);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-cyan-400\/25{--tw-gradient-from:#00d2ef40}@supports (color:color-mix(in lab, red, red)){.from-cyan-400\/25{--tw-gradient-from:color-mix(in oklab, var(--color-cyan-400) 25%, transparent)}}.from-cyan-400\/25{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-cyan-400\/90{--tw-gradient-from:#00d2efe6}@supports (color:color-mix(in lab, red, red)){.from-cyan-400\/90{--tw-gradient-from:color-mix(in oklab, var(--color-cyan-400) 90%, transparent)}}.from-cyan-400\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-cyan-500\/20{--tw-gradient-from:#00b7d733}@supports (color:color-mix(in lab, red, red)){.from-cyan-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-cyan-500) 20%, transparent)}}.from-cyan-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-cyan-500\/50{--tw-gradient-from:#00b7d780}@supports (color:color-mix(in lab, red, red)){.from-cyan-500\/50{--tw-gradient-from:color-mix(in oklab, var(--color-cyan-500) 50%, transparent)}}.from-cyan-500\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-emerald-200\/25{--tw-gradient-from:#a4f4cf40}@supports (color:color-mix(in lab, red, red)){.from-emerald-200\/25{--tw-gradient-from:color-mix(in oklab, var(--color-emerald-200) 25%, transparent)}}.from-emerald-200\/25{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-gray-100{--tw-gradient-from:var(--color-gray-100);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-gray-900{--tw-gradient-from:var(--color-gray-900);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-orange-500\/20{--tw-gradient-from:#fe6e0033}@supports (color:color-mix(in lab, red, red)){.from-orange-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-orange-500) 20%, transparent)}}.from-orange-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-orange-500\/50{--tw-gradient-from:#fe6e0080}@supports (color:color-mix(in lab, red, red)){.from-orange-500\/50{--tw-gradient-from:color-mix(in oklab, var(--color-orange-500) 50%, transparent)}}.from-orange-500\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-primary{--tw-gradient-from:var(--color-primary);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-primary\/3{--tw-gradient-from:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.from-primary\/3{--tw-gradient-from:color-mix(in oklab, var(--color-primary) 3%, transparent)}}.from-primary\/3{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-primary\/5{--tw-gradient-from:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.from-primary\/5{--tw-gradient-from:color-mix(in oklab, var(--color-primary) 5%, transparent)}}.from-primary\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-primary\/10{--tw-gradient-from:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.from-primary\/10{--tw-gradient-from:color-mix(in oklab, var(--color-primary) 10%, transparent)}}.from-primary\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-primary\/20{--tw-gradient-from:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.from-primary\/20{--tw-gradient-from:color-mix(in oklab, var(--color-primary) 20%, transparent)}}.from-primary\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-primary\/30{--tw-gradient-from:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.from-primary\/30{--tw-gradient-from:color-mix(in oklab, var(--color-primary) 30%, transparent)}}.from-primary\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-200\/25{--tw-gradient-from:#e9d5ff40}@supports (color:color-mix(in lab, red, red)){.from-purple-200\/25{--tw-gradient-from:color-mix(in oklab, var(--color-purple-200) 25%, transparent)}}.from-purple-200\/25{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-red-500\/50{--tw-gradient-from:#fb2c3680}@supports (color:color-mix(in lab, red, red)){.from-red-500\/50{--tw-gradient-from:color-mix(in oklab, var(--color-red-500) 50%, transparent)}}.from-red-500\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-secondary\/5{--tw-gradient-from:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.from-secondary\/5{--tw-gradient-from:color-mix(in oklab, var(--color-secondary) 5%, transparent)}}.from-secondary\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-secondary\/20{--tw-gradient-from:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.from-secondary\/20{--tw-gradient-from:color-mix(in oklab, var(--color-secondary) 20%, transparent)}}.from-secondary\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-transparent{--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-white\/5{--tw-gradient-from:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.from-white\/5{--tw-gradient-from:color-mix(in oklab, var(--color-white) 5%, transparent)}}.from-white\/5{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-yellow-400\/30{--tw-gradient-from:#fac8004d}@supports (color:color-mix(in lab, red, red)){.from-yellow-400\/30{--tw-gradient-from:color-mix(in oklab, var(--color-yellow-400) 30%, transparent)}}.from-yellow-400\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-yellow-500\/50{--tw-gradient-from:#edb20080}@supports (color:color-mix(in lab, red, red)){.from-yellow-500\/50{--tw-gradient-from:color-mix(in oklab, var(--color-yellow-500) 50%, transparent)}}.from-yellow-500\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-primary\/20{--tw-gradient-via:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.via-primary\/20{--tw-gradient-via:color-mix(in oklab, var(--color-primary) 20%, transparent)}}.via-primary\/20{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-secondary\/10{--tw-gradient-via:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.via-secondary\/10{--tw-gradient-via:color-mix(in oklab, var(--color-secondary) 10%, transparent)}}.via-secondary\/10{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-transparent{--tw-gradient-via:transparent;--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-white\/5{--tw-gradient-via:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.via-white\/5{--tw-gradient-via:color-mix(in oklab, var(--color-white) 5%, transparent)}}.via-white\/5{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-accent-cyan\/20{--tw-gradient-to:var(--color-accent-cyan)}@supports (color:color-mix(in lab, red, red)){.to-accent-cyan\/20{--tw-gradient-to:color-mix(in oklab, var(--color-accent-cyan) 20%, transparent)}}.to-accent-cyan\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-accent-green{--tw-gradient-to:var(--color-accent-green);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-accent-purple\/20{--tw-gradient-to:var(--color-accent-purple)}@supports (color:color-mix(in lab, red, red)){.to-accent-purple\/20{--tw-gradient-to:color-mix(in oklab, var(--color-accent-purple) 20%, transparent)}}.to-accent-purple\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-blue-100\/20{--tw-gradient-to:#dbeafe33}@supports (color:color-mix(in lab, red, red)){.to-blue-100\/20{--tw-gradient-to:color-mix(in oklab, var(--color-blue-100) 20%, transparent)}}.to-blue-100\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-cyan-200\/10{--tw-gradient-to:#a2f4fd1a}@supports (color:color-mix(in lab, red, red)){.to-cyan-200\/10{--tw-gradient-to:color-mix(in oklab, var(--color-cyan-200) 10%, transparent)}}.to-cyan-200\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-cyan-400\/20{--tw-gradient-to:#00d2ef33}@supports (color:color-mix(in lab, red, red)){.to-cyan-400\/20{--tw-gradient-to:color-mix(in oklab, var(--color-cyan-400) 20%, transparent)}}.to-cyan-400\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-cyan-500{--tw-gradient-to:var(--color-cyan-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-cyan-500\/20{--tw-gradient-to:#00b7d733}@supports (color:color-mix(in lab, red, red)){.to-cyan-500\/20{--tw-gradient-to:color-mix(in oklab, var(--color-cyan-500) 20%, transparent)}}.to-cyan-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-cyan-500\/90{--tw-gradient-to:#00b7d7e6}@supports (color:color-mix(in lab, red, red)){.to-cyan-500\/90{--tw-gradient-to:color-mix(in oklab, var(--color-cyan-500) 90%, transparent)}}.to-cyan-500\/90{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-cyan-600\/50{--tw-gradient-to:#0092b580}@supports (color:color-mix(in lab, red, red)){.to-cyan-600\/50{--tw-gradient-to:color-mix(in oklab, var(--color-cyan-600) 50%, transparent)}}.to-cyan-600\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-gray-200{--tw-gradient-to:var(--color-gray-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-gray-700{--tw-gradient-to:var(--color-gray-700);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-400\/30{--tw-gradient-to:#ff8b1a4d}@supports (color:color-mix(in lab, red, red)){.to-orange-400\/30{--tw-gradient-to:color-mix(in oklab, var(--color-orange-400) 30%, transparent)}}.to-orange-400\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-orange-600\/50{--tw-gradient-to:#f0510080}@supports (color:color-mix(in lab, red, red)){.to-orange-600\/50{--tw-gradient-to:color-mix(in oklab, var(--color-orange-600) 50%, transparent)}}.to-orange-600\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-pink-100\/15{--tw-gradient-to:#fce7f326}@supports (color:color-mix(in lab, red, red)){.to-pink-100\/15{--tw-gradient-to:color-mix(in oklab, var(--color-pink-100) 15%, transparent)}}.to-pink-100\/15{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-primary\/10{--tw-gradient-to:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.to-primary\/10{--tw-gradient-to:color-mix(in oklab, var(--color-primary) 10%, transparent)}}.to-primary\/10{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-primary\/20{--tw-gradient-to:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.to-primary\/20{--tw-gradient-to:color-mix(in oklab, var(--color-primary) 20%, transparent)}}.to-primary\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-primary\/80{--tw-gradient-to:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.to-primary\/80{--tw-gradient-to:color-mix(in oklab, var(--color-primary) 80%, transparent)}}.to-primary\/80{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-red-600\/50{--tw-gradient-to:#e4001480}@supports (color:color-mix(in lab, red, red)){.to-red-600\/50{--tw-gradient-to:color-mix(in oklab, var(--color-red-600) 50%, transparent)}}.to-red-600\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-secondary\/30{--tw-gradient-to:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.to-secondary\/30{--tw-gradient-to:color-mix(in oklab, var(--color-secondary) 30%, transparent)}}.to-secondary\/30{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-teal-100\/15{--tw-gradient-to:#cbfbf126}@supports (color:color-mix(in lab, red, red)){.to-teal-100\/15{--tw-gradient-to:color-mix(in oklab, var(--color-teal-100) 15%, transparent)}}.to-teal-100\/15{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-yellow-500\/20{--tw-gradient-to:#edb20033}@supports (color:color-mix(in lab, red, red)){.to-yellow-500\/20{--tw-gradient-to:color-mix(in oklab, var(--color-yellow-500) 20%, transparent)}}.to-yellow-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-yellow-600\/50{--tw-gradient-to:#cd890080}@supports (color:color-mix(in lab, red, red)){.to-yellow-600\/50{--tw-gradient-to:color-mix(in oklab, var(--color-yellow-600) 50%, transparent)}}.to-yellow-600\/50{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-\[15px\]{padding:15px}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-7{padding-block:calc(var(--spacing) * 7)}.py-8{padding-block:calc(var(--spacing) * 8)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-0{padding-top:calc(var(--spacing) * 0)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-6{padding-top:calc(var(--spacing) * 6)}.pt-8{padding-top:calc(var(--spacing) * 8)}.pt-px{padding-top:1px}.pr-4{padding-right:calc(var(--spacing) * 4)}.pb-0{padding-bottom:calc(var(--spacing) * 0)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-4{padding-bottom:calc(var(--spacing) * 4)}.pl-2{padding-left:calc(var(--spacing) * 2)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.text-right{text-align:right}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:Noto Sans,-apple-system,Roboto,Helvetica,sans-serif}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[1\.25rem\]{font-size:1.25rem}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[22px\]{font-size:22px}.text-\[24px\]{font-size:24px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-extrabold{--tw-font-weight:var(--font-weight-extrabold);font-weight:var(--font-weight-extrabold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-\[\#212122\]{color:#212122}.text-accent-cyan{color:var(--color-accent-cyan)}.text-accent-green,.text-accent-green\/90{color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.text-accent-green\/90{color:color-mix(in oklab, var(--color-accent-green) 90%, transparent)}}.text-accent-purple{color:var(--color-accent-purple)}.text-accent-red,.text-accent-red\/70{color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.text-accent-red\/70{color:color-mix(in oklab, var(--color-accent-red) 70%, transparent)}}.text-accent-red\/80{color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.text-accent-red\/80{color:color-mix(in oklab, var(--color-accent-red) 80%, transparent)}}.text-accent-red\/90{color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.text-accent-red\/90{color:color-mix(in oklab, var(--color-accent-red) 90%, transparent)}}.text-amber-500{color:var(--color-amber-500)}.text-amber-600{color:var(--color-amber-600)}.text-amber-700{color:var(--color-amber-700)}.text-amber-800{color:var(--color-amber-800)}.text-amber-900{color:var(--color-amber-900)}.text-background{color:var(--color-background)}.text-badge-cyan-text{color:var(--color-badge-cyan-text)}.text-badge-neutral-text{color:var(--color-badge-neutral-text)}.text-blue-100{color:var(--color-blue-100)}.text-blue-200{color:var(--color-blue-200)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-blue-700{color:var(--color-blue-700)}.text-blue-800{color:var(--color-blue-800)}.text-blue-900{color:var(--color-blue-900)}.text-content-heading{color:var(--color-heading)}.text-content-muted,.text-content-muted\/50{color:var(--color-text-muted)}@supports (color:color-mix(in lab, red, red)){.text-content-muted\/50{color:color-mix(in oklab, var(--color-text-muted) 50%, transparent)}}.text-content-muted\/60{color:var(--color-text-muted)}@supports (color:color-mix(in lab, red, red)){.text-content-muted\/60{color:color-mix(in oklab, var(--color-text-muted) 60%, transparent)}}.text-content-primary{color:var(--color-text-primary)}.text-content-secondary{color:var(--color-text-secondary)}.text-cyan-500{color:var(--color-cyan-500)}.text-cyan-600{color:var(--color-cyan-600)}.text-cyan-700{color:var(--color-cyan-700)}.text-cyan-900{color:var(--color-cyan-900)}.text-emerald-600{color:var(--color-emerald-600)}.text-gray-400{color:var(--color-gray-400)}.text-gray-500{color:var(--color-gray-500)}.text-gray-600{color:var(--color-gray-600)}.text-gray-700{color:var(--color-gray-700)}.text-gray-900{color:var(--color-gray-900)}.text-green-400{color:var(--color-green-400)}.text-green-600{color:var(--color-green-600)}.text-green-700{color:var(--color-green-700)}.text-green-800{color:var(--color-green-800)}.text-green-900{color:var(--color-green-900)}.text-orange-500{color:var(--color-orange-500)}.text-orange-600{color:var(--color-orange-600)}.text-orange-700{color:var(--color-orange-700)}.text-primary,.text-primary\/70{color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.text-primary\/70{color:color-mix(in oklab, var(--color-primary) 70%, transparent)}}.text-primary\/80{color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.text-primary\/80{color:color-mix(in oklab, var(--color-primary) 80%, transparent)}}.text-purple-500{color:var(--color-purple-500)}.text-purple-600{color:var(--color-purple-600)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-red-900{color:var(--color-red-900)}.text-secondary{color:var(--color-secondary)}.text-transparent{color:#0000}.text-violet-700{color:var(--color-violet-700)}.text-white{color:var(--color-white)}.text-white\/30{color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.text-white\/30{color:color-mix(in oklab, var(--color-white) 30%, transparent)}}.text-white\/40{color:#fff6}@supports (color:color-mix(in lab, red, red)){.text-white\/40{color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.text-white\/50{color:#ffffff80}@supports (color:color-mix(in lab, red, red)){.text-white\/50{color:color-mix(in oklab, var(--color-white) 50%, transparent)}}.text-white\/60{color:#fff9}@supports (color:color-mix(in lab, red, red)){.text-white\/60{color:color-mix(in oklab, var(--color-white) 60%, transparent)}}.text-white\/80{color:#fffc}@supports (color:color-mix(in lab, red, red)){.text-white\/80{color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.text-white\/90{color:#ffffffe6}@supports (color:color-mix(in lab, red, red)){.text-white\/90{color:color-mix(in oklab, var(--color-white) 90%, transparent)}}.text-yellow-200{color:var(--color-yellow-200)}.text-yellow-400{color:var(--color-yellow-400)}.text-yellow-500{color:var(--color-yellow-500)}.text-yellow-600{color:var(--color-yellow-600)}.text-yellow-700{color:var(--color-yellow-700)}.text-yellow-800{color:var(--color-yellow-800)}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.underline{text-decoration-line:underline}.decoration-gray-400{-webkit-text-decoration-color:var(--color-gray-400);-webkit-text-decoration-color:var(--color-gray-400);-webkit-text-decoration-color:var(--color-gray-400);text-decoration-color:var(--color-gray-400)}.decoration-green-400\/60{text-decoration-color:#05df7299}@supports (color:color-mix(in lab, red, red)){.decoration-green-400\/60{-webkit-text-decoration-color:color-mix(in oklab, var(--color-green-400) 60%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-green-400) 60%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-green-400) 60%, transparent);text-decoration-color:color-mix(in oklab, var(--color-green-400) 60%, transparent)}}.underline-offset-2{text-underline-offset:2px}.placeholder-content-muted::placeholder{color:var(--color-text-muted)}.placeholder-gray-400::placeholder{color:var(--color-gray-400)}.placeholder-gray-500::placeholder{color:var(--color-gray-500)}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-65{opacity:.65}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.opacity-100{opacity:1}.mix-blend-multiply{mix-blend-mode:multiply}.mix-blend-normal{mix-blend-mode:normal}.mix-blend-screen{mix-blend-mode:screen}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_0_\.375rem_0_rgba\(170\,232\,232\,0\.20\)\]{--tw-shadow:0 0 .375rem 0 var(--tw-shadow-color,#aae8e833);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_2px_12px_rgba\(6\,182\,212\,0\.3\)\]{--tw-shadow:0 2px 12px var(--tw-shadow-color,#06b6d44d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_4px_16px_rgba\(6\,182\,212\,0\.4\)\]{--tw-shadow:0 4px 16px var(--tw-shadow-color,#06b6d466);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_8px_32px_0_rgba\(0\,0\,0\,0\.1\)\]{--tw-shadow:0 8px 32px 0 var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\[0_8px_32px_0_rgba\(0\,0\,0\,0\.37\)\]{--tw-shadow:0 8px 32px 0 var(--tw-shadow-color,#0000005e);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-accent-green\/50{--tw-shadow-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.shadow-accent-green\/50{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-accent-green) 50%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/20{--tw-shadow-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.shadow-primary\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-primary) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/30{--tw-shadow-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.shadow-primary\/30{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-primary) 30%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-yellow-400\/20{--tw-shadow-color:#fac80033}@supports (color:color-mix(in lab, red, red)){.shadow-yellow-400\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-yellow-400) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-cyan-400\/50{--tw-ring-color:#00d2ef80}@supports (color:color-mix(in lab, red, red)){.ring-cyan-400\/50{--tw-ring-color:color-mix(in oklab, var(--color-cyan-400) 50%, transparent)}}.ring-white\/10{--tw-ring-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.ring-white\/10{--tw-ring-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-3xl{--tw-blur:blur(var(--blur-3xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[120px\]{--tw-blur:blur(120px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-xl{--tw-blur:blur(var(--blur-xl));filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.brightness-0{--tw-brightness:brightness(0%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow-\[0_0_6px_rgba\(6\,182\,212\,0\.8\)\]{--tw-drop-shadow-size:drop-shadow(0 0 6px var(--tw-drop-shadow-color,#06b6d4cc));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-lg{--tw-backdrop-blur:blur(var(--blur-lg));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xs{--tw-backdrop-blur:blur(var(--blur-xs));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.duration-700{--tw-duration:.7s;transition-duration:.7s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}@media (hover:hover){.group-hover\:translate-x-1:is(:where(.group):hover *){--tw-translate-x:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:translate-y-1:is(:where(.group):hover *){--tw-translate-y:calc(var(--spacing) * 1);translate:var(--tw-translate-x) var(--tw-translate-y)}.group-hover\:scale-110:is(:where(.group):hover *){--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:rotate-12:is(:where(.group):hover *){rotate:12deg}.group-hover\:border-stroke:is(:where(.group):hover *){border-color:var(--color-border)}.group-hover\:bg-accent-green\/30:is(:where(.group):hover *){background-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.group-hover\:bg-accent-green\/30:is(:where(.group):hover *){background-color:color-mix(in oklab, var(--color-accent-green) 30%, transparent)}}.group-hover\:bg-background-mute:is(:where(.group):hover *){background-color:var(--color-background-mute)}.group-hover\:bg-primary\/30:is(:where(.group):hover *){background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.group-hover\:bg-primary\/30:is(:where(.group):hover *){background-color:color-mix(in oklab, var(--color-primary) 30%, transparent)}}.group-hover\:text-cyan-700:is(:where(.group):hover *){color:var(--color-cyan-700)}.group-hover\:text-primary:is(:where(.group):hover *){color:var(--color-primary)}.group-hover\:text-white:is(:where(.group):hover *){color:var(--color-white)}.group-hover\:text-yellow-500:is(:where(.group):hover *){color:var(--color-yellow-500)}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}.group-hover\/delete\:rotate-12:is(:where(.group\/delete):hover *){rotate:12deg}}.group-has-\[\:checked\]\:scale-100:is(:where(.group):has(:checked) *){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-has-\[\:checked\]\:border-accent-green:is(:where(.group):has(:checked) *),.group-has-\[\:checked\]\:border-accent-green\/50:is(:where(.group):has(:checked) *){border-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.group-has-\[\:checked\]\:border-accent-green\/50:is(:where(.group):has(:checked) *){border-color:color-mix(in oklab, var(--color-accent-green) 50%, transparent)}}.group-has-\[\:checked\]\:border-accent-red:is(:where(.group):has(:checked) *),.group-has-\[\:checked\]\:border-accent-red\/50:is(:where(.group):has(:checked) *){border-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.group-has-\[\:checked\]\:border-accent-red\/50:is(:where(.group):has(:checked) *){border-color:color-mix(in oklab, var(--color-accent-red) 50%, transparent)}}.group-has-\[\:checked\]\:bg-accent-green:is(:where(.group):has(:checked) *),.group-has-\[\:checked\]\:bg-accent-green\/10:is(:where(.group):has(:checked) *){background-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.group-has-\[\:checked\]\:bg-accent-green\/10:is(:where(.group):has(:checked) *){background-color:color-mix(in oklab, var(--color-accent-green) 10%, transparent)}}.group-has-\[\:checked\]\:bg-accent-red:is(:where(.group):has(:checked) *),.group-has-\[\:checked\]\:bg-accent-red\/10:is(:where(.group):has(:checked) *){background-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.group-has-\[\:checked\]\:bg-accent-red\/10:is(:where(.group):has(:checked) *){background-color:color-mix(in oklab, var(--color-accent-red) 10%, transparent)}}.peer-checked\:scale-100:is(:where(.peer):checked~*){--tw-scale-x:100%;--tw-scale-y:100%;--tw-scale-z:100%;scale:var(--tw-scale-x) var(--tw-scale-y)}.peer-checked\:border-primary:is(:where(.peer):checked~*){border-color:var(--color-primary)}.peer-checked\:bg-primary\/20:is(:where(.peer):checked~*){background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.peer-checked\:bg-primary\/20:is(:where(.peer):checked~*){background-color:color-mix(in oklab, var(--color-primary) 20%, transparent)}}.last\:border-r-0:last-child{border-right-style:var(--tw-border-style);border-right-width:0}.last\:border-b-0:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}@media (hover:hover){.hover\:scale-105:hover{--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:scale-110:hover{--tw-scale-x:110%;--tw-scale-y:110%;--tw-scale-z:110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.hover\:scale-\[1\.02\]:hover{scale:1.02}.hover\:border-accent-cyan\/50:hover{border-color:var(--color-accent-cyan)}@supports (color:color-mix(in lab, red, red)){.hover\:border-accent-cyan\/50:hover{border-color:color-mix(in oklab, var(--color-accent-cyan) 50%, transparent)}}.hover\:border-cyan-400:hover{border-color:var(--color-cyan-400)}.hover\:border-cyan-400\/30:hover{border-color:#00d2ef4d}@supports (color:color-mix(in lab, red, red)){.hover\:border-cyan-400\/30:hover{border-color:color-mix(in oklab, var(--color-cyan-400) 30%, transparent)}}.hover\:border-cyan-400\/50:hover{border-color:#00d2ef80}@supports (color:color-mix(in lab, red, red)){.hover\:border-cyan-400\/50:hover{border-color:color-mix(in oklab, var(--color-cyan-400) 50%, transparent)}}.hover\:border-cyan-500\/50:hover{border-color:#00b7d780}@supports (color:color-mix(in lab, red, red)){.hover\:border-cyan-500\/50:hover{border-color:color-mix(in oklab, var(--color-cyan-500) 50%, transparent)}}.hover\:border-orange-500:hover{border-color:var(--color-orange-500)}.hover\:border-primary:hover,.hover\:border-primary\/30:hover{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:border-primary\/30:hover{border-color:color-mix(in oklab, var(--color-primary) 30%, transparent)}}.hover\:border-primary\/50:hover{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:border-primary\/50:hover{border-color:color-mix(in oklab, var(--color-primary) 50%, transparent)}}.hover\:border-primary\/60:hover{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:border-primary\/60:hover{border-color:color-mix(in oklab, var(--color-primary) 60%, transparent)}}.hover\:border-primary\/80:hover{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:border-primary\/80:hover{border-color:color-mix(in oklab, var(--color-primary) 80%, transparent)}}.hover\:border-secondary\/30:hover{border-color:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:border-secondary\/30:hover{border-color:color-mix(in oklab, var(--color-secondary) 30%, transparent)}}.hover\:border-stroke:hover{border-color:var(--color-border)}.hover\:border-stroke-subtle:hover{border-color:var(--color-border-subtle)}.hover\:border-yellow-500\/50:hover{border-color:#edb20080}@supports (color:color-mix(in lab, red, red)){.hover\:border-yellow-500\/50:hover{border-color:color-mix(in oklab, var(--color-yellow-500) 50%, transparent)}}.hover\:bg-accent-cyan\/30:hover{background-color:var(--color-accent-cyan)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent-cyan\/30:hover{background-color:color-mix(in oklab, var(--color-accent-cyan) 30%, transparent)}}.hover\:bg-accent-green\/10:hover{background-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent-green\/10:hover{background-color:color-mix(in oklab, var(--color-accent-green) 10%, transparent)}}.hover\:bg-accent-green\/20:hover{background-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent-green\/20:hover{background-color:color-mix(in oklab, var(--color-accent-green) 20%, transparent)}}.hover\:bg-accent-green\/30:hover{background-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent-green\/30:hover{background-color:color-mix(in oklab, var(--color-accent-green) 30%, transparent)}}.hover\:bg-accent-purple\/30:hover{background-color:var(--color-accent-purple)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent-purple\/30:hover{background-color:color-mix(in oklab, var(--color-accent-purple) 30%, transparent)}}.hover\:bg-accent-red\/10:hover{background-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent-red\/10:hover{background-color:color-mix(in oklab, var(--color-accent-red) 10%, transparent)}}.hover\:bg-accent-red\/20:hover{background-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent-red\/20:hover{background-color:color-mix(in oklab, var(--color-accent-red) 20%, transparent)}}.hover\:bg-accent-red\/30:hover{background-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent-red\/30:hover{background-color:color-mix(in oklab, var(--color-accent-red) 30%, transparent)}}.hover\:bg-accent-red\/80:hover{background-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent-red\/80:hover{background-color:color-mix(in oklab, var(--color-accent-red) 80%, transparent)}}.hover\:bg-accent-red\/90:hover{background-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-accent-red\/90:hover{background-color:color-mix(in oklab, var(--color-accent-red) 90%, transparent)}}.hover\:bg-amber-500\/30:hover{background-color:#f99c004d}@supports (color:color-mix(in lab, red, red)){.hover\:bg-amber-500\/30:hover{background-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)}}.hover\:bg-amber-600:hover{background-color:var(--color-amber-600)}.hover\:bg-amber-700:hover{background-color:var(--color-amber-700)}.hover\:bg-background-mute:hover,.hover\:bg-background-mute\/50:hover{background-color:var(--color-background-mute)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-background-mute\/50:hover{background-color:color-mix(in oklab, var(--color-background-mute) 50%, transparent)}}.hover\:bg-background-soft:hover{background-color:var(--color-background-soft)}.hover\:bg-black\/90:hover{background-color:#000000e6}@supports (color:color-mix(in lab, red, red)){.hover\:bg-black\/90:hover{background-color:color-mix(in oklab, var(--color-black) 90%, transparent)}}.hover\:bg-blue-200:hover{background-color:var(--color-blue-200)}.hover\:bg-blue-600:hover{background-color:var(--color-blue-600)}.hover\:bg-content-primary\/10:hover{background-color:var(--color-text-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-content-primary\/10:hover{background-color:color-mix(in oklab, var(--color-text-primary) 10%, transparent)}}.hover\:bg-cyan-500\/10:hover{background-color:#00b7d71a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-cyan-500\/10:hover{background-color:color-mix(in oklab, var(--color-cyan-500) 10%, transparent)}}.hover\:bg-cyan-500\/20:hover{background-color:#00b7d733}@supports (color:color-mix(in lab, red, red)){.hover\:bg-cyan-500\/20:hover{background-color:color-mix(in oklab, var(--color-cyan-500) 20%, transparent)}}.hover\:bg-cyan-500\/30:hover{background-color:#00b7d74d}@supports (color:color-mix(in lab, red, red)){.hover\:bg-cyan-500\/30:hover{background-color:color-mix(in oklab, var(--color-cyan-500) 30%, transparent)}}.hover\:bg-cyan-700:hover{background-color:var(--color-cyan-700)}.hover\:bg-gray-100:hover{background-color:var(--color-gray-100)}.hover\:bg-gray-100\/50:hover{background-color:#f3f4f680}@supports (color:color-mix(in lab, red, red)){.hover\:bg-gray-100\/50:hover{background-color:color-mix(in oklab, var(--color-gray-100) 50%, transparent)}}.hover\:bg-gray-300:hover{background-color:var(--color-gray-300)}.hover\:bg-green-600:hover{background-color:var(--color-green-600)}.hover\:bg-primary\/5:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/5:hover{background-color:color-mix(in oklab, var(--color-primary) 5%, transparent)}}.hover\:bg-primary\/10:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/10:hover{background-color:color-mix(in oklab, var(--color-primary) 10%, transparent)}}.hover\:bg-primary\/20:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/20:hover{background-color:color-mix(in oklab, var(--color-primary) 20%, transparent)}}.hover\:bg-primary\/30:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/30:hover{background-color:color-mix(in oklab, var(--color-primary) 30%, transparent)}}.hover\:bg-primary\/80:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/80:hover{background-color:color-mix(in oklab, var(--color-primary) 80%, transparent)}}.hover\:bg-primary\/90:hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab, var(--color-primary) 90%, transparent)}}.hover\:bg-purple-500\/30:hover{background-color:#ac4bff4d}@supports (color:color-mix(in lab, red, red)){.hover\:bg-purple-500\/30:hover{background-color:color-mix(in oklab, var(--color-purple-500) 30%, transparent)}}.hover\:bg-red-50:hover{background-color:var(--color-red-50)}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab, var(--color-red-500) 10%, transparent)}}.hover\:bg-red-500\/20:hover{background-color:#fb2c3633}@supports (color:color-mix(in lab, red, red)){.hover\:bg-red-500\/20:hover{background-color:color-mix(in oklab, var(--color-red-500) 20%, transparent)}}.hover\:bg-red-500\/30:hover{background-color:#fb2c364d}@supports (color:color-mix(in lab, red, red)){.hover\:bg-red-500\/30:hover{background-color:color-mix(in oklab, var(--color-red-500) 30%, transparent)}}.hover\:bg-red-600:hover{background-color:var(--color-red-600)}.hover\:bg-red-600\/30:hover{background-color:#e400144d}@supports (color:color-mix(in lab, red, red)){.hover\:bg-red-600\/30:hover{background-color:color-mix(in oklab, var(--color-red-600) 30%, transparent)}}.hover\:bg-red-700:hover{background-color:var(--color-red-700)}.hover\:bg-secondary\/30:hover{background-color:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/30:hover{background-color:color-mix(in oklab, var(--color-secondary) 30%, transparent)}}.hover\:bg-secondary\/90:hover{background-color:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:bg-secondary\/90:hover{background-color:color-mix(in oklab, var(--color-secondary) 90%, transparent)}}.hover\:bg-stroke-subtle:hover{background-color:var(--color-border-subtle)}.hover\:bg-white\/5:hover{background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/5:hover{background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.hover\:bg-white\/10:hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.hover\:bg-white\/10:hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.hover\:bg-yellow-50:hover{background-color:var(--color-yellow-50)}.hover\:bg-yellow-600:hover{background-color:var(--color-yellow-600)}.hover\:bg-gradient-to-r:hover{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.hover\:from-cyan-400\/20:hover{--tw-gradient-from:#00d2ef33}@supports (color:color-mix(in lab, red, red)){.hover\:from-cyan-400\/20:hover{--tw-gradient-from:color-mix(in oklab, var(--color-cyan-400) 20%, transparent)}}.hover\:from-cyan-400\/20:hover{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-cyan-500:hover{--tw-gradient-from:var(--color-cyan-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-cyan-500\/30:hover{--tw-gradient-from:#00b7d74d}@supports (color:color-mix(in lab, red, red)){.hover\:from-cyan-500\/30:hover{--tw-gradient-from:color-mix(in oklab, var(--color-cyan-500) 30%, transparent)}}.hover\:from-cyan-500\/30:hover{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-gray-200:hover{--tw-gradient-from:var(--color-gray-200);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:from-primary\/40:hover{--tw-gradient-from:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:from-primary\/40:hover{--tw-gradient-from:color-mix(in oklab, var(--color-primary) 40%, transparent)}}.hover\:from-primary\/40:hover{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-cyan-400\/30:hover{--tw-gradient-to:#00d2ef4d}@supports (color:color-mix(in lab, red, red)){.hover\:to-cyan-400\/30:hover{--tw-gradient-to:color-mix(in oklab, var(--color-cyan-400) 30%, transparent)}}.hover\:to-cyan-400\/30:hover{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-cyan-500\/20:hover{--tw-gradient-to:#00b7d733}@supports (color:color-mix(in lab, red, red)){.hover\:to-cyan-500\/20:hover{--tw-gradient-to:color-mix(in oklab, var(--color-cyan-500) 20%, transparent)}}.hover\:to-cyan-500\/20:hover{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-cyan-600:hover{--tw-gradient-to:var(--color-cyan-600);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-gray-300:hover{--tw-gradient-to:var(--color-gray-300);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:to-secondary\/40:hover{--tw-gradient-to:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:to-secondary\/40:hover{--tw-gradient-to:color-mix(in oklab, var(--color-secondary) 40%, transparent)}}.hover\:to-secondary\/40:hover{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.hover\:text-accent-green\/80:hover{color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.hover\:text-accent-green\/80:hover{color:color-mix(in oklab, var(--color-accent-green) 80%, transparent)}}.hover\:text-accent-red:hover{color:var(--color-accent-red)}.hover\:text-blue-600:hover{color:var(--color-blue-600)}.hover\:text-content-heading:hover{color:var(--color-heading)}.hover\:text-content-primary:hover{color:var(--color-text-primary)}.hover\:text-content-secondary:hover{color:var(--color-text-secondary)}.hover\:text-cyan-700:hover{color:var(--color-cyan-700)}.hover\:text-cyan-800:hover{color:var(--color-cyan-800)}.hover\:text-gray-900:hover{color:var(--color-gray-900)}.hover\:text-primary:hover,.hover\:text-primary\/80:hover{color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:text-primary\/80:hover{color:color-mix(in oklab, var(--color-primary) 80%, transparent)}}.hover\:text-red-600:hover{color:var(--color-red-600)}.hover\:text-white:hover{color:var(--color-white)}.hover\:text-white\/80:hover{color:#fffc}@supports (color:color-mix(in lab, red, red)){.hover\:text-white\/80:hover{color:color-mix(in oklab, var(--color-white) 80%, transparent)}}.hover\:no-underline:hover{text-decoration-line:none}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-\[0_2px_12px_rgba\(6\,182\,212\,0\.2\)\]:hover{--tw-shadow:0 2px 12px var(--tw-shadow-color,#06b6d433);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\:shadow-lg:hover{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.hover\:shadow-accent-green\/20:hover{--tw-shadow-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.hover\:shadow-accent-green\/20:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-accent-green) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:shadow-primary\/10:hover{--tw-shadow-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:shadow-primary\/10:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-primary) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:shadow-primary\/20:hover{--tw-shadow-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.hover\:shadow-primary\/20:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-primary) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:shadow-secondary\/10:hover{--tw-shadow-color:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:shadow-secondary\/10:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-secondary) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.hover\:shadow-secondary\/20:hover{--tw-shadow-color:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.hover\:shadow-secondary\/20:hover{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-secondary) 20%, transparent) var(--tw-shadow-alpha), transparent)}}}.focus\:border-cyan-500:focus{border-color:var(--color-cyan-500)}.focus\:border-primary:focus,.focus\:border-primary\/50:focus{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.focus\:border-primary\/50:focus{border-color:color-mix(in oklab, var(--color-primary) 50%, transparent)}}.focus\:border-transparent:focus{border-color:#0000}.focus\:bg-white:focus{background-color:var(--color-white)}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-2:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.focus\:ring-accent-cyan:focus{--tw-ring-color:var(--color-accent-cyan)}.focus\:ring-cyan-500\/40:focus{--tw-ring-color:#00b7d766}@supports (color:color-mix(in lab, red, red)){.focus\:ring-cyan-500\/40:focus{--tw-ring-color:color-mix(in oklab, var(--color-cyan-500) 40%, transparent)}}.focus\:ring-primary:focus,.focus\:ring-primary\/20:focus{--tw-ring-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.focus\:ring-primary\/20:focus{--tw-ring-color:color-mix(in oklab, var(--color-primary) 20%, transparent)}}.focus\:ring-primary\/50:focus{--tw-ring-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.focus\:ring-primary\/50:focus{--tw-ring-color:color-mix(in oklab, var(--color-primary) 50%, transparent)}}.focus\:ring-offset-background:focus{--tw-ring-offset-color:var(--color-background)}.focus\:outline-hidden:focus{--tw-outline-style:none;outline-style:none}@media (forced-colors:active){.focus\:outline-hidden:focus{outline-offset:2px;outline:2px solid #0000}}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\:scale-\[0\.98\]:active{scale:.98}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:border-gray-500\/20:disabled{border-color:#6a728233}@supports (color:color-mix(in lab, red, red)){.disabled\:border-gray-500\/20:disabled{border-color:color-mix(in oklab, var(--color-gray-500) 20%, transparent)}}.disabled\:bg-amber-500\/50:disabled{background-color:#f99c0080}@supports (color:color-mix(in lab, red, red)){.disabled\:bg-amber-500\/50:disabled{background-color:color-mix(in oklab, var(--color-amber-500) 50%, transparent)}}.disabled\:bg-gray-500\/10:disabled{background-color:#6a72821a}@supports (color:color-mix(in lab, red, red)){.disabled\:bg-gray-500\/10:disabled{background-color:color-mix(in oklab, var(--color-gray-500) 10%, transparent)}}.disabled\:text-gray-400:disabled{color:var(--color-gray-400)}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media (width>=40rem){.sm\:mx-0{margin-inline:calc(var(--spacing) * 0)}.sm\:mt-2{margin-top:calc(var(--spacing) * 2)}.sm\:mt-8{margin-top:calc(var(--spacing) * 8)}.sm\:mr-6{margin-right:calc(var(--spacing) * 6)}.sm\:mb-2{margin-bottom:calc(var(--spacing) * 2)}.sm\:mb-3{margin-bottom:calc(var(--spacing) * 3)}.sm\:mb-4{margin-bottom:calc(var(--spacing) * 4)}.sm\:mb-6{margin-bottom:calc(var(--spacing) * 6)}.sm\:mb-10{margin-bottom:calc(var(--spacing) * 10)}.sm\:ml-4{margin-left:calc(var(--spacing) * 4)}.sm\:block{display:block}.sm\:flex{display:flex}.sm\:hidden{display:none}.sm\:inline{display:inline}.sm\:inline-block{display:inline-block}.sm\:table-cell{display:table-cell}.sm\:h-3{height:calc(var(--spacing) * 3)}.sm\:h-4{height:calc(var(--spacing) * 4)}.sm\:h-5{height:calc(var(--spacing) * 5)}.sm\:h-6{height:calc(var(--spacing) * 6)}.sm\:h-8{height:calc(var(--spacing) * 8)}.sm\:h-9{height:calc(var(--spacing) * 9)}.sm\:h-10{height:calc(var(--spacing) * 10)}.sm\:h-48{height:calc(var(--spacing) * 48)}.sm\:min-h-\[16rem\]{min-height:16rem}.sm\:w-3{width:calc(var(--spacing) * 3)}.sm\:w-4{width:calc(var(--spacing) * 4)}.sm\:w-5{width:calc(var(--spacing) * 5)}.sm\:w-6{width:calc(var(--spacing) * 6)}.sm\:w-8{width:calc(var(--spacing) * 8)}.sm\:w-10{width:calc(var(--spacing) * 10)}.sm\:w-24{width:calc(var(--spacing) * 24)}.sm\:w-32{width:calc(var(--spacing) * 32)}.sm\:w-48{width:calc(var(--spacing) * 48)}.sm\:w-64{width:calc(var(--spacing) * 64)}.sm\:w-auto{width:auto}.sm\:max-w-xs{max-width:var(--container-xs)}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:flex-nowrap{flex-wrap:nowrap}.sm\:items-center{align-items:center}.sm\:items-start{align-items:flex-start}.sm\:justify-between{justify-content:space-between}.sm\:gap-2{gap:calc(var(--spacing) * 2)}.sm\:gap-2\.5{gap:calc(var(--spacing) * 2.5)}.sm\:gap-3{gap:calc(var(--spacing) * 3)}.sm\:gap-4{gap:calc(var(--spacing) * 4)}.sm\:gap-6{gap:calc(var(--spacing) * 6)}:where(.sm\:space-y-5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 5) * calc(1 - var(--tw-space-y-reverse)))}:where(.sm\:space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.sm\:rounded-\[24px\]{border-radius:24px}.sm\:border{border-style:var(--tw-border-style);border-width:1px}.sm\:border-stroke-subtle{border-color:var(--color-border-subtle)}.sm\:p-1{padding:calc(var(--spacing) * 1)}.sm\:p-3\.5{padding:calc(var(--spacing) * 3.5)}.sm\:p-4{padding:calc(var(--spacing) * 4)}.sm\:p-6{padding:calc(var(--spacing) * 6)}.sm\:p-8{padding:calc(var(--spacing) * 8)}.sm\:p-10{padding:calc(var(--spacing) * 10)}.sm\:px-0{padding-inline:calc(var(--spacing) * 0)}.sm\:px-2{padding-inline:calc(var(--spacing) * 2)}.sm\:px-3{padding-inline:calc(var(--spacing) * 3)}.sm\:px-4{padding-inline:calc(var(--spacing) * 4)}.sm\:py-2{padding-block:calc(var(--spacing) * 2)}.sm\:py-3\.5{padding-block:calc(var(--spacing) * 3.5)}.sm\:py-4{padding-block:calc(var(--spacing) * 4)}.sm\:pt-4{padding-top:calc(var(--spacing) * 4)}.sm\:pt-6{padding-top:calc(var(--spacing) * 6)}.sm\:text-right{text-align:right}.sm\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.sm\:text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.sm\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.sm\:text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.sm\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.sm\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.sm\:text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.sm\:text-\[32px\]{font-size:32px}}@media (width>=48rem){.md\:block{display:block}.md\:grid{display:grid}.md\:hidden{display:none}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.md\:gap-3{gap:calc(var(--spacing) * 3)}:where(.md\:space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.md\:p-4{padding:calc(var(--spacing) * 4)}.md\:p-12{padding:calc(var(--spacing) * 12)}.md\:px-4{padding-inline:calc(var(--spacing) * 4)}.md\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}}@media (width>=64rem){.lg\:mt-3{margin-top:calc(var(--spacing) * 3)}.lg\:mt-4{margin-top:calc(var(--spacing) * 4)}.lg\:mb-4{margin-bottom:calc(var(--spacing) * 4)}.lg\:block{display:block}.lg\:flex{display:flex}.lg\:grid{display:grid}.lg\:hidden{display:none}.lg\:h-48{height:calc(var(--spacing) * 48)}.lg\:h-56{height:calc(var(--spacing) * 56)}.lg\:w-7{width:calc(var(--spacing) * 7)}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-center{align-items:center}.lg\:justify-between{justify-content:space-between}.lg\:gap-3{gap:calc(var(--spacing) * 3)}.lg\:gap-4{gap:calc(var(--spacing) * 4)}.lg\:gap-6{gap:calc(var(--spacing) * 6)}.lg\:p-6{padding:calc(var(--spacing) * 6)}.lg\:p-\[15px\]{padding:15px}.lg\:text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.lg\:text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.lg\:text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.lg\:text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.lg\:text-\[35px\]{font-size:35px}}.dark\:block:is(.dark *){display:block}.dark\:hidden:is(.dark *){display:none}:where(.dark\:divide-stroke\/10:is(.dark *)>:not(:last-child)){border-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){:where(.dark\:divide-stroke\/10:is(.dark *)>:not(:last-child)){border-color:color-mix(in oklab, var(--color-border) 10%, transparent)}}:where(.dark\:divide-white\/5:is(.dark *)>:not(:last-child)){border-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){:where(.dark\:divide-white\/5:is(.dark *)>:not(:last-child)){border-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.dark\:border:is(.dark *){border-style:var(--tw-border-style);border-width:1px}.dark\:border-accent-green\/30:is(.dark *){border-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.dark\:border-accent-green\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-accent-green) 30%, transparent)}}.dark\:border-accent-green\/40:is(.dark *){border-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.dark\:border-accent-green\/40:is(.dark *){border-color:color-mix(in oklab, var(--color-accent-green) 40%, transparent)}}.dark\:border-accent-purple\/50:is(.dark *){border-color:var(--color-accent-purple)}@supports (color:color-mix(in lab, red, red)){.dark\:border-accent-purple\/50:is(.dark *){border-color:color-mix(in oklab, var(--color-accent-purple) 50%, transparent)}}.dark\:border-accent-red\/20:is(.dark *){border-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.dark\:border-accent-red\/20:is(.dark *){border-color:color-mix(in oklab, var(--color-accent-red) 20%, transparent)}}.dark\:border-amber-400\/40:is(.dark *){border-color:#fcbb0066}@supports (color:color-mix(in lab, red, red)){.dark\:border-amber-400\/40:is(.dark *){border-color:color-mix(in oklab, var(--color-amber-400) 40%, transparent)}}.dark\:border-amber-500\/30:is(.dark *){border-color:#f99c004d}@supports (color:color-mix(in lab, red, red)){.dark\:border-amber-500\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-amber-500) 30%, transparent)}}.dark\:border-amber-700\/30:is(.dark *){border-color:#b750004d}@supports (color:color-mix(in lab, red, red)){.dark\:border-amber-700\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-amber-700) 30%, transparent)}}.dark\:border-blue-400\/50:is(.dark *){border-color:#54a2ff80}@supports (color:color-mix(in lab, red, red)){.dark\:border-blue-400\/50:is(.dark *){border-color:color-mix(in oklab, var(--color-blue-400) 50%, transparent)}}.dark\:border-blue-500\/30:is(.dark *){border-color:#3080ff4d}@supports (color:color-mix(in lab, red, red)){.dark\:border-blue-500\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-blue-500) 30%, transparent)}}.dark\:border-cyan-500\/30:is(.dark *){border-color:#00b7d74d}@supports (color:color-mix(in lab, red, red)){.dark\:border-cyan-500\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-cyan-500) 30%, transparent)}}.dark\:border-dark-border:is(.dark *),.dark\:border-dark-border\/50:is(.dark *){border-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:border-dark-border\/50:is(.dark *){border-color:color-mix(in oklab, var(--color-border) 50%, transparent)}}.dark\:border-gray-600:is(.dark *){border-color:var(--color-gray-600)}.dark\:border-green-400\/30:is(.dark *){border-color:#05df724d}@supports (color:color-mix(in lab, red, red)){.dark\:border-green-400\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-green-400) 30%, transparent)}}.dark\:border-green-500\/30:is(.dark *){border-color:#00c7584d}@supports (color:color-mix(in lab, red, red)){.dark\:border-green-500\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-green-500) 30%, transparent)}}.dark\:border-green-500\/50:is(.dark *){border-color:#00c75880}@supports (color:color-mix(in lab, red, red)){.dark\:border-green-500\/50:is(.dark *){border-color:color-mix(in oklab, var(--color-green-500) 50%, transparent)}}.dark\:border-green-700\/30:is(.dark *){border-color:#0081384d}@supports (color:color-mix(in lab, red, red)){.dark\:border-green-700\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-green-700) 30%, transparent)}}.dark\:border-orange-400\/30:is(.dark *){border-color:#ff8b1a4d}@supports (color:color-mix(in lab, red, red)){.dark\:border-orange-400\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-orange-400) 30%, transparent)}}.dark\:border-orange-400\/40:is(.dark *){border-color:#ff8b1a66}@supports (color:color-mix(in lab, red, red)){.dark\:border-orange-400\/40:is(.dark *){border-color:color-mix(in oklab, var(--color-orange-400) 40%, transparent)}}.dark\:border-orange-400\/60:is(.dark *){border-color:#ff8b1a99}@supports (color:color-mix(in lab, red, red)){.dark\:border-orange-400\/60:is(.dark *){border-color:color-mix(in oklab, var(--color-orange-400) 60%, transparent)}}.dark\:border-orange-500\/30:is(.dark *){border-color:#fe6e004d}@supports (color:color-mix(in lab, red, red)){.dark\:border-orange-500\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-orange-500) 30%, transparent)}}.dark\:border-primary:is(.dark *),.dark\:border-primary\/30:is(.dark *){border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:border-primary\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-primary) 30%, transparent)}}.dark\:border-primary\/40:is(.dark *){border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:border-primary\/40:is(.dark *){border-color:color-mix(in oklab, var(--color-primary) 40%, transparent)}}.dark\:border-primary\/50:is(.dark *){border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:border-primary\/50:is(.dark *){border-color:color-mix(in oklab, var(--color-primary) 50%, transparent)}}.dark\:border-red-400\/20:is(.dark *){border-color:#ff656833}@supports (color:color-mix(in lab, red, red)){.dark\:border-red-400\/20:is(.dark *){border-color:color-mix(in oklab, var(--color-red-400) 20%, transparent)}}.dark\:border-red-400\/30:is(.dark *){border-color:#ff65684d}@supports (color:color-mix(in lab, red, red)){.dark\:border-red-400\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-red-400) 30%, transparent)}}.dark\:border-red-400\/40:is(.dark *){border-color:#ff656866}@supports (color:color-mix(in lab, red, red)){.dark\:border-red-400\/40:is(.dark *){border-color:color-mix(in oklab, var(--color-red-400) 40%, transparent)}}.dark\:border-red-500\/30:is(.dark *){border-color:#fb2c364d}@supports (color:color-mix(in lab, red, red)){.dark\:border-red-500\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-red-500) 30%, transparent)}}.dark\:border-red-500\/50:is(.dark *){border-color:#fb2c3680}@supports (color:color-mix(in lab, red, red)){.dark\:border-red-500\/50:is(.dark *){border-color:color-mix(in oklab, var(--color-red-500) 50%, transparent)}}.dark\:border-red-700\/30:is(.dark *){border-color:#bf000f4d}@supports (color:color-mix(in lab, red, red)){.dark\:border-red-700\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-red-700) 30%, transparent)}}.dark\:border-red-700\/50:is(.dark *){border-color:#bf000f80}@supports (color:color-mix(in lab, red, red)){.dark\:border-red-700\/50:is(.dark *){border-color:color-mix(in oklab, var(--color-red-700) 50%, transparent)}}.dark\:border-stroke:is(.dark *),.dark\:border-stroke\/5:is(.dark *){border-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:border-stroke\/5:is(.dark *){border-color:color-mix(in oklab, var(--color-border) 5%, transparent)}}.dark\:border-stroke\/10:is(.dark *){border-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:border-stroke\/10:is(.dark *){border-color:color-mix(in oklab, var(--color-border) 10%, transparent)}}.dark\:border-stroke\/20:is(.dark *){border-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:border-stroke\/20:is(.dark *){border-color:color-mix(in oklab, var(--color-border) 20%, transparent)}}.dark\:border-stroke\/30:is(.dark *){border-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:border-stroke\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-border) 30%, transparent)}}.dark\:border-teal-500:is(.dark *){border-color:var(--color-teal-500)}.dark\:border-transparent:is(.dark *){border-color:#0000}.dark\:border-white\/5:is(.dark *){border-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.dark\:border-white\/5:is(.dark *){border-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.dark\:border-white\/10:is(.dark *){border-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.dark\:border-white\/10:is(.dark *){border-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.dark\:border-white\/20:is(.dark *){border-color:#fff3}@supports (color:color-mix(in lab, red, red)){.dark\:border-white\/20:is(.dark *){border-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.dark\:border-yellow-400\/30:is(.dark *){border-color:#fac8004d}@supports (color:color-mix(in lab, red, red)){.dark\:border-yellow-400\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-yellow-400) 30%, transparent)}}.dark\:border-yellow-500\/30:is(.dark *){border-color:#edb2004d}@supports (color:color-mix(in lab, red, red)){.dark\:border-yellow-500\/30:is(.dark *){border-color:color-mix(in oklab, var(--color-yellow-500) 30%, transparent)}}.dark\:border-t-amber-400:is(.dark *){border-top-color:var(--color-amber-400)}.dark\:border-t-green-400:is(.dark *){border-top-color:var(--color-green-400)}.dark\:border-t-primary:is(.dark *){border-top-color:var(--color-primary)}.dark\:border-t-purple-400:is(.dark *){border-top-color:var(--color-purple-400)}.dark\:border-t-white\/70:is(.dark *){border-top-color:#ffffffb3}@supports (color:color-mix(in lab, red, red)){.dark\:border-t-white\/70:is(.dark *){border-top-color:color-mix(in oklab, var(--color-white) 70%, transparent)}}.dark\:border-l-accent-green:is(.dark *){border-left-color:var(--color-accent-green)}.dark\:bg-\[var\(--color-surface\)\]:is(.dark *){background-color:var(--color-surface)}.dark\:bg-accent-green\/20:is(.dark *){background-color:var(--color-accent-green)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-accent-green\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-accent-green) 20%, transparent)}}.dark\:bg-accent-purple:is(.dark *),.dark\:bg-accent-purple\/20:is(.dark *){background-color:var(--color-accent-purple)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-accent-purple\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-accent-purple) 20%, transparent)}}.dark\:bg-accent-red:is(.dark *),.dark\:bg-accent-red\/10:is(.dark *){background-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-accent-red\/10:is(.dark *){background-color:color-mix(in oklab, var(--color-accent-red) 10%, transparent)}}.dark\:bg-accent-red\/20:is(.dark *){background-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-accent-red\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-accent-red) 20%, transparent)}}.dark\:bg-amber-400\/20:is(.dark *){background-color:#fcbb0033}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-400\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-amber-400) 20%, transparent)}}.dark\:bg-amber-500:is(.dark *){background-color:var(--color-amber-500)}.dark\:bg-amber-500\/10:is(.dark *){background-color:#f99c001a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-500\/10:is(.dark *){background-color:color-mix(in oklab, var(--color-amber-500) 10%, transparent)}}.dark\:bg-amber-900\/20:is(.dark *){background-color:#7b330633}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-900\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-amber-900) 20%, transparent)}}.dark\:bg-amber-900\/30:is(.dark *){background-color:#7b33064d}@supports (color:color-mix(in lab, red, red)){.dark\:bg-amber-900\/30:is(.dark *){background-color:color-mix(in oklab, var(--color-amber-900) 30%, transparent)}}.dark\:bg-background:is(.dark *){background-color:var(--color-background)}.dark\:bg-background-mute:is(.dark *){background-color:var(--color-background-mute)}.dark\:bg-background\/20:is(.dark *){background-color:var(--color-background)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-background\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-background) 20%, transparent)}}.dark\:bg-background\/30:is(.dark *){background-color:var(--color-background)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-background\/30:is(.dark *){background-color:color-mix(in oklab, var(--color-background) 30%, transparent)}}.dark\:bg-background\/50:is(.dark *){background-color:var(--color-background)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-background\/50:is(.dark *){background-color:color-mix(in oklab, var(--color-background) 50%, transparent)}}.dark\:bg-black\/20:is(.dark *){background-color:#0003}@supports (color:color-mix(in lab, red, red)){.dark\:bg-black\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-black) 20%, transparent)}}.dark\:bg-black\/30:is(.dark *){background-color:#0000004d}@supports (color:color-mix(in lab, red, red)){.dark\:bg-black\/30:is(.dark *){background-color:color-mix(in oklab, var(--color-black) 30%, transparent)}}.dark\:bg-black\/40:is(.dark *){background-color:#0006}@supports (color:color-mix(in lab, red, red)){.dark\:bg-black\/40:is(.dark *){background-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.dark\:bg-black\/60:is(.dark *){background-color:#0009}@supports (color:color-mix(in lab, red, red)){.dark\:bg-black\/60:is(.dark *){background-color:color-mix(in oklab, var(--color-black) 60%, transparent)}}.dark\:bg-blue-400\/20:is(.dark *){background-color:#54a2ff33}@supports (color:color-mix(in lab, red, red)){.dark\:bg-blue-400\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-blue-400) 20%, transparent)}}.dark\:bg-blue-500\/10:is(.dark *){background-color:#3080ff1a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-blue-500\/10:is(.dark *){background-color:color-mix(in oklab, var(--color-blue-500) 10%, transparent)}}.dark\:bg-blue-500\/20:is(.dark *){background-color:#3080ff33}@supports (color:color-mix(in lab, red, red)){.dark\:bg-blue-500\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-blue-500) 20%, transparent)}}.dark\:bg-cyan-500\/10:is(.dark *){background-color:#00b7d71a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-cyan-500\/10:is(.dark *){background-color:color-mix(in oklab, var(--color-cyan-500) 10%, transparent)}}.dark\:bg-gray-500\/20:is(.dark *){background-color:#6a728233}@supports (color:color-mix(in lab, red, red)){.dark\:bg-gray-500\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-gray-500) 20%, transparent)}}.dark\:bg-gray-600:is(.dark *){background-color:var(--color-gray-600)}.dark\:bg-gray-700:is(.dark *){background-color:var(--color-gray-700)}.dark\:bg-gray-800:is(.dark *){background-color:var(--color-gray-800)}.dark\:bg-gray-800\/50:is(.dark *){background-color:#1e293980}@supports (color:color-mix(in lab, red, red)){.dark\:bg-gray-800\/50:is(.dark *){background-color:color-mix(in oklab, var(--color-gray-800) 50%, transparent)}}.dark\:bg-green-500\/10:is(.dark *){background-color:#00c7581a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-green-500\/10:is(.dark *){background-color:color-mix(in oklab, var(--color-green-500) 10%, transparent)}}.dark\:bg-green-500\/20:is(.dark *){background-color:#00c75833}@supports (color:color-mix(in lab, red, red)){.dark\:bg-green-500\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-green-500) 20%, transparent)}}.dark\:bg-green-600\/20:is(.dark *){background-color:#00a54433}@supports (color:color-mix(in lab, red, red)){.dark\:bg-green-600\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-green-600) 20%, transparent)}}.dark\:bg-green-900\/20:is(.dark *){background-color:#0d542b33}@supports (color:color-mix(in lab, red, red)){.dark\:bg-green-900\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-green-900) 20%, transparent)}}.dark\:bg-green-900\/30:is(.dark *){background-color:#0d542b4d}@supports (color:color-mix(in lab, red, red)){.dark\:bg-green-900\/30:is(.dark *){background-color:color-mix(in oklab, var(--color-green-900) 30%, transparent)}}.dark\:bg-orange-500\/10:is(.dark *){background-color:#fe6e001a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-orange-500\/10:is(.dark *){background-color:color-mix(in oklab, var(--color-orange-500) 10%, transparent)}}.dark\:bg-orange-500\/20:is(.dark *){background-color:#fe6e0033}@supports (color:color-mix(in lab, red, red)){.dark\:bg-orange-500\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-orange-500) 20%, transparent)}}.dark\:bg-primary:is(.dark *),.dark\:bg-primary\/10:is(.dark *){background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-primary\/10:is(.dark *){background-color:color-mix(in oklab, var(--color-primary) 10%, transparent)}}.dark\:bg-primary\/20:is(.dark *){background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-primary\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-primary) 20%, transparent)}}.dark\:bg-primary\/30:is(.dark *){background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-primary\/30:is(.dark *){background-color:color-mix(in oklab, var(--color-primary) 30%, transparent)}}.dark\:bg-red-400\/10:is(.dark *){background-color:#ff65681a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-red-400\/10:is(.dark *){background-color:color-mix(in oklab, var(--color-red-400) 10%, transparent)}}.dark\:bg-red-400\/20:is(.dark *){background-color:#ff656833}@supports (color:color-mix(in lab, red, red)){.dark\:bg-red-400\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-red-400) 20%, transparent)}}.dark\:bg-red-500:is(.dark *){background-color:var(--color-red-500)}.dark\:bg-red-500\/10:is(.dark *){background-color:#fb2c361a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-red-500\/10:is(.dark *){background-color:color-mix(in oklab, var(--color-red-500) 10%, transparent)}}.dark\:bg-red-500\/20:is(.dark *){background-color:#fb2c3633}@supports (color:color-mix(in lab, red, red)){.dark\:bg-red-500\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-red-500) 20%, transparent)}}.dark\:bg-red-900\/20:is(.dark *){background-color:#82181a33}@supports (color:color-mix(in lab, red, red)){.dark\:bg-red-900\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-red-900) 20%, transparent)}}.dark\:bg-red-900\/30:is(.dark *){background-color:#82181a4d}@supports (color:color-mix(in lab, red, red)){.dark\:bg-red-900\/30:is(.dark *){background-color:color-mix(in oklab, var(--color-red-900) 30%, transparent)}}.dark\:bg-secondary:is(.dark *){background-color:var(--color-secondary)}.dark\:bg-secondary-bg\/10:is(.dark *){background-color:var(--color-secondary-bg)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-secondary-bg\/10:is(.dark *){background-color:color-mix(in oklab, var(--color-secondary-bg) 10%, transparent)}}.dark\:bg-secondary\/20:is(.dark *){background-color:var(--color-secondary)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-secondary\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-secondary) 20%, transparent)}}.dark\:bg-stroke\/5:is(.dark *){background-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-stroke\/5:is(.dark *){background-color:color-mix(in oklab, var(--color-border) 5%, transparent)}}.dark\:bg-stroke\/10:is(.dark *){background-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-stroke\/10:is(.dark *){background-color:color-mix(in oklab, var(--color-border) 10%, transparent)}}.dark\:bg-stroke\/20:is(.dark *){background-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-stroke\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-border) 20%, transparent)}}.dark\:bg-surface:is(.dark *){background-color:var(--color-surface)}.dark\:bg-surface-elevated:is(.dark *),.dark\:bg-surface-elevated\/30:is(.dark *){background-color:var(--color-surface-elevated)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-surface-elevated\/30:is(.dark *){background-color:color-mix(in oklab, var(--color-surface-elevated) 30%, transparent)}}.dark\:bg-surface-elevated\/80:is(.dark *){background-color:var(--color-surface-elevated)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-surface-elevated\/80:is(.dark *){background-color:color-mix(in oklab, var(--color-surface-elevated) 80%, transparent)}}.dark\:bg-surface\/50:is(.dark *){background-color:var(--color-surface)}@supports (color:color-mix(in lab, red, red)){.dark\:bg-surface\/50:is(.dark *){background-color:color-mix(in oklab, var(--color-surface) 50%, transparent)}}.dark\:bg-teal-500:is(.dark *){background-color:var(--color-teal-500)}.dark\:bg-teal-600:is(.dark *){background-color:var(--color-teal-600)}.dark\:bg-transparent:is(.dark *){background-color:#0000}.dark\:bg-violet-400\/20:is(.dark *){background-color:#a685ff33}@supports (color:color-mix(in lab, red, red)){.dark\:bg-violet-400\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-violet-400) 20%, transparent)}}.dark\:bg-white\/5:is(.dark *){background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.dark\:bg-white\/5:is(.dark *){background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.dark\:bg-white\/10:is(.dark *){background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-white\/10:is(.dark *){background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.dark\:bg-yellow-500\/10:is(.dark *){background-color:#edb2001a}@supports (color:color-mix(in lab, red, red)){.dark\:bg-yellow-500\/10:is(.dark *){background-color:color-mix(in oklab, var(--color-yellow-500) 10%, transparent)}}.dark\:bg-yellow-500\/20:is(.dark *){background-color:#edb20033}@supports (color:color-mix(in lab, red, red)){.dark\:bg-yellow-500\/20:is(.dark *){background-color:color-mix(in oklab, var(--color-yellow-500) 20%, transparent)}}.dark\:bg-zinc-900:is(.dark *){background-color:var(--color-zinc-900)}.dark\:from-primary\/5:is(.dark *){--tw-gradient-from:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:from-primary\/5:is(.dark *){--tw-gradient-from:color-mix(in oklab, var(--color-primary) 5%, transparent)}}.dark\:from-primary\/5:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:from-transparent:is(.dark *){--tw-gradient-from:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:from-white:is(.dark *){--tw-gradient-from:var(--color-white);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:from-white\/5:is(.dark *){--tw-gradient-from:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.dark\:from-white\/5:is(.dark *){--tw-gradient-from:color-mix(in oklab, var(--color-white) 5%, transparent)}}.dark\:from-white\/5:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:to-transparent:is(.dark *){--tw-gradient-to:transparent;--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:to-white\/10:is(.dark *){--tw-gradient-to:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.dark\:to-white\/10:is(.dark *){--tw-gradient-to:color-mix(in oklab, var(--color-white) 10%, transparent)}}.dark\:to-white\/10:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:to-white\/70:is(.dark *){--tw-gradient-to:#ffffffb3}@supports (color:color-mix(in lab, red, red)){.dark\:to-white\/70:is(.dark *){--tw-gradient-to:color-mix(in oklab, var(--color-white) 70%, transparent)}}.dark\:to-white\/70:is(.dark *){--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:text-\[\#C3C3C3\]:is(.dark *){color:#c3c3c3}.dark\:text-accent-green:is(.dark *){color:var(--color-accent-green)}.dark\:text-accent-purple:is(.dark *){color:var(--color-accent-purple)}.dark\:text-accent-red:is(.dark *),.dark\:text-accent-red\/80:is(.dark *){color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.dark\:text-accent-red\/80:is(.dark *){color:color-mix(in oklab, var(--color-accent-red) 80%, transparent)}}.dark\:text-amber-200:is(.dark *){color:var(--color-amber-200)}.dark\:text-amber-300:is(.dark *){color:var(--color-amber-300)}.dark\:text-amber-300\/80:is(.dark *){color:#ffd236cc}@supports (color:color-mix(in lab, red, red)){.dark\:text-amber-300\/80:is(.dark *){color:color-mix(in oklab, var(--color-amber-300) 80%, transparent)}}.dark\:text-amber-400:is(.dark *){color:var(--color-amber-400)}.dark\:text-amber-400\/80:is(.dark *){color:#fcbb00cc}@supports (color:color-mix(in lab, red, red)){.dark\:text-amber-400\/80:is(.dark *){color:color-mix(in oklab, var(--color-amber-400) 80%, transparent)}}.dark\:text-amber-500:is(.dark *){color:var(--color-amber-500)}.dark\:text-background:is(.dark *){color:var(--color-background)}.dark\:text-blue-200:is(.dark *){color:var(--color-blue-200)}.dark\:text-blue-300:is(.dark *){color:var(--color-blue-300)}.dark\:text-blue-400:is(.dark *){color:var(--color-blue-400)}.dark\:text-blue-500:is(.dark *){color:var(--color-blue-500)}.dark\:text-content:is(.dark *){color:var(--color-text)}.dark\:text-content-muted:is(.dark *),.dark\:text-content-muted\/40:is(.dark *){color:var(--color-text-muted)}@supports (color:color-mix(in lab, red, red)){.dark\:text-content-muted\/40:is(.dark *){color:color-mix(in oklab, var(--color-text-muted) 40%, transparent)}}.dark\:text-content-muted\/50:is(.dark *){color:var(--color-text-muted)}@supports (color:color-mix(in lab, red, red)){.dark\:text-content-muted\/50:is(.dark *){color:color-mix(in oklab, var(--color-text-muted) 50%, transparent)}}.dark\:text-content-muted\/60:is(.dark *){color:var(--color-text-muted)}@supports (color:color-mix(in lab, red, red)){.dark\:text-content-muted\/60:is(.dark *){color:color-mix(in oklab, var(--color-text-muted) 60%, transparent)}}.dark\:text-content-muted\/70:is(.dark *){color:var(--color-text-muted)}@supports (color:color-mix(in lab, red, red)){.dark\:text-content-muted\/70:is(.dark *){color:color-mix(in oklab, var(--color-text-muted) 70%, transparent)}}.dark\:text-content-muted\/80:is(.dark *){color:var(--color-text-muted)}@supports (color:color-mix(in lab, red, red)){.dark\:text-content-muted\/80:is(.dark *){color:color-mix(in oklab, var(--color-text-muted) 80%, transparent)}}.dark\:text-content-primary:is(.dark *),.dark\:text-content-primary\/70:is(.dark *){color:var(--color-text-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:text-content-primary\/70:is(.dark *){color:color-mix(in oklab, var(--color-text-primary) 70%, transparent)}}.dark\:text-content-primary\/80:is(.dark *){color:var(--color-text-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:text-content-primary\/80:is(.dark *){color:color-mix(in oklab, var(--color-text-primary) 80%, transparent)}}.dark\:text-content-primary\/90:is(.dark *){color:var(--color-text-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:text-content-primary\/90:is(.dark *){color:color-mix(in oklab, var(--color-text-primary) 90%, transparent)}}.dark\:text-content-secondary:is(.dark *){color:var(--color-text-secondary)}.dark\:text-cyan-300:is(.dark *){color:var(--color-cyan-300)}.dark\:text-cyan-400:is(.dark *){color:var(--color-cyan-400)}.dark\:text-cyan-400\/60:is(.dark *){color:#00d2ef99}@supports (color:color-mix(in lab, red, red)){.dark\:text-cyan-400\/60:is(.dark *){color:color-mix(in oklab, var(--color-cyan-400) 60%, transparent)}}.dark\:text-emerald-400:is(.dark *){color:var(--color-emerald-400)}.dark\:text-gray-300:is(.dark *){color:var(--color-gray-300)}.dark\:text-gray-400:is(.dark *){color:var(--color-gray-400)}.dark\:text-gray-500:is(.dark *){color:var(--color-gray-500)}.dark\:text-green-300:is(.dark *){color:var(--color-green-300)}.dark\:text-green-400:is(.dark *){color:var(--color-green-400)}.dark\:text-green-500:is(.dark *){color:var(--color-green-500)}.dark\:text-orange-400:is(.dark *){color:var(--color-orange-400)}.dark\:text-orange-400\/60:is(.dark *){color:#ff8b1a99}@supports (color:color-mix(in lab, red, red)){.dark\:text-orange-400\/60:is(.dark *){color:color-mix(in oklab, var(--color-orange-400) 60%, transparent)}}.dark\:text-primary:is(.dark *),.dark\:text-primary\/80:is(.dark *){color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:text-primary\/80:is(.dark *){color:color-mix(in oklab, var(--color-primary) 80%, transparent)}}.dark\:text-purple-400:is(.dark *){color:var(--color-purple-400)}.dark\:text-red-200:is(.dark *){color:var(--color-red-200)}.dark\:text-red-400:is(.dark *){color:var(--color-red-400)}.dark\:text-red-400\/80:is(.dark *){color:#ff6568cc}@supports (color:color-mix(in lab, red, red)){.dark\:text-red-400\/80:is(.dark *){color:color-mix(in oklab, var(--color-red-400) 80%, transparent)}}.dark\:text-red-500:is(.dark *){color:var(--color-red-500)}.dark\:text-secondary:is(.dark *){color:var(--color-secondary)}.dark\:text-violet-300:is(.dark *){color:var(--color-violet-300)}.dark\:text-white:is(.dark *){color:var(--color-white)}.dark\:text-white\/60:is(.dark *){color:#fff9}@supports (color:color-mix(in lab, red, red)){.dark\:text-white\/60:is(.dark *){color:color-mix(in oklab, var(--color-white) 60%, transparent)}}.dark\:text-yellow-200:is(.dark *){color:var(--color-yellow-200)}.dark\:text-yellow-300:is(.dark *){color:var(--color-yellow-300)}.dark\:text-yellow-400:is(.dark *){color:var(--color-yellow-400)}.dark\:text-yellow-500:is(.dark *){color:var(--color-yellow-500)}.dark\:decoration-white\/30:is(.dark *){text-decoration-color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.dark\:decoration-white\/30:is(.dark *){-webkit-text-decoration-color:color-mix(in oklab, var(--color-white) 30%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-white) 30%, transparent);-webkit-text-decoration-color:color-mix(in oklab, var(--color-white) 30%, transparent);text-decoration-color:color-mix(in oklab, var(--color-white) 30%, transparent)}}.dark\:placeholder-content-muted\/50:is(.dark *)::placeholder{color:var(--color-text-muted)}@supports (color:color-mix(in lab, red, red)){.dark\:placeholder-content-muted\/50:is(.dark *)::placeholder{color:color-mix(in oklab, var(--color-text-muted) 50%, transparent)}}.dark\:placeholder-white\/30:is(.dark *)::placeholder{color:#ffffff4d}@supports (color:color-mix(in lab, red, red)){.dark\:placeholder-white\/30:is(.dark *)::placeholder{color:color-mix(in oklab, var(--color-white) 30%, transparent)}}.dark\:placeholder-white\/40:is(.dark *)::placeholder{color:#fff6}@supports (color:color-mix(in lab, red, red)){.dark\:placeholder-white\/40:is(.dark *)::placeholder{color:color-mix(in oklab, var(--color-white) 40%, transparent)}}.dark\:placeholder-white\/50:is(.dark *)::placeholder{color:#ffffff80}@supports (color:color-mix(in lab, red, red)){.dark\:placeholder-white\/50:is(.dark *)::placeholder{color:color-mix(in oklab, var(--color-white) 50%, transparent)}}.dark\:mix-blend-screen:is(.dark *){mix-blend-mode:screen}.dark\:shadow-\[0_4px_12px_rgba\(170\,232\,232\,0\.25\)\]:is(.dark *){--tw-shadow:0 4px 12px var(--tw-shadow-color,#aae8e840);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.dark\:shadow-\[0_8px_32px_0_rgba\(0\,0\,0\,0\.37\)\]:is(.dark *){--tw-shadow:0 8px 32px 0 var(--tw-shadow-color,#0000005e);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.dark\:shadow-none:is(.dark *){--tw-shadow:0 0 #0000;box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.dark\:ring-primary\/50:is(.dark *){--tw-ring-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:ring-primary\/50:is(.dark *){--tw-ring-color:color-mix(in oklab, var(--color-primary) 50%, transparent)}}.dark\:brightness-100:is(.dark *){--tw-brightness:brightness(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.dark\:drop-shadow-\[0_0_6px_rgba\(59\,130\,246\,0\.8\)\]:is(.dark *){--tw-drop-shadow-size:drop-shadow(0 0 6px var(--tw-drop-shadow-color,#3b82f6cc));--tw-drop-shadow:var(--tw-drop-shadow-size);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.dark\:invert-0:is(.dark *){--tw-invert:invert(0%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}@media (hover:hover){.dark\:group-hover\:border-stroke\/50:is(.dark *):is(:where(.group):hover *){border-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:group-hover\:border-stroke\/50:is(.dark *):is(:where(.group):hover *){border-color:color-mix(in oklab, var(--color-border) 50%, transparent)}}.dark\:group-hover\:bg-stroke\/20:is(.dark *):is(:where(.group):hover *){background-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:group-hover\:bg-stroke\/20:is(.dark *):is(:where(.group):hover *){background-color:color-mix(in oklab, var(--color-border) 20%, transparent)}}.dark\:group-hover\:text-primary:is(.dark *):is(:where(.group):hover *){color:var(--color-primary)}.dark\:group-hover\:text-white:is(.dark *):is(:where(.group):hover *){color:var(--color-white)}.dark\:hover\:border-primary\/20:is(.dark *):hover{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:border-primary\/20:is(.dark *):hover{border-color:color-mix(in oklab, var(--color-primary) 20%, transparent)}}.dark\:hover\:border-primary\/30:is(.dark *):hover{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:border-primary\/30:is(.dark *):hover{border-color:color-mix(in oklab, var(--color-primary) 30%, transparent)}}.dark\:hover\:border-primary\/40:is(.dark *):hover{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:border-primary\/40:is(.dark *):hover{border-color:color-mix(in oklab, var(--color-primary) 40%, transparent)}}.dark\:hover\:border-primary\/50:is(.dark *):hover{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:border-primary\/50:is(.dark *):hover{border-color:color-mix(in oklab, var(--color-primary) 50%, transparent)}}.dark\:hover\:border-stroke:is(.dark *):hover,.dark\:hover\:border-stroke\/20:is(.dark *):hover{border-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:border-stroke\/20:is(.dark *):hover{border-color:color-mix(in oklab, var(--color-border) 20%, transparent)}}.dark\:hover\:border-stroke\/30:is(.dark *):hover{border-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:border-stroke\/30:is(.dark *):hover{border-color:color-mix(in oklab, var(--color-border) 30%, transparent)}}.dark\:hover\:bg-accent-purple\/30:is(.dark *):hover{background-color:var(--color-accent-purple)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-accent-purple\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-accent-purple) 30%, transparent)}}.dark\:hover\:bg-accent-red\/30:is(.dark *):hover{background-color:var(--color-accent-red)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-accent-red\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-accent-red) 30%, transparent)}}.dark\:hover\:bg-amber-400\/30:is(.dark *):hover{background-color:#fcbb004d}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-amber-400\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-amber-400) 30%, transparent)}}.dark\:hover\:bg-amber-600:is(.dark *):hover{background-color:var(--color-amber-600)}.dark\:hover\:bg-background-mute:is(.dark *):hover{background-color:var(--color-background-mute)}.dark\:hover\:bg-background\/30:is(.dark *):hover{background-color:var(--color-background)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-background\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-background) 30%, transparent)}}.dark\:hover\:bg-blue-500\/30:is(.dark *):hover{background-color:#3080ff4d}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-blue-500\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-blue-500) 30%, transparent)}}.dark\:hover\:bg-gray-600:is(.dark *):hover{background-color:var(--color-gray-600)}.dark\:hover\:bg-primary\/5:is(.dark *):hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-primary\/5:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-primary) 5%, transparent)}}.dark\:hover\:bg-primary\/10:is(.dark *):hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-primary\/10:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-primary) 10%, transparent)}}.dark\:hover\:bg-primary\/20:is(.dark *):hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-primary\/20:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-primary) 20%, transparent)}}.dark\:hover\:bg-primary\/30:is(.dark *):hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-primary\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-primary) 30%, transparent)}}.dark\:hover\:bg-primary\/80:is(.dark *):hover{background-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-primary\/80:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-primary) 80%, transparent)}}.dark\:hover\:bg-red-400\/20:is(.dark *):hover{background-color:#ff656833}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-red-400\/20:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-red-400) 20%, transparent)}}.dark\:hover\:bg-red-400\/30:is(.dark *):hover{background-color:#ff65684d}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-red-400\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-red-400) 30%, transparent)}}.dark\:hover\:bg-red-600:is(.dark *):hover{background-color:var(--color-red-600)}.dark\:hover\:bg-red-900\/20:is(.dark *):hover{background-color:#82181a33}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-red-900\/20:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-red-900) 20%, transparent)}}.dark\:hover\:bg-stroke\/5:is(.dark *):hover{background-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-stroke\/5:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-border) 5%, transparent)}}.dark\:hover\:bg-stroke\/10:is(.dark *):hover{background-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-stroke\/10:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-border) 10%, transparent)}}.dark\:hover\:bg-stroke\/30:is(.dark *):hover{background-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-stroke\/30:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-border) 30%, transparent)}}.dark\:hover\:bg-surface\/50:is(.dark *):hover{background-color:var(--color-surface)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-surface\/50:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-surface) 50%, transparent)}}.dark\:hover\:bg-teal-700:is(.dark *):hover{background-color:var(--color-teal-700)}.dark\:hover\:bg-white\/5:is(.dark *):hover{background-color:#ffffff0d}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-white\/5:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-white) 5%, transparent)}}.dark\:hover\:bg-white\/10:is(.dark *):hover{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-white\/10:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.dark\:hover\:bg-white\/20:is(.dark *):hover{background-color:#fff3}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-white\/20:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-white) 20%, transparent)}}.dark\:hover\:bg-yellow-500\/20:is(.dark *):hover{background-color:#edb20033}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:bg-yellow-500\/20:is(.dark *):hover{background-color:color-mix(in oklab, var(--color-yellow-500) 20%, transparent)}}.dark\:hover\:from-white\/10:is(.dark *):hover{--tw-gradient-from:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:from-white\/10:is(.dark *):hover{--tw-gradient-from:color-mix(in oklab, var(--color-white) 10%, transparent)}}.dark\:hover\:from-white\/10:is(.dark *):hover{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:hover\:to-white\/15:is(.dark *):hover{--tw-gradient-to:#ffffff26}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:to-white\/15:is(.dark *):hover{--tw-gradient-to:color-mix(in oklab, var(--color-white) 15%, transparent)}}.dark\:hover\:to-white\/15:is(.dark *):hover{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.dark\:hover\:text-content-muted:is(.dark *):hover{color:var(--color-text-muted)}.dark\:hover\:text-content-primary:is(.dark *):hover,.dark\:hover\:text-content-primary\/80:is(.dark *):hover{color:var(--color-text-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:hover\:text-content-primary\/80:is(.dark *):hover{color:color-mix(in oklab, var(--color-text-primary) 80%, transparent)}}.dark\:hover\:text-content-secondary:is(.dark *):hover{color:var(--color-text-secondary)}.dark\:hover\:text-primary:is(.dark *):hover{color:var(--color-primary)}.dark\:hover\:text-red-400:is(.dark *):hover{color:var(--color-red-400)}.dark\:hover\:text-white:is(.dark *):hover{color:var(--color-white)}.dark\:hover\:shadow-\[0_2px_8px_rgba\(170\,232\,212\,0\.15\)\]:is(.dark *):hover{--tw-shadow:0 2px 8px var(--tw-shadow-color,#aae8d426);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.dark\:hover\:shadow-\[0_2px_8px_rgba\(170\,232\,232\,0\.15\)\]:is(.dark *):hover{--tw-shadow:0 2px 8px var(--tw-shadow-color,#aae8e826);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}}.dark\:focus\:border-accent-purple\/50:is(.dark *):focus{border-color:var(--color-accent-purple)}@supports (color:color-mix(in lab, red, red)){.dark\:focus\:border-accent-purple\/50:is(.dark *):focus{border-color:color-mix(in oklab, var(--color-accent-purple) 50%, transparent)}}.dark\:focus\:border-primary\/50:is(.dark *):focus{border-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:focus\:border-primary\/50:is(.dark *):focus{border-color:color-mix(in oklab, var(--color-primary) 50%, transparent)}}.dark\:focus\:bg-white\/10:is(.dark *):focus{background-color:#ffffff1a}@supports (color:color-mix(in lab, red, red)){.dark\:focus\:bg-white\/10:is(.dark *):focus{background-color:color-mix(in oklab, var(--color-white) 10%, transparent)}}.dark\:focus\:ring-primary\/40:is(.dark *):focus{--tw-ring-color:var(--color-primary)}@supports (color:color-mix(in lab, red, red)){.dark\:focus\:ring-primary\/40:is(.dark *):focus{--tw-ring-color:color-mix(in oklab, var(--color-primary) 40%, transparent)}}@media (width>=40rem){.dark\:sm\:border-stroke\/20:is(.dark *){border-color:var(--color-border)}@supports (color:color-mix(in lab, red, red)){.dark\:sm\:border-stroke\/20:is(.dark *){border-color:color-mix(in oklab, var(--color-border) 20%, transparent)}}}.\[\&_path\]\:fill-current path{fill:currentColor}:root{--vt-c-white:#fff;--vt-c-white-soft:#f8f8f8;--vt-c-white-mute:#f2f2f2;--vt-c-black:#181818;--vt-c-black-soft:#222;--vt-c-black-mute:#282828;--vt-c-indigo:#2c3e50;--vt-c-divider-light-1:#3c3c3c4a;--vt-c-divider-light-2:#3c3c3c1f;--vt-c-divider-dark-1:#545454a6;--vt-c-divider-dark-2:#5454547a;--vt-c-text-light-1:var(--vt-c-indigo);--vt-c-text-light-2:#3c3c3ca8;--vt-c-text-dark-1:var(--vt-c-white);--vt-c-text-dark-2:#ebebeba3;--color-surface:#fff;--color-surface-elevated:#fff;--color-background:#f5f7fa;--color-background-soft:#f8f8f8;--color-background-mute:#ebeef2;--color-text-primary:#111827;--color-text-secondary:#374151;--color-text-muted:#6b7280;--color-heading:#030712;--color-text:#374151;--color-border:#9ca3af;--color-border-subtle:#d1d5db;--color-border-hover:#6b7280;--color-primary:#0d7377;--color-secondary:#92610a;--color-accent-green:#15803d;--color-accent-purple:#7c3aed;--color-accent-red:#dc2626;--color-accent-cyan:#0e7490;--section-gap:160px;--color-primary-bg:#aae8e8;--color-secondary-bg:#ffc246;--color-accent-green-bg:#a5e5b6;--color-accent-purple-bg:#eba0fc;--color-accent-red-bg:#fb787b;--color-accent-cyan-bg:#d1e6e4;--color-badge-cyan-bg:#d1e6e4;--color-badge-cyan-text:#0d7377;--color-badge-neutral-bg:#e5e7eb;--color-badge-neutral-text:#374151;--color-glass-bg:#ffffffbf;--color-glass-border:#0000000f;--color-glass-shadow:0 4px 16px #0000000a, 0 1px 3px #00000005;--color-glass-green-bg:linear-gradient(91deg, #a5e5b659 1.17%, #a5e5b626 99.82%);--color-glass-green-border:#a5e5b64d;--color-glass-green-shadow:0 4px 12px #a5e5b626;--color-glass-orange-bg:linear-gradient(91deg, #f59e0b40 1.17%, #f59e0b1f 99.82%);--color-glass-orange-border:#f59e0b40;--color-glass-orange-shadow:0 4px 12px #f59e0b26}.dark{--color-surface:#0f1112;--color-surface-elevated:#1a1e1f;--color-background:#09090b;--color-background-soft:#111314;--color-background-mute:#1a1e1f;--color-text-primary:#f9fafb;--color-text-secondary:#d1d5db;--color-text-muted:#9ca3af;--color-heading:#fff;--color-text:#adadad;--color-border:#4b4b4b;--color-border-subtle:#374151;--color-border-hover:#6b7280;--color-primary:#aae8e8;--color-secondary:#ffc246;--color-accent-green:#a5e5b6;--color-accent-purple:#eba0fc;--color-accent-red:#fb787b;--color-accent-cyan:#d1e6e4;--color-primary-bg:#0d7377;--color-secondary-bg:#92610a;--color-accent-green-bg:#15803d;--color-accent-purple-bg:#7c3aed;--color-accent-red-bg:#dc2626;--color-accent-cyan-bg:#0e7490;--color-badge-cyan-bg:#223231;--color-badge-cyan-text:#d1e6e4;--color-badge-neutral-bg:#374151;--color-badge-neutral-text:#d1d5db;--color-glass-bg:#0006;--color-glass-border:#ffffff0d;--color-glass-shadow:0 4px 16px #0003;--color-glass-green-bg:linear-gradient(91deg, #15803d40 1.17%, #15803d1a 99.82%);--color-glass-green-border:#a5e5b626;--color-glass-green-shadow:0 4px 12px #0003;--color-glass-orange-bg:linear-gradient(91deg, #f59e0b40 1.17%, #f59e0b1f 99.82%);--color-glass-orange-border:#f59e0b26;--color-glass-orange-shadow:0 4px 12px #0003}*,:before,:after{box-sizing:border-box;margin:0;font-weight:400}body{min-height:100vh;color:var(--color-text);background:var(--color-background);text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;font-size:15px;line-height:1.6;transition:color .5s,background-color .5s}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}}@keyframes sparkline-draw-92b94522{0%{stroke-dasharray:1000;stroke-dashoffset:1000px}to{stroke-dasharray:1000;stroke-dashoffset:0}}.sparkline-animate[data-v-92b94522]{animation:1s ease-out sparkline-draw-92b94522}.glass-card[data-v-2c9f179a]{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);background:#000000b3;border:1px solid #ffffff1a}@keyframes ping-2c9f179a{75%,to{opacity:0;transform:scale(2)}}@keyframes ping-fast-2c9f179a{0%{opacity:1;transform:scale(1)}75%,to{opacity:0;transform:scale(4)}}.animate-ping[data-v-2c9f179a]{animation:cubic-bezier(0,0,.2,1) infinite ping-2c9f179a}.animate-ping-fast[data-v-2c9f179a]{animation:.8s cubic-bezier(0,0,.2,1) 3 ping-fast-2c9f179a}body{color:#1f2937;background-color:#f9fafb;margin:0;padding:0;transition:background-color .3s,color .3s}.dark body{color:#fff;background-color:#09090b}.dark html{scrollbar-width:thin;scrollbar-color:#374151 #1f2937}.dark html::-webkit-scrollbar{width:8px}.dark html::-webkit-scrollbar-track{background:#1f2937}.dark html::-webkit-scrollbar-thumb{background-color:#374151;border-radius:4px}.dark html::-webkit-scrollbar-thumb:hover{background-color:#4b5563}html{scrollbar-width:thin;scrollbar-color:#d1d5db #f3f4f6}html::-webkit-scrollbar{width:8px}html::-webkit-scrollbar-track{background:#f3f4f6}html::-webkit-scrollbar-thumb{background-color:#d1d5db;border-radius:4px}html::-webkit-scrollbar-thumb:hover{background-color:#9ca3af}.scrollbar-hide{-ms-overflow-style:none;scrollbar-width:none}.scrollbar-hide::-webkit-scrollbar{display:none} diff --git a/repeater/web/html/assets/index-CPWfwDmA.js b/repeater/web/html/assets/index-CPWfwDmA.js new file mode 100644 index 0000000..77a96e4 --- /dev/null +++ b/repeater/web/html/assets/index-CPWfwDmA.js @@ -0,0 +1,3 @@ +import{$ as e,C as t,D as n,E as r,G as i,J as a,K as o,O as s,Q as c,S as l,W as u,X as d,Y as f,Z as p,_ as m,a as h,at as g,b as _,c as v,ct as y,d as b,dt as x,et as S,f as C,ft as w,g as T,h as E,i as D,it as O,j as ee,k as te,l as k,lt as A,m as j,n as M,nt as N,o as P,ot as F,p as I,q as ne,r as L,rt as R,s as z,st as B,t as V,tt as re,u as H,ut as ie,w as U,x as ae,z as W}from"./runtime-core.esm-bundler-IofF4kUm.js";import{n as G,t as K}from"./pinia-BrpcNUEi.js";import{i as oe,r as se}from"./vue-router-BsDVl_JC.js";import{a as q,c as J,i as ce,l as le,o as ue,r as de,s as fe,t as Y}from"./api-CrUX-ZnK.js";import{t as pe}from"./system-CCY_Ibb-.js";import{t as X}from"./packets-BxrAyCoo.js";import{t as Z}from"./_plugin-vue_export-helper-V-yks4gF.js";import{t as me}from"./useTheme-Dlt6-wEf.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var he=void 0,ge=typeof window<`u`&&window.trustedTypes;if(ge)try{he=ge.createPolicy(`vue`,{createHTML:e=>e})}catch{}var _e=he?e=>he.createHTML(e):e=>e,ve=`http://www.w3.org/2000/svg`,ye=`http://www.w3.org/1998/Math/MathML`,be=typeof document<`u`?document:null,xe=be&&be.createElement(`template`),Se={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?be.createElementNS(ve,e):t===`mathml`?be.createElementNS(ye,e):n?be.createElement(e,{is:n}):be.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>be.createTextNode(e),createComment:e=>be.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>be.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{xe.innerHTML=_e(r===`svg`?`${e}`:r===`mathml`?`${e}`:e);let i=xe.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ce=`transition`,we=`animation`,Te=Symbol(`_vtc`),Ee={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},De=ne({},M,Ee),Oe=(e=>(e.displayName=`Transition`,e.props=De,e))((e,{slots:t})=>m(V,je(e),t)),ke=(e,t=[])=>{p(e)?e.forEach(e=>e(...t)):e&&e(...t)},Ae=e=>e?p(e)?e.some(e=>e.length>1):e.length>1:!1;function je(e){let t={};for(let n in e)n in Ee||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:c=a,appearActiveClass:l=o,appearToClass:u=s,leaveFromClass:d=`${n}-leave-from`,leaveActiveClass:f=`${n}-leave-active`,leaveToClass:p=`${n}-leave-to`}=e,m=Me(i),h=m&&m[0],g=m&&m[1],{onBeforeEnter:_,onEnter:v,onEnterCancelled:y,onLeave:b,onLeaveCancelled:x,onBeforeAppear:S=_,onAppear:C=v,onAppearCancelled:w=y}=t,T=(e,t,n,r)=>{e._enterCancelled=r,Pe(e,t?u:s),Pe(e,t?l:o),n&&n()},E=(e,t)=>{e._isLeaving=!1,Pe(e,d),Pe(e,p),Pe(e,f),t&&t()},D=e=>(t,n)=>{let i=e?C:v,o=()=>T(t,e,n);ke(i,[t,o]),Fe(()=>{Pe(t,e?c:a),Q(t,e?u:s),Ae(i)||Le(t,r,h,o)})};return ne(t,{onBeforeEnter(e){ke(_,[e]),Q(e,a),Q(e,o)},onBeforeAppear(e){ke(S,[e]),Q(e,c),Q(e,l)},onEnter:D(!1),onAppear:D(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>E(e,t);Q(e,d),e._enterCancelled?(Q(e,f),Ve(e)):(Ve(e),Q(e,f)),Fe(()=>{e._isLeaving&&(Pe(e,d),Q(e,p),Ae(b)||Le(e,r,g,n))}),ke(b,[e,n])},onEnterCancelled(e){T(e,!1,void 0,!0),ke(y,[e])},onAppearCancelled(e){T(e,!0,void 0,!0),ke(w,[e])},onLeaveCancelled(e){E(e),ke(x,[e])}})}function Me(e){if(e==null)return null;if(S(e))return[Ne(e.enter),Ne(e.leave)];{let t=Ne(e);return[t,t]}}function Ne(e){return w(e)}function Q(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[Te]||(e[Te]=new Set)).add(t)}function Pe(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[Te];n&&(n.delete(t),n.size||(e[Te]=void 0))}function Fe(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Ie=0;function Le(e,t,n,r){let i=e._endId=++Ie,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Re(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u(n[e]||``).split(`, `),i=r(`${Ce}Delay`),a=r(`${Ce}Duration`),o=ze(i,a),s=r(`${we}Delay`),c=r(`${we}Duration`),l=ze(s,c),u=null,d=0,f=0;t===Ce?o>0&&(u=Ce,d=o,f=a.length):t===we?l>0&&(u=we,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?Ce:we:null,f=u?u===Ce?a.length:c.length:0);let p=u===Ce&&/\b(?:transform|all)(?:,|$)/.test(r(`${Ce}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function ze(e,t){for(;e.lengthBe(t)+Be(e[n])))}function Be(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function Ve(e){return(e?e.ownerDocument:document).body.offsetHeight}function He(e,t,n){let r=e[Te];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Ue=Symbol(`_vod`),We=Symbol(`_vsh`),Ge={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Ue]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Ke(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Ke(e,!0),r.enter(e)):r.leave(e,()=>{Ke(e,!1)}):Ke(e,t))},beforeUnmount(e,{value:t}){Ke(e,t)}};function Ke(e,t){e.style.display=t?e[Ue]:`none`,e[We]=!t}var qe=Symbol(``),Je=/(?:^|;)\s*display\s*:/;function Ye(e,t,n){let r=e.style,i=O(n),a=!1;if(n&&!i){if(t)if(O(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Ze(r,t,``)}else for(let e in t)n[e]??Ze(r,e,``);for(let e in n)e===`display`&&(a=!0),Ze(r,e,n[e])}else if(i){if(t!==n){let e=r[qe];e&&(n+=`;`+e),r.cssText=n,a=Je.test(n)}}else t&&e.removeAttribute(`style`);Ue in e&&(e[Ue]=a?r.display:``,e[We]&&(r.display=`none`))}var Xe=/\s*!important$/;function Ze(e,t,n){if(p(n))n.forEach(n=>Ze(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=et(e,t);Xe.test(n)?e.setProperty(a(r),n.replace(Xe,``),`important`):e[r]=n}}var Qe=[`Webkit`,`Moz`,`ms`],$e={};function et(e,t){let n=$e[t];if(n)return n;let r=i(t);if(r!==`filter`&&r in e)return $e[t]=r;r=o(r);for(let n=0;nut||=(dt.then(()=>ut=0),Date.now());function pt(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;h(mt(e,n.value),t,5,[e])};return n.value=e,n.attached=ft(),n}function mt(e,t){if(p(t)){let n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(e=>t=>!t._stopped&&e&&e(t))}else return t}var ht=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,gt=(t,n,r,a,o,s)=>{let c=o===`svg`;n===`class`?He(t,a,c):n===`style`?Ye(t,r,a):re(n)?e(n)||st(t,n,r,a,s):(n[0]===`.`?(n=n.slice(1),!0):n[0]===`^`?(n=n.slice(1),!1):_t(t,n,a,c))?(rt(t,n,a),!t.tagName.includes(`-`)&&(n===`value`||n===`checked`||n===`selected`)&&nt(t,n,a,c,s,n!==`value`)):t._isVueCE&&(vt(t,n)||t._def.__asyncLoader&&(/[A-Z]/.test(n)||!O(a)))?rt(t,i(n),a,s,n):(n===`true-value`?t._trueValue=a:n===`false-value`&&(t._falseValue=a),nt(t,n,a,c))};function _t(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&ht(t)&&c(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return ht(t)&&O(n)?!1:t in e}function vt(e,t){let n=e._def.props;if(!n)return!1;let r=i(t);return Array.isArray(n)?n.some(e=>i(e)===r):Object.keys(n).some(e=>i(e)===r)}var yt=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return p(t)?e=>d(t,e):t};function bt(e){e.target.composing=!0}function xt(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var $=Symbol(`_assign`);function St(e,t,n){return t&&(e=e.trim()),n&&(e=y(e)),e}var Ct={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[$]=yt(i);let a=r||i.props&&i.props.type===`number`;it(e,t?`change`:`input`,t=>{t.target.composing||e[$](St(e.value,n,a))}),(n||a)&&it(e,`change`,()=>{e.value=St(e.value,n,a)}),t||(it(e,`compositionstart`,bt),it(e,`compositionend`,xt),it(e,`change`,xt))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[$]=yt(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?y(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},wt={deep:!0,created(e,t,n){e[$]=yt(n),it(e,`change`,()=>{let t=e._modelValue,n=kt(e),r=e.checked,i=e[$];if(p(t)){let e=B(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(N(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(At(e,r))})},mounted:Tt,beforeUpdate(e,t,n){e[$]=yt(n),Tt(e,t,n)}};function Tt(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(p(t))i=B(t,r.props.value)>-1;else if(N(t))i=t.has(r.props.value);else{if(t===n)return;i=F(t,At(e,!0))}e.checked!==i&&(e.checked=i)}var Et={created(e,{value:t},n){e.checked=F(t,n.props.value),e[$]=yt(n),it(e,`change`,()=>{e[$](kt(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[$]=yt(r),t!==n&&(e.checked=F(t,r.props.value))}},Dt={deep:!0,created(e,{value:t,modifiers:{number:n}},r){let i=N(t);it(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?y(kt(e)):kt(e));e[$](e.multiple?i?new Set(t):t:t[0]),e._assigning=!0,_(()=>{e._assigning=!1})}),e[$]=yt(r)},mounted(e,{value:t}){Ot(e,t)},beforeUpdate(e,t,n){e[$]=yt(n)},updated(e,{value:t}){e._assigning||Ot(e,t)}};function Ot(e,t){let n=e.multiple,r=p(t);if(!(n&&!r&&!N(t))){for(let i=0,a=e.options.length;iString(e)===String(o)):a.selected=B(t,o)>-1}else a.selected=t.has(o);else if(F(kt(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function kt(e){return`_value`in e?e._value:e.value}function At(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var jt=[`ctrl`,`shift`,`alt`,`meta`],Mt={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>jt.some(n=>e[`${n}Key`]&&!t.includes(n))},Nt=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=a(n.key);if(t.some(e=>e===r||Pt[e]===r))return e(n)}))},It=ne({patchProp:gt},Se),Lt;function Rt(){return Lt||=b(It)}var zt=((...e)=>{let t=Rt().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Vt(e);if(!r)return;let i=t._component;!c(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,Bt(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function Bt(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Vt(e){return O(e)?document.querySelector(e):e}var Ht=`/assets/meshcore-DQNtEl5I.svg`,Ut=G(`websocket`,()=>{let e=W(null),t=W(!1),n=W(0),r=W(null),i=W(Date.now()),a=X(),o=pe();function s(){if(e.value){if(e.value.readyState===WebSocket.OPEN){console.log(`[WebSocket] Already connected, skipping connect()`);return}else if(e.value.readyState===WebSocket.CONNECTING){console.log(`[WebSocket] Already connecting, skipping connect()`);return}}let l,u=fe(),d=ue(),f=new URLSearchParams;u&&f.set(`token`,u),d&&f.set(`client_id`,d),l=`${window.location.protocol===`https:`?`wss:`:`ws:`}//${``?.trim()?new URL(``).host:window.location.host}/ws/packets?${f.toString()}`,console.log(`[WebSocket] Creating new connection...`),e.value=new WebSocket(l),e.value.onopen=()=>{console.log(`[WebSocket] Connected`),t.value=!0,n.value=0,i.value=Date.now(),r.value&&clearInterval(r.value),r.value=window.setInterval(()=>{e.value?.readyState===WebSocket.OPEN&&(e.value.send(JSON.stringify({type:`ping`})),Date.now()-i.value>6e4&&(console.warn(`[WebSocket] No pong received, reconnecting...`),c(),s()))},3e4)},e.value.onmessage=t=>{try{let n=JSON.parse(t.data);n.type===`packet`?a.addRealtimePacket(n.data):n.type===`stats`?(n.data?.packet_stats&&a.updateRealtimeStats({packet_stats:n.data.packet_stats}),n.data?.system_stats&&o.updateRealtimeStats(n.data.system_stats)):n.type===`packet_stats`?a.updateRealtimeStats(n.data):n.type===`system_stats`?o.updateRealtimeStats(n.data):(n.type===`pong`||n.type===`ping`)&&(i.value=Date.now(),n.type===`ping`&&e.value?.readyState===WebSocket.OPEN&&e.value.send(JSON.stringify({type:`pong`})))}catch(e){console.error(`[WebSocket] Parse error:`,e)}},e.value.onerror=()=>{if(console.log(`[WebSocket] Error`),t.value=!1,e.value=null,r.value&&=(clearInterval(r.value),null),n.value<5){let e=Math.min(1e3*2**Math.min(n.value,5),3e4);console.log(`[WebSocket] Reconnecting in ${e}ms (attempt ${n.value+1})`),n.value++,setTimeout(s,e)}else console.error(`[WebSocket] Max reconnection attempts reached - stopping`)},e.value.onclose=()=>{console.log(`[WebSocket] Disconnected`),t.value=!1,e.value=null,r.value&&=(clearInterval(r.value),null),n.value<5?(n.value=0,setTimeout(s,3e3)):console.log(`[WebSocket] Not reconnecting - max attempts reached`)}}function c(){console.log(`[WebSocket] Disconnecting...`),r.value&&=(clearInterval(r.value),null),e.value&&=(e.value.onclose=null,e.value.onerror=null,e.value.close(),null),t.value=!1,n.value=0}return{isConnected:t,connect:s,disconnect:c}}),Wt={},Gt={width:`23`,height:`25`,viewBox:`0 0 23 25`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function Kt(e,t){return U(),H(`svg`,Gt,[...t[0]||=[z(`path`,{d:`M2.84279 2.25795C2.90709 1.12053 3.17879 0.625914 3.95795 0.228723C4.79631 -0.198778 6.11858 0.000168182 7.67449 0.788054C8.34465 1.12757 8.41289 1.13448 9.58736 0.983905C11.1485 0.783681 13.1582 0.784388 14.5991 0.985738C15.6887 1.13801 15.7603 1.1304 16.4321 0.790174C18.6406 -0.328212 20.3842 -0.255036 21.0156 0.982491C21.3308 1.6002 21.3893 3.20304 21.1449 4.52503C21.0094 5.25793 21.0238 5.34943 21.3502 5.83037C23.6466 9.21443 21.9919 14.6998 18.0569 16.7469C17.7558 16.9036 17.502 17.0005 17.2952 17.0795C16.6602 17.3219 16.4674 17.3956 16.7008 18.5117C16.8132 19.0486 16.9486 20.3833 17.0018 21.478C17.098 23.4567 17.0966 23.4705 16.7495 23.8742C16.2772 24.4233 15.5963 24.4326 15.135 23.8962C14.8341 23.5464 14.8047 23.3812 14.8047 22.0315C14.8047 20.037 14.5861 18.7113 14.0695 17.5753C13.4553 16.2235 13.9106 15.7194 15.3154 15.4173C17.268 14.9973 18.793 13.7923 19.643 11.9978C20.4511 10.2921 20.5729 7.93485 19.1119 6.50124C18.6964 6.00746 18.6674 5.56022 18.9641 4.21159C19.075 3.70754 19.168 3.05725 19.1707 2.76637C19.1749 2.30701 19.1331 2.23764 18.8509 2.23764C18.6724 2.23764 17.9902 2.49736 17.3352 2.81474L16.2897 3.32145C16.1947 3.36751 16.0883 3.38522 15.9834 3.37318C13.3251 3.06805 10.7991 3.06334 8.12774 3.37438C8.02244 3.38663 7.91563 3.36892 7.82025 3.32263L6.77535 2.81559C6.12027 2.49764 5.43813 2.23764 5.25963 2.23764C4.84693 2.23764 4.84072 2.54233 5.2169 4.35258C5.44669 5.45816 5.60133 5.70451 4.93703 6.58851C3.94131 7.91359 3.69258 9.55902 4.22654 11.2878C4.89952 13.4664 6.54749 14.9382 8.86436 15.4292C10.261 15.7253 10.6261 16.1115 10.0928 17.713C9.67293 18.9734 9.40748 19.2982 8.79738 19.2982C7.97649 19.2982 7.46228 18.5871 7.74527 17.843C7.86991 17.5151 7.83283 17.4801 7.06383 17.1996C4.71637 16.3437 2.9209 14.4254 2.10002 11.8959C1.46553 9.94098 1.74471 7.39642 2.76257 5.85843C3.10914 5.33477 3.1145 5.29036 2.95277 4.28787C2.86126 3.72037 2.81177 2.80699 2.84279 2.25795Z`,fill:`currentColor`},null,-1),z(`path`,{d:`M2.02306 16.5589C1.68479 16.0516 0.999227 15.9144 0.491814 16.2527C-0.0155884 16.591 -0.152708 17.2765 0.185564 17.7839C0.435301 18.1586 0.734065 18.4663 0.987777 18.72C1.03455 18.7668 1.08 18.8119 1.12438 18.856C1.3369 19.0671 1.52455 19.2535 1.71302 19.4748C2.12986 19.964 2.54572 20.623 2.78206 21.8047C2.88733 22.3311 3.26569 22.6147 3.47533 22.7386C3.70269 22.8728 3.9511 22.952 4.15552 23.0036C4.57369 23.109 5.08133 23.1638 5.56309 23.1957C6.09196 23.2308 6.665 23.2422 7.17743 23.2453C7.1778 23.8547 7.67202 24.3487 8.28162 24.3487C8.89146 24.3487 9.38582 23.8543 9.38582 23.2445V22.1403C9.38582 21.5305 8.89146 21.0361 8.28162 21.0361C8.17753 21.0361 8.06491 21.0364 7.94562 21.0369C7.29761 21.0389 6.45295 21.0414 5.70905 20.9922C5.35033 20.9684 5.05544 20.9347 4.8392 20.8936C4.50619 19.5863 3.96821 18.7165 3.39415 18.0426C3.14038 17.7448 2.87761 17.4842 2.66387 17.2722C2.62385 17.2326 2.58556 17.1946 2.54935 17.1584C2.30273 16.9118 2.1414 16.7365 2.02306 16.5589Z`,fill:`currentColor`},null,-1)]])}var qt=Z(Wt,[[`render`,Kt]]),Jt={},Yt={width:`17`,height:`24`,viewBox:`0 0 17 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function Xt(e,t){return U(),H(`svg`,Yt,[...t[0]||=[C(``,12)]])}var Zt=Z(Jt,[[`render`,Xt]]),Qt={class:`glass-card p-5 relative overflow-hidden`},$t={key:0,class:`absolute inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-10 rounded-lg`},en={class:`flex items-baseline gap-2 mb-4`},tn={class:`text-content-primary dark:text-content-primary text-2xl font-medium`},nn=[`viewBox`],rn=[`y1`,`y2`],an=[`cx`,`cy`],on=200,sn=50,cn=4,ln=Z(T({__name:`RFNoiseFloor`,props:{limit:{default:void 0}},setup(e){let t=e,n=X(),i=pe(),a=W(null),o=(e,t)=>{let n=t/100*(e.length-1),r=Math.floor(n),i=Math.ceil(n);return r===i?e[r]:e[r]+(e[i]-e[r])*(n-r)},s=P(()=>{let e=m.value;if(e.length===0)return[];let t=[...e].sort((e,t)=>e-t),n=o(t,2.5),r=o(t,97.5),i=r-n,a=Math.max(i*.05,.5),s=n-a,c=r+a,l=c-s||1;return e.map((t,n)=>{let r=cn+n/Math.max(e.length-1,1)*(on-cn*2),i=(Math.max(s,Math.min(c,t))-s)/l;return{x:r,y:sn-cn-i*(sn-cn*2)}})}),c=async()=>{try{let e={hours:1};t.limit&&(e.limit=t.limit),await Promise.all([n.fetchNoiseFloorHistory(e),n.fetchNoiseFloorStats({hours:1})])}catch(e){console.error(`Error fetching noise floor data:`,e)}},d=()=>{a.value||=window.setInterval(c,5e3)},f=()=>{a.value&&=(clearInterval(a.value),null)};l(()=>{c(),d()}),ae(()=>{f()});let p=P(()=>{let e=n.noiseFloorSparklineData;return e&&e.length>0?e[e.length-1]:n.noiseFloorStats?.avg_noise_floor??-116}),m=P(()=>n.noiseFloorSparklineData);return(e,t)=>(U(),H(`div`,Qt,[u(i).cadCalibrationRunning?(U(),H(`div`,$t,[...t[0]||=[C(`
CAD Calibration

In Progress

`,1)]])):k(``,!0),t[2]||=z(`p`,{class:`text-content-secondary dark:text-content-muted text-xs uppercase mb-2`},` RF NOISE FLOOR `,-1),z(`div`,en,[z(`span`,tn,x(p.value),1),t[1]||=z(`span`,{class:`text-content-secondary dark:text-content-muted text-xs uppercase`},`dBm`,-1)]),(U(),H(`svg`,{class:`w-full h-[50px]`,viewBox:`0 0 ${on} ${sn}`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[(U(),H(L,null,r(3,e=>z(`line`,{key:`grid-`+e,x1:0,y1:e*sn/4,x2:on,y2:e*sn/4,stroke:`rgba(255, 255, 255, 0.1)`,"stroke-width":`1`},null,8,rn)),64)),(U(!0),H(L,null,r(s.value,(e,t)=>(U(),H(`circle`,{key:`point-`+t,cx:e.x,cy:e.y,r:`2.5`,fill:`rgba(245, 158, 11, 0.8)`,class:`transition-all duration-300`},null,8,an))),128))],8,nn))]))}}),[[`__scopeId`,`data-v-92b94522`]]),un={},dn={width:`800px`,height:`800px`,viewBox:`0 -1.5 20 20`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,class:`w-full h-full`};function fn(e,t){return U(),H(`svg`,dn,[...t[0]||=[z(`g`,{id:`Page-1`,stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},[z(`g`,{transform:`translate(-420.000000, -3641.000000)`,fill:`currentColor`},[z(`g`,{id:`icons`,transform:`translate(56.000000, 160.000000)`},[z(`path`,{d:`M378.195439,3483.828 L376.781439,3485.242 C378.195439,3486.656 378.294439,3489.588 376.880439,3491.002 L378.294439,3492.417 C380.415439,3490.295 380.316439,3485.949 378.195439,3483.828 M381.023439,3481 L379.609439,3482.414 C382.438439,3485.242 382.537439,3491.002 379.708439,3493.831 L381.122439,3495.245 C385.365439,3491.002 384.559439,3484.535 381.023439,3481 M375.432439,3486.737 C375.409439,3486.711 375.392439,3486.682 375.367439,3486.656 L375.363439,3486.66 C374.582439,3485.879 373.243439,3485.952 372.536439,3486.659 C371.829439,3487.366 371.831439,3488.778 372.538439,3489.485 C372.547439,3489.494 372.558439,3489.499 372.567439,3489.508 C372.590439,3489.534 372.607439,3489.563 372.632439,3489.588 L372.636439,3489.585 C373.201439,3490.15 373.000439,3488.284 373.000439,3498 L375.000439,3498 C375.000439,3488.058 374.753439,3490.296 375.463439,3489.586 C376.170439,3488.879 376.168439,3487.467 375.461439,3486.76 C375.452439,3486.751 375.441439,3486.746 375.432439,3486.737 M371.119439,3485.242 L369.705439,3483.828 C367.584439,3485.949 367.683439,3490.295 369.804439,3492.417 L371.218439,3491.002 C369.804439,3489.588 369.705439,3486.656 371.119439,3485.242 M368.390439,3493.831 L366.976439,3495.245 C363.440439,3491.709 362.634439,3485.242 366.877439,3481 L368.291439,3482.414 C365.462439,3485.242 365.561439,3491.002 368.390439,3493.831`,id:`radio_tower-[#1019]`})])])],-1)]])}var pn=Z(un,[[`render`,fn]]),mn={class:`text-center`},hn={class:`relative flex items-center justify-center mb-8`},gn={class:`relative w-32 h-32`},_n={class:`absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2`},vn={key:0,class:`absolute inset-0 flex items-center justify-center`},yn={key:1,class:`absolute inset-0 flex items-center justify-center`},bn={key:2,class:`absolute inset-0`},xn={class:`mb-6`},Sn={key:0,class:`text-content-primary dark:text-content-primary text-lg`},Cn={key:1,class:`text-accent-green text-lg font-medium`},wn={key:2,class:`text-secondary text-lg`},Tn={key:3,class:`text-accent-red text-lg`},En={key:4,class:`text-content-secondary dark:text-content-muted`},Dn={key:5,class:`mt-3`},On={key:0,class:`text-secondary text-sm`},kn={key:1,class:`text-accent-red text-sm`},An={key:0,class:`flex gap-3`},jn={key:1,class:`text-content-muted text-sm`},Mn=Z(T({name:`AdvertModal`,__name:`AdvertModal`,props:{isOpen:{type:Boolean},isLoading:{type:Boolean},isSuccess:{type:Boolean},error:{default:null}},emits:[`close`,`send`],setup(e,{emit:t}){let n=e,r=t,i=W(!1),a=W(!1),o=W(!1);te(()=>n.isOpen,e=>{e?(i.value=!0,setTimeout(()=>{a.value=!0},50)):(a.value=!1,o.value=!1,setTimeout(()=>{i.value=!1},300))},{immediate:!0}),te(()=>n.isLoading,e=>{e||setTimeout(()=>{o.value=!1},1e3)});let s=()=>{n.isLoading||r(`close`)},c=()=>{n.isLoading||(o.value=!0,r(`send`))},l=e=>e?.includes(`Network error - no response received`)||e?.includes(`timeout`);return(t,n)=>(U(),v(D,{to:`body`},[i.value?(U(),H(`div`,{key:0,class:`fixed inset-0 z-50 flex items-center justify-center p-4`,onClick:Nt(s,[`self`])},[z(`div`,{class:A([`absolute inset-0 bg-black/60 backdrop-blur-sm transition-opacity duration-300`,a.value?`opacity-100`:`opacity-0`])},null,2),z(`div`,{class:A([`relative bg-white dark:bg-surface-elevated backdrop-blur-xl rounded-[20px] p-8 max-w-md w-full transform transition-all duration-300 border border-stroke-subtle dark:border-white/10`,a.value?`scale-100 opacity-100`:`scale-95 opacity-0`])},[e.isLoading?k(``,!0):(U(),H(`button`,{key:0,onClick:s,class:`absolute top-4 right-4 text-content-secondary dark:text-content-muted hover:text-content-primary dark:hover:text-content-primary transition-colors p-2`},[...n[0]||=[z(`svg`,{class:`w-5 h-5`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[z(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])),z(`div`,mn,[n[6]||=z(`h2`,{class:`text-content-primary dark:text-content-primary text-xl font-semibold mb-6`},` Send Advertisement `,-1),z(`div`,hn,[z(`div`,gn,[z(`div`,_n,[j(pn,{class:A([`w-16 h-16 transition-all duration-500`,[e.isLoading?`animate-pulse`:``,e.isSuccess?`text-accent-green`:e.error&&!l(e.error)?`text-accent-red`:`text-primary`]]),style:ie({filter:e.isLoading?`drop-shadow(0 0 8px currentColor)`:e.isSuccess?`drop-shadow(0 0 8px #A5E5B6)`:e.error&&!l(e.error)?`drop-shadow(0 0 8px #FB787B)`:`drop-shadow(0 0 4px #AAE8E8)`})},null,8,[`class`,`style`])]),e.isLoading||e.isSuccess?(U(),H(`div`,vn,[z(`div`,{class:A([`absolute w-16 h-16 rounded-full border-2 animate-ping`,[e.isSuccess?`border-accent-green/60`:`border-primary/60`]]),style:{"animation-duration":`1.5s`}},null,2),z(`div`,{class:A([`absolute w-24 h-24 rounded-full border-2 animate-ping`,[e.isSuccess?`border-accent-green/40`:`border-primary/40`]]),style:{"animation-duration":`2s`,"animation-delay":`0.3s`}},null,2),z(`div`,{class:A([`absolute w-32 h-32 rounded-full border-2 animate-ping`,[e.isSuccess?`border-accent-green/20`:`border-primary/20`]]),style:{"animation-duration":`2.5s`,"animation-delay":`0.6s`}},null,2)])):k(``,!0),o.value?(U(),H(`div`,yn,[...n[1]||=[z(`div`,{class:`absolute w-8 h-8 rounded-full border-4 border-secondary animate-ping-fast`},null,-1),z(`div`,{class:`absolute w-16 h-16 rounded-full border-3 border-secondary/70 animate-ping-fast`,style:{"animation-delay":`0.1s`}},null,-1),z(`div`,{class:`absolute w-24 h-24 rounded-full border-2 border-secondary/50 animate-ping-fast`,style:{"animation-delay":`0.2s`}},null,-1),z(`div`,{class:`absolute w-32 h-32 rounded-full border-2 border-secondary/30 animate-ping-fast`,style:{"animation-delay":`0.3s`}},null,-1)]])):k(``,!0),e.isLoading||e.isSuccess?(U(),H(`div`,bn,[z(`div`,{class:A([`absolute top-2 right-2 w-4 h-4 rounded-full transition-all duration-500 animate-pulse`,[e.isSuccess?`bg-accent-green shadow-lg shadow-accent-green/50`:`bg-primary/70 shadow-lg shadow-primary/30`]]),style:{"animation-delay":`0.5s`}},[...n[2]||=[z(`div`,{class:`w-2 h-2 bg-white rounded-full mx-auto mt-1`},null,-1)]],2),z(`div`,{class:A([`absolute bottom-2 left-2 w-4 h-4 rounded-full transition-all duration-500 animate-pulse`,[e.isSuccess?`bg-accent-green shadow-lg shadow-accent-green/50`:`bg-primary/70 shadow-lg shadow-primary/30`]]),style:{"animation-delay":`1s`}},[...n[3]||=[z(`div`,{class:`w-2 h-2 bg-white rounded-full mx-auto mt-1`},null,-1)]],2),z(`div`,{class:A([`absolute top-1/2 right-1 w-4 h-4 rounded-full transition-all duration-500 animate-pulse`,[e.isSuccess?`bg-accent-green shadow-lg shadow-accent-green/50`:`bg-primary/70 shadow-lg shadow-primary/30`]]),style:{"animation-delay":`1.5s`,transform:`translateY(-50%)`}},[...n[4]||=[z(`div`,{class:`w-2 h-2 bg-white rounded-full mx-auto mt-1`},null,-1)]],2),z(`div`,{class:A([`absolute top-3 left-3 w-4 h-4 rounded-full transition-all duration-500 animate-pulse`,[e.isSuccess?`bg-accent-green shadow-lg shadow-accent-green/50`:`bg-primary/70 shadow-lg shadow-primary/30`]]),style:{"animation-delay":`2s`}},[...n[5]||=[z(`div`,{class:`w-2 h-2 bg-white rounded-full mx-auto mt-1`},null,-1)]],2)])):k(``,!0)])]),z(`div`,xn,[e.isLoading?(U(),H(`p`,Sn,` Broadcasting advertisement... `)):e.isSuccess?(U(),H(`p`,Cn,` Advertisement sent successfully! `)):e.error&&l(e.error)?(U(),H(`p`,wn,` Advertisement likely sent `)):e.error?(U(),H(`p`,Tn,`Failed to send advertisement`)):(U(),H(`p`,En,` This will broadcast your node's presence to nearby nodes. `)),e.error?(U(),H(`div`,Dn,[l(e.error)?(U(),H(`p`,On,` Network timeout occurred, but the advertisement may have been successfully transmitted to nearby nodes. `)):(U(),H(`p`,kn,x(e.error),1))])):k(``,!0)]),!e.isLoading&&!e.isSuccess?(U(),H(`div`,An,[z(`button`,{onClick:s,class:`flex-1 bg-background-mute dark:bg-white/5 border border-stroke-subtle dark:border-stroke/10 hover:border-primary rounded-[10px] px-6 py-3 text-content-primary dark:text-content-primary hover:bg-stroke-subtle dark:hover:bg-white/10 transition-all duration-200`},` Cancel `),z(`button`,{onClick:c,class:A([`flex-1 rounded-[10px] px-6 py-3 font-medium transition-all duration-200 shadow-lg`,[e.error&&l(e.error)?`bg-secondary hover:bg-secondary/90 text-background hover:shadow-secondary/20`:`bg-primary hover:bg-primary/90 text-background hover:shadow-primary/20`]])},x(e.error&&l(e.error)?`Try Again`:`Send Advertisement`),3)])):k(``,!0),e.isSuccess?(U(),H(`div`,jn,`Closing automatically...`)):k(``,!0)])],2)])):k(``,!0)]))}}),[[`__scopeId`,`data-v-2c9f179a`]]),Nn={},Pn={width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function Fn(e,t){return U(),H(`svg`,Pn,[...t[0]||=[C(``,2)]])}var In=Z(Nn,[[`render`,Fn]]),Ln={},Rn={width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function zn(e,t){return U(),H(`svg`,Rn,[...t[0]||=[C(``,9)]])}var Bn=Z(Ln,[[`render`,zn]]),Vn={},Hn={width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function Un(e,t){return U(),H(`svg`,Hn,[...t[0]||=[C(``,2)]])}var Wn=Z(Vn,[[`render`,Un]]),Gn={},Kn={width:`11`,height:`14`,viewBox:`0 0 11 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function qn(e,t){return U(),H(`svg`,Kn,[...t[0]||=[z(`path`,{d:`M9.81633 1.99133L8.5085 0.683492C8.29229 0.466088 8.03511 0.293723 7.75185 0.176372C7.46859 0.059021 7.16486 -0.000985579 6.85825 -0.000175002H1.75C1.28587 -0.000175002 0.840752 0.184199 0.512563 0.512388C0.184375 0.840577 0 1.2857 0 1.74983V13.9998H10.5V3.64099C10.4985 3.02248 10.2528 2.4296 9.81633 1.99133ZM8.9915 2.81616C9.02083 2.84799 9.04829 2.88149 9.07375 2.91649H7.58333V1.42608C7.61834 1.45153 7.65184 1.479 7.68367 1.50833L8.9915 2.81616ZM1.16667 12.8332V1.74983C1.16667 1.59512 1.22812 1.44674 1.33752 1.33735C1.44692 1.22795 1.59529 1.16649 1.75 1.16649H6.41667V4.08316H9.33333V12.8332H1.16667ZM2.33333 9.33316H8.16667V5.83316H2.33333V9.33316ZM3.5 6.99983H7V8.16649H3.5V6.99983ZM2.33333 10.4998H8.16667V11.6665H2.33333V10.4998Z`,fill:`currentColor`},null,-1)]])}var Jn=Z(Gn,[[`render`,qn]]),Yn={},Xn={width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function Zn(e,t){return U(),H(`svg`,Xn,[...t[0]||=[z(`path`,{d:`M12.25 0H1.75C1.28587 0 0.840752 0.184375 0.512563 0.512563C0.184375 0.840752 0 1.28587 0 1.75V12.25C0 12.7141 0.184375 13.1592 0.512563 13.4874C0.840752 13.8156 1.28587 14 1.75 14H12.25C12.7141 14 13.1592 13.8156 13.4874 13.4874C13.8156 13.1592 14 12.7141 14 12.25V1.75C14 1.28587 13.8156 0.840752 13.4874 0.512563C13.1592 0.184375 12.7141 0 12.25 0ZM12.8333 12.25C12.8333 12.4047 12.7719 12.5531 12.6625 12.6625C12.5531 12.7719 12.4047 12.8333 12.25 12.8333H1.75C1.59529 12.8333 1.44692 12.7719 1.33752 12.6625C1.22812 12.5531 1.16667 12.4047 1.16667 12.25V1.75C1.16667 1.59529 1.22812 1.44692 1.33752 1.33752C1.44692 1.22812 1.59529 1.16667 1.75 1.16667H12.25C12.4047 1.16667 12.5531 1.22812 12.6625 1.33752C12.7719 1.44692 12.8333 1.59529 12.8333 1.75V12.25ZM3.23583 7.41317L5.23583 9.41317C5.29134 9.46685 5.35738 9.50892 5.43004 9.53689C5.5027 9.56485 5.58055 9.57812 5.65892 9.57579C5.73729 9.57347 5.81418 9.5556 5.88513 9.52325C5.95608 9.4909 6.01963 9.44476 6.07175 9.38792C6.12387 9.33108 6.16351 9.26467 6.18833 9.19237C6.21315 9.12007 6.22263 9.04335 6.21618 8.96725C6.20973 8.89115 6.18746 8.81722 6.15078 8.74965C6.11411 8.68207 6.06376 8.62223 6.00292 8.57383L4.66708 7.23617L6.00292 5.90033C6.10827 5.78972 6.16669 5.64161 6.16522 5.48792C6.16375 5.33423 6.10251 5.1873 5.99491 5.07882C5.88731 4.97034 5.74082 4.90791 5.58716 4.90522C5.4335 4.90254 5.28489 4.95982 5.17367 5.06417L3.17367 7.06417C3.06317 7.17386 3.00063 7.32313 3.00063 7.47867C3.00063 7.63421 3.06317 7.78348 3.17367 7.89317L3.23583 7.41317ZM8.75 10.5H7.58333C7.4286 10.5 7.28025 10.5615 7.17085 10.6709C7.06146 10.7803 7 10.9286 7 11.0833C7 11.2381 7.06146 11.3864 7.17085 11.4958C7.28025 11.6052 7.4286 11.6667 7.58333 11.6667H8.75C8.90473 11.6667 9.05308 11.6052 9.16248 11.4958C9.27188 11.3864 9.33333 11.2381 9.33333 11.0833C9.33333 10.9286 9.27188 10.7803 9.16248 10.6709C9.05308 10.5615 8.90473 10.5 8.75 10.5Z`,fill:`currentColor`},null,-1)]])}var Qn=Z(Yn,[[`render`,Zn]]),$n={},er={width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function tr(e,t){return U(),H(`svg`,er,[...t[0]||=[C(``,2)]])}var nr=Z($n,[[`render`,tr]]),rr={name:`SystemIcon`},ir={width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function ar(e,t,n,r,i,a){return U(),H(`svg`,ir,[...t[0]||=[C(``,5)]])}var or=Z(rr,[[`render`,ar]]),sr={},cr={width:`11`,height:`14`,viewBox:`0 0 11 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function lr(e,t){return U(),H(`svg`,cr,[...t[0]||=[z(`path`,{d:`M10.5 14.0004H9.33333V11.0586C9.33287 10.6013 9.15099 10.1628 8.82761 9.83942C8.50422 9.51603 8.06575 9.33415 7.60842 9.33369H2.89158C2.43425 9.33415 1.99578 9.51603 1.67239 9.83942C1.34901 10.1628 1.16713 10.6013 1.16667 11.0586V14.0004H0V11.0586C0.000926233 10.292 0.305872 9.55705 0.847948 9.01497C1.39002 8.47289 2.12497 8.16795 2.89158 8.16702H7.60842C8.37503 8.16795 9.10998 8.47289 9.65205 9.01497C10.1941 9.55705 10.4991 10.292 10.5 11.0586V14.0004Z`,fill:`currentColor`},null,-1),z(`path`,{d:`M5.25 6.99997C4.55777 6.99997 3.88108 6.7947 3.30551 6.41011C2.72993 6.02553 2.28133 5.4789 2.01642 4.83936C1.75152 4.19982 1.6822 3.49609 1.81725 2.81716C1.9523 2.13822 2.28564 1.51458 2.77513 1.0251C3.26461 0.535614 3.88825 0.202271 4.56719 0.0672226C5.24612 -0.0678257 5.94985 0.00148598 6.58939 0.266393C7.22894 0.531299 7.77556 0.979903 8.16015 1.55548C8.54473 2.13105 8.75 2.80774 8.75 3.49997C8.74908 4.42794 8.38003 5.31765 7.72385 5.97382C7.06768 6.63 6.17798 6.99904 5.25 6.99997ZM5.25 1.16664C4.78851 1.16664 4.33739 1.30349 3.95367 1.55988C3.56996 1.81627 3.27089 2.18068 3.09428 2.60704C2.91768 3.0334 2.87147 3.50256 2.9615 3.95518C3.05153 4.4078 3.27376 4.82357 3.60009 5.14989C3.92641 5.47621 4.34217 5.69844 4.79479 5.78847C5.24741 5.8785 5.71657 5.83229 6.14293 5.65569C6.56929 5.47909 6.93371 5.18002 7.1901 4.7963C7.44649 4.41259 7.58334 3.96146 7.58334 3.49997C7.58334 2.88113 7.3375 2.28764 6.89992 1.85006C6.46233 1.41247 5.86884 1.16664 5.25 1.16664Z`,fill:`currentColor`},null,-1)]])}var ur=Z(sr,[[`render`,lr]]),dr={},fr={width:`14`,height:`14`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function pr(e,t){return U(),H(`svg`,fr,[...t[0]||=[C(``,2)]])}var mr=Z(dr,[[`render`,pr]]),hr={class:`w-[285px] flex-shrink-0 p-[15px] hidden lg:block`},gr={class:`glass-card h-full p-6`},_r={class:`mb-12`},vr={class:`text-content-secondary dark:text-content-muted text-sm`},yr=[`title`],br={class:`text-content-secondary dark:text-content-muted text-sm mt-1`},xr={class:`mt-3 p-2 rounded-[10px] border border-stroke-subtle dark:border-white/10 bg-white dark:bg-white/5`},Sr={class:`flex items-center justify-between`},Cr={class:`flex items-center gap-3 mt-1.5 text-[10px] text-content-muted dark:text-content-muted`},wr={class:`text-green-600 dark:text-green-400`},Tr={class:`text-red-600 dark:text-red-400`},Er={key:0,class:`text-orange-600 dark:text-orange-400`},Dr={class:`mb-8`},Or={class:`mb-8`},kr={class:`space-y-2`},Ar=[`onClick`],jr={class:`mb-8`},Mr={class:`space-y-2`},Nr=[`onClick`],Pr={class:`mb-8`},Fr={class:`space-y-2`},Ir=[`onClick`],Lr={class:`mb-8`},Rr={class:`space-y-2`},zr=[`onClick`],Br={class:`mb-4`},Vr={class:`flex rounded-[10px] overflow-hidden border border-stroke-subtle dark:border-white/10 bg-white dark:bg-white/5`},Hr=[`title`,`disabled`,`onClick`],Ur=[`disabled`],Wr={class:`flex items-center gap-3`},Gr={class:`mb-4`},Kr={key:0,class:`mb-2 glass-card px-3 py-2 rounded-lg border border-blue-500/30 dark:border-blue-400/50 bg-blue-500/10 dark:bg-blue-400/20`},qr={class:`flex items-center gap-2`},Jr={key:0,class:`mt-2 glass-card px-3 py-2 rounded-lg border border-stroke-subtle dark:border-stroke/30 space-y-2 text-xs animate-fade-in`},Yr={class:`space-y-1`},Xr={class:`flex items-center justify-between`},Zr={class:`text-content-primary dark:text-content-primary font-mono`},Qr={key:0,class:`pl-2 space-y-0.5 text-[10px] text-content-secondary dark:text-content-muted`},$r={key:0,class:`flex items-center gap-1`},ei={class:`bg-white/5 dark:bg-black/20 px-1 py-0.5 rounded`},ti={class:`space-y-1`},ni={class:`flex items-center justify-between`},ri={class:`text-content-primary dark:text-content-primary font-mono`},ii={key:0,class:`pl-2 space-y-0.5 text-[10px] text-content-secondary dark:text-content-muted`},ai={key:0,class:`flex items-center gap-1`},oi={class:`bg-white/5 dark:bg-black/20 px-1 py-0.5 rounded`},si={key:0,class:`mb-4`},ci={class:`text-content-secondary dark:text-content-muted text-xs mb-2`},li={class:`text-content-primary dark:text-content-primary`},ui={class:`w-full h-1 bg-white/10 rounded-full overflow-hidden`},di={class:`flex items-center gap-2 text-content-secondary dark:text-content-muted text-xs mb-3`},fi={class:`flex items-center justify-center gap-3`},pi={href:`https://github.com/rightup`,target:`_blank`,class:`inline-flex items-center justify-center w-9 h-9 rounded-xl bg-content-primary dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 hover:bg-primary/20 dark:hover:bg-primary/30 hover:border-primary/50 transition-all duration-300 hover:scale-110 group backdrop-blur-sm`,title:`GitHub`},mi={href:`https://buymeacoffee.com/rightup`,target:`_blank`,class:`inline-flex items-center justify-center w-9 h-9 rounded-xl bg-content-primary dark:bg-white/10 border border-stroke-subtle dark:border-stroke/20 hover:bg-yellow-50 dark:hover:bg-yellow-500/20 hover:border-yellow-500/50 transition-all duration-300 hover:scale-110 group backdrop-blur-sm`,title:`Buy Me a Coffee`},hi=T({name:`SidebarNav`,__name:`Sidebar`,setup(e){let n=oe(),i=se(),a=pe(),o=Ut(),c=W(!1),d=W(!1),f=W(!1),p=W(!1),m=W(!1),h=W(null),g=null,_=null,y=W(`unknown`),b=W(0),S=W(0),C=W(0),w=async e=>{g&&=(g(),null),e?a.fetchStats():g=await a.startAutoRefresh(5e3,e)};l(async()=>{await w(o.isConnected),await T(),_=window.setInterval(()=>{T()},3e4),te(()=>o.isConnected,e=>{w(e)})}),t(()=>{g&&g(),_&&clearInterval(_)});let T=async()=>{try{let e=(await Y.get(`/advert_rate_limit_stats`))?.data;y.value=typeof e?.adaptive?.current_tier==`string`?e.adaptive.current_tier:`unknown`,b.value=e?.stats?.adverts_allowed||0,S.value=e?.stats?.adverts_dropped||0,C.value=Object.keys(e?.active_penalties||{}).length}catch{y.value=`unknown`,b.value=0,S.value=0,C.value=0}},E=P(()=>{switch(y.value){case`quiet`:return`bg-green-100 dark:bg-green-500/20 text-green-700 dark:text-green-400 border-green-500/50`;case`normal`:return`bg-blue-100 dark:bg-blue-500/20 text-blue-700 dark:text-blue-400 border-blue-500/50`;case`busy`:return`bg-yellow-100 dark:bg-yellow-500/20 text-yellow-700 dark:text-yellow-400 border-yellow-500/50`;case`congested`:return`bg-red-100 dark:bg-red-500/20 text-red-700 dark:text-red-400 border-red-500/50`;default:return`bg-gray-100 dark:bg-gray-500/20 text-gray-700 dark:text-gray-400 border-gray-500/50`}}),D={dashboard:Bn,neighbors:ur,statistics:nr,"system-stats":or,sessions:or,configuration:In,"room-servers":In,companions:In,logs:Jn,terminal:Qn,help:Wn},O=[{name:`Dashboard`,icon:`dashboard`,route:`/`},{name:`Neighbors`,icon:`neighbors`,route:`/neighbors`},{name:`Statistics`,icon:`statistics`,route:`/statistics`},{name:`System Stats`,icon:`system-stats`,route:`/system-stats`},{name:`Sessions`,icon:`sessions`,route:`/sessions`},{name:`Configuration`,icon:`configuration`,route:`/configuration`},{name:`Terminal`,icon:`terminal`,route:`/terminal`},{name:`Room Servers`,icon:`room-servers`,route:`/room-servers`},{name:`Companions`,icon:`companions`,route:`/companions`},{name:`Logs`,icon:`logs`,route:`/logs`},{name:`Help`,icon:`help`,route:`/help`}],ee=[{id:`forward`,label:`Forward`,title:`Repeats packets and Room Server and Companion identities can TX.`},{id:`monitor`,label:`Monitor`,title:`Does not repeat packets, can Advert, Room Server and Companion identities can TX.`},{id:`no_tx`,label:`No TX`,title:`No packets transmitted.`}],M=P(()=>e=>i.path===e),N=e=>{n.push(e)},F=async()=>{c.value=!0,h.value=null;try{await a.sendAdvert(),m.value=!0,setTimeout(()=>{ne()},2e3)}catch(e){h.value=e instanceof Error?e.message:`Unknown error occurred`,console.error(`Failed to send advert:`,e)}finally{c.value=!1}},ne=()=>{p.value=!1,m.value=!1,h.value=null,c.value=!1},R=async e=>{if(!d.value&&a.currentMode!==e){d.value=!0;try{await a.setMode(e)}catch(e){console.error(`Failed to set mode:`,e)}finally{d.value=!1}}},B=async()=>{if(!f.value){f.value=!0;try{await a.toggleDutyCycle()}catch(e){console.error(`Failed to toggle duty cycle:`,e)}finally{f.value=!1}}},V=W(new Date().toLocaleTimeString());setInterval(()=>{V.value=new Date().toLocaleTimeString()},1e3);let re=P(()=>{let e=a.dutyCyclePercentage,t=`#A5E5B6`;return e>90?t=`#FB787B`:e>70&&(t=`#FFC246`),{width:e===0?`2px`:`${Math.max(e,2)}%`,backgroundColor:t}}),ae=W(!1),G=P(()=>a.version.includes(`dev`)||a.coreVersion.includes(`dev`)),K=e=>{let t=e.match(/^([\d.]+)(\.dev(\d+))?((\+g)([a-f0-9]+))?$/);return t?{base:t[1],isDev:!!t[2],devNumber:t[3]||null,commit:t[6]||null}:{base:e,isDev:!1,devNumber:null,commit:null}},q=P(()=>K(a.version)),J=P(()=>K(a.coreVersion));return(e,t)=>(U(),H(L,null,[z(`aside`,hr,[z(`div`,gr,[z(`div`,_r,[t[3]||=z(`div`,{class:`mb-2 flex justify-center`},[z(`img`,{src:`/assets/meshcore-DQNtEl5I.svg`,alt:`MeshCore`,class:`h-4 opacity-80 dark:invert-0 invert`})],-1),t[4]||=z(`h1`,{class:`text-content-primary dark:text-content-primary text-[22px] font-extrabold tracking-tight mb-3 text-center`,style:{"font-family":`system-ui, + -apple-system, + sans-serif`}},` pyMC Repeater `,-1),z(`p`,vr,[I(x(u(a).nodeName)+` `,1),z(`span`,{class:A([`inline-block w-2 h-2 rounded-full ml-2`,u(a).statusBadge.text===`Active`?`bg-accent-green`:u(a).statusBadge.text===`Monitor Mode`?`bg-secondary`:`bg-accent-red`]),title:u(a).statusBadge.title},null,10,yr)]),z(`p`,br,` <`+x(u(a).pubKey)+`> `,1),z(`div`,xr,[z(`div`,Sr,[t[2]||=z(`span`,{class:`text-content-muted dark:text-content-muted text-[10px] uppercase tracking-wide`},`Adaptive`,-1),z(`div`,{class:A([`inline-flex items-center px-2 py-0.5 rounded-full border text-[10px] font-semibold`,E.value])},x(y.value.toUpperCase()),3)]),z(`div`,Cr,[z(`span`,wr,`OK: `+x(b.value),1),z(`span`,Tr,`Drop: `+x(S.value),1),C.value>0?(U(),H(`span`,Er,`Pen: `+x(C.value),1)):k(``,!0)])])]),t[22]||=z(`div`,{class:`border-t border-stroke-subtle dark:border-stroke mb-6`},null,-1),z(`div`,Dr,[t[6]||=z(`p`,{class:`text-content-muted dark:text-content-muted text-xs uppercase mb-4`},`Actions`,-1),z(`button`,{onClick:t[0]||=e=>p.value=!0,class:`w-full bg-white dark:bg-white/10 rounded-[10px] py-3 px-4 flex items-center gap-2 text-sm font-medium text-[#212122] dark:text-white border border-stroke-subtle dark:border-white/10 hover:bg-gray-100 dark:hover:bg-white/20 transition-colors`},[...t[5]||=[z(`svg`,{class:`w-3.5 h-3.5`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[z(`path`,{d:`M7 0C5.61553 0 4.26216 0.410543 3.11101 1.17971C1.95987 1.94888 1.06266 3.04213 0.532846 4.32122C0.003033 5.6003 -0.13559 7.00777 0.134506 8.36563C0.404603 9.7235 1.07129 10.9708 2.05026 11.9497C3.02922 12.9287 4.2765 13.5954 5.63437 13.8655C6.99224 14.1356 8.3997 13.997 9.67879 13.4672C10.9579 12.9373 12.0511 12.0401 12.8203 10.889C13.5895 9.73785 14 8.38447 14 7C13.998 5.1441 13.2599 3.36479 11.9475 2.05247C10.6352 0.74015 8.8559 0.0020073 7 0V0ZM7 12.8333C5.84628 12.8333 4.71846 12.4912 3.75918 11.8502C2.79989 11.2093 2.05222 10.2982 1.61071 9.23232C1.16919 8.16642 1.05368 6.99353 1.27876 5.86197C1.50384 4.73042 2.05941 3.69102 2.87521 2.87521C3.69102 2.0594 4.73042 1.50383 5.86198 1.27875C6.99353 1.05367 8.16642 1.16919 9.23232 1.6107C10.2982 2.05221 11.2093 2.79989 11.8502 3.75917C12.4912 4.71846 12.8333 5.84628 12.8333 7C12.8316 8.54658 12.2165 10.0293 11.1229 11.1229C10.0293 12.2165 8.54658 12.8316 7 12.8333ZM8.16667 7C8.1676 7.20501 8.11448 7.40665 8.01268 7.58461C7.91087 7.76256 7.76397 7.91054 7.58677 8.01365C7.40957 8.11676 7.20833 8.17136 7.00332 8.17194C6.7983 8.17252 6.59675 8.11906 6.41897 8.01696C6.24119 7.91485 6.09346 7.7677 5.99065 7.59033C5.88784 7.41295 5.83358 7.21162 5.83335 7.0066C5.83312 6.80159 5.88691 6.60013 5.98932 6.42252C6.09172 6.24491 6.23912 6.09743 6.41667 5.99492V3.5H7.58334V5.99492C7.76016 6.09659 7.90713 6.24298 8.00952 6.41939C8.1119 6.5958 8.1661 6.79603 8.16667 7Z`,fill:`currentColor`})],-1),I(` Send Advert `,-1)]])]),z(`div`,Or,[t[7]||=z(`p`,{class:`text-content-muted dark:text-content-muted text-xs uppercase mb-4`},`Monitoring`,-1),z(`div`,kr,[(U(!0),H(L,null,r(O.slice(0,3),e=>(U(),H(`button`,{key:e.name,onClick:t=>N(e.route),class:A([M.value(e.route)?`bg-gradient-to-r from-cyan-400/90 to-cyan-500/90 dark:bg-primary/30 border-cyan-500 dark:border-primary/40 shadow-[0_4px_16px_rgba(6,182,212,0.4)] dark:shadow-[0_4px_12px_rgba(170,232,232,0.25)] text-white dark:text-primary font-semibold`:`text-content-primary dark:text-content-primary hover:bg-gradient-to-r hover:from-cyan-400/20 hover:to-cyan-500/20 dark:hover:bg-primary/5 hover:border-cyan-400/30 dark:hover:border-primary/20 hover:shadow-[0_2px_12px_rgba(6,182,212,0.2)] dark:hover:shadow-[0_2px_8px_rgba(170,232,232,0.15)] border border-stroke-subtle dark:border-transparent`,`w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm font-medium transition-all duration-200`])},[(U(),v(s(D[e.icon]),{class:A(M.value(e.route)?`w-3.5 h-3.5 text-white dark:text-primary [&_path]:fill-current`:`w-3.5 h-3.5 text-content-primary dark:text-content-primary [&_path]:fill-current`)},null,8,[`class`])),I(` `+x(e.name),1)],10,Ar))),128))])]),z(`div`,jr,[t[8]||=z(`p`,{class:`text-content-muted dark:text-content-muted text-xs uppercase mb-4`},`System`,-1),z(`div`,Mr,[(U(!0),H(L,null,r(O.slice(3,7),e=>(U(),H(`button`,{key:e.name,onClick:t=>N(e.route),class:A([M.value(e.route)?`bg-gradient-to-r from-cyan-400/90 to-cyan-500/90 dark:bg-primary/30 border-cyan-500 dark:border-primary/40 shadow-[0_4px_16px_rgba(6,182,212,0.4)] dark:shadow-[0_4px_12px_rgba(170,232,232,0.25)] text-white dark:text-primary font-semibold`:`text-content-primary dark:text-content-primary hover:bg-gradient-to-r hover:from-cyan-400/20 hover:to-cyan-500/20 dark:hover:bg-primary/5 hover:border-cyan-400/30 dark:hover:border-primary/20 hover:shadow-[0_2px_12px_rgba(6,182,212,0.2)] dark:hover:shadow-[0_2px_8px_rgba(170,232,232,0.15)] border border-stroke-subtle dark:border-transparent`,`w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm font-medium transition-all duration-200`])},[(U(),v(s(D[e.icon]),{class:A(M.value(e.route)?`w-3.5 h-3.5 text-white dark:text-primary [&_path]:fill-current`:`w-3.5 h-3.5 text-content-primary dark:text-content-primary [&_path]:fill-current`)},null,8,[`class`])),I(` `+x(e.name),1)],10,Nr))),128))])]),z(`div`,Pr,[t[9]||=z(`p`,{class:`text-content-muted dark:text-content-muted text-xs uppercase mb-4`},` Room Servers & Companions `,-1),z(`div`,Fr,[(U(!0),H(L,null,r(O.slice(7,9),e=>(U(),H(`button`,{key:e.name,onClick:t=>N(e.route),class:A([M.value(e.route)?`bg-gradient-to-r from-cyan-400/90 to-cyan-500/90 dark:bg-primary/30 border-cyan-500 dark:border-primary/40 shadow-[0_4px_16px_rgba(6,182,212,0.4)] dark:shadow-[0_4px_12px_rgba(170,232,232,0.25)] text-white dark:text-primary font-semibold`:`text-content-primary dark:text-content-primary hover:bg-gradient-to-r hover:from-cyan-400/20 hover:to-cyan-500/20 dark:hover:bg-primary/5 hover:border-cyan-400/30 dark:hover:border-primary/20 hover:shadow-[0_2px_12px_rgba(6,182,212,0.2)] dark:hover:shadow-[0_2px_8px_rgba(170,232,212,0.15)] border border-stroke-subtle dark:border-transparent`,`w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm font-medium transition-all duration-200`])},[(U(),v(s(D[e.icon]),{class:A(M.value(e.route)?`w-3.5 h-3.5 text-white dark:text-primary [&_path]:fill-current`:`w-3.5 h-3.5 text-content-primary dark:text-content-primary [&_path]:fill-current`)},null,8,[`class`])),I(` `+x(e.name),1)],10,Ir))),128))])]),z(`div`,Lr,[t[10]||=z(`p`,{class:`text-content-muted dark:text-content-muted text-xs uppercase mb-4`},`Other`,-1),z(`div`,Rr,[(U(!0),H(L,null,r(O.slice(9),e=>(U(),H(`button`,{key:e.name,onClick:t=>N(e.route),class:A([M.value(e.route)?`bg-gradient-to-r from-cyan-400/90 to-cyan-500/90 dark:bg-primary/30 border-cyan-500 dark:border-primary/40 shadow-[0_4px_16px_rgba(6,182,212,0.4)] dark:shadow-[0_4px_12px_rgba(170,232,232,0.25)] text-white dark:text-primary font-semibold`:`text-content-primary dark:text-content-primary hover:bg-gradient-to-r hover:from-cyan-400/20 hover:to-cyan-500/20 dark:hover:bg-primary/5 hover:border-cyan-400/30 dark:hover:border-primary/20 hover:shadow-[0_2px_12px_rgba(6,182,212,0.2)] dark:hover:shadow-[0_2px_8px_rgba(170,232,232,0.15)] border border-stroke-subtle dark:border-transparent`,`w-full rounded-[10px] py-3 px-4 flex items-center gap-3 text-sm font-medium transition-all duration-200`])},[(U(),v(s(D[e.icon]),{class:A(M.value(e.route)?`w-3.5 h-3.5 text-white dark:text-primary [&_path]:fill-current`:`w-3.5 h-3.5 text-content-primary dark:text-content-primary [&_path]:fill-current`)},null,8,[`class`])),I(` `+x(e.name),1)],10,zr))),128))])]),j(ln,{"current-value":u(a).noiseFloorDbm||-116,"update-interval":3e3,class:`mb-6`},null,8,[`current-value`]),z(`div`,Br,[t[11]||=z(`p`,{class:`text-content-muted dark:text-content-muted text-xs uppercase mb-2`},`Mode`,-1),z(`div`,Vr,[(U(),H(L,null,r(ee,e=>z(`button`,{key:e.id,type:`button`,title:e.title,disabled:d.value,onClick:t=>R(e.id),class:A([`flex-1 py-2.5 px-2 text-xs font-medium transition-all duration-200 border-r border-stroke-subtle dark:border-white/10 last:border-r-0`,d.value?`opacity-60 cursor-not-allowed`:`cursor-pointer`,u(a).currentMode===e.id?e.id===`forward`?`bg-mode-segment-forward text-accent-green`:e.id===`monitor`?`bg-amber-500/20 text-amber-600 dark:text-amber-400`:`bg-mode-segment-no-tx text-accent-red`:`text-content-primary dark:text-content-primary hover:bg-white/10 dark:hover:bg-white/10`])},x(d.value&&u(a).currentMode!==e.id?`…`:e.label),11,Hr)),64))])]),z(`button`,{onClick:B,disabled:f.value,class:A([`p-4 flex items-center justify-between mb-4 w-full transition-all duration-200 cursor-pointer group`,u(a).dutyCycleButtonState.warning?`glass-card-orange hover:bg-accent-red/10`:`glass-card-green hover:bg-accent-green/10`])},[z(`div`,Wr,[j(mr,{class:`w-3.5 h-3.5 text-content-primary dark:text-content-primary group-hover:text-primary transition-colors`}),t[12]||=z(`span`,{class:`text-content-primary dark:text-content-primary text-sm group-hover:text-primary transition-colors`},`Duty Cycle`,-1)]),z(`span`,{class:A([`text-xs font-medium group-hover:text-white transition-colors`,u(a).dutyCycleButtonState.warning?`text-accent-red`:`text-primary`])},x(f.value?`Changing...`:u(a).dutyCycleEnabled?`Enabled`:`Disabled`),3)],10,Ur),z(`div`,Gr,[G.value?(U(),H(`div`,Kr,[...t[13]||=[z(`div`,{class:`flex items-center justify-center gap-2`},[z(`svg`,{class:`w-4 h-4 text-blue-500 dark:text-blue-400 flex-shrink-0`,viewBox:`0 0 20 20`,fill:`currentColor`},[z(`path`,{"fill-rule":`evenodd`,d:`M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z`,"clip-rule":`evenodd`})]),z(`span`,{class:`text-blue-500 dark:text-blue-400 text-xs font-semibold`},`Development Build`)],-1)]])):k(``,!0),z(`div`,{onClick:t[1]||=e=>ae.value=!ae.value,class:`cursor-pointer transition-all duration-200 hover:scale-[1.02]`},[z(`div`,qr,[z(`span`,{class:A([`glass-card px-2 py-1 text-xs font-medium rounded border transition-colors`,q.value.isDev?`text-yellow-600 dark:text-yellow-400 border-yellow-500/30 dark:border-yellow-500/30`:`text-content-secondary dark:text-content-muted border-stroke-subtle dark:border-stroke`])},` R:v`+x(q.value.base)+x(q.value.isDev?`-dev`+q.value.devNumber:``),3),z(`span`,{class:A([`glass-card px-2 py-1 text-xs font-medium rounded border transition-colors`,J.value.isDev?`text-yellow-600 dark:text-yellow-400 border-yellow-500/30 dark:border-yellow-500/30`:`text-content-secondary dark:text-content-muted border-stroke-subtle dark:border-stroke`])},` Core:v`+x(J.value.base)+x(J.value.isDev?`-dev`+J.value.devNumber:``),3),(U(),H(`svg`,{class:A([`w-3 h-3 text-content-muted transition-transform duration-200`,ae.value?`rotate-180`:``]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...t[14]||=[z(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 9l-7 7-7-7`},null,-1)]],2))]),ae.value?(U(),H(`div`,Jr,[z(`div`,Yr,[z(`div`,Xr,[t[15]||=z(`span`,{class:`text-content-muted font-medium`},`Repeater:`,-1),z(`span`,Zr,`v`+x(q.value.base),1)]),q.value.isDev?(U(),H(`div`,Qr,[z(`div`,null,`Dev Build: `+x(q.value.devNumber),1),q.value.commit?(U(),H(`div`,$r,[t[16]||=z(`span`,null,`Commit:`,-1),z(`code`,ei,x(q.value.commit),1)])):k(``,!0)])):k(``,!0)]),t[19]||=z(`div`,{class:`border-t border-stroke-subtle dark:border-stroke/20`},null,-1),z(`div`,ti,[z(`div`,ni,[t[17]||=z(`span`,{class:`text-content-muted font-medium`},`Core:`,-1),z(`span`,ri,`v`+x(J.value.base),1)]),J.value.isDev?(U(),H(`div`,ii,[z(`div`,null,`Dev Build: `+x(J.value.devNumber),1),J.value.commit?(U(),H(`div`,ai,[t[18]||=z(`span`,null,`Commit:`,-1),z(`code`,oi,x(J.value.commit),1)])):k(``,!0)])):k(``,!0)])])):k(``,!0)])]),t[23]||=z(`div`,{class:`border-t border-accent-green mb-4`},null,-1),u(a).dutyCycleEnabled?(U(),H(`div`,si,[z(`p`,ci,[t[20]||=I(` Duty Cycle: `,-1),z(`span`,li,x(u(a).dutyCycleUtilization.toFixed(1))+`% / `+x(u(a).dutyCycleMax.toFixed(1))+`%`,1)]),z(`div`,ui,[z(`div`,{class:`h-full rounded-full transition-all duration-300`,style:ie(re.value)},null,4)])])):k(``,!0),z(`div`,di,[t[21]||=z(`svg`,{class:`w-3 h-3`,viewBox:`0 0 13 13`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[z(`path`,{d:`M6.5 13C5.59722 13 4.75174 12.8286 3.96355 12.4858C3.17537 12.143 2.48926 11.6795 1.90522 11.0955C1.32119 10.5115 0.85776 9.82535 0.514945 9.03717C0.172131 8.24898 0.000482491 7.40326 1.0101e-06 6.5C-0.000480471 5.59674 0.171168 4.75126 0.514945 3.96356C0.858723 3.17585 1.32191 2.48974 1.9045 1.90522C2.48709 1.3207 3.1732 0.857278 3.96283 0.514944C4.75246 0.172611 5.59818 0.000962963 6.5 0C7.48703 0 8.42303 0.210648 9.30799 0.631944C10.193 1.05324 10.9421 1.64907 11.5555 2.41944V1.44444C11.5555 1.23981 11.6249 1.06841 11.7635 0.930222C11.9022 0.792037 12.0736 0.722704 12.2778 0.722222C12.4819 0.721741 12.6536 0.791074 12.7927 0.930222C12.9319 1.06937 13.001 1.24078 13 1.44444V4.33333C13 4.53796 12.9307 4.70961 12.792 4.84828C12.6533 4.98694 12.4819 5.05604 12.2778 5.05556H9.38888C9.18425 5.05556 9.01285 4.98622 8.87466 4.84756C8.73647 4.70889 8.66714 4.53748 8.66666 4.33333C8.66618 4.12919 8.73551 3.95778 8.87466 3.81911C9.01381 3.68044 9.18521 3.61111 9.38888 3.61111H10.6528C10.1593 2.93704 9.55138 2.40741 8.82916 2.02222C8.10694 1.63704 7.33055 1.44444 6.5 1.44444C5.09166 1.44444 3.89711 1.93507 2.91633 2.91633C1.93555 3.89759 1.44493 5.09215 1.44444 6.5C1.44396 7.90785 1.93459 9.10265 2.91633 10.0844C3.89807 11.0661 5.09263 11.5565 6.5 11.5556C7.64351 11.5556 8.66666 11.2125 9.56944 10.5264C10.4722 9.84028 11.068 8.95555 11.3569 7.87222C11.4171 7.67963 11.5255 7.53519 11.6819 7.43889C11.8384 7.34259 12.013 7.30648 12.2055 7.33055C12.4102 7.35463 12.5727 7.44178 12.693 7.592C12.8134 7.74222 12.8495 7.90785 12.8014 8.08889C12.4523 9.5213 11.694 10.698 10.5264 11.6191C9.35879 12.5402 8.01666 13.0005 6.5 13ZM7.22222 6.21111L9.02777 8.01667C9.16018 8.14907 9.22638 8.31759 9.22638 8.52222C9.22638 8.72685 9.16018 8.89537 9.02777 9.02778C8.89536 9.16018 8.72685 9.22639 8.52222 9.22639C8.31759 9.22639 8.14907 9.16018 8.01666 9.02778L5.99444 7.00556C5.92222 6.93333 5.86805 6.8522 5.83194 6.76217C5.79583 6.67213 5.77777 6.57872 5.77777 6.48194V3.61111C5.77777 3.40648 5.84711 3.23507 5.98577 3.09689C6.12444 2.9587 6.29585 2.88937 6.5 2.88889C6.70414 2.88841 6.87579 2.95774 7.01494 3.09689C7.15409 3.23604 7.22318 3.40744 7.22222 3.61111V6.21111Z`,fill:`currentColor`})],-1),I(` Last Updated: `+x(V.value),1)]),z(`div`,fi,[z(`a`,pi,[j(qt,{class:`w-5 h-5 text-white group-hover:text-primary transition-colors`})]),z(`a`,mi,[j(Zt,{class:`w-5 h-5 text-white group-hover:text-yellow-500 transition-colors`})])])])]),j(Mn,{isOpen:p.value,isLoading:c.value,isSuccess:m.value,error:h.value,onClose:ne,onSend:F},null,8,[`isOpen`,`isLoading`,`isSuccess`,`error`])],64))}}),gi={class:`bg-white/95 dark:bg-black/20 backdrop-blur-xl border border-stroke dark:border-white/10 rounded-2xl h-full p-6 overflow-auto shadow-2xl`},_i={class:`mb-6 flex items-center justify-between`},vi={class:`text-content-secondary dark:text-[#C3C3C3] text-sm`},yi=[`title`],bi={class:`text-content-secondary dark:text-[#C3C3C3] text-sm mt-1`},xi={class:`mt-3 p-2 rounded-[10px] border border-stroke-subtle dark:border-white/10 bg-white dark:bg-white/5`},Si={class:`flex items-center justify-between`},Ci={class:`flex items-center gap-3 mt-1.5 text-[10px] text-content-muted`},wi={class:`text-green-600 dark:text-green-400`},Ti={class:`text-red-600 dark:text-red-400`},Ei={key:0,class:`text-orange-600 dark:text-orange-400`},Di={class:`mb-4`},Oi={class:`mb-4`},ki={class:`space-y-2 mb-3`},Ai=[`onClick`],ji={class:`mb-4`},Mi={class:`space-y-2 mb-3`},Ni=[`onClick`],Pi={class:`mb-4`},Fi={class:`space-y-2 mb-3`},Ii=[`onClick`],Li={class:`mb-4`},Ri={class:`space-y-2 mb-3`},zi=[`onClick`],Bi={class:`mb-3`},Vi={class:`flex rounded-[.625rem] overflow-hidden border border-stroke dark:border-white/10 bg-white dark:bg-white/5`},Hi=[`title`,`disabled`,`onClick`],Ui=[`disabled`],Wi={class:`flex items-center gap-3`},Gi={class:`mb-4`},Ki={key:0,class:`mt-2 glass-card px-3 py-2 rounded-lg border border-stroke-subtle dark:border-stroke/30 space-y-2 text-xs animate-fade-in`},qi={class:`space-y-1`},Ji={class:`flex items-center justify-between`},Yi={class:`text-content-primary dark:text-content-primary font-mono`},Xi={key:0,class:`pl-2 space-y-0.5 text-[10px] text-content-secondary dark:text-content-muted`},Zi={key:0,class:`flex items-center gap-1`},Qi={class:`bg-white/5 dark:bg-black/20 px-1 py-0.5 rounded`},$i={class:`space-y-1`},ea={class:`flex items-center justify-between`},ta={class:`text-content-primary dark:text-content-primary font-mono`},na={key:0,class:`pl-2 space-y-0.5 text-[10px] text-content-secondary dark:text-content-muted`},ra={key:0,class:`flex items-center gap-1`},ia={class:`bg-white/5 dark:bg-black/20 px-1 py-0.5 rounded`},aa={key:1,class:`mb-4`},oa={class:`text-content-muted text-xs mb-2`},sa={class:`text-content-primary dark:text-white`},ca={class:`w-full h-1 bg-stroke-subtle dark:bg-white/10 rounded-full overflow-hidden`},la={class:`text-content-muted text-xs`},ua=T({name:`MobileSidebar`,__name:`MobileSidebar`,props:{showMobileSidebar:{type:Boolean}},emits:[`update:showMobileSidebar`,`close`],setup(e,{emit:n}){let i=E(()=>ce(()=>import(`./RFNoiseFloor-D00K9PjZ.js`),[])),a=W(!1),o=e,c=n,d=oe(),f=se(),p=pe();te(()=>o.showMobileSidebar,e=>{e&&!a.value?setTimeout(()=>{a.value=!0},100):e||(a.value=!1)});let m=W(!1),h=W(!1),g=W(!1),_=W(!1),y=W(!1),b=W(null),S=null,C=null,w=W(`unknown`),T=W(0),D=W(0),O=W(0);l(()=>{S=window.setInterval(()=>{le.value=new Date().toLocaleTimeString()},1e3),ee(),C=window.setInterval(()=>{ee()},3e4)}),t(()=>{S&&clearInterval(S),C&&clearInterval(C)});let ee=async()=>{try{let e=(await Y.get(`/advert_rate_limit_stats`))?.data;w.value=typeof e?.adaptive?.current_tier==`string`?e.adaptive.current_tier:`unknown`,T.value=e?.stats?.adverts_allowed||0,D.value=e?.stats?.adverts_dropped||0,O.value=Object.keys(e?.active_penalties||{}).length}catch{w.value=`unknown`,T.value=0,D.value=0,O.value=0}},M=P(()=>{switch(w.value){case`quiet`:return`bg-green-100 dark:bg-green-500/20 text-green-700 dark:text-green-400 border-green-500/50`;case`normal`:return`bg-blue-100 dark:bg-blue-500/20 text-blue-700 dark:text-blue-400 border-blue-500/50`;case`busy`:return`bg-yellow-100 dark:bg-yellow-500/20 text-yellow-700 dark:text-yellow-400 border-yellow-500/50`;case`congested`:return`bg-red-100 dark:bg-red-500/20 text-red-700 dark:text-red-400 border-red-500/50`;default:return`bg-gray-100 dark:bg-gray-500/20 text-gray-700 dark:text-gray-400 border-gray-500/50`}}),N={dashboard:Bn,neighbors:ur,statistics:nr,"system-stats":or,sessions:or,configuration:In,"room-servers":In,companions:In,logs:Jn,terminal:Qn,help:Wn},F=[{name:`Dashboard`,icon:`dashboard`,route:`/`},{name:`Neighbors`,icon:`neighbors`,route:`/neighbors`},{name:`Statistics`,icon:`statistics`,route:`/statistics`},{name:`System Stats`,icon:`system-stats`,route:`/system-stats`},{name:`Sessions`,icon:`sessions`,route:`/sessions`},{name:`Configuration`,icon:`configuration`,route:`/configuration`},{name:`Terminal`,icon:`terminal`,route:`/terminal`},{name:`Room Servers`,icon:`room-servers`,route:`/room-servers`},{name:`Companions`,icon:`companions`,route:`/companions`},{name:`Logs`,icon:`logs`,route:`/logs`},{name:`Help`,icon:`help`,route:`/help`}],ne=[{id:`forward`,label:`Forward`,title:`Repeats packets and Room Server and Companion identities can TX.`},{id:`monitor`,label:`Monitor`,title:`Does not repeat packets, can Advert, Room Server and Companion identities can TX.`},{id:`no_tx`,label:`No TX`,title:`No packets transmitted.`}],R=P(()=>e=>f.path===e),B=e=>{d.push(e),V()},V=()=>{c(`update:showMobileSidebar`,!1)},re=()=>{q(),d.push(`/login`),V()},ae=async()=>{m.value=!0,b.value=null;try{await p.sendAdvert(),y.value=!0,setTimeout(()=>{G()},2e3)}catch(e){b.value=e instanceof Error?e.message:`Unknown error occurred`,console.error(`Failed to send advert:`,e)}finally{m.value=!1}},G=()=>{_.value=!1,y.value=!1,b.value=null,m.value=!1},K=async e=>{if(!h.value&&p.currentMode!==e){h.value=!0;try{await p.setMode(e)}catch(e){console.error(`Failed to set mode:`,e)}finally{h.value=!1}}},J=async()=>{if(!g.value){g.value=!0;try{await p.toggleDutyCycle()}catch(e){console.error(`Failed to toggle duty cycle:`,e)}finally{g.value=!1}}},le=W(new Date().toLocaleTimeString()),ue=W(!1),de=P(()=>p.version.includes(`dev`)||p.coreVersion.includes(`dev`)),fe=e=>{let t=e.match(/^([\d.]+)(\.dev(\d+))?((\+g)([a-f0-9]+))?$/);return t?{base:t[1],isDev:!!t[2],devNumber:t[3]||null,commit:t[6]||null}:{base:e,isDev:!1,devNumber:null,commit:null}},X=P(()=>fe(p.version)),Z=P(()=>fe(p.coreVersion)),me=P(()=>{let e=p.dutyCyclePercentage,t=`#A5E5B6`;return e>90?t=`#FB787B`:e>70&&(t=`#FFC246`),{width:e===0?`.125rem`:`${Math.max(e,2)}%`,backgroundColor:t}});return(t,n)=>(U(),H(L,null,[z(`div`,{class:A([`fixed inset-0 z-[1010] lg:hidden transition-opacity duration-300`,e.showMobileSidebar?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`])},[z(`div`,{class:`absolute inset-0 bg-black/30 backdrop-blur-sm dark:bg-black/30`,onClick:V}),z(`div`,{class:A([`absolute left-0 top-0 bottom-0 w-72 p-4 transition-transform duration-300`,e.showMobileSidebar?`translate-x-0`:`-translate-x-full`])},[z(`div`,gi,[z(`div`,_i,[z(`div`,null,[n[3]||=z(`h1`,{class:`text-content-heading dark:text-white text-[1.25rem] font-bold`},` pyMC Repeater `,-1),z(`p`,vi,[I(x(u(p).nodeName)+` `,1),z(`span`,{class:A([`inline-block w-2 h-2 rounded-full ml-2`,u(p).statusBadge.text===`Active`?`bg-accent-green`:u(p).statusBadge.text===`Monitor Mode`?`bg-secondary`:`bg-accent-red`]),title:u(p).statusBadge.title},null,10,yi)]),z(`p`,bi,` <`+x(u(p).pubKey)+`> `,1),z(`div`,xi,[z(`div`,Si,[n[2]||=z(`span`,{class:`text-content-muted text-[10px] uppercase tracking-wide`},`Adaptive`,-1),z(`div`,{class:A([`inline-flex items-center px-2 py-0.5 rounded-full border text-[10px] font-semibold`,M.value])},x(w.value.toUpperCase()),3)]),z(`div`,Ci,[z(`span`,wi,`OK: `+x(T.value),1),z(`span`,Ti,`Drop: `+x(D.value),1),O.value>0?(U(),H(`span`,Ei,`Pen: `+x(O.value),1)):k(``,!0)])])]),z(`button`,{onClick:V,class:`text-content-primary dark:text-content-muted hover:text-content-heading dark:hover:text-white`},` ✕ `)]),n[20]||=z(`div`,{class:`border-t border-stroke dark:border-dark-border mb-4`},null,-1),z(`div`,Di,[n[5]||=z(`p`,{class:`text-content-muted text-xs uppercase mb-2`},`Actions`,-1),z(`button`,{onClick:n[0]||=e=>{_.value=!0,V()},class:`w-full bg-white dark:bg-white/10 rounded-[.625rem] py-3 px-4 flex items-center gap-2 text-sm font-medium text-[#212122] dark:text-white border border-stroke-subtle dark:border-white/10 hover:bg-gray-100 dark:hover:bg-white/20 transition-colors mb-2`},[...n[4]||=[z(`svg`,{class:`w-3.5 h-3.5`,viewBox:`0 0 14 14`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[z(`path`,{d:`M7 0C5.61553 0 4.26216 0.410543 3.11101 1.17971C1.95987 1.94888 1.06266 3.04213 0.532846 4.32122C0.003033 5.6003 -0.13559 7.00777 0.134506 8.36563C0.404603 9.7235 1.07129 10.9708 2.05026 11.9497C3.02922 12.9287 4.2765 13.5954 5.63437 13.8655C6.99224 14.1356 8.3997 13.997 9.67879 13.4672C10.9579 12.9373 12.0511 12.0401 12.8203 10.889C13.5895 9.73785 14 8.38447 14 7C13.998 5.1441 13.2599 3.36479 11.9475 2.05247C10.6352 0.74015 8.8559 0.0020073 7 0V0ZM7 12.8333C5.84628 12.8333 4.71846 12.4912 3.75918 11.8502C2.79989 11.2093 2.05222 10.2982 1.61071 9.23232C1.16919 8.16642 1.05368 6.99353 1.27876 5.86197C1.50384 4.73042 2.05941 3.69102 2.87521 2.87521C3.69102 2.0594 4.73042 1.50383 5.86198 1.27875C6.99353 1.05367 8.16642 1.16919 9.23232 1.6107C10.2982 2.05221 11.2093 2.79989 11.8502 3.75917C12.4912 4.71846 12.8333 5.84628 12.8333 7C12.8316 8.54658 12.2165 10.0293 11.1229 11.1229C10.0293 12.2165 8.54658 12.8316 7 12.8333ZM8.16667 7C8.1676 7.20501 8.11448 7.40665 8.01268 7.58461C7.91087 7.76256 7.76397 7.91054 7.58677 8.01365C7.40957 8.11676 7.20833 8.17136 7.00332 8.17194C6.7983 8.17252 6.59675 8.11906 6.41897 8.01696C6.24119 7.91485 6.09346 7.7677 5.99065 7.59033C5.88784 7.41295 5.83358 7.21162 5.83335 7.0066C5.83312 6.80159 5.88691 6.60013 5.98932 6.42252C6.09172 6.24491 6.23912 6.09743 6.41667 5.99492V3.5H7.58334V5.99492C7.76016 6.09659 7.90713 6.24298 8.00952 6.41939C8.1119 6.5958 8.1661 6.79603 8.16667 7Z`,fill:`currentColor`})],-1),I(` Send Advert `,-1)]])]),z(`div`,Oi,[n[6]||=z(`p`,{class:`text-content-muted text-xs uppercase mb-2`},`Monitoring`,-1),z(`div`,ki,[(U(!0),H(L,null,r(F.slice(0,3),e=>(U(),H(`button`,{key:e.name,onClick:t=>B(e.route),class:A([R.value(e.route)?`bg-primary/20 shadow-[0_0_.375rem_0_rgba(170,232,232,0.20)] text-primary`:`text-content-primary dark:text-white hover:bg-content-primary/10 dark:hover:bg-white/5`,`w-full rounded-[.625rem] py-3 px-4 flex items-center gap-3 text-sm transition-all`])},[(U(),v(s(N[e.icon]),{class:`w-3.5 h-3.5`})),I(` `+x(e.name),1)],10,Ai))),128))])]),z(`div`,ji,[n[7]||=z(`p`,{class:`text-content-muted text-xs uppercase mb-2`},`System`,-1),z(`div`,Mi,[(U(!0),H(L,null,r(F.slice(3,7),e=>(U(),H(`button`,{key:e.name,onClick:t=>B(e.route),class:A([R.value(e.route)?`bg-primary/20 shadow-[0_0_.375rem_0_rgba(170,232,232,0.20)] text-primary`:`text-content-primary dark:text-white hover:bg-content-primary/10 dark:hover:bg-white/5`,`w-full rounded-[.625rem] py-3 px-4 flex items-center gap-3 text-sm transition-all`])},[(U(),v(s(N[e.icon]),{class:`w-3.5 h-3.5`})),I(` `+x(e.name),1)],10,Ni))),128))])]),z(`div`,Pi,[n[8]||=z(`p`,{class:`text-content-muted text-xs uppercase mb-2`},`Room Servers & Companions`,-1),z(`div`,Fi,[(U(!0),H(L,null,r(F.slice(7,9),e=>(U(),H(`button`,{key:e.name,onClick:t=>B(e.route),class:A([R.value(e.route)?`bg-primary/20 shadow-[0_0_.375rem_0_rgba(170,232,232,0.20)] text-primary`:`text-content-primary dark:text-white hover:bg-content-primary/10 dark:hover:bg-white/5`,`w-full rounded-[.625rem] py-3 px-4 flex items-center gap-3 text-sm transition-all`])},[(U(),v(s(N[e.icon]),{class:`w-3.5 h-3.5`})),I(` `+x(e.name),1)],10,Ii))),128))])]),z(`div`,Li,[n[9]||=z(`p`,{class:`text-content-muted text-xs uppercase mb-2`},`Other`,-1),z(`div`,Ri,[(U(!0),H(L,null,r(F.slice(9),e=>(U(),H(`button`,{key:e.name,onClick:t=>B(e.route),class:A([R.value(e.route)?`bg-primary/20 shadow-[0_0_.375rem_0_rgba(170,232,232,0.20)] text-primary`:`text-content-primary dark:text-white hover:bg-content-primary/10 dark:hover:bg-white/5`,`w-full rounded-[.625rem] py-3 px-4 flex items-center gap-3 text-sm transition-all`])},[(U(),v(s(N[e.icon]),{class:`w-3.5 h-3.5`})),I(` `+x(e.name),1)],10,zi))),128))])]),a.value?(U(),v(u(i),{key:0,"current-value":u(p).noiseFloorDbm||-116,"update-interval":3e3,limit:50,class:`mb-4`},null,8,[`current-value`])):k(``,!0),z(`div`,Bi,[n[10]||=z(`p`,{class:`text-content-muted text-xs uppercase mb-2`},`Mode`,-1),z(`div`,Vi,[(U(),H(L,null,r(ne,e=>z(`button`,{key:e.id,type:`button`,title:e.title,disabled:h.value,onClick:t=>K(e.id),class:A([`flex-1 py-2.5 px-2 text-xs font-medium transition-all duration-200 border-r border-stroke dark:border-white/10 last:border-r-0`,h.value?`opacity-60 cursor-not-allowed`:`cursor-pointer`,u(p).currentMode===e.id?e.id===`forward`?`bg-mode-segment-forward text-accent-green`:e.id===`monitor`?`bg-amber-500/20 text-amber-600 dark:text-amber-400`:`bg-mode-segment-no-tx text-accent-red`:`text-content-primary dark:text-white hover:bg-white/10 dark:hover:bg-white/10`])},x(h.value&&u(p).currentMode!==e.id?`…`:e.label),11,Hi)),64))])]),z(`button`,{onClick:J,disabled:g.value,class:A([`p-4 flex items-center justify-between mb-3 w-full transition-all duration-200 cursor-pointer group`,u(p).dutyCycleButtonState.warning?`glass-card-orange hover:bg-accent-red/10`:`glass-card-green hover:bg-accent-green/10`])},[z(`div`,Wi,[j(mr,{class:`w-3.5 h-3.5 text-content-primary dark:text-white group-hover:text-primary transition-colors`}),n[11]||=z(`span`,{class:`text-content-primary dark:text-white text-sm group-hover:text-primary transition-colors`},`Duty Cycle`,-1)]),z(`span`,{class:A([`text-xs font-medium group-hover:text-primary dark:group-hover:text-white transition-colors`,u(p).dutyCycleButtonState.warning?`text-accent-red`:`text-primary`])},x(g.value?`Changing...`:u(p).dutyCycleEnabled?`Enabled`:`Disabled`),3)],10,Ui),z(`button`,{onClick:re,class:`w-full glass-card-orange hover:bg-accent-red/10 rounded-[.625rem] py-3 px-4 flex items-center justify-center gap-2 text-sm font-medium text-content-primary dark:text-white transition-all mb-4`},[...n[12]||=[z(`svg`,{class:`w-4 h-4`,viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,xmlns:`http://www.w3.org/2000/svg`},[z(`path`,{d:`M13 3H15C16.1046 3 17 3.89543 17 5V15C17 16.1046 16.1046 17 15 17H13M8 7L4 10.5M4 10.5L8 14M4 10.5H13`,"stroke-linecap":`round`,"stroke-linejoin":`round`})],-1),I(` Logout `,-1)]]),z(`div`,Gi,[z(`div`,{onClick:n[1]||=e=>ue.value=!ue.value,class:`flex items-center gap-2 cursor-pointer group`},[z(`span`,{class:A([`glass-card px-2 py-1 text-xs font-medium rounded border transition-all duration-200`,`border-stroke dark:border-dark-border`,X.value.isDev?`text-secondary bg-secondary-bg/20 dark:bg-secondary-bg/10 border-secondary/40`:`text-content-muted`])},` R:v`+x(X.value.base)+x(X.value.isDev?`.dev${X.value.devNumber}`:``),3),z(`span`,{class:A([`glass-card px-2 py-1 text-xs font-medium rounded border transition-all duration-200`,`border-stroke dark:border-dark-border`,Z.value.isDev?`text-secondary bg-secondary-bg/20 dark:bg-secondary-bg/10 border-secondary/40`:`text-content-muted`])},` C:v`+x(Z.value.base)+x(Z.value.isDev?`.dev${Z.value.devNumber}`:``),3),de.value?(U(),H(`svg`,{key:0,class:A([`w-3 h-3 text-content-muted transition-transform duration-200`,ue.value?`rotate-180`:``]),fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[...n[13]||=[z(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19 9l-7 7-7-7`},null,-1)]],2)):k(``,!0)]),ue.value?(U(),H(`div`,Ki,[z(`div`,qi,[z(`div`,Ji,[n[14]||=z(`span`,{class:`text-content-muted font-medium`},`Repeater:`,-1),z(`span`,Yi,`v`+x(X.value.base),1)]),X.value.isDev?(U(),H(`div`,Xi,[z(`div`,null,`Dev Build: `+x(X.value.devNumber),1),X.value.commit?(U(),H(`div`,Zi,[n[15]||=z(`span`,null,`Commit:`,-1),z(`code`,Qi,x(X.value.commit),1)])):k(``,!0)])):k(``,!0)]),n[18]||=z(`div`,{class:`border-t border-stroke-subtle dark:border-stroke/20`},null,-1),z(`div`,$i,[z(`div`,ea,[n[16]||=z(`span`,{class:`text-content-muted font-medium`},`Core:`,-1),z(`span`,ta,`v`+x(Z.value.base),1)]),Z.value.isDev?(U(),H(`div`,na,[z(`div`,null,`Dev Build: `+x(Z.value.devNumber),1),Z.value.commit?(U(),H(`div`,ra,[n[17]||=z(`span`,null,`Commit:`,-1),z(`code`,ia,x(Z.value.commit),1)])):k(``,!0)])):k(``,!0)])])):k(``,!0)]),n[21]||=z(`div`,{class:`border-t border-accent-green mb-4`},null,-1),u(p).dutyCycleEnabled?(U(),H(`div`,aa,[z(`p`,oa,[n[19]||=I(` Duty Cycle: `,-1),z(`span`,sa,x(u(p).dutyCycleUtilization.toFixed(1))+`% / `+x(u(p).dutyCycleMax.toFixed(1))+`%`,1)]),z(`div`,ca,[z(`div`,{class:`h-full rounded-full transition-all duration-300`,style:ie(me.value)},null,4)])])):k(``,!0),z(`p`,la,`Last Updated: `+x(le.value),1)])],2)],2),j(Mn,{isOpen:_.value,isLoading:m.value,isSuccess:y.value,error:b.value,onClose:G,onSend:ae},null,8,[`isOpen`,`isLoading`,`isSuccess`,`error`])],64))}}),da=[`aria-label`,`title`],fa={key:0,xmlns:`http://www.w3.org/2000/svg`,class:`w-5 h-5 text-yellow-600 dark:text-yellow-400`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`2`},pa={key:1,xmlns:`http://www.w3.org/2000/svg`,class:`w-5 h-5 text-content-secondary dark:text-content`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,"stroke-width":`2`},ma=T({__name:`ThemeToggle`,setup(e){let{theme:t,toggleTheme:n}=me();return(e,r)=>(U(),H(`button`,{onClick:r[0]||=(...e)=>u(n)&&u(n)(...e),class:`w-[35px] h-[35px] rounded bg-background-mute dark:bg-surface-elevated flex items-center justify-center hover:bg-stroke-subtle dark:hover:bg-stroke/30 transition-colors`,"aria-label":u(t)===`dark`?`Switch to light mode`:`Switch to dark mode`,title:u(t)===`dark`?`Switch to light mode`:`Switch to dark mode`},[u(t)===`dark`?(U(),H(`svg`,fa,[...r[1]||=[z(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z`},null,-1)]])):(U(),H(`svg`,pa,[...r[2]||=[z(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,d:`M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z`},null,-1)]]))],8,da))}}),ha={class:`flex items-center justify-between p-6 pb-0 shrink-0`},ga={class:`p-6 space-y-5 overflow-y-auto flex-1`},_a={class:`grid grid-cols-2 gap-3`},va={class:`bg-background-mute dark:bg-background-mute rounded-xl p-3 border border-stroke-subtle dark:border-stroke/10`},ya={class:`text-sm font-mono font-medium text-content-primary dark:text-content-primary`},ba={key:0,class:`flex items-center gap-1.5 mt-1`},xa={key:0,class:`flex items-start gap-3 bg-amber-50 dark:bg-amber-500/10 border border-amber-200 dark:border-amber-500/30 rounded-xl p-3`},Sa={class:`text-xs text-amber-800 dark:text-amber-300`},Ca={class:`font-mono font-semibold`},wa={key:1,class:`flex items-center gap-2 bg-green-50 dark:bg-surface border border-green-200 dark:border-accent-green/30 border-l-2 border-l-green-600 dark:border-l-accent-green rounded-xl p-3 text-sm text-green-800 dark:text-content-primary`},Ta={key:2,class:`space-y-1`},Ea={class:`flex items-center gap-1`},Da={key:0,class:`w-3 h-3 border-2 border-primary border-t-transparent rounded-full animate-spin inline-block`},Oa={key:1,class:`text-content-muted`},ka={key:0,class:`bg-background-mute dark:bg-black/30 rounded-xl border border-stroke-subtle dark:border-stroke/10 overflow-hidden`},Aa={class:`max-h-52 overflow-y-auto divide-y divide-stroke-subtle dark:divide-stroke/10`},ja=[`href`],Ma={class:`font-mono text-[10px] text-content-muted shrink-0 mt-0.5 pt-px`},Na={class:`min-w-0 flex-1`},Pa={class:`text-xs text-content-primary truncate group-hover:text-primary transition-colors`},Fa={class:`text-[10px] text-content-muted mt-0.5`},Ia={class:`space-y-2`},La={class:`flex gap-2`},Ra=[`disabled`],za=[`value`],Ba=[`disabled`],Va={key:0,class:`text-xs text-accent-green`},Ha={key:1,class:`text-xs text-accent-red`},Ua={key:3,class:`space-y-2`},Wa={class:`flex items-center justify-between`},Ga={key:0,class:`flex items-center gap-1 text-xs text-primary`},Ka={key:1,class:`flex items-center gap-1 text-xs text-primary`},qa={key:2,class:`flex items-center gap-1 text-xs text-yellow-500`},Ja={key:3,class:`text-xs text-accent-green font-medium`},Ya={key:4,class:`text-xs text-accent-red font-medium`},Xa={key:0,class:`w-2 h-4 bg-green-400 animate-pulse inline-block ml-1`},Za={key:1,class:`flex items-center gap-2 mt-2 text-primary`},Qa={key:2,class:`flex items-center gap-2 mt-2 text-yellow-400`},$a={key:3,class:`text-content-muted animate-pulse`},eo={key:0,class:`text-xs text-accent-red`},to={key:4,class:`flex items-center gap-3 bg-primary/5 dark:bg-primary/10 border border-primary/20 rounded-xl p-3 text-sm text-primary`},no={key:5},ro={class:`flex items-center gap-3 bg-yellow-50 dark:bg-yellow-500/10 border border-yellow-200 dark:border-yellow-500/30 rounded-xl p-3 text-sm text-yellow-800 dark:text-yellow-400`},io={class:`font-medium`},ao={class:`text-xs opacity-70 mt-0.5`},oo={key:6,class:`bg-green-50 dark:bg-surface-elevated border border-green-200 dark:border-accent-green/40 rounded-xl p-4`},so={class:`flex items-center gap-3`},co={class:`text-xs text-gray-600 dark:text-content-muted mt-0.5`},lo={class:`font-mono font-semibold`},uo={key:7,class:`bg-red-50 dark:bg-accent-red/10 border border-accent-red/40 rounded-xl p-4 space-y-3`},fo={class:`flex items-center gap-3`},po={class:`flex-1 min-w-0`},mo={class:`text-xs text-accent-red/80 mt-0.5`},ho={key:0,class:`grid grid-cols-2 gap-2 text-xs`},go={class:`bg-white/50 dark:bg-black/20 rounded-lg px-3 py-2`},_o={class:`font-mono font-semibold text-content-primary`},vo={class:`bg-white/50 dark:bg-black/20 rounded-lg px-3 py-2`},yo={class:`font-mono font-semibold text-accent-red`},bo={class:`p-6 pt-0 flex items-center gap-3 shrink-0`},xo=[`disabled`],So={key:0,class:`flex items-center justify-center gap-2`},Co={key:1,class:`flex items-center justify-center gap-2`},wo={key:2},To=T({__name:`UpdateModal`,props:{show:{type:Boolean},currentVersion:{default:``},latestVersion:{default:``},hasUpdate:{type:Boolean,default:!1},rateLimitUntil:{default:null}},emits:[`close`,`installed`,`version-updated`],setup(e,{emit:n}){let i=e,a=n,o=W(i.currentVersion),s=W(i.latestVersion),c=W(i.hasUpdate);te(()=>i.currentVersion,e=>{o.value=e}),te(()=>i.latestVersion,e=>{s.value=e}),te(()=>i.hasUpdate,e=>{c.value=e});let l=W([`main`]),u=W(`main`),d=W(``),f=W(``),p=W(!1),m=W(!1),h=W([]),g=W(!1),_=W(!0),y=W(`idle`),b=W(null),S=W([]),C=W(null),w=W(!1),T=W(null),E=W(null),O=null,j=W(!1),M=null,N=P(()=>y.value===`idle`||y.value===`error`||y.value===`verify-failed`),F=P(()=>{switch(y.value){case`installing`:return`Installing…`;case`restarting`:return`Restarting…`;case`verified`:return`Installed ✓`;case`verify-failed`:return`Retry Install`;case`complete`:return`Installed ✓`;case`error`:return`Retry Install`;default:return c.value?`Install Update`:`Force Reinstall`}});function ne(){C.value&&(C.value.scrollTop=C.value.scrollHeight)}function R(e){S.value.push(e),S.value.length>500&&S.value.splice(0,S.value.length-500),setTimeout(ne,20)}function B(){O&&=(O.close(),null)}async function V(){g.value=!0,h.value=[];try{let e=await Y.get(`/update/changelog`);e.success&&Array.isArray(e.commits)&&(h.value=e.commits)}catch{}finally{g.value=!1}}async function re(){p.value=!0,f.value=``;try{let e=await Y.get(`/update/channels`);e.success&&Array.isArray(e.channels)&&(l.value=e.channels,u.value=e.current_channel??`main`)}catch{l.value=[`main`],f.value=`Could not load channels from GitHub`}finally{p.value=!1}}async function ie(){if(u.value){d.value=``,f.value=``;try{let e=await Y.post(`/update/set_channel`,{channel:u.value});if(!e.success){f.value=e.error??`Failed to set channel`;return}d.value=`Switched to '${u.value}' — checking version…`,y.value=`idle`,b.value=null,S.value=[],m.value=!0,s.value=``,c.value=!1;try{await Y.post(`/update/check`);for(let e=0;e<24;e++){let e=await Y.get(`/update/status`);if(e.success&&e.state!==`checking`){o.value=e.current_version??o.value,s.value=e.latest_version??``,c.value=!!e.has_update,d.value=`Switched to '${u.value}'`,a(`version-updated`,{currentVersion:o.value,latestVersion:s.value,hasUpdate:c.value}),V();break}await new Promise(e=>setTimeout(e,500))}}catch{d.value=`Switched to '${u.value}' (version check failed)`}finally{m.value=!1}}catch(e){f.value=e?.message??`Failed to set channel`}}}async function ae(){if(!N.value)return;y.value=`installing`,b.value=null,S.value=[];try{let e=await Y.post(`/update/install`,{force:!c.value});if(!e.success){y.value=`error`,b.value=e.error??`Failed to start install`;return}}catch(e){y.value=`error`,b.value=e?.message??`Network error`;return}B();let e=fe(),t=e?`/api/update/progress?token=${encodeURIComponent(e)}`:`/api/update/progress`;O=new EventSource(t),O.onmessage=e=>{try{let t=JSON.parse(e.data);switch(t.type){case`line`:{let e=t.line??``;R(e),e.includes(`Restarting service`)&&(j.value=!0,M||=setTimeout(()=>{M=null,(y.value===`installing`||y.value===`complete`)&&(B(),y.value=`restarting`,R(`[pyMC updater] Service is restarting — waiting for it to come back…`),G())},8e3));break}case`status`:t.state===`error`?y.value=`error`:t.state===`complete`&&(j.value=!0,y.value=`complete`);break;case`done`:B(),M&&=(clearTimeout(M),null),t.state===`complete`?(y.value=`restarting`,G()):(y.value=`error`,t.error&&(b.value=t.error));break}}catch{}},O.onerror=()=>{if(B(),M&&=(clearTimeout(M),null),j.value&&y.value!==`error`){y.value=`restarting`,R(`[pyMC updater] Connection lost — waiting for service restart…`),G();return}y.value===`installing`&&(y.value=`error`,b.value=`Progress stream disconnected`)}}async function G(){let e=s.value;E.value=`going-down`;let t=Date.now()+2e4,n=!1;for(;Date.now()setTimeout(e,1e3));try{await Y.get(`/update/status`)}catch{n=!0;break}}n||R(`[pyMC updater] Service did not appear to stop — assuming fast restart`),E.value=`coming-up`;let r=Date.now()+6e4;for(;Date.now()setTimeout(e,2e3));try{let t=await Y.get(`/update/status`);if(!t?.success)continue;E.value=`verifying`,await new Promise(e=>setTimeout(e,1200));let n=t.current_version??``;T.value=n,o.value=n||o.value,a(`version-updated`,{currentVersion:o.value,latestVersion:s.value,hasUpdate:!!t.has_update}),n&&e&&n===e?(y.value=`verified`,c.value=!1,E.value=null,a(`installed`)):(y.value=`verify-failed`,E.value=null);return}catch{}}y.value=`verify-failed`,E.value=null,b.value=`Service did not respond after restart — check logs`}te(()=>i.show,e=>{e?(y.value=`idle`,b.value=null,S.value=[],w.value=!1,T.value=null,E.value=null,j.value=!1,M&&=(clearTimeout(M),null),d.value=``,f.value=``,o.value=i.currentVersion,s.value=i.latestVersion,c.value=i.hasUpdate,re(),V()):B()}),t(()=>{B(),M&&=(clearTimeout(M),null)});function K(e){e.target===e.currentTarget&&y.value!==`installing`&&y.value!==`restarting`&&a(`close`)}function oe(){window.location.reload()}return(e,t)=>(U(),v(D,{to:`body`},[i.show?(U(),H(`div`,{key:0,class:`fixed inset-0 bg-black/50 backdrop-blur-sm z-[99999] flex items-center justify-center p-4`,onClick:K},[z(`div`,{class:`bg-white dark:bg-surface-elevated rounded-[20px] w-full max-w-lg border border-stroke-subtle dark:border-white/10 shadow-2xl flex flex-col max-h-[90vh]`,onClick:t[5]||=Nt(()=>{},[`stop`])},[z(`div`,ha,[t[7]||=z(`div`,{class:`flex items-center gap-3`},[z(`div`,{class:`w-10 h-10 rounded-xl bg-primary/10 flex items-center justify-center`},[z(`svg`,{class:`w-5 h-5 text-primary`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[z(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12`})])]),z(`div`,null,[z(`h3`,{class:`text-lg font-semibold text-content-primary dark:text-content-primary`},` OTA Update `),z(`p`,{class:`text-xs text-content-muted dark:text-content-muted`},` Update over the air from GitHub `)])],-1),y.value!==`installing`&&y.value!==`restarting`?(U(),H(`button`,{key:0,onClick:t[0]||=e=>a(`close`),class:`text-content-secondary hover:text-content-primary transition-colors`},[...t[6]||=[z(`svg`,{class:`w-6 h-6`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[z(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M6 18L18 6M6 6l12 12`})],-1)]])):k(``,!0)]),z(`div`,ga,[z(`div`,_a,[z(`div`,va,[t[8]||=z(`p`,{class:`text-xs text-content-muted mb-1`},`Installed`,-1),z(`p`,ya,x(o.value||`—`),1)]),z(`div`,{class:A([`bg-background-mute dark:bg-background-mute rounded-xl p-3 border border-stroke-subtle dark:border-stroke/10`,c.value?`border-l-2 border-l-accent-red`:`border-l-2 border-l-accent-green`])},[t[10]||=z(`p`,{class:`text-xs text-content-muted mb-1`},`On GitHub`,-1),m.value?(U(),H(`div`,ba,[...t[9]||=[z(`span`,{class:`w-3 h-3 border-2 border-primary border-t-transparent rounded-full animate-spin inline-block`},null,-1),z(`span`,{class:`text-xs text-content-muted`},`Checking…`,-1)]])):(U(),H(`p`,{key:1,class:A([`text-sm font-mono font-medium`,c.value?`text-accent-red`:`text-accent-green`])},x(s.value||`—`),3))],2)]),i.rateLimitUntil?(U(),H(`div`,xa,[t[14]||=z(`svg`,{class:`w-4 h-4 shrink-0 mt-0.5 text-amber-600 dark:text-amber-400`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[z(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z`})],-1),z(`div`,Sa,[t[13]||=z(`p`,{class:`font-semibold mb-0.5`},`GitHub API rate limit reached`,-1),z(`p`,null,[t[11]||=I(` Version checks are paused until `,-1),z(`span`,Ca,x(new Date(i.rateLimitUntil).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})),1),t[12]||=I(`. This is a GitHub limit, not a software issue. You can still install or switch channels manually. `,-1)])])])):k(``,!0),!c.value&&o.value&&!m.value?(U(),H(`div`,wa,[...t[15]||=[z(`svg`,{class:`w-4 h-4 shrink-0`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[z(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 13l4 4L19 7`})],-1),I(` You are up to date. Use `,-1),z(`em`,{class:`mx-1`},`Force Reinstall`,-1),I(` to reinstall anyway. `,-1)]])):k(``,!0),h.value.length>0||g.value?(U(),H(`div`,Ta,[z(`button`,{onClick:t[1]||=e=>_.value=!_.value,class:`flex items-center justify-between w-full text-xs font-medium text-content-secondary dark:text-content-secondary uppercase tracking-wide py-1 hover:text-content-primary transition-colors`},[t[17]||=z(`span`,null,`What's New`,-1),z(`span`,Ea,[g.value?(U(),H(`span`,Da)):(U(),H(`span`,Oa,x(h.value.length)+` commit`+x(h.value.length===1?``:`s`),1)),(U(),H(`svg`,{class:A([`w-3.5 h-3.5 text-content-muted transition-transform`,_.value?`rotate-180`:``]),viewBox:`0 0 20 20`,fill:`currentColor`},[...t[16]||=[z(`path`,{"fill-rule":`evenodd`,d:`M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z`,"clip-rule":`evenodd`},null,-1)]],2))])]),_.value?(U(),H(`div`,ka,[z(`div`,Aa,[(U(!0),H(L,null,r(h.value,e=>(U(),H(`a`,{key:e.sha,href:e.url,target:`_blank`,class:`flex gap-3 px-3 py-2.5 hover:bg-background-soft dark:hover:bg-surface/50 transition-colors group`},[z(`span`,Ma,x(e.short_sha),1),z(`div`,Na,[z(`p`,Pa,x(e.title),1),z(`p`,Fa,x(e.author)+` · `+x(e.date?new Date(e.date).toLocaleDateString():``),1)]),t[18]||=z(`svg`,{class:`w-3 h-3 text-content-muted shrink-0 mt-1 opacity-0 group-hover:opacity-100 transition-opacity`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`},[z(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14`})],-1)],8,ja))),128))])])):k(``,!0)])):k(``,!0),z(`div`,Ia,[t[19]||=z(`label`,{class:`text-xs font-medium text-content-secondary dark:text-content-secondary uppercase tracking-wide`},` Release Channel `,-1),z(`div`,La,[ee(z(`select`,{"onUpdate:modelValue":t[2]||=e=>u.value=e,disabled:p.value||y.value===`installing`||m.value,class:`flex-1 bg-background-mute dark:bg-surface border border-stroke-subtle dark:border-stroke/20 rounded-xl px-3 py-2 text-sm text-content-primary dark:text-content-primary disabled:opacity-50 focus:outline-none focus:ring-1 focus:ring-primary`},[(U(!0),H(L,null,r(l.value,e=>(U(),H(`option`,{key:e,value:e},x(e),9,za))),128))],8,Ra),[[Dt,u.value]]),z(`button`,{onClick:ie,disabled:p.value||y.value===`installing`||m.value,class:`px-4 py-2 bg-primary/10 hover:bg-primary/20 text-primary rounded-xl text-sm font-medium disabled:opacity-50 transition-colors`},x(p.value||m.value?`…`:`Apply`),9,Ba)]),d.value?(U(),H(`p`,Va,x(d.value),1)):k(``,!0),f.value?(U(),H(`p`,Ha,x(f.value),1)):k(``,!0),t[20]||=z(`p`,{class:`text-xs text-content-muted`},[z(`em`,null,`main`),I(` = stable releases \xA0|\xA0 `),z(`em`,null,`dev`),I(` = latest commits (may be unstable) `)],-1)]),y.value===`installing`||y.value===`restarting`||S.value.length>0&&(w.value||y.value===`error`)?(U(),H(`div`,Ua,[z(`div`,Wa,[t[24]||=z(`label`,{class:`text-xs font-medium text-content-secondary uppercase tracking-wide`},`Install Log`,-1),y.value===`installing`?(U(),H(`span`,Ga,[...t[21]||=[z(`span`,{class:`inline-block w-2 h-2 rounded-full bg-primary animate-pulse`},null,-1),I(` Running… `,-1)]])):y.value===`restarting`&&E.value===`verifying`?(U(),H(`span`,Ka,[...t[22]||=[z(`span`,{class:`inline-block w-2 h-2 rounded-full bg-primary animate-pulse`},null,-1),I(` Checking version… `,-1)]])):y.value===`restarting`?(U(),H(`span`,qa,[t[23]||=z(`span`,{class:`inline-block w-2 h-2 rounded-full bg-yellow-500 animate-pulse`},null,-1),I(` `+x(E.value===`going-down`?`Stopping service…`:`Waiting for service…`),1)])):y.value===`verified`?(U(),H(`span`,Ja,`Complete ✓`)):y.value===`verify-failed`||y.value===`error`?(U(),H(`span`,Ya,`Failed ✗`)):k(``,!0)]),z(`div`,{ref_key:`logContainer`,ref:C,class:`bg-zinc-900 dark:bg-black/60 rounded-xl p-3 h-52 overflow-y-auto font-mono text-xs text-green-400 leading-relaxed border border-stroke/20`},[(U(!0),H(L,null,r(S.value,(e,t)=>(U(),H(`div`,{key:t,class:A([`whitespace-pre-wrap break-all`,{"text-accent-red":e.includes(`✗`)||e.includes(`error`)||e.includes(`ERROR`)||e.includes(`Failed`),"text-yellow-400":e.includes(`WARNING`)||e.includes(`⚠`),"text-accent-green":e.includes(`✓`)||e.includes(`Successfully`),"text-content-muted/60":e.includes(`keepalive`)}])},x(e),3))),128)),y.value===`installing`?(U(),H(`div`,Xa)):k(``,!0),y.value===`restarting`&&E.value===`verifying`?(U(),H(`div`,Za,[...t[25]||=[z(`span`,{class:`w-3 h-3 border-2 border-primary border-t-transparent rounded-full animate-spin inline-block`},null,-1),I(` Service is back — verifying version… `,-1)]])):y.value===`restarting`?(U(),H(`div`,Qa,[t[26]||=z(`span`,{class:`w-3 h-3 border-2 border-yellow-400 border-t-transparent rounded-full animate-spin inline-block`},null,-1),I(` `+x(E.value===`going-down`?`Waiting for service to stop…`:`Waiting for service to come back up…`),1)])):k(``,!0),S.value.length===0&&y.value===`installing`?(U(),H(`div`,$a,` Waiting for output… `)):k(``,!0)],512),b.value?(U(),H(`p`,eo,x(b.value),1)):k(``,!0)])):k(``,!0),y.value===`restarting`&&E.value===`verifying`?(U(),H(`div`,to,[...t[27]||=[z(`span`,{class:`w-4 h-4 border-2 border-primary border-t-transparent rounded-full animate-spin shrink-0`},null,-1),z(`div`,null,[z(`p`,{class:`font-medium`},`Checking version…`),z(`p`,{class:`text-xs opacity-70 mt-0.5`},` Confirming the installed version matches the target `)],-1)]])):y.value===`restarting`&&S.value.length===0?(U(),H(`div`,no,[z(`div`,ro,[t[28]||=z(`span`,{class:`w-4 h-4 border-2 border-yellow-500 border-t-transparent rounded-full animate-spin shrink-0`},null,-1),z(`div`,null,[z(`p`,io,x(E.value===`going-down`?`Stopping service…`:`Starting service…`),1),z(`p`,ao,x(E.value===`going-down`?`Waiting for the old process to exit`:`Waiting for the service to become healthy`),1)])])])):k(``,!0),y.value===`verified`?(U(),H(`div`,oo,[z(`div`,so,[t[31]||=z(`div`,{class:`w-9 h-9 rounded-full bg-accent-green flex items-center justify-center shrink-0`},[z(`svg`,{class:`w-5 h-5 text-white`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[z(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2.5`,d:`M5 13l4 4L19 7`})])],-1),z(`div`,null,[t[30]||=z(`p`,{class:`font-semibold text-gray-900 dark:text-content-primary`},` Installed successfully! `,-1),z(`p`,co,[t[29]||=I(` Running version `,-1),z(`span`,lo,x(T.value),1)])])]),z(`button`,{onClick:oe,class:`mt-3 w-full py-2 px-4 rounded-xl text-sm font-semibold text-white bg-primary hover:bg-primary/90 transition-colors`},` Refresh Page to Load New Version `)])):k(``,!0),y.value===`verify-failed`?(U(),H(`div`,uo,[z(`div`,fo,[t[33]||=z(`div`,{class:`w-9 h-9 rounded-full bg-accent-red/15 flex items-center justify-center shrink-0`},[z(`svg`,{class:`w-5 h-5 text-accent-red`,fill:`none`,stroke:`currentColor`,viewBox:`0 0 24 24`},[z(`path`,{"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2.5`,d:`M6 18L18 6M6 6l12 12`})])],-1),z(`div`,po,[t[32]||=z(`p`,{class:`font-semibold text-accent-red`},`Installation may have failed`,-1),z(`p`,mo,x(b.value||`Version mismatch after restart`),1)])]),T.value||s.value?(U(),H(`div`,ho,[z(`div`,go,[t[34]||=z(`p`,{class:`text-content-muted mb-0.5`},`Expected`,-1),z(`p`,_o,x(s.value||`—`),1)]),z(`div`,vo,[t[35]||=z(`p`,{class:`text-content-muted mb-0.5`},`Reported`,-1),z(`p`,yo,x(T.value||`unknown`),1)])])):k(``,!0),S.value.length>0?(U(),H(`button`,{key:1,onClick:t[3]||=e=>w.value=!w.value,class:`w-full text-xs text-accent-red/70 hover:text-accent-red underline underline-offset-2 hover:no-underline transition-all`},x(w.value?`Hide install log`:`View install log`),1)):k(``,!0)])):k(``,!0)]),z(`div`,bo,[z(`button`,{onClick:ae,disabled:!N.value,class:A([`flex-1 py-3 rounded-xl font-semibold text-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed`,y.value===`verified`||y.value===`complete`?`bg-accent-green/20 text-accent-green cursor-default`:y.value===`error`||y.value===`verify-failed`?`bg-accent-red hover:bg-accent-red/80 text-white`:y.value===`restarting`?`bg-yellow-500/20 text-yellow-600 cursor-default`:`bg-primary hover:bg-primary/80 text-white`])},[y.value===`installing`?(U(),H(`span`,So,[...t[36]||=[z(`span`,{class:`w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin`},null,-1),I(` Installing… `,-1)]])):y.value===`restarting`?(U(),H(`span`,Co,[...t[37]||=[z(`span`,{class:`w-4 h-4 border-2 border-yellow-600 border-t-transparent rounded-full animate-spin`},null,-1),I(` Restarting service… `,-1)]])):(U(),H(`span`,wo,x(F.value),1))],10,xo),y.value!==`installing`&&y.value!==`restarting`?(U(),H(`button`,{key:0,onClick:t[4]||=e=>a(`close`),class:`px-6 py-3 rounded-xl border border-stroke-subtle dark:border-stroke/20 text-content-secondary hover:text-content-primary hover:bg-background-mute transition-colors text-sm`},` Close `)):k(``,!0)])])])):k(``,!0)]))}}),Eo={class:`glass-card p-3 sm:p-6 mb-5 rounded-[20px] relative z-10`},Do={class:`flex justify-between items-center`},Oo={class:`flex items-center gap-3`},ko={class:`hidden sm:block`},Ao={class:`text-content-primary dark:text-content-primary text-2xl lg:text-[35px] font-bold mb-1 sm:mb-2`},jo={class:`flex items-center gap-3 sm:gap-4`},Mo={class:`text-right`,style:{"min-width":`180px`}},No={key:0,class:`flex items-center gap-2 justify-end`},Po={key:1,class:`space-y-1`},Fo={class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},Io={class:`text-primary font-medium`},Lo={key:0,class:`text-xs text-content-muted dark:text-content-muted/80`,style:{"min-height":`16px`}},Ro={key:0},zo={key:2},Bo={key:0,class:`text-xs text-content-muted dark:text-content-muted/60 hidden sm:block`,style:{"min-height":`16px`}},Vo={key:0,class:`absolute right-0 top-10 z-[100] w-48 bg-surface dark:bg-surface-elevated border border-stroke-subtle dark:border-stroke/20 rounded-xl shadow-2xl overflow-hidden`},Ho=[`disabled`],Uo={key:0,class:`w-4 h-4 text-content-secondary`,viewBox:`0 0 20 20`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,xmlns:`http://www.w3.org/2000/svg`},Wo={key:1,class:`animate-spin rounded-full h-4 w-4 border-b-2 border-primary`},Go={class:`flex items-center justify-between mb-3`},Ko={class:`flex items-center gap-2`},qo=[`disabled`],Jo=[`disabled`],Yo={class:`space-y-3 text-sm`},Xo={key:0,class:`bg-red-50 dark:bg-background-mute p-3 rounded-lg border border-accent-red/30 border-l-2 border-l-accent-red`},Zo={class:`flex items-center justify-between`},Qo={class:`text-accent-red font-bold`},$o={class:`text-xs text-content-muted dark:text-content-muted mt-1`},es={class:`mt-2 flex items-center gap-2`},ts=[`disabled`],ns={key:1,class:`flex items-start gap-2 bg-amber-50 dark:bg-amber-500/10 border border-amber-200 dark:border-amber-500/30 border-l-2 border-l-amber-500 rounded-lg p-3 text-xs text-amber-800 dark:text-amber-300`},rs={key:2,class:`bg-green-50 dark:bg-background-mute p-3 rounded-lg border border-stroke-subtle dark:border-stroke/10 border-l-2 border-l-accent-green`},is={class:`flex items-center justify-between`},as={class:`text-accent-green font-bold`},os={key:0,class:`text-xs text-content-muted dark:text-content-muted mt-1`},ss={class:`mt-2 flex items-center gap-2`},cs=[`disabled`],ls={key:3,class:`bg-background-mute dark:bg-background-mute p-3 rounded-lg border border-stroke-subtle dark:border-stroke/10`},us={key:4,class:`bg-red-50 dark:bg-background-mute p-3 rounded-lg border border-accent-red/30 border-l-2 border-l-accent-red`},ds={class:`text-xs text-content-secondary dark:text-content-muted`},fs={class:`bg-background-mute dark:bg-background-mute p-3 rounded-lg border border-stroke-subtle dark:border-stroke/10 border-l-2 border-l-primary`},ps={class:`flex items-center justify-between`},ms={class:`text-primary font-bold`},hs={key:0,class:`text-xs text-content-muted dark:text-content-muted mt-1`},gs={class:`flex items-center justify-between`},_s={class:`text-content-primary dark:text-content-primary font-medium`},vs={key:0,class:`mt-2`},ys={class:`text-xs text-content-muted dark:text-content-muted`},bs={class:`text-content-secondary dark:text-content-secondary`},xs={key:5,class:`bg-background-mute dark:bg-background-mute p-4 rounded-lg border border-stroke-subtle dark:border-stroke/10 text-center`},Ss={key:6,class:`bg-background-mute dark:bg-background-mute p-3 rounded-lg border border-stroke-subtle dark:border-stroke/10 text-center`},Cs={key:0,class:`fixed inset-0 z-[9999] bg-black/60 backdrop-blur-sm flex items-center justify-center`},ws={class:`bg-surface dark:bg-surface-elevated rounded-2xl p-8 shadow-2xl max-w-sm w-full mx-4 text-center border border-stroke-subtle dark:border-stroke/20`},Ts={key:0,class:`mb-4`},Es={key:1,class:`mb-4`},Ds={class:`text-sm text-content-secondary dark:text-content-muted`},Os={key:2,class:`mt-4 flex items-center justify-center gap-3`},ks=Z(T({name:`TopBar`,__name:`TopBar`,emits:[`toggleMobileSidebar`],setup(e,{emit:t}){let n=t,i=oe(),a=pe(),o=W(!1),s=W(null),c=W(!1),u=W(!1),d=W(null),f=W(!1),p=W(``),m=W(!1),h=W({hasUpdate:!1,currentVersion:``,latestVersion:``,isChecking:!1,lastChecked:null,error:null,rateLimitUntil:null}),g=W({}),_=W(!0),y=W(null),b=W(J()||`User`),S=[`Chat Node`,`Repeater`,`Room Server`];function w(e){let t=e.target;s.value&&!s.value.contains(t)&&(o.value=!1),d.value&&!d.value.contains(t)&&(u.value=!1)}let T=async()=>{try{_.value=!0;let e={};for(let t of S)try{let n=await Y.get(`/adverts_by_contact_type?contact_type=${encodeURIComponent(t)}&hours=168`);n.success&&Array.isArray(n.data)?e[t]=n.data:e[t]=[]}catch(n){console.error(`Error fetching ${t} nodes:`,n),e[t]=[]}g.value=e,y.value=new Date}catch(e){console.error(`Error updating tracked nodes:`,e)}finally{_.value=!1}},E=async(e=!1)=>{if(!h.value.isChecking)try{h.value.isChecking=!0,h.value.error=null,await Y.post(`/update/check`,e?{force:!0}:{});for(let e=0;e<20;e++){let e=await Y.get(`/update/status`);if(e.success&&e.state!==`checking`){h.value.currentVersion=e.current_version??``,h.value.latestVersion=e.latest_version??``,h.value.hasUpdate=!!e.has_update,h.value.lastChecked=new Date,h.value.error=e.error??null,h.value.rateLimitUntil=e.rate_limit_until??null;return}await new Promise(e=>setTimeout(e,500))}h.value.error=`Version check timed out`}catch(e){console.error(`Error checking for updates:`,e),h.value.error=e instanceof Error?e.message:`Failed to check for updates`}finally{h.value.isChecking=!1}},O=()=>{o.value=!1,E(),a.fetchStats()},ee=e=>{h.value.currentVersion=e.currentVersion,h.value.latestVersion=e.latestVersion,h.value.hasUpdate=e.hasUpdate,h.value.lastChecked=new Date},te=()=>{q(),i.push(`/login`)},M=async(e=20,t=2e3)=>{for(let n=0;nsetTimeout(e,t))}return!1},N=async()=>{if(!f.value){f.value=!0,m.value=!1,p.value=`Sending restart request...`,u.value=!1;try{let e=await Y.post(`/restart_service`,{});e.success?(p.value=`Service restarting, waiting for it to come back...`,await M()?(p.value=`Service is back! Reloading...`,setTimeout(()=>{window.location.reload()},500)):(p.value=`Service did not respond in time. Try reloading manually.`,m.value=!0)):(p.value=e.error||`Restart request failed`,m.value=!0)}catch(e){e.code===`ERR_NETWORK`||e.message?.includes(`Network error`)||e.response?.status===500||e.message?.includes(`500`)?(p.value=`Service restarting, waiting for it to come back...`,await M()?(p.value=`Service is back! Reloading...`,setTimeout(()=>{window.location.reload()},500)):(p.value=`Service did not respond in time. Try reloading manually.`,m.value=!0)):(p.value=e.message||`Restart request failed`,m.value=!0)}}},F=()=>{f.value=!1,p.value=``,m.value=!1},ne=()=>{window.location.reload()},R=P(()=>Object.values(g.value).reduce((e,t)=>e+t.length,0)),B=P(()=>S.map(e=>({type:e,count:g.value[e]?.length||0})).filter(e=>e.count>0)),V=P(()=>!0),re=e=>({"Chat Node":`text-blue-600 dark:text-blue-400`,Repeater:`text-accent-green`,"Room Server":`text-accent-purple`})[e]||`text-gray-400`,ie=e=>{let t=g.value[e]||[];return t.length===0?`None`:t.reduce((e,t)=>t.last_seen>e.last_seen?t:e,t[0]).node_name||`Unknown Node`},G=null,K=null,se=()=>{G&&clearInterval(G),G=setInterval(()=>{T()},3e4),K&&clearInterval(K),K=setInterval(()=>{E()},6e5)},ce=()=>{G&&=(clearInterval(G),null),K&&=(clearInterval(K),null)};l(()=>{document.addEventListener(`click`,w),T(),E(),se()}),ae(()=>{document.removeEventListener(`click`,w),ce()});let le=()=>{n(`toggleMobileSidebar`)};return(e,t)=>(U(),H(L,null,[z(`div`,Eo,[z(`div`,Do,[z(`div`,Oo,[z(`button`,{onClick:le,class:`lg:hidden w-10 h-10 rounded bg-background-mute dark:bg-surface-elevated flex items-center justify-center hover:bg-stroke-subtle dark:hover:bg-stroke/30 transition-colors`},[...t[10]||=[z(`svg`,{class:`w-5 h-5 text-content-secondary dark:text-content-primary`,viewBox:`0 0 20 20`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[z(`path`,{d:`M3 6h14M3 10h14M3 14h14`,stroke:`currentColor`,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`})],-1)]]),z(`div`,ko,[z(`h1`,Ao,` Hi `+x(b.value)+`👋 `,1)])]),z(`div`,jo,[z(`div`,Mo,[_.value?(U(),H(`div`,No,[...t[11]||=[z(`div`,{class:`animate-spin rounded-full h-3 w-3 border-b-2 border-primary`},null,-1),z(`p`,{class:`text-content-secondary dark:text-content-muted text-xs sm:text-sm`},` Loading... `,-1)]])):R.value>0?(U(),H(`div`,Po,[z(`p`,Fo,[t[12]||=I(` Tracking: `,-1),z(`span`,Io,x(R.value)+` node`+x(R.value===1?``:`s`),1)]),B.value.length>0?(U(),H(`div`,Lo,[(U(!0),H(L,null,r(B.value,(e,t)=>(U(),H(`span`,{key:e.type,class:`inline`},[I(x(e.count)+` `+x(e.type)+x(e.count===1?``:`s`),1),t