diff --git a/honk/Makefile b/honk/Makefile deleted file mode 100644 index 39b4ad8f..00000000 --- a/honk/Makefile +++ /dev/null @@ -1,104 +0,0 @@ -# SPDX-License-Identifier: GPL-2.0-only - -include $(TOPDIR)/rules.mk - -PKG_NAME:=honk -PKG_VERSION:=2026.10.9_pre3 -PKG_RELEASE:=1 - -# Raw upstream release tag. It keeps the dots in qualifiers (e.g. v0.0.1.beta.49) -# because that is what the GitHub release asset name uses. -HONK_RELEASE_TAG:=debug.2026.10.9.native-api.3 -HONK_ASSET_TAG:=debug - -# SHA256 of each release tarball, kept in sync by scripts/update_honk_version.sh. -HONK_HASH_X86_64:=179dac725195f04899ae871b9fbcf47deec4b99f6b30c539296d31fdcd9a8c2e -HONK_HASH_AARCH64:=6bcf738b8c618d9c87a412fa3dbb976e041349f6614ebd1ea2c7044ede3a4d48 - -PKG_LICENSE:=AGPL-3.0-only -PKG_LICENSE_FILE:=LICENSE -PKG_MAINTAINER:=luci-app-honk maintainers - -ifeq ($(ARCH),x86_64) - HONK_TARGET:=x86_64-unknown-linux-musl - HONK_HASH:=$(HONK_HASH_X86_64) -else ifeq ($(ARCH),aarch64) - HONK_TARGET:=aarch64-unknown-linux-musl - HONK_HASH:=$(HONK_HASH_AARCH64) -endif - -# Default to the stock-malloc build: lower RSS high-water on small gateways. -# Use an empty suffix to switch back to the mimalloc build (faster QUIC). -HONK_SUFFIX:=-stock -HONK_ASSET:=honk-core-$(HONK_ASSET_TAG)-$(HONK_TARGET)$(HONK_SUFFIX).tar.gz - -PKG_SOURCE:=$(HONK_ASSET) -PKG_SOURCE_URL:=https://github.com/Glassyiris/honk/releases/download/$(HONK_RELEASE_TAG)/ -PKG_HASH:=$(HONK_HASH) - -include $(INCLUDE_DIR)/package.mk - -define Package/honk - SECTION:=net - CATEGORY:=Network - SUBMENU:=Web Servers/Proxies - TITLE:=honk - eBPF transparent proxy engine (dae-compatible) - URL:=https://github.com/Glassyiris/honk - DEPENDS:=@(x86_64||aarch64) \ - +ca-bundle +ip-full \ - +kmod-sched-core +kmod-sched-bpf +kmod-veth +kmod-nft-queue \ - +v2ray-geoip +v2ray-geosite \ - +@KERNEL_XDP_SOCKETS \ - +HONK_USE_VMLINUX_BTF:vmlinux-btf -endef - -define Package/honk/config - choice - prompt "BTF source for CO-RE" - default HONK_USE_KERNEL_BTF - depends on PACKAGE_honk - - config HONK_USE_KERNEL_BTF - bool "Use kernel BTF (integrated)" - depends on KERNEL_DEBUG_INFO_BTF - - config HONK_USE_VMLINUX_BTF - bool "Use vmlinux-btf package" - endchoice -endef - -define Package/honk/conffiles -/etc/honk/config.dae -/etc/honk/config.d/ -/etc/honk/state/ -/etc/config/honk -endef - -define Build/Prepare - mkdir -p $(PKG_BUILD_DIR) - $(TAR) -xzf $(DL_DIR)/$(PKG_SOURCE) -C $(PKG_BUILD_DIR) --strip-components=1 -endef - -define Build/Compile - true -endef - -define Package/honk/install - $(INSTALL_DIR) $(1)/usr/bin - $(INSTALL_BIN) $(PKG_BUILD_DIR)/honk-core $(1)/usr/bin/honk-core - - $(INSTALL_DIR) $(1)/etc/honk/config.d - $(INSTALL_CONF) $(CURDIR)/files/config.dae $(1)/etc/honk/config.dae - $(INSTALL_CONF) $(CURDIR)/files/config.d/node.dae $(1)/etc/honk/config.d/node.dae - $(INSTALL_CONF) $(CURDIR)/files/config.d/route.dae $(1)/etc/honk/config.d/route.dae - $(INSTALL_CONF) $(CURDIR)/files/config.d/dns.dae $(1)/etc/honk/config.d/dns.dae - $(INSTALL_CONF) $(CURDIR)/files/config.d/api.dae $(1)/etc/honk/config.d/api.dae - - $(INSTALL_DIR) $(1)/etc/config - $(INSTALL_CONF) $(CURDIR)/files/honk.config $(1)/etc/config/honk - - $(INSTALL_DIR) $(1)/etc/init.d - $(INSTALL_BIN) $(CURDIR)/files/honk.init $(1)/etc/init.d/honk -endef - -$(eval $(call BuildPackage,honk)) diff --git a/honk/files/config.d/api.dae b/honk/files/config.d/api.dae deleted file mode 100644 index e69de29b..00000000 diff --git a/honk/files/config.d/dns.dae b/honk/files/config.d/dns.dae deleted file mode 100644 index f2806067..00000000 --- a/honk/files/config.d/dns.dae +++ /dev/null @@ -1,24 +0,0 @@ -# dns.dae -dns { - bind: 'tcp+udp://[::]:53530' - client_subnet: auto - max_cache_size: 50000 - #ipversion_prefer: 4 - upstream { - local: 'udp://127.0.0.1:53' -> direct - remote: 'tcp+udp://dns.google:53' - } - routing { - request { - qtype(https) -> reject - qname(geosite: gfw) -> remote - fallback: local - } - response { - upstream(remote) -> accept - qname(geosite: private) -> accept - ip(geoip: cn) -> accept - fallback: remote - } - } -} diff --git a/honk/files/config.d/node.dae b/honk/files/config.d/node.dae deleted file mode 100644 index 848dcb48..00000000 --- a/honk/files/config.d/node.dae +++ /dev/null @@ -1,35 +0,0 @@ -# node.dae -node { - node1: 'xxx' - node2: 'xxx' -} - -subscription { - # 短形式:默认 86400s 刷新一次 - sub: 'http://sub' - - # 短形式 + UA:仍然只能默认 86400s - sub_ua: 'http://sub'(honk/1.0 like) - - # 块形式:可以自定义定时刷新周期 - sub2: { - url: 'http://sub' - ua: 'honk/1.0' - interval: '10000s' # 每 10000 秒刷新一次 - } - - # 禁用定期刷新 - sub3: { - url: 'http://sub' - interval: 0 - } -} - -group { - proxy { - filter: subtag(sub) && !name(keyword: 'ExpireAt:') - filter: name(node1, node2) - policy: score - } -} - diff --git a/honk/files/config.d/route.dae b/honk/files/config.d/route.dae deleted file mode 100644 index 31106c7f..00000000 --- a/honk/files/config.d/route.dae +++ /dev/null @@ -1,27 +0,0 @@ -# route.dae -routing { - pname(dnsmasq, zerotier-one) -> direct(must) - dip(224.0.0.0/3, 'ff00::/8', geoip: private) -> direct - domain(geosite: category-bank-cn, geosite: boc@!cn, geosite: synology) -> direct - - # block quic, if u node has poor quic support, enable this line - # l4proto(udp) && dport(443) -> block - - domain(geosite: spotify) -> proxy - domain(geosite: category-doh) -> proxy - domain(geosite: tiktok) -> proxy - domain(geosite: category-ai-!cn, geosite: github) -> proxy - domain(geosite: gfw) -> proxy - - dip(geoip: telegram) -> proxy - - dip(geoip: cn) -> direct - # geoip:cn always using chiness asn, can use domain rule to override - # domain(geosite: cn) -> direct - - # using proxy for ssh, http, https, and common ports, avoid (bt, or other p2p) - # dport(22, 80, 443, 8080, 6443, 9090) -> proxy - - # fallback: direct - fallback: proxy -} diff --git a/honk/files/config.dae b/honk/files/config.dae deleted file mode 100644 index 159259b8..00000000 --- a/honk/files/config.dae +++ /dev/null @@ -1,31 +0,0 @@ -# config.dae -# Load all honk files placed in ./config.d/. -include { - config.d/*.dae -} - -global { - log_level: warn - check_interval: 600s - check_tolerance: 30ms - lan_interface: br-lan - wan_interface: auto - auto_config_kernel_parameter: true - disable_waiting_network: false - data_dir: '/etc/honk' - log_file: '/var/log/honk/honk.log' - store_subscribe: true - # if u not using dns bind, set dial_mode to domain++ prefer - dial_mode: domain - bootstrap_resolver: '223.5.5.5:53' - tcp_check_url: 'https://www.gstatic.com/generate_204' - tcp_check_http_method: HEAD - udp_check_dns: 'dns.google.com:53', '8.8.8.8', '2001:4860:4860::8888' -} - -assets { - geodata { - geosite: 'https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/release/geosite.dat' - geoip: 'https://raw.githubusercontent.com/QiuSimons/geoip-moedove/refs/heads/main/geoip.dat' - } -} diff --git a/honk/files/honk.config b/honk/files/honk.config deleted file mode 100644 index f30d297c..00000000 --- a/honk/files/honk.config +++ /dev/null @@ -1,7 +0,0 @@ - -config honk 'config' - option enabled '0' - option advanced '0' - option dashboard 'none' - option config_file '/etc/honk/config.dae' - diff --git a/honk/files/honk.init b/honk/files/honk.init deleted file mode 100644 index ceb4faa7..00000000 --- a/honk/files/honk.init +++ /dev/null @@ -1,122 +0,0 @@ -#!/bin/sh /etc/rc.common - -USE_PROCD=1 -START=96 -STOP=10 - -extra_command "hot_reload" "Hot-reload service" - -CONF="honk" -PROG="/usr/bin/honk-core" -# honk-core hardcodes dae-compatible datapath names (dae0/dae0peer + daens); -# these are the real interface/netns names, not leftover dae config. -HONK_HOST_IFACE="dae0" -HONK_PEER_IFACE="dae0peer" -HONK_NETNS_NAME="daens" -HONK_NETNS_PATH="/run/netns/$HONK_NETNS_NAME" -RESOLV_HONK="/tmp/resolv.conf.honk" - -set_chmod_640() { - mkdir -p /etc/honk/config.d /etc/honk/state /var/log/honk - chmod -R u=rwX,go= /etc/honk 2>/dev/null || true - chmod 700 /etc/honk /etc/honk/config.d /etc/honk/state 2>/dev/null || true -} - -cleanup_netns() { - ip netns del "$HONK_NETNS_NAME" 2>/dev/null || true - umount "$HONK_NETNS_PATH" 2>/dev/null || true - rm -f "$HONK_NETNS_PATH" 2>/dev/null || true - ip link del "$HONK_HOST_IFACE" 2>/dev/null || true - ip link del "$HONK_PEER_IFACE" 2>/dev/null || true -} - -hijack_resolv_conf() { - grep -q ' /tmp/resolv\.conf ' /proc/mounts && return 0 - - local dns_list WANS - . /lib/functions/network.sh - unset -v __NETWORK_CACHE - __network_ifstatus WANS "" "[@.route[@.target='0.0.0.0' && !@.table]].interface" 2>/dev/null - set -- $WANS - - if [ $# -eq 1 ]; then - dns_list=$(ubus call "network.interface.$1" status 2>/dev/null | \ - jsonfilter -e '@["dns-server"][*]' 2>/dev/null) - if [ -z "$dns_list" ] && [ -f "/tmp/resolv.conf.d/resolv.conf.auto" ]; then - dns_list=$(awk '/^nameserver/{print $2}' "/tmp/resolv.conf.d/resolv.conf.auto") - fi - fi - - [ -z "$dns_list" ] && dns_list="119.29.29.29 223.5.5.5" - - [ -f /tmp/resolv.conf ] || touch /tmp/resolv.conf - grep -E '^(search|domain) ' /tmp/resolv.conf > "$RESOLV_HONK" 2>/dev/null - - for dns in $dns_list; do - echo "nameserver $dns" >> "$RESOLV_HONK" - done - - mount --bind "$RESOLV_HONK" /tmp/resolv.conf - mount -o remount,ro,bind /tmp/resolv.conf -} - -restore_resolv_conf() { - while grep -q ' /tmp/resolv\.conf ' /proc/mounts; do - mount -o remount,rw,bind /tmp/resolv.conf 2>/dev/null - umount /tmp/resolv.conf 2>/dev/null || break - done - rm -f "$RESOLV_HONK" -} - -start_service() { - local enabled config_file - - config_load "$CONF" - config_get_bool enabled "config" "enabled" "0" - [ "$enabled" -eq "1" ] || return 1 - - config_get config_file "config" "config_file" "/etc/honk/config.dae" - - if [ ! -x "$PROG" ]; then - logger -t honk "not starting: $PROG is missing or not executable" - return 1 - fi - - set_chmod_640 - cleanup_netns - hijack_resolv_conf - - procd_open_instance "$CONF" - procd_set_param env DAE_LOCATION_ASSET="/usr/share/v2ray" - procd_set_param command "$PROG" --config "$config_file" - procd_set_param netdev "$HONK_HOST_IFACE" "$HONK_PEER_IFACE" - procd_set_param limits core="unlimited" - procd_set_param limits nofile="1000000 1000000" - procd_set_param term_timeout 8 - procd_set_param respawn 3600 5 5 - procd_set_param stderr 1 - procd_close_instance -} - -service_stopped() { - restore_resolv_conf - cleanup_netns -} - -reload_service() { - stop - start -} - -service_triggers() { - procd_add_reload_trigger "$CONF" -} - -hot_reload() { - set_chmod_640 - if /etc/init.d/honk running; then - "$PROG" reload - else - start - fi -} diff --git a/luci-app-eqosplus/.github/workflows/main.yml b/luci-app-eqosplus/.github/workflows/main.yml new file mode 100644 index 00000000..3258ec29 --- /dev/null +++ b/luci-app-eqosplus/.github/workflows/main.yml @@ -0,0 +1,47 @@ +name: Build + +on: + push: + tags: + - v* + +jobs: + build: + name: Build ${{ matrix.arch }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + arch: + - aarch64_generic + - i386_pentium-mmx + - loongarch64_generic + - mips_mips32 + - mipsel_24kc + - mipsel_mips32 + - x86_64 + steps: + - uses: actions/checkout@main + with: + fetch-depth: 0 + - name: Building packages + uses: sbwml/openwrt-gh-action-sdk@go1.24 + env: + ARCH: ${{ matrix.arch }}-openwrt-24.10 + FEEDNAME: packages_ci + PACKAGES: luci-app-eqosplus + NO_REFRESH_CHECK: true + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.arch }} + path: bin/packages/${{ matrix.arch }}/packages_ci/*.ipk + + - name: Upload packages + uses: ncipollo/release-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + allowUpdates: true + replacesArtifacts: true + artifacts: "bin/packages/${{ matrix.arch }}/packages_ci/*.ipk" diff --git a/luci-app-eqosplus/LICENSE b/luci-app-eqosplus/LICENSE new file mode 100644 index 00000000..574c7ac3 --- /dev/null +++ b/luci-app-eqosplus/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 sirpdboy + +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. diff --git a/luci-app-eqosplus/Makefile b/luci-app-eqosplus/Makefile new file mode 100644 index 00000000..91e501b7 --- /dev/null +++ b/luci-app-eqosplus/Makefile @@ -0,0 +1,39 @@ +# +# Copyright (C) 2006-2017 OpenWrt.org# +# Copyright (C) 2022-2025 sirpdboy herboy2008@gmail.com https://github.com/sirpdboy/luci-app-eqosplus +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +THEME_NAME:=eqosplus +PKG_NAME:=luci-app-$(THEME_NAME) + +PKG_LICENSE:=Apache-2.0 + +LUCI_TITLE:=LuCI support for eqosplus. +LUCI_DESCRIPTION:=LuCI support for Easy eqosplus(Support speed limit based on IP address). +LUCI_DEPENDS:=+ip-full +tc +nftables +bc +kmod-ifb +LUCI_PKGARCH:=all + +PKG_VERSION:=1.3.0 +PKG_RELEASE:=20251128 +PKG_MAINTAINER:=sirpdboy + +define Build/Compile +endef + +define Package/$(PKG_NAME)/postinst +#!/bin/sh +rm -f /tmp/luci-* +endef + +define Package/$(PKG_NAME)/conffiles +/etc/config/eqosplus +endef + +include $(TOPDIR)/feeds/luci/luci.mk + +# call BuildPackage - OpenWrt buildroot signature + diff --git a/luci-app-eqosplus/README.md b/luci-app-eqosplus/README.md new file mode 100644 index 00000000..d2707f57 --- /dev/null +++ b/luci-app-eqosplus/README.md @@ -0,0 +1,91 @@ +![hello](https://views.whatilearened.today/views/github/sirpdboy/deplives.svg) [![](https://img.shields.io/badge/TG群-点击加入-FFFFFF.svg)](https://t.me/joinchat/AAAAAEpRF88NfOK5vBXGBQ) + +

+
luci-app-eqosplus
+

+ +

+OpenWrt +Chrome +Safari +Firefox + GitHub release +Downloads +

+ +[中文] | [English](README.md) + +![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明1.jpg) + +Please read this page carefully, which includes precautions and instructions on how to use it. + +## Enhanced version of EQOS with timed speed limit and added features such as timed limit. + +### Method for downloading source code: + + ```Brach + # downloading + git clone https://github.com/sirpdboy/luci-app-eqosplus package/luci-app-eqosplus + make menuconfig + ``` +### Configuration Menu + ```Brach + make menuconfig + # find LuCI -> Applications, select luci-app-eqosplus, save and exit + ``` +### compile + + ```Brach + # compile + make package/luci-app-eqosplus/compile V=s + ``` + + +## describe + +- luci-app-eqosplus : https://github.com/sirpdboy/luci-app-eqosplus + +![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明2.jpg) + + +## interface + +![screenshots](./doc/eqosplus0.png) + +![screenshots](./doc/eqosplus1.png) + +![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/eqosplus.png) + +![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/eqosplus2.png) + + +# My other project + +- Watch Dog : https://github.com/sirpdboy/luci-app-watchdog +- Net Speedtest : https://github.com/sirpdboy/luci-app-netspeedtest +- Task Plan : https://github.com/sirpdboy/luci-app-taskplan +- Power Off Device : https://github.com/sirpdboy/luci-app-poweroffdevice +- OpentoPD Theme : https://github.com/sirpdboy/luci-theme-opentopd +- KuCat Theme : https://github.com/sirpdboy/luci-theme-kucat +- KuCat Theme Config : https://github.com/sirpdboy/luci-app-kucat-config +- NFT Time Control : https://github.com/sirpdboy/luci-app-timecontrol +- Parent Control: https://github.com/sirpdboy/luci-theme-parentcontrol +- Eqos Plus: https://github.com/sirpdboy/luci-app-eqosplus +- Advanced : https://github.com/sirpdboy/luci-app-advanced +- ddns-go : https://github.com/sirpdboy/luci-app-ddns-go +- Advanced Plus): https://github.com/sirpdboy/luci-app-advancedplus +- Net Wizard: https://github.com/sirpdboy/luci-app-netwizard +- Part Exp: https://github.com/sirpdboy/luci-app-partexp +- Lukcy: https://github.com/sirpdboy/luci-app-lukcy + +## HELP + +| 图飞了 | 图飞了 | +| :-----------------: | :-------------: | +|![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/支付宝.png) | ![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/微信.png) | + + + no + + +![hello](https://visitor-badge-deno.deno.dev/sirpdboy.sirpdboy.svg) [![](https://img.shields.io/badge/TGGroup-ClickJoin-FFFFFF.svg)](https://t.me/joinchat/AAAAAEpRF88NfOK5vBXGBQ) diff --git a/luci-app-eqosplus/README_CN.md b/luci-app-eqosplus/README_CN.md new file mode 100644 index 00000000..8da16627 --- /dev/null +++ b/luci-app-eqosplus/README_CN.md @@ -0,0 +1,109 @@ +![hello](https://views.whatilearened.today/views/github/sirpdboy/deplives.svg) [![](https://img.shields.io/badge/TG群-点击加入-FFFFFF.svg)](https://t.me/joinchat/AAAAAEpRF88NfOK5vBXGBQ) + +

+
luci-app-eqosplus
+

+ +

+ + + + +

+ +[中文] | [English](README.md) + +![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明1.jpg) + +请 **认真阅读完毕** 本页面,本页面包含注意事项和如何使用。 + +## 功能说明: + +### 定时限速1.2.2版 +#### 2023.7.19 定时限速1.2.2:增加更多日期:工作日和休息日,自定义日期1,2,3中间用逗号分隔;加入MAC地址限速,从此不用担心IPV6和IPV4的限速问题。 + +### 定时限速1.0版 +#### 2022.12.24 定时限速在eqos的加强版,加入定时限制等功能。 + +## 编译使用方法 [![](https://img.shields.io/badge/-编译使用方法-F5F5F5.svg)](#编译使用方法-) + +将luci-app-eqosplus添加至 LEDE/OpenWRT 源码的方法。 + +### 下载源码方法一: +编辑源码文件夹根目录feeds.conf.default并加入如下内容: + +```Brach + # feeds获取源码: + src-git eqosplus https://github.com/sirpdboy/luci-app-eqosplus + ``` + ```Brach + # 更新feeds,并安装主题: + scripts/feeds update eqosplus + scripts/feeds install luci-app-eqosplus + ``` + +### 下载源码方法: + ```Brach + # 下载源码 + git clone https://github.com/sirpdboy/luci-app-eqosplus package/luci-app-eqosplus + make menuconfig + ``` +### 配置菜单 + ```Brach + make menuconfig + # 找到 LuCI -> Applications, 选择 luci-app-eqosplus, 保存后退出。 + ``` +### 编译 + ```Brach + # 编译固件 + make package/luci-app-eqosplus/compile V=s + ``` + +## 说明 [![](https://img.shields.io/badge/-说明-F5F5F5.svg)](#说明-) + +源码来源:https://github.com/sirpdboy/luci-app-eqosplus + + +- 你可以随意使用其中的源码,但请注明出处。 + +![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明2.jpg) + +## 界面 + +![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/eqosplus.png) + +![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/eqosplus2.png) + +# My other project + +- 路由安全看门狗 :https://github.com/sirpdboy/luci-app-watchdog +- 网络速度测试 :https://github.com/sirpdboy/luci-app-netspeedtest +- 计划任务插件(原定时设置) : https://github.com/sirpdboy/luci-app-taskplan +- 关机功能插件 : https://github.com/sirpdboy/luci-app-poweroffdevice +- opentopd主题 : https://github.com/sirpdboy/luci-theme-opentopd +- kucat酷猫主题: https://github.com/sirpdboy/luci-theme-kucat +- kucat酷猫主题设置工具: https://github.com/sirpdboy/luci-app-kucat-config +- NFT版上网时间控制插件: https://github.com/sirpdboy/luci-app-timecontrol +- 家长控制: https://github.com/sirpdboy/luci-theme-parentcontrol +- 定时限速: https://github.com/sirpdboy/luci-app-eqosplus +- 系统高级设置 : https://github.com/sirpdboy/luci-app-advanced +- ddns-go动态域名: https://github.com/sirpdboy/luci-app-ddns-go +- 进阶设置(系统高级设置+主题设置kucat/agron/opentopd): https://github.com/sirpdboy/luci-app-advancedplus +- 网络设置向导: https://github.com/sirpdboy/luci-app-netwizard +- 一键分区扩容: https://github.com/sirpdboy/luci-app-partexp +- lukcy大吉: https://github.com/sirpdboy/luci-app-lukcy + +## 捐助 + +![screenshots](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/说明3.jpg) + +| 图飞了 | 图飞了 | +| :-----------------: | :-------------: | +|![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/支付宝.png) | ![xm1](https://raw.githubusercontent.com/sirpdboy/openwrt/master/doc/微信.png) | + + + 图飞了 + + +![](https://visitor-badge-deno.deno.dev/sirpdboy.sirpdboy.svg) [![](https://img.shields.io/badge/TG群-点击加入-FFFFFF.svg)](https://t.me/joinchat/AAAAAEpRF88NfOK5vBXGBQ) + diff --git a/luci-app-eqosplus/doc/eqosplus0.png b/luci-app-eqosplus/doc/eqosplus0.png new file mode 100644 index 00000000..978f4abd Binary files /dev/null and b/luci-app-eqosplus/doc/eqosplus0.png differ diff --git a/luci-app-eqosplus/doc/eqosplus1.png b/luci-app-eqosplus/doc/eqosplus1.png new file mode 100644 index 00000000..c603fcda Binary files /dev/null and b/luci-app-eqosplus/doc/eqosplus1.png differ diff --git a/luci-app-eqosplus/luasrc/controller/eqosplus.lua b/luci-app-eqosplus/luasrc/controller/eqosplus.lua new file mode 100644 index 00000000..cbe01b70 --- /dev/null +++ b/luci-app-eqosplus/luasrc/controller/eqosplus.lua @@ -0,0 +1,19 @@ +module("luci.controller.eqosplus", package.seeall) +-- Copyright 2022-2023 sirpdboy +function index() + if not nixio.fs.access("/etc/config/eqosplus") then return end + entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false + + local e = entry({"admin", "control", "eqosplus"}, cbi("eqosplus"), _("Eqosplus"), 10) + e.dependent=false + e.acl_depends = { "luci-app-eqosplus" } + entry({"admin", "control", "eqosplus", "status"}, call("act_status")).leaf = true +end + +function act_status() + local sys = require "luci.sys" + local e = {} + e.status = sys.call(" busybox ps -w | grep eqosplus | grep -v grep >/dev/null ") == 0 + luci.http.prepare_content("application/json") + luci.http.write_json(e) +end diff --git a/luci-app-eqosplus/luasrc/model/cbi/eqosplus.lua b/luci-app-eqosplus/luasrc/model/cbi/eqosplus.lua new file mode 100644 index 00000000..32c3433c --- /dev/null +++ b/luci-app-eqosplus/luasrc/model/cbi/eqosplus.lua @@ -0,0 +1,190 @@ +-- Copyright 2022-2023 sirpdboy +-- Licensed to the public under the Apache License 2.0. +local sys = require "luci.sys" +local ifaces = sys.net:devices() +local WADM = require "luci.tools.webadmin" +local ipc = require "luci.ip" +local a, t, e + +a = Map("eqosplus", translate("Network speed limit")) +a.description = translate("Users can limit the network speed for uploading/downloading through MAC, IP, and IP segments (192.168.110.00-192.168.10.200). The speed unit is MB/second.") +a.template = "eqosplus/index" + +t = a:section(TypedSection, "eqosplus") +t.anonymous = true + +e = t:option(DummyValue, "eqosplus_status", translate("Status")) +e.template = "eqosplus/eqosplus" +e.value = translate("Collecting data...") + + +ipi = t:option(ListValue, "ifname", translate("Interface"), translate("Set the interface used for restriction, use pppoe-wan for dialing, use WAN hardware interface for DHCP mode (such as eth1), and use br-lan for bypass mode")) +ipi.default = "1" +ipi:value(1,translate("Automatic settings")) +ipi:value("br-lan", translate("br-lan (LAN Bridge)")) +local function get_wan_interfaces() + local result = {} + local ubus = require "ubus" + + local conn = ubus.connect() + if not conn then + return result + end + + local network_status = conn:call("network.interface", "dump", {}) + for _, iface in ipairs(network_status.interface) do + if iface.interface:match("^wan") or iface.interface:match("^pppoe") or iface.proto == "pppoe" then + local dev = iface.l3_device or iface.device + if dev then + table.insert(result, { + name = dev, + proto = iface.proto, + logical_name = iface.interface + }) + end + end + end + + conn:close() + return result +end + +local wan_ifaces = get_wan_interfaces() +for _, iface in ipairs(wan_ifaces) do + ipi:value(iface.name, translate(iface.name) .. (iface.proto == "pppoe" and " (PPPoE)" or " (WAN)")) +end + +t = a:section(TypedSection, "device") +t.template = "cbi/tblsection" +t.anonymous = true +t.addremove = true + +comment = t:option(Value, "comment", translate("Comment")) +comment.size = 8 + +e = t:option(Flag, "enable", translate("Enabled")) +e.rmempty = false +e.size = 4 + +ip = t:option(Value, "mac", translate("IP/MAC")) +ip.size = 8 + +local function get_devices() + local devices = {} + local seen_ips = {} + local ubus = require "ubus" + local conn = ubus.connect() + + local function get_hostname(ip) + local f = io.popen("nslookup "..ip.." 2>/dev/null | grep 'name =' | cut -d'=' -f2 | sed 's/\\.$//'") + if f then + local name = f:read("*l") + f:close() + if name and name ~= "" then + return name:match("^%s*(.-)%s*$") + end + end + local leases_file = io.open("/tmp/dhcp.leases", "r") + if leases_file then + for line in leases_file:lines() do + local mac, ip_lease, _, hostname = line:match("^(%S+)%s+(%S+)%s+(%S+)%s+(%S+)") + if ip_lease == ip and hostname ~= "*" then + leases_file:close() + return hostname + end + end + leases_file:close() + end + return "unknown" + end + if conn then + local leases = conn:call("dhcp", "ipv4leases", {}) or {} + for _, lease in ipairs(leases) do + if lease.ipaddr and lease.mac then + local hostname = lease.hostname or get_hostname(lease.ipaddr) + devices[#devices+1] = { + ip = lease.ipaddr, + mac = lease.mac:upper(), + hostname = hostname, + display = string.format("%s (%s) - %s", lease.ipaddr, lease.mac:upper(), hostname) + } + seen_ips[lease.ipaddr] = true + end + end + conn:close() + end + local arp_cmd = io.popen("ip -4 neigh show dev br-lan 2>/dev/null") + if arp_cmd then + for line in arp_cmd:lines() do + local ip_addr, mac = line:match("^(%S+)%s+.+%s+(%S+)%s+") + if ip_addr and mac and mac ~= "00:00:00:00:00:00" and not seen_ips[ip_addr] then + mac = mac:upper() + local hostname = get_hostname(ip_addr) + devices[#devices+1] = { + ip = ip_addr, + mac = mac, + hostname = hostname, + display = string.format("%s (%s) - %s", ip_addr, mac, hostname) + } + seen_ips[ip_addr] = true + end + end + arp_cmd:close() + end + table.sort(devices, function(a, b) return a.ip < b.ip end) + return devices +end + +local devices = get_devices() +for _, dev in ipairs(devices) do + ip:value(dev.ip, dev.display) +end +dl = t:option(Value, "download", translate("Downloads")) +dl.default = '0.1' +dl.size = 4 + +ul = t:option(Value, "upload", translate("Uploads")) +ul.default = '0.1' +ul.size = 4 +function validate_time(self, value, section) + local hh, mm, ss + hh, mm, ss = string.match (value, "^(%d?%d):(%d%d)$") + hh = tonumber (hh) + mm = tonumber (mm) + if hh and mm and hh <= 23 and mm <= 59 then + return value + else + return nil, "Time HH:MM or space" + end +end + +e = t:option(Value, "timestart", translate("Start control time")) +e.placeholder = '00:00' +e.default = '00:00' +e.validate = validate_time +e.rmempty = true +e.size = 4 + +e = t:option(Value, "timeend", translate("Stop control time")) +e.placeholder = '00:00' +e.default = '00:00' +e.validate = validate_time +e.rmempty = true +e.size = 4 + +week=t:option(Value,"week",translate("Week Day(1~7)")) +week.rmempty = true +week:value('0',translate("Everyday")) +week:value(1,translate("Monday")) +week:value(2,translate("Tuesday")) +week:value(3,translate("Wednesday")) +week:value(4,translate("Thursday")) +week:value(5,translate("Friday")) +week:value(6,translate("Saturday")) +week:value(7,translate("Sunday")) +week:value('1,2,3,4,5',translate("Workday")) +week:value('6,7',translate("Rest Day")) +week.default='0' +week.size = 6 + +return a diff --git a/luci-app-eqosplus/luasrc/view/eqosplus/eqosplus.htm b/luci-app-eqosplus/luasrc/view/eqosplus/eqosplus.htm new file mode 100644 index 00000000..4445143f --- /dev/null +++ b/luci-app-eqosplus/luasrc/view/eqosplus/eqosplus.htm @@ -0,0 +1,3 @@ +<%+cbi/valueheader%> +<%=pcdata(self:cfgvalue(section) or self.default or "")%> +<%+cbi/valuefooter%> \ No newline at end of file diff --git a/luci-app-eqosplus/luasrc/view/eqosplus/index.htm b/luci-app-eqosplus/luasrc/view/eqosplus/index.htm new file mode 100644 index 00000000..c4b8a072 --- /dev/null +++ b/luci-app-eqosplus/luasrc/view/eqosplus/index.htm @@ -0,0 +1,12 @@ +<% include("cbi/map") %> + \ No newline at end of file diff --git a/luci-app-eqosplus/po/templates/eqosplus.pot b/luci-app-eqosplus/po/templates/eqosplus.pot new file mode 100644 index 00000000..151cee8d --- /dev/null +++ b/luci-app-eqosplus/po/templates/eqosplus.pot @@ -0,0 +1,61 @@ + +msgid "Eqosplus" +msgstr "" + +msgid "Network speed limit" +msgstr "" + +msgid "Running state" +msgstr "" + +msgid "Not running" +msgstr "" + +msgid "Running" +msgstr "" + +msgid "Users can limit the network speed for uploading/downloading through MAC, IP, and IP segments (192.168.110.00-192.168.10.200). The speed unit is MB/second." +msgstr "" + +msgid "MAC/IP" +msgstr "" + +msgid "Downloads" +msgstr "" + +msgid "Uploads" +msgstr "" + +msgid "Comment" +msgstr "" + +msgid "Upload bandwidth(Mbit/s)" +msgstr "" + +msgid "Download bandwidth(Mbit/s)" +msgstr "" + +msgid "Start control time" +msgstr "" + +msgid "Stop control time" +msgstr "" + +msgid "Week Day(1~7)" +msgstr "" + +msgid "Suggested feedback:" +msgstr "" + +msgid "Set the interface used for restriction, use pppoe-wan for dialing, use WAN hardware interface for DHCP mode (such as eth1), and use br-lan for bypass mode" +msgstr "" + +msgid "Rest Day" +msgstr "" + +msgid "Workday" +msgstr "" + +msgid "Automatic settings" +msgstr "" + diff --git a/luci-app-eqosplus/po/zh-cn/eqosplus.po b/luci-app-eqosplus/po/zh-cn/eqosplus.po new file mode 100644 index 00000000..0fa56393 --- /dev/null +++ b/luci-app-eqosplus/po/zh-cn/eqosplus.po @@ -0,0 +1,61 @@ + +msgid "Eqosplus" +msgstr "定时限速" + +msgid "Network speed limit" +msgstr "定时网速限制" + +msgid "Running state" +msgstr "运行状态" + +msgid "Not running" +msgstr "未运行" + +msgid "Running" +msgstr "已运行" + +msgid "Users can limit the network speed for uploading/downloading through MAC, IP.The speed unit is MB/second." +msgstr "可以通过MAC,IP限制用户上传/下载的网速。速度单位为 MB/秒 。" + +msgid "MAC/IP" +msgstr "MAC/IP" + +msgid "Downloads" +msgstr "下载速度" + +msgid "Uploads" +msgstr "上传速度" + +msgid "Comment" +msgstr "备注" + +msgid "Upload bandwidth(Mbit/s)" +msgstr "上传总带宽(Mbit/s)" + +msgid "Download bandwidth(Mbit/s)" +msgstr "下载总带宽(Mbit/s)" + +msgid "Start control time" +msgstr "起控时间" + +msgid "Stop control time" +msgstr "停控时间" + +msgid "Week Day(1~7)" +msgstr "星期(1~7)" + +msgid "Suggested feedback:" +msgstr "建议反馈:" + +msgid "Set the interface used for restriction, use pppoe-wan for dialing, use WAN hardware interface for DHCP mode (such as eth1), and use br-lan for bypass mode" +msgstr "设定用来限制网络速度的接口,拨号使用pppoe-wan,DHCP模式使用WAN口的硬件接口(如:eth1),通用使用br-lan接口" + +msgid "Rest Day" +msgstr "休息日" + +msgid "Workday" +msgstr "工作日" + +msgid "Automatic settings" +msgstr "自动设置" + diff --git a/luci-app-eqosplus/po/zh_Hans/eqosplus.po b/luci-app-eqosplus/po/zh_Hans/eqosplus.po new file mode 100644 index 00000000..840559fc --- /dev/null +++ b/luci-app-eqosplus/po/zh_Hans/eqosplus.po @@ -0,0 +1,61 @@ + +msgid "Eqosplus" +msgstr "定时限速" + +msgid "Network speed limit" +msgstr "定时网速限制" + +msgid "Running state" +msgstr "运行状态" + +msgid "Not running" +msgstr "未运行" + +msgid "Running" +msgstr "已运行" + +msgid "Users can limit the network speed for uploading/downloading through MAC, IP, and IP segments (192.168.110.00-192.168.10.200). The speed unit is MB/second." +msgstr "用户可以通过MAC、IP、IP段(192.168.10.100-192.168.10.200),限制上传/下载的网络速度。速度单位为MB/秒。。" + +msgid "MAC/IP" +msgstr "MAC/IP" + +msgid "Downloads" +msgstr "下载速度" + +msgid "Uploads" +msgstr "上传速度" + +msgid "Comment" +msgstr "备注" + +msgid "Upload bandwidth(Mbit/s)" +msgstr "上传总带宽(Mbit/s)" + +msgid "Download bandwidth(Mbit/s)" +msgstr "下载总带宽(Mbit/s)" + +msgid "Start control time" +msgstr "起控时间" + +msgid "Stop control time" +msgstr "停控时间" + +msgid "Week Day(1~7)" +msgstr "星期(1~7)" + +msgid "Suggested feedback:" +msgstr "建议反馈:" + +msgid "Set the interface used for restriction, use pppoe-wan for dialing, use WAN hardware interface for DHCP mode (such as eth1), and use br-lan for bypass mode" +msgstr "设定用来限制网络速度的接口,拨号使用pppoe-wan,DHCP模式使用WAN口的硬件接口(如:eth1),通用使用br-lan接口" + +msgid "Rest Day" +msgstr "休息日" + +msgid "Workday" +msgstr "工作日" + +msgid "Automatic settings" +msgstr "自动设置" + diff --git a/luci-app-eqosplus/root/etc/config/eqosplus b/luci-app-eqosplus/root/etc/config/eqosplus new file mode 100644 index 00000000..722434ae --- /dev/null +++ b/luci-app-eqosplus/root/etc/config/eqosplus @@ -0,0 +1,25 @@ + +config eqosplus + option enabled '0' + option download '1000' + option upload '30' + option ifname '1' + +config device + option timestart '00:00' + option week '0' + option download '1' + option timeend '23:55' + option upload '1' + option mac '192.168.10.10' + option enable '0' + +config device + option mac '192.168.10.10-192.168.10.200' + option timestart '00:00' + option timeend '00:00' + option week '0' + option download '0.1' + option upload '0.1' + option enable '0' + diff --git a/luci-app-eqosplus/root/etc/hotplug.d/iface/10-eqosplus b/luci-app-eqosplus/root/etc/hotplug.d/iface/10-eqosplus new file mode 100644 index 00000000..91059ec8 --- /dev/null +++ b/luci-app-eqosplus/root/etc/hotplug.d/iface/10-eqosplus @@ -0,0 +1,5 @@ +#!/bin/sh +[ "$ACTION" = "ifup" ] && [ "$INTERFACE" = "wan" ] && { + sleep 5 + /etc/init.d/eqosplus restart +} \ No newline at end of file diff --git a/luci-app-eqosplus/root/etc/init.d/eqosplus b/luci-app-eqosplus/root/etc/init.d/eqosplus new file mode 100644 index 00000000..f74b5fdd --- /dev/null +++ b/luci-app-eqosplus/root/etc/init.d/eqosplus @@ -0,0 +1,54 @@ +#!/bin/sh /etc/rc.common +# +# Copyright (C) 2025 sirpdboy herboy2008@gmail.com https://github.com/sirpdboy/luci-app-eqosplus +# + +START=99 +USE_PROCD=1 + +NAME=eqosplus +LOCK="/var/lock/$NAME.lock" +CR=/etc/crontabs/root + +start_instance() { + procd_open_instance + procd_set_param command /usr/bin/eqosplusctrl + procd_set_param respawn + procd_set_param stderr 1 + procd_close_instance +} + +_eqosplus_start() { + if [ "$(grep -c 'option enable .1.' /etc/config/$NAME 2>/dev/null)" -gt "0" ]; then + if [ x$(uci -q get turboacc.config.sw_flow) = 'x1' ] || [ x$(uci -q get turboacc.config.sfe_flow) = 'x1' ] ;then + uci -q set turboacc.config.sw_flow='0' + uci -q set turboacc.config.sfe_flow='0' + uci -q set turboacc.config.hw_flow='0' + uci commit turboacc + /etc/init.d/turboacc restart + fi + touch $LOCK + eqosplus start + start_instance + (crontab -l ; echo "00 1 * * * /etc/init.d/eqosplus start") | sort - | uniq - | crontab - + fi +} + +start_service(){ + [ -f $LOCK ] && exit + stop_service + _eqosplus_start + rm -f $LOCK +} + +service_triggers() { + procd_add_reload_trigger 'eqosplus' +} + +stop_service(){ + kill -9 $(busybox ps -w | grep 'eqosplusctrl' | grep -v 'grep' | awk '{print $1}') >/dev/null 2>&1 + sed -i '/eqosplus/d' $CR >/dev/null 2>&1 + rm -f $LOCK 2>/dev/null + eqosplus stop +} + diff --git a/luci-app-eqosplus/root/etc/uci-defaults/luci-eqosplus b/luci-app-eqosplus/root/etc/uci-defaults/luci-eqosplus new file mode 100644 index 00000000..f22cd0c6 --- /dev/null +++ b/luci-app-eqosplus/root/etc/uci-defaults/luci-eqosplus @@ -0,0 +1,13 @@ +#!/bin/sh +chmod +x /etc/init.d/eqosplus /usr/bin/eqosplus* +uci -q batch <<-EOF >/dev/null + delete ucitrack.@eqosplus[-1] + add ucitrack eqosplus + set ucitrack.@eqosplus[-1].init=eqosplus + commit ucitrack +EOF + +[ -s /etc/config/eqosplus ] || echo "config eqosplus" > /etc/config/eqosplus + +rm -f /tmp/luci-indexcache +exit 0 diff --git a/luci-app-eqosplus/root/usr/bin/eqosplus b/luci-app-eqosplus/root/usr/bin/eqosplus new file mode 100644 index 00000000..721fafa0 --- /dev/null +++ b/luci-app-eqosplus/root/usr/bin/eqosplus @@ -0,0 +1,379 @@ +#!/bin/bash + +# Copyright (C) 2006 OpenWrt.org +# Copyright 2022-2025 sirpdboy + +crrun=$1 +crid=$2 +NAME=eqosplus +IDLIST="/var/$NAME.idlist" +LOCK="/var/lock/$NAME.lock" +TMPID="/var/$NAME.tmpid" +LOG="/var/$NAME_log.log" +# idlist=`uci show $NAME | grep "enable='1'" | grep "device" | grep -oE '\[.*?\]' | grep -o '[0-9]' ` + + +if [ x$(uci get $NAME.@$NAME[0].ifname 2>/dev/null) = 'x1' ]; then + ifname=$(uci -q get network.lan.ifname) + [ "x$ifname" = "x" ] && ifname="device" || ifname="ifname" + dev=$(uci -q get network.wan.$ifname) + [ ! "$dev" ] && dev=br-lan +else + dev=$(uci -q get $NAME.@$NAME[0].ifname 2>/dev/null) + [ ! "$dev" ] && dev=br-lan +fi + +bin_nft=$(which nft) +bin_tc=$(which tc) +bin_ip=$(which ip) +DEBUG=1 + +nft_type() { + if command -v nft >/dev/null; then + nftables_ver="true" + fi +} + +# Debug functions +dbg_nft() { + [ "${DEBUG:-0}" -eq 0 ] || echo "DEBUG: nft $*" + $bin_nft "$@" +} + +dbg_tc() { + [ "${DEBUG:-0}" -eq 0 ] || echo "DEBUG: tc $*" + $bin_tc "$@" +} + +dbg_ip() { + [ "${DEBUG:-0}" -eq 0 ] || echo "DEBUG: ip $*" + $bin_ip "$@" +} + +is_macaddr() { + ret=1 + if echo "$1" | grep -qE '^([0-9A-Fa-f]{2}[-:]){5}[0-9A-Fa-f]{2}$'; then + ret=0 + fi + return $ret +} + +# 数值比较函数 +is_gt_zero() { + local value=$1 + # 使用bc进行浮点数比较 + echo "$value > 0" | bc -l 2>/dev/null | grep -q 1 +} + +# 转换为kbit +to_kbit() { + local mb=$1 + # MB/s 转 kbit/s: 1 MB/s = 8192 kbit/s + echo "scale=0; $mb * 8192 / 1" | bc 2>/dev/null || echo "0" +} + +# Default commands +tc="dbg_tc" +ip="dbg_ip" +nft="dbg_nft" + +nft_type + +stop_qos() { + for face in $(tc qdisc show 2>/dev/null | grep htb | awk '{print $5}'); do + $tc qdisc del dev $face root 2>/dev/null + done + + $tc qdisc del dev ${dev} root 2>/dev/null + $tc qdisc del dev ${dev}_ifb root 2>/dev/null + $tc qdisc del dev ${dev} ingress 2>/dev/null + $ip link del dev ${dev}_ifb 2>/dev/null 2>&1 + + if [ -n "$nftables_ver" ]; then + $nft delete table inet ${NAME} 2>/dev/null + $nft delete table bridge ${NAME} 2>/dev/null + fi + + echo "" > "$IDLIST" 2>/dev/null +} + +init_qosplus() { + + insmod sch_htb 2>/dev/null + insmod act_mirred 2>/dev/null + insmod ifb 2>/dev/null + + $ip link del dev ${dev}_ifb 2>/dev/null + $ip link add dev ${dev}_ifb name ${dev}_ifb type ifb + $ip link set dev ${dev}_ifb up + + $tc qdisc del dev ${dev} root 2>/dev/null + $tc qdisc add dev ${dev} root handle 1:0 htb default 1 + $tc class add dev ${dev} parent 1:0 classid 1:1 htb rate 1000mbit ceil 1000mbit + + $tc qdisc del dev ${dev}_ifb root 2>/dev/null + $tc qdisc add dev ${dev}_ifb root handle 1:0 htb default 1 + $tc class add dev ${dev}_ifb parent 1:0 classid 1:1 htb rate 1000mbit ceil 1000mbit + lanipaddr=$(uci -q get network.lan.ipaddr 2>/dev/null | awk -F '.' '{print $1"."$2"."$3".0/24"}') + if [ -n "$lanipaddr" ]; then + $tc filter add dev $dev parent 1:0 protocol ip prio 1 u32 match ip src "$lanipaddr" match ip dst "$lanipaddr" flowid 1:1 + $tc filter add dev ${dev}_ifb parent 1:0 protocol ip prio 1 u32 match ip src "$lanipaddr" match ip dst "$lanipaddr" flowid 1:1 + fi + $tc qdisc del dev ${dev} ingress 2>/dev/null + $tc qdisc add dev ${dev} ingress + $tc filter add dev ${dev} parent ffff: protocol all prio 2 u32 match u32 0 0 flowid 1:1 action mirred egress redirect dev ${dev}_ifb + + if [ -n "$nftables_ver" ]; then + $nft delete table inet ${NAME} 2>/dev/null + $nft delete table bridge ${NAME} 2>/dev/null + + $nft add table inet ${NAME} + + $nft add chain inet ${NAME} mark_forward { type filter hook forward priority -200\; policy accept\; } + $nft add chain inet ${NAME} mark_output { type filter hook output priority -200\; policy accept\; } + $nft add chain inet ${NAME} mark_postrouting { type filter hook postrouting priority -200\; policy accept\; } + fi + + return 0 +} + + +del_id() { + local list_id=$1 + id=$((list_id * 10 + 1000)) + [ "${DEBUG:-0}" -eq 0 ] || echo "D: del_id $@ --$id --$mac" + $tc filter del dev ${dev} parent 1: handle 800::$(printf "%x" $id) 2>/dev/null + $tc class del dev ${dev} parent 1:1 classid 1:$id 2>/dev/null + $tc filter del dev ${dev}_ifb parent 1: handle 800::$(printf "%x" $id) 2>/dev/null + $tc class del dev ${dev}_ifb parent 1:1 classid 1:$id 2>/dev/null + mac=$(uci -q get $NAME.@device[$list_id].mac 2>/dev/null) + if [ -n "$nftables_ver" ] && [ -n "$mac" ]; then + if is_macaddr "$mac"; then + $nft delete rule inet ${NAME} mark_forward ether saddr $mac counter 2>/dev/null + $nft delete rule inet ${NAME} mark_output ether saddr $mac counter 2>/dev/null + $nft delete rule inet ${NAME} mark_postrouting ether saddr $mac counter 2>/dev/null + else + Z=$(echo $mac | awk -F '[/]' '{print $2}') + [ -n "$Z" ] && mac=$(echo $mac | awk -F '[/]' '{print $1}') || Z=32 + $nft delete rule inet ${NAME} mark_forward ip saddr $mac/$Z counter 2>/dev/null + $nft delete rule inet ${NAME} mark_output ip saddr $mac/$Z counter 2>/dev/null + $nft delete rule inet ${NAME} mark_postrouting ip saddr $mac/$Z counter 2>/dev/null + fi + fi +} + +add_mac() { + local list_id=$1 + id=$((list_id * 10 + 1000)) + M0=$(echo $mac | cut -d : -f 1)$(echo $mac | cut -d : -f 2) + M1=$(echo $mac | cut -d : -f 3)$(echo $mac | cut -d : -f 4) + M2=$(echo $mac | cut -d : -f 5)$(echo $mac | cut -d : -f 6) + [ "${DEBUG:-0}" -eq 0 ] || echo "D: add_mac $@ --id:$id --mac:$mac M012--$M0-$M1-$M2" + + if is_gt_zero "$UL"; then + if [ -n "$nftables_ver" ]; then + $nft add rule inet ${NAME} mark_forward ether saddr $mac counter meta mark set $id + $nft add rule inet ${NAME} mark_output ether saddr $mac counter meta mark set $id + $nft add rule inet ${NAME} mark_postrouting ether saddr $mac counter meta mark set $id + fi + $tc class add dev ${dev}_ifb parent 1:1 classid 1:$id htb rate "${UL}kbit" ceil "${UL}kbit" prio $id burst 15k cburst 15k + $tc qdisc add dev ${dev}_ifb parent 1:$id handle ${id}: sfq perturb 10 + + $tc filter add dev ${dev}_ifb parent 1: protocol ip prio $id handle $id fw flowid 1:$id + + $tc filter add dev ${dev}_ifb parent 1: protocol ip prio $((id + 100)) u32 \ + match u16 0x0800 0xFFFF at -2 \ + match u16 0x${M2} 0xFFFF at -4 \ + match u32 0x${M0}${M1} 0xFFFFFFFF at -8 \ + flowid 1:$id + fi + if is_gt_zero "$DL"; then + $tc class add dev ${dev} parent 1:1 classid 1:$id htb rate "${DL}kbit" ceil "${DL}kbit" prio $id burst 15k cburst 15k + $tc qdisc add dev ${dev} parent 1:$id handle ${id}: sfq perturb 10 + + $tc filter add dev ${dev} parent 1: protocol ip prio $id u32 \ + match u16 0x0800 0xFFFF at -2 \ + match u32 0x${M1}${M2} 0xFFFFFFFF at -12 \ + match u16 0x${M0} 0xFFFF at -14 \ + flowid 1:$id + fi +} + +add_ip() { + local list_id=$1 + id=$((list_id * 10 + 1000)) + [ "${DEBUG:-0}" -eq 0 ] || echo "D: add_ip $@ --$id --$mac" + + Z=$(echo $mac | awk -F '[/]' '{print $2}') + [ -n "$Z" ] && mac=$(echo $mac | awk -F '[/]' '{print $1}') || Z=32 + if is_gt_zero "$UL"; then + if [ -n "$nftables_ver" ]; then + $nft add rule inet ${NAME} mark_forward ip saddr $mac/$Z counter meta mark set $id + $nft add rule inet ${NAME} mark_output ip saddr $mac/$Z counter meta mark set $id + $nft add rule inet ${NAME} mark_postrouting ip saddr $mac/$Z counter meta mark set $id + fi + $tc class add dev ${dev}_ifb parent 1:1 classid 1:$id htb rate "${UL}kbit" ceil "${UL}kbit" prio $id burst 15k cburst 15k + $tc qdisc add dev ${dev}_ifb parent 1:$id handle ${id}: sfq perturb 10 + $tc filter add dev ${dev}_ifb parent 1: protocol ip prio $id handle $id fw flowid 1:$id + $tc filter add dev ${dev}_ifb parent 1:0 prio $((id + 100)) protocol ip u32 \ + match ip src "$mac"/"$Z" \ + flowid 1:$id + fi + if is_gt_zero "$DL"; then + $tc class add dev ${dev} parent 1:1 classid 1:$id htb rate "${DL}kbit" ceil "${DL}kbit" prio $id burst 15k cburst 15k + $tc qdisc add dev ${dev} parent 1:$id handle ${id}: sfq perturb 10 + $tc filter add dev ${dev} parent 1:0 prio $id protocol ip u32 \ + match ip dst "$mac"/"$Z" \ + flowid 1:$id + fi +} + +check_time() { + local start=$1 + local end=$2 + local current=$(date +%H%M) + local start_min=$((10#${start:0:2}*60 + 10#${start:3:2})) + local end_min=$((10#${end:0:2}*60 + 10#${end:3:2})) + local current_min=$((10#${current:0:2}*60 + 10#${current:2:2})) + + if [[ $start_min -lt $end_min ]]; then + [[ $current_min -ge $start_min && $current_min -lt $end_min ]] + else + [[ $current_min -ge $start_min || $current_min -lt $end_min ]] + fi +} + +check_list() { + local i=$1 + local start_time=$(uci -q get $NAME.@device[$i].timestart 2>/dev/null) + local end_time=$(uci -q get $NAME.@device[$i].timeend 2>/dev/null) + local wweek=$(uci -q get $NAME.@device[$i].week 2>/dev/null) + local current_weekday=$(date +%u) + [ -z "$start_time" ] && [ -z "$end_time" ] && [ -z "$wweek" ] && return 0 + + if [ -n "$wweek" ] && [ "$wweek" != "0" ]; then + local day_match=0 + for day in $(echo $wweek | tr ',' ' '); do + [ "$day" -eq "$current_weekday" ] && day_match=1 && break + done + [ "$day_match" -eq 0 ] && return 1 + fi + + if [ -n "$start_time" ] && [ -n "$end_time" ]; then + check_time "$start_time" "$end_time" || return 1 + fi + + return 0 +} + +case "$crrun" in + "stop") + stop_qos + ;; + "start") + stop_qos > /dev/null 2>&1 + sleep 2 + init_qosplus + idlist=$(uci show $NAME 2>/dev/null | grep "enable='1'" | grep "device" | grep -oE '\[.*?\]' | grep -o '[0-9]' | sort -nu | sed -e 's/^/!/g' -e 's/$/!/g' > $IDLIST; cat $IDLIST 2>/dev/null | sed -e 's/!//g') + + if [ ! -s "$IDLIST" ]; then + return 1 + fi + + device_count=0 + for list in $(echo $idlist | sed -e 's/!//g'); do + if check_list $list; then + mac=$(uci -q get $NAME.@device[$list].mac 2>/dev/null) + download_mb=$(uci -q get $NAME.@device[$list].download 2>/dev/null) + upload_mb=$(uci -q get $NAME.@device[$list].upload 2>/dev/null) + comment=$(uci -q get $NAME.@device[$list].comment 2>/dev/null) + + # 转换为kbit + DL=$(to_kbit "$download_mb") + UL=$(to_kbit "$upload_mb") + + if [ -n "$mac" ]; then + if is_macaddr "$mac"; then + add_mac $list >>$LOG + echo "✅ MAC限速: $comment ($mac) - 下载:${download_mb}MB/s(${DL}kbit/s) 上传:${upload_mb}MB/s(${UL}kbit/s)" >>$LOG + else + add_ip $list >>$LOG + echo "✅ IP限速: $comment ($mac) - 下载:${download_mb}MB/s(${DL}kbit/s) 上传:${upload_mb}MB/s(${UL}kbit/s)" >>$LOG + fi + device_count=$((device_count + 1)) + fi + else + [ -f "$IDLIST" ] && [ $(grep "!${list}!" "$IDLIST" 2>/dev/null | wc -l) -gt 0 ] && { + del_id $list >>$LOG + sed -i "/!$list!/d" "$IDLIST" >/dev/null 2>&1 + comment=$(uci -q get $NAME.@device[$list].comment 2>/dev/null) + } + fi + done + echo "EQOSPLUS限速服务启动完成,共配置 $device_count 个设备" >>$LOG + echo "" + echo "当前限速状态:" >>$LOG + tc -s class show dev $dev | grep "rate" | head -5 >>$LOG + tc -s class show dev ${dev}_ifb | grep "rate" | head -5 >>$LOG + + ;; + "add") + echo "➕ 添加限速规则..." + for list in $(echo $crid | sed -e 's/!//g' | sed 's/,/ /g'); do + mac=$(uci -q get $NAME.@device[$list].mac 2>/dev/null) + download_mb=$(uci -q get $NAME.@device[$list].download 2>/dev/null) + upload_mb=$(uci -q get $NAME.@device[$list].upload 2>/dev/null) + comment=$(uci -q get $NAME.@device[$list].comment 2>/dev/null) + DL=$(to_kbit "$download_mb") + UL=$(to_kbit "$upload_mb") + + if is_macaddr $mac; then + add_mac $list + echo "✅ 添加MAC限速: $comment ($mac)" >>$LOG + else + add_ip $list + echo "✅ 添加IP限速: $comment ($mac)" >>$LOG + fi + done + ;; + "del") + for list in $(echo $crid | sed -e 's/!//g' | sed 's/,/ /g'); do + comment=$(uci -q get $NAME.@device[$list].comment 2>/dev/null) + mac=$(uci -q get $NAME.@device[$list].mac 2>/dev/null) + del_id $list + done + ;; + "status") + echo "EQOSPLUS限速服务状态" + echo "### 网络接口: $dev ###" + echo "# 下载队列统计 #" + tc -s qdisc show dev $dev 2>/dev/null || echo "无下载队列" + echo "# 下载类统计 #" + tc -s class show dev $dev 2>/dev/null | grep -E "class htb|rate [0-9]" || echo "无下载类" + echo "# 下载过滤器 #" + tc -s filter show dev $dev parent 1: 2>/dev/null | head -10 || echo "无下载过滤器" + + echo "### 虚拟接口: ${dev}_ifb ###" + echo "# 上传队列统计 #" + tc -s qdisc show dev ${dev}_ifb 2>/dev/null || echo "无上传队列" + echo "# 上传类统计 #" + tc -s class show dev ${dev}_ifb 2>/dev/null | grep -E "class htb|rate [0-9]" || echo "无上传类" + echo "# 上传过滤器 #" + tc -s filter show dev ${dev}_ifb parent 1: 2>/dev/null | head -10 || echo "无上传过滤器" + + if [ -n "$nftables_ver" ]; then + echo "### NFTables规则 ###" + nft list table inet ${NAME} 2>/dev/null || echo "没有NFTables规则" + else + echo "NFTables不可用" + fi + + # 显示流量统计 + echo "### 流量统计 ###" + echo "下载流量:" + tc -s class show dev $dev 2>/dev/null | grep "Sent" | head -5 + echo "上传流量:" + tc -s class show dev ${dev}_ifb 2>/dev/null | grep "Sent" | head -5 + ;; + +esac \ No newline at end of file diff --git a/luci-app-eqosplus/root/usr/bin/eqosplusctrl b/luci-app-eqosplus/root/usr/bin/eqosplusctrl new file mode 100644 index 00000000..9b5721d6 --- /dev/null +++ b/luci-app-eqosplus/root/usr/bin/eqosplusctrl @@ -0,0 +1,63 @@ +#!/bin/sh + +# Copyright (C) 2006 OpenWrt.org +# Copyright 2022-2025 sirpdboy +NAME=eqosplus +IDLIST="/var/$NAME.idlist" +TMPID="/var/$NAME.tmpid" + +idlist=`uci show $NAME | grep "enable='1'" | grep "device" | grep -oE '\[.*?\]' | grep -o '[0-9]' ` + +check_list() { + i=$1 + checki='0' + start_time=$(uci -q get $NAME.@device[$i].timestart 2>/dev/null) + end_time=$(uci -q get $NAME.@device[$i].timeend 2>/dev/null) + wweek=`uci -q get $NAME.@device[$i].week ` + current_time=$(date +%H:%M) + current_weekday=$(date +%u) + for ww in `echo $wweek | sed 's/,/ /g' `; do + if [ $current_weekday = $ww ] || [ 'x0' = x$ww ] ;then + [ "$start_time" = "$end_time" ] && checki='1' || { + if [ "$start_time" \< "$end_time" ]; then + if [ "$current_time" \> "$start_time" ] && [ "$current_time" \< "$end_time" ] ; then + checki='1' + fi + else + if [ "$start_time" \> "$end_time" ] ; then + if [ "$current_time" \< "$start_time" ] && [ "$current_time" \> "$end_time" ] ; then + checki='1' + fi + fi + fi + } + fi + done + return +} + +idlistusr(){ + checki='0' + [ -s $IDLIST ] || touch $IDLIST + for list in $idlist ;do + check_list $list + if [ $checki == '1' ] ; then + [ `cat $IDLIST 2>/dev/null | grep "!${list}!" | wc -l ` -gt 0 ] || { + eqosplus add $list + echo "!${list}!" >> $IDLIST ; cat $IDLIST | sort | uniq > $TMPID ;cat $TMPID >$IDLIST ;rm -rf $TMPID + } + else + [ `cat $IDLIST 2>/dev/null | grep "!${list}!" | wc -l ` -gt 0 ] && { + eqosplus del $list + sed -i "/!$list!/d" $IDLIST >/dev/null 2>&1 + } + fi + done +} + + +while :;do + sleep 30 + idlistusr + sleep 30 +done \ No newline at end of file diff --git a/luci-app-eqosplus/root/usr/share/rpcd/acl.d/luci-app-eqosplus.json b/luci-app-eqosplus/root/usr/share/rpcd/acl.d/luci-app-eqosplus.json new file mode 100644 index 00000000..b879f4de --- /dev/null +++ b/luci-app-eqosplus/root/usr/share/rpcd/acl.d/luci-app-eqosplus.json @@ -0,0 +1,11 @@ +{ + "luci-app-eqosplus": { + "description": "Grant UCI access for luci-app-eqosplus", + "read": { + "uci": [ "eqosplus" ] + }, + "write": { + "uci": [ "eqosplus" ] + } + } +} diff --git a/luci-app-eqosplus/界面.png b/luci-app-eqosplus/界面.png new file mode 100644 index 00000000..d346c698 Binary files /dev/null and b/luci-app-eqosplus/界面.png differ diff --git a/luci-app-honk/Makefile b/luci-app-honk/Makefile deleted file mode 100644 index fcaf9841..00000000 --- a/luci-app-honk/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (C) 2016 Openwrt.org -# -# This is free software, licensed under the Apache License, Version 2.0 . -# - -include $(TOPDIR)/rules.mk - -PKG_NAME:=luci-app-honk -PKG_VERSION:=1.1.4 -PKG_RELEASE:=7 - -LUCI_TITLE:=LuCI support for honk -LUCI_PKGARCH:=all -LUCI_DEPENDS:=+honk +luci-base +rpcd-mod-ucode - -include $(TOPDIR)/feeds/luci/luci.mk - -# call BuildPackage - OpenWrt buildroot signature - diff --git a/luci-app-honk/po/zh_Hans/honk.po b/luci-app-honk/po/zh_Hans/honk.po deleted file mode 100644 index 02b94831..00000000 --- a/luci-app-honk/po/zh_Hans/honk.po +++ /dev/null @@ -1,361 +0,0 @@ -msgid "HONK" -msgstr "HONK" - -msgid "RUNNING" -msgstr "运行中" - -msgid "NOT RUNNING" -msgstr "未运行" - -msgid "Collecting data..." -msgstr "收集数据..." - -msgid "Enabled" -msgstr "启用" - -msgid "Reload Service" -msgstr "重载服务" - -msgid "Global Settings" -msgstr "全局设置" - -msgid "DNS Settings" -msgstr "DNS 设置" - -msgid "Node Settings" -msgstr "节点设置" - -msgid "Routing Settings" -msgstr "路由设置" - -msgid "Global Configuration" -msgstr "全局配置" - -msgid "DNS Configuration" -msgstr "DNS 配置" - -msgid "Node Configuration" -msgstr "节点配置" - -msgid "Route Configuration" -msgstr "路由配置" - -msgid "Configure global settings for HONK." -msgstr "调整 HONK 的全局设置。" - -msgid "Configure DNS settings for HONK." -msgstr "调整 HONK 的 DNS 设置。" - -msgid "Configure nodes and groups for HONK." -msgstr "调整 HONK 的节点与分组设置。" - -msgid "Configure routing rules for HONK." -msgstr "调整 HONK 的路由规则。" - -msgid "Correctly configure the include field for separate-config to work, or enter complete configuration here." -msgstr "请正确配置 include 字段以启用拆分配置,或在此处填写完整配置。" - -msgid "Logs" -msgstr "日志" - -msgid "Memory Usage" -msgstr "内存占用" - -msgid "Format Code" -msgstr "格式化代码" - -msgid "Clear logs" -msgstr "清空日志" - -msgid "Logs cleared successfully." -msgstr "日志已清空。" - -msgid "Failed to clear logs:" -msgstr "清空日志失败:" - -msgid "Configuration applied and service reloaded." -msgstr "配置已生效并重载服务。" - -msgid "Status" -msgstr "状态" - -msgid "Running Status" -msgstr "运行状态" - -msgid "Formatted" -msgstr "已格式化" - -msgid "Failed to format code:" -msgstr "格式化代码失败:" - - - -msgid "Checking Dashboard and API configuration..." -msgstr "正在检测控制面板与 API 配置..." - -msgid "Enabling Native API and restarting HONK..." -msgstr "正在启用 Native API 并重启 HONK..." - -msgid "One-click Enable Default Native API" -msgstr "一键启用默认 Native API 配置" - -msgid "Successfully enabled! Restarting service and initializing dashboard..." -msgstr "已成功启用!正在重启服务并初始化面板..." - -msgid "Failed to enable:" -msgstr "启用失败:" - -msgid "Unknown error" -msgstr "未知错误" - -msgid "Dashboard / Native API Unconfigured" -msgstr "控制面板 / Native API 未配置" - -msgid "HONK has not enabled Native API in its configuration file. Dashboard requires native API listener and dashboard UI path." -msgstr "HONK 尚未在配置文件中启用 Native API。控制面板需要依赖 Native API 提供的监听端口与面板静态文件路径。" - -msgid "Please configure experimental.native_api block in API Settings, and ensure listen and ui are configured." -msgstr "请在【API 设置】的配置文件中配置 experimental.native_api 语法块,并确保配置了 listen 和 ui。" - -msgid "Example Configuration (/etc/honk/config.d/api.dae):" -msgstr "参考配置示例(/etc/honk/config.d/api.dae):" - -msgid "Configure in API Settings" -msgstr "前往【API 设置】手动配置" - -msgid "(Not set)" -msgstr "(未设置)" - -msgid "Preparing download..." -msgstr "准备下载..." - -msgid "Please enter a valid download URL" -msgstr "请输入有效的下载 URL" - -msgid "Processing..." -msgstr "正在处理..." - -msgid "Start Download & Install Dashboard" -msgstr "开始下载并安装控制面板" - -msgid "%s UI Files Not Found" -msgstr "未检测到 %s 面板文件" - -msgid "Listen Address & Port" -msgstr "监听地址与端口" - -msgid "API Secret" -msgstr "API 认证密钥" - -msgid "Download Source:" -msgstr "下载源:" - -msgid "Custom URL" -msgstr "自定义 URL" - -msgid "HTTPS access detected:" -msgstr "检测到当前通过 HTTPS 访问 LuCI:" - -msgid "Modern browsers may block HTTP iframe resources under HTTPS. If the dashboard fails to display, open it in a new tab." -msgstr "现代浏览器可能会阻止直接加载 HTTP 协议的控制面板。如无法正常显示,请点击右侧按钮在新标签页打开。" - -msgid "Open in New Tab" -msgstr "在新标签页打开" - -msgid "HONK service is currently not running:" -msgstr "HONK 服务当前未运行:" - -msgid "Dashboard API port (" -msgstr "Dashboard API 端口(" - -msgid ") is not listening. Start the service to display data." -msgstr ")尚未监听。启动服务后即可正常显示数据。" - -msgid "Start HONK" -msgstr "前往启动 HONK" - -msgid "New Tab" -msgstr "新标签页" - -msgid "Open independently in a new tab" -msgstr "在新标签页中独立打开" - -msgid "Drag to scroll page" -msgstr "拖拽以滚动页面" - -msgid "Update Dashboard" -msgstr "更新控制面板" - -msgid "Update to latest" -msgstr "更新至最新版" - -msgid "The latest version (%s) will be downloaded and deployed to:" -msgstr "系统将下载最新版本(%s)并重新部署至目标目录:" - -msgid "Select download source" -msgstr "选择下载源" - -msgid "Cancel" -msgstr "取消" - -msgid "Start Update" -msgstr "开始更新" - -msgid "Refresh" -msgstr "刷新" - -msgid "Refresh dashboard content" -msgstr "刷新面板内容" - -msgid "Fullscreen" -msgstr "全屏" - -msgid "Toggle fullscreen display" -msgstr "切换全屏显示" - -msgid "Initializing download task...\n" -msgstr "正在初始化下载任务...\n" - -msgid "Failed to trigger download:" -msgstr "触发下载失败:" - -msgid "Installation completed successfully!" -msgstr "安装成功,最新版本已部署。" - -msgid "Installation failed. Please check logs." -msgstr "安装失败,请检查日志。" - -msgid "Close" -msgstr "关闭" - -msgid "Download error:" -msgstr "触发下载异常:" - -msgid "Not configured (Empty)" -msgstr "未设置(留空)" - -msgid "Reloading..." -msgstr "正在重载..." - -msgid "HONK service reload triggered successfully." -msgstr "已成功触发 HONK 服务重载。" - -msgid "Failed to reload HONK:" -msgstr "重载 HONK 失败:" - -msgid "DNS configuration saved and service reloaded." -msgstr "DNS 配置已保存并重载服务。" - -msgid "Node configuration saved and service reloaded." -msgstr "节点配置已保存并重载服务。" - -msgid "Routing configuration saved and service reloaded." -msgstr "路由配置已保存并重载服务。" - -msgid "Dashboard" -msgstr "控制面板" - -msgid "Mirror" -msgstr "镜像源" - -msgid "Mirror 1" -msgstr "镜像源 1" - -msgid "Mirror 2" -msgstr "镜像源 2" - -msgid "Tip: If the dashboard still shows the old version, press Ctrl+F5 or open in a new tab to bypass PWA cache." -msgstr "提示:若更新后仍显示旧版本,请按 Ctrl+F5 强刷或在新标签页中打开以绕过 PWA 缓存。" - -msgid "Advanced Settings" -msgstr "高级设置" - -msgid "Enable to display full configuration editor and advanced routing/DNS/node tabs." -msgstr "启用后将显示完整的全局配置编辑器以及路由、DNS、节点的高级分页。" - -msgid "Target Dashboard" -msgstr "目标面板" - -msgid "Dashboard Type" -msgstr "面板类型" - -msgid "Select the active web dashboard." -msgstr "选择当前生效的 Web 管理面板。" - -msgid "Doona" -msgstr "Doona" - -msgid "Native API is configured, but dashboard files are missing in the UI directory. You can download and deploy it directly." -msgstr "Native API 已配置,但 UI 目录中缺少面板文件。您可以直接下载并部署。" - -msgid "Target Directory (ui)" -msgstr "目标目录 (ui)" - -msgid "Click to copy API Token" -msgstr "点击复制 API 认证密钥" - -msgid "Token copied to clipboard: " -msgstr "认证密钥已复制到剪贴板: " - -msgid "Token: " -msgstr "认证密钥: " - -msgid "API Settings" -msgstr "API 设置" - -msgid "Configure API settings for HONK." -msgstr "调整 HONK 的 API 设置。" - -msgid "API Configuration" -msgstr "API 配置" - -msgid "API configuration saved and service restarted." -msgstr "API 配置已保存并重启服务。" - -msgid "None" -msgstr "无" - -msgid "Dashboard Disabled" -msgstr "面板未启用" - -msgid "Dashboard type is currently set to \"None\". Web dashboard and API listener are disabled." -msgstr "当前面板类型为“无”,Web 管理面板和 Native API 监听已禁用。" - -msgid "Failed to switch dashboard:" -msgstr "切换面板失败:" - -msgid "GitHub Release " -msgstr "GitHub Release " - -msgid "Service did not accept the request" -msgstr "服务未接受该请求" - -msgid "Failed to apply configuration:" -msgstr "应用配置失败:" - -msgid "HONK did not come back up; check the logs" -msgstr "HONK 未能重新启动,请检查日志" - -msgid "Configuration saved. HONK is disabled, so the service was not started." -msgstr "配置已保存。HONK 处于禁用状态,未启动服务。" - -msgid "Download did not finish in time." -msgstr "下载超时未完成。" - -msgid "Download task stopped reporting progress." -msgstr "下载任务已停止上报进度。" - -msgid "Configuration saved, but the service state could not be confirmed." -msgstr "配置已保存,但无法确认服务状态。" - -msgid "Running" -msgstr "运行中" - -msgid "Not Running" -msgstr "未运行" - -msgid "Zashboard" -msgstr "Zashboard" - -msgid "Saved, but the panel files are not installed yet — download the panel first." -msgstr "配置已保存,但面板文件尚未安装,请先下载面板。" diff --git a/luci-app-honk/root/etc/honk/doona/THIRD-PARTY-NOTICES.txt b/luci-app-honk/root/etc/honk/doona/THIRD-PARTY-NOTICES.txt deleted file mode 100644 index 3ddccc29..00000000 --- a/luci-app-honk/root/etc/honk/doona/THIRD-PARTY-NOTICES.txt +++ /dev/null @@ -1,744 +0,0 @@ -Licence text shared by 19 packages (MIT) -======================================================================== -@codemirror/autocomplete 6.20.3 (MIT) — LICENSE - Copyright (C) 2018-2021 by Marijn Haverbeke and others -@codemirror/commands 6.11.1 (MIT) — LICENSE - Copyright (C) 2018-2021 by Marijn Haverbeke and others -@codemirror/language 6.12.4 (MIT) — LICENSE - Copyright (C) 2018-2021 by Marijn Haverbeke and others -@codemirror/lint 6.9.7 (MIT) — LICENSE - Copyright (C) 2018-2021 by Marijn Haverbeke and others -@codemirror/search 6.7.2 (MIT) — LICENSE - Copyright (C) 2018-2021 by Marijn Haverbeke and others -@codemirror/state 6.7.6 (MIT) — LICENSE - Copyright (C) 2018-2021 by Marijn Haverbeke and others -@codemirror/view 6.43.13 (MIT) — LICENSE - Copyright (C) 2018-2021 by Marijn Haverbeke and others -@lezer/common 1.5.2 (MIT) — LICENSE - Copyright (C) 2018 by Marijn Haverbeke and others -@lezer/highlight 1.2.5 (MIT) — LICENSE - Copyright (C) 2018 by Marijn Haverbeke and others -@lezer/lr 1.4.10 (MIT) — LICENSE - Copyright (C) 2018 by Marijn Haverbeke and others -@marijn/find-cluster-break 1.0.4 (MIT) — LICENSE - Copyright (C) 2024 by Marijn Haverbeke -aria-hidden 1.2.6 (MIT) — LICENSE - Copyright (c) 2017 Anton Korzunov -clsx 2.1.1 (MIT) — license - Copyright (c) Luke Edwards (lukeed.com) -openapi-fetch 0.17.0 (MIT) — LICENSE - Copyright (c) 2023 Drew Powers -openapi-typescript-helpers 0.1.0 (MIT) — LICENSE - Copyright (c) 2023 Drew Powers -react 19.3.0 (MIT) — LICENSE - Copyright (c) Meta Platforms, Inc. and affiliates. -react-dom 19.3.0 (MIT) — LICENSE - Copyright (c) Meta Platforms, Inc. and affiliates. -scheduler 0.28.0 (MIT) — LICENSE - Copyright (c) Meta Platforms, Inc. and affiliates. -use-sync-external-store 1.7.0 (MIT) — LICENSE - Copyright (c) Meta Platforms, Inc. and affiliates. - -MIT License - -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. - - -Licence text shared by 2 packages (OFL-1.1) -======================================================================== -@fontsource-variable/noto-sans-sc 5.3.0 (OFL-1.1) — LICENSES/OFL-1.1.txt - Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. -@fontsource-variable/noto-sans-tc 5.3.0 (OFL-1.1) — LICENSES/OFL-1.1.txt - Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. - -This Font Software is licensed under the SIL Open Font License, -Version 1.1. - -This license is copied below, and is also available with a FAQ at: -http://scripts.sil.org/OFL - ------------------------------------------------------------ -SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 ------------------------------------------------------------ - -PREAMBLE -The goals of the Open Font License (OFL) are to stimulate worldwide -development of collaborative font projects, to support the font -creation efforts of academic and linguistic communities, and to -provide a free and open framework in which fonts may be shared and -improved in partnership with others. - -The OFL allows the licensed fonts to be used, studied, modified and -redistributed freely as long as they are not sold by themselves. The -fonts, including any derivative works, can be bundled, embedded, -redistributed and/or sold with any software provided that any reserved -names are not used by derivative works. The fonts and derivatives, -however, cannot be released under any other type of license. The -requirement for fonts to remain under this license does not apply to -any document created using the fonts or their derivatives. - -DEFINITIONS -"Font Software" refers to the set of files released by the Copyright -Holder(s) under this license and clearly marked as such. This may -include source files, build scripts and documentation. - -"Reserved Font Name" refers to any names specified as such after the -copyright statement(s). - -"Original Version" refers to the collection of Font Software -components as distributed by the Copyright Holder(s). - -"Modified Version" refers to any derivative made by adding to, -deleting, or substituting -- in part or in whole -- any of the -components of the Original Version, by changing formats or by porting -the Font Software to a new environment. - -"Author" refers to any designer, engineer, programmer, technical -writer or other person who contributed to the Font Software. - -PERMISSION & CONDITIONS -Permission is hereby granted, free of charge, to any person obtaining -a copy of the Font Software, to use, study, copy, merge, embed, -modify, redistribute, and sell modified and unmodified copies of the -Font Software, subject to the following conditions: - -1) Neither the Font Software nor any of its individual components, in -Original or Modified Versions, may be sold by itself. - -2) Original or Modified Versions of the Font Software may be bundled, -redistributed and/or sold with any software, provided that each copy -contains the above copyright notice and this license. These can be -included either as stand-alone text files, human-readable headers or -in the appropriate machine-readable metadata fields within text or -binary files as long as those fields can be easily viewed by the user. - -3) No Modified Version of the Font Software may use the Reserved Font -Name(s) unless explicit written permission is granted by the -corresponding Copyright Holder. This restriction only applies to the -primary font name as presented to the users. - -4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font -Software shall not be used to promote, endorse or advertise any -Modified Version, except to acknowledge the contribution(s) of the -Copyright Holder(s) and the Author(s) or with their explicit written -permission. - -5) The Font Software, modified or unmodified, in part or in whole, -must be distributed entirely under this license, and must not be -distributed under any other license. The requirement for fonts to -remain under this license does not apply to any document created using -the Font Software. - -TERMINATION -This license becomes null and void if any of the above conditions are -not met. - -DISCLAIMER -THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT -OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE -COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL -DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM -OTHER DEALINGS IN THE FONT SOFTWARE. - - -Licence text shared by 8 packages (Apache-2.0) -======================================================================== -@internationalized/date 3.12.4 (Apache-2.0) — LICENSE - Copyright 2019 Adobe -@internationalized/number 3.6.8 (Apache-2.0) — LICENSE - Copyright 2019 Adobe -@internationalized/string 3.2.10 (Apache-2.0) — LICENSE - Copyright 2019 Adobe -@react-types/shared 3.36.1 (Apache-2.0) — LICENSE - Copyright 2019 Adobe -@swc/helpers 0.5.23 (Apache-2.0) — LICENSE - Copyright 2024 SWC contributors. -react-aria 3.52.1 (Apache-2.0) — LICENSE - Copyright 2019 Adobe -react-aria-components 1.21.1 (Apache-2.0) — LICENSE - Copyright 2019 Adobe -react-stately 3.50.0 (Apache-2.0) — LICENSE - Copyright 2019 Adobe - -Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - -@react-aria/optimize-locales-plugin 2.0.2 (Apache-2.0) — LICENSE -======================================================================== -Only the empty.js locale helper emitted by the plugin ships. - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2019 Adobe - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - - - -Licence text shared by 3 packages (MIT) -======================================================================== -crelt 1.0.7 (MIT) — LICENSE - Copyright (C) 2020 by Marijn Haverbeke -style-mod 4.1.3 (MIT) — LICENSE - Copyright (C) 2018 by Marijn Haverbeke and others -w3c-keyname 2.2.8 (MIT) — LICENSE - Copyright (C) 2016 by Marijn Haverbeke and others - -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. - - -Licence text shared by 2 packages (ISC) -======================================================================== -d3-path 3.1.0 (ISC) — LICENSE - Copyright 2015-2022 Mike Bostock -d3-shape 3.2.0 (ISC) — LICENSE - Copyright 2010-2022 Mike Bostock - -Permission to use, copy, modify, and/or distribute this software for any purpose -with or without fee is hereby granted, provided that the above copyright notice -and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND -FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS -OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF -THIS SOFTWARE. - - -rollup 4.63.2 (MIT) — LICENSE.md -======================================================================== -Only the module namespace objects that Rollup writes into the build ship. - -# Rollup core license -Rollup is released under the MIT license: - -The MIT License (MIT) - -Copyright (c) 2017 [these people](https://github.com/rollup/rollup/graphs/contributors) - -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. - - -tslib 2.8.1 (0BSD) — LICENSE.txt -======================================================================== -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. - -vite 6.4.3 (MIT) — LICENSE.md -======================================================================== -Only helper code that Vite writes into the build ships: the module preload polyfill, the preload helper for dynamic imports and the CommonJS interop helper of @rollup/plugin-commonjs, which Vite bundles. - -# Vite core license -Vite is released under the MIT license: - -MIT License - -Copyright (c) 2019-present, VoidZero Inc. and Vite contributors - -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. - -## @rollup/plugin-alias, @rollup/plugin-commonjs, @rollup/plugin-dynamic-import-vars, @rollup/pluginutils -License: MIT -By: Johannes Stein -Repository: rollup/plugins - -License: MIT -By: Rich Harris -Repository: rollup/plugins - -License: MIT -By: LarsDenBakker -Repository: rollup/plugins - -License: MIT -By: Rich Harris -Repository: rollup/plugins - -> The MIT License (MIT) -> -> Copyright (c) 2019 RollupJS Plugin Contributors (https://github.com/rollup/plugins/graphs/contributors) -> -> 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. - - -Packages without a licence file -======================================================================== -client-only 0.0.1 (MIT) diff --git a/luci-app-honk/root/etc/honk/doona/assets/AddCircle-C6Jc7GCc.js b/luci-app-honk/root/etc/honk/doona/assets/AddCircle-C6Jc7GCc.js deleted file mode 100644 index 7aac0bc8..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/AddCircle-C6Jc7GCc.js +++ /dev/null @@ -1 +0,0 @@ -import{j as r}from"./vendor-react-64fcanlc.js";import{I as a}from"./index-HxEUeoab.js";function o(o){return r.jsx(a,{...o,children:r.jsx("path",{fill:"currentColor",d:"M10 1.5a8.5 8.5 0 1 0 0 17 8.5 8.5 0 0 0 0-17m0 15.5a7 7 0 1 1 0-14 7 7 0 0 1 0 14m3.75-7.75h-3v-3a.75.75 0 0 0-1.5 0v3h-3a.75.75 0 0 0 0 1.5h3v3a.75.75 0 0 0 1.5 0v-3h3a.75.75 0 0 0 0-1.5"})})}export{o as A}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/AppearanceControls-sRy1p156.js b/luci-app-honk/root/etc/honk/doona/assets/AppearanceControls-sRy1p156.js deleted file mode 100644 index 0a7177c7..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/AppearanceControls-sRy1p156.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,$ as s,j as l}from"./vendor-react-64fcanlc.js";import{cB as a,cA as n,cD as t,cC as c,fU as i,dZ as r,fV as o,cQ as d,cV as u,d3 as p,d2 as b,cU as h,eW as m,cm as f,fW as x,b7 as j,fX as v,fY as g,cl as C,bw as y,fZ as N,dh as k,f_ as A,di as P,co as S,u as M,b4 as D,f$ as w,bp as L,fr as q,g0 as I,fs as V,dj as $,fu as H,g1 as F,ft as E,T as O,I as z,bg as B,B as R,dV as T}from"./index-HxEUeoab.js";import{a as K,b as U}from"./ItemText-DOD_75iR.js";const W=e.createContext(null),Z=e.forwardRef(function(e,l){[e,l]=d(e,l,W);let m=e.href&&!e.isDisabled?"a":"span",{linkProps:f,isPressed:x}=function(e,s){let{elementType:l="a",onPress:d,onPressStart:u,onPressEnd:p,onPressChange:b,onClick:h,isDisabled:m,...f}=e,x={};"a"!==l&&(x={role:"link",tabIndex:m?void 0:0});let{focusableProps:j}=a(e,s),{pressProps:v,isPressed:g}=n({onPress:d,onPressStart:u,onPressEnd:p,onPressChange:b,onClick:h,isDisabled:m,ref:s}),C=t(f,{labelable:!0}),y=c(j,v),N=i(),k=r(e);return{isPressed:g,linkProps:c(C,k,{...y,...x,"aria-disabled":m||void 0,"aria-current":e["aria-current"],onClick:s=>{v.onClick?.(s),o(s,N,e.href,e.routerOptions)}})}}({...e,elementType:m},l),j=u[m],{hoverProps:v,isHovered:g}=p(e),{focusProps:C,isFocused:y,isFocusVisible:N}=b(),k=h({...e,defaultClassName:"react-aria-Link",values:{isCurrent:!!e["aria-current"],isDisabled:e.isDisabled||!1,isPressed:x,isHovered:g,isFocused:y,isFocusVisible:N}}),A=t(e,{global:!0});return delete A.onClick,s.createElement(j,{ref:l,slot:e.slot||void 0,...c(A,k,f,v,C),"data-focused":y||void 0,"data-hovered":g||void 0,"data-pressed":x||void 0,"data-focus-visible":N||void 0,"data-current":!!e["aria-current"]||void 0,"data-disabled":e.isDisabled||void 0},k.children)});function _({external:e,layout:s,appearance:a,label:n,className:t,quiet:c,secondary:i,small:r,icon:o,accent:d,negative:u,size:p,...b}){const h="button"===a?m({quiet:c,secondary:i,small:r,icon:o,accent:d,negative:u}):`rp-${a}`,v=f(p);return l.jsx(Z,{target:e?"_blank":void 0,rel:e?"noreferrer":void 0,"aria-label":n,"data-layout":s,"data-size":v,...b,className:a?x(t,e=>j(h,e)):t})}const Q=e=>e>12,X=e=>s=>{if("all"===s)return;const l=[...s][0];null!=l&&e(String(l))};function Y({item:e,children:s,onAction:a}){return l.jsxs(E,{id:e.id,className:"rp-item",textValue:e.label,onAction:a,children:[l.jsx(K,{}),l.jsx(U,{i:e,children:s})]})}function G({children:s,content:a,label:n,quiet:t,small:c,size:i,chevron:r=!0,isDisabled:o,appearance:d,placement:u="bottom end",count:p,onIntent:b}){const h=p?l.jsx("span",{className:"rp-count","aria-hidden":"true",children:p}):null,x=g(o),[j,v]=e.useState(!1),M=f(i),D=e.useRef(null),w=l.jsxs(C,{ref:D,className:d?"rp-select":m({quiet:t,small:c,icon:!r}),"data-size":M,"aria-label":n,"aria-describedby":x?.id,isDisabled:o,onHoverStart:b,onFocus:b,children:[s,h,r&&l.jsx(y,{className:"rp-chev"})]});return l.jsxs(N,{children:[r&&!x?w:l.jsxs(k,{delay:400,isOpen:j,onOpenChange:v,children:[l.jsx(A,{children:l.jsx("span",{className:"rp-tipwrap",tabIndex:o?0:-1,"data-passive":o?void 0:"",onPointerDown:e=>{o&&"touch"===e.pointerType&&v(e=>!e)},children:w})}),l.jsx(P,{triggerRef:D,children:x?.text??n})]}),l.jsx(S,{className:"rp-popover rp-list-popover",placement:u,children:a})]})}function J({label:e,labelledBy:s,sections:a,headers:n=!0,focusedByCaller:t,onAction:c,searchLabel:i,actions:r=[]}){const o="function"==typeof a?a():a,d=!!i&&Q(ee(o)),u=l.jsxs(q,{"aria-label":e,"aria-labelledby":s??"",className:d?"rp-menu-scroll":void 0,autoFocus:!t&&void 0,children:[o.map(e=>l.jsxs(V,{"aria-label":n&&!e.hideHeader?void 0:e.title,selectionMode:e.selectionMode??"single",selectedKeys:[`/choice-${e.value}`],onSelectionChange:e.onChange&&X(s=>e.onChange(s.slice(8))),children:[n&&!e.hideHeader&&l.jsx($,{className:"rp-sec-h",children:e.title}),e.items.map(e=>l.jsx(Y,{item:{...e,id:`/choice-${e.id}`},onAction:c&&(()=>c(e.id))},e.id))]},e.title)),r.length>0&&l.jsx(H,{className:"rp-hrule"}),r.map(e=>l.jsx(le,{...e},e.label))]});return d?l.jsx(F,{label:i,children:u}):u}const ee=e=>e.reduce((e,s)=>e+s.items.length,0);function se(e,s){for(const l of e){const a=l.items.find(e=>e.id===l.value);if(a)return e.length>1&&!l.plain&&a.label!==l.title?s("ui.sectionChoice",{section:l.title,item:a.label}):a.label}return""}const le=({label:e,icon:s,onAction:a})=>l.jsxs(E,{className:"rp-item rp-subitem",textValue:e,onAction:a,shouldCloseOnSelect:!0,children:[l.jsx("span",{className:"ic",children:s}),l.jsx(O,{children:e})]}),ae=({id:e,label:s,icon:a,sections:n})=>{const t=M();return l.jsxs(E,{id:e,className:"rp-item rp-subitem",textValue:s,children:[l.jsx("span",{className:"ic",children:a}),l.jsx(O,{children:s}),l.jsxs("span",{className:"desc",children:[se(n,t),l.jsx(y,{className:"rp-chev-end"})]})]})};function ne({label:s,submenus:a,actions:n=[]}){const t="function"==typeof a?a():a,c=M(),i=D(w),[r,o]="rtl"===L().direction?["ArrowLeft","ArrowRight"]:["ArrowRight","ArrowLeft"],[{open:d,left:u},p]=e.useState({open:null,left:null}),b=e.useRef(null),h=e.useId(),m=e=>{b.current?.focus(),p({open:e,left:null==e?d:null})};if(e.useEffect(()=>{const e=b.current;if(!e||null==d&&null==u)return;const s=null==d?`[data-key="${CSS.escape(`/submenu-${u}`)}"]`:'[aria-checked="true"], [role="menuitem"]',l=requestAnimationFrame(()=>{document.activeElement===e&&e.querySelector(s)?.focus()});return()=>cancelAnimationFrame(l)},[d,u]),!i)return l.jsxs(q,{"aria-label":s,"aria-labelledby":"",children:[t.map(e=>"sections"in e?l.jsxs(I,{children:[l.jsx(ae,{id:`/submenu-${e.label}`,...e}),l.jsx(S,{className:"rp-popover rp-list-popover",offset:-4,crossOffset:-9,children:l.jsx(J,{...e,headers:e.sections.length>1})})]},e.label):l.jsx(le,{...e},e.label)),n.map(e=>l.jsx(le,{...e},e.label))]});const f=null==d?null:t.find(e=>e.label===d);if(f&&"sections"in f){const e=()=>m(null),s=s=>{s.key!==o&&"Escape"!==s.key||(s.preventDefault(),s.stopPropagation(),e())};return l.jsxs("div",{ref:b,className:"rp-drill",tabIndex:-1,onKeyDownCapture:s,children:[l.jsxs(C,{className:"rp-item rp-drill-back","aria-label":c("ui.back"),onPress:e,children:[l.jsx(y,{className:"rp-chev-start"}),l.jsx("span",{id:h,children:f.label})]}),l.jsx(J,{...f,labelledBy:h,headers:f.sections.length>1,focusedByCaller:!0})]})}const x=e=>t.find(s=>`/submenu-${s.label}`===e&&"sections"in s)?.label??null;return l.jsx("div",{ref:b,className:"rp-drill",tabIndex:-1,onKeyDownCapture:e=>{const s=x(e.target.dataset.key);e.key===r&&null!=s&&(e.preventDefault(),m(s))},children:l.jsxs(q,{"aria-label":s,"aria-labelledby":"",autoFocus:null==u&&void 0,shouldCloseOnSelect:!1,onAction:e=>{const s=x(String(e));null!=s&&m(s)},children:[t.map(e=>"sections"in e?l.jsx(ae,{id:`/submenu-${e.label}`,...e},e.label):l.jsx(le,{...e},e.label)),n.map(e=>l.jsx(le,{...e},e.label))]})})}function te({label:e,items:s,selectionMode:a,value:n,onChange:t,onAction:c,searchLabel:i}){const r="function"==typeof s?s():s,o=!!i&&Q(r.length),d=l.jsx(q,{"aria-label":e,"aria-labelledby":"",className:o?"rp-menu-scroll":void 0,selectionMode:a,disallowEmptySelection:"single"===a,selectedKeys:null==n?void 0:"string"==typeof n?[n]:n,onSelectionChange:t&&X(t),shouldCloseOnSelect:"multiple"!==a&&void 0,onAction:c&&(e=>c(String(e))),children:r.map(e=>l.jsx(Y,{item:e},e.id))});return o?l.jsx(F,{label:i,children:d}):d}function ce({items:e,selectionMode:s,value:a,onChange:n,sections:t,submenus:c,actions:i,onAction:r,searchLabel:o,triggerLabel:d,...u}){const p=t?Array.isArray(t)&&Q(ee(t)):c?Array.isArray(c)&&c.some(e=>"sections"in e&&!!e.searchLabel&&Q(ee(e.sections))):Array.isArray(e)&&Q(e.length);return l.jsx(G,{...u,label:d??u.label,onIntent:u.onIntent??(o&&p?v:void 0),content:c?l.jsx(ne,{label:u.label,submenus:c,actions:i}):t?l.jsx(J,{label:u.label,sections:t,onAction:r,searchLabel:o,actions:i}):l.jsx(te,{label:u.label,items:e,selectionMode:s??(null==a?"none":"single"),value:a,onChange:n,onAction:r,searchLabel:o})})}function ie(e){return l.jsxs(z,{...e,children:[l.jsx("circle",{cx:"10.859",cy:"5.521",r:"1.5",fill:"currentColor"}),l.jsx("circle",{cx:"6.859",cy:"7.521",r:"1.5",fill:"currentColor"}),l.jsx("circle",{cx:"6.859",cy:"12.521",r:"1.5",fill:"currentColor"}),l.jsx("circle",{cx:"10.859",cy:"14.521",r:"1.5",fill:"currentColor"}),l.jsx("path",{fill:"currentColor",d:"M11.003 18.771c-2.595-.018-4.935-.91-6.662-2.507-1.762-1.631-2.732-3.814-2.732-6.145s.97-4.514 2.732-6.144C6.192 2.257 8.683 1.27 11.17 1.27c2.157 0 4.143.737 5.594 2.074 1.048.97 1.626 2.27 1.626 3.659s-.578 2.69-1.625 3.66l-1.204 1.12c-.086.078-.188.206-.188.362s.102.284.188.364c.146.136.18.169.516.226.414.073.95.166 1.373.576l.001.001c.396.386.626.979.618 1.586-.008.59-.234 1.119-.636 1.49-1.625 1.513-3.97 2.382-6.431 2.382m.168-16c-2.114 0-4.233.84-5.81 2.304C3.907 6.42 3.108 8.211 3.108 10.12s.8 3.7 2.251 5.043c1.431 1.325 3.465 2.094 5.581 2.11 2.147 0 4.12-.723 5.473-1.983.133-.123.154-.31.156-.41.003-.223-.083-.41-.164-.49-.092-.088-.352-.134-.562-.17-.61-.106-.923-.254-1.306-.614-.428-.397-.664-.916-.664-1.46 0-.542.236-1.061.666-1.46l1.205-1.122c.74-.683 1.146-1.592 1.146-2.56s-.407-1.873-1.144-2.556c-1.172-1.08-2.797-1.675-4.576-1.675"})]})}function re(e){return l.jsxs(z,{...e,children:[l.jsx("path",{fill:"currentColor",d:"M10 18.78c-4.825 0-8.75-3.926-8.75-8.75S5.175 1.28 10 1.28s8.75 3.924 8.75 8.75-3.925 8.75-8.75 8.75m0-16c-3.998 0-7.25 3.251-7.25 7.25s3.252 7.25 7.25 7.25 7.25-3.253 7.25-7.25S13.998 2.78 10 2.78"}),l.jsx("path",{fill:"currentColor",d:"M10 14.384c0 .653.615 1.121 1.251.973 2.435-.566 4.249-2.75 4.249-5.357s-1.814-4.79-4.249-5.357c-.636-.148-1.251.32-1.251.973z"})]})}function oe(e){return l.jsx(z,{...e,children:l.jsx("path",{fill:"currentColor",d:"M10 6.35c2.012 0 3.65 1.638 3.65 3.65s-1.638 3.65-3.65 3.65S6.35 12.012 6.35 10 7.988 6.35 10 6.35m0-1.5c-2.84 0-5.15 2.31-5.15 5.15s2.31 5.15 5.15 5.15 5.15-2.31 5.15-5.15S12.84 4.85 10 4.85M10 3.25c-.414 0-.75-.336-.75-.75V1.25c0-.414.336-.75.75-.75s.75.336.75.75V2.5c0 .414-.336.75-.75.75M10 19.5c-.414 0-.75-.336-.75-.75V17.5c0-.414.336-.75.75-.75s.75.336.75.75v1.25c0 .414-.336.75-.75.75M2.5 10.75H1.25c-.414 0-.75-.336-.75-.75s.336-.75.75-.75H2.5c.414 0 .75.336.75.75s-.336.75-.75.75M18.75 10.75H17.5c-.414 0-.75-.336-.75-.75s.336-.75.75-.75h1.25c.414 0 .75.336.75.75s-.336.75-.75.75M15.304 5.446c-.193 0-.384-.073-.53-.22-.294-.292-.294-.767 0-1.06l.883-.884c.293-.293.768-.293 1.06 0s.294.768 0 1.06l-.883.885c-.146.146-.338.22-.53.22M3.813 16.938c-.193 0-.384-.074-.53-.22-.294-.293-.294-.768 0-1.06l.883-.885c.293-.293.768-.293 1.06 0s.294.768 0 1.061l-.883.884c-.147.146-.338.22-.53.22M4.696 5.446c-.192 0-.383-.073-.53-.22l-.884-.883c-.293-.293-.293-.768 0-1.06s.768-.294 1.06 0l.885.883c.293.293.293.768 0 1.06-.147.147-.338.22-.53.22M16.188 16.938c-.193 0-.384-.074-.53-.22l-.885-.884c-.293-.293-.293-.768 0-1.06s.768-.294 1.061 0l.884.883c.293.293.293.768 0 1.06-.147.147-.338.22-.53.22"})})}function de(e){return l.jsx(z,{...e,children:l.jsx("path",{fill:"currentColor",d:"M12.25 2.5H7.834v-.75c0-.414-.336-.75-.75-.75s-.75.336-.75.75v.75H1.75c-.414 0-.75.336-.75.75s.336.75.75.75h7.878C9.17 6.271 7.792 7.876 6.272 8.934c-.479-.869-.843-1.76-1.068-2.645-.101-.401-.51-.648-.912-.542-.4.102-.644.51-.542.911.259 1.02.677 2.045 1.228 3.039-.793.395-1.563.66-2.195.802-.405.09-.659.491-.569.896.078.348.388.585.732.585q.082 0 .164-.018c.766-.171 1.705-.499 2.669-.996.824 1.19 1.83 2.311 2.988 3.284.14.118.312.176.482.176.214 0 .426-.091.575-.268.266-.317.225-.79-.092-1.056-1.031-.867-1.927-1.858-2.664-2.906C8.946 8.906 10.67 6.903 11.156 4h1.094c.414 0 .75-.336.75-.75s-.336-.75-.75-.75M18.94 17.958l-4.018-9.5c-.118-.277-.39-.458-.691-.458s-.573.18-.691.458l-4.02 9.5c-.16.38.018.821.399.982.384.165.822-.016.983-.398l1.28-3.026h4.097l1.28 3.026c.121.286.399.458.691.458q.148 0 .292-.06c.382-.16.56-.601.399-.982m-6.123-3.942 1.414-3.341 1.413 3.34z"})})}function ue({dark:e}){return l.jsxs("span",{className:"rp-icon-stack","data-dark":e||void 0,children:[l.jsx(re,{className:"moon"}),l.jsx(oe,{className:"sun"})]})}function pe({lang:s,pickLang:a}){const n=M(),[t]=e.useState(s);return l.jsx(ce,{quiet:!0,chevron:!1,label:n("ui.lang"),value:s,onChange:e=>a(e),items:B,children:l.jsx(de,{className:s!==t?"rp-icon-in":void 0},s)})}function be({dark:e,label:s,toggle:a}){return l.jsx(R,{quiet:!0,icon:!0,label:s,onPress:a,children:l.jsx(ue,{dark:e})})}const he=()=>T();function me({ap:e,paletteSections:s}){return{palettes:s.map(s=>({...s,items:s.items.map(e=>({...e,aside:!0})),value:e.shownPalette,onChange:s=>e.pickPalette(s)}))}}function fe({more:s,...a}){const n=M(),{palettes:t}=me(a),c=a.ap.palette,[i]=e.useState(c);return l.jsx(ce,{quiet:!0,chevron:!1,label:n("ui.palette"),sections:t,actions:s&&[s],onIntent:he,children:l.jsx(ie,{className:c!==i?"rp-icon-in":void 0},c)})}export{Z as $,ce as C,_ as L,G as M,fe as P,be as S,de as T,pe as a,re as b,ie as c,Q as l,me as u}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/AreaChart-CMjcgmpk.js b/luci-app-honk/root/etc/honk/doona/assets/AreaChart-CMjcgmpk.js deleted file mode 100644 index 0643d86b..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/AreaChart-CMjcgmpk.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{u as a,f as s,g2 as n,dr as o,g3 as l}from"./index-HxEUeoab.js";import{a as i,aW as r,aX as c,aY as u,aZ as h,a_ as m,a$ as p,b0 as d,b1 as x}from"./activity-yZTrGy-J.js";import{G as f,C as M}from"./AreaCurve-DQSHOSpG.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./nodes-6sIn2I0s.js";import"./AppearanceControls-sRy1p156.js";import"./ItemText-DOD_75iR.js";import"./logs-C4GIy4tX.js";import"./Select-D7_6MaHd.js";import"./array-C0VuvQyb.js";const g=[30,60,120,300,600,900,1800,3600,7200,21600,43200,86400].map(e=>1e3*e);function j(t,a){const[s,n]=e.useState([]),o=e.useRef("");return e.useLayoutEffect(()=>{const e=[a,...t].join("\0");if(e===o.current)return;o.current=e;const s=document.createElement("span");s.className="rp-area-tick",Object.assign(s.style,{position:"absolute",top:"-20000px",whiteSpace:"pre"}),document.body.appendChild(s),n(t.map(e=>{s.textContent=e;const{width:t,height:a}=s.getBoundingClientRect();return{width:t,height:a}})),s.remove()},[t,a]),s}function y({label:y,series:b,timestamps:v,fmt:w,locale:k,height:C=150,baseline:D="zero",window:$,fill:N,bare:S=!1,inset:A=2}){const L=a(),T=i(),B=e.useId(),[E,F]=s(Math.round,120),{tip:P,showAt:I,hide:K}=r(),[W,z]=e.useState(null),O=W&&W.indexvoid 0!==_&&void 0!==G?function(e,t){const a=t-e,s=g.find(e=>a/e<=6)??g[g.length-1],n=s>=864e5?6e4*new Date(t).getTimezoneOffset():0,o=[];for(let l=Math.ceil((e-n)/s)*s+n;l<=t;l+=s)l-e>=.04*a&&t-l>=.04*a&&o.push(l);return{ticks:o,step:s}}(_,G):void 0,[_,G]),X=H?H.step<6e4:R<18e4,Y=H?H.step>=864e5:R>1296e5,Z=e.useMemo(()=>Y?n(k):o(k,X),[k,X,Y]),{yDomain:q,yTicks:J}=e.useMemo(()=>{const e=b.flatMap(e=>e.values.filter(e=>null!==e));let t=0,a=(e=>{const t=Math.pow(10,Math.floor(Math.log10(e))),a=e/t;return([1,1.2,1.5,2,2.5,3,4,5,6,8,10].find(e=>a<=e)??10)*t})(1.08*Math.max(1,...e));if("auto"===D&&e.length){const s=Math.min(...e),n=Math.max(...e),o=(e=>{const t=Math.pow(10,Math.floor(Math.log10(Math.max(e,1e-9)))),a=e/t;return(a<=1?.2:a<=2?.5:a<=5?1:2)*t})(Math.max(n-s,.02*n,1));t=Math.max(0,Math.floor(s/o)*o-o),a=Math.ceil(n/o)*o+o}return{yDomain:[t,a],yTicks:"auto"===D?[t,(t+a)/2,a]:[a/2,a]}},[b,D]),Q=e.useMemo(()=>{const e=v.length-1;return H?H.ticks:[...new Set((X?[0,Math.round(e/2),e]:[0,Math.round(e/3),Math.round(2*e/3),e]).map(e=>v[e]))]},[H,X,v]),U=e.useMemo(()=>void 0!==_&&void 0!==G?[_,G]:[Math.min(...v),Math.max(...v)],[_,G,v]),V=F?.width??0,ee=F?.height??C,te=S?A:20,ae=S?2:8,se=ee-(S?2:30),ne=V-(S?A:64),oe=e.useMemo(()=>[Math.min(U[0],...v),Math.max(U[1],...v)],[U,v]),le=e.useCallback(e=>c(e,oe,[te,ne]),[oe,te,ne]),ie=e.useCallback(e=>c(e,q,[se,ae]),[q,se,ae]),re=e.useMemo(()=>v.map(le),[v,le]),ce=e.useMemo(()=>b.map(e=>v.map((t,a)=>null==e.values[a]?null:{x:re[a],y:ie(e.values[a])})),[b,v,re,ie]),ue={x:te,y:ae,width:ne-te,height:se-ae},he=(e,t)=>z({index:e,y:t}),me=()=>{z(null),K()};e.useLayoutEffect(()=>{null!==O&&b.some(e=>null!=e.values[O])?I({x:re[O],y:W?.y??(ae+se)/2,width:V,bounds:S&&E.current?u(E.current):ue,label:l(k).format(v[O]),lines:b.filter(e=>null!=e.values[O]).sort((e,t)=>e.labelt.label?1:0).map(e=>L("ui.valuePair",{label:e.label,value:w(e.values[O])}))}):K()});const pe=h(v.length,he,me),de=e.useMemo(()=>Q.map(e=>Z.format(e)),[Q,Z]),xe=e.useMemo(()=>J.map(w),[J,w]),fe=j(de,k),Me=j(xe,k),ge=H?m(Q.map(le),fe.map(e=>e.width),0,V,16,!0):function(e,t,a){const s=a=>[e[a]-(t[a]??0)/2,e[a]+(t[a]??0)/2],n=e.length-1,o=[];let l=1/0;for(let i=n;i>=0;i--){const[t,r]=s(i);r+a>l||i>0&&ie.width),8),je=m(J.map(ie),Me.map(e=>e.height),0,ee,5,!1),ye=[...new Set([...(S?J:je.map(e=>J[e.index])).map(ie),ae,se])];return t.jsx("div",{ref:E,style:{height:C,width:"100%",flex:N?"1 0 auto":void 0,position:"relative"},onPointerLeave:pe.onPointerLeave,children:v.length>0&&F&&t.jsxs(t.Fragment,{children:[t.jsx(p,{tip:P}),t.jsxs("svg",{className:"rp-activity-surface",width:V,height:ee,viewBox:`0 0 ${V} ${ee}`,style:{display:"block"},role:"application","aria-label":y,tabIndex:0,onFocus:pe.onFocus,onBlur:pe.onBlur,onKeyDown:pe.onKeyDown,onPointerMove:e=>{const{x:t,y:a}=d(e,e.currentTarget,{width:V,height:ee});if(tne||ase)return void me();const s=x(re,t);he(s,a)},children:[t.jsx("g",{className:"rp-area-grid",children:ye.map(e=>t.jsx("line",{x1:te,x2:ne,y1:e,y2:e,stroke:T["hl-med"],strokeDasharray:"2 4",fill:"none"},e))}),t.jsx("defs",{children:b.map((e,a)=>t.jsx(f,{id:B+a,color:e.color},e.label))}),b.map((e,a)=>t.jsx(M,{points:ce[a],baseline:ie(Math.max(0,q[0])),color:e.color,id:B+a,strokeWidth:2},e.label)),null!==O&&t.jsx("path",{d:`M${re[O]},${ae}L${re[O]},${se}`,stroke:T.subtle,strokeDasharray:"3 3",fill:"none",pointerEvents:"none"}),!S&&t.jsxs(t.Fragment,{children:[t.jsx("g",{children:ge.map(({index:e,position:a})=>t.jsx("text",{x:a,y:se+8,className:"rp-area-tick",fill:T.subtle,textAnchor:"middle",children:t.jsx("tspan",{x:a,dy:"0.71em",children:de[e]})},e))}),t.jsx("g",{className:"rp-area-y-ticks",children:je.map(({index:e,position:a})=>t.jsx("text",{x:ne+8,y:a,className:"rp-area-tick",fill:T.subtle,textAnchor:"start",children:t.jsx("tspan",{x:ne+8,dy:"0.355em",children:w(J[e])})},e))})]}),null!==O&&b.map(e=>null==e.values[O]?null:t.jsx("circle",{cx:re[O],cy:ie(e.values[O]),r:4,fill:e.color,stroke:T.base,strokeWidth:2},e.label))]})]})})}export{y as AreaPlot}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/AreaCurve-DQSHOSpG.js b/luci-app-honk/root/etc/honk/doona/assets/AreaCurve-DQSHOSpG.js deleted file mode 100644 index a582e3ed..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/AreaCurve-DQSHOSpG.js +++ /dev/null @@ -1 +0,0 @@ -import{j as t,r as n}from"./vendor-react-64fcanlc.js";import{w as i,c as e,a as o}from"./array-C0VuvQyb.js";function r(t){this._context=t}function u(t){return new r(t)}function l(t){return t[0]}function s(t){return t[1]}function c(t,n){var r=e(!0),c=null,f=u,h=null,a=i(_);function _(i){var e,u,l,s=(i=o(i)).length,_=!1;for(null==c&&(h=f(l=a())),e=0;e<=s;++e)!(enull!==t&&Number.isFinite(t.x)&&Number.isFinite(t.y),p=c().defined(_).x(t=>t.x).y(t=>t.y).curve(y).digits(3),x=function(t,n,r){var f=null,h=e(!0),a=null,_=u,p=null,y=i(x);function x(i){var e,u,l,s,c,x=(i=o(i)).length,d=!1,v=new Array(x),g=new Array(x);for(null==a&&(p=_(c=y())),e=0;e<=x;++e){if(!(e=u;--l)p.point(v[l],g[l]);p.lineEnd(),p.areaEnd()}d&&(v[e]=+t(s,e,i),g[e]=+n(s,e,i),p.point(f?+f(s,e,i):v[e],r?+r(s,e,i):g[e]))}if(c)return p=null,c+""||null}function d(){return c().defined(h).curve(_).context(a)}return t="function"==typeof t?t:void 0===t?l:e(+t),n="function"==typeof n?n:e(void 0===n?0:+n),r="function"==typeof r?r:void 0===r?s:e(+r),x.x=function(n){return arguments.length?(t="function"==typeof n?n:e(+n),f=null,x):t},x.x0=function(n){return arguments.length?(t="function"==typeof n?n:e(+n),x):t},x.x1=function(t){return arguments.length?(f=null==t?null:"function"==typeof t?t:e(+t),x):f},x.y=function(t){return arguments.length?(n="function"==typeof t?t:e(+t),r=null,x):n},x.y0=function(t){return arguments.length?(n="function"==typeof t?t:e(+t),x):n},x.y1=function(t){return arguments.length?(r=null==t?null:"function"==typeof t?t:e(+t),x):r},x.lineX0=x.lineY0=function(){return d().x(t).y(n)},x.lineY1=function(){return d().x(t).y(r)},x.lineX1=function(){return d().x(f).y(n)},x.defined=function(t){return arguments.length?(h="function"==typeof t?t:e(!!t),x):h},x.curve=function(t){return arguments.length?(_=t,null!=a&&(p=_(a)),x):_},x.context=function(t){return arguments.length?(null==t?a=p=null:p=_(a=t),x):a},x}().defined(_).x(t=>t.x).y0(r).y1(t=>t.y).curve(y).digits(3);return t.jsxs("g",{children:[t.jsx("path",{d:x(n)??void 0,stroke:"none",fill:`url(#${h})`,fillOpacity:.6}),t.jsx("path",{className:"rp-area-curve",d:p(n)??void 0,stroke:f,strokeWidth:a,fill:"none"})]})});export{d as C,x as G}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/Checkbox-CJt7u9-e.js b/luci-app-honk/root/etc/honk/doona/assets/Checkbox-CJt7u9-e.js deleted file mode 100644 index 3bdc261e..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/Checkbox-CJt7u9-e.js +++ /dev/null @@ -1 +0,0 @@ -import{ez as e,g4 as t,cC as i,fj as a,cP as s,g5 as l,g6 as n,em as r,en as o,ep as d,eP as c,cL as u,ey as m,eo as f,cK as v,cQ as p,cR as g,cS as b,c$ as h,d0 as R,d1 as I,d2 as M,d3 as P,cU as y,cD as S,cV as C,aD as V}from"./index-HxEUeoab.js";import{r as x,$ as D}from"./vendor-react-64fcanlc.js";function $(t,i){const a=x.useRef(!0),s=x.useRef(null);let l=e(t);x.useEffect(()=>(a.current=!0,()=>{a.current=!1}),[]),x.useEffect(()=>{let e=s.current;a.current?a.current=!1:e&&!i.some((t,i)=>!Object.is(t,e[i]))||l(),s.current=i},i)}function E(e,a,s){let{labelProps:l,inputProps:n,descriptionProps:r,errorMessageProps:o,isSelected:d,isPressed:c,isDisabled:u,isReadOnly:m,isInvalid:f,validationErrors:v,validationDetails:p}=t(e,a,s),{isIndeterminate:g}=e;return x.useEffect(()=>{s.current&&(s.current.indeterminate=!!g)}),{labelProps:i(l,x.useMemo(()=>({onMouseDown:e=>e.preventDefault()}),[])),inputProps:n,descriptionProps:r,errorMessageProps:o,isSelected:d,isPressed:c,isDisabled:u,isReadOnly:m,isInvalid:f,validationErrors:v,validationDetails:p}}const B=new WeakMap;var O;function k(e,t){let{getRowText:i=e=>t.collection.getTextValue?.(e)??t.collection.getItem(e)?.textValue}=e,a=o((s=O)&&s.__esModule?s.default:s,"@react-aria/grid");var s;let l=t.selectionManager.rawSelection,n=x.useRef(l),r=x.useCallback(()=>{if(!t.selectionManager.isFocused||l===n.current)return void(n.current=l);let e=F(l,n.current),s=F(n.current,l),r="replace"===t.selectionManager.selectionBehavior,o=[];if(1===t.selectionManager.selectedKeys.size&&r){let e=t.selectionManager.selectedKeys.keys().next().value;if(null!=e&&t.collection.getItem(e)){let t=i(e);t&&o.push(a.format("selectedItem",{item:t}))}}else if(1===e.size&&0===s.size){let t=e.keys().next().value;if(null!=t){let e=i(t);e&&o.push(a.format("selectedItem",{item:e}))}}else if(1===s.size&&0===e.size){let e=s.keys().next().value;if(null!=e&&t.collection.getItem(e)){let t=i(e);t&&o.push(a.format("deselectedItem",{item:t}))}}"multiple"===t.selectionManager.selectionMode&&(0===o.length||"all"===l||l.size>1||"all"===n.current||n.current?.size>1)&&o.push("all"===l?a.format("selectedAll"):a.format("selectedCount",{count:l.size})),o.length>0&&d(o.join(" ")),n.current=l},[l,t.selectionManager.selectedKeys,t.selectionManager.isFocused,t.selectionManager.selectionBehavior,t.selectionManager.selectionMode,t.collection,i,a]);$(()=>{if(!t.selectionManager.isFocused){let e=requestAnimationFrame(r);return()=>cancelAnimationFrame(e)}r()},[l,t.selectionManager.isFocused])}function F(e,t){let i=new Set;if("all"===e||"all"===t)return i;for(let a of e.keys())t.has(a)||i.add(a);return i}function w(e,t){let i=t?.isDisabled,[a,s]=x.useState(!1);return c(()=>{if(e?.current&&!i){let t=()=>{if(e.current){let t=u(e.current,{tabbable:!0});s(!!t.nextNode())}};t();let i=new MutationObserver(t);return i.observe(e.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{i.disconnect()}}}),!i&&a}function T(e){let t=o((i=O)&&i.__esModule?i.default:i,"@react-aria/grid");var i;let a=m(),s=("pointer"===a||"virtual"===a||null==a)&&"undefined"!=typeof window&&"ontouchstart"in window,l=x.useMemo(()=>{let i,a=e.selectionManager.selectionMode,l=e.selectionManager.selectionBehavior;return s&&(i=t.format("longPressToSelect")),"replace"===l&&"none"!==a&&e.hasItemActions?i:void 0},[e.selectionManager.selectionMode,e.selectionManager.selectionBehavior,e.hasItemActions,t,s]);return f(l)}function z(e,t){let{key:i}=e,a=t.selectionManager,s=v(),l=!t.selectionManager.canSelectItem(i),n=t.selectionManager.isSelected(i);var r;return{checkboxProps:{id:s,"aria-label":o((r=O)&&r.__esModule?r.default:r,"@react-aria/grid").format("select"),isSelected:n,isDisabled:l,onChange:()=>a.toggleSelection(i)}}}O={"ar-AE":r,"bg-BG":r,"cs-CZ":r,"da-DK":r,"de-DE":r,"el-GR":r,"en-US":{deselectedItem:e=>`${e.item} not selected.`,select:"Select",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"No items selected",one:()=>`${t.number(e.count)} item selected`,other:()=>`${t.number(e.count)} items selected`})}.`,selectedAll:"All items selected.",selectedItem:e=>`${e.item} selected.`,longPressToSelect:"Long press to enter selection mode."},"es-ES":r,"et-EE":r,"fi-FI":r,"fr-FR":r,"he-IL":r,"hr-HR":r,"hu-HU":r,"it-IT":r,"ja-JP":r,"ko-KR":r,"lt-LT":r,"lv-LV":r,"nb-NO":r,"nl-NL":r,"pl-PL":r,"pt-BR":r,"pt-PT":r,"ro-RO":r,"ru-RU":r,"sk-SK":r,"sl-SI":r,"sr-SP":r,"sv-SE":r,"tr-TR":r,"uk-UA":r,"zh-CN":{deselectedItem:e=>`未选择 ${e.item}。`,longPressToSelect:"长按以进入选择模式。",select:"选择",selectedAll:"已选择所有项目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未选择项目",one:()=>`已选择 ${t.number(e.count)} 个项目`,other:()=>`已选择 ${t.number(e.count)} 个项目`})}。`,selectedItem:e=>`已选择 ${e.item}。`},"zh-TW":{deselectedItem:e=>`未選取「${e.item}」。`,longPressToSelect:"長按以進入選擇模式。",select:"選取",selectedAll:"已選取所有項目。",selectedCount:(e,t)=>`${t.plural(e.count,{"=0":"未選取任何項目",one:()=>`已選取 ${t.number(e.count)} 個項目`,other:()=>`已選取 ${t.number(e.count)} 個項目`})}。`,selectedItem:e=>`已選取「${e.item}」。`}};const A=x.createContext(null),q=x.createContext(null),L=x.createContext(null),N=x.createContext(null);function j(e,t){let{validationBehavior:i}=g(b)||{},r=e.validationBehavior??i??"native",o=x.useContext(L),d=h(x.useMemo(()=>R(t,void 0!==e.inputRef?e.inputRef:null),[t,e.inputRef])),c={...I(e),children:"function"==typeof e.children||e.children,value:e.value,validationBehavior:r},u=o?function(e,t,i){const r=a({isReadOnly:e.isReadOnly||t.isReadOnly,isSelected:t.isSelected(e.value),defaultSelected:t.defaultValue.includes(e.value),onChange(i){i?t.addValue(e.value):t.removeValue(e.value),e.onChange&&e.onChange(i)}});let{name:o,form:d,descriptionId:c,errorMessageId:u,validationBehavior:m}=B.get(t);m=e.validationBehavior??m;let{realtimeValidation:f}=s({...e,value:r.isSelected,name:void 0,validationBehavior:"aria"}),v=x.useRef(l),p=()=>{t.setInvalid(e.value,f.isInvalid?f:v.current)};x.useEffect(p);let g=t.realtimeValidation.isInvalid?t.realtimeValidation:f,b="native"===m?t.displayValidation:g,h=E({...e,isReadOnly:e.isReadOnly||t.isReadOnly,isDisabled:e.isDisabled||t.isDisabled,name:e.name||o,form:e.form||d,isRequired:e.isRequired??t.isRequired,validationBehavior:m,[n]:{realtimeValidation:g,displayValidation:b,resetValidation:t.resetValidation,commitValidation:t.commitValidation,updateValidation(e){v.current=e,p()}}},r,i);return{...h,inputProps:{...h.inputProps,"aria-describedby":[h.inputProps["aria-describedby"],t.isInvalid?u:null,c].filter(Boolean).join(" ")||void 0}}}(c,o,d):E(c,a(e),d);return[u,d]}const K=x.forwardRef(function(e,t){let{inputRef:i=null,...a}=e;[e,t]=p(a,t,A);let[s,l]=j(e,i);return D.createElement(N.Provider,{value:{...s,inputRef:l,defaultClassName:"react-aria-Checkbox",isIndeterminate:e.isIndeterminate,isRequired:e.isRequired}},D.createElement(_,{...e,ref:t}))}),_=x.forwardRef(function(e,t){let{labelProps:a,inputProps:s,isSelected:l,isDisabled:n,isReadOnly:r,isPressed:o,isInvalid:d,inputRef:c,defaultClassName:u,isIndeterminate:m,isRequired:f}=x.useContext(N),{isFocused:v,isFocusVisible:p,focusProps:g}=M(),b=n||r,{hoverProps:h,isHovered:R}=P({...e,isDisabled:b}),I=y({...e,defaultClassName:u,values:{isSelected:l,isIndeterminate:m||!1,isPressed:o,isHovered:R,isFocused:v,isFocusVisible:p,isDisabled:n,isReadOnly:r,isInvalid:d,isRequired:f||!1}}),$=S(e,{global:!0});return delete $.id,delete $.onClick,D.createElement(C.label,{...i($,a,h,I),ref:t,slot:e.slot||void 0,"data-selected":l||void 0,"data-indeterminate":m||void 0,"data-pressed":o||void 0,"data-hovered":R||void 0,"data-focused":v||void 0,"data-focus-visible":p||void 0,"data-disabled":n||void 0,"data-readonly":r||void 0,"data-invalid":d||void 0,"data-required":f||void 0},D.createElement(V,{elementType:"span"},D.createElement("input",{...i(s,g),ref:c})),I.children)});export{K as $,w as a,T as b,k as c,$ as d,z as e,A as f,q as g}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/CodeEditor-DdrUcw42.js b/luci-app-honk/root/etc/honk/doona/assets/CodeEditor-DdrUcw42.js deleted file mode 100644 index 8d4f22ee..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/CodeEditor-DdrUcw42.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,j as r}from"./vendor-react-64fcanlc.js";import{bN as t,gr as o,bM as n,fl as a,bq as c,u as s,df as i,B as l,fr as d,ft as p}from"./index-HxEUeoab.js";import{S as m,a as u,E as f,C as g,b,l as v,c as x,h,d as y,r as k,e as w,f as C,g as j,i as R,j as A,s as E,k as L,t as M,m as N,n as F,o as O,p as S,q as $,u as q,v as B,w as D,x as I,y as T,z as H,D as K,R as V,A as z,B as G,F as U,G as W,H as P,I as J,J as _,K as Q,L as X}from"./vendor-editor-BRV-W12m.js";import{d as Y,s as Z}from"./daeTokens-BVtuNnWZ.js";import{s as ee}from"./nodes-6sIn2I0s.js";import{M as re}from"./AppearanceControls-sRy1p156.js";import{A as te,n as oe}from"./logs-C4GIy4tX.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./index-DUM-iwa2.js";import"./ItemText-DOD_75iR.js";import"./Select-D7_6MaHd.js";const ne=m.define({name:"dae",languageData:{commentTokens:{line:"#"},closeBrackets:{brackets:["(","{","'",'"']}},startState:Z,token:Y}),ae=["global","subscription","node","group","dns","routing"].map(e=>({label:e,type:"keyword"})),ce=n.map(e=>({label:e,type:"property",apply:e+": "})),se=["domain","dip","sip","dport","sport","l4proto","ipversion","pname","mac","dscp","qname","qtype","upstream"].map(e=>({label:e,type:"function",apply:e+"("})),ie=["geosite","geoip","suffix","full","keyword","regex"].map(e=>({label:e,type:"constant",apply:e+":"})),le=o.map(e=>({label:e,type:"constant"})),de=t.map(e=>({label:e,type:"keyword"})),pe=[{label:"fallback",type:"keyword",apply:"fallback: "},{label:"include",type:"keyword",apply:"include "}];function me(e){return u({override:[r=>function(e,r){const t=e.matchBefore(/[\w.-]*/);if(!t)return null;const o=e.state.doc.lineAt(e.pos),n=o.text.slice(0,e.pos-o.from),a=/->\s*[\w.-]*$/.test(n)||/^\s*fallback:\s*[\w.-]*$/.test(n);if(t.from===t.to&&!e.explicit&&!a)return null;const c=e.state.doc.sliceString(0,e.pos),{blocks:s,tokens:i}=ee(c),l=i.at(-1);if(l?.to===e.pos&&("quoted"===l.kind||"comment"===l.kind))return null;const d=s.find(r=>r.close===e.pos)?.name;let p;if(a)p=[...r().map(e=>({label:e.name,apply:e.written,type:"variable"})),...de];else if(/\b(domain|dip|sip|qname)\(\s*[\w.-]*$/.test(n))p=ie;else if(void 0===d)p=ae.map(e=>({...e,apply:(r,t,o,n)=>{const a=e.label+" {\n \n}";r.dispatch({changes:{from:o,to:n,insert:a},selection:{anchor:o+e.label.length+4}})}}));else if("routing"===d||"dns"===d)p=[...se,...pe];else if("global"===d)p=ce;else{if("group"!==d)return null;p=/\bpolicy\s*:\s*[\w.-]*$/.test(n)?le:[...le.map(e=>({...e,apply:"policy: "+e.label})),{label:"filter",type:"property",apply:"filter: "}]}return{from:t.from,options:p,validFor:/^[\w.-]*$/}}(r,e)]})}function ue(e){let r=!1;const t=r=>(r.state.readOnly&&e(),!1);return f.domEventHandlers({keydown:(e,r)=>function(e){return"Backspace"===e.key||"Delete"===e.key||"Enter"===e.key||1===[...e.key].length&&!e.ctrlKey&&!e.metaKey}(e)&&t(r),paste:(e,r)=>t(r),cut:(e,r)=>t(r),pointerdown:e=>(r="touch"===e.pointerType,!1),click:(e,o)=>r&&t(o)})}const fe=[["Completions","cm.completions"],["Find","cm.find"],["Replace","cm.replace"],["next","cm.next"],["previous","cm.previous"],["all","cm.all"],["match case","cm.matchCase"],["regexp","cm.regexp"],["by word","cm.byWord"],["replace","cm.replaceOne"],["replace all","cm.replaceAll"],["close","ui.close"],["Go to line","cm.gotoLine"],["go","cm.go"],["current match","cm.currentMatch"],["replaced $ matches","cm.replacedMatches"],["replaced match on line $","cm.replacedOnLine"],["on line","cm.onLine"],["Selection deleted","cm.selectionDeleted"],["Control character","cm.controlCharacter"]],ge=e=>b.phrases.of(Object.fromEntries(fe.map(([r,t])=>[r,e(t)]))),be=f.theme({"&":{backgroundColor:"var(--rp-base)",color:"var(--rp-text)",border:"1px solid var(--rp-hl-high)",borderRadius:"var(--rp-r-md)",fontSize:"var(--rp-text-sm)"},"&.cm-focused":{outline:"none",borderColor:"var(--rp-text)"},".cm-scroller":{fontFamily:"var(--rp-font-mono)",lineHeight:"var(--rp-line-body)",fontVariantLigatures:"none",borderRadius:"calc(var(--rp-r-md) - 1px)"},".cm-content":{padding:"var(--rp-space-2) 0",caretColor:"var(--rp-text)"},".cm-line":{padding:"0 var(--rp-space-3)"},".cm-gutters":{backgroundColor:"var(--rp-base)",color:"var(--rp-muted)",border:"none"},".cm-lineNumbers .cm-gutterElement":{padding:"0 var(--rp-space-2) 0 var(--rp-space-3)",minWidth:"40px"},".cm-activeLine, .cm-focusLine":{backgroundColor:"color-mix(in srgb, var(--rp-hl-med) 60%, transparent)"},".cm-activeLineGutter":{backgroundColor:"transparent",color:"var(--rp-text)"},".cm-selectionBackground, &.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:"var(--rp-hl-high)"},".cm-cursor":{borderLeftColor:"var(--rp-text)"},".cm-matchingBracket":{backgroundColor:"color-mix(in srgb, var(--rp-accent) 20%, transparent)",outline:"none"},".cm-selectionMatch":{backgroundColor:"color-mix(in srgb, var(--rp-notice) 25%, transparent)"},".cm-gutter-lint":{width:"12px"},".cm-gutter-lint .cm-gutterElement":{padding:"0"},".cm-lint-marker":{width:"8px",height:"8px",margin:"6px 2px",borderRadius:"50%"},".cm-lint-marker-error":{content:"none",backgroundColor:"var(--rp-negative)"},".cm-lint-marker-warning":{content:"none",backgroundColor:"var(--rp-notice)"},".cm-lint-marker-info":{content:"none",backgroundColor:"var(--rp-foam)"},".cm-tooltip.cm-tooltip-lint":{backgroundColor:"var(--rp-text)",color:"var(--rp-on-text)",border:"none",borderRadius:"var(--rp-r-sm)",padding:"var(--rp-space-half) 0"},".cm-tooltip-lint .cm-diagnostic":{border:"none",padding:"var(--rp-space-half) var(--rp-space-2)",fontSize:"var(--rp-text-xs)",lineHeight:"16px",fontFamily:"inherit"},".cm-tooltip-lint .cm-diagnosticText":{color:"inherit"},".cm-diag-line-error":{backgroundColor:"color-mix(in srgb, var(--rp-negative) 14%, transparent)"},".cm-diag-line-warning":{backgroundColor:"color-mix(in srgb, var(--rp-notice) 16%, transparent)"},".cm-diag-line-info":{backgroundColor:"color-mix(in srgb, var(--rp-foam) 14%, transparent)"},".cm-lintRange-error":{backgroundImage:"none",textDecoration:"underline wavy var(--rp-negative)",textUnderlineOffset:"3px"},".cm-lintRange-warning":{backgroundImage:"none",textDecoration:"underline wavy var(--rp-notice)",textUnderlineOffset:"3px"},".cm-lintRange-info":{backgroundImage:"none",textDecoration:"underline dotted var(--rp-foam)",textUnderlineOffset:"3px"},".cm-tooltip":{backgroundColor:"var(--rp-surface)",border:"1px solid var(--rp-hl-high)",borderRadius:"var(--rp-r-md)",color:"var(--rp-text)"},".cm-tooltip.cm-tooltip-autocomplete > ul > li[aria-selected]":{backgroundColor:"var(--rp-selected)",color:"var(--rp-text)"},".cm-tooltip.cm-tooltip-autocomplete > ul":{fontFamily:"var(--rp-font-mono)",fontVariantLigatures:"none"},".cm-panels":{backgroundColor:"var(--rp-surface)",color:"var(--rp-text)"},".cm-panels-bottom":{borderTop:"1px solid var(--rp-hl-med)"},".cm-textfield":{border:"1px solid var(--rp-hl-high)",borderRadius:"var(--rp-r-sm)",backgroundColor:"var(--rp-base)",color:"var(--rp-text)"},".cm-button":{border:"1px solid var(--rp-hl-high)",borderRadius:"var(--rp-r-sm)",backgroundImage:"none",backgroundColor:"var(--rp-overlay)",color:"var(--rp-text)"}}),ve=_.define([{tag:Q.comment,color:"var(--rp-code-comment)"},{tag:Q.keyword,color:"var(--rp-code-keyword)",fontWeight:"700"},{tag:Q.string,color:"var(--rp-code-string)"},{tag:Q.number,color:"var(--rp-code-number)"},{tag:Q.propertyName,color:"var(--rp-code-propertyName)"},{tag:Q.variableName,color:"var(--rp-code-variableName)"},{tag:Q.operator,color:"var(--rp-code-operator)"},{tag:Q.punctuation,color:"var(--rp-code-punctuation)"}]),xe=z.of((e,r)=>{const t=e.lineAt(r,-1),o=t.from>0?e.lineAt(t.from-1,-1):null;if(!o)return 0;const n=/^\s*/.exec(o.text)[0].length,a=/\{\s*(#.*)?$/.test(o.text),c=/^\s*\}/.test(t.text);return Math.max(0,n+(a?2:0)-(c?2:0))}),he=J.define(),ye={error:K.line({class:"cm-diag-line cm-diag-line-error"}),warning:K.line({class:"cm-diag-line cm-diag-line-warning"}),info:K.line({class:"cm-diag-line cm-diag-line-info"})},ke=H.define({create:()=>K.none,update(e,r){let t=e.map(r.changes);for(const o of r.effects){if(!o.is(he))continue;const e=new V,n={error:0,warning:1,info:2},a=new Map;for(const t of o.value){if(t.line<1||t.line>r.state.doc.lines)continue;const e=a.get(t.line);(!e||n[t.level]e-r)){const o=r.state.doc.line(t).from;e.add(o,o,ye[a.get(t).level])}t=e.finish()}return t},provide:e=>f.decorations.from(e)}),we=[{id:"undo",label:"cm.undo",run:I},{id:"redo",label:"cm.redo",run:T},{id:"comment",label:"cm.toggleComment",run:M}],Ce=[],je=P.define(),Re=J.define(),Ae=K.line({class:"cm-focusLine"}),Ee=H.define({create:()=>K.none,update(e,r){let t=e.map(r.changes);for(const o of r.effects)o.is(Re)&&(t=K.set(Ae.range(r.state.doc.line(o.value).from)));return t},provide:e=>f.decorations.from(e)}),Le=e=>[b.readOnly.of(e),f.editable.of(!e),e?Ee:[G(),U(),W()]];function Me({value:t,onChange:o,readOnly:n=!1,marks:m=Ce,focusLine:u,label:I,outbounds:T,onSave:H,onReadOnlyAttempt:K,compact:V,actions:z=[],focusKey:G,banner:U}){const W=e.useRef(null),P=a(W,`${n} ${!!o} ${I}`),J=e.useRef(null);e.useLayoutEffect(()=>{P&&W.current?.contains(document.activeElement)&&J.current?.querySelector("button")?.focus()},[P]);const _=e.useRef(null),{isFocusVisible:Q}=c({isTextInput:!0}),Y=e.useRef(null),Z=e.useRef(null),ee=e.useRef(o),ae=e.useRef(T),ce=e.useRef(H),se=e.useRef(K);e.useEffect(()=>{ee.current=o,ae.current=T,ce.current=H,se.current=K});const ie=e.useRef(new g),le=s(),de=e.useRef(new g),pe=e.useRef(new g),fe=e.useRef(new g);e.useLayoutEffect(()=>{const e=new f({parent:_.current,state:b.create({doc:t,extensions:[v(),x(),f.scrollMargins.of(e=>{const r=Y.current?.getBoundingClientRect().bottom;return void 0===r?null:{top:Math.min(r,Math.max(0,r-e.scrollDOM.getBoundingClientRect().top))}}),h(),fe.current.of(y()),k(),ke,w(),C(),j(),R.of(" "),A(),xe,me(()=>ae.current?.()??[]),ne,E(ve),be,L.of([{key:"Mod-s",run:()=>(ce.current?.(),!0)},{key:"Mod-/",run:M},{key:"Mod-g",run:N},...F,...O,...S,...$,...q,B]),ie.current.of(Le(n)),de.current.of(ge(le)),pe.current.of(f.contentAttributes.of({"aria-label":I,tabindex:"0"})),ue(()=>se.current?.()),f.updateListener.of(e=>{e.docChanged&&!e.transactions.some(e=>e.annotation(je))&&ee.current?.(e.state.doc.toString())})]})});return Z.current=e,()=>{e.destroy(),Z.current=null}},[]),e.useEffect(()=>{const e=Z.current;e&&e.dispatch({effects:ie.current.reconfigure(Le(n))})},[n]),e.useEffect(()=>{Z.current?.dispatch({effects:de.current.reconfigure(ge(le))})},[le]),e.useEffect(()=>{Z.current?.dispatch({effects:pe.current.reconfigure(f.contentAttributes.of({"aria-label":I,tabindex:"0"}))})},[I]),e.useEffect(()=>{const e=Z.current;e&&e.state.doc.toString()!==t&&(e.dispatch({changes:{from:0,to:e.state.doc.length,insert:t},annotations:je.of(!0),effects:fe.current.reconfigure([])}),e.dispatch({effects:fe.current.reconfigure(y())}))},[t]),e.useEffect(()=>{const e=Z.current;if(!e)return;const r=D(e.state,function(e,r){return r.filter(r=>r.line>=1&&r.line<=e.doc.lines).map(r=>{const t=e.doc.line(r.line),o=Math.max(0,(r.column??1)-1),n=(new TextEncoder).encode(t.text);let a=0;for(let e=0;eo)break;e+=r,a+=4===r?2:1}return{from:t.from+a,to:t.to,severity:r.level,message:r.message}})}(e.state,m)),t=Array.isArray(r.effects)?r.effects:r.effects?[r.effects]:[];e.dispatch({...r,effects:[...t,he.of(m)]})},[m]),e.useEffect(()=>{const e=Z.current;if(!e||!u||u<1||u>e.state.doc.lines)return;const r=e.state.doc.line(u);e.dispatch({selection:{anchor:r.from},effects:[Re.of(u),f.scrollIntoView(r.from,{y:"center"})]}),e.focus()},[u,G]);const ye=e=>{Z.current&&e(Z.current)};return r.jsxs(r.Fragment,{children:[!V&&r.jsxs("div",{className:"rp-editor-head",ref:Y,children:[r.jsxs("div",{className:"rp-editor-toolbar",children:[z.length>0&&r.jsx("div",{className:"rp-toolbar",children:r.jsx(i,{children:r.jsx(te,{actions:z,overflowMode:"wrap"})})}),r.jsxs("div",{className:"rp-editor-actions","data-collapsed":P||void 0,children:[r.jsxs("div",{className:"rp-toolbar",ref:W,children:[r.jsx(l,{onPress:()=>ye(X),children:le(n?"cm.find":"cm.findReplace")}),r.jsx(l,{onPress:()=>ye(N),children:le("cm.gotoLine")}),o&&r.jsx(re,{label:le("cm.commands"),isDisabled:n,content:r.jsx(d,{"aria-label":le("cm.commands"),onAction:e=>{const r=we.find(r=>r.id===e);r&&ye(r.run)},children:we.map(e=>r.jsx(p,{id:e.id,className:"rp-item plain",textValue:le(e.label),children:le(e.label)},e.id))}),children:le("cm.commands")})]}),P&&r.jsx("div",{className:"rp-editor-overflow",ref:J,children:r.jsx(oe,{actions:[{id:"find",label:le(n?"cm.find":"cm.findReplace"),onAction:()=>requestAnimationFrame(()=>ye(X))},{id:"line",label:le("cm.gotoLine"),onAction:()=>requestAnimationFrame(()=>ye(N))},...o?we.map(e=>({id:e.id,label:le(e.label),isDisabled:n,onAction:()=>requestAnimationFrame(()=>ye(e.run))})):[]]})})]})]}),U]}),r.jsx("div",{className:V?"rp-editor compact":"rp-editor",ref:_,"data-keyboard":Q||void 0})]})}export{Me as CodeEditor}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/ConditionRow-B8Otz3rt.js b/luci-app-honk/root/etc/honk/doona/assets/ConditionRow-B8Otz3rt.js deleted file mode 100644 index 0bd6c6f5..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/ConditionRow-B8Otz3rt.js +++ /dev/null @@ -1 +0,0 @@ -import{r as s,j as e}from"./vendor-react-64fcanlc.js";import{$ as a}from"./Checkbox-CJt7u9-e.js";import{C as r}from"./ItemText-DOD_75iR.js";import{da as i,I as l,cq as n,ch as c,B as d}from"./index-HxEUeoab.js";function o({label:l,description:n,isSelected:c,onChange:d,isDisabled:o}){const t=s.useId(),h=s.useId(),x=i({isDisabled:o});return e.jsxs(a,{className:"rp-radio rp-checkbox",isSelected:c,onChange:d,isDisabled:x.isDisabled,"aria-labelledby":t,"aria-describedby":n?h:void 0,children:[e.jsx("span",{className:"rp-checkbox-mark",children:e.jsx(r,{})}),e.jsxs("span",{className:"rp-radio-text",children:[e.jsx("span",{id:t,children:l}),n&&e.jsx("span",{id:h,className:"rp-note",children:n})]})]})}function t(s){return e.jsx(l,{...s,children:e.jsx("path",{fill:"currentColor",d:"M17.78 1.757C16.51.716 14.555.858 13.33 2.08L3.079 12.334c-.32.32-.559.717-.69 1.15l-1.384 4.584c-.08.265-.007.552.188.747.142.143.334.22.53.22q.11 0 .217-.032l4.582-1.384c.434-.13.832-.368 1.151-.688L18.028 6.575c.648-.647.993-1.545.948-2.46s-.482-1.775-1.195-2.358M2.846 17.163l.98-3.246q.042-.135.113-.257l2.41 2.409q-.123.07-.259.114zM16.966 5.516l-9.525 9.526-2.475-2.476 9.425-9.425c.386-.387.896-.586 1.39-.586.38 0 .752.119 1.05.362.392.321.621.772.646 1.272.025.494-.161.977-.51 1.327"})})}function h({children:s}){return e.jsx("div",{className:"rp-toolbar",children:s})}function x({children:s,negate:a,onNegate:r,negateLabel:i,removeLabel:l,onRemove:o,isDisabled:t,removeDisabled:x}){return e.jsxs(n,{children:[s,e.jsxs(h,{children:[e.jsx(c,{isDisabled:t,isSelected:a,onChange:r,children:i}),e.jsx("span",{className:"rp-grow"}),e.jsx(d,{small:!0,isDisabled:t||x,onPress:o,children:l})]})]})}export{o as C,t as E,x as a,h as b}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/Config-C2AJDYeV.js b/luci-app-honk/root/etc/honk/doona/assets/Config-C2AJDYeV.js deleted file mode 100644 index 343c3d13..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/Config-C2AJDYeV.js +++ /dev/null @@ -1,2 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./CodeEditor-DdrUcw42.js","./vendor-react-64fcanlc.js","./_commonjsHelpers-CXUWDbkB.js","./index-HxEUeoab.js","./index-CcbWXWDN.css","./vendor-editor-BRV-W12m.js","./index-DUM-iwa2.js","./daeTokens-BVtuNnWZ.js","./nodes-6sIn2I0s.js","./AppearanceControls-sRy1p156.js","./ItemText-DOD_75iR.js","./logs-C4GIy4tX.js","./Select-D7_6MaHd.js"])))=>i.map(i=>d[i]); -import{r as e,j as n}from"./vendor-react-64fcanlc.js";import{h as i,u as s,al as a,l as r,q as t,r as o,x as l,c4 as c,w as d,c6 as u,Y as g,A as f,aK as p,c2 as m,cw as h,dk as b,dl as x,a1 as v,a0 as j,a9 as y,bO as w,z as k,cv as N,dm as S,t as D,aM as C,aV as T,B as P,aA as O,E as _,bk as R,ax as E,af as M,b5 as A,cq as L,aL as F,C as I,m as H,dn as q,bF as $,bG as K,df as V,a as W,b as U,v as B,aN as z,cs as G,p as J,aD as Q,aG as Y,d9 as X,_ as Z,av as ee,T as ne}from"./index-HxEUeoab.js";import{a as ie,u as se,w as ae,e as re,c as te,H as oe,I as le,K as ce,D as de,L as ue,J as ge,S as fe}from"./logs-C4GIy4tX.js";import{T as pe}from"./Tabs-DT6MQhIo.js";import{T as me}from"./Toolbar-BTFtduwD.js";import{aL as he,a2 as be,aa as xe,aM as ve,y as je,aN as ye,a8 as we,D as ke}from"./activity-yZTrGy-J.js";import{s as Ne,N as Se,O as De,r as Ce,ag as Te,ah as Pe,ai as Oe,aj as _e,K as Re,ak as Ee}from"./nodes-6sIn2I0s.js";import{s as Me,c as Ae,r as Le,a as Fe,b as Ie,d as He,e as qe,f as $e,g as Ke,h as Ve,v as We,i as Ue,j as Be,k as ze,l as Ge,m as Je,n as Qe,o as Ye,w as Xe}from"./nav-BMNMQSWb.js";import{u as Ze,c as en}from"./flows-dBNkBg79.js";import{d as nn}from"./files-Dt8K7QfP.js";import{D as sn}from"./Table-yWn0d3vL.js";import{T as an}from"./TimeCell-BIqfL3y_.js";import{L as rn}from"./AppearanceControls-sRy1p156.js";import{N as tn,t as on}from"./NumberField-q4-QmTAT.js";import{A as ln}from"./AddCircle-C6Jc7GCc.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Select-D7_6MaHd.js";import"./ItemText-DOD_75iR.js";import"./Checkbox-CJt7u9-e.js";import"./Virtualizer-DMIKG2CD.js";function cn(e,n,s,a="main"){if(!s.daeText)return[];const{blocks:r,tokens:t}=Ne(e),o=s.globalSettings;return r.flatMap(s=>{if(s.name===o?.name){const a=r.filter(e=>e.name===o.name).indexOf(s),l=Se(e,s,t);return l.filter(e=>1===l.filter(n=>n.name===e.name).length&&o.fields.some(n=>n.key===e.name)).map(r=>({kind:s.name,from:r.from,to:r.to,label:r.name,line:e.slice(0,r.from).split("\n").length,href:i("config",{tab:"global",source:n,section:String(a),field:r.name})}))}const l=Me[s.name];return"subscription"===s.name?"main"!==a?[]:De(e).filter(e=>e.from>s.open&&e.to<=s.close).map(e=>({kind:s.name,from:e.from,to:e.to,label:e.tag,line:e.line,href:i("nodes",{editSubscriptionTag:e.tag})})):"dns"===s.name?s.children.filter(e=>"routing"===e.name).flatMap(e=>e.children.filter(e=>"request"===e.name||"response"===e.name).map(e=>({kind:s.name,from:e.from,to:e.to,label:e.name,line:e.line+1,href:l}))):l?[{kind:s.name,from:s.from,to:s.to,label:s.name,line:s.line+1,href:l}]:[]})}const dn=()=>{};const un=new Map;function gn({go:n,query:i}){const m=s(),h=a[r()],b=t(),x=b.data?.resources,v=se(o(x,"config",{whileLoading:!0})),j=function(n){const i=s(),a=ie(n),r=e.useMemo(()=>{const e=xe(a.error);return e?e.diagnostics??[]:null},[a.error]);return e.useEffect(()=>{if(a.error)if(r){const e=ve(r);f("negative",e?i("config.writeRestart",{n:e}):i("ui.writeInvalid",{n:r.filter(e=>"error"===e.level).length}))}else p(a.error,i,i("ui.writeFailed"))},[a.error,r,i]),{...a,diagnostics:r}}(v.refetch),y=e.useMemo(()=>new URLSearchParams(i),[i]),w=e.useMemo(()=>v.data?.sources??[],[v.data]),k=w.find(e=>"main"===e.kind)??null,N=w.find(e=>e.id===y.get("source"))??w[0]??null,S=N?.id??null,D=(e,s)=>n("config",d(i,{tab:"source",source:e,line:null===s?null:String(s)})),C=Number(y.get("line"))||null,T=v.data?.diagnostics??[],P=e.useMemo(()=>{const e=v.data?.diagnostics??[];return{error:e.filter(e=>"error"===e.level).length,warning:e.filter(e=>"warning"===e.level).length}},[v.data]),O=o(x,"config_validate",{whileLoading:!1})&&(x?.config_validate.modes??[]).includes("full"),_=!0===x?.config.writable,R=ae(w),E=l().data,M=e.useMemo(()=>re(E),[E]),A=Ae(!!M.globalSettings,b.data),L=N?Le(N,_,R(N),M,m):null,F=!!N&&!L,[I,H]=e.useState(un),[q,$]=e.useState(null),K=q??P.error,V=y.has("source")||void 0===k?.content?"source":"modules",W=c("validate"===y.get("tab")?d(i,{tab:"source"}):i,A.map(e=>e.id),V),U=N?{source:N,sources:w,open:D,diagnostics:T,canValidate:O&&("main"===N.kind||"include"===N.kind),canWrite:F,readOnly:L,isComplete:R,editor:j,focusLine:C,generation:v.data?.generation_id??"",focusDiagnostics:"validate"===y.get("tab"),diagnosticsChoice:I.get(N.id)??null,chooseDiagnostics:e=>H(n=>new Map(n).set(N.id,e)),reportErrors:$}:null,B=!0===x?.config.create&&!0===x.config.writable?{sources:w,refetch:v.refetch,open:e=>D(e,null)}:null;return{error:b.error??v.error,reload:()=>{b.refetch(),v.refetch()},loading:v.loading&&!v.data,ready:!!v.data,tabsReady:!!v.data||A.some(e=>"history"===e.id),metadata:v.data?Ie(v.data.revision,m):[],redacted:!!v.data?.secrets_redacted,tabs:A.map(e=>({id:e.id,label:"source"===e.id&&K?m("ui.aside",{text:m(e.titleKey),note:g(K,h)}):m(e.titleKey)})),tab:W,setTab:e=>n("config",d(u(i,e,null),{field:null})),selectedId:S??"",select:e=>n("config",d(i,{source:e,line:null})),sourceProps:U,newSourceProps:B,modulesProps:v.data?{config:v.data}:null,sourceModel:N?{...Fe(N,h,m),readOnly:L}:null,sourceOptions:w.map(e=>{const n=Fe(e,h,m);return{id:n.id,label:n.label,desc:n.kind}}),exportSource:()=>{N&&nn(be(N),N.content,"text/plain;charset=utf-8")},summaryTone:P.error?"err":P.warning?"warn":"ok",summaryText:P.error?m("config.errors",{n:P.error}):P.warning?m("config.warnings",{n:P.warning}):m("config.clean")}}function fn({source:n,sources:o,diagnostics:c,canValidate:d,canWrite:u,readOnly:g,isComplete:p,editor:v,focusLine:j,generation:y,open:w,diagnosticsChoice:k,chooseDiagnostics:N,reportErrors:S}){const D=s(),C=a[r()],T=re(l().data),P=t().data?.resources,O=Ze(!!j&&!0===P?.rules.available).data,_=en(!!j&&!0===P?.dns_rules.available).data,R=te(!!j&&!0===P?.groups.available).data,E=j?Ce(n.content).find(e=>e.from=j-1):void 0,M=E&&je(R,E.name),A=O?.rules.find(e=>e.source?.source_id===n.id&&e.source.line===j),L=_?.request.some(e=>e.source?.source_id===n.id&&e.source.line===j)?"request":"response",F=_?.[L].find(e=>e.source?.source_id===n.id&&e.source.line===j),[I,H]=e.useState(null),[q,$]=e.useState(null),[K,V]=e.useState(null),W=u&&!0===p(n),U=e.useRef(!1),B=v.errorSource===n.id?v.diagnostics:null,z=e.useMemo(()=>B??q??(I?[]:c),[B,q,I,c]);m(y,()=>$(null));const G=e.useMemo(()=>He(z,n.id,D),[z,n.id,D]),J=I?.text??n.content??"",[Q,Y]=e.useState(null),X=e.useRef(0),Z=e=>Y(null===e?null:{line:e,key:++X.current});m(j,()=>Y(null));const ee=null!==I&&I.text!==n.content,ne=ee&&I.origin.content_sha256!==n.content_sha256,se=h(ee,()=>{H(null),$(null)});e.useEffect(()=>v.cancel,[v.cancel,se.revision]);const ae=I?.text,oe=function(n,i,s){const a=s?.id,r=s?.content;return e.useMemo(()=>{const e=n.filter(e=>"main"===e.kind||"include"===e.kind);return e.some(e=>void 0===i(e))?null:he(e.filter(e=>i(e)),void 0!==a&&void 0!==r?{id:a,content:r}:void 0)},[n,i,a,r])}(o,p,{id:n.id,content:J});!function(n,i){const{validate:s,cancel:a}=ie(dn);e.useEffect(()=>{if(!n)return;let e=!0;const r=setTimeout(()=>{s({sources:n,mode:"full"}).then(n=>{e&&n&&i(n.diagnostics)})},600);return()=>{e=!1,clearTimeout(r),a()}},[n,s,a,i])}(d&&void 0!==ae?oe:null,$);const le=(e,i=!0)=>{$(e.diagnostics);const s=e.diagnostics.find(e=>e.source_id===n.id&&"error"===e.level&&null!==e.line);Z(s?s.line:null);const a=ve(e.diagnostics);return e.valid?i&&f("positive",D("config.valid")):f("negative",a?D("config.writeRestart",{n:a}):D("config.invalid",{n:e.diagnostics.filter(e=>"error"===e.level).length})),e.valid},ce=()=>{v.cancel(),H(null),$(null),V(null)},de=g?()=>{U.current||(U.current=!0,f("info",D("config.readOnlyAttempt"),{detail:g.note}))}:void 0,ue=Fe(n,C,D),ge=null!==q||null!==B,fe=e.useMemo(()=>qe(z,o,C,D,n.id),[z,o,C,D,n.id]),pe=$e(fe),[me,be]=e.useState("all"),xe=Ke(fe,me),ke=ee&&!ge;return e.useEffect(()=>S(ke?null:pe.errors),[S,ke,pe.errors]),e.useEffect(()=>()=>S(null),[S]),{writable:W,links:M?[{from:0,to:0,line:j,label:E.name,href:b("policies",M)}]:A||F?[{from:0,to:0,line:j,label:A?.expression??F.expression,href:i("rules",{tab:A?"list":"dns",view:A?"advanced":null,edit:A?.rule_id??F.rule_id,list:A?null:L})}]:cn(J,n.id,T,n.kind),note:g?.note??D(d?"config.editNoteValidate":"config.editNote"),refused:de,diagnostics:{rows:xe.rows,errors:pe.errors,warnings:pe.warnings,level:xe.level,setLevel:e=>be(e),levels:[["all",D("ui.allCount",{n:pe.errors+pe.warnings+pe.infos})],["error",D("config.levelErrors",{n:pe.errors})],["warning",D("config.levelWarnings",{n:pe.warnings})],["info",D("config.levelInfo",{n:pe.infos})]],scope:ee?D("config.draftDiagnostics"):ge?D("config.fileDiagnostics"):D("config.acceptedDiagnostics",{generation:y}),quiet:ke?D("config.draftPending"):fe.length?null:D("config.clean"),open:Be(pe.errorKeys,k),setOpen:e=>N({open:e,errorKeys:pe.errorKeys}),go:e=>{"jump"===e.action?Z(e.line):"open"===e.action&&w(e.sourceId,e.line)}},restart:ee?ye(B??K??[]):[],marks:G,text:J,outbounds:()=>we(o,{id:n.id,content:J}),focus:Q?.line??j,focusKey:Q?.key??0,dirty:ee,conflict:ne?D("config.changedOnDisk"):null,keep:()=>H(e=>e&&{...e,origin:n}),validate:async()=>{if(!oe)return!1;const e=await v.validate({sources:oe,mode:"full"});return!!e&&le(e)},save:async()=>{if(null===I||v.busy||!W||ne)return;V(null);const e=await v.apply(I.origin,I.text);if($(null),e){if(e.diagnostics)return V(e.diagnostics),void le({valid:!1,diagnostics:e.diagnostics},!1);f("positive",D("config.saved",{path:Fe(n,C,D).label})),se.clear(),H(null)}},cancel:ce,change:e=>{v.cancel(),e===n.content?ce():($(null),V(null),H(i=>({text:e,origin:i?.origin??n})))},view:ue,busy:!!v.busy,validating:"validate"===v.busy,saving:"save"===v.busy,saveButton:ne?{disabled:!0,tip:D("config.changedOnDisk")}:Ue(v.busy,W,g?.note??null,x,D),validateDisabled:!!v.busy||!oe,reason:ee?!W&&g?g.note:"validate"===v.busy?D("config.saveValidating"):Ve({busy:!!v.busy,conflict:!!ne},D):d&&!v.busy?We(oe,o,p,D):null}}function pn(){const n=s(),i=a[r()],o=y(),l=t().data,c=w(l),d=se(!0===l?.resources.config.available),u=oe(c.revisions),m=le(),h=k(),b=N();e.useEffect(()=>()=>b.next(),[b]);const[x,P]=e.useState(null),[O,_]=e.useState(null),R=O&&{...O,...m.pending},[E,M]=e.useState(null),[A,L]=e.useState([]),F=function(e,n,i,s,a,r){const t=!1===n?.recorded;return{unrecorded:t,headNumber:null==r?void 0:g(r,s),rows:(e?.revisions??[]).map(n=>({...n,id:String(n.revision),number:g(n.revision,s),head:n.revision===e?.active,canRestore:i&&(n.revision!==e?.active||t),originText:"import"===n.origin?a("config.revisions.origin.import"):"write"===n.origin?a("config.revisions.origin.write"):"activate"===n.origin?a("config.revisions.origin.activate"):n.origin,size:j(n.bytes,s),metadata:[[a("config.revisions.revision"),g(n.revision,s)],[a("config.revisions.createdAt"),v(n.created_at,s)],[a("config.revisions.parent"),null===n.parent?"—":g(n.parent,s)],[a("config.revisions.principal"),n.principal],[a("config.revisions.hash"),n.content_sha256]]}))}}(u.data,S(d.data),c.canActivate,i,n,R?.head),I=F.rows.find(e=>e.id===x),H=F.rows.find(e=>e.revision===R?.revision),q=()=>{b.next(),_(null)},$=async(e=!1)=>{if(!R||m.busy||(e?!m.pending:m.pending))return;const i=b.start();M(null),L([]);try{const s=e?await m.reread():await m.apply(R.revision,c.replaceRequired,R.head);if(y()!==o||!s)return;if("changed"in s)return void(i()&&(_({revision:R.revision,head:s.changed}),M({id:Date.now(),text:n("config.revisions.changed")})));f("positive",n(null===R.revision?"config.backup.imported":"config.revisions.restored")),i()&&q()}catch(s){if(y()!==o)return;if(p(s,n,n("ui.writeFailed")),i()){if(s instanceof D&&"ui.operationUnknown"===s.key)return;const e=(s instanceof C||s instanceof D?s.details:null)?.diagnostics;L(e??[]);const i=ve(e??[]);M({id:Date.now(),text:i?n("config.writeRestart",{n:i}):T(s,n)})}}};return{management:c,list:u,view:F,detail:I,selected:x,setSelected:P,confirmation:R,target:H,problem:E,diagnostics:qe(A,[],i,n),busy:!!m.busy,confirmDisabled:!!R?.operation||(null===R?.revision?!c.import:!H?.canRestore),show:e=>{b.next(),M(null),L([]),_(m.pending?{revision:m.pending.revision,head:m.pending.head}:{revision:e,head:u.error?void 0:u.data?.active})},close:q,submit:()=>$(),reread:()=>$(!0),exporting:!!h.busy,exportError:h.error,export:async()=>{const e=await h.run("export",e=>o.exportConfig(e));e&&y()===o&&nn(e.filename,e.content,e.contentType)}}}function mn(){const e=s(),i=pn();return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"rp-cluster",children:[i.management.export&&n.jsxs(P,{onPress:()=>{i.export()},isPending:i.exporting,children:[n.jsx(ke,{}),e("config.backup.export")]}),i.management.import&&n.jsx(P,{onPress:()=>i.show(null),children:e("config.backup.import")}),(i.management.export||i.list.data)&&n.jsx(O,{title:e("config.tabHistory"),text:[...i.management.export?[e("config.backup.exportHelp")]:[],...i.list.data?[e("config.revisions.retention",{n:i.list.data.max_revisions})]:[]]})]}),n.jsx(_,{error:i.exportError,message:n=>e("config.backup.exportFailed",{error:n})}),i.view.unrecorded&&n.jsx(R,{tone:"informative",children:e("config.revisions.unrecorded")}),i.management.revisions&&n.jsxs(n.Fragment,{children:[n.jsx(_,{error:i.list.error,onRetry:i.list.refetch}),(i.list.data||i.list.loading)&&n.jsx(n.Fragment,{children:i.view.rows.length||!i.list.data?n.jsx(sn,{label:e("config.tabHistory"),rows:i.view.rows,fit:!0,loading:i.list.loading,selected:i.selected,onSelect:i.setSelected,rowDetail:!0,cols:[{id:"revision",label:e("config.revisions.revision"),minWidth:160,isRowHeader:!0,render:i=>n.jsxs("span",{className:"rp-cluster",children:[i.number,i.head&&n.jsx(E,{children:e("config.revisions.head")})]})},{id:"created",label:e("config.revisions.createdAt"),minWidth:150,render:e=>n.jsx(an,{at:e.created_at})},{id:"origin",label:e("config.revisions.origin"),minWidth:110,render:e=>e.originText},{id:"size",label:e("config.revisions.bytes"),minWidth:100,render:e=>e.size}]}):n.jsx(M,{children:e("config.revisions.empty")})})]}),n.jsx(A,{title:e("config.revisions.details"),isOpen:!!i.detail,onOpenChange:e=>{e||i.setSelected(null)},scrollBody:!0,footer:s=>n.jsxs(n.Fragment,{children:[n.jsx(P,{onPress:s,children:e("ui.close")}),i.management.canActivate&&n.jsx(P,{isDisabled:!i.detail?.canRestore,onPress:()=>{i.show(i.detail.revision),i.setSelected(null)},children:e("config.revisions.restore")})]}),children:i.detail&&n.jsxs(n.Fragment,{children:[n.jsx(ce,{items:i.detail.metadata}),n.jsx(L,{title:e("config.revisions.sources"),children:i.detail.sources.map((i,s)=>n.jsx(ce,{items:[[e("config.source"),i.path],[e("config.revisions.hash"),i.sha256]]},s))})]})}),n.jsxs(F,{title:null===i.confirmation?.revision?e("config.backup.importTitle"):e("config.revisions.restoreTitle",{revision:i.target?.number??""}),isOpen:!!i.confirmation,onCancel:i.close,onConfirm:()=>{i.submit()},isPending:i.busy,isDisabled:i.confirmDisabled,confirmLabel:e(null===i.confirmation?.revision?"config.backup.import":"config.revisions.restore"),error:i.problem,scrollBody:!0,children:[n.jsx("p",{children:null===i.confirmation?.revision?e("config.backup.importHelp"):e("config.revisions.restoreHelp")}),i.target&&n.jsx(ce,{items:i.target.metadata.slice(0,2)}),void 0!==i.view.headNumber&&n.jsx(ce,{items:[[e("config.revisions.head"),i.view.headNumber]]}),i.confirmation?.operation&&!i.busy&&n.jsxs(R,{tone:"informative",children:[n.jsx("p",{children:e("ui.operationUnknown")}),n.jsx(P,{onPress:()=>{i.reread()},children:e("ui.refresh")})]}),i.diagnostics.length>0&&n.jsx(sn,{label:e("config.diagnostics"),rows:i.diagnostics,fit:!0,cols:[{id:"message",isRowHeader:!0,label:e("config.diagnostics"),minWidth:220,text:"wrap",render:i=>n.jsxs("span",{children:[i.text,i.backend&&i.backend!==i.message&&n.jsx(de,{flush:!0,title:e("config.backendText"),children:n.jsx("code",{children:i.backend})})]})}]})]})]})}function hn({config:i}){const a=s(),r=l().data,t=e.useMemo(()=>re(r),[r]);return n.jsx("div",{className:"rp-page",children:ze(i.sources,t,a).map(e=>n.jsxs(I,{"aria-label":e.kind,children:[n.jsxs("div",{className:"rp-row",children:[n.jsxs("span",{className:"rp-cluster",children:[n.jsx("h2",{className:"rp-h3 rp-code",children:e.kind}),n.jsx("span",{className:"rp-label rp-code",children:e.range})]}),e.href&&n.jsx(rn,{appearance:"button",href:e.href,children:a("config.moduleOpen")})]}),n.jsx("span",{className:"rp-label",children:e.note??e.summary})]},e.id))})}const bn="systemctl restart honk-core";function xn({settings:e,sources:i}){const a=s(),t=r();return n.jsx(R,{takeFocus:!0,title:a("config.restart.title",{n:e.length}),action:n.jsxs(n.Fragment,{children:[n.jsx("span",{children:a("config.restart.planned")}),e.map(({key:e,sourceId:s,line:r},t)=>{const o=i.find(e=>e.id===s);return n.jsxs("span",{children:[e&&n.jsx("code",{className:"rp-code",children:e})," ",a("config.restart.effect"),null!==r&&o&&n.jsxs("span",{className:"rp-label",children:[" ",`${be(o)}:${r}`]})]},t)}),n.jsx("span",{children:a("config.restart.next")}),n.jsxs("span",{className:"rp-cluster",children:[n.jsx("code",{className:"rp-code rp-limit-snippet",children:bn}),n.jsx(P,{small:!0,onPress:()=>{(async()=>{const e=await q(bn);f(e?"positive":"negative",a(e?"config.restart.copied":"config.restart.copyFailed"))})()},children:a("config.restart.copy")})]}),n.jsxs(rn,{appearance:"link",external:!0,href:H(t,"reload-and-restart"),children:[a("config.restart.docs"),n.jsx("span",{"aria-hidden":"true",children:"↗"})]})]}),children:a("config.restart.body")})}function vn({groups:e}){const i=s();return n.jsx("div",{className:"rp-page",children:n.jsxs(W,{children:[n.jsx(me,{page:!0,children:n.jsx("span",{className:"rp-cluster nowrap rp-source-pick",children:n.jsx(U,{width:240})})}),n.jsx("span",{className:"rp-label",children:i("config.globalNote")}),e.map(e=>n.jsx(I,{title:e.title,children:n.jsx(me,{className:"top rp-fieldgrid",children:e.fields.map(e=>n.jsxs("div",{className:"rp-field",inert:!0,"aria-hidden":"true",children:[n.jsx("span",{className:"lbl",children:e.label}),n.jsx(U,{}),n.jsx("span",{className:"rp-label rp-code",children:e.key}),e.hint&&n.jsx("span",{className:"rp-label",children:e.hint})]},e.key))})},e.id)),n.jsx(me,{page:!0,children:n.jsx(U,{width:96})})]})})}function jn(i){const a=s(),r=function({query:n,go:i}){const a=s(),r=t().data?.resources,c=o(r,"config",{whileLoading:!1}),u=se(c),g=l().data,p=re(g),m=p.globalSettings,b=e.useMemo(()=>u.data?.sources??[],[u.data?.sources]),x=ae(b),v=e.useMemo(()=>new URLSearchParams(n),[n]),j=b.filter(e=>"main"===e.kind||"include"===e.kind).flatMap(e=>{const n=Ne(e.content).blocks.filter(e=>e.name===m?.name);return(n.length?n:"main"===e.kind?[null]:[]).map((n,i)=>({id:`${e.id}:${i}`,source:e,block:n,index:i,label:`${be(e)}:${n?n.line+1:1}`}))}),y=j.find(e=>e.source.id===v.get("source")&&e.index===Number(v.get("section")??0))??j[0],w=y?.source,k=ie(u.refetch),[N,S]=e.useState(null),[C,T]=e.useState(null),P=h(!!N,()=>{S(null),T(null)});e.useEffect(()=>k.cancel,[k.cancel,P.revision]);const O=N?.patch??{},_=N?.source.content??w?.content??"",R=Ne(_),E=R.blocks.filter(e=>e.name===m?.name)[y?.index??0],M=E?Se(_,E,R.tokens):[],A=a("ui.listSeparator"),L=(m?.fields??[]).map(e=>{const n=M.filter(n=>n.name===e.key),i=n[0]?Ge(e,n[0].value):"",s=O[e.key]??i,r="boolean"===e.type||!!e.choices&&"integer"!==e.type,t="boolean"===e.type?["true","false"]:e.choices??[];return{key:e.key,group:e.group,label:a(e.label),hint:(o=e,"list"===o.type?a("config.globalList"):o.choices&&"integer"===o.type?a("config.globalChoice",{choices:o.choices.join(A)}):o.max&&"18446744073709551615"!==o.max?a("config.globalRange",{max:o.max}):o.units?a("config.globalUnits",{units:o.units.filter(Boolean).join(A)}):void 0),items:r?[{id:"",label:a("config.globalUnset")},...[...t,...s&&!t.includes(s)?[s]:[]].map(e=>({id:e,label:e}))]:null,value:s,number:Qe(e)&&/^\d*$/.test(i)?{max:Number(e.max),value:""===s?NaN:Number(s)}:null,duplicate:n.length>1,invalid:null===Je(e,s),change:n=>{if(!w||k.busy)return;k.cancel(),T(null);const s={...O,[e.key]:n};n===i&&delete s[e.key],S(Object.keys(s).length?{source:N?.source??w,id:y.id,patch:s}:null)}};var o}),F=!!N&&(N.source.content_sha256!==w?.content_sha256||N.id!==y?.id),I=c&&!u.error&&!!w&&!0===r?.config.writable&&w.writable&&!0===x(w)&&!p.holdsCredentials(w),H=!!k.busy,q=!N||!I||F||L.some(e=>e.key in O&&e.invalid),$=xe(k.error)?.diagnostics??null,K=k.error instanceof D&&"ui.writtenNotRead"===k.error.key,V=C??$??null,W=N&&Array.isArray(V)?ye(V):[];return e.useEffect(()=>{const e=v.get("field");if("global"!==v.get("tab")||!e)return;const n=document.getElementById("config-global-form")?.querySelector(`[data-setting="${CSS.escape(e)}"] input, [data-setting="${CSS.escape(e)}"] button`);n?.focus(),n?.scrollIntoView({block:"center"})},[v,w?.id,m,I]),{available:c&&!!m,loading:!!u.loading&&!u.data,fields:L,groups:Object.entries(Ye).map(([e,n])=>({id:e,title:a(n),fields:L.filter(n=>n.group===e)})).filter(e=>e.fields.length>0),source:w,busy:H,blocked:q,writable:I,dirty:!!N,conflict:F,failure:Array.isArray(V)?W.length?null:a("config.invalid",{n:V.filter(e=>"error"===e.level).length}):V,restart:W,sources:b,unread:K?a("ui.writtenNotRead"):null,error:($||K?null:k.error)??u.error,retry:u.refetch,save:async()=>{if(q||H||!m||!y)return;const e=Xe(N.source.content,m,y.index,O),n=he(b.filter(e=>x(e)),{id:w.id,content:e});if(r?.config_validate.available&&r.config_validate.modes?.includes("full")){if(!n)return void T(a("config.incomplete"));const e=await k.validate({sources:n,mode:"full"});if(!e)return;if(!e.valid)return void T(e.diagnostics)}const i=await k.apply(N.source,e);i&&(i.diagnostics?T(i.diagnostics):(P.clear(),S(null),f("positive",a("config.globalSaved"))))},cancel:()=>{k.cancel(),P.clear(),S(null),T(null)},choices:j.map(({id:e,label:n})=>({id:e,label:n})),selected:y?.id??"",select:e=>{const s=j.find(n=>n.id===e);s&&i("config",d(n,{tab:"global",source:s.source.id,section:String(s.index),field:null}))}}}(i);return r.available?r.loading?n.jsx(vn,{groups:r.groups}):n.jsxs($,{id:"config-global-form",className:"rp-page",onSubmit:e=>{e.preventDefault(),r.save()},children:[n.jsx(me,{page:!0,children:n.jsx("span",{className:"rp-cluster nowrap rp-source-pick",children:n.jsx(ue,{side:!0,cut:"path",label:a("config.source"),value:r.selected,items:r.choices,onChange:r.select,isDisabled:r.busy||!r.source})})}),n.jsx("span",{className:"rp-label",children:a("config.globalNote")}),r.unread&&n.jsx(R,{tone:"informative",children:r.unread}),n.jsx(_,{error:r.error,onRetry:r.retry}),r.failure&&n.jsx(R,{children:r.failure}),r.restart.length>0&&n.jsx(xn,{settings:r.restart,sources:r.sources}),r.conflict&&n.jsx(R,{children:a("config.changedOnDisk")}),r.source&&!r.writable&&n.jsx(R,{tone:"informative",children:a("config.readOnly")}),r.groups.map(e=>n.jsx(I,{title:e.title,children:n.jsx(me,{className:"top rp-fieldgrid",children:e.fields.map(e=>n.jsxs("div",{className:"rp-field","data-setting":e.key,children:[e.items?n.jsx(ue,{label:e.label,value:e.value,isDisabled:!r.writable||r.busy||e.duplicate,onChange:e.change,items:e.items}):e.number?n.jsx(tn,{label:e.label,name:e.key,value:e.number.value,onChange:n=>e.change(on(n)),minValue:0,maxValue:e.number.max,step:1,isDisabled:!r.writable||r.busy||e.duplicate,placeholder:a("config.globalUnset"),error:e.invalid?a("config.globalInvalid"):void 0,"aria-describedby":e.hint?`config-global-${e.key}`:void 0}):n.jsx(K,{label:e.label,name:e.key,value:e.value,onChange:e.change,isDisabled:!r.writable||r.busy||e.duplicate,placeholder:a("config.globalUnset"),error:e.invalid?a("config.globalInvalid"):void 0,"aria-describedby":e.hint?`config-global-${e.key}`:void 0}),n.jsx("span",{className:"rp-label rp-code",children:e.key}),e.hint&&n.jsx("span",{id:`config-global-${e.key}`,className:"rp-label",children:e.hint}),e.duplicate&&n.jsx("span",{className:"rp-label",children:a("config.globalDuplicate")})]},e.key))})},e.id)),n.jsx(me,{page:!0,children:n.jsxs(V,{children:[n.jsx(P,{accent:!0,type:"submit",isPending:r.busy,isDisabled:r.blocked,children:a("config.globalSave")}),r.dirty&&n.jsx(P,{onPress:r.cancel,isDisabled:r.busy,children:a("config.discard")})]})})]}):null}const yn="config-new-source-form";function wn(i){const a=s(),r=function({sources:n,refetch:i,open:a}){const r=s(),t=n.find(e=>"main"===e.kind),o=e.useMemo(()=>t?Te(t.content):null,[t]),l=e.useMemo(()=>Pe(o??[]),[o]),c=e.useMemo(()=>Oe(n),[n]),[d,u]=e.useState(null),[g,m]=e.useState(null),{busy:h,create:b}=ge(i),x=N(),v=d?.text??"",j=l.find(e=>e.pattern===d?.pattern)??null,y=j?j.prefix+v+j.suffix:v,w=v?j?_e(v,j):Re(v):null;return{isOpen:null!==d,show:()=>{x.next(),m(null),u({text:l.length?"":Ee(o??[]),pattern:l[0]?.pattern??""})},hide:()=>{x.next(),u(null)},choices:l,choice:j,setChoice:e=>u(n=>n&&{...n,pattern:e}),text:v,setText:e=>u(n=>n&&{...n,text:e}),error:w?r(w):void 0,unmatched:!!v&&!w&&null!==c&&!c(y),problem:g,busy:h,canSubmit:!!v&&!w&&!h,submit:async e=>{if(!v||w||h)return;const n=x.start();try{const i=await b(y);if(!i)return;if(f("positive",r("config.newSourceCreated",{path:y})),!n())return;e(),i.id&&a(i.id)}catch(i){const e=r("config.newSourceFailed",{path:y});if(n()){const n=B(i,r,e);m(e=>({id:(e?.id??0)+1,text:z(n,r),kind:n.kind}))}else p(i,r,e)}}}}(i);return n.jsxs(n.Fragment,{children:[n.jsxs(P,{onPress:r.show,children:[n.jsx(ln,{}),a("config.newSource")]}),n.jsxs(A,{title:a("config.newSourceTitle"),narrow:!0,isOpen:r.isOpen,onOpenChange:e=>{e||r.hide()},footer:e=>n.jsxs(n.Fragment,{children:[n.jsx(P,{onPress:e,children:a("ui.cancel")}),n.jsx(P,{accent:!0,type:"submit",form:yn,isDisabled:!r.canSubmit,isPending:r.busy,children:a("config.newSourceCreate")})]}),children:[r.problem&&n.jsx(G,{problem:r.problem},r.problem.id),n.jsxs($,{id:yn,className:"rp-list",onSubmit:e=>{e.preventDefault(),r.submit(r.hide)},children:[n.jsx("span",{className:"rp-label",children:a(r.choice?"config.newSourceNameHelp":"config.newSourceHelp")}),r.choices.length>1&&n.jsx(ue,{label:a("config.newSourcePattern"),items:r.choices.map(e=>({id:e.pattern,label:e.pattern})),value:r.choice?.pattern??"",onChange:r.setChoice,isDisabled:r.busy}),r.choice?n.jsx(K,{isDisabled:r.busy,label:a("ui.name"),value:r.text,prefix:r.choice.prefix,suffix:r.choice.suffix,placeholder:"extra",spellCheck:!1,error:r.error,onChange:r.setText}):n.jsx(K,{isDisabled:r.busy,label:a("config.newSourcePath"),value:r.text,placeholder:"config.d/extra.dae",spellCheck:!1,error:r.error,onChange:r.setText}),r.unmatched&&n.jsx(R,{tone:"informative",children:a("config.newSourceUnmatched")})]})]})]})}function kn({message:e,busy:i,keep:a,discard:r}){const t=s();return n.jsx(R,{action:(a||r)&&n.jsx(me,{children:n.jsxs(V,{children:[a&&n.jsx(P,{isDisabled:i,onPress:a,children:t("config.keepChanges")}),r&&n.jsx(P,{isDisabled:i,onPress:r,children:t("config.discard")})]})}),children:e})}const Nn=X(()=>Z(()=>import("./CodeEditor-DdrUcw42.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12]),import.meta.url).then(e=>({default:e.CodeEditor}))),Sn=[{block:560}];function Dn(i){const{canValidate:a}=i,r=s(),{writable:t,links:o,diagnostics:l,note:c,refused:d,restart:u,marks:g,text:f,outbounds:p,focus:m,focusKey:h,dirty:b,conflict:x,keep:v,validate:j,save:y,cancel:w,change:k,view:N,busy:S,validating:D,saving:C,saveButton:T,validateDisabled:O,reason:_}=fn(i),R=e.useRef(null),M=e.useRef(!1),A=()=>{M.current&&R.current&&(M.current=!1,R.current.focus(),R.current.scrollIntoView({block:"nearest"}))};e.useEffect(()=>{M.current=!!i.focusDiagnostics,A()},[i.focusDiagnostics,i.focusLine,i.source.id]);const L=function(e,n,i){return e.filter(e=>e.line===n||n&&e.line<=n&&i.slice(0,e.to).split("\n").length>=n)}(o,m,f),F=L.length?L:o,H=n.jsx(me,{"aria-label":r("config.forms"),children:F.map(e=>n.jsx(rn,{appearance:"button",href:e.href,children:e.label},e.from))}),q=n.jsx("div",{ref:R,tabIndex:-1,role:"region","aria-label":r("config.diagnostics"),className:"rp-config-diagnostics",children:l.quiet?n.jsx("span",{className:"rp-config-diagnostics-quiet rp-label",children:l.quiet}):n.jsxs(de,{isExpanded:l.open,onExpandedChange:l.setOpen,title:n.jsxs("span",{className:"rp-config-diagnostics-summary",children:[n.jsx(E,{tone:l.errors?"negative":void 0,children:r("config.levelErrors",{n:l.errors})}),n.jsx(E,{tone:l.warnings?"warn":void 0,children:r("config.levelWarnings",{n:l.warnings})}),n.jsx("span",{className:"rp-label",children:l.scope})]}),children:[n.jsx("div",{className:"rp-config-diagnostic-filter",children:n.jsx(fe,{label:r("config.level"),value:l.level,onChange:l.setLevel,items:l.levels})}),n.jsx("div",{className:"rp-config-diagnostic-list",role:"list","aria-label":r("config.diagnostics"),children:l.rows.map(e=>n.jsxs("div",{className:"rp-config-diagnostic",role:"listitem",children:[n.jsxs(J,{small:!0,tone:e.tone,children:[n.jsx(Q,{children:`${e.levelText} `}),e.text]}),e.backend&&n.jsx(de,{flush:!0,title:r("config.backendText"),children:n.jsx("code",{children:e.backend})}),e.action&&n.jsx(P,{small:!0,className:"rp-config-diagnostic-go",label:"jump"===e.action?r("config.jumpToLine",{line:e.line}):r("config.openSourceAt",{where:e.where}),onPress:()=>l.go(e),children:r("jump"===e.action?"cm.go":"config.openSource")})]},e.id))})]})}),$=[...a?[{id:"validate",label:r("config.validate"),isPending:D,isDisabled:O,reason:_??void 0,onAction:()=>{j()}}]:[],...b?[{id:"cancel",label:r("ui.cancel"),isDisabled:S,onAction:w},{id:"save",label:r("config.save"),accent:!0,isPending:C,isDisabled:T.disabled,reason:T.tip??_??void 0,onAction:()=>{y()}}]:[]];return n.jsxs(I,{title:r("config.editor"),className:"rp-source-card","aria-label":N.label,help:t?{title:r("config.editor"),text:r("config.writeHelp")}:void 0,reason:_,children:[n.jsx("div",{className:"rp-row rp-source-note",children:n.jsx("span",{className:"rp-cluster",children:b?n.jsxs(n.Fragment,{children:[n.jsx(E,{tone:"warn",children:r("config.unsaved")}),n.jsx("span",{className:"rp-label",children:r("config.unsavedHint")})]}):n.jsx("span",{className:"rp-label",children:c})})}),x&&n.jsx(kn,{message:x,busy:S,keep:v}),u.length>0&&n.jsx(xn,{settings:u,sources:i.sources}),L.length?H:o.length>0&&n.jsx(de,{title:r("config.forms"),children:H}),n.jsxs(e.Suspense,{fallback:n.jsx(Y,{panel:!0,shape:Sn}),children:[n.jsx(Nn.Component,{actions:$,label:N.label,value:f,readOnly:!t||S,onChange:k,onReadOnlyAttempt:d,marks:g,focusLine:m,focusKey:h,banner:q,outbounds:p,onSave:b&&!S?()=>{y()}:void 0}),n.jsx(Cn,{run:A})]})]})}function Cn({run:n}){const i=e.useRef(n);return e.useEffect(()=>i.current(),[]),null}const Tn=[{toolbar:3,height:24}],Pn=[{cards:[94,94,94,94,94,94,94],gap:"page"}],On=[{toolbar:1,height:16},...Sn],_n=[{tabs:3},{toolbar:1},...On];function Rn(i){const a=s(),{error:r,reload:t,loading:o,ready:l,tabsReady:c,metadata:d,redacted:u,tabs:g,tab:f,setTab:p,selectedId:m,select:h,sourceProps:b,newSourceProps:x,modulesProps:v,sourceModel:j,sourceOptions:y,exportSource:w,summaryTone:k,summaryText:N}=gn(i);e.useEffect(()=>{"source"===f&&Nn.preload().catch(()=>{})},[f]);const S={history:n.jsx(mn,{}),modules:v?n.jsx(hn,{...v}):o&&n.jsx(Y,{panel:!0,shape:Pn}),global:n.jsx(jn,{...i}),source:n.jsxs(n.Fragment,{children:[n.jsxs(me,{page:!0,children:[n.jsxs("span",{className:"rp-cluster nowrap rp-source-pick",children:[n.jsx(ue,{side:!0,cut:"path",label:a("config.source"),value:m,onChange:h,items:y}),j&&n.jsxs(n.Fragment,{children:[j.readOnly&&n.jsx(ee,{help:j.readOnly.help,children:n.jsx(E,{children:j.readOnly.label})}),n.jsx(ne,{className:"rp-label",text:j.loaded,children:j.facts})]})]}),(x||j)&&n.jsxs("span",{className:"rp-cluster nowrap",children:[x&&n.jsx(wn,{...x}),j&&n.jsxs(P,{onPress:w,children:[n.jsx(ke,{}),a("config.export")]})]})]}),j&&n.jsx("span",{className:"rp-label",children:a("config.exportWarning")}),b?n.jsx(Dn,{...b},j.id):o&&n.jsx(Y,{panel:!0,shape:On})]})};return n.jsxs("div",{className:"rp-page",children:[n.jsx(_,{error:r,onRetry:t}),o&&n.jsx(Y,{shape:c?Tn:[...Tn,..._n]}),l&&n.jsxs(me,{page:!0,children:[n.jsx(ce,{row:!0,items:d}),n.jsx(J,{small:!0,tone:k,children:N}),u&&n.jsx(J,{small:!0,tone:"muted",children:a("config.redacted")})]}),c&&n.jsx(pe,{page:!0,label:a("nav.config"),value:f,onChange:p,items:g.map(e=>({...e,content:S[e.id]}))})]})}export{Rn as Config}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/Connections-DUegD4fy.js b/luci-app-honk/root/etc/honk/doona/assets/Connections-DUegD4fy.js deleted file mode 100644 index 8f676730..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/Connections-DUegD4fy.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,j as n}from"./vendor-react-64fcanlc.js";import{O as t}from"./OutboundTag-CO8Ndxdr.js";import{aU as o,u as s,al as l,l as a,a0 as i,o as r,aB as c,C as u,E as d,Y as p,a8 as m,s as b,M as h,bW as g,ax as f,N as w,T as v,bX as y,w as x,bY as j,U as _,bZ as k,b_ as C,Z as S,a1 as A,q as L,r as N,O as T,b$ as M,a6 as R,c0 as O,ah as P,G as F,c1 as U,b4 as W,c2 as q,bS as D,c3 as E,c4 as I,c5 as V,K as H,am as Q,c6 as B,A as K,c7 as G,aV as J,b9 as Y,c8 as Z,aM as X,c9 as z,bG as $,B as ee,ca as ne,bx as te,av as oe,p as se}from"./index-HxEUeoab.js";import{R as le,u as ae,i as ie,o as re,h as ce,c as ue,S as de,L as pe,n as me,K as be}from"./logs-C4GIy4tX.js";import{C as he}from"./AppearanceControls-sRy1p156.js";import{T as ge}from"./Tabs-DT6MQhIo.js";import{T as fe}from"./Toolbar-BTFtduwD.js";import{a as we,D as ve,U as ye,F as xe,S as je,c as _e,B as ke,L as Ce,t as Se,d as Ae,f as Le,g as Ne,p as Te,o as Me,k as Re,h as Oe}from"./activity-yZTrGy-J.js";import{S as Pe}from"./SearchSelect-BcScGUbQ.js";import{D as Fe}from"./Table-yWn0d3vL.js";import{T as Ue}from"./TimeCell-BIqfL3y_.js";import{Q as We,u as qe,R as De}from"./useQuickRule-DUEi6geL.js";import{u as Ee}from"./outbounds-Bbb6kdae.js";import{c as Ie,d as Ve,e as He}from"./files-Dt8K7QfP.js";import{w as Qe}from"./labels-D8xxfRTQ.js";import{u as Be}from"./flows-dBNkBg79.js";import{r as Ke}from"./rule-Bl9YOsFn.js";import{c as Ge}from"./nav-BO8viH9G.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Tag-SxASl3TF.js";import"./Select-D7_6MaHd.js";import"./ItemText-DOD_75iR.js";import"./nodes-6sIn2I0s.js";import"./Checkbox-CJt7u9-e.js";import"./SearchList-LjCruZYP.js";import"./Virtualizer-DMIKG2CD.js";import"./DaeCode-DEjXqvav.js";import"./daeTokens-BVtuNnWZ.js";import"./AddCircle-C6Jc7GCc.js";const Je=[0,2,3,1,4,5,6,7],Ye=e.memo(function({records:t,outbounds:p,latency:m,latencyError:b,retryLatency:h,truncated:g,uncounted:f,onSelect:w}){const v=s(),y=we(),x=l[a()],j=e.useCallback(e=>i(e,x),[x]),_=e.useMemo(()=>function(e,n){const t=new Map;let s=0;for(const o of e){if(null===o.upload_bytes||null===o.download_bytes){s++;continue}const e={id:o.id,up:Number(o.upload_bytes),down:Number(o.download_bytes),name:o.domain||o.dst||o.id},n=t.get(o.outbound);n?n.push(e):t.set(o.outbound,[e])}const l=[...t].map(([e,n])=>({outbound:e,points:n})).sort((e,t)=>o(n)(e.outbound??"",t.outbound??""));let a,i=-1n;for(const o of e){if(null===o.upload_bytes||null===o.download_bytes)continue;const e=BigInt(o.upload_bytes)+BigInt(o.download_bytes);e>i&&(i=e,a={id:o.id,up:Number(o.upload_bytes),down:Number(o.download_bytes),name:o.domain||o.dst||o.id,outbound:o.outbound})}return{series:l,unknown:s,heaviest:a,placed:e.length-s}}(t,x),[t,x]),k=e.useMemo(()=>{const e=p.filter(e=>"block"!==e);return _.series.map(n=>{return{id:n.outbound??"",label:r(n.outbound,v),color:(t=n.outbound,"block"===t?y.negative:y.cat[Je[Math.max(0,e.indexOf(t))%Je.length]]),points:n.points.map(e=>({id:e.id,x:e.up,y:e.down,name:e.name,detail:v("conn.chart.point",{download:j(e.down),upload:j(e.up)})}))};var t})},[_,p,y,v,j]),C=_.heaviest?[{label:v("conn.chart.busiest"),icon:n.jsx(c,{}),tint:"c3",value:_.heaviest.name,caption:r(_.heaviest.outbound,v)},{label:v("ui.download"),value:j(_.heaviest.down),icon:n.jsx(ve,{}),tint:"c1"},{label:v("ui.upload"),value:j(_.heaviest.up),icon:n.jsx(ye,{}),tint:"c4"}]:[],S=_.unknown?v("conn.chart.sampleUnknown",{n:t.length,unknown:_.unknown}):v("conn.chart.sample",{n:t.length});return n.jsxs("div",{className:"rp-chart-page",children:[n.jsx(xe,{facts:C,lead:!0}),n.jsxs(u,{title:v("conn.chart.title"),help:f?{title:v("conn.chart.title"),text:v("ui.trafficUncounted")}:void 0,note:S,children:[g&&n.jsx("p",{className:"rp-note",children:v("conn.truncated")}),_.placed>0&&n.jsxs(n.Fragment,{children:[n.jsx(je,{label:v("conn.chart.title"),series:k,fmt:j,onSelect:w,regions:{above:v("conn.chart.moreDown"),below:v("conn.chart.moreUp")}}),n.jsx(_e,{series:k}),n.jsx("p",{className:"rp-note",children:v("conn.chart.hint")})]})]}),m?n.jsx(Ze,{latency:m}):b&&n.jsx(u,{title:v("ui.nodeLatency"),children:n.jsx(d,{error:b,onRetry:h})})]})});function Ze({latency:e}){const t=s(),o=we(),i=e=>m(e,t),r=l[a()],c=n=>!e.chains||n?o.cat[0]:o.muted;return n.jsx(u,{title:t("ui.nodeLatency"),note:t("conn.latency.sample",{n:e.samples.length,missing:e.missing}),children:e.samples.length?n.jsxs(n.Fragment,{children:[n.jsx("p",{className:"rp-note",children:t("conn.latency.percentiles",{p50:i(e.p50),p90:i(e.p90)})}),null!==e.weightedP50&&n.jsx("p",{className:"rp-note",children:e.unplaced?t("conn.latency.weightedUnplaced",{p50:i(e.weightedP50),n:e.unplaced}):t("conn.latency.weighted",{p50:i(e.weightedP50)})}),n.jsx(ke,{label:t("ui.nodeLatency"),points:e.samples.map(e=>({id:e.node,nodeName:!0,value:e.value,color:c(e.connections>0),lines:[e.name,i(e.value),...e.connections?[t("conn.chart.sample",{n:e.connections})]:[]]})),fmt:i}),e.chains&&n.jsxs("div",{className:"rp-legend",children:[n.jsx(Ce,{swatch:c(!0),label:t("conn.latency.inUse"),value:p(e.used,r)}),n.jsx(Ce,{swatch:c(!1),label:t("conn.latency.others"),value:p(e.samples.length-e.used,r)})]}),n.jsx("p",{className:"rp-note",children:t("conn.latency.hint")})]}):n.jsx("p",{className:"rp-note",children:t("conn.latency.pending")})})}const Xe=[{id:"dst",label:"ui.target",minWidth:200,sortable:!0},{id:"src",label:"ui.device",minWidth:128,sortable:!0,drop:5},{id:"node",label:"nodes.node",minWidth:120,drop:3},{id:"rule",label:"ui.rule",minWidth:220,drop:2},{id:"state",label:"ui.state",minWidth:112,sortable:!0,drop:7},{id:"down",label:"ui.download",minWidth:96,sortable:!0,drop:4},{id:"downRate",label:"conn.f.downloadRate",minWidth:128,sortable:!0,drop:1},{id:"age",label:"ui.started",minWidth:132,sortable:!0,drop:6}],ze=b.connectionsView,$e=e=>({allCollapsed:e,exceptions:new Set}),en=(e,n)=>e.allCollapsed!==e.exceptions.has(n);function nn(e,n){const t=new Set(e.exceptions);return t.delete(n)||t.add(n),{allCollapsed:e.allCollapsed,exceptions:t}}const tn=(e,n)=>"source"===n?h(e.src??void 0)??e.src??"—":e.outbound??"unknown",on=(e,n,t)=>"source"===n?e:r(e,t),sn=e=>"g:"+e,ln=e=>e.startsWith("g:")||e.startsWith("\\")?"\\"+e:e;function an(e){const n={hidden:[],sort:null,group:"source"};try{const t=JSON.parse(e??"null");if(!t||"object"!=typeof t)return n;const o=Array.isArray(t.hidden)?t.hidden.map(e=>"chain"===e?"node":e):[],s=Xe.filter(e=>o.includes(e.id)).map(e=>e.id),l=t.sort;return{hidden:s.length===Xe.length?[]:s,sort:l&&Xe.some(e=>e.sortable&&e.id===l.column)&&["ascending","descending"].includes(l.direction)?{column:l.column,direction:l.direction}:null,group:"none"===t.group||"outbound"===t.group?t.group:"source"}}catch{return n}}const rn=e=>e.target;function cn({collection:t,view:o,collapse:l,onToggleGroup:a,loading:i,selected:r,onSelect:c,selectOnFocus:u,onSort:d,rule:p}){const m=s(),[b,h]=g(442),y=e.useRef(p);e.useLayoutEffect(()=>{y.current=p});const x=e.useMemo(()=>{const e={dst:e=>n.jsx(v,{children:e.target}),src:e=>n.jsx(v,{className:"rp-code",children:e.source}),node:e=>e.nodeName?n.jsx(w,{name:e.node,className:"rp-chain",text:e.path??void 0}):n.jsx(v,{className:"rp-chain",text:e.path??void 0,children:e.node}),rule:e=>n.jsxs("span",{className:"rp-rule",children:[n.jsx(le,{...e.rule}),e.recomputed&&n.jsx(f,{children:e.recomputed})]}),state:e=>e.state,down:e=>e.download,downRate:e=>e.downloadRate,age:e=>n.jsx(Ue,{at:e.startedAt})};return[...Xe.filter(e=>!o.hidden.includes(e.id)).map(n=>({...n,label:m(n.label),grow:1,render:e[n.id]})),{id:"actions",actions:!0,label:m("ui.actions"),minWidth:88,grow:0,render:e=>{const t=y.current,o=!t.canAdd(e.seed);return n.jsx(We,{label:t.label(e.target),disabled:o,tip:t.noTarget,onPress:()=>y.current.open(e.seed)})}}]},[o.hidden,m]),j=e.useMemo(()=>t.map(e=>"connection"in e?e.connection:e),[t]),_=e.useMemo(()=>({grouped:"none"!==o.group,collapsed:e=>en(l,e),onToggle:a}),[o.group,l,a]);return n.jsx("div",{ref:b,children:n.jsx(Fe,{label:m("nav.connections"),rowDetail:!0,cols:x,rows:j,height:h,selected:r&&ln(r),onSelect:c&&(e=>c(e&&(e=>e.startsWith("\\")?e.slice(1):e)(e))),selectOnFocus:u,reveal:!0,empty:m("conn.empty"),loading:i,sort:o.sort&&{column:String(o.sort.column),direction:o.sort.direction},onSort:d,getTextValue:rn,stream:!0,tree:_})})}const un={userspace:"ov.v.userspace",ebpf:"ov.v.ebpf",mixed:"conn.observed.mixed"},dn={evaluation:"conn.chainSource.evaluation",reconstructed:"conn.chainSource.reconstructed",unknown:"ui.unknown"};function pn(e,n){const t=e.chain_source?[["conn.f.chainSource",dn[e.chain_source]?{key:dn[e.chain_source]}:e.chain_source]]:[];return[["ui.device",e.src??"—"],["conn.f.dst",e.dst??"—"],["ui.domain",e.domain??"—"],["conn.f.ingress",Qe(e.ingress)],["conn.f.domainSource",Qe(e.domain_source)],...t,["ui.process",e.pname??"—"],["conn.f.observedBy",un[e.observed_by]?{key:un[e.observed_by]}:e.observed_by],["ui.upload",i(e.upload_bytes,n)],["ui.download",i(e.download_bytes,n)],["conn.f.uploadRate",S(e.upload_bytes_per_second,n)],["conn.f.downloadRate",S(e.download_bytes_per_second,n)],["conn.f.started",A(e.started_at,n)]]}const mn={observed:["conn.state.observed","conn.stateHelp.observed"],routing:["conn.state.routing","conn.stateHelp.routing"],dialing:["conn.state.dialing","conn.stateHelp.dialing"]};function bn(e,n){return Object.hasOwn(mn,e)?{title:n("ui.state"),text:Object.values(mn).map(([e,t])=>n("ui.valuePair",{label:n(e),value:n(t)}))}:null}const hn=e=>({domain:e.domain??null,dip:h(e.dst)??null,sip:h(e.src)??null,outbound:e.outbound,matched:e.rule_id&&"unknown"!==e.rule_source?{id:e.rule_id,expression:e.rule_expression}:null});const gn=new WeakMap;function fn(e,n,t,s,l,a){const r=e=>{const n=gn.get(e);if(n&&n.locale===t&&n.names===s&&n.rulesListed===l&&n.t===a)return n.row;const o={id:ln(e.id),target:e.domain||e.dst||"—",seed:hn(e),source:e.src??"—",node:O(e,a,s),nodeName:!R(e.outbound)&&e.chain.length>0,path:M(e,a,s),rule:{expression:e.rule_expression,href:Ae(e.rule_id,l)},recomputed:"recomputed"===e.rule_source?a("conn.recomputed"):null,state:_(k,e.state,a),download:i(e.download_bytes,t),downloadRate:S(e.download_bytes_per_second,t),startedAt:e.started_at};return gn.set(e,{locale:t,names:s,rulesListed:l,t:a,row:o}),o};return function(e,n,t,s){let l=e;if(n.sort){const{column:r,direction:c}=n.sort,u=o(t);a=e=>{switch(r){case"dst":return e.domain||e.dst;case"src":return e.src;case"state":return _(k,e.state,s);case"down":return P(e.download_bytes);case"downRate":return P(e.download_bytes_per_second);case"age":return e.started_at?Date.parse(e.started_at):null;default:return null}},i=(e,n)=>{if(null==e)return null==n?0:1;if(null==n)return-1;const t="string"==typeof e&&"string"==typeof n?u(e,n):en?1:0;return"descending"===c?-t:t},l=e.map(e=>({item:e,key:a(e)})).sort((e,n)=>i(e.key,n.key)).map(e=>e.item)}var a,i;if("none"===n.group)return l.map(e=>({id:ln(e.id),connection:e}));const r=new Map;for(const o of l){const e=tn(o,n.group),t=r.get(e);t?t.push(o):r.set(e,[o])}return[...r].map(([e,n])=>({id:sn(e),group:e,children:n,active:n.filter(e=>"active"===e.state).length,download:T(...n.map(e=>e.download_bytes))}))}(e,n,t,a).map(e=>"connection"in e?{id:e.id,connection:r(e.connection)}:{id:e.id,group:e.group,children:e.children.map(r),label:a("conn.groupCount",{name:on(e.group,n.group,a),n:e.children.length}),totals:{down:i(e.download,t),state:a("conn.activeCount",{n:e.active})}})}const wn=Ge().map(e=>e.id),vn=e=>["id","src","network","out","rule","q"].some(n=>new URLSearchParams(e).has(n))?"list":"traffic",yn=(e,n)=>x(e,"list"===vn(e)?{tab:I(e,wn,"list"),...n}:n);function xn({go:n,query:t}){const i=s(),c=l[a()],[u,d]=e.useState(()=>{try{return an(localStorage.getItem(ze))}catch{return an(null)}}),m=W(Z),b=W(Y),[g,f]=e.useState(()=>$e(!1)),w=e.useCallback(e=>f(n=>nn(n,e)),[]),v=e=>{const n={...u,...e};n.group!==u.group&&f($e(!1)),d(n);try{localStorage.setItem(ze,JSON.stringify(n))}catch{}},S=e.useMemo(()=>new URLSearchParams(t),[t]),[A,T]=e.useState(S.get("q")??""),M=S.get("network")??"all",R=S.get("out")??"all",O=S.get("rule")??"all",P=(e,o)=>n("connections",yn(t,{[e]:"all"===o?null:o})),$=S.get("id"),[ee,ne]=e.useState(null);q(S.get("q"),e=>T(e??""));const te=e.useRef(t);e.useEffect(()=>{te.current=t});const oe=e=>n("connections",yn(te.current,{id:e})),se=e.useDeferredValue(A),le=D(S.get("src")??""),de=ie(le),pe=L(),me=!0===pe.data?.resources.connections.can_close,be=N(pe.data?.resources,"rules",{whileLoading:!1}),he=N(pe.data?.resources,"flows",{whileLoading:!1});E(pe.data?.resources);const ge=Ee(),fe=re(de.refetch),we=vn(t),ve=I(t,wn,we),ye=V(de.data,"list"===ve),xe=V(de.data,"traffic"===ve),je=e.useMemo(()=>H(ye),[ye]),_e=e.useMemo(()=>H(xe),[xe]),ke=N(pe.data?.resources,"nodes",{whileLoading:!1}),Ce=ce(ke),Pe=V(Ce.data,"traffic"===ve),Fe=e.useMemo(()=>ke&&Pe?function(e,n,t){if(!n.some(e=>e.health?.length))return null;const s=[];let l=0;for(const o of n){const e=F(U(o.health??[]));void 0===e?l++:s.push({node:o.id,name:o.name,value:e,connections:0})}s.sort((e,n)=>e.value-n.value||o(t)(e.name,n.name));const a=new Map(s.map(e=>[e.node,e])),i=e.some(e=>e.chain?.length);let r=0;for(const o of e){const e=o.chain?.at(-1);if(void 0===e)continue;const n=a.get(e);n?n.connections++:r++}const c=s.reduce((e,n)=>e+n.connections,0);let u=0;const d=s.find(e=>(u+=e.connections)>=Math.max(1,Math.ceil(c/2))),p=s.map(e=>e.value);return{samples:s,chains:i,missing:l,unplaced:r,used:s.filter(e=>e.connections).length,p50:Te(p,50),p90:Te(p,90),weightedP50:c?d.value:null}}(_e,Pe,c):null,[ke,Pe,_e,c]),Ue=Q("traffic"===ve&&N(pe.data?.resources,"runtime",{whileLoading:!1})),We=ke&&!Ce.data?Ce.error:null,De=e.useMemo(()=>[...new Set(_e.map(e=>e.outbound))].sort((e,n)=>o(c)(e??"",n??"")),[_e,c]),Qe=se.trim().toLowerCase(),Ge=e.useMemo(()=>je.filter(e=>("all"===M||e.network===M)&&("all"===R||e.outbound===R)&&("all"===O||e.rule_expression===O)&&(!Qe||[e.dst,e.domain,e.src,e.pname,r(e.outbound,i),C(e.chain,ge).join(" "),e.rule_expression].join(" ").toLowerCase().includes(Qe))),[je,M,R,O,Qe,ge,i]),Je=$?je.find(e=>e.id===$):void 0,[Ye,Ze]=e.useState(null);$||null===Ye||Ze(null);const on=function(e,n){if(!e||"none"===n)return null;const t=tn(e,n);return{group:t,token:JSON.stringify([e.id,n,t])}}(Je,u.group);var sn,ln;on&&Ye!==on.token&&(Ze(on.token),f((sn=g,ln=on.group,en(sn,ln)?nn(sn,ln):sn)));const rn=function(e,n){const t=s(),o=L().data?.resources,l=qe(n),a=N(o,"rules",{whileLoading:!1})&&N(o,"config",{whileLoading:!1})&&!0===o?.config.writable?e?.rule_id??null:null,i=Be(!!a),r=ae(!!a),c=e&&hn(e);return{canAdd:!!c&&l.canAdd(c),row:{canAdd:l.canAdd,open:l.open,label:e=>t("conn.addRuleFor",{target:e}),noTarget:t("conn.ruleNoTarget")},canShow:N(o,"rules",{whileLoading:!1})&&!!e?.rule_id,canEdit:!!a&&Ke(i.data?.rules.find(e=>e.rule_id===a),r.data?.sources??[]),openAdd:()=>{c&&l.open(c)},dialog:l.dialog}}(Je,n),cn=e.useMemo(()=>function(e,n,t,o,s,l,a){const i=new Set(e.flatMap(e=>e.outbound?[e.outbound]:[]));"all"!==s&&i.add(s);const c=e=>{const n=e.flatMap(e=>e?[e]:[]);return Ne(n,1/0).top},u=[{id:"all",label:a("conn.allOutbounds")},...[...i].map(e=>({id:e,label:r(e,a)}))];return{networks:[["all",a("ui.allCount",{n:e.length})],["tcp",a("ui.tcp")],["udp",a("ui.udp")]],outbounds:u,outboundSections:[{id:"outbounds",items:u}],picks:[{title:a("ui.device"),value:Le("src",t??""),items:c(e.map(e=>h(e.src))).map(({key:e,count:n})=>({id:Le("src",e),label:e,desc:p(n,l)}))},{title:a("ui.rule"),value:Le("rule",o),items:c(e.map(e=>e.rule_expression)).map(({key:e,count:n})=>({id:Le("rule",e),label:e,desc:p(n,l)}))}],visibility:n&&"full"!==n.visibility?a("none"===n.visibility?"conn.visibilityNone":"conn.visibilityPartial"):null}}(je,ye,le,O,R,c,i),[je,ye,le,O,R,c,i]),un=ue(N(pe.data?.resources,"groups",{whileLoading:!1})).data,dn=e.useMemo(()=>{const e=function(e,n,t,o,s){return e?{id:e.id,title:e.domain||e.dst||e.id,tone:"blocked"===e.state||"failed"===e.state?"err":"active"===e.state?"ok":"info",status:t("ui.aside",{text:_(k,e.state,t),note:e.network.toUpperCase()}),chain:j(e,t,o),outbound:e.outbound,rule:{expression:e.rule_expression,href:Ae(e.rule_id,s)},fields:pn(e,n).map(([e,n])=>[t(e),"string"==typeof n?n:t(n.key,n.params)]),flowQuery:x("",{tab:"records",...e.flow_id?{id:e.flow_id}:{connection_id:e.id}}),traceQuery:e.domain||h(e.dst)?Se({network:"udp"===e.network?"udp":"tcp",domain:e.domain??"",dst_ip:h(e.dst),dst_port:y(e.dst),src_ip:h(e.src),src_port:y(e.src),pname:e.pname??""}):null,source:e.src?h(e.src)??e.src:null,closable:"active"===e.state||"dialing"===e.state||"routing"===e.state,closeReason:"ebpf"===e.observed_by?t("conn.notClosable"):null,stateHelp:bn(e.state,t)}:null}(Je,c,i,ge,be);return e&&{...e,outboundTag:Me(e.outbound,un,i)}},[Je,c,i,ge,be,un]),mn={...cn,detail:dn},gn=e.useMemo(()=>fn(Ge,u,c,ge,be,i),[Ge,u,c,ge,be,i]),xn=e=>{const o=Oe(String(e),["src","rule"]);"src"===o?.kind?(T(""),n("connections",yn(t,{src:o.value&&le!==o.value?o.value:null,q:null}))):"rule"===o?.kind&&P("rule",O===o.value?"all":o.value)},jn=function(e,n,t){const[o,s]=e.picks,l=(e,n,t,o,s)=>({filter:e,label:n,sections:[{title:n,items:t,value:o}],searchLabel:s});return{active:["all"!==n.network,"all"!==n.out,!!n.src,"all"!==n.rule].filter(Boolean).length,submenus:[l("network",t("ui.network"),e.networks.map(([e,n])=>({id:e,label:n})),n.network),l("out",t("ui.outbound"),e.outbounds,n.out,t("ui.filterOutbounds")),l("src",o.title,[{id:Le("src",""),label:t("conn.allDevices")},...o.items],o.value,t("ui.filterDevices")),l("rule",s.title,[{id:Le("rule","all"),label:t("conn.allRules")},...s.items],s.value,t("ui.filterRules"))]}}(cn,{network:M,out:R,src:le,rule:O},i),_n={network:e=>P("network",e),out:e=>P("out",e),src:xn,rule:xn},kn={active:jn.active,submenus:jn.submenus.map(({filter:e,...n})=>({...n,sections:n.sections.map(n=>({...n,onChange:_n[e]}))}))},Cn=e.useCallback(e=>n("connections",x(t,{tab:"list",id:e})),[n,t]);return{...mn,tab:ve,setTab:e=>n("connections",B(t,e,"traffic"===we?we:null)),openInList:Cn,trafficUncounted:Re(Ue.data),view:u,updateView:v,collapse:g,toggleCollapse:w,toggleCollapseAll:()=>f($e(!g.allCollapsed)),wide:m,text:A,setText:T,network:M,out:R,sel:$,select:oe,collection:gn,rows:_e,outboundKeys:De,latency:Fe,latencyError:We,retryLatency:Ce.refetch,setNetwork:e=>P("network",e),setOut:e=>P("out",e),pick:xn,compact:b,filterMenu:kn,columns:Xe.map(e=>({id:e.id,label:i(e.label)})),visibleColumns:Xe.filter(e=>!u.hidden.includes(e.id)).map(e=>e.id),toggleColumn:e=>{const n=String(e),t=u.hidden.includes(n)?u.hidden.filter(e=>e!==n):[...u.hidden,n];t.length{T(""),n("connections",yn(t,{network:null,out:null,rule:null,q:null,src:null}))},error:de.error,retry:de.refetch,loading:de.loading&&!de.data,truncated:!!de.data?.truncated,canClose:me,canViewFlow:he,closeAll:{confirmationText:ee?.query?i("all"===ee.query.type?"conn.closeAllLive":"tcp"===ee.query.type?"conn.closeAllLiveTcp":"conn.closeAllLiveUdp",le?{n:ee.count??ee.ids.length,source:le}:{n:ee.count??ee.ids.length,source:i("conn.anySource")}):i("conn.closeAllHelp",{n:ee?.ids.length??0}),open:!!ee,setOpen:e=>ne(e?"all"!==S.get("scope")||"all"!==M||le||"all"!==R||"all"!==O||Qe?function(e,n){const t=e.map(e=>e.id),o=null!=n.bulkLimit&&t.length>n.bulkLimit;return n.narrowed||n.truncated||o?{ids:t}:{ids:t,query:{type:n.network,src:n.src,all:!0}}}(Ge,{network:M,src:le,narrowed:"all"!==R||"all"!==O||!!Qe,truncated:!!de.data?.truncated,bulkLimit:pe.data?.resources.connections.max_bulk_close}):{ids:[],query:{type:"all",all:!0},count:(de.data?.total_tcp??0)+(de.data?.total_udp??0)}:null),isDisabled:!Ge.length||!!fe.busy||A!==se,isPending:"all"===fe.busy,onConfirm:async()=>{if(ee)try{const e=await fe.closeAll(ee);if(!e)return;oe(null),K(G(e),i("conn.closedAll",{closed:e.closed,skipped:e.skipped}))}catch(e){return i("ui.valuePair",{label:i("conn.closeFailed"),value:J(e,i)})}},onAbort:fe.cancel},close:{pending:fe.busy===Je?.id,disabled:!!fe.busy,run:()=>{(async()=>{if(!mn.detail)return;const{id:e}=mn.detail;try{if(!(await fe.close(e)))return;new URLSearchParams(te.current).get("id")===e&&oe(null),K("positive",i("conn.closed",{name:mn.detail.title}))}catch(n){n instanceof X&&"state_conflict"===n.code?K("negative",i("conn.notClosable"),{error:n}):K("negative",i("conn.closeFailed"),z(n,i))}})()}},ruleAction:rn,showRule:(e=!1)=>{Je?.rule_id&&n("rules",x("",{tab:"list",rule:Je.rule_id,edit:e?Je.rule_id:null}))},canTrace:N(pe.data?.resources,"routing_trace",{whileLoading:!1})&&!!mn.detail?.traceQuery,traceConnection:()=>{mn.detail?.traceQuery&&n("rules",mn.detail.traceQuery)},showFlow:()=>{mn.detail&&he&&n("flows",mn.detail.flowQuery)},onlyClient:()=>{mn.detail?.source&&(T(""),n("connections",yn(t,{src:mn.detail.source,q:null})))},canExport:Ge.length>0,export:()=>Ve(He("connections","csv"),function(e,n){return[Ie(["id","target","domain","source","network","state","outbound","chain","rule","upload_bytes","download_bytes","started_at"]),...e.map(e=>Ie([e.id,e.dst,e.domain,e.src,e.network,e.state,e.outbound,C(e.chain,n).join(" > "),e.rule_expression,e.upload_bytes,e.download_bytes,e.started_at]))].join("\n")+"\n"}(Ge,ge),"text/csv;charset=utf-8"),detailTitle:mn.detail?.title??"",notInSnapshot:!!$&&!Je&&!!de.data}}function jn(e){const o=s(),l=xn(e),a=l.detail,i={list:n.jsxs(n.Fragment,{children:[n.jsxs(fe,{page:!0,children:[l.compact?n.jsxs("span",{className:"rp-filter-row",children:[n.jsx($,{search:!0,label:o("ui.filter"),value:l.text,onChange:l.setText,placeholder:o("conn.filterHint"),className:"rp-filter"}),n.jsx(he,{label:l.filterMenu.active?o("conn.filtersActive",{n:l.filterMenu.active}):o("conn.filters"),count:l.filterMenu.active,submenus:l.filterMenu.submenus,children:o("conn.filters")})]}):n.jsxs(n.Fragment,{children:[n.jsx($,{search:!0,label:o("ui.filter"),value:l.text,onChange:l.setText,placeholder:o("conn.filterHint"),className:"rp-filter"}),n.jsx(de,{label:o("ui.network"),value:l.network,onChange:l.setNetwork,items:l.networks}),n.jsx(Pe,{side:!0,label:o("ui.outbound"),searchLabel:o("ui.filterOutbounds"),value:l.out,onChange:l.setOut,sections:l.outboundSections}),n.jsx(he,{label:o("conn.pick"),sections:l.picks,onAction:l.pick,searchLabel:o("conn.filterPick"),children:o("conn.pick")})]}),n.jsx(pe,{label:o("conn.group"),side:!0,value:l.view.group,onChange:e=>l.updateView({group:e}),items:[{id:"source",label:o("conn.byClient")},{id:"outbound",label:o("ui.outbound")},{id:"none",label:o("conn.ungrouped")}]}),"none"!==l.view.group&&n.jsx(ee,{onPress:l.toggleCollapseAll,children:o(l.collapse.allCollapsed?"conn.expandAll":"conn.collapseAll")}),n.jsx(he,{label:o("conn.columns"),selectionMode:"multiple",items:l.columns,value:l.visibleColumns,onAction:l.toggleColumn,children:o("conn.columns")}),l.filtered&&n.jsx(ee,{quiet:!0,onPress:l.clear,children:o("ui.clearFilters")}),l.truncated&&n.jsx(f,{tone:"warn",children:o("conn.truncated")}),l.visibility&&n.jsx(v,{text:o("conn.visibilityNote"),children:n.jsx(f,{children:l.visibility})}),n.jsx("span",{className:"rp-grow"}),l.canClose&&n.jsx(ne,{label:o("conn.closeAll"),...l.closeAll}),n.jsxs(ee,{isDisabled:!l.canExport,onPress:l.export,children:[n.jsx(ve,{}),o("conn.export")]})]}),n.jsxs("div",{className:"rp-with-panel","data-open":a?"":void 0,children:[n.jsx(cn,{collection:l.collection,loading:l.loading,selected:l.sel,onSelect:l.select,selectOnFocus:l.wide,view:l.view,collapse:l.collapse,onToggleGroup:l.toggleCollapse,onSort:e=>l.updateView({sort:e}),rule:l.ruleAction.row}),n.jsx(te,{open:!!a,title:l.detailTitle,onClose:()=>l.select(null),children:a&&n.jsxs(n.Fragment,{children:[n.jsx(oe,{help:a.stateHelp,children:n.jsx(se,{small:!0,tone:a.tone,children:a.status})}),n.jsxs("div",{className:"rp-cluster",children:[l.ruleAction.canAdd&&n.jsx(ee,{onPress:l.ruleAction.openAdd,children:o("rule.add")}),n.jsx(me,{actions:[...l.ruleAction.canShow?[{id:"show-rule",label:o("conn.showRule"),onAction:()=>l.showRule()}]:[],...l.ruleAction.canEdit?[{id:"edit-rule",label:o("conn.editRule"),onAction:()=>l.showRule(!0)}]:[],...l.canViewFlow?[{id:"view-flow",label:o("conn.viewFlow"),onAction:l.showFlow}]:[],...l.canTrace?[{id:"trace",label:o("conn.trace"),onAction:l.traceConnection}]:[],...a.source?[{id:"only-client",label:o("conn.onlyThisClient"),onAction:l.onlyClient}]:[],...l.canClose&&a.closable?[{id:"close",label:o("conn.close"),negative:!0,isPending:l.close.pending,isDisabled:l.close.disabled||!!a.closeReason,reason:a.closeReason??void 0,onAction:l.close.run}]:[]]})]}),n.jsx(be,{items:a.fields}),n.jsx(be,{items:[[o("ui.outbound"),n.jsx(t,{...a.outboundTag})],[o("conn.chain"),a.chain]]}),n.jsxs("div",{className:"rp-list",children:[n.jsx("span",{className:"rp-label",children:o("ui.rule")}),n.jsx(le,{...a.rule})]})]})})]}),l.notInSnapshot&&n.jsx("span",{className:"rp-label",children:o("conn.notInSnapshot")}),n.jsx(De,{dialog:l.ruleAction.dialog})]}),traffic:n.jsx(Ye,{records:l.rows,outbounds:l.outboundKeys,latency:l.latency,latencyError:l.latencyError,retryLatency:l.retryLatency,truncated:l.truncated,uncounted:l.trafficUncounted,onSelect:l.openInList})};return n.jsxs("div",{className:"rp-page",children:[l.error&&n.jsx(d,{error:l.error,onRetry:l.retry}),n.jsx(ge,{page:!0,keepMounted:!0,label:o("nav.connections"),value:l.tab,onChange:l.setTab,items:Ge().map(e=>({id:e.id,label:o(e.titleKey),content:i[e.id]}))})]})}export{jn as Connections}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/Copy-CGFSe6tr.js b/luci-app-honk/root/etc/honk/doona/assets/Copy-CGFSe6tr.js deleted file mode 100644 index fbcab877..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/Copy-CGFSe6tr.js +++ /dev/null @@ -1 +0,0 @@ -import{r as c,j as r}from"./vendor-react-64fcanlc.js";import{u as s,dn as o,A as l,I as t}from"./index-HxEUeoab.js";function a(){const r=s();return c.useCallback(async c=>{const s=await o(c);l(s?"positive":"negative",r(s?"ui.recordCopied":"ui.recordCopyFailed"))},[r])}function e(c){return r.jsxs(t,{...c,children:[r.jsx("path",{fill:"currentColor",d:"m11.75,18h-7.5c-1.24023,0-2.25-1.00977-2.25-2.25v-7.5c0-1.24023,1.00977-2.25,2.25-2.25.41406,0,.75.33594.75.75s-.33594.75-.75.75c-.41309,0-.75.33691-.75.75v7.5c0,.41309.33691.75.75.75h7.5c.41309,0,.75-.33691.75-.75,0-.41406.33594-.75.75-.75s.75.33594.75.75c0,1.24023-1.00977,2.25-2.25,2.25Z"}),r.jsx("path",{fill:"currentColor",d:"m6.75,5c-.41406,0-.75-.33594-.75-.75,0-1.24023,1.00977-2.25,2.25-2.25.41406,0,.75.33594.75.75s-.33594.75-.75.75c-.41309,0-.75.33691-.75.75,0,.41406-.33594.75-.75.75Z"}),r.jsx("path",{fill:"currentColor",d:"m13,3.5h-2c-.41406,0-.75-.33594-.75-.75s.33594-.75.75-.75h2c.41406,0,.75.33594.75.75s-.33594.75-.75.75Z"}),r.jsx("path",{fill:"currentColor",d:"m13,14h-2c-.41406,0-.75-.33594-.75-.75s.33594-.75.75-.75h2c.41406,0,.75.33594.75.75s-.33594.75-.75.75Z"}),r.jsx("path",{fill:"currentColor",d:"m15.75,14c-.41406,0-.75-.33594-.75-.75s.33594-.75.75-.75c.41309,0,.75-.33691.75-.75,0-.41406.33594-.75.75-.75s.75.33594.75.75c0,1.24023-1.00977,2.25-2.25,2.25Z"}),r.jsx("path",{fill:"currentColor",d:"m17.25,5c-.41406,0-.75-.33594-.75-.75,0-.41309-.33691-.75-.75-.75-.41406,0-.75-.33594-.75-.75s.33594-.75.75-.75c1.24023,0,2.25,1.00977,2.25,2.25,0,.41406-.33594.75-.75.75Z"}),r.jsx("path",{fill:"currentColor",d:"m17.25,9.75c-.41406,0-.75-.33594-.75-.75v-2c0-.41406.33594-.75.75-.75s.75.33594.75.75v2c0,.41406-.33594.75-.75.75Z"}),r.jsx("path",{fill:"currentColor",d:"m6.75,9.75c-.41406,0-.75-.33594-.75-.75v-2c0-.41406.33594-.75.75-.75s.75.33594.75.75v2c0,.41406-.33594.75-.75.75Z"}),r.jsx("path",{fill:"currentColor",d:"m8.25,14c-1.24023,0-2.25-1.00977-2.25-2.25,0-.41406.33594-.75.75-.75s.75.33594.75.75c0,.41309.33691.75.75.75.41406,0,.75.33594.75.75s-.33594.75-.75.75Z"})]})}export{e as C,a as u}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/Coverage-8qg_JeNJ.js b/luci-app-honk/root/etc/honk/doona/assets/Coverage-8qg_JeNJ.js deleted file mode 100644 index 3be4fee2..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/Coverage-8qg_JeNJ.js +++ /dev/null @@ -1 +0,0 @@ -import{ah as e,ak as l,U as r,u as a,T as s,p as n}from"./index-HxEUeoab.js";import{j as o}from"./vendor-react-64fcanlc.js";const t={userspace_tcp:"flow.userspaceTcp",userspace_udp:"flow.userspaceUdp",kernel_direct:"flow.kernelDirect",kernel_block:"flow.kernelBlock",dns_intercept:"flow.dnsIntercept",kernel_bypass:"flow.kernelBypass"},p={full:"flow.full",partial:"flow.partialVisibility",none:"ui.none"};function c(a,s,n){const o=Object.entries(a.coverage).filter(([,e])=>"full"!==e),c=e(a.dropped_records),i=c?s("flow.dropped",{n:c}):null;return o.length||i?{summary:o.length?s("flow.coverageSummary",{n:o.length}):null,detail:l(n,o.map(([e,l])=>s("ui.valuePair",{label:r(t,e,s),value:r(p,l,s)}))),dropped:i}:null}function i({view:e}){const l=a();return o.jsxs("div",{className:"rp-cluster",role:"group","aria-label":l("flow.coverage"),children:[e.summary&&o.jsx(s,{text:e.detail,children:o.jsx(n,{small:!0,tone:"warn",children:e.summary})}),e.dropped&&o.jsx(n,{small:!0,tone:"warn",children:e.dropped})]})}export{i as C,c}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/DaeCode-DEjXqvav.js b/luci-app-honk/root/etc/honk/doona/assets/DaeCode-DEjXqvav.js deleted file mode 100644 index c8ff1df5..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/DaeCode-DEjXqvav.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e}from"./vendor-react-64fcanlc.js";import{t}from"./daeTokens-BVtuNnWZ.js";function a({text:a,as:r="span",className:s=""}){return e.createElement(r,{className:`rp-code ${s}`.trim()},t(a).map((t,a)=>t.type?e.createElement("span",{key:a,className:`rp-dae-${t.type}`},t.text):t.text))}export{a as D}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/Delete-CR2AtZsd.js b/luci-app-honk/root/etc/honk/doona/assets/Delete-CR2AtZsd.js deleted file mode 100644 index 6b970f7f..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/Delete-CR2AtZsd.js +++ /dev/null @@ -1 +0,0 @@ -import{j as c}from"./vendor-react-64fcanlc.js";import{I as r}from"./index-HxEUeoab.js";function l(l){return c.jsxs(r,{...l,children:[c.jsx("path",{fill:"currentColor",d:"M8.249 15.021c-.4 0-.733-.317-.748-.72l-.25-6.5c-.017-.414.307-.763.72-.779H8c.4 0 .733.317.748.72l.25 6.5c.017.414-.307.763-.72.778zM11.751 15.021h-.03c-.413-.016-.737-.365-.72-.779l.25-6.5c.015-.403.348-.72.748-.72h.03c.413.016.737.365.72.779l-.25 6.5c-.015.403-.348.72-.748.72"}),c.jsx("path",{fill:"currentColor",d:"M17 4h-3.5v-.75C13.5 2.01 12.49 1 11.25 1h-2.5C7.51 1 6.5 2.01 6.5 3.25V4H3c-.414 0-.75.336-.75.75s.336.75.75.75h.52l.422 10.342C3.99 17.052 4.98 18 6.19 18h7.62c1.211 0 2.2-.948 2.248-2.158L16.48 5.5H17c.414 0 .75-.336.75-.75S17.414 4 17 4m-9-.75c0-.413.337-.75.75-.75h2.5c.413 0 .75.337.75.75V4H8zm6.56 12.531c-.017.404-.346.719-.75.719H6.19c-.404 0-.733-.315-.75-.719L5.02 5.5h9.96z"})]})}export{l as D}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/Dns-BTZu7DCC.js b/luci-app-honk/root/etc/honk/doona/assets/Dns-BTZu7DCC.js deleted file mode 100644 index 862b5aff..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/Dns-BTZu7DCC.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,j as s}from"./vendor-react-64fcanlc.js";import{M as a,U as t,a8 as n,a1 as r,Y as l,Q as i,ah as d,aM as c,u as o,a9 as u,q as m,c2 as h,z as p,c4 as x,r as g,w as y,h as f,c6 as b,al as j,l as v,cb as w,bS as _,cc as N,b4 as S,c8 as T,A as q,c9 as C,aV as k,cd as M,bR as R,az as L,af as A,E as F,ce as E,bh as D,cf as P,C as W,S as O,ae as U,ay as H,T as B,bu as K,bF as I,cg as Q,bG as $,ch as z,B as J,ci as V,ax as G,p as X,av as Y,bx as Z,ca as ee}from"./index-HxEUeoab.js";import{D as se}from"./Delete-CR2AtZsd.js";import{s as ae,l as te,a as ne,m as re,C as le,F as ie,B as de,L as ce,W as oe,n as ue,q as me,D as he}from"./activity-yZTrGy-J.js";import{u as pe,q as xe,k as ge,s as ye,t as fe,S as be,L as je,K as ve,A as we}from"./logs-C4GIy4tX.js";import{T as _e}from"./Tabs-DT6MQhIo.js";import{T as Ne}from"./Toolbar-BTFtduwD.js";import{D as Se}from"./Table-yWn0d3vL.js";import{T as Te}from"./TimeCell-BIqfL3y_.js";import{c as qe,d as Ce,e as ke}from"./files-Dt8K7QfP.js";import{d as Me}from"./nav-CBqYxt5v.js";import{a as Re}from"./rule-Bl9YOsFn.js";import{J as Le,u as Ae}from"./nodes-6sIn2I0s.js";import{u as Fe,R as Ee,Q as De}from"./useQuickRule-DUEi6geL.js";import{L as Pe}from"./AppearanceControls-sRy1p156.js";/* empty css */import"./_commonjsHelpers-CXUWDbkB.js";import"./ItemText-DOD_75iR.js";import"./Select-D7_6MaHd.js";import"./Checkbox-CJt7u9-e.js";import"./Virtualizer-DMIKG2CD.js";import"./DaeCode-DEjXqvav.js";import"./daeTokens-BVtuNnWZ.js";import"./AddCircle-C6Jc7GCc.js";import"./SearchSelect-BcScGUbQ.js";import"./SearchList-LjCruZYP.js";import"./flows-dBNkBg79.js";function We(e,s,t,n,r){return{domain:e,dip:null,sip:(r&&a(r))??null,outbound:null,matched:null,dns:{type:s,answers:Re(t),upstream:n,query:{name:e,type:s}}}}const Oe=(e,s,a)=>({domain:null,dip:e,sip:null,outbound:null,matched:null,dns:{type:a,answers:[e],upstream:null,query:{name:s,type:a}}}),Ue={forced:"dns.route.forced","dns.routing":"dns.route.rules",default:"dns.route.default"};function He(e,s){return{fields:[[s("ui.state"),e.status],[s("ui.upstream"),e.upstream??"—"],[s("dns.routeSource"),t(Ue,e.route.source,s)],[s("dns.routeRule"),e.route.rule??"—"],[s("ui.elapsed"),n(e.elapsed_ms,s)]],answers:(e.answers??[]).map(e=>s("dns.answer",{name:e.name,type:e.type,ttl:e.ttl,data:e.data})),cacheText:s(e.cached?"dns.hit":"dns.miss"),cacheTone:e.cached?void 0:"warn"}}function Be(e,s,a){return e?a instanceof c&&503===a.status?"unavailable":s?"ready":a?"error":"loading":"unlisted"}const Ke=[{id:"full",label:"rule.kind.domain"},{id:"suffix",label:"rule.kind.domainSuffix"},{id:"keyword",label:"rule.kind.domainKeyword"},{id:"regex",label:"dns.matchRegex"}],Ie=e=>e.trim().toLowerCase().replace(/\.$/,"");function Qe(e,s){if(!s.trim())return()=>!0;if("regex"===e){const e=function(e){try{return new RegExp(e,"iu")}catch{return null}}(s);return e&&(s=>e.test(Ie(s)))}if("keyword"===e){const e=s.trim().toLowerCase();return s=>Ie(s).includes(e)}const a=Ie(s),t="suffix"===e&&a.startsWith("."),n=t?a.slice(1):a;return n?"full"===e?e=>Ie(e)===n:e=>{const s=Ie(e);return s.endsWith("."+n)||!t&&s===n}:null}function $e({go:s,query:a}){const t=o(),n=u(),r=m(),l=e.useMemo(()=>new URLSearchParams(a),[a]),[i,d]=e.useState(l.get("domain")??""),[c,j]=e.useState(l.get("type")??"A"),[v,w]=e.useState(!1);h(l.get("domain"),e=>d(e??"")),h(l.get("type"),e=>j(e??"A"));const[_,N]=e.useState(null),{busy:S,error:T,run:q}=p({rethrow:!0}),C=r.data?.resources,k=e.useMemo(()=>function(e,s,a,t,n,r){const l=s?.dns_query.record_types??[],i="all"===a?l.length>0:l.includes(a);return{types:l,choices:[...l.map(e=>({id:e,label:e})),{id:"all",label:r("dns.allTypes")}],disabled:n||!s?.dns_query.available||!i||!t.trim(),reason:!s||n?null:s.dns_query.available?i?null:r("all"===a?"dns.noTypes":"dns.typeUnsupported"):r("dns.queryUnavailable"),showCache:!!s?.dns_cache.available,cards:e?.results.map(s=>({id:s.type,title:`${e.domain} ${s.type}`,...He(s,r),seed:We(e.domain,s.type,s.answers??[],s.upstream,null),answerSeeds:(s.answers??[]).map(a=>Re([a]).length?{address:a.data,seed:Oe(a.data,e.domain,s.type)}:null)}))??[],tabs:Me(s).map(e=>({id:e.id,label:r(e.titleKey)}))}}(_,C,c,i,!!S,t),[_,C,c,i,S,t]),M=k.tabs.map(e=>e.id),R=l.has("domain")||l.has("device"),L=M.includes("log")?R?"log":"stats":M.includes("query")?"query":M[0]??"query",A=x(a,M,L),F=g(C,"config",{whileLoading:!1}),E=pe("query"===A&&F&&g(C,"dns_query",{whileLoading:!1})),D=e.useMemo(()=>F?function(e,s){const a=[...new Set((e??[]).flatMap(e=>e.content?Le(e.content).map(Ae):[]))];return a.length?[{id:"",label:s("dns.upstreamAuto")},...a.map(e=>({id:e,label:e}))]:[]}(E.data?.sources,t):[],[F,E.data,t]),[P,W]=e.useState(""),O=D.some(e=>e.id===P)?P:"";E.data&&P&&!O&&W("");const U=async(e={domain:i,type:c})=>{try{await q("query",async s=>{const a=await xe(n.dnsQuery,e.domain.trim(),"all"===e.type?k.types:[e.type],C?.dns_query.limits?.max_types_per_request??1,s,v?"bypass":"normal",O||void 0);return s.aborted||N(a),a})}catch{}},H=g(C,"dns_query",{whileLoading:!1})&&k.types.length>0,B=Fe(s,{queryAgain:H?e=>{const a=k.types.includes(e.type)?e.type:"all";s("dns",y("",{tab:"query",domain:e.name.replace(/\.$/,""),type:a,run:"1"}))}:void 0}),K=l.has("run")&&C?a:null,I=e.useEffectEvent(e=>{const a=new URLSearchParams(e);s("dns",y(e,{run:null}),{replace:!0}),U({domain:a.get("domain")??"",type:a.get("type")??"A"})});return e.useEffect(()=>{null!==K&&I(K)},[K]),{...k,rule:{...B,label:e=>t(g(C,"dns_rules",{whileLoading:!1})?"dns.addRequestRuleFor":"dns.addRoutingRuleFor",{domain:e})},domain:i,setDomain:d,type:c,setType:j,bypassCache:v,setBypassCache:w,upstreams:D,upstream:O,setUpstream:W,pending:"query"===S,queryError:T,submit:()=>{U()},setTab:e=>s("dns",b(a,e,C&&!R?L:null)),tab:A,filterDomain:l.get("domain")??"",filterDevice:l.get("device")??"",cacheHref:M.includes("cache")?f("dns",{tab:"cache"}):null,logHref:(e,s)=>f("dns",{tab:"log",[e]:s}),logLinks:[...g(C,"dns_rules",{whileLoading:!1})?[{id:"rules",label:t("rule.dnsTitle"),onAction:()=>s("rules","tab=dns")}]:[],...C?.runtime_settings.available?[{id:"recording",label:t("ui.recordingSettings"),onAction:()=>s("settings","card=runtime")}]:[]],logEnabled:C?.dns_log.available,viewCache:()=>s("dns",y(a,{tab:"cache",domain:_?.domain??""})),clearCacheFilter:()=>s("dns",y(a,{tab:"cache",domain:null}))}}function ze(s){const a=o(),t=j[v()],[n,r]=e.useState(!1),i=ye(!N(),n),[d,c]=e.useState(s?"keyword":"suffix"),[u,m]=e.useState(s),[p,x]=e.useState("all");h(s,e=>{m(e),c(e?"keyword":"suffix"),x("all")});const g=[...new Set([...i.capabilities.data?.resources.dns_query.record_types??[],...(i.cache.data?.entries??[]).map(e=>e.type)])],y=e.useMemo(()=>({kind:d,text:u}),[d,u]),f=w(y,250),b=f!==y,_=i.cache.data?.entries,{matches:S,error:T,pending:M}=function(s,a,t){const n=e.useMemo(()=>(s??[]).filter(e=>"all"===t||e.type===t),[s,t]),r="regex"===a.kind&&!!a.text.trim(),[l,i]=e.useState(null);e.useEffect(()=>{if(!r)return;const e=new Worker(new URL(""+new URL("match.worker-B2aIccpg.js",import.meta.url).href,import.meta.url),{type:"module"});let s,t=!0;const l=(r,l)=>{t&&(t=!1,clearTimeout(s),e.terminate(),i({candidates:n,pattern:a,matches:r?.map(e=>n[e])??[],error:l??(null===r?"dns.invalidRegex":void 0)}))};return e.onmessage=r=>{t&&("ready"===r.data?(s=window.setTimeout(()=>l([],"dns.regexTimeout"),1e3),e.postMessage({text:a.text,names:n.map(e=>e.domain)})):l(r.data))},e.onerror=e=>{e.preventDefault(),l([],"dns.matchFailed")},()=>{t=!1,clearTimeout(s),e.terminate()}},[r,n,a]);const d=e.useMemo(()=>{if(r)return null;const e=Qe(a.kind,a.text);return{matches:e?n.filter(s=>e(s.domain)):[],error:e?void 0:"dns.invalidName"}},[r,n,a]);if(d)return{...d,pending:!1};const c=l?.candidates===n&&l.pattern===a;return{matches:c?l.matches:[],error:c?l.error:void 0,pending:!c}}(_,f,p),R=!!u.trim()||"all"!==p||!!s,L=e.useMemo(()=>function(e,s,a,t,n,r=e?.entries??[],i=!1){const d=s?.dns_cache;return{readable:!!d?.available&&!0===d.read,fields:[[n("dns.entries"),e?l(e.total,t):"—"]],coverage:e?["positive","negative","persistent"].filter(s=>!e.coverage[s]).map(e=>({id:e,text:"persistent"===e?n("dns.memoryOnly"):n("ui.valuePair",{label:n("positive"===e?"dns.positive":"dns.negative"),value:n("dns.notCovered")})})):[],deleteBy:{name:!!d?.available&&!0===d.delete_name,entry:!!d?.available&&!0===d.delete_entry},confirmationText:e?n("dns.flushConfirm",{n:e.total}):n("dns.flushConfirmAll"),flushDisabled:!!a||!s?.dns_cache.available||!s.dns_cache.flush,flushReason:!d||a||d.available&&d.flush?null:n("dns.flushUnsupported"),deleteReason:!(d&&!a&&r.length>0)||d.available&&d.delete_entry?null:n("dns.deleteUnsupported"),empty:n(s?.dns_cache.available&&s.dns_cache.read?i?"dns.emptyFiltered":"dns.empty":"dns.cacheUnavailable"),rows:r.map(e=>({id:e.entry_id,domain:e.domain,type:e.type,status:e.status,expiresAt:e.expires_at,staleUntil:e.stale_until,deleteLabel:n("dns.deleteEntry",{domain:e.domain,type:e.type}),seed:We(e.domain,e.type,[],null,null),pending:a===e.entry_id,disabled:!!a||!s?.dns_cache.available||!s.dns_cache.delete_entry}))}}(i.cache.data,i.capabilities.data?.resources,i.busy,t,a,b?[]:S,R),[i.cache.data,i.capabilities.data,i.busy,t,a,b,S,R]),A="full"===d&&!!u.trim()&&L.deleteBy.name,{remove:F}=i,E=e.useCallback(e=>{F(e).then(e=>e&&q("positive",a("dns.deleted",{n:e.deleted})),e=>q("negative",a("dns.deleteFailed"),C(e,a)))},[F,a]);return{...L,includeExpired:n,setIncludeExpired:r,matchKind:d,matchText:u,matchType:p,matchAvailable:L.readable||L.deleteBy.name||L.deleteBy.entry,filtered:R,clearMatches:()=>{m(""),x("all"),c("suffix")},setMatchType:x,setMatchKind:c,setMatchText:e=>{const s=function(e,s){return s.startsWith("*.")?{kind:"suffix",text:s.slice(2)}:{kind:e,text:s}}(d,e);c(s.kind),m(s.text)},matchKinds:Ke.map(e=>({id:e.id,label:a(e.label)})),matchTypes:[{id:"all",label:a("dns.allTypes")},...g.map(e=>({id:e,label:e}))],matchError:T?a(T):void 0,matchReason:L.deleteBy.entry||!L.deleteBy.name||A||i.busy?null:a("dns.matchNameOnly"),matchPending:"delete-match"===i.busy,matchDisabled:!!i.busy||b||M||!!T||!A&&!S.length||!u.trim()&&"all"===p||!(L.deleteBy.entry||A),matchConfirmation:A?a("dns.deleteNameConfirm",{name:u.trim(),type:"all"===p?a("dns.allTypes"):p}):a("dns.deleteMatchingConfirm",{n:S.length}),matchListed:S.slice(0,100),matchMore:S.length>100?a("dns.matchMore",{n:S.length-100}):null,removeMatching:async()=>{try{if(A){const e=await i.removeName({name:u.trim(),type:"all"===p?void 0:[p]});return void(e&&q("positive",a("dns.deleted",{n:e.deleted})))}const e=await i.removeMany(S.map(e=>e.entry_id));if(!e)return;e.failed?e.deleted?q("negative",a("dns.deletePartial",{deleted:e.deleted,n:e.failed})):q("negative",a("dns.deleteAllFailed",{n:e.failed})):q("positive",a("dns.deleted",{n:e.deleted}))}catch(e){return a("dns.deleteMatchingFailed",{error:k(e,a)})}},error:i.cache.error,retry:i.cache.refetch,loading:(i.cache.loading||i.capabilities.loading)&&!i.cache.data||b||M,flushPending:"flush"===i.busy,remove:E,flush:async()=>{try{const e=await i.flush();e&&q("positive",a("dns.flushed",{matched:e.matched,deleted:e.deleted}))}catch(e){return a("dns.flushFailed",{error:k(e,a)})}},abortFlush:()=>{i.cancel(),i.cache.refetch()}}}function Je(s){const a=o(),t=j[v()],[n,r]=L(),[c,u]=e.useState(!1),m=fe(s,!r&&c);m.data&&!c&&u(!0);const h=e.useMemo(()=>function(e,s,a){if(!e)return null;const{usage:t,coverage:n}=e,r=e=>{const a=d(e);return null===a?"—":l(a,s)},c=t?.entry_capacity??null,o=t&&null!==c?i(t.entries,c):null;return{note:t?null===c?a("dns.chart.usageFacts",{entries:r(t.entries)}):void 0:a("dns.chart.cacheNote",{n:e.total}),usage:t&&null!==c&&null!==o?{meter:d(c)?{value:o,valueLabel:o>0&&o<.5?"<"+a("ui.percent",{n:1}):a("ui.percent",{n:Math.round(o)})}:null,facts:[{label:a("dns.chart.entries"),value:r(t.entries)},{label:a("dns.chart.capacity"),value:r(c)}]}:null,coverage:a("dns.chart.coverage",{kinds:[n.positive&&a("dns.chart.positive"),n.negative&&a("dns.chart.negative")].filter(Boolean).join(a("ui.listSeparator")),persistent:a(n.persistent?"dns.chart.persistent":"dns.chart.memoryOnly")})}}(m.data,t,a),[m.data,t,a]);return{ref:n,card:h,state:Be(s,!!h,m.error),error:m.error,retry:m.refetch}}function Ve(s,a,t){const l=o(),i=j[v()],[d,x]=e.useState(a);h(a,x);const[g,y]=e.useState("all"),[f,b]=e.useState(t);h(t,b);const C=u(),k=m(),L=w(f),A=_(L),F=""!==L.trim()&&!A,[E,D]=e.useState(A);F||A===E||D(A);const P={name:w(d),type:g,src:F?E:A},W=JSON.stringify(P),O=ge(P,!0===s,!N()),[U,H]=e.useState(null),[B,K]=e.useState(!1),I=p({scope:W});h(W,()=>H(null));const{data:Q,newerWaiting:$}=e.useMemo(()=>function(e,s){const a=s&&new Set(s.records.map(e=>e.id));return{data:s??e,newerWaiting:!!a&&!!e?.records.some(e=>!a.has(e.id))}}(O.data,U),[O.data,U]),z=()=>{I.run("older",async e=>{if(!Q?.next_cursor)return;let s;H(Q);try{s=await C.dnsLog({name:P.name.trim()||void 0,type:"all"===g?void 0:g,src:P.src,cursor:Q.next_cursor,limit:Q.limit},e)}catch(a){if(!(a instanceof c)||e.aborted)throw a;const s=M(a);if(!(410===a.status&&"snapshot_expired"===a.code||400===a.status&&"invalid_request"===a.code)&&!s)throw a;return s&&await R(a.retryAfter,e),H(null),O.refetch(),void q("info",l("dns.olderExpired"))}e.aborted||H(function(e,s){const a=new Set(e.records.map(e=>e.id));return{...e,records:[...e.records,...s.records.filter(e=>!a.has(e.id))],next_cursor:s.next_cursor}}(Q,s))})},J=()=>{I.cancel(),H(null);const e=O.refetch();e&&(K(!0),e.finally(()=>K(!1)))},[V,G]=e.useState(null),X=S(T),Y=k.data?.resources.dns_query.record_types,Z=e.useMemo(()=>function(e,s,a,t=[]){const r=e?.records??[];return{choices:[{id:"all",label:a("dns.allTypes")},...[...new Set([...t,...r.map(e=>e.question.type)])].map(e=>({id:e,label:e}))],total:e?a("dns.logTotal",{n:e.total}):"",totalHelp:e?{title:a("dns.logTotal",{n:e.total}),text:a("dns.logTotalHelp")}:null,loaded:e?.next_cursor?a("dns.logLoaded",{n:r.length}):"",empty:a(void 0===s?"ui.loading":s?"dns.logEmpty":"dns.logUnavailable"),rows:r.map(e=>({id:e.id,observedAt:e.observed_at,name:e.question.name,type:e.question.type,seed:We(e.question.name,e.question.type,e.answers,e.upstream,e.src),source:e.src??"—",resultError:"NOERROR"!==e.status,result:"NOERROR"!==e.status?e.status:e.answers.map(e=>e.data).join(", ")||"—",cached:e.cached,upstream:e.cached?a("dns.hit"):e.upstream??"—",elapsed:n(e.elapsed_ms,a)}))}}(Q,s,l,Y),[Q,s,l,Y]),ee=e.useMemo(()=>function(e,s,a,t){const n=e?.records.find(e=>e.id===s);if(!n)return null;const l=He(n,t);return{id:n.id,title:n.question.name,answers:l.answers,fields:[[t("ui.type"),n.question.type],[t("ui.device"),n.src??"—"],l.fields[0],[t("ui.cache"),l.cacheText],...l.fields.slice(1),[t("ui.time"),r(n.observed_at,a)]]}}(Q,V,i,l),[Q,V,i,l]);return{...Z,detail:ee,detailTitle:ee?.title??"",name:d,newerWaiting:$,setName:x,type:g,setType:y,src:f,setSrc:b,srcError:F?l("ui.invalidIp"):void 0,selected:ee?V:null,setSelected:G,wide:X,error:I.error??O.error,loading:O.loading&&!Q,hasOlder:!!Q?.next_cursor,loadingOlder:!!I.busy,loadOlder:z,refreshing:B,refresh:J,retry:I.error?z:J,export:()=>{return Ce(ke("dns-log","csv"),(e=Q?.records??[],[qe(["id","observed_at","src","name","type","status","cached","upstream","route_source","route_rule","elapsed_ms","answers"]),...e.map(e=>qe([e.id,e.observed_at,e.src,e.question.name,e.question.type,e.status,e.cached?"true":"false",e.upstream,e.route.source,e.route.rule,e.elapsed_ms,e.answers.map(e=>e.data).join(" ")]))].join("\n")+"\n"),"text/csv;charset=utf-8");var e}}}const Ge={cached:"dns.outcome.cached",answered:"dns.outcome.answered",nxdomain:"dns.outcome.nxdomain",failed:"dns.outcome.failed"};function Xe({enabled:a,links:t}){const n=o(),{log:r,cacheListed:l,configHref:i}=function(s){const a=ge({},!0===s,!N()),t=m().data?.resources,n=g(t,"config",{whileLoading:!1}),r=pe(!0===s&&n),l=r.data?.sources,i=e.useMemo(()=>n&&l?ae(l,"dns"):null,[n,l]);return{log:a,cacheListed:g(t,"dns_cache",{whileLoading:!1})&&!0===t?.dns_cache.read,configHref:i}}(a);if(!1===a)return s.jsx(A,{children:n("dns.logUnavailable")});if(void 0===a)return null;const d=r.error,c=r.data?null:!d||s.jsx(A,{children:n("dns.chart.noLog")}),u=d?s.jsx(F,{error:d,onRetry:r.refetch}):te(r.data,r.limit)?s.jsx("p",{className:"rp-note",children:n("dns.chart.shortPage",{n:r.data.records.length,limit:r.limit})}):null;return s.jsx(Ze,{records:r.data?.records??Ye,pending:c,notice:u,cacheListed:l,links:{...t,config:i}})}const Ye=[];function Ze({records:a,pending:t,notice:r,cacheListed:l,links:i}){const d=o(),c=ne(),u=j[v()],m=e.useMemo(()=>re(a,u),[a,u]),h={cached:c.positive,answered:c.cat[2],nxdomain:c.notice,failed:c.negative},p=e=>d("ui.percent",{n:null===e?0:Math.round(100*e)}),x=(e,s)=>{const a=s?e/s:0;return e>0&&a<.005?"<"+d("ui.percent",{n:1}):e.995?">"+d("ui.percent",{n:99}):p(a)},g=e=>({id:e.id,value:e.value,color:h[e.outcome],lines:[e.name,n(e.value,d),d(Ge[e.outcome])]}),y=!0===t,f=e=>y?"bars"===e?s.jsx(O,{shape:"bars",count:8}):s.jsx(U,{holds:"tall",children:s.jsx(O,{shape:"block"})}):t??(m.total<5?s.jsx(A,{children:d("dns.chart.tooFew")}):null),b=f("block"),w=[{label:d("dns.chart.median"),value:n(m.typical,d),icon:s.jsx(E,{}),tint:"c1"},{label:d("dns.chart.p95"),value:n(m.slowest,d),icon:s.jsx(le,{}),tint:"c4"},{label:d("dns.chart.cacheRate"),value:p(m.cacheRate),icon:s.jsx(D,{}),tint:"c2"},{label:d("dns.chart.failureRate"),value:p(m.failureRate),icon:s.jsx(P,{}),tint:"c5",tone:m.counts.failed?"negative":void 0}];return s.jsxs("div",{className:"rp-chart-page",children:[r,(y||!b)&&s.jsx(ie,{facts:w,loading:y}),s.jsxs("div",{className:"rp-g21",children:[s.jsx(W,{title:d("dns.chart.speed",{n:m.samples.length}),note:b?void 0:d("dns.chart.sample",{n:m.total,uncached:m.uncached,upstream:m.samples.length}),aside:i.config&&s.jsx(Pe,{appearance:"link",href:i.config,children:d("dns.openConfig")}),children:b??s.jsxs(s.Fragment,{children:[s.jsx(de,{label:d("dns.chart.speed",{n:m.samples.length}),points:m.samples.map(g),marks:null!==m.typical&&null!==m.slowest?[{value:m.typical,label:d("dns.chart.typical",{value:n(m.typical,d)})},{value:m.slowest,label:d("dns.chart.slowest",{value:n(m.slowest,d)})}]:[],rows:m.upstreams.map(e=>({id:e.upstream,label:e.upstream,detail:d("dns.chart.upstream",{n:e.samples.length,median:n(e.median,d)}),points:e.samples.map(g),mark:e.median})),fmt:e=>n(e,d)}),s.jsxs("div",{className:"rp-legend",children:[["answered","nxdomain","failed"].map(e=>s.jsx(ce,{swatch:h[e],label:d(Ge[e])},e)),s.jsx(ce,{swatch:s.jsx("i",{className:"rp-median-key","aria-hidden":"true"}),label:d("dns.chart.medianKey")})]})]})}),s.jsx(W,{title:d("dns.chart.outcomes"),children:b??s.jsx(oe,{label:d("dns.chart.outcomes"),shares:ue.map(e=>({id:e,label:d(Ge[e]),count:m.counts[e],color:h[e],text:d("dns.chart.share",{n:m.counts[e],share:x(m.counts[e],m.total)})}))})})]}),s.jsxs("div",{className:"rp-g21",children:[s.jsx(ss,{analysis:m,standIn:f("bars"),logHref:i.log}),s.jsx(es,{listed:l,href:i.cache})]})]})}function es({listed:e,href:a}){const t=o(),{ref:n,...r}=Je(e);return s.jsx(W,{ref:n,title:t("dns.chart.cache"),note:"ready"===r.state?r.card?.note:void 0,aside:e&&a&&s.jsx(Pe,{appearance:"link",href:a,children:t("dns.viewCache")}),children:"unlisted"===r.state?s.jsx(A,{children:t("dns.cacheUnavailable")}):"unavailable"===r.state?s.jsx(A,{children:t("dns.cacheBusy")}):"error"===r.state?s.jsx(F,{error:r.error,onRetry:r.retry}):r.card?s.jsxs(s.Fragment,{children:[r.card.usage&&s.jsxs("div",{className:"rp-form",children:[r.card.usage.meter&&s.jsx(K,{label:t("dns.chart.usage"),...r.card.usage.meter}),s.jsx(ie,{facts:r.card.usage.facts})]}),s.jsx("p",{className:"rp-note",children:r.card.coverage})]}):s.jsx(O,{shape:"rows"})})}function ss({analysis:a,standIn:t,logHref:n}){const r=o(),l=ne(),[i,d]=e.useState("device"),c="device"===i?a.devices:a.domains,u=c.top[0]?.count??1;return s.jsx(W,{title:r("dns.chart.ranking"),aside:!t&&s.jsx(be,{label:r("dns.chart.ranking"),value:i,onChange:d,items:[["device",r("dns.chart.byDevice")],["domain",r("dns.chart.byDomain")]]}),children:t??s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"rp-list",children:c.top.map(e=>s.jsx(H,{label:null===e.key?r("dns.chart.resolver"):s.jsx(Pe,{appearance:"link",href:n("device"===i?"device":"domain",e.key),children:s.jsx(B,{children:e.key})}),value:r("dns.chart.count",{n:e.count}),pct:e.count/u*100,color:"device"===i?l.cat[0]:l.cat[3]},e.key??""))}),c.rest>0&&s.jsx("p",{className:"rp-note",children:r("dns.chart.rest",{n:c.rest})})]})})}function as(e){const a=o(),t=$e(e),n=s.jsxs(s.Fragment,{children:[t.queryError&&s.jsx(F,{error:t.queryError,onRetry:t.submit,message:e=>a("dns.queryFailed",{error:e})}),s.jsx(I,{className:V(),onSubmit:e=>{e.preventDefault(),t.submit()},children:s.jsx(Q,{reason:t.reason,children:s.jsxs(Ne,{children:[s.jsx($,{side:!0,label:a("ui.domain"),value:t.domain,onChange:t.setDomain,width:280,placeholder:"example.com"}),s.jsx(je,{label:a("ui.type"),side:!0,value:t.type,onChange:t.setType,items:t.choices}),t.upstreams.length>0&&s.jsx(je,{label:a("ui.upstream"),side:!0,value:t.upstream,onChange:t.setUpstream,items:t.upstreams}),s.jsx(z,{isSelected:t.bypassCache,onChange:t.setBypassCache,children:a("dns.bypassCache")}),s.jsx(J,{accent:!0,type:"submit",isPending:t.pending,isDisabled:t.disabled,children:a("dns.query")})]})})}),t.cards.length>0&&s.jsx("div",{className:"rp-col",children:t.cards.map(e=>s.jsxs(W,{className:"rp-col",children:[s.jsxs("div",{className:"rp-row",children:[s.jsxs("div",{className:"rp-cluster",children:[s.jsx("h2",{className:"rp-h3",children:e.title}),s.jsx(G,{tone:e.cacheTone,children:e.cacheText})]}),s.jsxs("div",{className:"rp-cluster",children:[t.rule.canAdd(e.seed)&&s.jsx(J,{quiet:!0,small:!0,onPress:()=>t.rule.open(e.seed),children:a("rule.add")}),t.showCache&&s.jsx(J,{quiet:!0,small:!0,onPress:t.viewCache,children:a("dns.viewCache")})]})]}),s.jsx(ve,{inline:!0,items:e.fields}),e.answers.length?s.jsx("div",{className:"rp-list",children:e.answers.map((n,r)=>{const l=e.answerSeeds[r];return s.jsxs("div",{className:"rp-cluster",children:[s.jsx("div",{className:"rp-code",children:n}),l&&t.rule.canAdd(l.seed)&&s.jsx(J,{quiet:!0,small:!0,label:a("dns.addRuleFor",{value:l.address}),onPress:()=>t.rule.open(l.seed),children:a("rule.add")})]},r)})}):s.jsx(A,{children:a("dns.noAnswers")})]},e.id))})]}),r={stats:s.jsx(Xe,{enabled:t.logEnabled,links:{cache:t.cacheHref,log:t.logHref}}),query:n,cache:s.jsx(ts,{domain:t.filterDomain,clearFilter:t.clearCacheFilter,rule:t.rule}),log:s.jsx(ns,{enabled:t.logEnabled,initialName:t.filterDomain,initialSrc:t.filterDevice,links:t.logLinks,rule:t.rule})};return s.jsxs("div",{className:"rp-page",children:[s.jsx(_e,{page:!0,keepMounted:!0,label:a("nav.dns"),items:t.tabs.map(e=>({...e,content:r[e.id]})),value:t.tab,onChange:t.setTab}),s.jsx(Ee,{dialog:t.rule.dialog})]})}function ts({domain:a,clearFilter:t,rule:n}){const r=o(),l=ze(a),{remove:i}=l,d=e.useMemo(()=>[{id:"q",label:r("ui.domain"),text:"wrap",minWidth:320,isRowHeader:!0,render:e=>s.jsx("span",{className:"rp-code",children:e.domain})},{id:"t",label:r("ui.type"),minWidth:88,grow:0,drop:3,render:e=>e.type},{id:"s",label:r("ui.state"),minWidth:128,grow:0,render:e=>e.status},{id:"e",label:r("dns.expires"),minWidth:128,drop:2,render:e=>s.jsx(Te,{at:e.expiresAt})},{id:"st",label:r("dns.staleUntil"),minWidth:128,drop:1,render:e=>s.jsx(Te,{at:e.staleUntil})},{id:"a",actions:!0,label:r("ui.actions"),minWidth:104,grow:0,render:e=>s.jsxs("div",{className:"rp-cluster nowrap",children:[s.jsx(De,{label:n.label(e.domain),disabled:!n.canAdd(e.seed),onPress:()=>n.open(e.seed)}),s.jsx(J,{quiet:!0,icon:!0,small:!0,label:e.deleteLabel,isPending:e.pending,isDisabled:e.disabled,onPress:()=>i(e.id),children:s.jsx(se,{})})]})}],[r,i,n]);return s.jsxs(s.Fragment,{children:[l.error&&s.jsx(F,{error:l.error,onRetry:l.retry}),s.jsxs(Ne,{page:!0,className:"top",children:[s.jsx(ve,{row:!0,items:l.fields}),l.coverage.map(e=>s.jsx(G,{tone:"warn",children:e.text},e.id)),l.filtered&&s.jsx(J,{onPress:()=>{l.clearMatches(),t()},children:r("ui.clearFilters")}),s.jsx(z,{isSelected:l.includeExpired,onChange:l.setIncludeExpired,children:r("dns.includeExpired")}),s.jsx("span",{className:"rp-grow"}),s.jsx("div",{className:"rp-col",children:s.jsx(Q,{reason:l.flushReason,children:s.jsx(ee,{label:r("dns.flushAll"),confirmationText:l.confirmationText,isPending:l.flushPending,isDisabled:l.flushPending||l.flushDisabled,onConfirm:l.flush,onAbort:l.abortFlush})})})]}),l.matchAvailable&&s.jsx(Q,{reason:l.matchReason,children:s.jsxs(Ne,{page:!0,children:[s.jsx(je,{side:!0,label:r("rule.kind"),value:l.matchKind,onChange:e=>l.setMatchKind(e),items:l.matchKinds}),s.jsx($,{side:!0,label:r("dns.pattern"),value:l.matchText,onChange:l.setMatchText,error:l.matchError,help:"regex"===l.matchKind?{title:r("dns.pattern"),text:r("dns.regexHelp")}:void 0,width:280,placeholder:"example.com"}),s.jsx(je,{side:!0,label:r("ui.type"),value:l.matchType,onChange:l.setMatchType,items:l.matchTypes}),(l.deleteBy.name||l.deleteBy.entry)&&s.jsx(ee,{label:r("dns.deleteMatching"),confirmationText:l.matchConfirmation,details:s.jsxs("ul",{className:"rp-impact",children:[l.matchListed.map(e=>s.jsx("li",{children:s.jsxs("span",{className:"rp-cluster nowrap",children:[s.jsx(B,{className:"rp-code",children:e.domain}),s.jsx("span",{className:"rp-note",children:e.type})]})},e.entry_id)),l.matchMore&&s.jsx("li",{className:"rp-note",children:l.matchMore})]}),isPending:l.matchPending,isDisabled:l.matchDisabled,onConfirm:l.removeMatching,onAbort:l.abortFlush})]})}),s.jsx(Q,{reason:l.deleteReason,children:s.jsx(Se,{label:r("ui.cache"),height:442,fit:!0,rows:l.rows,loading:l.loading,empty:l.empty,cols:d})})]})}function ns({enabled:a,initialName:t,initialSrc:n,links:r,rule:l}){const i=o(),d=Ve(a,t,n),c=e.useMemo(()=>[{id:"t",label:i("ui.time"),minWidth:140,grow:0,render:e=>s.jsx(Te,{at:e.observedAt})},{id:"q",label:i("ui.domain"),minWidth:200,grow:2,isRowHeader:!0,render:e=>s.jsx(B,{children:e.name})},{id:"ty",label:i("ui.type"),minWidth:88,grow:0,drop:3,render:e=>e.type},{id:"s",label:i("ui.device"),minWidth:128,drop:2,render:e=>s.jsx(B,{className:"rp-code",children:e.source})},{id:"r",label:i("dns.result"),minWidth:160,grow:2,render:e=>e.resultError?s.jsx(X,{small:!0,tone:"err",children:e.result}):s.jsx(B,{className:"rp-code",children:e.result})},{id:"u",label:i("ui.upstream"),minWidth:128,drop:1,render:e=>e.cached?s.jsx(X,{small:!0,tone:"ok",children:e.upstream}):s.jsx(B,{children:e.upstream})},{id:"e",label:i("ui.elapsed"),minWidth:88,grow:0,drop:4,render:e=>e.elapsed},{id:"a",actions:!0,label:i("ui.actions"),minWidth:88,grow:0,render:e=>s.jsx(De,{label:l.label(e.name),disabled:!l.canAdd(e.seed),onPress:()=>l.open(e.seed)})}],[i,l]);return s.jsxs(s.Fragment,{children:[s.jsxs(Ne,{page:!0,children:[s.jsx($,{search:!0,label:i("ui.domain"),value:d.name,onChange:d.setName,placeholder:i("dns.logFilterHint"),width:240}),s.jsx(je,{label:i("ui.type"),side:!0,value:d.type,onChange:d.setType,items:d.choices}),s.jsx($,{search:!0,label:i("ui.device"),value:d.src,onChange:d.setSrc,error:d.srcError,placeholder:"10.0.0.12",width:160}),d.total&&s.jsx(Y,{help:d.totalHelp,children:s.jsx("span",{className:"rp-label",children:d.total})}),d.loaded&&s.jsx("span",{className:"rp-label",children:d.loaded}),s.jsx("span",{className:"rp-grow"}),s.jsx(we,{actions:[{id:"refresh",label:i("ui.refresh"),icon:s.jsx(me,{className:"rp-spin-on-press"}),isPending:d.refreshing,onAction:d.refresh},{id:"export",label:i("dns.exportLog"),icon:s.jsx(he,{}),isDisabled:!d.rows.length,onAction:d.export},...r,...d.hasOlder?[{id:"older",label:i("dns.loadOlder"),isPending:d.loadingOlder,onAction:d.loadOlder}]:[]]})]}),d.error&&s.jsx(F,{error:d.error,onRetry:d.retry}),d.newerWaiting&&s.jsx("p",{className:"rp-note",children:i("dns.newerWaiting")}),s.jsxs("div",{className:"rp-with-panel","data-open":d.detail?"":void 0,children:[s.jsx(Se,{label:i("dns.log"),rowDetail:!0,height:520,rows:d.rows,selected:d.selected,onSelect:d.setSelected,selectOnFocus:d.wide,loading:d.loading,empty:d.empty,cols:c}),s.jsx(Z,{open:!!d.detail,title:d.detailTitle,onClose:()=>d.setSelected(null),children:d.detail&&s.jsxs(s.Fragment,{children:[s.jsx(ve,{inline:!0,items:d.detail.fields}),d.detail.answers.length?s.jsx("div",{className:"rp-list",children:d.detail.answers.map((e,a)=>s.jsx("div",{className:"rp-code",children:e},a))}):s.jsx(A,{children:i("dns.noAnswers")})]})})]}),d.hasOlder&&s.jsx("div",{className:"rp-narrow-only",children:s.jsx("div",{className:"rp-cluster",children:s.jsx(J,{small:!0,isPending:d.loadingOlder,onPress:d.loadOlder,children:i("dns.loadOlder")})})})]})}export{as as Dns}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/Donut-CLXBHnKk.js b/luci-app-honk/root/etc/honk/doona/assets/Donut-CLXBHnKk.js deleted file mode 100644 index 252462a3..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/Donut-CLXBHnKk.js +++ /dev/null @@ -1 +0,0 @@ -import{r as n,j as t}from"./vendor-react-64fcanlc.js";import{u as e,f as r}from"./index-HxEUeoab.js";import{aW as o,b4 as a,aZ as i,a$ as l}from"./activity-yZTrGy-J.js";import{w as u,c,a as s}from"./array-C0VuvQyb.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./nodes-6sIn2I0s.js";import"./AppearanceControls-sRy1p156.js";import"./ItemText-DOD_75iR.js";import"./logs-C4GIy4tX.js";import"./Select-D7_6MaHd.js";const f=Math.abs,h=Math.atan2,y=Math.cos,p=Math.max,d=Math.min,x=Math.sin,g=Math.sqrt,v=1e-12,m=Math.PI,M=m/2,A=2*m;function j(n){return n>=1?M:n<=-1?-M:Math.asin(n)}function w(n){return n.innerRadius}function b(n){return n.outerRadius}function P(n){return n.startAngle}function T(n){return n.endAngle}function R(n){return n&&n.padAngle}function L(n,t,e,r,o,a,i){var l=n-e,u=t-r,c=(i?a:-a)/g(l*l+u*u),s=c*u,f=-c*l,h=n+s,y=t+f,d=e+s,x=r+f,v=(h+d)/2,m=(y+x)/2,M=d-h,A=x-y,j=M*M+A*A,w=o-a,b=h*x-d*y,P=(A<0?-1:1)*g(p(0,w*w*j-b*b)),T=(b*A-M*P)/j,R=(-b*M-A*P)/j,L=(b*A+M*P)/j,$=(-b*M+A*P)/j,I=T-v,k=R-m,B=L-v,K=$-m;return I*I+k*k>B*B+K*K&&(T=L,R=$),{cx:T,cy:R,x01:-s,y01:-f,x11:T*(o/w-1),y11:R*(o/w-1)}}function $(){var n=w,t=b,e=c(0),r=null,o=P,a=T,i=R,l=null,s=u(p);function p(){var u,c,p,w=+n.apply(this,arguments),b=+t.apply(this,arguments),P=o.apply(this,arguments)-M,T=a.apply(this,arguments)-M,R=f(T-P),$=T>P;if(l||(l=u=s()),bv)if(R>A-v)l.moveTo(b*y(P),b*x(P)),l.arc(0,0,b,P,T,!$),w>v&&(l.moveTo(w*y(T),w*x(T)),l.arc(0,0,w,T,P,$));else{var I,k,B=P,K=T,N=P,S=T,D=R,E=R,F=i.apply(this,arguments)/2,q=F>v&&(r?+r.apply(this,arguments):g(w*w+b*b)),C=d(f(b-w)/2,+e.apply(this,arguments)),H=C,V=C;if(q>v){var W=j(q/w*x(F)),Z=j(q/b*x(F));(D-=2*W)>v?(N+=W*=$?1:-1,S-=W):(D=0,N=S=(P+T)/2),(E-=2*Z)>v?(B+=Z*=$?1:-1,K-=Z):(E=0,B=K=(P+T)/2)}var _=b*y(B),z=b*x(B),G=w*y(S),J=w*x(S);if(C>v){var O,Q=b*y(K),U=b*x(K),X=w*y(N),Y=w*x(N);if(R1?0:p<-1?m:Math.acos(p))/2),an=g(O[0]*O[0]+O[1]*O[1]);H=d(C,(w-an)/(on-1)),V=d(C,(b-an)/(on+1))}else H=V=0}E>v?V>v?(I=L(X,Y,_,z,b,V,$),k=L(Q,U,G,J,b,V,$),l.moveTo(I.cx+I.x01,I.cy+I.y01),Vv&&D>v?H>v?(I=L(G,J,Q,U,w,-H,$),k=L(_,z,X,Y,w,-H,$),l.lineTo(I.cx+I.x01,I.cy+I.y01),Hn?1:t>=n?0:NaN}function k(n){return n}function B({label:u,rows:f}){const h=e(),[y,p]=r(Math.round,120),{tip:d,showAt:x,hide:g}=o(),[v,m]=n.useState(null),M=f.filter(n=>null!==n.value&&n.value>0),j=p?.width??0,w=p?.height??0,b=a(M.map(n=>n.value)),P=function(){var n=k,t=I,e=null,r=c(0),o=c(A),a=c(0);function i(i){var l,u,c,f,h,y=(i=s(i)).length,p=0,d=new Array(y),x=new Array(y),g=+r.apply(this,arguments),v=Math.min(A,Math.max(-A,o.apply(this,arguments)-g)),m=Math.min(Math.abs(v)/y,a.apply(this,arguments)),M=m*(v<0?-1:1);for(l=0;l0&&(p+=h);for(null!=t?d.sort(function(n,e){return t(x[n],x[e])}):null!=e&&d.sort(function(n,t){return e(i[n],i[t])}),l=0,c=p?(v-y*M)/p:0;l0?h*c:0)+M,x[u]={data:i[u],index:l,value:h,startAngle:g,endAngle:f,padAngle:m};return x}return i.value=function(t){return arguments.length?(n="function"==typeof t?t:c(+t),i):n},i.sortValues=function(n){return arguments.length?(t=n,e=null,i):t},i.sort=function(n){return arguments.length?(e=n,t=null,i):e},i.startAngle=function(n){return arguments.length?(r="function"==typeof n?n:c(+n),i):r},i.endAngle=function(n){return arguments.length?(o="function"==typeof n?n:c(+n),i):o},i.padAngle=function(n){return arguments.length?(a="function"==typeof n?n:c(+n),i):a},i}().sort(null).value((n,t)=>b[t])(M),T=Math.min(j,w)/2,R=$().innerRadius(T*(44/56)).outerRadius(T).digits(3),L=n=>m(n);n.useLayoutEffect(()=>{const n=null===v?void 0:P[v];if(!n||null===v)return void g();const t=M[v],[e,r]=R.centroid(n);x({x:Math.round(1e4*(j/2+e))/1e4,y:Math.round(1e4*(w/2+r))/1e4,width:j,bounds:{x:0,y:0,width:j,height:w},lines:[h("ui.valuePair",{label:t.name,value:h("ui.share",{bytes:t.text,percent:String(t.value)})})]})});const B=i(M.length,L,()=>{m(null),g()});return t.jsxs("div",{ref:y,style:{height:"100%",width:"100%",position:"relative"},onPointerLeave:B.onPointerLeave,children:[t.jsx(l,{tip:d}),p&&t.jsx("svg",{className:"rp-activity-surface",width:j,height:w,viewBox:`0 0 ${j} ${w}`,style:{display:"block"},role:M.length?"application":"img","aria-label":u,tabIndex:M.length?0:void 0,onFocus:M.length?B.onFocus:void 0,onBlur:B.onBlur,onKeyDown:M.length?B.onKeyDown:void 0,children:t.jsx("g",{transform:`translate(${j/2},${w/2})`,children:P.map((n,e)=>t.jsx("path",{d:R({...n,endAngle:Math.min(n.endAngle,n.startAngle+359.999*Math.PI/180)})??void 0,fill:M[e].color,stroke:"none",onPointerEnter:()=>L(e),onPointerLeave:B.onPointerLeave},M[e].name))})})]})}export{B as DonutPlot}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/Editors-DQ5Z_NlY.js b/luci-app-honk/root/etc/honk/doona/assets/Editors-DQ5Z_NlY.js deleted file mode 100644 index 91ce787c..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/Editors-DQ5Z_NlY.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,$ as t,a as r,j as n}from"./vendor-react-64fcanlc.js";import{ey as o,gi as i,ep as a,el as s,cN as l,gj as d,gk as c,gl as p,er as u,em as g,en as f,dv as m,eo as h,gb as y,gm as D,ez as v,eP as b,gn as w,go as x,eQ as T,ew as k,dx as E,bp as P,cK as K,cC as O,b7 as S,aD as C,cl as I,eW as j,az as A,bs as R,B as M,f as B,u as L,R as F,ch as $,q as z,d2 as N,bK as V,cw as X,df as Y,b5 as H,aL as q,gp as U,P as J,gq as W,A as _}from"./index-HxEUeoab.js";import{b5 as G,b6 as Q,b7 as Z,b8 as ee,b9 as te,ba as re,bb as ne,bc as oe,bd as ie,be as ae,bf as se,bg as le,bh as de,bi as ce,bj as pe,bk as ue,bl as ge,bm as fe,bn as me,bo as he,bp as ye,bq as De,br as ve,bs as be,bt as we,bu as xe,bv as Te,bw as ke,bx as Ee,by as Pe,bz as Ke,bA as Oe,bB as Se,bC as Ce,bD as Ie,bE as je,bF as Ae}from"./activity-yZTrGy-J.js";import{$ as Re,a as Me}from"./GridList-D7qdplA5.js";import{m as Be}from"./Select-D7_6MaHd.js";import{D as Le}from"./Delete-CR2AtZsd.js";import{S as Fe,c as $e,$ as ze}from"./logs-C4GIy4tX.js";import{C as Ne}from"./AppearanceControls-sRy1p156.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./nodes-6sIn2I0s.js";import"./ItemText-DOD_75iR.js";import"./Checkbox-CJt7u9-e.js";var Ve=function(e){return e[e.none=0]="none",e[e.cancel=0]="cancel",e[e.move=1]="move",e[e.copy=2]="copy",e[e.link=4]="link",e[e.all=7]="all",e}({});const Xe={...Ve,copyMove:3,copyLink:6,linkMove:5,all:7,uninitialized:7},Ye=Ue(Xe);Ye[7]="all";const He={none:"cancel",link:"link",copy:"copy",move:"move"},qe=Ue(He);function Ue(e){let t={};for(let r in e)t[e[r]]=r;return t}const Je=new Set(["text/plain","text/uri-list","text/html"]),We="application/vnd.react-aria.items+json",_e="application/octet-stream",Ge=new WeakMap,Qe=Symbol();function Ze(e){let t=new Set;for(let r of e)for(let e of Object.keys(r))t.add(e);return t}function et(e){return e||(e="virtual"),"pointer"===e&&(e="virtual"),"virtual"===e&&"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches&&(e="touch"),e}function tt(){return et(o())}function rt(){return et(i())}class nt{constructor(e){this.types=new Set;let t=!1;for(let r of e.items)r.type!==We&&("file"===r.kind&&(t=!0),r.type?this.types.add(r.type):this.types.add(_e));this.includesUnknownTypes=!t&&e.types.includes("Files")}has(e){if(Array.isArray(e))return e.some(e=>this.has(e));if(this.includesUnknownTypes||e===Qe&&this.types.has(_e)||"*/*"===e)return!0;if("string"==typeof e){if(e.endsWith("/*")){for(let t of this.types)if(t.startsWith(e.slice(0,-2)))return!0;return!1}return this.types.has(e)}return!1}}function ot(e){if(!e)throw new Error("No file provided");return{kind:"file",type:e.type||_e,name:e.name,getText:()=>{return"function"==typeof(t=e).text?t.text():new Promise((e,r)=>{let n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=r,n.readAsText(t)});var t},getFile:()=>Promise.resolve(e)}}function it(e){return{kind:"directory",name:e.name,getEntries:()=>async function*(e){let t,r=e.createReader();do{t=await new Promise((e,t)=>{r.readEntries(e,t)});for(let e of t)if(e.isFile){let t=await at(e);yield ot(t)}else e.isDirectory&&(yield it(e))}while(t.length>0)}(e)}}function at(e){return new Promise((t,r)=>e.file(t,r))}let st,lt={draggingKeys:new Set};function dt(e){lt.dropCollectionRef=e}function ct(){lt={draggingKeys:new Set}}function pt(e){let{draggingCollectionRef:t,dropCollectionRef:r}=lt;return null!=t?.current&&t.current===(e?.current||r?.current)}function ut(e){st=e}let gt=Ve.none;function ft(e){gt=e}let mt=new Map,ht=new Map,yt=null,Dt=new Set;function vt(e){return mt.set(e.element,e),yt?.updateValidDropTargets(),()=>{mt.delete(e.element),yt?.updateValidDropTargets()}}function bt(){let[t,r]=e.useState(yt);return e.useEffect(()=>{let e=()=>r(yt);return Dt.add(e),()=>{Dt.delete(e)}},[]),t}function wt(){return!!yt}const xt=["pointerdown","pointermove","pointerenter","pointerleave","pointerover","pointerout","pointerup","mousedown","mousemove","mouseenter","mouseleave","mouseover","mouseout","mouseup","touchstart","touchmove","touchend","focusin","focusout"],Tt=["pointerup","mouseup","touchend"],kt={keyboard:"dragStartedKeyboard",touch:"dragStartedTouch",virtual:"dragStartedVirtual"};class Et{constructor(e,t){this.validDropTargets=[],this.currentDropTarget=null,this.currentDropItem=null,this.dropOperation=null,this.mutationObserver=null,this.restoreAriaHidden=null,this.isVirtualClick=!1,this.dragTarget=e,this.stringFormatter=t,this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.onFocus=this.onFocus.bind(this),this.onBlur=this.onBlur.bind(this),this.onClick=this.onClick.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.cancelEvent=this.cancelEvent.bind(this),this.initialFocused=!1}setup(){document.addEventListener("keydown",this.onKeyDown,!0),document.addEventListener("keyup",this.onKeyUp,!0),window.addEventListener("focus",this.onFocus,!0),window.addEventListener("blur",this.onBlur,!0),document.addEventListener("click",this.onClick,!0),document.addEventListener("pointerdown",this.onPointerDown,!0);for(let e of xt)document.addEventListener(e,this.cancelEvent,!0);this.mutationObserver=new MutationObserver(()=>this.updateValidDropTargets()),this.updateValidDropTargets(),a(this.stringFormatter.format(kt[rt()]))}teardown(){document.removeEventListener("keydown",this.onKeyDown,!0),document.removeEventListener("keyup",this.onKeyUp,!0),window.removeEventListener("focus",this.onFocus,!0),window.removeEventListener("blur",this.onBlur,!0),document.removeEventListener("click",this.onClick,!0),document.removeEventListener("pointerdown",this.onPointerDown,!0);for(let e of xt)document.removeEventListener(e,this.cancelEvent,!0);this.mutationObserver?.disconnect(),this.restoreAriaHidden?.()}onKeyDown(e){this.cancelEvent(e),"Escape"!==e.key?("Tab"!==e.key||e.metaKey||e.altKey||e.ctrlKey||(e.shiftKey?this.previous():this.next()),"function"==typeof this.currentDropTarget?.onKeyDown&&this.currentDropTarget.onKeyDown(e,this.dragTarget)):this.cancel()}onKeyUp(e){this.cancelEvent(e),"Enter"===e.key&&(e.altKey||s(this.getCurrentActivateButton(),l(e))?this.activate(this.currentDropTarget,this.currentDropItem):this.drop())}getCurrentActivateButton(){return this.currentDropItem?.activateButtonRef?.current??this.currentDropTarget?.activateButtonRef?.current??null}onFocus(e){let t=this.getCurrentActivateButton(),r=l(e);if(r===t)return void this.cancelEvent(e);if(r!==this.dragTarget.element&&this.cancelEvent(e),!(r instanceof HTMLElement)||r===this.dragTarget.element)return;let n=this.validDropTargets.find(e=>e.element===r)||this.validDropTargets.find(e=>s(e.element,r));if(!n)return void(this.currentDropTarget?this.currentDropTarget.element.focus():this.dragTarget.element.focus());let o=ht.get(r);n&&this.setCurrentDropTarget(n,o)}onBlur(e){let t=this.getCurrentActivateButton();t&&e.relatedTarget===t?this.cancelEvent(e):(l(e)!==this.dragTarget.element&&this.cancelEvent(e),e.relatedTarget&&e.relatedTarget instanceof HTMLElement||(this.currentDropTarget?this.currentDropTarget.element.focus():this.dragTarget.element.focus()))}onClick(e){if(this.cancelEvent(e),d(e)||this.isVirtualClick){let t=ht.values(),r=l(e),n=[...t].find(e=>e.element===r||s(e.activateButtonRef?.current,r)),o=this.validDropTargets.find(e=>s(e.element,r));if(s(n?.activateButtonRef?.current??o?.activateButtonRef?.current,r)&&o)return void this.activate(o,n);if(l(e)===this.dragTarget.element)return void this.cancel();o&&(this.setCurrentDropTarget(o,n),this.drop(n))}}onPointerDown(e){this.cancelEvent(e),this.isVirtualClick=c(e)}cancelEvent(e){let t=l(e);("focusin"!==e.type&&"focusout"!==e.type||t!==this.dragTarget?.element&&t!==this.getCurrentActivateButton())&&(Tt.includes(e.type)||e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())}updateValidDropTargets(){if(!this.mutationObserver)return;if(this.mutationObserver.disconnect(),this.restoreAriaHidden&&this.restoreAriaHidden(),this.validDropTargets=function(e){let t=Ze(e.items);return[...mt.values()].filter(r=>!r.element.closest('[aria-hidden="true"], [inert]')&&("function"!=typeof r.getDropOperation||"cancel"!==r.getDropOperation(t,e.allowedDropOperations)))}(this.dragTarget),this.validDropTargets.length>0){let e=this.findNearestDropTarget();this.validDropTargets=[...this.validDropTargets.slice(e),...this.validDropTargets.slice(0,e)]}this.currentDropTarget&&!this.validDropTargets.includes(this.currentDropTarget)&&this.setCurrentDropTarget(this.validDropTargets[0]);let e=Ze(this.dragTarget.items),t=[...ht.values()].filter(t=>"function"!=typeof t.getDropOperation||"cancel"!==t.getDropOperation(e,this.dragTarget.allowedDropOperations)),r=this.validDropTargets.filter(e=>!t.some(t=>s(e.element,t.element)));this.restoreAriaHidden=p([this.dragTarget.element,...t.flatMap(e=>e.activateButtonRef?.current?[e.element,e.activateButtonRef?.current]:[e.element]),...r.flatMap(e=>e.activateButtonRef?.current?[e.element,e.activateButtonRef?.current]:[e.element])],{shouldUseInert:!0}),this.mutationObserver.observe(document.body,{subtree:!0,attributes:!0,attributeFilter:["aria-hidden","inert"]})}next(){if(!this.currentDropTarget)return void this.setCurrentDropTarget(this.validDropTargets[0]);let e=this.validDropTargets.indexOf(this.currentDropTarget);e<0?this.setCurrentDropTarget(this.validDropTargets[0]):e===this.validDropTargets.length-1?this.dragTarget.element.closest('[aria-hidden="true"], [inert]')?this.setCurrentDropTarget(this.validDropTargets[0]):(this.setCurrentDropTarget(null),this.dragTarget.element.focus()):this.setCurrentDropTarget(this.validDropTargets[e+1])}previous(){if(!this.currentDropTarget)return void this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length-1]);let e=this.validDropTargets.indexOf(this.currentDropTarget);e<0?this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length-1]):0===e?this.dragTarget.element.closest('[aria-hidden="true"], [inert]')?this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length-1]):(this.setCurrentDropTarget(null),this.dragTarget.element.focus()):this.setCurrentDropTarget(this.validDropTargets[e-1])}findNearestDropTarget(){let e=this.dragTarget.element.getBoundingClientRect(),t=1/0,r=-1,n=-1;for(let o=0;o=0?n:r}setCurrentDropTarget(e,t){if(e!==this.currentDropTarget){if(this.currentDropTarget&&"function"==typeof this.currentDropTarget.onDropExit){let e=this.currentDropTarget.element.getBoundingClientRect();this.currentDropTarget.onDropExit({type:"dropexit",x:e.left+e.width/2,y:e.top+e.height/2})}if(this.currentDropTarget=e,e){if("function"==typeof e.onDropEnter){let t=e.element.getBoundingClientRect();e.onDropEnter({type:"dropenter",x:t.left+t.width/2,y:t.top+t.height/2},this.dragTarget)}t||e?.element.focus()}}if(null!=t&&t!==this.currentDropItem&&(this.currentDropTarget&&"function"==typeof this.currentDropTarget.onDropTargetEnter&&this.currentDropTarget.onDropTargetEnter(t.target),t.element.focus(),this.currentDropItem=t,!this.initialFocused)){let e=t?.element.getAttribute("aria-label");e&&a(e,"polite"),this.initialFocused=!0}}end(){if(this.teardown(),function(){yt=null;for(let e of Dt)e()}(),"function"==typeof this.dragTarget.onDragEnd){let e=(this.currentDropTarget&&"cancel"!==this.dropOperation?this.currentDropTarget:this.dragTarget).element.getBoundingClientRect();this.dragTarget.onDragEnd({type:"dragend",x:e.x+e.width/2,y:e.y+e.height/2,dropOperation:this.dropOperation||"cancel"})}this.currentDropTarget&&!this.currentDropTarget.preventFocusOnDrop&&u()?.dispatchEvent(new FocusEvent("focusin",{bubbles:!0})),this.setCurrentDropTarget(null)}cancel(){this.setCurrentDropTarget(null),this.end(),this.dragTarget.element.closest('[aria-hidden="true"], [inert]')||this.dragTarget.element.focus(),u()?.dispatchEvent(new FocusEvent("focusin",{bubbles:!0})),a(this.stringFormatter.format("dropCanceled"))}drop(e){if(this.currentDropTarget){if("function"==typeof e?.getDropOperation){let t=Ze(this.dragTarget.items);this.dropOperation=e.getDropOperation(t,this.dragTarget.allowedDropOperations)}else if("function"==typeof this.currentDropTarget.getDropOperation){let e=Ze(this.dragTarget.items);this.dropOperation=this.currentDropTarget.getDropOperation(e,this.dragTarget.allowedDropOperations)}else this.dropOperation=this.dragTarget.allowedDropOperations[0];if("function"==typeof this.currentDropTarget.onDrop){let t=this.dragTarget.items.map(e=>({kind:"text",types:new Set(Object.keys(e)),getText:t=>Promise.resolve(e[t])})),r=this.currentDropTarget.element.getBoundingClientRect();this.currentDropTarget.onDrop({type:"drop",x:r.left+r.width/2,y:r.top+r.height/2,items:t,dropOperation:this.dropOperation},e?.target??null)}this.end(),a(this.stringFormatter.format("dropComplete"))}else this.cancel()}activate(e,t){if(e&&"function"==typeof e.onDropActivate){let r=t?.target??null,n=e.element.getBoundingClientRect();e.onDropActivate({type:"dropactivate",x:n.left+n.width/2,y:n.top+n.height/2},r)}}}var Pt;Pt={"ar-AE":g,"bg-BG":g,"cs-CZ":g,"da-DK":g,"de-DE":g,"el-GR":g,"en-US":{dragItem:e=>`Drag ${e.itemText}`,dragSelectedItems:(e,t)=>`Drag ${t.plural(e.count,{one:()=>`${t.number(e.count)} selected item`,other:()=>`${t.number(e.count)} selected items`})}`,dragDescriptionKeyboard:"Press Enter to start dragging.",dragDescriptionKeyboardAlt:"Press Alt + Enter to start dragging.",dragDescriptionTouch:"Double tap to start dragging.",dragDescriptionVirtual:"Click to start dragging.",dragDescriptionLongPress:"Long press to start dragging.",dragSelectedKeyboard:(e,t)=>`Press Enter to drag ${t.plural(e.count,{one:()=>`${t.number(e.count)} selected item`,other:()=>`${t.number(e.count)} selected items`})}.`,dragSelectedKeyboardAlt:(e,t)=>`Press Alt + Enter to drag ${t.plural(e.count,{one:()=>`${t.number(e.count)} selected item`,other:()=>`${t.number(e.count)} selected items`})}.`,dragSelectedLongPress:(e,t)=>`Long press to drag ${t.plural(e.count,{one:()=>`${t.number(e.count)} selected item`,other:()=>`${t.number(e.count)} selected items`})}.`,dragStartedKeyboard:"Started dragging. Press Tab to navigate to a drop target, then press Enter to drop, or press Escape to cancel.",dragStartedTouch:"Started dragging. Navigate to a drop target, then double tap to drop.",dragStartedVirtual:"Started dragging. Navigate to a drop target, then click or press Enter to drop.",endDragKeyboard:"Dragging. Press Enter to cancel drag.",endDragTouch:"Dragging. Double tap to cancel drag.",endDragVirtual:"Dragging. Click to cancel drag.",dropDescriptionKeyboard:"Press Enter to drop. Press Escape to cancel drag.",dropDescriptionTouch:"Double tap to drop.",dropDescriptionVirtual:"Click to drop.",dropCanceled:"Drop canceled.",dropComplete:"Drop complete.",dropIndicator:"drop indicator",dropOnRoot:"Drop on",dropOnItem:e=>`Drop on ${e.itemText}`,insertBefore:e=>`Insert before ${e.itemText}`,insertBetween:e=>`Insert between ${e.beforeItemText} and ${e.afterItemText}`,insertAfter:e=>`Insert after ${e.itemText}`},"es-ES":g,"et-EE":g,"fi-FI":g,"fr-FR":g,"he-IL":g,"hr-HR":g,"hu-HU":g,"it-IT":g,"ja-JP":g,"ko-KR":g,"lt-LT":g,"lv-LV":g,"nb-NO":g,"nl-NL":g,"pl-PL":g,"pt-BR":g,"pt-PT":g,"ro-RO":g,"ru-RU":g,"sk-SK":g,"sl-SI":g,"sr-SP":g,"sv-SE":g,"tr-TR":g,"uk-UA":g,"zh-CN":{dragDescriptionKeyboard:"按 Enter 开始拖动。",dragDescriptionKeyboardAlt:"按 Alt + Enter 开始拖动。",dragDescriptionLongPress:"长按以开始拖动。",dragDescriptionTouch:"双击开始拖动。",dragDescriptionVirtual:"单击开始拖动。",dragItem:e=>`拖动 ${e.itemText}`,dragSelectedItems:(e,t)=>`拖动 ${t.plural(e.count,{one:()=>`${t.number(e.count)} 选中项目`,other:()=>`${t.number(e.count)} 选中项目`})}`,dragSelectedKeyboard:(e,t)=>`按 Enter 以拖动 ${t.plural(e.count,{one:()=>`${t.number(e.count)} 个选定项`,other:()=>`${t.number(e.count)} 个选定项`})}。`,dragSelectedKeyboardAlt:(e,t)=>`按 Alt + Enter 以拖动 ${t.plural(e.count,{one:()=>`${t.number(e.count)} 个选定项`,other:()=>`${t.number(e.count)} 个选定项`})}。`,dragSelectedLongPress:(e,t)=>`长按以拖动 ${t.plural(e.count,{one:()=>`${t.number(e.count)} 个选定项`,other:()=>`${t.number(e.count)} 个选定项`})}。`,dragStartedKeyboard:"已开始拖动。按 Tab 导航到放置目标,然后按 Enter 放置或按 Escape 取消。",dragStartedTouch:"已开始拖动。导航到放置目标,然后双击放置。",dragStartedVirtual:"已开始拖动。导航到放置目标,然后单击或按 Enter 放置。",dropCanceled:"放置已取消。",dropComplete:"放置已完成。",dropDescriptionKeyboard:"按 Enter 放置。按 Escape 取消拖动。",dropDescriptionTouch:"双击放置。",dropDescriptionVirtual:"单击放置。",dropIndicator:"放置标记",dropOnItem:e=>`放置于 ${e.itemText}`,dropOnRoot:"放置于",endDragKeyboard:"正在拖动。按 Enter 取消拖动。",endDragTouch:"正在拖动。双击取消拖动。",endDragVirtual:"正在拖动。单击取消拖动。",insertAfter:e=>`插入到 ${e.itemText} 之后`,insertBefore:e=>`插入到 ${e.itemText} 之前`,insertBetween:e=>`插入到 ${e.beforeItemText} 和 ${e.afterItemText} 之间`},"zh-TW":{dragDescriptionKeyboard:"按 Enter 鍵以開始拖曳。",dragDescriptionKeyboardAlt:"按 Alt+Enter 鍵以開始拖曳。",dragDescriptionLongPress:"長按以開始拖曳。",dragDescriptionTouch:"輕點兩下以開始拖曳。",dragDescriptionVirtual:"按一下滑鼠以開始拖曳。",dragItem:e=>`拖曳「${e.itemText}」`,dragSelectedItems:(e,t)=>`拖曳 ${t.plural(e.count,{one:()=>`${t.number(e.count)} 個選定項目`,other:()=>`${t.number(e.count)} 個選定項目`})}`,dragSelectedKeyboard:(e,t)=>`按 Enter 鍵以拖曳 ${t.plural(e.count,{one:()=>`${t.number(e.count)} 個選定項目`,other:()=>`${t.number(e.count)} 個選定項目`})}。`,dragSelectedKeyboardAlt:(e,t)=>`按 Alt+Enter 鍵以拖曳 ${t.plural(e.count,{one:()=>`${t.number(e.count)} 個選定項目`,other:()=>`${t.number(e.count)} 個選定項目`})}。`,dragSelectedLongPress:(e,t)=>`長按以拖曳 ${t.plural(e.count,{one:()=>`${t.number(e.count)} 個選定項目`,other:()=>`${t.number(e.count)} 個選定項目`})}。`,dragStartedKeyboard:"已開始拖曳。按 Tab 鍵以瀏覽至放置目標,然後按 Enter 鍵以放置,或按 Escape 鍵以取消。",dragStartedTouch:"已開始拖曳。瀏覽至放置目標,然後輕點兩下以放置。",dragStartedVirtual:"已開始拖曳。瀏覽至放置目標,然後按一下滑鼠或按 Enter 鍵以放置。",dropCanceled:"放置已取消。",dropComplete:"放置已完成。",dropDescriptionKeyboard:"按 Enter 鍵以放置。按 Escape 鍵以取消拖曳。",dropDescriptionTouch:"輕點兩下以放置。",dropDescriptionVirtual:"按一下滑鼠以放置。",dropIndicator:"放置指示器",dropOnItem:e=>`放置在「${e.itemText}」上`,dropOnRoot:"放置在",endDragKeyboard:"拖曳中。按 Enter 鍵以取消拖曳。",endDragTouch:"拖曳中。輕點兩下以取消拖曳。",endDragVirtual:"拖曳中。按一下滑鼠以取消拖曳。",insertAfter:e=>`插入至「${e.itemText}」之後`,insertBefore:e=>`插入至「${e.itemText}」之前`,insertBetween:e=>`插入至「${e.beforeItemText}」和「${e.afterItemText}」之間`}};const Kt={keyboard:{start:"dragDescriptionKeyboard",end:"endDragKeyboard"},touch:{start:"dragDescriptionTouch",end:"endDragTouch"},virtual:{start:"dragDescriptionVirtual",end:"endDragVirtual"}};function Ot(t){let{hasDragButton:r,isDisabled:n}=t,o=f((i=Pt)&&i.__esModule?i.default:i,"@react-aria/dnd");var i;let a=e.useRef({options:t,x:0,y:0}).current;a.options=t;let s=e.useRef(null),[p,u]=e.useState(!1),g=e=>{s.current=e,u(!!e)},{addGlobalListener:v,removeAllGlobalListeners:b}=m(),w=e.useRef(null);e.useEffect(()=>()=>{if(s.current&&(!s.current.isConnected||parseInt(e.version,10)<17)){if("function"==typeof a.options.onDragEnd){let e={type:"dragend",x:0,y:0,dropOperation:He[st||"none"]};a.options.onDragEnd(e)}g(null),ft(Ve.none),ut(void 0)}},[a]);let x=e=>{if("function"==typeof a.options.onDragStart){let t=e.getBoundingClientRect();a.options.onDragStart({type:"dragstart",x:t.x+t.width/2,y:t.y+t.height/2})}!function(e,t){if(yt)throw new Error("Cannot begin dragging while already dragging");yt=new Et(e,t),requestAnimationFrame(()=>{yt&&(yt.setup(),"keyboard"===rt()&&yt.next())});for(let r of Dt)r()}({element:e,items:a.options.getItems(),allowedDropOperations:"function"==typeof a.options.getAllowedDropOperations?a.options.getAllowedDropOperations():["move","copy","link"],onDragEnd(e){g(null),"function"==typeof a.options.onDragEnd&&a.options.onDragEnd(e)}},o),g(e)},T=tt(),k=p?Kt[T].end:Kt[T].start,E=h(o.format(k)),P={};return r||(P={...E,onPointerDown(e){if(w.current=c(e.nativeEvent)?"virtual":e.pointerType,e.width<1&&e.height<1&&y()&&D())w.current="virtual";else{let t=e.currentTarget.getBoundingClientRect(),r=e.clientX-t.x,n=e.clientY-t.y,o=t.width/2,i=t.height/2;Math.abs(r-o)<=.5&&Math.abs(n-i)<=.5?w.current="virtual":w.current=e.pointerType}},onKeyDownCapture(e){l(e)===e.currentTarget&&"Enter"===e.key&&(e.preventDefault(),e.stopPropagation())},onKeyUpCapture(e){l(e)===e.currentTarget&&"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),x(l(e)))},onClick(e){(d(e.nativeEvent)||"virtual"===w.current)&&(e.preventDefault(),e.stopPropagation(),x(l(e)))}}),n?{dragProps:{draggable:"false"},dragButtonProps:{},isDragging:!1}:{dragProps:{...P,draggable:"true",onDragStart:e=>{if(e.defaultPrevented)return;if(e.stopPropagation(),"virtual"===w.current)return e.preventDefault(),x(l(e)),void(w.current=null);"function"==typeof t.onDragStart&&t.onDragStart({type:"dragstart",x:e.clientX,y:e.clientY});let r=t.getItems();e.dataTransfer.clearData?.(),function(e,t){let r=new Map,n=!1,o=[];for(let i of t){let e=Object.keys(i);e.length>1&&(n=!0);let t={};for(let o of e){let e=r.get(o);e?n=!0:(e=[],r.set(o,e));let a=i[o];t[o]=a,e.push(a)}o.push(t)}for(let[i,a]of r)if(Je.has(i)){let t=a.join("\n");e.items.add(t,i)}else e.items.add(a[0],i);if(n){let t=JSON.stringify(o);e.items.add(t,We)}}(e.dataTransfer,r);let n=Ve.all;if("function"==typeof t.getAllowedDropOperations){let e=t.getAllowedDropOperations();n=Ve.none;for(let t of e)n|=Ve[t]||Ve.none}ft(n);let o=Ye[n]||"none";e.dataTransfer.effectAllowed="cancel"===o?"none":o,"function"==typeof t.preview?.current&&t.preview.current(r,(t,r,n)=>{if(!t)return;let o=t.getBoundingClientRect(),i=e.currentTarget.getBoundingClientRect(),a=e.clientX-i.x,s=e.clientY-i.y;(a>o.width||s>o.height)&&(a=o.width/2,s=o.height/2);let l=a,d=s;"number"==typeof r&&"number"==typeof n&&(l=r,d=n),l=Math.max(0,Math.min(l,o.width)),d=Math.max(0,Math.min(d,o.height));let c=2*Math.round(o.height/2);t.style.height=`${c}px`,e.dataTransfer.setDragImage(t,l,d)}),v(window,"drop",e=>{e.preventDefault(),e.stopPropagation(),console.warn("Drags initiated from the React Aria useDrag hook may only be dropped on a target created with useDrop. This ensures that a keyboard and screen reader accessible alternative is available.")},{once:!0}),a.x=e.clientX,a.y=e.clientY;let i=l(e);requestAnimationFrame(()=>{g(i)})},onDrag:e=>{e.stopPropagation(),e.clientX===a.x&&e.clientY===a.y||("function"==typeof t.onDragMove&&t.onDragMove({type:"dragmove",x:e.clientX,y:e.clientY}),a.x=e.clientX,a.y=e.clientY)},onDragEnd:e=>{if(e.stopPropagation(),"function"==typeof t.onDragEnd){let r={type:"dragend",x:e.clientX,y:e.clientY,dropOperation:He[e.dataTransfer.dropEffect]};st&&(r.dropOperation=He[st]),t.onDragEnd(r)}g(null),b(),ft(Ve.none),ut(void 0)}},dragButtonProps:{...E,onPress:e=>{"keyboard"!==e.pointerType&&"virtual"!==e.pointerType||x(e.target)}},isDragging:p}}const St={keyboard:"dropDescriptionKeyboard",touch:"dropDescriptionTouch",virtual:"dropDescriptionVirtual"};function Ct(){let e=f((t=Pt)&&t.__esModule?t.default:t,"@react-aria/dnd");var t;let r=tt(),n=bt();return{dropProps:{...h(n?e.format(St[r]):""),onClick:()=>{}}}}function It(t){let{hasDropButton:r,isDisabled:n}=t,[o,i]=e.useState(!1),a=e.useRef({x:0,y:0,dragOverElements:new Set,dropEffect:"none",allowedOperations:Ve.all,dropActivateTimer:void 0}).current,d=e=>{if(i(!0),"function"==typeof t.onDropEnter){let r=e.currentTarget.getBoundingClientRect();t.onDropEnter({type:"dropenter",x:e.clientX-r.x,y:e.clientY-r.y})}},c=e=>{if(i(!1),"function"==typeof t.onDropExit){let r=e.currentTarget.getBoundingClientRect();t.onDropExit({type:"dropexit",x:e.clientX-r.x,y:e.clientY-r.y})}},p=v(e=>{"function"==typeof t.onDropEnter&&t.onDropEnter(e)}),u=v(e=>{"function"==typeof t.onDropExit&&t.onDropExit(e)}),g=v(e=>{"function"==typeof t.onDropActivate&&t.onDropActivate(e)}),f=v(e=>{"function"==typeof t.onDrop&&t.onDrop(e)}),m=v((e,r)=>t.getDropOperation?t.getDropOperation(e,r):r[0]),{ref:h}=t;b(()=>{if(!n&&h.current)return vt({element:h.current,getDropOperation:m,onDropEnter(e){i(!0),p(e)},onDropExit(e){i(!1),u(e)},onDrop:f,onDropActivate:g})},[n,h]);let{dropProps:y}=Ct();return n?{dropProps:{},dropButtonProps:{isDisabled:!0},isDropTarget:!1}:{dropProps:{...!r&&y,onDragEnter:e=>{if(e.preventDefault(),e.stopPropagation(),a.dragOverElements.add(l(e)),a.dragOverElements.size>1)return;let r=jt(e),n=At(r),o=n[0];if("function"==typeof t.getDropOperation){let i=new nt(e.dataTransfer);o=Rt(r,t.getDropOperation(i,n))}if("function"==typeof t.getDropOperationForPoint){let i=new nt(e.dataTransfer),a=e.currentTarget.getBoundingClientRect();o=Rt(r,t.getDropOperationForPoint(i,n,e.clientX-a.x,e.clientY-a.y))}a.x=e.clientX,a.y=e.clientY,a.allowedOperations=r,a.dropEffect=qe[o]||"none",e.dataTransfer.dropEffect=a.dropEffect,"cancel"!==o&&d(e)},onDragOver:e=>{e.preventDefault(),e.stopPropagation();let r=jt(e);if(e.clientX===a.x&&e.clientY===a.y&&r===a.allowedOperations)return void(e.dataTransfer.dropEffect=a.dropEffect);a.x=e.clientX,a.y=e.clientY;let n=a.dropEffect;if(r!==a.allowedOperations){let n=At(r),o=n[0];if("function"==typeof t.getDropOperation){let i=new nt(e.dataTransfer);o=Rt(r,t.getDropOperation(i,n))}a.dropEffect=qe[o]||"none"}if("function"==typeof t.getDropOperationForPoint){let n=new nt(e.dataTransfer),o=e.currentTarget.getBoundingClientRect(),i=Rt(r,t.getDropOperationForPoint(n,At(r),a.x-o.x,a.y-o.y));a.dropEffect=qe[i]||"none"}if(a.allowedOperations=r,e.dataTransfer.dropEffect=a.dropEffect,"none"===a.dropEffect&&"none"!==n?c(e):"none"!==a.dropEffect&&"none"===n&&d(e),"function"==typeof t.onDropMove&&"none"!==a.dropEffect){let r=e.currentTarget.getBoundingClientRect();t.onDropMove({type:"dropmove",x:a.x-r.x,y:a.y-r.y})}if(clearTimeout(a.dropActivateTimer),t.onDropActivate&&"function"==typeof t.onDropActivate&&"none"!==a.dropEffect){let r=t.onDropActivate,n=e.currentTarget.getBoundingClientRect();a.dropActivateTimer=setTimeout(()=>{r({type:"dropactivate",x:a.x-n.x,y:a.y-n.y})},800)}},onDragLeave:e=>{e.preventDefault(),e.stopPropagation();let t=l(e);if(a.dragOverElements.delete(t),t===e.currentTarget)for(let r of a.dragOverElements)s(e.currentTarget,r)||a.dragOverElements.delete(r);a.dragOverElements.size>0||("none"!==a.dropEffect&&c(e),clearTimeout(a.dropActivateTimer))},onDrop:e=>{if(e.preventDefault(),e.stopPropagation(),ut(a.dropEffect),"function"==typeof t.onDrop){let r=He[a.dropEffect],n=function(e){let t=[];if(!e)return t;let r=!1;if(e.types.includes(We))try{let n=e.getData(We),o=JSON.parse(n);for(let e of o)t.push({kind:"text",types:new Set(Object.keys(e)),getText:t=>Promise.resolve(e[t])});r=!0}catch{}if(!r){let r=new Map;for(let n of e.items)if("string"===n.kind)r.set(n.type||_e,e.getData(n.type));else if("file"===n.kind)if("function"==typeof n.webkitGetAsEntry){let e=n.webkitGetAsEntry();if(!e)continue;e.isFile?t.push(ot(n.getAsFile())):e.isDirectory&&t.push(it(e))}else t.push(ot(n.getAsFile()));r.size>0&&t.push({kind:"text",types:new Set(r.keys()),getText:e=>Promise.resolve(r.get(e))})}return t}(e.dataTransfer),o=e.currentTarget.getBoundingClientRect(),i={type:"drop",x:e.clientX-o.x,y:e.clientY-o.y,items:n,dropOperation:r};t.onDrop(i)}let r={...lt};a.dragOverElements.clear(),c(e),clearTimeout(a.dropActivateTimer),null==r.draggingCollectionRef?ut(void 0):function(e){lt=e}(r)}},dropButtonProps:{...r&&y},isDropTarget:o}}function jt(e){let t=Xe[e.dataTransfer.effectAllowed];gt&&(t&=gt);let r=Ve.none;return w()?(e.altKey&&(r|=Ve.copy),e.ctrlKey&&!x()&&(r|=Ve.link),e.metaKey&&(r|=Ve.move)):(e.altKey&&(r|=Ve.link),e.shiftKey&&(r|=Ve.move),e.ctrlKey&&(r|=Ve.copy)),r?t&r:t}function At(e){let t=[];return e&Ve.move&&t.push("move"),e&Ve.copy&&t.push("copy"),e&Ve.link&&t.push("link"),t}function Rt(e,t){return e&Ve[t]?t:"cancel"}function Mt(e,t,r){let{draggingCollectionRef:n}=lt;t.draggingKeys.size>0&&n?.current!==r.current&&function(e){lt.draggingCollectionRef=e}(r)}function Bt(e,t,r,n=!1,o=null){if(!r)return{type:"root"};if("root"===r.type){let t=e.getFirstKey?.()??null;return null!=t?{type:"item",key:t,dropPosition:"before"}:null}if("item"===r.type){let n=null;n=o?"right"===o?e.getKeyRightOf?.(r.key,{includeDisabled:!0}):e.getKeyLeftOf?.(r.key,{includeDisabled:!0}):e.getKeyBelow?.(r.key,{includeDisabled:!0});let i=$t(t,r.key,e=>t.getKeyAfter(e));if(null!=n&&n!==i)return{type:"item",key:n,dropPosition:r.dropPosition};switch(r.dropPosition){case"before":return{type:"item",key:r.key,dropPosition:"on"};case"on":{let e=t.getItem(r.key),o=null!=n?t.getItem(n):null;return e&&o&&o.level>=e.level?{type:"item",key:o.key,dropPosition:"before"}:{type:"item",key:r.key,dropPosition:"after"}}case"after":{let e=t.getItem(r.key),n=null!=e?.nextKey?t.getItem(e.nextKey):null;for(;null!=n&&"item"!==n.type;)n=null!=n.nextKey?t.getItem(n.nextKey):null;if(e&&null==n&&null!=e.parentKey){let r=t.getItem(e.parentKey);const n=null!=r?.nextKey?t.getItem(r.nextKey):null;if("item"===n?.type)return{type:"item",key:n.key,dropPosition:"before"};if("item"===r?.type)return{type:"item",key:r.key,dropPosition:"after"}}if(n)return{type:"item",key:n.key,dropPosition:"on"}}}}return n?{type:"root"}:null}function Lt(e,t,r,n=!1,o=null){if(!r||n&&"root"===r.type){let r=null,n=e.getLastKey?.();for(;null!=n;){let e=t.getItem(n);if("item"!==e?.type)break;r=n,n=e?.parentKey}return null!=r?{type:"item",key:r,dropPosition:"after"}:null}if("item"===r.type){let n=null;n=o?"left"===o?e.getKeyLeftOf?.(r.key,{includeDisabled:!0}):e.getKeyRightOf?.(r.key,{includeDisabled:!0}):e.getKeyAbove?.(r.key,{includeDisabled:!0});let i=$t(t,r.key,e=>t.getKeyBefore(e));if(null!=n&&n!==i)return{type:"item",key:n,dropPosition:r.dropPosition};switch(r.dropPosition){case"before":{let e=t.getItem(r.key);if(e&&null!=e.prevKey){let r=Ft(t,e.prevKey);if(r)return r}return null!=n?{type:"item",key:n,dropPosition:"on"}:{type:"root"}}case"on":return{type:"item",key:r.key,dropPosition:"before"};case"after":{let e=Ft(t,r.key);return e||{type:"item",key:r.key,dropPosition:"on"}}}}return"root"!==r.type?{type:"root"}:null}function Ft(e,t){let r=e.getItem(t),n=$t(e,t,t=>e.getKeyAfter(t)),o=null!=n?e.getItem(n):null;if(r&&o&&o.level>r.level){let t=null;if("lastChildKey"in r)for(t=null!=r.lastChildKey?e.getItem(r.lastChildKey):null;t&&"item"!==t.type&&null!=t.prevKey;)t=e.getItem(t.prevKey);else t=Array.from(r.childNodes).findLast(e=>"item"===e.type)||null;if(t)return{type:"item",key:t.key,dropPosition:"after"}}return null}function $t(e,t,r){let n=r(t),o=null!=n?e.getItem(n):null;for(;o&&"item"!==o.type;)n=r(o.key),o=null!=n?e.getItem(n):null;return n}function zt(t,r,n){let o=e.useRef({props:t,state:r,nextTarget:null,dropOperation:null}).current;o.props=t,o.state=r;let i=e.useCallback(async e=>{let{onInsert:t,onRootDrop:r,onItemDrop:i,onReorder:a,onMove:s,acceptedDragTypes:l="all",shouldAcceptItemDrop:d}=o.props,{draggingKeys:c}=lt,p=pt(n),{target:u,dropOperation:g,items:f}=e,m=f;("all"!==l||d)&&(m=f.filter(e=>{let t;return t="directory"===e.kind?new Set([Qe]):"file"===e.kind?new Set([e.type]):e.types,!("all"!==l&&!l.some(e=>t.has(e)))&&("item"!==u.type||"on"!==u.dropPosition||!d||d(u,t))})),m.length>0&&("root"===u.type&&r&&await r({items:m,dropOperation:g}),"item"===u.type&&("on"===u.dropPosition&&i&&await i({items:m,dropOperation:g,isInternal:p,target:u}),s&&p&&await s({keys:c,dropOperation:g,target:u}),"on"!==u.dropPosition&&(!p&&t&&await t({items:m,dropOperation:g,target:u}),p&&a&&await a({keys:c,dropOperation:g,target:u}))))},[o,n]),a=function(t){let r=e.useRef(null),n=e.useRef(!0),o=e.useRef(!0);e.useEffect(()=>{if(t.current){r.current=T(t.current)?t.current:k(t.current);let e=window.getComputedStyle(r.current);n.current=/(auto|scroll)/.test(e.overflowX),o.current=/(auto|scroll)/.test(e.overflowY)}},[t]);let i=e.useRef({timer:void 0,dx:0,dy:0}).current;e.useEffect(()=>()=>{i.timer&&(cancelAnimationFrame(i.timer),i.timer=void 0)},[i]);let a=e.useCallback(()=>{n.current&&r.current&&(r.current.scrollLeft+=i.dx),o.current&&r.current&&(r.current.scrollTop+=i.dy),i.timer&&(i.timer=requestAnimationFrame(a))},[r,i]);return{move(e,t){if(!D()||y()||!r.current)return;let n=r.current.getBoundingClientRect(),o=n.height-20,s=n.width-20;e<20||e>s||t<20||t>o?(e<20?i.dx=e-20:e>s&&(i.dx=e-s),t<20?i.dy=t-20:t>o&&(i.dy=t-o),i.timer||(i.timer=requestAnimationFrame(a))):this.stop()},stop(){i.timer&&(cancelAnimationFrame(i.timer),i.timer=void 0)}}}(n),{dropProps:s}=It({ref:n,onDropEnter(){null!=o.nextTarget&&r.setTarget(o.nextTarget)},onDropMove(e){null!=o.nextTarget&&r.setTarget(o.nextTarget),a.move(e.x,e.y)},getDropOperationForPoint(e,i,a,s){let{draggingKeys:l,dropCollectionRef:d}=lt,c=pt(n),p=t.dropTargetDelegate.getDropTargetFromPoint(a,s,t=>"cancel"!==r.getDropOperation({target:t,types:e,allowedOperations:i,isInternal:c,draggingKeys:l}));if(!p)return o.dropOperation="cancel",o.nextTarget=null,"cancel";if(o.dropOperation=r.getDropOperation({target:p,types:e,allowedOperations:i,isInternal:c,draggingKeys:l}),"cancel"===o.dropOperation){let t={type:"root"},n=r.getDropOperation({target:t,types:e,allowedOperations:i,isInternal:c,draggingKeys:l});"cancel"!==n&&(p=t,o.dropOperation=n)}return p&&"cancel"!==o.dropOperation&&n?.current!==d?.current&&dt(n),o.nextTarget="cancel"===o.dropOperation?null:p,o.dropOperation},onDropExit(){dt(void 0),r.setTarget(null),a.stop()},onDropActivate(e){"item"===r.target?.type&&"function"==typeof t.onDropActivate&&t.onDropActivate({type:"dropactivate",x:e.x,y:e.y,target:r.target})},onDrop(e){dt(n),r.target&&c(e,r.target);let{draggingCollectionRef:t}=lt;null==t&&ct()}}),l=e.useRef(null),d=e.useCallback(()=>{let{state:e}=o;if(l.current){let{target:t,collection:r,selectedKeys:n,focusedKey:o,isInternal:i,draggingKeys:a}=l.current;if(e.collection.size>r.size&&e.selectionManager.isSelectionEqual(n)){let t=new Set,n=e.collection.getFirstKey();for(;null!=n;){let o=e.collection.getItem(n);"item"!==o?.type||r.getItem(o.key)||t.add(o.key),n=o?.hasChildNodes&&"item"===e.collection.getItem(o.lastChildKey)?.type?o.firstChildKey:e.collection.getKeyAfter(n)}if(e.selectionManager.setSelectedKeys(t),e.selectionManager.focusedKey===o){let r=t.keys().next().value;if(null!=r){let t=e.collection.getItem(r),n=l.current.target,o=!!e.collection.expandedKeys&&e.collection.expandedKeys.has(t?.parentKey);t&&("cell"===t?.type||"item"===n.type&&"on"===n.dropPosition&&!o)&&(r=t.parentKey),null!=r&&e.selectionManager.setFocusedKey(r),"none"===e.selectionManager.selectionMode&&E("keyboard")}}}else null!=o&&e.selectionManager.focusedKey===o&&i&&"item"===t.type&&"on"!==t.dropPosition&&a.has(e.collection.getItem(o)?.parentKey)?(e.selectionManager.setFocusedKey(e.collection.getItem(o)?.parentKey??null),E("keyboard")):e.selectionManager.focusedKey===o&&"item"===t.type&&"on"===t.dropPosition&&null!=e.collection.getItem(t.key)?(e.selectionManager.setFocusedKey(t.key),E("keyboard")):null==e.selectionManager.focusedKey||e.selectionManager.isSelected(e.selectionManager.focusedKey)||E("keyboard");e.selectionManager.setFocused(!0)}},[o]),c=e.useCallback((e,t)=>{let{state:r}=o;l.current={timeout:void 0,focusedKey:r.selectionManager.focusedKey,collection:r.collection,selectedKeys:r.selectionManager.selectedKeys,draggingKeys:lt.draggingKeys,isInternal:pt(n),target:t},(o.props.onDrop||i)({type:"drop",x:e.x,y:e.y,target:t,items:e.items,dropOperation:e.dropOperation}),l.current.timeout=setTimeout(()=>{d(),l.current=null},50)},[o,i,n,d]);e.useEffect(()=>()=>{l.current&&clearTimeout(l.current.timeout)},[]),b(()=>{l.current&&r.collection!==l.current.collection&&d()});let{direction:p}=P();e.useEffect(()=>{if(!n.current)return;let e=(e,t=!0,r="down")=>function(e,t,r,n,o=!1,i=!1){switch(n){case"left":return o?Bt(e,t,r,i,"left"):Lt(e,t,r,i,"left");case"right":return o?Lt(e,t,r,i,"right"):Bt(e,t,r,i,"right");case"up":return Lt(e,t,r,i);case"down":return Bt(e,t,r,i)}}(o.props.keyboardDelegate,o.state.collection,e,r,"rtl"===p,t),t=(t,r=!0)=>e(t,r,"up"),r=(e,t,r,i,a=!0)=>{let s,l=0,{draggingKeys:d}=lt,c=pt(n);do{let n=i(e,a);if(!n)return null;e=n,s=o.state.getDropOperation({target:n,types:t,allowedOperations:r,isInternal:c,draggingKeys:d}),"root"===e.type&&l++}while("cancel"===s&&!o.state.isDropTarget(e)&&l<2);return"cancel"===s?null:e};return vt({element:n.current,preventFocusOnDrop:!0,getDropOperation(t,i){if(o.state.target){let{draggingKeys:e}=lt,r=pt(n);return o.state.getDropOperation({target:o.state.target,types:t,allowedOperations:i,isInternal:r,draggingKeys:e})}return r(null,t,i,e)?"move":"cancel"},onDropEnter(i,a){let s=Ze(a.items),l=o.state.selectionManager,d=null;dt(n);let c=l.focusedKey,p="after",u=null!=c?o.state.collection.getItem(c):null;if("cell"===u?.type&&(c=u.parentKey),null!=c&&l.isSelected(c)&&(l.selectedKeys.size>1&&l.firstSelectedKey===c?p="before":c=l.lastSelectedKey),null!=c){d={type:"item",key:c,dropPosition:p};let{draggingKeys:i}=lt,l=pt(n);"cancel"===o.state.getDropOperation({target:d,types:s,allowedOperations:a.allowedDropOperations,isInternal:l,draggingKeys:i})&&(d=r(d,s,a.allowedDropOperations,e,!1)??r(d,s,a.allowedDropOperations,t,!1))}d||(d=r(null,s,a.allowedDropOperations,e)),o.state.setTarget(d)},onDropExit(){dt(void 0),o.state.setTarget(null)},onDropTargetEnter(e){o.state.setTarget(e)},onDropActivate(e,t){"item"===t?.type&&"on"===t?.dropPosition&&"function"==typeof o.props.onDropActivate&&o.props.onDropActivate({type:"dropactivate",x:e.x,y:e.y,target:t})},onDrop(e,t){dt(n),o.state.target&&c(e,t||o.state.target)},onKeyDown(i,a){let{keyboardDelegate:s}=o.props,l=Ze(a.items);switch(i.key){case"ArrowDown":if(s.getKeyBelow){let t=r(o.state.target,l,a.allowedDropOperations,(t,r)=>e(t,r,"down"));o.state.setTarget(t)}break;case"ArrowUp":if(s.getKeyAbove){let t=r(o.state.target,l,a.allowedDropOperations,(t,r)=>e(t,r,"up"));o.state.setTarget(t)}break;case"ArrowLeft":if(s.getKeyLeftOf){let t=r(o.state.target,l,a.allowedDropOperations,(t,r)=>e(t,r,"left"));o.state.setTarget(t)}break;case"ArrowRight":if(s.getKeyRightOf){let t=r(o.state.target,l,a.allowedDropOperations,(t,r)=>e(t,r,"right"));o.state.setTarget(t)}break;case"Home":if(s.getFirstKey){let t=r(null,l,a.allowedDropOperations,e);o.state.setTarget(t)}break;case"End":if(s.getLastKey){let e=r(null,l,a.allowedDropOperations,t);o.state.setTarget(e)}break;case"PageDown":if(s.getKeyPageBelow){let i=o.state.target;if(i){let d=s.getFirstKey?.();"item"===i.type&&(d=i.key);let c=null;null!=d&&(c=s.getKeyPageBelow(d));let p="item"===i.type?i.dropPosition:"after";if((null==c||"item"===i.type&&i.key===s.getLastKey?.())&&(c=s.getLastKey?.()??null,p="after"),null==c)break;i={type:"item",key:c,dropPosition:p};let{draggingCollectionRef:u,draggingKeys:g}=lt,f=u?.current===n?.current;"cancel"===o.state.getDropOperation({target:i,types:l,allowedOperations:a.allowedDropOperations,isInternal:f,draggingKeys:g})&&(i=r(i,l,a.allowedDropOperations,e,!1)??r(i,l,a.allowedDropOperations,t,!1))}else i=r(null,l,a.allowedDropOperations,e);o.state.setTarget(i??o.state.target)}break;case"PageUp":{if(!s.getKeyPageAbove)break;let i=o.state.target;if(i){if("item"===i.type){if(i.key===s.getFirstKey?.())i={type:"root"};else{let e=s.getKeyPageAbove(i.key),t=i.dropPosition;if(null==e&&(e=s.getFirstKey?.(),t="before"),null==e)break;i={type:"item",key:e,dropPosition:t}}let{draggingKeys:d}=lt,c=pt(n);"cancel"===o.state.getDropOperation({target:i,types:l,allowedOperations:a.allowedDropOperations,isInternal:c,draggingKeys:d})&&(i=r(i,l,a.allowedDropOperations,t,!1)??r(i,l,a.allowedDropOperations,e,!1))}}else i=r(null,l,a.allowedDropOperations,t);o.state.setTarget(i??o.state.target);break}}o.props.onKeyDown?.(i)}})},[o,n,c,p]);let u=K();return Ge.set(r,{id:u,ref:n}),{collectionProps:O(s,{id:u,"aria-describedby":null})}}function Nt(t,r,n){let{dropProps:o}=Ct(),i=function(e){let{ref:t}=Ge.get(e)||{};if(!t)throw new Error("Droppable item outside a droppable collection");return t}(r);e.useEffect(()=>{if(n.current)return e={element:n.current,target:t.target,getDropOperation(e,n){let{draggingKeys:o}=lt,a=pt(i);return r.getDropOperation({target:t.target,types:e,allowedOperations:n,isInternal:a,draggingKeys:o})},activateButtonRef:t.activateButtonRef},ht.set(e.element,e),()=>{ht.delete(e.element)};var e},[n,t.target,r,i,t.activateButtonRef]);let a=bt(),{draggingKeys:s}=lt,l=pt(i),d=a&&"cancel"!==r.getDropOperation({target:t.target,types:Ze(a.dragTarget.items),allowedOperations:a.dragTarget.allowedDropOperations,isInternal:l,draggingKeys:s}),c=r.isDropTarget(t.target);return e.useEffect(()=>{a&&c&&n.current&&n.current.focus()},[c,a,n]),{dropProps:{...o,"aria-hidden":!a||d?void 0:"true"},isDropTarget:c}}function Vt(e,t,r){let{target:n}=e,{collection:o}=t,i=f((a=Pt)&&a.__esModule?a.default:a,"@react-aria/dnd");var a;let s,l=bt(),{dropProps:d}=Nt(e,t,r),c=K(),p=e=>null==e?"":o.getTextValue?.(e)??o.getItem(e)?.textValue??"",u="";if("root"===n.type)u=i.format("dropOnRoot"),s=`${c} ${function(e){let{id:t}=Ge.get(e)||{};if(!t)throw new Error("Droppable item outside a droppable collection");return t}(t)}`;else if("on"===n.dropPosition)u=i.format("dropOnItem",{itemText:p(n.key)});else{let e,t;if("before"===n.dropPosition){let t=o.getItem(n.key)?.prevKey,r=null!=t?o.getItem(t):null;e="item"===r?.type?r.key:null}else e=n.key;if("after"===n.dropPosition){let e=o.getItem(n.key)?.nextKey,r=null!=e?o.getItem(e):null;t="item"===r?.type?r.key:null}else t=n.key;null!=e&&null!=t?u=i.format("insertBetween",{beforeItemText:p(e),afterItemText:p(t)}):null!=e?u=i.format("insertAfter",{itemText:p(e)}):null!=t&&(u=i.format("insertBefore",{itemText:p(t)}))}let g=t.isDropTarget(n),m=l?d["aria-hidden"]:"true";return{dropIndicatorProps:{...d,id:c,"aria-roledescription":i.format("dropIndicator"),"aria-label":u,"aria-labelledby":s,"aria-hidden":m,tabIndex:-1},isDropTarget:g,isHidden:!g&&!!m}}const Xt={keyboard:{selected:"dragSelectedKeyboard",notSelected:"dragDescriptionKeyboard"},touch:{selected:"dragSelectedLongPress",notSelected:"dragDescriptionLongPress"},virtual:{selected:"dragDescriptionVirtual",notSelected:"dragDescriptionVirtual"}};function Yt(e,t){let r=f((n=Pt)&&n.__esModule?n.default:n,"@react-aria/dnd");var n;let o,i,a=t.isDisabled||t.selectionManager.isDisabled(e.key),{dragProps:s,dragButtonProps:l}=Ot({getItems:()=>t.getItems(e.key),preview:t.preview,getAllowedDropOperations:t.getAllowedDropOperations,hasDragButton:e.hasDragButton,onDragStart(r){var n;t.startDrag(e.key,r),n=t.draggingKeys,lt.draggingKeys=n},onDragMove(e){t.moveDrag(e)},onDragEnd(e){let{dropOperation:r}=e,n="cancel"!==r&&pt();t.endDrag({...e,keys:t.draggingKeys,isInternal:n}),ct()}}),d=t.collection.getItem(e.key),c=t.getKeysForDrag(e.key).size,p=c>1&&t.selectionManager.isSelected(e.key),u=tt();if(e.hasDragButton||"none"===t.selectionManager.selectionMode)if(p)o=r.format("dragSelectedItems",{count:c});else{let n=t.collection.getTextValue?.(e.key)??d?.textValue??"";o=r.format("dragItem",{itemText:n})}else{let t=Xt[u][p?"selected":"notSelected"];e.hasAction&&"keyboard"===u&&(t+="Alt"),i=p?r.format(t,{count:c}):r.format(t),delete s.onClick}let g=h(i);if(i&&Object.assign(s,g),!e.hasDragButton&&e.hasAction){let{onKeyDownCapture:e,onKeyUpCapture:t}=s;"touch"===u&&delete s["aria-describedby"],s.onKeyDownCapture=t=>{t.altKey&&e?.(t)},s.onKeyUpCapture=e=>{e.altKey&&t?.(e)}}return{dragProps:a?{}:s,dragButtonProps:{...l,isDisabled:a,"aria-label":o}}}const Ht=t.forwardRef(function(n,o){let i=n.children,[a,s]=e.useState(null),l=e.useRef(null),d=e.useRef(void 0);return e.useImperativeHandle(o,()=>(e,t)=>{let n,o,a,c=i(e);c&&"object"==typeof c&&"element"in c?(n=c.element,o=c.x,a=c.y):n=c,r.flushSync(()=>{s(n)}),t(l.current,o,a),d.current=requestAnimationFrame(()=>{s(null)})},[i]),e.useEffect(()=>()=>{d.current&&cancelAnimationFrame(d.current)},[]),a?t.createElement("div",{style:{zIndex:-100,position:"fixed",top:0,left:-1e5},ref:l},a):null});class qt{constructor(e,t,r){this.collection=e,this.ref=t,this.layout=r?.layout||"stack",this.orientation=r?.orientation||"vertical",this.direction=r?.direction||"ltr"}getPrimaryStart(e){return"horizontal"===this.orientation?e.left:e.top}getPrimaryEnd(e){return"horizontal"===this.orientation?e.right:e.bottom}getSecondaryStart(e){return"horizontal"===this.orientation?e.top:e.left}getSecondaryEnd(e){return"horizontal"===this.orientation?e.bottom:e.right}getFlowStart(e){return"stack"===this.layout?this.getPrimaryStart(e):this.getSecondaryStart(e)}getFlowEnd(e){return"stack"===this.layout?this.getPrimaryEnd(e):this.getSecondaryEnd(e)}getFlowSize(e){return this.getFlowEnd(e)-this.getFlowStart(e)}getDropTargetFromPoint(e,t,r){if(this.collection[Symbol.iterator]().next().done||!this.ref.current)return{type:"root"};let n=this.ref.current.getBoundingClientRect(),o="horizontal"===this.orientation?e:t,i="horizontal"===this.orientation?t:e;o+=this.getPrimaryStart(n),i+=this.getSecondaryStart(n);let a="stack"===this.layout?o:i,s="horizontal"===this.orientation&&"rtl"===this.direction,l="grid"===this.layout&&"vertical"===this.orientation&&"rtl"===this.direction,d="stack"===this.layout?s:l,c=this.ref.current?.dataset.collection,p=this.ref.current.querySelectorAll(c?`[data-collection="${CSS.escape(c)}"]`:"[data-key]"),u=new Map;for(let D of p)D instanceof HTMLElement&&null!=D.dataset.key&&u.set(D.dataset.key,D);let g=[...this.collection].filter(e=>"item"===e.type);if(g.length<1)return{type:"root"};let f=0,m=g.length;for(;f{t?f=e+1:m=e};if(othis.getPrimaryEnd(c))p(!s);else if(ithis.getSecondaryEnd(c))){let e={type:"item",key:t.key,dropPosition:"on"};if(r(e))a<=this.getFlowStart(c)+5&&r({...e,dropPosition:"before"})?e.dropPosition=d?"after":"before":a>=this.getFlowEnd(c)-5&&r({...e,dropPosition:"after"})&&(e.dropPosition=d?"before":"after");else{let t=this.getFlowStart(c)+this.getFlowSize(c)/2;a<=t&&r({...e,dropPosition:"before"})?e.dropPosition=d?"after":"before":a>=t&&r({...e,dropPosition:"after"})&&(e.dropPosition=d?"before":"after")}return e}p(!l)}}let h=g[Math.min(f,g.length-1)],y=u.get(String(h.key));return n=y?.getBoundingClientRect(),n&&(o{let{onDrop:r,onInsert:n,onItemDrop:o,onReorder:i,onMove:a,onRootDrop:s,getItems:l,renderDragPreview:d,renderDropIndicator:c,dropTargetDelegate:p}=t,u=!!(r||n||o||i||a||s),g={};return!!l&&(g.useDraggableCollectionState=function(r){return function(t){let{getItems:r,isDisabled:n,collection:o,selectionManager:i,onDragStart:a,onDragMove:s,onDragEnd:l,preview:d,getAllowedDropOperations:c}=t,[,p]=e.useState(!1),u=e.useRef(new Set),g=e.useRef(null),f=e=>{let t=new Set;if(i.isSelected(e))for(let r of i.selectedKeys){let e=o.getItem(r);if(e){let n=!1,a=e.parentKey;for(;null!=a;){if(i.selectedKeys.has(a)){n=!0;break}let e=o.getItem(a);a=e?e.parentKey:null}n||t.add(r)}}else t.add(e);return t};return{collection:o,selectionManager:i,get draggedKey(){return g.current},get draggingKeys(){return u.current},isDragging:e=>u.current.has(e),getKeysForDrag:f,getItems(e){let t=f(e),n=[];for(let r of t){let e=o.getItem(r)?.value;null!=e&&n.push(e)}return r(f(e),n)},isDisabled:n,preview:d,getAllowedDropOperations:c,startDrag(e,t){let r=f(e);u.current=r,g.current=e,i.setFocused(!1),p(!0),"function"==typeof a&&a({...t,keys:r})},moveDrag(e){"function"==typeof s&&s({...e,keys:u.current})},endDrag(e){let{isInternal:t}=e;"function"==typeof l&&l({...e,keys:u.current,isInternal:t}),u.current=new Set,g.current=null,p(!1)}}}({...r,...t})},g.useDraggableCollection=Mt,g.useDraggableItem=Yt,g.DragPreview=Ht,g.renderDragPreview=d,g.isVirtualDragging=wt),u&&(g.useDroppableCollectionState=function(r){return function(t){let{acceptedDragTypes:r="all",isDisabled:n,onInsert:o,onRootDrop:i,onItemDrop:a,onReorder:s,onMove:l,shouldAcceptItemDrop:d,collection:c,selectionManager:p,onDropEnter:u,getDropOperation:g,onDrop:f}=t,[m,h]=e.useState(null),y=e.useRef(null),D=e=>{if("before"===e.dropPosition){let t=c.getItem(e.key);return t&&null!=t.prevKey?{type:"item",key:t.prevKey,dropPosition:"after"}:null}if("after"===e.dropPosition){let t=c.getItem(e.key);return t&&null!=t.nextKey?{type:"item",key:t.nextKey,dropPosition:"before"}:null}return null},v=e.useCallback(e=>{let{target:t,types:p,allowedOperations:u,isInternal:m,draggingKeys:h}=e;if(n||!t)return"cancel";if("all"===r||r.some(e=>p.has(e))){let e=o&&"item"===t.type&&!m&&("before"===t.dropPosition||"after"===t.dropPosition),r=s&&"item"===t.type&&m&&("before"===t.dropPosition||"after"===t.dropPosition)&&function(e,t,r){let n=e.getItem(t.key);for(let o of r){let t=e.getItem(o);if(t?.parentKey!==n?.parentKey)return!1}return!0}(c,t,h),n="item"!==t.type||"on"!==t.dropPosition||!d||d(t,p),y=l&&"item"===t.type&&m&&n,D=i&&"root"===t.type&&!m,v=a&&"item"===t.type&&"on"===t.dropPosition&&!(m&&null!=t.key&&h.has(t.key))&&n;if(f||e||r||y||D||v)return g?g(t,p,u):u[0]}return"cancel"},[n,c,r,g,o,i,a,d,s,l,f]);return{collection:c,selectionManager:p,isDisabled:n,target:m,setTarget(e){if(this.isDropTarget(e))return;let r=y.current;r&&"function"==typeof t.onDropExit&&t.onDropExit({type:"dropexit",x:0,y:0,target:r}),e&&"function"==typeof u&&u({type:"dropenter",x:0,y:0,target:e}),y.current=e??null,h(e??null)},isDropTarget(e){let t=y.current;return!(!t||!e)&&(!!Ut(e,t)||"item"===e?.type&&"item"===t?.type&&e.key!==t.key&&e.dropPosition!==t.dropPosition&&"on"!==e.dropPosition&&"on"!==t.dropPosition&&(Ut(D(e),t)||Ut(e,D(t))))},getDropOperation(e){let{target:t,isInternal:r,draggingKeys:n}=e;if(r&&"item"===t.type&&n.size>0){if(n.has(t.key)&&"on"===t.dropPosition)return"cancel";let e=t.key;for(;null!=e;){let t=c.getItem(e),r=t?.parentKey;if(null!=r&&n.has(r))return"cancel";e=r??null}}return v(e)}}}({...r,...t})},g.useDroppableItem=Nt,g.useDroppableCollection=function(e,r,n){return zt({...e,...t},r,n)},g.useDropIndicator=Vt,g.renderDropIndicator=c,g.dropTargetDelegate=p,g.ListDropTargetDelegate=qt),g},[t])}}function Wt({className:e,...t}){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:20,height:20,viewBox:"0 0 12 12","aria-hidden":"true",focusable:"false",className:S("rp-icon",e),...t,children:[1.6,6,10.4].flatMap(e=>[3.8,8.2].map(t=>n.jsx("circle",{cx:t,cy:e,r:1.1,fill:"currentColor"},`${t}-${e}`)))})}const _t="application/x-doona-card",Gt={},Qt=new Map,Zt=new Set,er=e=>{if(Gt.card=e,Qt.clear(),void 0===e)for(const t of Zt)t()},tr=e=>[...document.querySelectorAll(".rp-dashboard-cell")].find(t=>t.dataset.instance===e);function rr(e){let t=[1,1];for(let r=1;r<=12;r++){const n=Math.round(e*r);n>0&&Math.abs(e-n/r){const e=t.current;if(!e)return;const r=()=>{const t=e.parentElement.getBoundingClientRect(),r=getComputedStyle(e),n=Number.parseFloat(r.getPropertyValue("--rp-dash-gap"))||0,o=function(e,t,r,n){const o=n?e.map(e=>({...e,left:t-e.right,right:t-e.left})):e,i=new Map;for(const a of o)i.set(Math.round(a.top),[...i.get(Math.round(a.top))??[],a]);return[...i.values()].flatMap(e=>{const i=e[0].top,a=Math.max(...e.map(e=>e.bottom)),s=Math.max(...e.map(e=>e.right))+r;let l=t;for(const t of o)!e.includes(t)&&t.topi+.5&&t.right>s&&(l=Math.min(l,t.left-r));return(l-s+r)/(t+r)<1/6-.01?[]:[{after:e.at(-1).id,left:n?t-l:s,top:i,width:l-s,height:a-i}]})}([...e.querySelectorAll(":scope > .rp-dashboard-cell")].map(e=>{const r=e.getBoundingClientRect();return{id:e.dataset.instance,left:r.left-t.left,right:r.right-t.left,top:r.top-t.top,bottom:r.bottom-t.top}}),t.width,n,"rtl"===r.direction).map(e=>({...e,share:rr((e.width+n)/(t.width+n))}));s(e=>JSON.stringify(e)===JSON.stringify(o)?e:o)};return r(),e.addEventListener("rp-packed",r),()=>e.removeEventListener("rp-packed",r)},[t]),a.map(e=>n.jsx(or,{section:t,gap:e,label:r(e.share),refusal:o,onPlace:i},e.after))}function or({section:t,gap:r,label:o,refusal:i,onPlace:a}){const s=e.useRef(null),[l,d]=e.useState(!1),c=(e=Gt.card)=>{const n=t.current;if(void 0===e||!n)return!1;const o=[e,r.after,r.width].join("\n");return Qt.has(o)||Qt.set(o,(function(e,t,r){const n=tr(t),o=tr(r);if(!n||o?.parentElement!==e)return;const i=document.createElement("div");i.className="rp-dashboard-cell",i.style.visibility="hidden";for(const d of["data-module","data-size","data-foot","data-width","data-height"]){const e=n.getAttribute(d);null!==e&&i.setAttribute(d,e)}const a=e.dataset.grid;i.dataset.width&&(e.dataset.grid="fraction");const s=n.parentElement===e;s&&n.classList.remove("rp-dashboard-cell"),o.after(i);const l=i.getBoundingClientRect().width;return i.remove(),s&&n.classList.add("rp-dashboard-cell"),void 0===a?delete e.dataset.grid:e.dataset.grid=a,l}(n,e,r.after)??1/0)<=r.width+1),Qt.get(o)},{dropProps:p,isDropTarget:u}=It({ref:s,getDropOperation:e=>e.has(_t)&&c()?"move":"cancel",onDrop:async e=>{for(const t of e.items){if("text"!==t.kind||!t.types.has(_t))continue;const e=await t.getText(_t);c(e)&&a(e,{target:r.after,after:!0})}}}),g={onDragEnter:()=>d(void 0!==Gt.card&&!c()),onDragLeave:()=>d(!1),onDrop:()=>d(!1)};return e.useEffect(()=>{const e=()=>d(!1);return Zt.add(e),()=>{Zt.delete(e)}},[]),n.jsxs("div",{...O(p,g),ref:s,className:"rp-dashboard-gap rp-label","data-drop-target":u||void 0,"data-refused":l||void 0,style:{left:r.left,top:r.top,width:r.width,height:r.height},children:[o,n.jsx(C,{children:n.jsx("span",{role:"status",children:l?i:""})})]})}const ir="application/x-doona-card",ar={current:null};function sr({label:t,profile:r,items:o,textValue:i,dragLabel:a,tools:s,resize:l,gapLabel:d,refusal:c,rearm:p,children:u,onPlace:g,...f}){const m=e.useRef(null);G(r?m:ar),e.useEffect(()=>{!p?.focus||document.activeElement&&document.activeElement!==document.body||m.current?.querySelector(`[data-key="${CSS.escape(p.focus)}"]`)?.focus()},[p]);const h=async e=>{for(const t of e.items)if("text"===t.kind&&t.types.has(ir))return t.getText(ir)},{dragAndDropHooks:y}=function(t){const{dragAndDropHooks:r}=Jt(t);return{dragAndDropHooks:e.useMemo(()=>function(e){const{useDraggableItem:t,isVirtualDragging:r}=e;return t&&r?{...e,useDraggableItem:(e,n)=>{const o=t(e,n),i=o.dragButtonProps.onPress;return{...o,dragButtonProps:{...o.dragButtonProps,onPress:e=>{r()||i?.(e)}}}}}:e}(r),[r])}}({getItems:e=>[...e].map(e=>({[ir]:String(e),"text/plain":i(o.find(t=>t.id===e))})),getAllowedDropOperations:()=>["move"],acceptedDragTypes:[ir],getDropOperation:()=>"move",onDragStart:e=>er(String([...e.keys][0])),onDragEnd:()=>{er(void 0),function(){const e=()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("mousedown",t,!0)},t=t=>{e();const{clientX:r,clientY:n,screenX:o,screenY:i,button:a,buttons:s,ctrlKey:l,shiftKey:d,altKey:c,metaKey:p}=t;t.target?.dispatchEvent(new PointerEvent("pointerdown",{bubbles:!0,cancelable:!0,composed:!0,pointerId:1,pointerType:"mouse",isPrimary:!0,clientX:r,clientY:n,screenX:o,screenY:i,button:a,buttons:s,ctrlKey:l,shiftKey:d,altKey:c,metaKey:p}))};document.addEventListener("pointerdown",e,!0),document.addEventListener("mousedown",t,!0)}()},renderDropIndicator:e=>n.jsx(Be,{target:e,className:"rp-canvas-drop"}),onReorder:e=>{for(const t of e.keys)g(String(t),{target:String(e.target.key),after:"after"===e.target.dropPosition})},onInsert:async e=>{const t=await h(e);t&&g(t,{target:String(e.target.key),after:"after"===e.target.dropPosition})},onRootDrop:async e=>{const t=await h(e);t&&g(t,{})}}),D=n.jsx(Re,{...f,ref:m,"aria-label":t,layout:"grid",className:r?"rp-dash-section":"rp-widget-grid rp-sortable-grid","data-profile":r,"data-grid":r?te(o):void 0,items:o,dragAndDropHooks:y,dependencies:[u,s,l],children:e=>n.jsxs(Me,{id:e.id,textValue:i(e),className:r?"rp-dashboard-cell":"rp-widget-cell rp-sortable-row",...r?Z(e):{"data-size":ee(e.size),"data-module":e.module},children:[n.jsxs("div",{className:"rp-dashboard-tools",children:[n.jsx(I,{slot:"drag",className:j({quiet:!0,icon:!0,small:!r}),"aria-label":a(e),children:n.jsx(Wt,{})}),s?.(e)]}),n.jsx(Q,{children:u(e)}),l?.(e)]})});return r?n.jsxs("div",{className:"rp-dashboard-canvas","data-rearm":p?"":void 0,children:[D,d&&n.jsx(nr,{section:m,label:d,refusal:c,onPlace:g})]}):D}function lr({id:t,label:r,added:o,addLabel:i,count:a,onAdd:s,presets:l,row:d,children:c}){const[p,u]=A(void 0,200),[g,f]=e.useState(!1);return u&&!g&&f(!0),n.jsxs("section",{ref:p,className:"rp-widget-gallery-tile","data-added":o||void 0,"data-module":t,"aria-label":r,children:[n.jsx("h3",{className:"rp-h3",children:r}),l&&d?n.jsx(dr,{presets:l,row:d,loaded:g,disabled:o}):n.jsx("div",{className:"rp-widget-gallery-frame",inert:!0,children:n.jsx(R,{value:!1,children:g&&c})}),n.jsxs("div",{className:"rp-cluster",children:[n.jsx(M,{isDisabled:o,label:`${i} ${r}`,onPress:s,children:i}),n.jsx("span",{className:"rp-label",children:a})]})]})}function dr({presets:e,row:t,loaded:r,disabled:o}){const[i,a]=B(Math.round),s=a?a.width/t.width:0;return n.jsx("div",{ref:i,className:"rp-widget-gallery-presets",style:{"--rp-preset-gap":t.gap*s+"px"},children:r&&s>0&&e.map(e=>n.jsx(cr,{preset:e,width:e.share*(t.width+t.gap)-t.gap,scale:s,disabled:o},e.key))})}function cr({preset:e,width:t,scale:r,disabled:o}){const[i,a]=B(Math.round);return n.jsxs("div",{className:"rp-widget-gallery-preset",style:{inlineSize:t*r},children:[n.jsxs("div",{className:"rp-widget-gallery-thumb",style:{blockSize:(a?.height??0)*r},children:[n.jsx("div",{ref:i,className:"rp-widget-gallery-thumb-card",style:{inlineSize:t,scale:String(r)},inert:!0,children:n.jsx(R,{value:!1,children:e.preview})}),n.jsx(I,{className:"rp-widget-gallery-thumb-add","aria-label":e.addLabel,isDisabled:o,onPress:e.onAdd})]}),n.jsx("span",{className:"rp-label",children:e.label})]})}function pr({label:e,children:t}){return n.jsxs("div",{className:"rp-module-option",children:[n.jsx("span",{className:"rp-label",children:e}),t]})}function ur(){const e=document.querySelector(".rp-dashboard-canvas"),t=e&&getComputedStyle(e.querySelector(".rp-dash-section")??e);return{width:e?.getBoundingClientRect().width||1152,gap:Number.parseFloat(t?.getPropertyValue("--rp-dash-gap")??"")||12,snap:Number.parseFloat(t?.getPropertyValue("--rp-dash-snap")??"")||12}}function gr({items:t,add:r,surface:o="panel"}){const i=L(),[a]=e.useState(ur);return Object.keys(re).filter(e=>"panel"===o||!ne(e)).map(e=>{const s=t.filter(t=>t.id===e).length,l=oe(ie()).find(t=>t.id===e)??ae(e),d=e=>{const t=we(e.width);return a.snap>=12?t:Math.ceil(t*a.snap-1e-6)/a.snap};return n.jsx(lr,{id:e,label:i(re[e].label),added:s>=me,addLabel:i("widgets.add"),count:i("widgets.placedCount",{n:s,max:me}),onAdd:()=>r(e),row:a,presets:"dashboard"===o?de(l,ce(l)).map(t=>{const o=pe(l,t),a=ue(t,i);return{key:a,label:a,addLabel:i("widgets.addPreset",{name:i(re[e].label),size:a}),share:d(t),onAdd:()=>r(e,t),preview:n.jsx(se,{id:e,children:n.jsx(F,{value:!0,children:n.jsx("div",{className:"rp-dashboard-cell",...Z(fe(o)),"data-tile":"tall"===o.height?"stacked":void 0,children:n.jsx(ge,{item:o,preview:!0})})})})}}):void 0,children:"panel"===o&&n.jsx(se,{id:e,children:n.jsx(le,{item:ae(e),preview:!0,sample:!0})})},e)})}const fr={area:"dashboard.form.area",sparkline:"dashboard.form.sparkline",donut:"dashboard.form.donut",waffle:"dashboard.form.waffle",dots:"dashboard.form.dots",ranked:"dashboard.form.ranked",kv:"dashboard.form.kv",facts:"dashboard.form.facts"},mr={small:"widgets.small",medium:"widgets.medium",large:"widgets.large",wide:"dashboard.wide"};function hr({active:e,items:t,sizes:r=[],surface:o,update:i,move:a,remove:s}){const l=L();if(!e)return n.jsx("p",{className:"rp-label",children:l("widgets.select")});const d=re[e.id].groupChoice;return n.jsxs(n.Fragment,{children:["dashboard"===o&&Object.values(he(e,ce(e),l)).map(e=>e&&n.jsx(pr,{label:e.label,children:n.jsx(Fe,{label:e.label,value:e.value,onChange:t=>i(e.set(t)),items:e.options.map(e=>[e.value,e.label])})},e.label)),r.length>1&&n.jsx(pr,{label:l("widgets.size"),children:n.jsx(Fe,{label:l("widgets.size"),value:e.size,onChange:t=>i({...e,size:t,form:"panel"===o&&"small"===t&&ye(e.id,o).includes("kv")?"kv":e.form}),items:r.map(e=>[e,l(mr[e])])})}),ye(e.id,o).length>1&&!("small"===e.size&&!e.width&&ye(e.id,o).includes("sparkline"))&&n.jsx(pr,{label:l("widgets.form"),children:n.jsx(Fe,{label:l("widgets.form"),value:ve(e,o),onChange:t=>i({...e,form:t,size:"large"!==e.size||De(e.id,t,o).includes("large")?e.size:"medium"}),items:ye(e.id,o).map(e=>[e,l(fr[e])])})}),"ranking"===e.id&&n.jsx(pr,{label:l("widgets.rankBy"),children:n.jsx(Fe,{label:l("widgets.rankBy"),value:e.by??"dev",onChange:t=>i({...e,by:"domain"===t?"domain":"dev"}),items:[["dev",l("act.devices")],["domain",l("act.domains")]]})}),"speed"===e.id&&"small"!==e.size&&"sparkline"===ve(e,o)&&n.jsx($,{isSelected:!e.split,onChange:t=>i({...e,split:!t||void 0}),children:l("widgets.combineRates")}),d&&n.jsx(yr,{item:e,automatic:d,update:i}),n.jsxs("div",{className:"rp-cluster rp-module-actions",children:[n.jsx(M,{isDisabled:be(t[0])===be(e),onPress:()=>a(-1),children:l("widgets.up")}),n.jsx(M,{isDisabled:be(t.at(-1))===be(e),onPress:()=>a(1),children:l("widgets.down")}),n.jsx(M,{negative:!0,onPress:s,children:l("widgets.remove")})]})]})}function yr({item:e,automatic:t,update:r}){const o=z(),i=$e(!0===o.data?.resources.groups.available),a=L(),s=a(t);return n.jsx(pr,{label:a("ui.group"),children:n.jsx(Ne,{label:a("ui.group"),value:e.group??"",items:[{id:"",label:s},...(i.data??[]).map(e=>({id:e.id,label:e.name}))],onChange:t=>r({...e,group:t}),children:i.data?.find(t=>t.id===e.group)?.name??s})})}function Dr(e,t,r){const n=oe(e).find(e=>be(e)===t);if(!n||r.target===t)return e;const o=e.sections.map(e=>({...e,items:e.items.filter(e=>be(e)!==t)})),i=o.find(e=>e.id===r.section);if(!i)return e;const a=void 0===r.target?-1:i.items.findIndex(e=>be(e)===r.target);return i.items.splice(a<0?i.items.length:a+(r.after?1:0),0,n),{...e,sections:o}}function vr({width:e,height:t}){return n.jsxs(n.Fragment,{children:[n.jsx(Er,{axis:e,edge:"width"}),t&&n.jsx(Er,{axis:t,edge:"height"})]})}const br=e=>{const[t,r=1]=e.split("/").map(Number);return t/r||0};function wr(e,t){const r=e.closest(".rp-dash-section"),n=getComputedStyle(r),o=getComputedStyle(e),i=Number.parseFloat(n.getPropertyValue("--rp-dash-snap"))||12,a=Number.parseFloat(n.getPropertyValue("--rp-dash-gap"))||0,s=r.getBoundingClientRect().width+Math.min(0,Number.parseFloat(n.marginInlineStart)||0),l=Number.parseFloat(o.getPropertyValue("--rp-span"))||420,d=br(o.getPropertyValue("--rp-shift"))-br(o.getPropertyValue("--rp-trim"));return t.map(t=>{if(void 0===t.fraction)return e.dataset.width?l/420*(s+a)-a+d*a:e.getBoundingClientRect().width;return(i>=12?t.fraction:Math.ceil(t.fraction*i-1e-6)/i)*(s+a)-a})}const xr=(e,t,r)=>t.reduce((n,o,i)=>{const a=Math.abs(o-r)-Math.abs(t[n]-r);return a<-.5||a<=.5&&void 0===e[n].fraction&&void 0!==e[i].fraction?i:n},0),Tr=new Map,kr=e=>e.target&&Tr.get(e.target)?.(e);function Er({axis:t,edge:r}){const o=e.useRef(null),i=e.useRef(null),{focusProps:a,isFocusVisible:s}=N(),l=()=>o.current.closest(".rp-dashboard-cell"),d=()=>"rtl"===getComputedStyle(o.current).direction,c=Math.max(0,t.options.findIndex(e=>e.value===t.value)),p=e=>{i.current&&(i.current.index=e),t.options[e].value!==t.value&&t.onChange(t.options[e])},{moveProps:u}=ze({onMoveStart:()=>{const e=l().getBoundingClientRect(),n=Number.parseFloat(getComputedStyle(l()).getPropertyValue("--rp-space-16"))||1,o="width"===r?wr(l(),t.options):[];i.current={start:c,size:"width"===r?e.width:e.height,travel:0,sizes:o,step:n,index:c},l().dataset.resizing=""},onMove:({deltaX:e,deltaY:n,pointerType:o})=>{const a=i.current;if(!a||"keyboard"===o)return;a.travel+="width"===r?e*(d()?-1:1):n;const s="width"===r?xr(t.options,a.sizes,a.size+a.travel):Math.max(0,Math.min(t.options.length-1,a.start+Math.round(a.travel/a.step)));s!==a.index&&p(s)},onMoveEnd:()=>{i.current=null,delete l().dataset.resizing}}),g=e.useRef(e=>{});return e.useLayoutEffect(()=>{g.current=e=>{const n="width"===r?d()?"ArrowLeft":"ArrowRight":"ArrowDown",o="width"===r?d()?"ArrowRight":"ArrowLeft":"ArrowUp";e.key!==n&&e.key!==o||(e.preventDefault(),e.stopPropagation(),p((e=>{if("width"===r&&void 0===t.options[c].fraction){if(!e)return c;const r=l().getBoundingClientRect().width,n=wr(l(),t.options).findIndex((e,n)=>void 0!==t.options[n].fraction&&e>r+1);return n<0?t.options.length-1:n}return Math.max(0,Math.min(t.options.length-1,c+(e?1:-1)))})(e.key===n)))}}),e.useEffect(()=>{return e=o.current,t=e=>g.current(e),Tr.size||addEventListener("keydown",kr,!0),Tr.set(e,t),()=>{Tr.delete(e),Tr.size||removeEventListener("keydown",kr,!0)};var e,t},[]),n.jsx("div",{ref:o,role:"slider",tabIndex:0,...a,...u,onPointerDown:e=>{e.preventDefault(),e.stopPropagation(),u.onPointerDown?.(e)},className:"rp-dashboard-resize rp-grip","data-edge":r,"data-focus-visible":s||void 0,"aria-label":t.label,"aria-orientation":"width"===r?"horizontal":"vertical","aria-valuemin":0,"aria-valuemax":t.options.length-1,"aria-valuenow":c,"aria-valuetext":t.options[c]?.label})}const Pr=(e,t)=>e.filter(e=>e.id===t).lengthbe(e)===t)?{instance:V()}:{}}:null;function Kr({draft:t,setDraft:r,render:o}){const i=L(),[a,s]=e.useState({text:"",serial:0}),l=oe(t),d=e=>s(t=>({text:e,serial:t.serial+1})),c=e.useRef([]);e.useEffect(()=>()=>c.current.forEach(e=>U(e.key)),[]),e.useEffect(()=>{c.current=c.current.filter(e=>!!e.restorable(t)||(U(e.key),!1))},[t]);const[p,u]=e.useState(null),g=e.useRef({x:Number.NaN,y:Number.NaN});e.useEffect(()=>{const e=e=>{g.current={x:e.clientX,y:e.clientY}};return document.addEventListener("pointerdown",e,!0),document.addEventListener("pointermove",e,!0),()=>{document.removeEventListener("pointerdown",e,!0),document.removeEventListener("pointermove",e,!0)}},[]),e.useEffect(()=>{if(!p)return;const{x:e,y:t}=g.current,r=r=>{r instanceof PointerEvent&&r.clientX===e&&r.clientY===t||u(null)};return document.addEventListener("pointermove",r,!0),document.addEventListener("keydown",r,!0),()=>{document.removeEventListener("pointermove",r,!0),document.removeEventListener("keydown",r,!0)}},[p]);const f=e=>{const{layout:n,restore:o,restorable:a}=function(e,t){const r=e.sections.find(e=>e.items.some(e=>be(e)===t));if(!r)return{layout:e,restore:e=>e,restorable:()=>!1};const n=r.items.findIndex(e=>be(e)===t),o=r.items[n],i=e=>{const r=oe(e);return!r.some(e=>be(e)===t)&&r.filter(e=>e.id===o.id).lengthe===r?{...e,items:e.items.filter(e=>e!==o)}:e)},restore:e=>i(e)?{...e,sections:e.sections.map(e=>e.id===r.id?{...e,items:[...e.items.slice(0,n),o,...e.items.slice(n)]}:e)}:e,restorable:i}}(t,be(e)),s=l.findIndex(t=>be(t)===be(e)),d=l[s+1]??l[s-1];u({focus:d&&be(d)}),r(n);const p=_("neutral",i("widgets.removed",{name:i(re[e.id].label)}),{id:`removed:${be(e)}`,action:{label:i("ui.undo"),onAction:()=>r(e=>e&&o(e)),closeOnAction:!0}});c.current.push({key:p,restorable:a})};return n.jsxs(n.Fragment,{children:[t.sections.map(e=>n.jsx(sr,{label:i("widgets.order"),profile:e.id,items:e.items.map(e=>({...fe(e),item:e})),textValue:({item:e})=>i(re[e.id].label),dragLabel:({item:e})=>i("widgets.drag",{name:i(re[e.id].label)}),gapLabel:e=>i("dashboard.remaining",{space:e}),refusal:i("dashboard.noRoom"),rearm:p,resize:({item:e})=>{const o=he(e,ce(e),i),a=(e,n)=>e&&{label:n,value:e.value,options:e.options,onChange:n=>{r(Te(t,Ae(e.set(n.value)))),d(`${e.label}: ${n.label}`)}};return n.jsx(vr,{width:a(o.width,i("dashboard.resizeWidth")),height:a(o.height,i("dashboard.resizeHeight"))})},onPlace:(n,o)=>{r(Dr(t,n,{section:e.id,...o})),d(i("widgets.reordered"))},tools:({item:e})=>n.jsxs(n.Fragment,{children:[n.jsx(J,{title:i(re[e.id].label),placement:"bottom end",trigger:n.jsx(M,{quiet:!0,icon:!0,label:i("widgets.inspector"),children:n.jsx(W,{})}),children:()=>n.jsx("div",{className:"rp-module-inspector",children:n.jsx(hr,{active:e,items:l,surface:"dashboard",update:e=>r(Te(t,Ae(e))),move:n=>{r(function(e,t,r){const n=e.sections.findIndex(e=>e.items.some(e=>be(e)===t));if(n<0)return e;const o=e.sections[n].items,i=o.findIndex(e=>be(e)===t),a=o[i+r];if(a)return Dr(e,t,{section:e.sections[n].id,target:be(a),after:r>0});const s=e.sections[n+r];if(!s)return e;const l=r>0?s.items[0]:s.items.at(-1);return Dr(e,t,{section:s.id,...l?{target:be(l),after:r<0}:{}})}(t,be(e),n)),d(i("widgets.reordered"))},remove:()=>f(e)})})}),n.jsx(M,{quiet:!0,icon:!0,label:i("widgets.removeName",{name:i(re[e.id].label)}),onPress:()=>f(e),children:n.jsx(Le,{})})]}),children:({item:e})=>o(e)},e.id)),n.jsx(C,{children:n.jsx("span",{role:"status",children:n.jsx("span",{children:a.text},a.serial)})})]})}function Or({draft:t,saved:r,setDraft:o,onClose:i}){const a=L(),[s,l]=e.useState(!1),d=e.useMemo(()=>JSON.stringify(t)!==JSON.stringify(r),[t,r]);return X(d,i),n.jsxs(Y,{children:[n.jsx(H,{title:a("widgets.gallery"),size:"wide",scrollBody:!0,trigger:n.jsx(M,{children:a("widgets.gallery")}),footer:e=>n.jsx(M,{onPress:e,children:a("ui.close")}),children:n.jsx("div",{className:"rp-widget-gallery-grid",children:n.jsx(gr,{items:oe(t),add:(e,r)=>o(function(e,t,r){const n=Pr(oe(e),t);if(!n)return e;const o=r?pe(n,r):n;return{...e,sections:e.sections.map(e=>"extensions"===e.id?{...e,items:[...e.items,o]}:e)}}(t,e,r)),surface:"dashboard"})})}),n.jsx(M,{onPress:()=>o(ie()),children:a("widgets.reset")}),n.jsx(M,{onPress:()=>d?l(!0):i(),children:a("ui.cancel")}),n.jsx(M,{accent:!0,onPress:()=>{xe(t),i()},children:a("ui.done")}),n.jsx(q,{title:a("config.discardTitle"),isOpen:s,onCancel:()=>l(!1),confirmLabel:a("config.discard"),onConfirm:i,children:n.jsx("p",{children:a("widgets.discardHelp")})})]})}function Sr({onClose:t,backend:r}){const o=L(),[i]=e.useState(ke),a=i.items,[s,l]=e.useState(a),[d,c]=e.useState(!1),[p]=e.useState(()=>i.docked?document.querySelector(".rp-side-dock")?.offsetWidth:void 0),u=i.size?.width??Ee,[g,f]=e.useState(u),[m,h]=e.useState(!1),y=g!==(d?Ee:u),[D,v]=e.useState(null),[b,w]=e.useState(!1),[x,T]=e.useState({text:"",serial:0}),k=e=>T(t=>({text:e,serial:t.serial+1})),E=d&&Pe(ke()),P=e.useMemo(()=>JSON.stringify(a)!==JSON.stringify(s),[a,s])||E||y;X(P,t);const K=()=>P?w(!0):t(),O=s.find(e=>be(e)===D);return n.jsxs(n.Fragment,{children:[n.jsxs(H,{title:o("widgets.edit"),size:"wide",scrollBody:!0,isOpen:!0,onOpenChange:e=>{e||K()},footer:()=>n.jsxs(n.Fragment,{children:[n.jsx(M,{onPress:()=>{l(Se().items),c(!0),f(Ee),v(null)},children:o("widgets.reset")}),n.jsx(M,{onPress:K,children:o("ui.cancel")}),n.jsx(M,{accent:!0,onPress:()=>{Ce(e=>({...e,version:4,items:s,...d&&je,...y&&{size:{width:g,height:(d?void 0:e.size?.height)??Ie}}})),t()},children:o("settings.save")})]}),children:[n.jsx(Ke,{panelWidth:(d||m?void 0:p)??g,onPanelWidth:e=>{h(!0),f(e)},resizeLabel:o("widgets.resizePreview"),header:n.jsx(Oe,{backend:r,preview:!0}),galleryLabel:o("widgets.gallery"),canvasLabel:o("widgets.canvas"),inspectorLabel:o(O?re[O.id].label:"widgets.inspector"),gallery:n.jsx(gr,{items:s,add:e=>{const t=Pr(s,e);t&&(l([...s,t]),v(be(t)),k(o("widgets.addedName",{name:o(re[e].label)})))}}),canvas:n.jsx(sr,{label:o("widgets.order"),items:s.map(e=>({item:e,module:e.id,id:be(e),size:e.size})),textValue:({item:e})=>o(re[e.id].label),selectionMode:"single",selectedKeys:D?new Set([D]):new Set,onSelectionChange:e=>{"all"!==e&&v(String([...e][0]))},dragLabel:({item:e})=>o("widgets.drag",{name:o(re[e.id].label)}),onPlace:(e,{target:t,after:r})=>{t&&(l(n=>{const o=function(e,t,r,n){if(t.has(r))return e;const o=e.filter(e=>!t.has(e)),i=o.indexOf(r);return i<0?e:(o.splice(i+("after"===n?1:0),0,...e.filter(e=>t.has(e))),o)}(n.map(be),new Set([e]),t,r?"after":"before");return o.flatMap(e=>n.find(t=>be(t)===e)??[])}),k(o("widgets.reordered")))},children:({item:e})=>n.jsx(le,{item:e,preview:!0})}),inspector:n.jsx(hr,{active:O,items:s,sizes:O?De(O.id,ve(O,"panel"),"panel"):[],surface:"panel",update:e=>l(t=>t.map(Ae(e))),move:e=>{O&&l(function(e,t,r){const n=e.findIndex(e=>be(e)===t),o=n+r;if(n<0||o<0||o>=e.length)return e;const i=[...e];return i.splice(o,0,...i.splice(n,1)),i}(s,be(O),e)),k(o("widgets.reordered"))},remove:()=>{O&&(e=>{const t=be(e);l(e=>e.filter(e=>be(e)!==t)),v(null),k(o("widgets.removed",{name:o(re[e.id].label)}))})(O)}})}),n.jsx(C,{children:n.jsx("span",{role:"status",children:n.jsx("span",{children:x.text},x.serial)})})]}),n.jsx(q,{title:o("config.discardTitle"),isOpen:b,onCancel:()=>w(!1),confirmLabel:o("config.discard"),onConfirm:t,children:n.jsx("p",{children:o("widgets.discardHelp")})})]})}export{Or as DashboardActions,Kr as DashboardEditor,Sr as WidgetEditor}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/Editors-rPgk_VZK.css b/luci-app-honk/root/etc/honk/doona/assets/Editors-rPgk_VZK.css deleted file mode 100644 index 30b3447c..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/Editors-rPgk_VZK.css +++ /dev/null @@ -1 +0,0 @@ -.rp-dashboard-body{display:contents}.rp-dashboard-tools{z-index:1;gap:var(--rp-space-2);border-radius:var(--rp-r-md);background:var(--rp-base);display:flex;position:absolute;inset-block-start:var(--rp-space-3);inset-inline-end:var(--rp-space-3)}.rp-dashboard-tools [slot=drag]{touch-action:none;cursor:grab}.rp-grip:before{content:"";inline-size:calc(var(--rp-space-1) / var(--rp-preview-scale,1));block-size:calc(var(--rp-space-6) / var(--rp-preview-scale,1));border-radius:var(--rp-r-pill);background:var(--rp-subtle);box-shadow:0 0 0 calc(var(--rp-space-half) / var(--rp-preview-scale,1)) var(--rp-base)}.rp-sortable-row{outline:none;min-inline-size:0;position:relative}.rp-sortable-row[data-focus-visible]{outline:none}.rp-sortable-row:is([data-focus-visible],[data-selected]):before{content:"";inset:calc(0px - var(--rp-sortable-gap,var(--rp-space-2)) - var(--rp-focus-width));border:var(--rp-focus-width) solid var(--rp-focus-color);pointer-events:none;position:absolute}.rp-sortable-grid{outline:none}.rp-sortable-row>[role=gridcell]{display:contents}.rp-sortable-grid[data-drop-target]{outline:2px dashed var(--rp-accent)}.rp-sortable-grid .rp-dashboard-tools{background:0 0;inset-block-start:calc(var(--rp-line-caption) / 2 - var(--rp-space-1));inset-inline-end:0;translate:0 -50%}.rp-sortable-grid .rp-widget-label{padding-inline-end:calc(var(--rp-control) + var(--rp-space-2))}.rp-sortable-row[data-module=divider] .rp-dashboard-tools{background:var(--rp-surface);padding-inline-start:var(--rp-space-1);inset-block-start:50%}.rp-widget-gallery-grid{gap:var(--rp-space-4);grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr));display:grid}.rp-widget-gallery-tile{gap:var(--rp-space-3);min-inline-size:0;padding:var(--rp-space-4);border:1px solid var(--rp-line);border-radius:var(--rp-r-lg);flex-direction:column;display:flex}.rp-widget-gallery-tile>.rp-cluster{margin-block-start:auto}.rp-widget-gallery-tile[data-added]{background:var(--rp-fill);--rp-subtle:var(--rp-subtle-text)}.rp-widget-gallery-frame{pointer-events:none;block-size:200px;overflow:hidden;mask-image:linear-gradient(#000 80%,#0000)}.rp-widget-gallery-presets{align-items:flex-start;gap:var(--rp-space-3) var(--rp-preset-gap);flex-wrap:wrap;display:flex}.rp-widget-gallery-preset{gap:var(--rp-space-1);flex-direction:column;min-inline-size:0;display:flex}.rp-widget-gallery-thumb{position:relative;overflow:hidden}.rp-widget-gallery-thumb-card{transform-origin:0 0;pointer-events:none;container:rp-tile/inline-size}.rp-widget-gallery-thumb-card:dir(rtl){transform-origin:100% 0}.rp-widget-gallery-thumb-add{border-radius:var(--rp-r-lg);cursor:pointer;background:0 0;border:0;position:absolute;inset:0}.rp-widget-gallery-thumb-add[data-hovered]{outline:2px solid var(--rp-line);outline-offset:2px}.rp-widget-gallery-thumb-add[data-focus-visible]{outline:2px solid var(--rp-accent);outline-offset:2px}.rp-widget-gallery-thumb-add[data-disabled]{cursor:default;outline:none} diff --git a/luci-app-honk/root/etc/honk/doona/assets/Events-ZfmwKzoO.js b/luci-app-honk/root/etc/honk/doona/assets/Events-ZfmwKzoO.js deleted file mode 100644 index ebc538b4..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/Events-ZfmwKzoO.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{U as n,a2 as s,a4 as r,a1 as a,h as i,a9 as o,u as l,al as d,l as c,q as m,c2 as u,ab as p,ac as v,dp as h,dq as j,T as f,av as x,B as b,p as g,E as w}from"./index-HxEUeoab.js";import{L as k}from"./AppearanceControls-sRy1p156.js";import{d as y,O as T,K as N,L as C}from"./logs-C4GIy4tX.js";import{T as H}from"./Toolbar-BTFtduwD.js";import{D as _}from"./Table-yWn0d3vL.js";import{d as K,e as O}from"./files-Dt8K7QfP.js";import{j as S,D as W}from"./activity-yZTrGy-J.js";import{u as L,C as M}from"./Copy-CGFSe6tr.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./ItemText-DOD_75iR.js";import"./Select-D7_6MaHd.js";import"./nodes-6sIn2I0s.js";import"./Checkbox-CJt7u9-e.js";import"./Virtualizer-DMIKG2CD.js";const R={buffer_overflow:["event.gap.overflow","event.gapHelp.overflow"],evicted:["event.gap.evicted","event.gapHelp.evicted"]};function q(e,t){const n="flow.gap"===e.event&&Object.hasOwn(R,e.data.reason)?R[e.data.reason]:void 0;return n&&{title:t(n[0]),text:t(n[1])}}function D(e,t){const n=e=>e?[{id:"flow",label:t("event.viewFlow"),href:i("flows",{tab:"records",id:e})}]:[];switch(e.event){case"flow.updated":return n(e.data.resource_id);case"flow.gap":return[...n(e.data.resource_id),{id:"recording",label:t("ui.recordingSettings"),href:S}];case"generation.changed":return[{id:"config",label:t("event.viewConfig"),href:i("config")}];default:return[]}}const F=new WeakMap;function I(e,t,i,o,l,d,c,m,u=!1,p=()=>!1){const v="without-runtime"===t||m.includes(t)?t:"all",h=e.filter(e=>"all"===v||("without-runtime"===v?"runtime.updated"!==e.event:e.event===v)).slice(0,l);return{kind:v,rows:h.map(e=>function(e,t,i,o){const l=F.get(e);if(l&&l.locale===t)return l.row;const d=o?{key:"event.lostHistory"}:r(e,i),c={id:y(e),timestamp:a(e.data.observed_at,t),iso:e.data.observed_at,kind:e.event,kindText:n(s,e.event,i),summary:i(d.key,d.params),help:q(e,i),links:D(e,i),event:e};return F.set(e,{locale:t,row:c}),c}(e,d,c,p(e))),kinds:[{id:"without-runtime",label:c("event.withoutRuntime")},{id:"all",label:c("event.allKinds")},...m.map(e=>({id:e,label:n(s,e,c)}))],status:u&&!1!==o?{tone:"err",text:c("event.disconnected")}:{tone:i?"ok":null===o?"muted":"warn",text:c(!1===o?"event.unavailable":i?"event.connected":null===o?"ui.loading":"event.reconnecting")},limitText:c("event.limit",{n:l}),shown:h}}function J(){const t=o(),n=l(),s=d[c()],r=m(),a=r.data?.resources.events.kinds,[i,f]=e.useState("without-runtime"),x="all"!==i&&"runtime.updated"!==i&&a?.includes(i),b=T("without-runtime"!==i&&!x),g=e.useMemo(()=>I(b.events,i,b.connected,b.available,j,s,n,a??[],!!b.error,h),[b.events,i,b.connected,b.available,b.error,s,n,a]);return u(g.kind,f),{...g,setKind:f,cursor:b.cursor,error:b.error,retry:()=>{p().then(()=>v(t))},loading:!b.error&&!b.connected&&!1!==b.available&&!b.events.length,export:()=>{return K(O("doona-events","json"),(e=g.shown,JSON.stringify(e,null,2)+"\n"),"application/json");var e}}}function P(){const n=l(),s=J(),r=L(),a=e.useMemo(()=>[{id:"t",label:n("ui.time"),minWidth:212,grow:0,drop:1,render:e=>t.jsx(f,{className:"rp-code",text:e.iso,children:e.timestamp})},{id:"k",label:n("event.kind"),minWidth:224,drop:2,render:e=>t.jsx(f,{text:e.kind,children:e.kindText})},{id:"m",label:n("event.summary"),minWidth:176,isRowHeader:!0,render:e=>t.jsx(x,{fill:!0,help:e.help,children:t.jsx(f,{children:e.summary})})},{id:"actions",actions:!0,label:n("ui.actions"),hideLabel:!0,minWidth:64,grow:0,render:e=>t.jsx(b,{small:!0,quiet:!0,icon:!0,label:n("ui.copyRecord"),onPress:()=>{r((e=>JSON.stringify(e,null,2))(e.event))},children:t.jsx(M,{})})}],[n,r]),i=e.useCallback(e=>t.jsxs(t.Fragment,{children:[t.jsx(N,{inline:!0,items:[[n("ui.time"),e.timestamp],[n("event.kind"),e.kindText],[n("event.summary"),e.summary]]}),e.links.length>0&&t.jsx("div",{className:"rp-cluster",children:e.links.map(e=>t.jsx(k,{appearance:"button",href:e.href,children:e.label},e.id))})]}),[n]);return t.jsxs("div",{className:"rp-page",children:[t.jsxs(H,{page:!0,children:[t.jsx(C,{label:n("event.kind"),side:!0,value:s.kind,onChange:s.setKind,items:s.kinds}),t.jsx(g,{small:!0,tone:s.status.tone,children:s.status.text}),s.cursor&&t.jsx(f,{text:s.cursor,children:t.jsx("span",{className:"rp-label",children:n("event.cursor")})}),t.jsx("span",{className:"rp-label",children:s.limitText}),t.jsx("span",{className:"rp-grow"}),t.jsxs(b,{isDisabled:!s.rows.length,onPress:s.export,children:[t.jsx(W,{}),n("event.export")]})]}),s.error&&t.jsx(w,{error:s.error,onRetry:s.retry}),t.jsx(_,{label:n("nav.events"),stream:!0,flow:!0,loading:s.loading,rows:s.rows,empty:n("event.empty"),cols:a,detail:i})]})}export{P as Events}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/FlagPicker-CiyGi8d1.js b/luci-app-honk/root/etc/honk/doona/assets/FlagPicker-CiyGi8d1.js deleted file mode 100644 index e84f53bd..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/FlagPicker-CiyGi8d1.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,j as s}from"./vendor-react-64fcanlc.js";import{u as a,l,ct as t,al as o,dg as i,b5 as n,B as r}from"./index-HxEUeoab.js";import{S as c}from"./SearchSelect-BcScGUbQ.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Select-D7_6MaHd.js";import"./ItemText-DOD_75iR.js";import"./SearchList-LjCruZYP.js";import"./Virtualizer-DMIKG2CD.js";function m({name:n,value:r,automaticFlag:m,onChange:d}){const f=a(),g=l(),p=e.useMemo(()=>t(o[g]),[g]),j=i(n),u=p.find(e=>e.flag===m),h=u?f("flags.detected",{region:u.label}):f("flags.automatic");return s.jsx("div",{className:"rp-list",children:s.jsx(c,{label:f("flags.region"),description:f(j?"flags.embedded":"flags.help"),isDisabled:j,searchLabel:f("flags.search"),value:j?"automatic":r,onChange:d,sections:[{id:"flags",items:[{id:"automatic",label:h,flag:m},{id:"none",label:f("flags.none"),flag:null},...p]}]})})}function d({name:e,onClose:l,...t}){const o=a();return s.jsxs(n,{narrow:!0,title:o("flags.edit"),isOpen:!0,onOpenChange:e=>{e||l()},footer:()=>s.jsx(r,{onPress:l,children:o("ui.close")}),children:[s.jsx("p",{className:"rp-note",children:e}),s.jsx(m,{name:e,...t})]})}export{m as FlagField,d as FlagPicker}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/Flows-B78_vhjx.css b/luci-app-honk/root/etc/honk/doona/assets/Flows-B78_vhjx.css deleted file mode 100644 index 30969581..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/Flows-B78_vhjx.css +++ /dev/null @@ -1 +0,0 @@ -.rp-topology{min-width:0;overflow:hidden}.rp-tree{gap:var(--rp-space-2);overscroll-behavior-x:contain;flex-direction:column;min-width:0;display:flex;overflow-x:auto}.rp-tree-hint{color:var(--rp-subtle);font-size:var(--rp-text-xs);line-height:16px;display:none}@media (width<=599.98px){.rp-tree-hint{display:block}}.rp-tree-captions{height:16px;position:relative}.rp-tree-captions>.rp-label{text-transform:uppercase;letter-spacing:.04em;white-space:nowrap;position:absolute;top:0}.rp-tree-canvas{position:relative}.rp-tree-links{pointer-events:none;fill:none;stroke:var(--rp-muted);stroke-linecap:round;position:absolute;inset:0;overflow:visible}.rp-tree-links path{opacity:.55;transition:opacity var(--rp-duration) var(--rp-ease)}.rp-tree-links path[data-kind=direct]{stroke:var(--rp-positive)}.rp-tree-links path[data-kind=block]{stroke:var(--rp-negative)}.rp-tree-links path[data-kind=group]{stroke:var(--rp-iris)}.rp-tree-links path[data-kind=node]{stroke:var(--rp-accent)}.rp-tree-links path[data-state=active]{opacity:1}.rp-tree-links path[data-state=dim]{opacity:.1}.rp-tree-tile{box-sizing:border-box;align-items:center;gap:var(--rp-space-2);height:36px;padding:0 var(--rp-space-2h);border-radius:var(--rp-r-md);background:var(--rp-overlay);color:var(--rp-text);font:inherit;font-size:var(--rp-text-sm);text-align:start;cursor:pointer;border:2px solid #0000;line-height:16px;display:flex;position:absolute}.rp-tree-tile.dim{opacity:.35}.rp-tree-tile[data-hovered]{background:var(--rp-hl-med)}.rp-tree-tile[data-selected]{border-color:var(--rp-accent);background:var(--rp-selected)}.rp-tree-tile[data-focus-visible]{outline:var(--rp-focus-width) solid var(--rp-focus-color);outline-offset:calc(-1 * var(--rp-focus-width));border-color:#0000}.rp-tree-tile .l{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.rp-tree-tile[data-stage=rule] .l{font-family:var(--rp-font-mono);font-size:var(--rp-text-xs);font-variant-ligatures:none}.rp-tree-tile .s{font-size:var(--rp-text-xs);color:var(--rp-subtle);margin-inline-start:var(--rp-space-2)}.rp-tree-tile .s.ok{color:var(--rp-positive-text)}.rp-tree-tile .s.warn{color:var(--rp-notice-text)}.rp-tree-tile .s.err{color:var(--rp-negative-text)}.rp-tree-tile .c{font-variant-numeric:tabular-nums;color:var(--rp-subtle);flex:none;font-weight:700} diff --git a/luci-app-honk/root/etc/honk/doona/assets/Flows-C_tb9jRq.js b/luci-app-honk/root/etc/honk/doona/assets/Flows-C_tb9jRq.js deleted file mode 100644 index ea9bf08d..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/Flows-C_tb9jRq.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e,j as t}from"./vendor-react-64fcanlc.js";import{O as n}from"./OutboundTag-CO8Ndxdr.js";import{l as a,p as o,c as s,h as r,R as l,S as i,L as d,K as u}from"./logs-C4GIy4tX.js";import{a6 as c,M as p,a3 as m,H as f,G as g,c4 as w,c6 as h,w as b,bZ as v,U as j,b$ as x,c0 as y,al as k,a1 as _,h as M,ak as N,o as L,a8 as S,Y as T,u as C,l as P,i as O,B as F,N as R,b7 as E,ax as H,q,r as W,b4 as $,c8 as I,c3 as D,aG as A,E as U,T as B,aE as J,bx as K,S as Q,af as G,C as V}from"./index-HxEUeoab.js";import{h as Z,f as z,i as X,o as Y,j as ee,d as te}from"./activity-yZTrGy-J.js";import{w as ne}from"./labels-D8xxfRTQ.js";import{c as ae,C as oe}from"./Coverage-8qg_JeNJ.js";import{f as se}from"./nav-CKRufMnz.js";import{L as re}from"./AppearanceControls-sRy1p156.js";import{T as le}from"./Tabs-DT6MQhIo.js";import{T as ie}from"./Toolbar-BTFtduwD.js";import{D as de}from"./Table-yWn0d3vL.js";import{T as ue}from"./TimeCell-BIqfL3y_.js";import{a as ce,u as pe,b as me}from"./flows-dBNkBg79.js";import{u as fe}from"./outbounds-Bbb6kdae.js";import{u as ge,Q as we,R as he}from"./useQuickRule-DUEi6geL.js";import"./_commonjsHelpers-CXUWDbkB.js";import"./Tag-SxASl3TF.js";import"./Select-D7_6MaHd.js";import"./ItemText-DOD_75iR.js";import"./nodes-6sIn2I0s.js";import"./Checkbox-CJt7u9-e.js";import"./Virtualizer-DMIKG2CD.js";import"./DaeCode-DEjXqvav.js";import"./daeTokens-BVtuNnWZ.js";import"./AddCircle-C6Jc7GCc.js";import"./SearchSelect-BcScGUbQ.js";import"./SearchList-LjCruZYP.js";import"./rule-Bl9YOsFn.js";const be=["client","rule","outbound","node"];function ve(e,t){if(e.rule_id)return null!==e.rule_generation_id&&e.rule_generation_id===t?e.rule_id:e.rule_id+"\0"+e.rule_expression}function je(e,t,n,a){switch(t){case"client":{const t=p(e.input?.src??void 0);return{label:t??"unknown",unknown:!t}}case"rule":return e.rule_expression?{label:e.rule_expression,unknown:!1,key:ve(e,a)}:{label:"unknown",unknown:!0};case"outbound":return e.outbound?{label:e.outbound,unknown:!1}:{label:"unknown",unknown:!0};case"node":{if(c(e.outbound))return null;const t=e.chain.at(-1)??null;return t?{label:n.get(t)??t,unknown:!1,key:t}:{label:"unknown",unknown:!0}}}}const xe=(e,t)=>z(e,t.unknown?"":t.key??t.label),ye=e=>Z(e,be)?.kind,ke=new Map;function _e(e,t,n){const a=ye(t);return a?e.filter(e=>{const o=je(e,a,ke,n?.generation_id);return null!==o&&xe(a,o)===t}):[]}function Me(e,t,n,a){const o=Z(e,be);if(!o||""===o.value)return a(null);const{kind:s,value:r}=o;return"rule"===s?r.includes("\0")?r.slice(r.indexOf("\0")+1):t.find(e=>e.rule_id===r)?.expression??r:"node"===s?n.get(r)??r:"client"===s?r:a(r)}function Ne(e,t,n,a,o="rule"){const s=(e=>new Map(e.map(e=>[e.id,e.name])))(n),r=new Map(t.map(e=>[e.id,e])),l=new Map(t.map(e=>[e.name,e])),i=new Map(n.map(e=>[e.id,e])),d=new Map,u=new Map,p=new Map,w=new Map,h=(e,t)=>{const n=e+">"+t;let a=w.get(n);return a||w.set(n,a={source:e,target:t,count:0}),a},b=(e,t,n=!1)=>{const a=xe("node",{key:e,label:t,unknown:n});let o=p.get(a);if(!o){const s=n?void 0:i.get(e),r=s&&f(s);p.set(a,o={id:a,label:t,count:0,unknown:n||void 0,latency:g(r),unavailable:"unavailable"===r?.state})}return o},v=(e,t=!1)=>{const n=xe("outbound",{label:e,unknown:t});let a=u.get(n);if(a)return a;const o=t?void 0:l.get(e),d=t?{groups:[],member:null}:m(e,o?.selection.tcp_member_id?"tcp":"udp",l,r,i),p=d.groups.map(e=>({name:e.name,kind:e.policy.kind,policy:e.policy.native})),f=d.member;return a={id:n,label:e,count:0,unknown:t||void 0,kind:t?"unknown":c(e)?e:p.length?"group":"unknown",groups:p,node:f&&b(f,s.get(f)??f).id},u.set(n,a),a.node&&h(n,a.node),a},j=(e,t,n=!1)=>{let a=d.get(e);return a||d.set(e,a={id:e,label:t,count:0,unknown:n||void 0,outbound:null,must:!1}),a};if("rule"===o)for(const c of a?.rules??[]){const e=j(xe("rule",{key:c.rule_id,label:c.expression}),c.expression);e.must=c.must,c.outbound&&(e.outbound=v(c.outbound).id,h(e.id,e.outbound))}const x=[o,"outbound","node"];for(const c of e){let e;for(const t of x){const n=je(c,t,s,a?.generation_id);if(!n)break;const o="outbound"===t?v(n.label,n.unknown):"node"===t?b(n.key??n.label,n.label,n.unknown):j(xe(t,n),n.label,n.unknown);o.count++,e&&h(e.id,o.id).count++,e=o}}for(const c of t)v(c.name);const y=new Set([...d.values()].map(e=>e.outbound)),k=new Set([...u.values()].flatMap(e=>e.groups.slice(1).map(e=>e.name))),_=[...u.values()].filter(e=>e.count||y.has(e.id)||!k.has(e.label)),M=new Set(_.map(e=>e.id)),N=[...w.values()].filter(e=>M.has(e.source)||M.has(e.target)),L=new Set(N.map(e=>e.target));return{by:o,leaves:[...d.values()],outbounds:_,nodes:[...p.values()].filter(e=>L.has(e.id)),links:N}}const Le=new WeakMap;function Se(e){const t=Le.get(e);if(t)return t;const n=new Map,a=new Map,o=new Map;for(const l of e.links){for(const[e,t]of[[n,l.source],[a,l.target]]){let n=e.get(t);n||e.set(t,n=[]),n.push(l)}(!o.has(l.source)||o.get(l.source).countnull==e?"—":{key:e?"ui.yes":"ui.no"};function Oe(e,t,n,a,o,s){return{tree:e,state:t?e.leaves.length||e.outbounds.length?"ready":"empty":n?"error":"loading",pinLabel:a?s("flow.viewPinned",{n:o}):null}}const Fe={input:"flow.stage.input",route:"flow.stage.route",dial_mode:"flow.stage.dialMode",dns:"nav.dns",outbound:"ui.outbound",connection:"flow.stage.connection",datapath:"ov.datapath",reroute:"flow.stage.reroute"},Re={complete:"flow.status.complete",partial:"flow.status.partial",disabled:"flow.status.disabled"};function Ee(e,t,n,a){if(!e)return null;const o=k[n];return{title:e.input.domain||e.input.dst||e.id,status:j(Re,e.trace.status,t),tone:"complete"===e.trace.status?void 0:"warn",revision:t("flow.revision",{n:e.revision}),fields:[[t("ui.state"),j(v,e.state,t)],...a?[[t("nodes.node"),a.path??a.node]]:[],...a?.expression?[[t("ui.rule"),a.expression]]:[],...e.trace.missing.length?[[t("flow.missing"),N(n,e.trace.missing.map(e=>j(Te,e,t)))]]:[]],connectionHref:e.connection_id?M("connections",{id:e.connection_id}):null,steps:[...e.trace.steps].sort((e,t)=>e.seq-t.seq).map(e=>{const n=function(e){const t=e=>null==e?"—":"object"==typeof e?JSON.stringify(e):String(e);switch(e.stage){case"input":return Object.entries(e.data.values).filter(([,e])=>null!=e&&""!==e).map(([e,n])=>{const a=Ce[e];return[void 0!==a&&a.includes(".")?a:{key:"flow.f.input",params:{name:a??e}},"string"!=typeof n||"ingress"!==e&&"domain_source"!==e?t(n):ne(n)]});case"route":return[["conn.chain",e.data.chain],["flow.f.plane",ne(e.data.plane)],["ui.rule",e.data.rules.filter(e=>"matched"===e.result).map(e=>e.expression??e.rule_id).join(", ")||"—"],["ui.outbound",t(e.data.outbound)],["flow.f.must",Pe(e.data.must)]];case"dial_mode":return[["flow.f.dialTarget",e.data.configured+" → "+e.data.effective_target],["flow.f.verification",ne(e.data.verification)]];case"dns":return[["ui.name",e.data.name],["ui.source",ne(e.data.source)],["ui.cache",ne(e.data.cache)],["ui.upstream",t(e.data.upstream)],["flow.f.selectedIp",t(e.data.selected_ip)]];case"outbound":return[["ui.outbound",t(e.data.routed_outbound)+" → "+t(e.data.effective_outbound)],["flow.f.selectionPath",e.data.selection_path.map(e=>e.group_id+" → "+t(e.member_name??e.member_id)).join(" / ")||"—"],["flow.f.leafNode",t(e.data.leaf_node_id)],["ui.target",t(e.data.target)],["ui.state",ne(e.data.status)]];case"connection":return[["ui.state",Object.hasOwn(v,e.data.state)?{key:v[e.data.state]}:e.data.state],["flow.f.milestone",ne(e.data.milestone)],["flow.f.reason",ne(e.data.reason)]];case"datapath":return[["flow.f.plane",ne(e.data.plane)],["flow.f.action",ne(e.data.action)],["flow.f.reason",ne(e.data.reason)]];case"reroute":return[["flow.f.performed",Pe(e.data.performed)],["flow.f.reason",ne(e.data.reason)]];default:return null}}(e);return{id:e.seq,stage:j(Fe,e.stage,t),observed:_(e.observed_at,o),elapsed:null==e.elapsed_us?"—":t("ui.microseconds",{n:e.elapsed_us}),fields:n?.map(([e,n])=>["string"==typeof e?t(e):t(e.key,e.params),"string"==typeof n?n:t(n.key,n.params)])??null,raw:n?"":JSON.stringify(e.data,null,2)}})}}const He=30,qe=[5,4,3],We={rule:0,client:0,outbound:1,node:2};function $e(e,t,n,o){const s=null===t?void 0:Math.max(t,720),r=((s??0)-112)/qe.reduce((e,t)=>e+t),l=e=>{const t=We[e];return{left:qe.slice(0,t).reduce((e,t)=>e+t*r+56,0),width:qe[t]*r}},i=function(e){const t=new Map;let n=0;const a=new Map,{parents:o}=Se(e);for(const l of[...e.leaves,...e.outbounds]){const e=o.get(l.id);if(e){let t=a.get(e);t||a.set(e,t=[]),t.push(l.id)}}const s=e=>{const o=a.get(e)??[];if(o.length){for(const e of o)s(e);t.set(e,(t.get(o[0])+t.get(o[o.length-1]))/2)}else t.set(e,n++)},r=new Set;for(const l of e.outbounds)r.add(o.get(l.id)??l.id);for(const l of e.nodes)r.add(l.id);for(const l of e.leaves)o.has(l.id)||r.add(l.id);for(const l of r)s(l);return{rows:n,at:t}}(e),d=function(e,t,n){const o=(e,n)=>e.unknown?t("ui.unknown"):n,s=[...e.leaves.map(t=>({id:t.id,stage:e.by,name:o(t,t.label),badge:t.must?"must":void 0,notes:[],count:t.count})),...e.outbounds.map(e=>({id:e.id,stage:"outbound",name:o(e,L(e.label,t)),notes:[...e.groups.slice(1).map(e=>({text:"› "+e.name})),...e.groups.slice(-1).map(e=>({text:X({kind:e.kind,native:e.policy},t).label})),..."group"!==e.kind||e.node?[]:[{text:t("flow.treeNoNode")}]],count:e.count})),...e.nodes.map(e=>({id:e.id,stage:"node",name:o(e,e.label),notes:null!=e.latency?[{text:S(e.latency,t),tone:a(e.latency)}]:e.unavailable?[{text:t("ui.unavailable"),tone:"err"}]:[],count:e.count}))],r=new Map(s.map(e=>[e.id,e.name])),{outgoing:l,incoming:i}=Se(e);return s.map(e=>{const a=(l.get(e.id)??[]).map(e=>r.get(e.target)),o="node"===e.stage?(i.get(e.id)??[]).map(e=>r.get(e.source)):[],s=[e.name,...e.badge?[e.badge]:[],...e.notes.map(e=>e.text),t("flow.treeFlows",{n:e.count})];return o.length&&s.push(t("flow.treeFrom",{names:N(n,o)})),a.length&&s.push(t("flow.treeTo",{names:N(n,a)})),{...e,countText:T(e.count,k[n]),label:s.join(t("ui.separator"))}})}(e,n,o).map(e=>({view:e,style:{top:44*i.at.get(e.id),...l(e.stage)}})),u=new Map(e.outbounds.map(e=>[e.id,e])),c=e.links.flatMap(t=>{if(!i.at.has(t.source)||!i.at.has(t.target))return[];const n="outbound"===ye(t.source)?"outbound":e.by,a=l(n),o=a.left+a.width,s=l("outbound"===n?"node":"outbound").left,r=44*i.at.get(t.source)+18,d=44*i.at.get(t.target)+18,c=(o+s)/2;return[{link:t,id:t.source+">"+t.target,path:`M${o},${r} C${c},${r} ${c},${d} ${s},${d}`,width:Math.min(8,1.5+1.25*Math.log2(1+t.count)),dash:t.count?void 0:"4 4",kind:"outbound"===n?"node":u.get(t.target)?.kind??"group"}]});return{width:s,height:44*i.rows-8,captions:[{stage:e.by,label:n("rule"===e.by?"ui.rule":"ui.device"),style:l(e.by)},{stage:"outbound",label:n("ui.outbound"),style:l("outbound")},{stage:"node",label:n("nodes.node"),style:l("node")}],placed:d,geometry:c}}function Ie(t,n,a){const o=C(),s=P(),[r,l]=e.useState(He),[i,d]=e.useState(null),[u,c]=O(),p=e.useMemo(()=>Se(t),[t]),m=e.useMemo(()=>function(e,t){return e.leaves.length<=t?e:{...e,leaves:e.leaves.slice(0,t)}}(t,r),[t,r]),f=e.useMemo(()=>$e(m,c,o,s),[m,c,o,s]),g=e.useMemo(()=>new Set(f.placed.map(e=>e.view.id)),[f.placed]),w=e.useMemo(()=>new Set([...t.leaves,...t.outbounds,...t.nodes].map(e=>e.id)),[t]),h=i&&g.has(i)?i:n&&w.has(n)?n:null,b=e.useMemo(()=>h?function(e,t){const n=new Set([t]),a=new Set;for(const[o,s]of[[e.outgoing,"target"],[e.incoming,"source"]]){const e=[t];for(const t of e)for(const r of o.get(t)??[])a.has(r)||(a.add(r),n.has(r[s])||(n.add(r[s]),e.push(r[s])))}return{items:n,edges:a}}(p,h):null,[p,h]);e.useEffect(()=>{if(!n)return;const e=e=>{"Escape"===e.key&&a(null)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[n,a]);const v=e.useRef(n);e.useLayoutEffect(()=>{v.current=n},[n]);const j=e.useCallback(e=>a(v.current===e?null:e),[a]);return{...f,ref:u,ready:void 0!==f.width,active:b,pinned:n,pin:j,hover:d,more:t.leaves.length>r?o("flow.treeShowMore",{n:Math.min(He,t.leaves.length-r)}):null,fewer:r>He?o("flow.treeFewer",{n:He}):null,showMore:()=>l(e=>Math.min(t.leaves.length,e+He)),showFewer:()=>l(He)}}const De=e.memo(function({view:e,style:n,dim:a,selected:s,pin:r,hover:l}){return t.jsxs(o,{"aria-label":e.label,className:E("rp-tree-tile",a&&"dim"),"data-id":e.id,"data-stage":e.stage,style:n,isSelected:s,onChange:()=>r(e.id),onHoverStart:()=>l(e.id),onHoverEnd:()=>l(null),onFocus:()=>l(e.id),onBlur:()=>l(null),children:[t.jsxs("span",{className:"l",children:["node"===e.stage?t.jsx("b",{children:t.jsx(R,{name:e.name})}):"rule"===e.stage||"client"===e.stage?e.name:t.jsx("b",{children:e.name}),e.notes.map((e,n)=>t.jsx("span",{className:E("s",e.tone),children:e.text},n))]}),e.badge&&t.jsx(H,{children:e.badge}),t.jsx("span",{className:"c",children:e.countText})]})});function Ae({tree:e,pinned:n,onPin:a}){const{ref:o,...s}=Ie(e,n,a);return t.jsxs("div",{className:"rp-tree",ref:o,children:[t.jsx("div",{className:"rp-tree-captions",style:{width:s.width},children:s.captions.map(e=>t.jsx("span",{className:"rp-label",style:e.style,children:e.label},e.stage))}),t.jsxs("div",{className:"rp-tree-canvas",style:{height:s.height,width:s.width},children:[s.ready&&t.jsx("svg",{className:"rp-tree-links",width:s.width,height:s.height,"aria-hidden":!0,children:s.geometry.map(e=>t.jsx("path",{d:e.path,strokeWidth:e.width,"data-kind":e.kind,"data-state":s.active?s.active.edges.has(e.link)?"active":"dim":void 0,strokeDasharray:e.dash},e.id))}),s.ready&&s.placed.map(({view:e,style:n})=>t.jsx(De,{view:e,style:n,dim:!!s.active&&!s.active.items.has(e.id),selected:s.pinned===e.id,pin:s.pin,hover:s.hover},e.id))]}),s.more&&t.jsx(F,{small:!0,quiet:!0,onPress:s.showMore,children:s.more}),s.fewer&&t.jsx(F,{small:!0,quiet:!0,onPress:s.showFewer,children:s.fewer})]})}function Ue({go:t,query:n}){const a=C(),o=P(),r=$(I),l=e.useMemo(()=>new URLSearchParams(n),[n]),i=l.get("network"),d="tcp"===i||"udp"===i?i:"all",u=l.get("state")??"",m=Object.hasOwn(v,u)?u:"all",f=l.get("connection_id")??void 0,g=q().data?.resources,w=ce({connection_id:f,network:d,state:m},W(g,"flows",{whileLoading:!0})),h=W(g,"rules",{whileLoading:!1}),k=pe(h),_=fe(),M=l.get("id"),N=me(M),S=l.get("path"),T=e.useMemo(()=>{const e=w.data?.flows??[];return S?_e(e,S,k.data):e},[w.data,S,k.data]),O=k.data?.generation_id,F=e.useMemo(()=>function(e,t,n,a,o,s){return{rows:e.map(e=>({id:e.id,target:e.input?.domain||e.input?.dst||e.id,node:y(e,o,a),nodeName:!c(e.outbound)&&e.chain.length>0,path:x(e,o,a),expression:e.rule_expression,ruleId:null!==e.rule_generation_id&&e.rule_generation_id===n?e.rule_id:null,recomputed:"recomputed"===e.rule_source,network:e.network.toUpperCase(),state:j(v,e.state,o),startedAt:e.started_at,seed:{domain:e.input?.domain??null,dip:p(e.input?.dst??void 0)??null,sip:p(e.input?.src??void 0)??null,outbound:e.outbound,matched:e.rule_id&&"unknown"!==e.rule_source?{id:e.rule_id,expression:e.rule_expression,generation:e.rule_generation_id}:null}})),coverage:t?ae(t,o,s):null,stateOptions:[{id:"all",label:o("flow.allStates")},...Object.entries(v).map(([e,t])=>({id:e,label:o(t)}))]}}(T,w.data,O,_,a,o),[T,w.data,O,_,a,o]),R=F.rows.find(e=>e.id===M),E=s(W(g,"groups",{whileLoading:!1})).data,H=e.useMemo(()=>{const e=Ee(N.data??void 0,a,o,R);return e&&{...e,outboundTag:Y(N.data.outbound,E,a)}},[N.data,a,o,R,E]),D=ge(t);return{...F,detail:H,rule:{canAdd:D.canAdd,open:D.open,label:e=>a("conn.addRuleFor",{target:e}),noTarget:a("flow.ruleNoTarget"),dialog:D.dialog},network:d,setNetwork:e=>t("flows",b(n,{network:"all"===e?null:e})),state:m,setState:e=>t("flows",b(n,{state:"all"===e?null:e})),wide:r,id:M,rulesListed:h,error:w.error,retry:w.refetch,loading:w.loading&&!w.data,panelOpen:!!M&&(!!N.data||N.loading||!!N.error),panelTitle:H?.title??M??"",detailError:N.error,detailRetry:N.refetch,detailLoading:!N.data&&N.loading,select:e=>t("flows",b(n,{id:e}),{replace:null!==M}),pinLabel:S?a("flow.mapFilter",{label:Me(S,k.data?.rules??[],_,e=>null===e?a("ui.unknown"):L(e,a))}):null,clearPin:()=>t("flows",b(n,{path:null})),connectionLabel:f?a("flow.connectionFilter",{connectionId:f}):null,clearConnection:()=>t("flows",b(n,{connection_id:null})),recordingHref:g?.runtime_settings.available?ee:null}}function Be({go:e,query:t}){const n=C(),a=q(),o=function(e,t,n){const a=se(e).map(e=>({id:e.id,label:n(e.titleKey)})),o=a[0]?.id??"map";return{tabs:a,tab:w(t,a.map(e=>e.id),o),fallback:e?o:null}}(a.data?.resources,t,n);return D(a.data?.resources),{...o,loading:a.loading&&!a.data,error:a.error,retry:a.refetch,changeTab:n=>e("flows",function(e,t,n){return h(b(e,"map"===t?{id:null,connection_id:null}:{by:null}),t,n)}(t,n,o.fallback))}}function Je(e){const n=C(),a=Be(e),o={map:t.jsx(Ke,{...e}),records:t.jsx(Qe,{...e})};return a.loading?t.jsx(A,{}):a.error?t.jsx(U,{error:a.error,onRetry:a.retry}):t.jsx("div",{className:"rp-page",children:t.jsx(le,{page:!0,label:n("nav.flows"),items:a.tabs.map(e=>({...e,content:o[e.id]})),value:a.tab,onChange:a.changeTab})})}function Ke(n){const a=C(),o=function({go:t,query:n}){const a=C(),o=new URLSearchParams(n),l=q().data?.resources,i=ce({},W(l,"flows",{whileLoading:!0})),d=s(W(l,"groups",{whileLoading:!1})),u=r(W(l,"nodes",{whileLoading:!1})),c=pe(W(l,"rules",{whileLoading:!1})),p="client"===o.get("by")?"client":"rule",m=e.useMemo(()=>Ne(i.data?.flows??[],d.data??[],u.data??[],c.data,p),[i.data,d.data,u.data,c.data,p]),f=o.get("path"),g=e.useRef(n);e.useLayoutEffect(()=>{g.current=n},[n]);const w=e.useCallback(e=>t("flows",b(g.current,{path:e})),[t]),h=e.useMemo(()=>f?_e(i.data?.flows??[],f,c.data).length:0,[i.data,f,c.data]);return{...Oe(m,[i,c,d,u].every(e=>void 0!==e.data||e.error||!e.loading)&&!!(i.data||c.data||d.data),!!i.error,f,h,a),by:p,pinned:f,error:i.error??d.error??u.error??c.error,retry:()=>{i.refetch(),d.refetch(),u.refetch(),c.refetch()},pin:w,changeBy:e=>t("flows",b(n,{by:"client"===e?"client":null,path:null})),viewPinned:()=>t("flows",b(n,{tab:"records"}))}}(n);return t.jsxs("section",{className:"rp-col","aria-label":a("flow.map"),children:[t.jsxs(ie,{page:!0,children:[o.pinLabel?t.jsx(F,{onPress:o.viewPinned,children:o.pinLabel}):t.jsx("span",{className:"rp-label",children:a("flow.mapFilterHint")}),t.jsx("span",{className:"rp-grow"}),t.jsx(F,{quiet:!0,isDisabled:!o.pinLabel,onPress:()=>o.pin(null),children:a("flow.clearMapFilter")})]}),t.jsx(U,{error:o.error,onRetry:o.retry}),t.jsxs(V,{title:a("flow.topology"),note:a("flow.topologyNote"),className:"rp-topology",aside:t.jsx(i,{label:a("flow.topology"),value:o.by,onChange:o.changeBy,items:[["rule",a("flow.byRule")],["client",a("conn.byClient")]]}),children:["loading"===o.state&&t.jsx(Q,{shape:"block",height:480}),"empty"===o.state&&t.jsx(G,{children:a("flow.mapEmpty")}),"ready"===o.state&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rp-tree-hint",children:a("flow.treePanHint")}),t.jsx(Ae,{tree:o.tree,pinned:o.pinned,onPin:o.pin})]})]})]})}function Qe(a){const o=C(),s=Ue(a),r=s.detail,c=e.useRef(s.rule);e.useLayoutEffect(()=>{c.current=s.rule});const p=e.useMemo(()=>[{id:"target",label:o("ui.target"),minWidth:128,grow:2,isRowHeader:!0,render:e=>t.jsx(B,{children:e.target})},{id:"node",label:o("nodes.node"),minWidth:96,drop:2,render:e=>e.nodeName?t.jsx(R,{name:e.node,className:"rp-chain",text:e.path??void 0}):t.jsx(B,{className:"rp-chain",text:e.path??void 0,children:e.node})},{id:"rule",label:o("ui.rule"),minWidth:152,grow:2,drop:1,render:e=>t.jsxs("span",{className:"rp-rule",children:[t.jsx(l,{expression:e.expression,href:te(e.ruleId,s.rulesListed)}),e.recomputed&&t.jsx(H,{children:o("conn.recomputed")})]})},{id:"network",label:o("ui.protocol"),minWidth:64,grow:0,drop:3,render:e=>e.network},{id:"state",label:o("ui.state"),minWidth:112,grow:0,drop:5,render:e=>e.state},{id:"started",label:o("ui.started"),minWidth:140,grow:0,drop:4,render:e=>t.jsx(ue,{at:e.startedAt})},{id:"actions",actions:!0,label:o("ui.actions"),minWidth:88,grow:0,render:e=>{const n=c.current,a=!n.canAdd(e.seed);return t.jsx(we,{label:n.label(e.target),disabled:a,tip:n.noTarget,onPress:()=>c.current.open(e.seed)})}}],[o,s.rulesListed]);return t.jsxs(t.Fragment,{children:[t.jsx(U,{error:s.error,onRetry:s.retry}),t.jsxs(ie,{page:!0,children:[t.jsx(i,{label:o("ui.network"),value:s.network,onChange:s.setNetwork,items:[["all",o("ui.all")],["tcp",o("ui.tcp")],["udp",o("ui.udp")]]}),t.jsx(d,{label:o("ui.state"),side:!0,value:s.state,onChange:s.setState,items:s.stateOptions}),s.pinLabel&&t.jsxs(F,{label:o("ui.valuePair",{label:o("flow.clearMapFilter"),value:s.pinLabel}),onPress:s.clearPin,children:[s.pinLabel,t.jsx(J,{})]}),s.connectionLabel&&t.jsxs(F,{label:o("ui.valuePair",{label:o("flow.clearConnectionFilter"),value:s.connectionLabel}),onPress:s.clearConnection,children:[s.connectionLabel,t.jsx(J,{})]}),s.coverage&&t.jsx(oe,{view:s.coverage}),s.recordingHref&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"rp-grow"}),t.jsx(re,{appearance:"button",quiet:!0,href:s.recordingHref,children:o("ui.recordingSettings")})]})]}),t.jsxs("div",{className:"rp-with-panel","data-open":s.panelOpen?"":void 0,children:[t.jsx(de,{label:o("flow.records"),rowDetail:!0,loading:s.loading,rows:s.rows,height:442,selected:s.id,onSelect:s.select,selectOnFocus:s.wide,empty:o("flow.empty"),cols:p}),t.jsxs(K,{open:s.panelOpen,title:s.panelTitle,onClose:()=>s.select(null),children:[t.jsx(U,{error:s.detailError,onRetry:s.detailRetry}),s.detailLoading&&t.jsx(Q,{shape:"rows",count:4,label:o("flow.detailLoading")}),r&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"rp-cluster",children:[t.jsx(H,{tone:r.tone,children:r.status}),t.jsx("span",{className:"rp-label",children:r.revision})]}),t.jsx(u,{inline:!0,items:[[o("ui.outbound"),t.jsx(n,{...r.outboundTag})],...r.fields]}),t.jsx("div",{className:"rp-cluster",children:r.connectionHref&&t.jsx(re,{appearance:"button",href:r.connectionHref,children:o("flow.viewConnection")})}),t.jsxs("div",{className:"rp-list",children:[!r.steps.length&&t.jsx(G,{children:o("ui.empty")}),r.steps.map(e=>t.jsxs("div",{className:"rp-col rp-step",children:[t.jsxs("div",{className:"rp-cluster",children:[t.jsx(H,{children:e.stage}),t.jsx(B,{text:e.observed,className:"rp-label",children:e.elapsed})]}),e.fields?t.jsx(u,{inline:!0,items:e.fields}):t.jsx("pre",{className:"rp-flow-raw rp-code",children:t.jsx("code",{children:e.raw})})]},e.id))]})]})]})]}),t.jsx(he,{dialog:s.rule.dialog})]})}export{Je as Flows}; diff --git a/luci-app-honk/root/etc/honk/doona/assets/GridList-D7qdplA5.js b/luci-app-honk/root/etc/honk/doona/assets/GridList-D7qdplA5.js deleted file mode 100644 index d48e4ef3..00000000 --- a/luci-app-honk/root/etc/honk/doona/assets/GridList-D7qdplA5.js +++ /dev/null @@ -1 +0,0 @@ -import{fG as e,cK as t,cD as r,cC as o,bp as a,fH as i,dY as l,eB as n,eC as s,eq as c,er as d,es as u,cL as p,et as g,ev as f,ew as y,cN as v,eu as b,el as h,e1 as m,fM as k,c$ as D,e6 as w,d3 as E,d2 as P,eA as M,cU as x,cV as S,cW as A,eN as K,cY as C,eb as T,eH as N,eJ as B,e2 as I,eO as F,cQ as L,e3 as R,e0 as V,ek as H,eI as U,eK as O,c_ as z,eT as $,eU as G,ea as W}from"./index-HxEUeoab.js";import{b as _,a as j,c as q,e as Y,f as J,g as Q}from"./Checkbox-CJt7u9-e.js";import{k as X,f as Z,e as ee,l as te,g as re,i as oe,h as ae}from"./Select-D7_6MaHd.js";import{r as ie,$ as le}from"./vendor-react-64fcanlc.js";const ne=new WeakMap;function se(e,t){let{id:r}=ne.get(e)??{};if(!r)throw new Error("Unknown list");return`${r}-${function(e){return"string"==typeof e?e.replace(/\s*/g,""):""+e}(t)}`}const ce={ltr:"ArrowRight",rtl:"ArrowLeft"},de={ltr:"ArrowLeft",rtl:"ArrowRight"};function ue(e,t,r){let{node:m,isVirtualized:k,focusMode:D="row",allowsArrowNavigation:w}=e,{direction:E}=a(),{onAction:P,linkBehavior:M,keyboardNavigationBehavior:x,shouldSelectOnPressUp:S}=ne.get(t),A=i(),K=ie.useRef(null),C=()=>{if(null!==r.current){if("child"===D){if(c(r.current)&&r.current!==d(u(r.current)))return;let e=p(r.current,{tabbable:!0}).firstChild();if(e)return g(e),void f(e,{containingElement:y(e)})}(null!=K.current&&m.key!==K.current||!c(r.current))&&g(r.current)}},T={},N=e.hasChildItems,B=t.selectionManager.isLink(m.key);if(null!=m&&"expandedKeys"in t){let e=t.collection.getChildren?.(m.key);N=N||[...e??[]].length>1,null==P&&!B&&"none"===t.selectionManager.selectionMode&&N&&(P=()=>t.toggleKey(m.key));let r=N?t.expandedKeys.has(m.key):void 0,o=1,a=m.index;if(m.level>=0&&null!=m?.parentKey){let e=t.collection.getItem(m.parentKey);if(e){let r=function(e,t){let r=t.getChildren?.(e.key),o=r?Array.from(r):[],a=o.length>0?o[0]:null,i=[];for(;a;)i.push(a),a=null!=a.nextKey?t.getItem(a.nextKey):null;return i}(e,t.collection);o=[...r].filter(e=>"item"===e.type).length,a>0&&"item"!==r[0].type&&(a-=1)}}else o=[...t.collection].filter(e=>0===e.level&&"item"===e.type).length;T={"aria-expanded":r,"aria-level":m.level+1,"aria-posinset":a+1,"aria-setsize":o}}let{itemProps:I,...F}=l({selectionManager:t.selectionManager,key:m.key,ref:r,isVirtualized:k,shouldSelectOnPressUp:e.shouldSelectOnPressUp||S,onAction:P||m.props?.onAction?n(m.props?.onAction,P?()=>P(m.key):void 0):void 0,focus:C,linkBehavior:M}),L=s(m.props),R=F.hasAction?L:{},V=o(I,R,{role:"row",onKeyDownCapture:"arrow"===x||w?e=>{let o=d(u(r.current));if(!h(e.currentTarget,v(e))||!r.current||!o)return;let a=p(r.current);if(a.currentNode=o,!pe(e,t,m,N,E,o,r.current,w))switch(e.key){case"ArrowLeft":if("arrow"===x){let t="rtl"===E?a.nextNode():a.previousNode();if(t)e.preventDefault(),e.stopPropagation(),g(t),f(t,{containingElement:y(r.current)});else if(e.preventDefault(),e.stopPropagation(),"rtl"===E)g(r.current),f(r.current,{containingElement:y(r.current)});else{a.currentNode=r.current;let e=ge(a);e&&(g(e),f(e,{containingElement:y(r.current)}))}}break;case"ArrowRight":if("arrow"===x){let t="rtl"===E?a.previousNode():a.nextNode();if(t)e.preventDefault(),e.stopPropagation(),g(t),f(t,{containingElement:y(r.current)});else if(e.preventDefault(),e.stopPropagation(),"ltr"===E)g(r.current),f(r.current,{containingElement:y(r.current)});else{a.currentNode=r.current;let e=ge(a);e&&(g(e),f(e,{containingElement:y(r.current)}))}}break;case"ArrowUp":case"ArrowDown":!e.altKey&&h(r.current,v(e))&&(e.stopPropagation(),e.preventDefault(),r.current.parentElement?.dispatchEvent(new KeyboardEvent(e.nativeEvent.type,e.nativeEvent)))}}:void 0,onFocus:e=>{K.current=m.key,v(e)===r.current?"child"===D&&e.relatedTarget&&h(r.current,e.relatedTarget)||requestAnimationFrame(()=>{"child"===D&&d(u(r.current))===r.current&&C()}):b()||t.selectionManager.setFocusedKey(m.key)},"aria-label":m["aria-label"]||m.textValue||void 0,"aria-selected":t.selectionManager.canSelectItem(m.key)?t.selectionManager.isSelected(m.key):void 0,"aria-disabled":t.selectionManager.isDisabled(m.key)||void 0,"aria-labelledby":A&&(m["aria-label"]||m.textValue)?`${se(t,m.key)} ${A}`:void 0,id:se(t,m.key)});"child"===D&&w&&"tab"===x&&(V.tabIndex=-1);let H=V.onKeyDown;if(V.onKeyDown=e=>{(e=>{let o=d(u(r.current));if(h(e.currentTarget,v(e))&&r.current&&o){if("tab"===x){if(v(e)!==r.current&&"Tab"!==e.key)return void e.stopPropagation();if(pe(e,t,m,N,E,o,r.current,w))return}if("Tab"===e.key&&"tab"===x){let t=p(r.current,{tabbable:!0});t.currentNode=o,(e.shiftKey?t.previousNode():t.nextNode())&&e.stopPropagation()}}})(e),e.isPropagationStopped()||H?.(e)},k){let{collection:e}=t,r=[...e];V["aria-rowindex"]=r.find(e=>"section"===e.type)?[...e.getKeys()].filter(t=>"section"!==e.getItem(t)?.type).findIndex(e=>e===m.key)+1:m.index+1}return{rowProps:{...o(V,T)},gridCellProps:{role:"gridcell","aria-colindex":1},descriptionProps:{id:A},...F}}function pe(e,t,r,o,a,i,l,n){if(!("expandedKeys"in t)||!n&&i!==l)return!1;if(e.key===ce[a]&&t.selectionManager.focusedKey===r.key&&o&&!t.expandedKeys.has(r.key))return t.toggleKey(r.key),e.stopPropagation(),!0;if(e.key===de[a]&&t.selectionManager.focusedKey===r.key){if(o&&t.expandedKeys.has(r.key))return t.toggleKey(r.key),e.stopPropagation(),!0;if(!t.expandedKeys.has(r.key)&&r.parentKey&&"item"===t.collection.getItem(r.parentKey)?.type)return t.selectionManager.setFocusedKey(r.parentKey),e.stopPropagation(),!0}return!1}function ge(e){let t=null,r=null;do{r=e.lastChild(),r&&(t=r)}while(r);return t}const fe=ie.createContext(null),ye=ie.forwardRef(function(e,t){return[e,t]=L(e,t,fe),le.createElement(R,{content:le.createElement(V,e)},r=>le.createElement(ve,{props:e,collection:r,gridListRef:t}))});function ve({props:i,collection:l,gridListRef:n}){[i,n]=L(i,n,N);let s,c,d,{shouldUseVirtualFocus:u,filter:p,disallowTypeAhead:g,UNSTABLE_focusOnEntry:f,...y}=i,{dragAndDropHooks:v,keyboardNavigationBehavior:b="arrow",layout:h="stack",orientation:m="vertical"}=i,{CollectionRoot:k,isVirtualized:D,layoutDelegate:E,dropTargetDelegate:M}=ie.useContext(w),K=ee({...y,collection:l,children:void 0,layoutDelegate:E}),C=te(K,p),T=H({usage:"search",sensitivity:"base"}),{disabledBehavior:B,disabledKeys:I}=C.selectionManager,{direction:F}=a(),R=ie.useMemo(()=>new U({collection:C.collection,collator:T,ref:n,disabledKeys:I,disabledBehavior:B,layoutDelegate:E,layout:h,orientation:m,direction:F}),[C.collection,n,h,m,I,B,E,T,F]),{gridProps:V}=function(a,i,l){let{isVirtualized:n,keyboardDelegate:s,layoutDelegate:c,onAction:d,disallowTypeAhead:u,linkBehavior:p="action",keyboardNavigationBehavior:g="arrow",escapeKeyBehavior:f="clearSelection",shouldSelectOnPressUp:y}=a;a["aria-label"]||a["aria-labelledby"]||console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let{listProps:v}=e({selectionManager:i.selectionManager,collection:i.collection,disabledKeys:i.disabledKeys,ref:l,keyboardDelegate:s,layoutDelegate:c,isVirtualized:n,selectOnFocus:"replace"===i.selectionManager.selectionBehavior,shouldFocusWrap:a.shouldFocusWrap,linkBehavior:p,disallowTypeAhead:u,autoFocus:a.autoFocus,escapeKeyBehavior:f,UNSTABLE_focusOnEntry:a.UNSTABLE_focusOnEntry}),b=t(a.id);ne.set(i,{id:b,onAction:d,linkBehavior:p,keyboardNavigationBehavior:g,shouldSelectOnPressUp:y});let h=_({selectionManager:i.selectionManager,hasItemActions:!!d}),m=j(l,{isDisabled:0!==i.collection.size}),k=r(a,{labelable:!0}),D=o(k,{role:"grid",id:b,"aria-multiselectable":"multiple"===i.selectionManager.selectionMode?"true":void 0},0===i.collection.size?{tabIndex:m?-1:0}:v,h);return n&&(D["aria-rowcount"]=i.collection.size,D["aria-colcount"]=1),q({},i),{gridProps:D}}({...y,keyboardDelegate:R,keyboardNavigationBehavior:"grid"===h?"tab":b,isVirtualized:D,shouldSelectOnPressUp:i.shouldSelectOnPressUp,disallowTypeAhead:g,UNSTABLE_focusOnEntry:f},C,n),$=C.selectionManager,G=!!v?.useDraggableCollectionState,W=!!v?.useDroppableCollectionState;ie.useRef(G),ie.useRef(W),ie.useEffect(()=>{},[G,W]);let Y=!1,J=null,Q=ie.useRef(null);if(G&&v){s=v.useDraggableCollectionState({collection:C.collection,selectionManager:$,preview:v.renderDragPreview?Q:void 0}),v.useDraggableCollection({},s,n);let e=v.DragPreview;J=v.renderDragPreview?le.createElement(e,{ref:Q},v.renderDragPreview):null}if(W&&v){c=v.useDroppableCollectionState({collection:C.collection,selectionManager:$});let e=v.dropTargetDelegate||M||new v.ListDropTargetDelegate(l,n,{layout:h,direction:F,orientation:m});d=v.useDroppableCollection({keyboardDelegate:R,dropTargetDelegate:e},c,n),Y=c.isDropTarget({type:"root"})}let{focusProps:se,isFocused:ce,isFocusVisible:de}=P(),ue=0===C.collection.size,pe={isDropTarget:Y,orientation:m,isEmpty:ue,isFocused:ce,isFocusVisible:de,layout:h,state:C},ge=x({...i,children:void 0,defaultClassName:"react-aria-GridList",values:pe}),fe=null;if(ue&&i.renderEmptyState){let e=i.renderEmptyState(pe);fe=le.createElement("div",{role:"row","aria-rowindex":1,style:{display:"contents"}},le.createElement("div",{role:"gridcell",style:{display:"contents"}},e))}let ye=r(i,{global:!0});return le.createElement(O,null,le.createElement(S.div,{...o(ye,ge,V,se,d?.collectionProps,null),ref:n,slot:i.slot||void 0,onScroll:i.onScroll,"data-drop-target":Y||void 0,"data-empty":ue||void 0,"data-focused":ce||void 0,"data-focus-visible":de||void 0,"data-layout":h,"data-orientation":m},le.createElement(A,{values:[[X,C],[Z,{dragAndDropHooks:v,dragState:s,dropState:c}],[re,{render:he}]]},W&&le.createElement(De,null),le.createElement(z,null,le.createElement(k,{collection:C.collection,scrollRef:n,persistedKeys:ae($,v,c),renderDropIndicator:oe(v,c)}))),fe,J))}const be=m(k,function(e,t,a){let i=ie.useContext(X),{dragAndDropHooks:l,dragState:n,dropState:s}=ie.useContext(Z),c=D(t),{isVirtualized:d}=ie.useContext(w),u=n&&!(n.isDisabled||n.selectionManager.isDisabled(a.key)),{rowProps:p,gridCellProps:g,descriptionProps:f,...y}=ue({node:a,shouldSelectOnPressUp:!!n,isVirtualized:d,focusMode:e.focusMode,allowsArrowNavigation:e.allowsArrowNavigation},i,c),{hoverProps:v,isHovered:b}=E({isDisabled:!y.allowsSelection&&!y.hasAction&&!u,onHoverStart:a.props.onHoverStart,onHoverChange:a.props.onHoverChange,onHoverEnd:a.props.onHoverEnd}),{isFocusVisible:h,focusProps:m}=P(),{isFocusVisible:k,focusProps:L}=P({within:!0}),{checkboxProps:R}=function(e,t){let{key:r}=e;const{checkboxProps:o}=Y(e,t);return{checkboxProps:{...o,"aria-labelledby":`${o.id} ${se(t,r)}`}}}({key:a.key},i),V="all"===i.selectionManager.disabledBehavior&&y.isDisabled?{isDisabled:!0}:{},H=null;n&&l&&(H=l.useDraggableItem({key:a.key,hasDragButton:!0},n));let U=null,O=ie.useRef(null),{visuallyHiddenProps:z}=M();s&&l&&(U=l.useDropIndicator({target:{type:"item",key:a.key,dropPosition:"on"}},s,O));let $=n&&n.isDragging(a.key),G=x({...e,id:void 0,children:a.rendered,defaultClassName:"react-aria-GridListItem",values:{...y,isHovered:b,isFocusVisible:h,isFocusVisibleWithin:k,selectionMode:i.selectionManager.selectionMode,selectionBehavior:i.selectionManager.selectionBehavior,allowsDragging:!!n,isDragging:$,isDropTarget:U?.isDropTarget,id:a.key,state:i}}),W=ie.useRef(null);ie.useEffect(()=>{n&&!W.current&&console.warn('Draggable items in a GridList must contain a