diff --git a/hysteria/Makefile b/hysteria/Makefile index 312977c14..b649ae69a 100644 --- a/hysteria/Makefile +++ b/hysteria/Makefile @@ -5,12 +5,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hysteria -PKG_VERSION:=1.2.0 +PKG_VERSION:=1.2.1 PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/HyNetwork/hysteria/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=aeff737d81860e736cf2ce239bf8391aea0f50957315eb0b20ea40fd07f29460 +PKG_HASH:=cdac1f149651ca5eaa77ea69ee913d0f1391a07da681ad4908a60a6603307543 PKG_LICENSE:=MIT PKG_LICENSE_FILE:=LICENSE @@ -20,7 +20,7 @@ PKG_BUILD_DEPENDS:=golang/host PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 -GO_PKG:=github.com/tobyxdd/hysteria +GO_PKG:=github.com/HyNetwork/hysteria GO_PKG_BUILD_PKG:=$(GO_PKG)/cmd GO_PKG_LDFLAGS_X:=main.appVersion=$(PKG_VERSION) diff --git a/luci-app-openclash/Makefile b/luci-app-openclash/Makefile index 8a189676c..25dbca4e0 100644 --- a/luci-app-openclash/Makefile +++ b/luci-app-openclash/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-openclash -PKG_VERSION:=0.45.51 +PKG_VERSION:=0.45.59 PKG_RELEASE:=beta PKG_MAINTAINER:=vernesong @@ -12,6 +12,18 @@ include $(INCLUDE_DIR)/package.mk define Package/$(PKG_NAME)/config config PACKAGE_kmod-inet-diag default y if PACKAGE_$(PKG_NAME) + + config PACKAGE_kmod-nft-tproxy + default y if PACKAGE_firewall4 + + config PACKAGE_kmod-ipt-nat + default y if ! PACKAGE_firewall4 + + config PACKAGE_iptables-mod-tproxy + default y if ! PACKAGE_firewall4 + + config PACKAGE_iptables-mod-extra + default y if ! PACKAGE_firewall4 endef define Package/$(PKG_NAME) @@ -19,8 +31,8 @@ define Package/$(PKG_NAME) SUBMENU:=3. Applications TITLE:=LuCI support for clash PKGARCH:=all - DEPENDS:=+iptables +dnsmasq-full +coreutils +coreutils-nohup +bash +curl +ca-bundle +ipset +ip-full \ - +iptables-mod-tproxy +iptables-mod-extra +libcap +libcap-bin +libcap-bin +ruby +ruby-yaml +kmod-tun +unzip + DEPENDS:=+dnsmasq-full +coreutils +coreutils-nohup +bash +curl +ca-bundle +ipset +ip-full \ + +libcap +libcap-bin +libcap-bin +ruby +ruby-yaml +kmod-tun +unzip MAINTAINER:=vernesong endef diff --git a/luci-app-openclash/luasrc/controller/openclash.lua b/luci-app-openclash/luasrc/controller/openclash.lua index 9ea9a5414..c25576b84 100644 --- a/luci-app-openclash/luasrc/controller/openclash.lua +++ b/luci-app-openclash/luasrc/controller/openclash.lua @@ -700,6 +700,7 @@ function action_get_run_mode() luci.http.prepare_content("application/json") luci.http.write_json({ clash = is_running(), + watchdog = is_watchdog(), mode = mode(); }) else diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/groups-config.lua b/luci-app-openclash/luasrc/model/cbi/openclash/groups-config.lua index fef0fb3a9..5b3a1188f 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/groups-config.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/groups-config.lua @@ -76,6 +76,7 @@ o.default = "false" o.rmempty = false o = s:option(Value, "test_url", translate("Test URL")) +o:value("http://cp.cloudflare.com/generate_204") o:value("http://www.gstatic.com/generate_204") o:value("https://cp.cloudflare.com/generate_204") o.rmempty = false diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua b/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua index 4e3c2b6db..991671fbc 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/other-rules-edit.lua @@ -134,17 +134,6 @@ end o:value("DIRECT") o:value("REJECT") -o = s:option(ListValue, "Douyin", translate("Douyin")) -o:depends("rule_name", "lhie1") -o.rmempty = true -for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do - if groupname ~= nil and groupname ~= "" then - o:value(groupname) - end -end -o:value("DIRECT") -o:value("REJECT") - o = s:option(ListValue, "Bahamut", translate("Bahamut")) o:depends("rule_name", "lhie1") o.rmempty = true @@ -332,6 +321,17 @@ end o:value("DIRECT") o:value("REJECT") +o = s:option(ListValue, "Discord", translate("Discord")) +o:depends("rule_name", "lhie1") +o.rmempty = true +for groupname in string.gmatch(groupnames, "([^'##\n']+)##") do + if groupname ~= nil and groupname ~= "" then + o:value(groupname) + end +end +o:value("DIRECT") +o:value("REJECT") + o = s:option(ListValue, "PayPal", translate("PayPal")) o:depends("rule_name", "lhie1") o.rmempty = true diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/proxy-provider-config.lua b/luci-app-openclash/luasrc/model/cbi/openclash/proxy-provider-config.lua index b428605f2..1bcbfc59f 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/proxy-provider-config.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/proxy-provider-config.lua @@ -97,6 +97,7 @@ o:value("true", translate("Enable")) o.default = true o = s:option(Value, "health_check_url", translate("Health Check URL")) +o:value("http://cp.cloudflare.com/generate_204") o:value("http://www.gstatic.com/generate_204") o:value("https://cp.cloudflare.com/generate_204") o.rmempty = false diff --git a/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua b/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua index 91499816b..dda0a106d 100644 --- a/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua +++ b/luci-app-openclash/luasrc/model/cbi/openclash/settings.lua @@ -66,7 +66,7 @@ o.default = "fake-ip" end o = s:taboption("op_mode", Flag, "enable_udp_proxy", font_red..bold_on..translate("Proxy UDP Traffics")..bold_off..font_off) -o.description = translate("The Servers Must Support UDP forwarding")..", "..font_red..bold_on..translate("If Docker is Installed, UDP May Not Forward Normally")..bold_off..font_off +o.description = translate("The Servers Must Support UDP forwarding").."
"..font_red..bold_on.."1."..translate("If Docker is Installed, UDP May Not Forward Normally").."
2."..translate("In Fake-ip Mode, Even If This Option is Turned Off, Domain Type Connections Still Pass Through The Core For The Availability")..bold_off..font_off o:depends("en_mode", "redir-host") o:depends("en_mode", "fake-ip") o.default = 1 @@ -597,7 +597,7 @@ o.description = translate("In The Fake-IP Mode, Only Pure IP Requests Are Suppor o = s:taboption("lan_ac", DynamicList, "lan_ac_black_ports", translate("Lan Bypassed Port List")) o.datatype = "port" o:value("5000", translate("5000(NAS)")) -o.description = translate("The Traffic From The Local Specified Port Will Not Pass The Core, Try To Set When The Bypass Gateway Forwarding Fails") +o.description = "1."..translate("The Traffic From The Local Specified Port Will Not Pass The Core, Try To Set When The Bypass Gateway Forwarding Fails").."
".."2."..translate("In The Fake-IP Mode, Only Pure IP Requests Are Supported") o = s:taboption("lan_ac", Value, "local_network_pass", translate("Local IPv4 Network Bypassed List")) o.template = "cbi/tvalue" @@ -1207,6 +1207,28 @@ o.template = "openclash/other_stream_option" o.value = "Bilibili" o:depends("stream_auto_select_bilibili", "1") +--Google not cn +o = s:taboption("stream_enhance", Flag, "stream_auto_select_google_not_cn", font_red..translate("Google Not CN")..font_off) +o.default = 0 +o:depends("stream_auto_select", "1") + +o = s:taboption("stream_enhance", Value, "stream_auto_select_group_key_google_not_cn", translate("Group Filter")) +o.default = "Google" +o.placeholder = "Google" +o.description = translate("It Will Be Searched According To The Regex When Auto Search Group Fails") +o:depends("stream_auto_select_google_not_cn", "1") + +o = s:taboption("stream_enhance", Value, "stream_auto_select_node_key_google_not_cn", translate("Unlock Nodes Filter")) +o.default = "" +o.description = translate("It Will Be Selected Nodes According To The Regex") +o:depends("stream_auto_select_google_not_cn", "1") + +o = s:taboption("stream_enhance", DummyValue, "Google", translate("Manual Test")) +o.rawhtml = true +o.template = "openclash/other_stream_option" +o.value = "Google" +o:depends("stream_auto_select_google_not_cn", "1") + ---- update Settings o = s:taboption("rules_update", Flag, "other_rule_auto_update", translate("Auto Update")) o.description = font_red..bold_on..translate("Auto Update Other Rules")..bold_off..font_off diff --git a/luci-app-openclash/luasrc/view/openclash/dlercloud.htm b/luci-app-openclash/luasrc/view/openclash/dlercloud.htm index 9721849f2..faad1eb16 100644 --- a/luci-app-openclash/luasrc/view/openclash/dlercloud.htm +++ b/luci-app-openclash/luasrc/view/openclash/dlercloud.htm @@ -131,6 +131,7 @@ text-overflow: ellipsis; line-height: 25px; height: 25px; + text-align: left; } .card .general .dler-result { diff --git a/luci-app-openclash/luasrc/view/openclash/status.htm b/luci-app-openclash/luasrc/view/openclash/status.htm index f2547aca3..29d7702a6 100644 --- a/luci-app-openclash/luasrc/view/openclash/status.htm +++ b/luci-app-openclash/luasrc/view/openclash/status.htm @@ -284,7 +284,7 @@ luci_protocol = (window.location.protocol == "http:" ? "ws://" : "wss://") + status.daip + ":" + status.cn_port; }; - if (status.clash) { + if (status.clash && status.watchdog) { radio_mode.style.display = "inline-block"; radio_de.style.display = "none"; } @@ -294,7 +294,7 @@ radio_de.innerHTML = "<%:Not Running%>"; }; - if (status.clash) { + if (status.clash && status.watchdog) { radio_ru_mode.style.display = "inline-block"; } else { @@ -451,8 +451,8 @@ } for (i=0; i<%:Fake-IP%>   |   " : '<%:Not Running%>'; - radio_run_normal.innerHTML = "<%:Enhance%>" + mode.innerHTML = status.clash && status.watchdog ? "<%:Fake-IP%>   |   " : '<%:Not Running%>'; + radio_run_normal.innerHTML = "<%:Enhance%>" } else if (status.mode == "redir-host" || status.mode == "redir-host-tun" || status.mode == "redir-host-mix") { - mode.innerHTML = status.clash ? "<%:Redir-Host%>   |   " : '<%:Not Running%>'; - radio_run_normal.innerHTML = "<%:Compatible%>" + mode.innerHTML = status.clash && status.watchdog ? "<%:Redir-Host%>   |   " : '<%:Not Running%>'; + radio_run_normal.innerHTML = "<%:Compatible%>" }; for (i=0; i"$LOCK_FILE" 2>/dev/null @@ -364,7 +365,7 @@ yml_other_rules_get() check_run_quick() { quick_start=true - check_file="$RAW_CONFIG_FILE /etc/openclash/custom/openclash_custom_domain_dns.list /etc/openclash/custom/openclash_custom_domain_dns_policy.list /etc/openclash/custom/openclash_custom_fake_filter.list /etc/openclash/custom/openclash_custom_fallback_filter.yaml /etc/openclash/custom/openclash_custom_hosts.list /etc/openclash/custom/openclash_custom_rules.list /etc/openclash/custom/openclash_custom_rules_2.list $dev_core_path $tun_core_path $meta_core_path $ipdb_path $geosite_path $geoip_path $chnr_path $chnr6_path /usr/share/openclash/res/ConnersHua.yaml /usr/share/openclash/res/ConnersHua_return.yaml /usr/share/openclash/res/lhie1.yaml /usr/share/openclash/res/openclash_version /etc/openclash/custom/openclash_force_sniffing_domain.list /etc/openclash/custom/openclash_sniffing_domain_filter.list /etc/openclash/custom/openclash_sniffing_port_filter.yaml /etc/openclash/custom/openclash_custom_localnetwork_ipv4.list /etc/openclash/custom/openclash_custom_localnetwork_ipv6.list" + check_file="$(echo $RAW_CONFIG_FILE | tr " " "?") /etc/openclash/custom/openclash_custom_domain_dns.list /etc/openclash/custom/openclash_custom_domain_dns_policy.list /etc/openclash/custom/openclash_custom_fake_filter.list /etc/openclash/custom/openclash_custom_fallback_filter.yaml /etc/openclash/custom/openclash_custom_hosts.list /etc/openclash/custom/openclash_custom_rules.list /etc/openclash/custom/openclash_custom_rules_2.list $dev_core_path $tun_core_path $meta_core_path $ipdb_path $geosite_path $geoip_path $chnr_path $chnr6_path /usr/share/openclash/res/ConnersHua.yaml /usr/share/openclash/res/ConnersHua_return.yaml /usr/share/openclash/res/lhie1.yaml /etc/openclash/custom/openclash_force_sniffing_domain.yaml /etc/openclash/custom/openclash_sniffing_domain_filter.yaml /etc/openclash/custom/openclash_sniffing_port_filter.yaml /etc/openclash/custom/openclash_custom_localnetwork_ipv4.list /etc/openclash/custom/openclash_custom_localnetwork_ipv6.list /etc/openclash/custom/openclash_custom_chnroute_pass.list /etc/openclash/custom/openclash_custom_chnroute6_pass.list" if [ ! -f "$CONFIG_FILE" ] || [ ! -f "/tmp/openclash_config.tmp" ] || [ ! -f "/tmp/openclash.change" ]; then quick_start=false return @@ -376,7 +377,7 @@ check_run_quick() else if [ -s "/tmp/openclash.change" ]; then for i in $check_file; do - if [ -z "$(grep "$i $(date -r $i)$" "/tmp/openclash.change")" ]; then + if [ -z "$(grep "$i $(date -r "$i")$" "/tmp/openclash.change")" ]; then LOG_OUT "Tip: Because of the file【 $i 】modificated, Pause quick start..." quick_start=false break @@ -395,7 +396,7 @@ write_run_quick() if ! $quick_start; then : > "/tmp/openclash.change" for i in $check_file; do - echo "$i $(date -r $i)" >> "/tmp/openclash.change" + echo "$i $(date -r "$i")" >> "/tmp/openclash.change" done 2>/dev/null fi } @@ -588,10 +589,27 @@ do_run_file() } if [ "$china_ip_route" = "1" ] || [ "$china_ip6_route" = "1" ] || [ "$disable_udp_quic" = "1" ]; then - if [ ! -f "$chnr_path" ] || [ ! -f "$chnr6_path" ]; then + if [ ! -f "$chnr_path" ] || [ ! -f "$chnr6_path" ]; then LOG_OUT "Tip: Detected that the Chnroute Cidr List is not Installed, Ready to Download..." /usr/share/openclash/openclash_chnroute.sh fi + if [ -n "$FW4" ]; then + if [ -z "$(cat "$chnr_path" |grep "define china_ip_route")" ] || [ -z "$(cat "$chnr6_path" |grep "define china_ip6_route")" ]; then + LOG_OUT "Tip: Detected that the Chnroute Cidr List Format is wrong, Ready to Reformat..." + /usr/share/openclash/openclash_chnroute.sh + if [ -z "$(cat "$chnr_path" |grep "define china_ip_route")" ] || [ -z "$(cat "$chnr6_path" |grep "define china_ip6_route")" ]; then + start_fail + fi + fi + else + if [ -n "$(cat "$chnr_path" |grep "define china_ip_route")" ] || [ -n "$(cat "$chnr6_path" |grep "define china_ip6_route")" ]; then + LOG_OUT "Tip: Detected that the Chnroute Cidr List Format is wrong, Ready to Reformat..." + /usr/share/openclash/openclash_chnroute.sh + if [ -n "$(cat "$chnr_path" |grep "define china_ip_route")" ] || [ -n "$(cat "$chnr6_path" |grep "define china_ip6_route")" ]; then + start_fail + fi + fi + fi if [ ! -f "$chnr_path" ] || [ ! -f "$chnr6_path" ]; then start_fail fi @@ -842,6 +860,16 @@ try_restore_start() } #防火墙设置部分 +nft_ac_add() +{ + if [ -z "$1" ]; then + return + fi + + nft add element inet fw4 "$2" { "$1" } 2>/dev/null + [ -n "$3" ] && nft add element inet fw4 "$3" { "$1" } 2>/dev/null +} + ac_add() { if [ -z "$1" ]; then @@ -886,71 +914,138 @@ firewall_rule_exclude() return fi - dest_port=$(echo $dest_port |sed "s/-/:/g" 2>/dev/null) - dest_ip=$(echo $dest_ip |sed "s/ /,/g" 2>/dev/null) - - if [ -z "$family" ] || [ "$family" == "ipv4" ]; then - if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 2 ]; then - for i in $dest_port; do - if $e_tcp ; then - iptables -t nat -I openclash_output -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 - if [ -z "$dest_ip" ]; then - iptables -t nat -I openclash -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 - else - iptables -t nat -I openclash -p tcp -s "$dest_ip" --sport "$i" -j RETURN >/dev/null 2>&1 + if [ -n "$FW4" ]; then + if [ -z "$family" ] || [ "$family" == "ipv4" ]; then + if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 2 ]; then + for i in $dest_port; do + if $e_tcp ; then + nft insert rule inet fw4 openclash_output position 0 meta nfproto {ipv4} tcp sport "$i" counter return >/dev/null 2>&1 + if [ -z "$dest_ip" ]; then + nft insert rule inet fw4 openclash position 0 meta nfproto {ipv4} tcp sport "$i" counter return >/dev/null 2>&1 + else + nft insert rule inet fw4 openclash position 0 ip saddr { "$dest_ip" } tcp sport "$i" counter return >/dev/null 2>&1 + fi fi - fi - if $e_udp ; then - iptables -t mangle -I openclash_output -p udp --sport "$i" -j RETURN >/dev/null 2>&1 - if [ -z "$dest_ip" ]; then - iptables -t mangle -I openclash -p udp --sport "$i" -j RETURN >/dev/null 2>&1 - else - iptables -t mangle -I openclash -p udp -s "$dest_ip" --sport "$i" -j RETURN >/dev/null 2>&1 + if $e_udp ; then + nft insert rule inet fw4 openclash_mangle_output position 0 meta nfproto {ipv4} udp sport "$i" counter return >/dev/null 2>&1 + if [ -z "$dest_ip" ]; then + nft insert rule inet fw4 openclash_mangle position 0 meta nfproto {ipv4} udp sport "$i" counter return >/dev/null 2>&1 + else + nft insert rule inet fw4 openclash_mangle position 0 ip saddr { "$dest_ip" } udp sport "$i" counter return >/dev/null 2>&1 + fi fi - fi - done - elif [ "$en_mode_tun" -eq 1 ]; then - for i in $dest_port; do - if $e_tcp ; then - iptables -t mangle -I openclash_output -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 - if [ -z "$dest_ip" ]; then - iptables -t mangle -I openclash -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 - else - iptables -t mangle -I openclash -p tcp -s "$dest_ip" --sport "$i" -j RETURN >/dev/null 2>&1 + done + elif [ "$en_mode_tun" -eq 1 ]; then + for i in $dest_port; do + if $e_tcp ; then + nft insert rule inet fw4 openclash_mangle_output position 0 meta nfproto {ipv4} tcp sport "$i" counter return >/dev/null 2>&1 + if [ -z "$dest_ip" ]; then + nft insert rule inet fw4 openclash_mangle position 0 meta nfproto {ipv4} tcp sport "$i" counter return >/dev/null 2>&1 + else + nft insert rule inet fw4 openclash_mangle position 0 ip saddr { "$dest_ip" } tcp sport "$i" counter return >/dev/null 2>&1 + fi fi - fi - if $e_udp ; then - iptables -t mangle -I openclash_output -p udp --sport "$i" -j RETURN >/dev/null 2>&1 - if [ -z "$dest_ip" ]; then - iptables -t mangle -I openclash -p udp --sport "$i" -j RETURN >/dev/null 2>&1 - else - iptables -t mangle -I openclash -p udp -s "$dest_ip" --sport "$i" -j RETURN >/dev/null 2>&1 + if $e_udp ; then + nft insert rule inet fw4 openclash_mangle_output position 0 meta nfproto {ipv4} udp sport "$i" counter return >/dev/null 2>&1 + if [ -z "$dest_ip" ]; then + nft insert rule inet fw4 openclash_mangle position 0 meta nfproto {ipv4} udp sport "$i" counter return >/dev/null 2>&1 + else + nft insert rule inet fw4 openclash_mangle position 0 ip saddr { "$dest_ip" } udp sport "$i" counter return >/dev/null 2>&1 + fi fi - fi - done + done + fi fi - fi - - if [ "$ipv6_enable" -eq 1 ] && [ -n "$(ip6tables -t mangle -L 2>&1 | grep -o 'Chain')" ]; then - if [ -z "$family" ] || [ "$family" == "ipv6" ]; then - for i in $dest_port; do - if $e_tcp ; then - if [ -z "$dest_ip" ]; then - ip6tables -t mangle -I openclash -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 - else - ip6tables -t mangle -I openclash -s "$dest_ip" -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 - fi - ip6tables -t mangle -I openclash_output -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 - fi - if $e_udp ; then - if [ -z "$dest_ip" ]; then - ip6tables -t mangle -I openclash -p udp --sport "$i" -j RETURN >/dev/null 2>&1 - else - ip6tables -t mangle -I openclash -s "$dest_ip" -p udp --sport "$i" -j RETURN >/dev/null 2>&1 - fi - ip6tables -t mangle -I openclash_output -p udp --sport "$i" -j RETURN >/dev/null 2>&1 - fi - done + + if [ "$ipv6_enable" -eq 1 ]; then + if [ -z "$family" ] || [ "$family" == "ipv6" ]; then + for i in $dest_port; do + if $e_tcp ; then + if [ -z "$dest_ip" ]; then + nft insert rule inet fw4 openclash_mangle_v6 position 0 meta nfproto {ipv6} tcp sport "$i" counter return >/dev/null 2>&1 + else + nft insert rule inet fw4 openclash_mangle_v6 position 0 ip6 saddr { "$dest_ip" } tcp sport "$i" counter return >/dev/null 2>&1 + fi + nft insert rule inet fw4 openclash_mangle_output_v6 position 0 meta nfproto {ipv6} tcp sport "$i" counter return >/dev/null 2>&1 + fi + if $e_udp ; then + if [ -z "$dest_ip" ]; then + nft insert rule inet fw4 openclash_mangle_v6 position 0 meta nfproto {ipv6} udp sport "$i" counter return >/dev/null 2>&1 + else + nft insert rule inet fw4 openclash_mangle_v6 position 0 ip6 saddr { "$dest_ip" } udp sport "$i" counter return >/dev/null 2>&1 + fi + nft insert rule inet fw4 openclash_mangle_output_v6 position 0 meta nfproto {ipv6} udp sport "$i" counter return >/dev/null 2>&1 + fi + done + fi + fi + else + dest_port=$(echo $dest_port |sed "s/-/:/g" 2>/dev/null) + dest_ip=$(echo $dest_ip |sed "s/ /,/g" 2>/dev/null) + + if [ -z "$family" ] || [ "$family" == "ipv4" ]; then + if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 2 ]; then + for i in $dest_port; do + if $e_tcp ; then + iptables -t nat -I openclash_output -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 + if [ -z "$dest_ip" ]; then + iptables -t nat -I openclash -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 + else + iptables -t nat -I openclash -p tcp -s "$dest_ip" --sport "$i" -j RETURN >/dev/null 2>&1 + fi + fi + if $e_udp ; then + iptables -t mangle -I openclash_output -p udp --sport "$i" -j RETURN >/dev/null 2>&1 + if [ -z "$dest_ip" ]; then + iptables -t mangle -I openclash -p udp --sport "$i" -j RETURN >/dev/null 2>&1 + else + iptables -t mangle -I openclash -p udp -s "$dest_ip" --sport "$i" -j RETURN >/dev/null 2>&1 + fi + fi + done + elif [ "$en_mode_tun" -eq 1 ]; then + for i in $dest_port; do + if $e_tcp ; then + iptables -t mangle -I openclash_output -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 + if [ -z "$dest_ip" ]; then + iptables -t mangle -I openclash -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 + else + iptables -t mangle -I openclash -p tcp -s "$dest_ip" --sport "$i" -j RETURN >/dev/null 2>&1 + fi + fi + if $e_udp ; then + iptables -t mangle -I openclash_output -p udp --sport "$i" -j RETURN >/dev/null 2>&1 + if [ -z "$dest_ip" ]; then + iptables -t mangle -I openclash -p udp --sport "$i" -j RETURN >/dev/null 2>&1 + else + iptables -t mangle -I openclash -p udp -s "$dest_ip" --sport "$i" -j RETURN >/dev/null 2>&1 + fi + fi + done + fi + fi + + if [ "$ipv6_enable" -eq 1 ] && [ -n "$(ip6tables -t mangle -L 2>&1 | grep -o 'Chain')" ]; then + if [ -z "$family" ] || [ "$family" == "ipv6" ]; then + for i in $dest_port; do + if $e_tcp ; then + if [ -z "$dest_ip" ]; then + ip6tables -t mangle -I openclash -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 + else + ip6tables -t mangle -I openclash -s "$dest_ip" -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 + fi + ip6tables -t mangle -I openclash_output -p tcp --sport "$i" -j RETURN >/dev/null 2>&1 + fi + if $e_udp ; then + if [ -z "$dest_ip" ]; then + ip6tables -t mangle -I openclash -p udp --sport "$i" -j RETURN >/dev/null 2>&1 + else + ip6tables -t mangle -I openclash -s "$dest_ip" -p udp --sport "$i" -j RETURN >/dev/null 2>&1 + fi + ip6tables -t mangle -I openclash_output -p udp --sport "$i" -j RETURN >/dev/null 2>&1 + fi + done + fi fi fi } @@ -982,62 +1077,114 @@ firewall_redirect_exclude() return fi - dest_port=$(echo $dest_port |sed "s/-/:/g" 2>/dev/null) - src_dport=$(echo $src_dport |sed "s/-/:/g" 2>/dev/null) - dest_ip=$(echo $dest_ip |sed "s/ /,/g" 2>/dev/null) - [ -n "$dest_ip" ] && dest_ip="-s ${dest_ip}" - - if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 2 ]; then - if $e_tcp ; then - iptables -t nat -I openclash_output "$dest_ip" -p tcp --sport "$dest_port" -j RETURN >/dev/null 2>&1 - iptables -t nat -I openclash_output "$dest_ip" -p tcp --dport "$src_dport" -j RETURN >/dev/null 2>&1 - fi - if $e_udp ; then - iptables -t mangle -I openclash_output "$dest_ip" -p udp --sport "$dest_port" -j RETURN >/dev/null 2>&1 - iptables -t mangle -I openclash_output "$dest_ip" -p udp --dport "$src_dport" -j RETURN >/dev/null 2>&1 - if [ -n "$dest_ip" ]; then - iptables -t mangle -I openclash "$dest_ip" -p udp --dport "$src_dport" -j RETURN >/dev/null 2>&1 - iptables -t mangle -I openclash "$dest_ip" -p udp --sport "$dest_port" -j RETURN >/dev/null 2>&1 + if [ -n "$FW4" ]; then + if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 2 ]; then + if $e_tcp ; then + nft insert rule inet fw4 openclash_output position 0 ip saddr { "$dest_ip" } tcp sport "$dest_port" counter return >/dev/null 2>&1 + nft insert rule inet fw4 openclash_output position 0 ip saddr { "$dest_ip" } tcp dport "$src_dport" counter return >/dev/null 2>&1 + fi + if $e_udp ; then + nft insert rule inet fw4 openclash_mangle_output position 0 ip saddr { "$dest_ip" } udp sport "$dest_port" counter return >/dev/null 2>&1 + nft insert rule inet fw4 openclash_mangle_output position 0 ip saddr { "$dest_ip" } udp dport "$src_dport" counter return >/dev/null 2>&1 + if [ -n "$dest_ip" ]; then + nft insert rule inet fw4 openclash_mangle position 0 ip saddr { "$dest_ip" } udp sport "$dest_port" counter return >/dev/null 2>&1 + nft insert rule inet fw4 openclash_mangle position 0 ip saddr { "$dest_ip" } udp dport "$src_dport" counter return >/dev/null 2>&1 + fi + fi + elif [ "$en_mode_tun" -eq 1 ]; then + if $e_tcp ; then + nft insert rule inet fw4 openclash_mangle_output position 0 ip saddr { "$dest_ip" } tcp sport "$dest_port" counter return >/dev/null 2>&1 + nft insert rule inet fw4 openclash_mangle_output position 0 ip saddr { "$dest_ip" } tcp dport "$src_dport" counter return >/dev/null 2>&1 + if [ -n "$dest_ip" ]; then + nft insert rule inet fw4 openclash_mangle position 0 ip saddr { "$dest_ip" } tcp sport "$dest_port" counter return >/dev/null 2>&1 + nft insert rule inet fw4 openclash_mangle position 0 ip saddr { "$dest_ip" } tcp dport "$src_dport" counter return >/dev/null 2>&1 + fi + fi + if $e_udp ; then + nft insert rule inet fw4 openclash_mangle_output position 0 ip saddr { "$dest_ip" } udp sport "$dest_port" counter return >/dev/null 2>&1 + nft insert rule inet fw4 openclash_mangle_output position 0 ip saddr { "$dest_ip" } udp dport "$src_dport" counter return >/dev/null 2>&1 + if [ -n "$dest_ip" ]; then + nft insert rule inet fw4 openclash_mangle position 0 ip saddr { "$dest_ip" } udp sport "$dest_port" counter return >/dev/null 2>&1 + nft insert rule inet fw4 openclash_mangle position 0 ip saddr { "$dest_ip" } udp dport "$src_dport" counter return >/dev/null 2>&1 + fi fi fi - elif [ "$en_mode_tun" -eq 1 ]; then - if $e_tcp ; then - iptables -t mangle -I openclash_output -p tcp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 - iptables -t mangle -I openclash_output -p tcp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 - if [ -n "$dest_ip" ]; then - iptables -t mangle -I openclash -p tcp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 - iptables -t mangle -I openclash -p tcp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 - fi - fi - if $e_udp ; then - iptables -t mangle -I openclash_output -p udp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 - iptables -t mangle -I openclash_output -p udp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 - if [ -n "$dest_ip" ]; then - iptables -t mangle -I openclash -p udp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 - iptables -t mangle -I openclash -p udp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 + + if [ "$ipv6_enable" -eq 1 ]; then + if $e_tcp ; then + if [ -n "$dest_ip" ]; then + nft insert rule inet fw4 openclash_mangle_v6 position 0 ip6 saddr { "$dest_ip" } tcp sport "$dest_port" counter return >/dev/null 2>&1 + nft insert rule inet fw4 openclash_mangle_v6 position 0 ip6 saddr { "$dest_ip" } tcp dport "$src_dport" counter return >/dev/null 2>&1 + fi + nft insert rule inet fw4 openclash_mangle_output_v6 position 0 ip6 saddr { "$dest_ip" } tcp sport "$dest_port" counter return >/dev/null 2>&1 + nft insert rule inet fw4 openclash_mangle_output_v6 position 0 ip6 saddr { "$dest_ip" } tcp dport "$src_dport" counter return >/dev/null 2>&1 + fi + if $e_udp ; then + if [ -n "$dest_ip" ]; then + nft insert rule inet fw4 openclash_mangle_v6 position 0 ip6 saddr { "$dest_ip" } udp sport "$dest_port" counter return >/dev/null 2>&1 + nft insert rule inet fw4 openclash_mangle_v6 position 0 ip6 saddr { "$dest_ip" } udp dport "$src_dport" counter return >/dev/null 2>&1 + fi + nft insert rule inet fw4 openclash_mangle_output_v6 position 0 ip6 saddr { "$dest_ip" } udp sport "$dest_port" counter return >/dev/null 2>&1 + nft insert rule inet fw4 openclash_mangle_output_v6 position 0 ip6 saddr { "$dest_ip" } udp dport "$src_dport" counter return >/dev/null 2>&1 + fi + fi + else + dest_port=$(echo $dest_port |sed "s/-/:/g" 2>/dev/null) + src_dport=$(echo $src_dport |sed "s/-/:/g" 2>/dev/null) + dest_ip=$(echo $dest_ip |sed "s/ /,/g" 2>/dev/null) + [ -n "$dest_ip" ] && dest_ip="-s ${dest_ip}" + + if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 2 ]; then + if $e_tcp ; then + iptables -t nat -I openclash_output "$dest_ip" -p tcp --sport "$dest_port" -j RETURN >/dev/null 2>&1 + iptables -t nat -I openclash_output "$dest_ip" -p tcp --dport "$src_dport" -j RETURN >/dev/null 2>&1 + fi + if $e_udp ; then + iptables -t mangle -I openclash_output "$dest_ip" -p udp --sport "$dest_port" -j RETURN >/dev/null 2>&1 + iptables -t mangle -I openclash_output "$dest_ip" -p udp --dport "$src_dport" -j RETURN >/dev/null 2>&1 + if [ -n "$dest_ip" ]; then + iptables -t mangle -I openclash "$dest_ip" -p udp --dport "$src_dport" -j RETURN >/dev/null 2>&1 + iptables -t mangle -I openclash "$dest_ip" -p udp --sport "$dest_port" -j RETURN >/dev/null 2>&1 + fi + fi + elif [ "$en_mode_tun" -eq 1 ]; then + if $e_tcp ; then + iptables -t mangle -I openclash_output -p tcp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 + iptables -t mangle -I openclash_output -p tcp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 + if [ -n "$dest_ip" ]; then + iptables -t mangle -I openclash -p tcp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 + iptables -t mangle -I openclash -p tcp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 + fi + fi + if $e_udp ; then + iptables -t mangle -I openclash_output -p udp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 + iptables -t mangle -I openclash_output -p udp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 + if [ -n "$dest_ip" ]; then + iptables -t mangle -I openclash -p udp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 + iptables -t mangle -I openclash -p udp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 + fi + fi + fi + + if [ "$ipv6_enable" -eq 1 ] && [ -n "$(ip6tables -t mangle -L 2>&1 | grep -o 'Chain')" ]; then + if $e_tcp ; then + if [ -n "$dest_ip" ]; then + ip6tables -t mangle -I openclash -p tcp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 + ip6tables -t mangle -I openclash -p tcp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 + fi + ip6tables -t mangle -I openclash_output -p tcp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 + ip6tables -t mangle -I openclash_output -p tcp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 + fi + if $e_udp ; then + if [ -n "$dest_ip" ]; then + ip6tables -t mangle -I openclash -p udp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 + ip6tables -t mangle -I openclash -p udp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 + fi + ip6tables -t mangle -I openclash_output -p udp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 + ip6tables -t mangle -I openclash_output -p udp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 fi fi fi - - if [ "$ipv6_enable" -eq 1 ] && [ -n "$(ip6tables -t mangle -L 2>&1 | grep -o 'Chain')" ]; then - if $e_tcp ; then - if [ -n "$dest_ip" ]; then - ip6tables -t mangle -I openclash -p tcp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 - ip6tables -t mangle -I openclash -p tcp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 - fi - ip6tables -t mangle -I openclash_output -p tcp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 - ip6tables -t mangle -I openclash_output -p tcp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 - fi - if $e_udp ; then - if [ -n "$dest_ip" ]; then - ip6tables -t mangle -I openclash -p udp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 - ip6tables -t mangle -I openclash -p udp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 - fi - ip6tables -t mangle -I openclash_output -p udp "$dest_ip" --sport "$dest_port" -j RETURN >/dev/null 2>&1 - ip6tables -t mangle -I openclash_output -p udp "$dest_ip" --dport "$src_dport" -j RETURN >/dev/null 2>&1 - fi - fi - } set_firewall() @@ -1052,7 +1199,8 @@ if [ -z "$(uci -q get firewall.openclash)" ] || [ -z "$(uci -q get ucitrack.@ope uci -q set firewall.openclash=include uci -q set firewall.openclash.type=script uci -q set firewall.openclash.path=/var/etc/openclash.include - uci -q set firewall.openclash.reload=1 + [ -n "$FW4" ] || uci -q set firewall.openclash.reload=1 + uci -q commit firewall fi mkdir -p /var/etc @@ -1060,496 +1208,993 @@ cat > "/var/etc/openclash.include" <<-EOF /etc/init.d/openclash reload "firewall" >/dev/null 2>&1 EOF -if [ "$china_ip_route" = "1" ] || [ "$disable_udp_quic" = "1" ]; then - ipset -! flush china_ip_route 2>/dev/null - ipset -! restore /dev/null - mkdir -p /tmp/dnsmasq.d 2>/dev/null - echo "create china_ip_route_pass hash:net family inet hashsize 1024 maxelem 1000000" >/tmp/openclash_china_ip_route_pass.list - awk '!/^$/&&!/^#/&&/(^([1-9]|1[0-9]|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.)(([0-9]{1,2}|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.){2}([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-5][0-9]|25[0-4])((\/[0-9][0-9])?)$/{printf("add china_ip_route_pass %s'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute_pass.list >>/tmp/openclash_china_ip_route_pass.list 2>/dev/null - awk '!/^$/&&!/^#/&&!/(^([1-9]|1[0-9]|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.)(([0-9]{1,2}|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.){2}([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-5][0-9]|25[0-4])((\/[0-9][0-9])?)$/{printf("ipset=/%s/china_ip_route_pass'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute_pass.list >>/tmp/dnsmasq.d/dnsmasq_openclash_chnroute_pass.conf 2>/dev/null - ipset -! flush china_ip_route_pass 2>/dev/null - ipset -! restore /dev/null - rm -rf /tmp/openclash_china_ip_route_pass.list 2>/dev/null +local settype nftflag +if dnsmasq --version | grep -q 'Compile time options:.* nftset'; then + settype="nftset" + nftflag="inet#fw4#" +else + settype="ipset" fi -if [ "$enable_redirect_dns" -eq 1 ] && [ -z "$(iptables -t nat -nL PREROUTING --line-number |grep 'OpenClash DNS Hijack')"]; then - DNSPORT=$(uci -q get dhcp.@dnsmasq[0].port) - if [ -z "$DNSPORT" ]; then - DNSPORT=$(netstat -nlp |grep -E '127.0.0.1:.*dnsmasq' |awk -F '127.0.0.1:' '{print $2}' |awk '{print $1}' |head -1 || echo "$dns_port") - fi - iptables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" - iptables -t nat -I PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" -fi - -#lan_google_dns_ac -if [ -n "$(uci -q get openclash.config.lan_block_google_dns_ips)" ]; then - ipset create lan_block_google_dns_ips hash:net - ipset create lan_block_google_dns_ipv6s hash:net family inet6 - config_load "openclash" - config_list_foreach "config" "lan_block_google_dns_ips" ac_add "lan_block_google_dns_ips" "lan_block_google_dns_ipv6s" -fi -if [ -n "$(uci -q get openclash.config.lan_block_google_dns_macs)" ]; then - ipset create lan_block_google_dns_macs hash:mac - config_load "openclash" - config_list_foreach "config" "lan_block_google_dns_macs" ac_add "lan_block_google_dns_macs" -fi - -#lan_ac -if [ "$operation_mode" = "redir-host" ] && [ "$en_mode" = "redir-host" ]; then - if [ "$lan_ac_mode" = "0" ]; then - if [ -n "$(uci -q get openclash.config.lan_ac_black_ips)" ]; then - ipset create lan_ac_black_ips hash:net - ipset create lan_ac_black_ipv6s hash:net family inet6 - config_load "openclash" - config_list_foreach "config" "lan_ac_black_ips" ac_add "lan_ac_black_ips" "lan_ac_black_ipv6s" - fi - if [ -n "$(uci -q get openclash.config.lan_ac_black_macs)" ]; then - ipset create lan_ac_black_macs hash:mac - config_load "openclash" - config_list_foreach "config" "lan_ac_black_macs" ac_add "lan_ac_black_macs" - fi - elif [ "$lan_ac_mode" = "1" ]; then - if [ -n "$(uci -q get openclash.config.lan_ac_white_ips)" ]; then - ipset create lan_ac_white_ips hash:net - ipset create lan_ac_white_ipv6s hash:net family inet6 - config_load "openclash" - config_list_foreach "config" "lan_ac_white_ips" ac_add "lan_ac_white_ips" "lan_ac_white_ipv6s" - fi - if [ -n "$(uci -q get openclash.config.lan_ac_white_macs)" ]; then - ipset create lan_ac_white_macs hash:mac - config_load "openclash" - config_list_foreach "config" "lan_ac_white_macs" ac_add "lan_ac_white_macs" - fi - fi -fi - -#wan ac -if [ -n "$(uci -q get openclash.config.wan_ac_black_ips)" ]; then - ipset create wan_ac_black_ips hash:net - ipset create wan_ac_black_ipv6s hash:net family inet6 - config_load "openclash" - config_list_foreach "config" "wan_ac_black_ips" ac_add "wan_ac_black_ips" "wan_ac_black_ipv6s" -fi - -#lan port ac -if [ -n "$(uci -q get openclash.config.lan_ac_black_ports)" ]; then - ipset create lan_ac_black_ports bitmap:port range 0-65535 - config_load "openclash" - config_list_foreach "config" "lan_ac_black_ports" ac_add "lan_ac_black_ports" -fi - -#local - ipset create localnetwork hash:net - if [ -f "/etc/openclash/custom/openclash_custom_localnetwork_ipv4.list" ]; then - for line in `cat "/etc/openclash/custom/openclash_custom_localnetwork_ipv4.list"` +if [ -n "$FW4" ]; then + if [ "$china_ip_route" = "1" ] || [ "$disable_udp_quic" = "1" ]; then + nft 'flush set inet fw4 china_ip_route' + nft -f '/etc/openclash/china_ip_route.ipset' 2>/dev/null + CHNROUTE_WAIT=0 + while ( [ -z "$(nft list sets |grep "set china_ip_route {")" ] && [ "$CHNROUTE_WAIT" -le 3 ] ) do - ipset add localnetwork "$line" - done 2>/dev/null - else - ipset add localnetwork 0.0.0.0/8 - ipset add localnetwork 127.0.0.0/8 - ipset add localnetwork 10.0.0.0/8 - ipset add localnetwork 169.254.0.0/16 - ipset add localnetwork 192.168.0.0/16 - ipset add localnetwork 224.0.0.0/4 - ipset add localnetwork 240.0.0.0/4 - ipset add localnetwork 172.16.0.0/12 - ipset add localnetwork 100.64.0.0/10 - fi - - if [ -n "$lan_ip_cidrs" ]; then - for lan_ip_cidr in $lan_ip_cidrs; do - ipset add localnetwork "$lan_ip_cidr" 2>/dev/null + nft -f '/etc/openclash/china_ip_route.ipset' 2>/dev/null done - fi - if [ -n "$wan_ip4s" ]; then - for wan_ip4 in $wan_ip4s; do - ipset add localnetwork "$wan_ip4" 2>/dev/null - done - fi - -#common ports -if [ "$common_ports" = "1" ]; then - common_port="21 22 23 53 80 123 143 194 443 465 587 853 993 995 998 2052 2053 2082 2083 2086 2095 2096 5222 5228 5229 5230 8080 8443 8880 8888 8889" - ipset create common_ports bitmap:port range 0-65535 - for i in $common_port; do - ipset add common_ports $i - done -fi - -#bypass gateway compatible -if [ "$bypass_gateway_compatible" -eq 1 ]; then - iptables -t nat -N openclash_post - iptables -t nat -F openclash_post - iptables -t nat -A openclash_post -m mark --mark "$PROXY_FWMARK" -m comment --comment "OpenClash Bypass Gateway Compatible" -j ACCEPT - iptables -t nat -A openclash_post -m comment --comment "OpenClash Bypass Gateway Compatible" -m set --match-set localnetwork dst -j RETURN - iptables -t nat -A openclash_post -m addrtype ! --src-type LOCAL -m owner ! --uid-owner 65534 -m comment --comment "OpenClash Bypass Gateway Compatible" -j MASQUERADE - iptables -t nat -A POSTROUTING -j openclash_post -fi - -#intranet allowed -if [ "$intranet_allowed" -eq 1 ]; then - wan_ints=$(iptables-save -t filter |grep -e "-j zone_wan_input" 2>/dev/null |awk '{for (i=1;i<=NF;i++) {if ($i ~ /-i/) {print $(i+1)}}}' 2>/dev/null) - if [ -n "$wan_ints" ]; then - iptables -t filter -N openclash_wan_input - iptables -t filter -F openclash_wan_input - for wan_int in $wan_ints; do - iptables -t filter -I INPUT -i "$wan_int" -m set ! --match-set localnetwork src -j openclash_wan_input - done - iptables -t filter -A openclash_wan_input -p udp -m multiport --dport "$proxy_port,$tproxy_port,$cn_port,$http_port,$socks_port,$mixed_port,$dns_port" -j REJECT >/dev/null 2>&1 - iptables -t filter -A openclash_wan_input -p tcp -m multiport --dport "$proxy_port,$tproxy_port,$cn_port,$http_port,$socks_port,$mixed_port,$dns_port" -j REJECT >/dev/null 2>&1 - fi -fi - -if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 2 ]; then - #tcp - iptables -t nat -N openclash - iptables -t nat -F openclash - iptables -t nat -A openclash -m set --match-set localnetwork dst -j RETURN - iptables -t nat -A openclash -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN - iptables -t nat -A openclash -m set --match-set wan_ac_black_ips dst -j RETURN >/dev/null 2>&1 - iptables -t nat -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 - iptables -t nat -A openclash -m set --match-set lan_ac_black_macs src -j RETURN >/dev/null 2>&1 - iptables -t nat -A openclash -m set ! --match-set lan_ac_white_macs src -j RETURN >/dev/null 2>&1 - iptables -t nat -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 - if [ "$en_mode" = "redir-host" ]; then - iptables -t nat -A openclash -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 - if [ "$china_ip_route" = "1" ]; then - iptables -t nat -A openclash -m set --match-set china_ip_route dst -m set ! --match-set china_ip_route_pass dst -j RETURN >/dev/null 2>&1 - fi - fi - iptables -t nat -A openclash -p tcp -j REDIRECT --to-ports "$proxy_port" - iptables -t nat -A PREROUTING -p tcp -j openclash - if [ -z "$en_mode_tun" ]; then - #Google dns - iptables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Hijack" -p tcp -d 8.8.8.8 --dport 53 -j REDIRECT --to-ports "$proxy_port" - iptables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Hijack" -p tcp -d 8.8.4.4 --dport 53 -j REDIRECT --to-ports "$proxy_port" - #udp - if [ "$enable_udp_proxy" -eq 1 ]; then - modprobe xt_TPROXY >/dev/null 2>&1 - ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" - ip route add local 0.0.0.0/0 dev lo table "$PROXY_ROUTE_TABLE" - iptables -t mangle -N openclash - iptables -t mangle -F openclash - iptables -t mangle -A openclash -m set --match-set localnetwork dst -j RETURN - iptables -t mangle -A openclash -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN - iptables -t mangle -A openclash -m set --match-set wan_ac_black_ips dst -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash -m set --match-set lan_ac_black_macs src -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_macs src -j RETURN >/dev/null 2>&1 - if [ "$en_mode" = "redir-host" ]; then - iptables -t mangle -A openclash -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 - if [ "$china_ip_route" = "1" ]; then - iptables -t mangle -A openclash -m set --match-set china_ip_route dst -m set ! --match-set china_ip_route_pass dst -j RETURN >/dev/null 2>&1 - fi - fi - iptables -t mangle -A openclash -p udp --dport 53 -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash -p udp -j TPROXY --on-port "$tproxy_port" --tproxy-mark "$PROXY_FWMARK" - iptables -t mangle -A PREROUTING -p udp -j openclash - - #quic - if [ "$disable_udp_quic" -eq 1 ]; then - iptables -I INPUT -p udp --dport 443 -m comment --comment "OpenClash QUIC REJECT" -m set ! --match-set china_ip_route dst -j REJECT >/dev/null 2>&1 - fi - - elif [ "$en_mode" = "fake-ip" ]; then - modprobe xt_TPROXY >/dev/null 2>&1 - ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" - ip route add local 0.0.0.0/0 dev lo table "$PROXY_ROUTE_TABLE" - iptables -t mangle -N openclash - iptables -t mangle -F openclash - iptables -t mangle -A openclash -p udp -d 198.18.0.0/16 -j TPROXY --on-port "$tproxy_port" --tproxy-mark "$PROXY_FWMARK" - iptables -t mangle -A PREROUTING -p udp -j openclash - - #quic - if [ "$disable_udp_quic" -eq 1 ]; then - iptables -I INPUT -p udp --dport 443 -m comment --comment "OpenClash QUIC REJECT" -m set ! --match-set china_ip_route dst -j REJECT >/dev/null 2>&1 - fi - fi - fi - - if [ -z "$_koolshare" ]; then - iptables -t nat -N openclash_output - iptables -t nat -F openclash_output - iptables -t nat -A openclash_output -m set --match-set localnetwork dst -j RETURN - iptables -t nat -A openclash_output -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN - if [ "$en_mode" = "fake-ip" ]; then - iptables -t nat -A openclash_output -m owner ! --uid-owner 65534 -p tcp -d 198.18.0.0/16 -j REDIRECT --to-ports "$proxy_port" - fi - iptables -t nat -A openclash_output -m owner ! --uid-owner 65534 -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 - if [ "$en_mode" = "redir-host" ]; then - iptables -t nat -A openclash_output -m set --match-set wan_ac_black_ips dst -j RETURN >/dev/null 2>&1 - if [ "$china_ip_route" = "1" ]; then - iptables -t nat -A openclash_output -m owner ! --uid-owner 65534 -m set --match-set china_ip_route dst -m set ! --match-set china_ip_route_pass dst -j RETURN >/dev/null 2>&1 - fi - fi - iptables -t nat -A openclash_output -m owner ! --uid-owner 65534 -p tcp -j REDIRECT --to-ports "$proxy_port" - else - if [ "$en_mode" = "fake-ip" ]; then - iptables -t nat -N openclash_output - iptables -t nat -F openclash_output - if [ "$enable_redirect_dns" -eq 1 ] && [ -z "$(iptables -t nat -nL OUTPUT --line-number |grep 'OpenClash DNS Hijack')"]; then - iptables -t nat -I OUTPUT -p udp --dport 53 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" - iptables -t nat -I OUTPUT -p tcp --dport 53 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" - fi - iptables -t nat -A openclash_output -m set --match-set localnetwork dst -j RETURN - iptables -t nat -A openclash_output -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN - iptables -t nat -A openclash_output -p tcp -d 198.18.0.0/16 -j REDIRECT --to-ports "$proxy_port" - - fi - fi - iptables -t nat -A OUTPUT -j openclash_output >/dev/null 2>&1 -fi - -if [ -n "$en_mode_tun" ]; then - #TUN模式 - #启动TUN - TUN_WAIT=0 - ip link set utun up - - while ( [ -n "$(pidof clash)" ] && [ -z "$(ip route list |grep utun)" ] && [ "$TUN_WAIT" -le 3 ] ) - do - ip link set utun up - let TUN_WAIT++ - sleep 2 - done - - ip route replace default dev utun table "$PROXY_ROUTE_TABLE" - ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" - - #MTU UP TO 65535 - ifconfig utun mtu 65535 >/dev/null 2>&1 - - #设置防火墙 - if [ "$en_mode" = "fake-ip" ]; then - iptables -t mangle -N openclash_output - iptables -t mangle -F openclash_output - iptables -t mangle -A openclash_output -m set --match-set localnetwork dst -j RETURN - iptables -t mangle -A openclash_output -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN - if [ "$en_mode_tun" -eq 1 ]; then - if [ -z "$_koolshare" ]; then - iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK" - iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -p tcp -j MARK --set-mark "$PROXY_FWMARK" - else - iptables -t mangle -A openclash_output -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK" - fi - elif [ -z "$_koolshare" ]; then - iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -p udp -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK" - fi - iptables -t mangle -A OUTPUT -j openclash_output - elif [ -z "$_koolshare" ] && [ "$en_mode" = "redir-host" ] && [ "$en_mode_tun" -eq 1 ]; then - iptables -t mangle -N openclash_output - iptables -t mangle -F openclash_output - iptables -t mangle -A openclash_output -m set --match-set localnetwork dst -j RETURN - iptables -t mangle -A openclash_output -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN - iptables -t mangle -A openclash_output -m set --match-set wan_ac_black_ips dst -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 - if [ "$china_ip_route" = "1" ]; then - iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -m set --match-set china_ip_route dst -m set ! --match-set china_ip_route_pass dst -j RETURN >/dev/null 2>&1 - fi - iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -p tcp -j MARK --set-mark "$PROXY_FWMARK" - iptables -t mangle -A OUTPUT -j openclash_output - fi - - iptables -t mangle -N openclash - iptables -t mangle -F openclash - iptables -t mangle -N openclash_dns_hijack - iptables -t mangle -F openclash_dns_hijack - #其他流量 - iptables -t mangle -A openclash -m set --match-set localnetwork dst -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN - iptables -t mangle -A openclash -m set --match-set wan_ac_black_ips dst -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash -m set --match-set lan_ac_black_macs src -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 - iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_macs src -j RETURN >/dev/null 2>&1 - if [ "$en_mode" = "redir-host" ]; then - iptables -t mangle -A openclash -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 - if [ "$china_ip_route" = "1" ]; then - iptables -t mangle -A openclash -m set --match-set china_ip_route dst -m set ! --match-set china_ip_route_pass dst -j RETURN >/dev/null 2>&1 - fi - fi - iptables -t mangle -A openclash -j MARK --set-mark "$PROXY_FWMARK" - - if [ "$en_mode_tun" -eq 1 ]; then - iptables -t mangle -I PREROUTING -j openclash - iptables -t nat -I PREROUTING -m comment --comment "OpenClash TCP DNS Hijack" -p tcp --dport 53 -j ACCEPT - else - iptables -t mangle -I PREROUTING -p tcp --dport 53 -j openclash_dns_hijack - iptables -t mangle -A openclash_dns_hijack -m comment --comment "OpenClash TCP DNS Hijack" -p tcp --dport 53 -j MARK --set-mark "$PROXY_FWMARK" - iptables -t mangle -I PREROUTING -p udp -j openclash - iptables -t nat -I PREROUTING -m comment --comment "OpenClash TCP DNS Hijack" -p tcp --dport 53 -j ACCEPT - fi - - #TUN FORWORD - iptables -I FORWARD -m comment --comment "OpenClash TUN Forward" -o utun -j ACCEPT - - #quic - if [ "$disable_udp_quic" -eq 1 ]; then - iptables -I FORWARD -p udp --dport 443 -o utun -m comment --comment "OpenClash QUIC REJECT" -m set ! --match-set china_ip_route dst -j REJECT >/dev/null 2>&1 - fi -fi - -#google_dns_block -if [ -n "$(uci -q get openclash.config.lan_block_google_dns_ips)" ] || [ -n "$(uci -q get openclash.config.lan_block_google_dns_macs)" ]; then - ipset create openclash_google_dns_ips hash:net - ipset add openclash_google_dns_ips 8.8.8.8 - ipset add openclash_google_dns_ips 8.8.4.4 - - if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 2 ]; then - iptables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Block" -m set --match-set lan_block_google_dns_ips src -m set --match-set openclash_google_dns_ips dst -j ACCEPT >/dev/null 2>&1 - iptables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Block" -m set --match-set lan_block_google_dns_macs src -m set --match-set openclash_google_dns_ips dst -j ACCEPT >/dev/null 2>&1 - fi - iptables -t filter -I FORWARD -m set --match-set lan_block_google_dns_ips src -m set --match-set openclash_google_dns_ips dst -j REJECT >/dev/null 2>&1 - iptables -t filter -I FORWARD -m set --match-set lan_block_google_dns_macs src -m set --match-set openclash_google_dns_ips dst -j REJECT >/dev/null 2>&1 -fi - -#ipv6 -if [ "$ipv6_enable" -eq 1 ] && [ -n "$(ip6tables -t mangle -L 2>&1 | grep -o 'Chain')" ]; then - if [ "$enable_redirect_dns" -eq 1 ] && [ -z "$(ip6tables -t nat -nL PREROUTING --line-number |grep 'DNS Hijack')"]; then - ip6tables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" - ip6tables -t nat -I PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" - fi - - if [ "$china_ip6_route" = "1" ] || [ "$disable_udp_quic" = "1" ]; then - ipset -! flush china_ip6_route 2>/dev/null - ipset -! restore /dev/null mkdir -p /tmp/dnsmasq.d 2>/dev/null - echo "create china_ip6_route_pass hash:net family inet6 hashsize 1024 maxelem 1000000" >/tmp/openclash_china_ip6_route_pass.list - awk '!/^$/&&!/^#/&&!/^(\*?\.?)*[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})*$/{printf("add china_ip6_route_pass %s'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute6_pass.list >>/tmp/openclash_china_ip6_route_pass.list 2>/dev/null - awk '!/^$/&&!/^#/&&/^(\*?\.?)*[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})*$/{printf("ipset=/%s/china_ip6_route_pass'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute6_pass.list >>/tmp/dnsmasq.d/dnsmasq_openclash_chnroute6_pass.conf 2>/dev/null - ipset -! flush china_ip6_route_pass 2>/dev/null - ipset -! restore /dev/null - rm -rf /tmp/openclash_china_ip6_route_pass.list 2>/dev/null - fi - - #local - ipset create localnetwork6 hash:net family inet6 - if [ -f "/etc/openclash/custom/openclash_custom_localnetwork_ipv6.list" ]; then - for line in `cat "/etc/openclash/custom/openclash_custom_localnetwork_ipv6.list"` - do - ipset add localnetwork6 "$line" - done 2>/dev/null - else - ipset add localnetwork6 ::/128 - ipset add localnetwork6 ::1/128 - ipset add localnetwork6 ::ffff:0:0/96 - ipset add localnetwork6 ::ffff:0:0:0/96 - ipset add localnetwork6 64:ff9b::/96 - ipset add localnetwork6 100::/64 - ipset add localnetwork6 2001::/32 - ipset add localnetwork6 2001:20::/28 - ipset add localnetwork6 2001:db8::/32 - ipset add localnetwork6 2002::/16 - ipset add localnetwork6 fc00::/7 - ipset add localnetwork6 fe80::/10 - ipset add localnetwork6 ff00::/8 + + echo "add set inet fw4 china_ip_route_pass { type ipv4_addr; flags interval; auto-merge; }" >>/tmp/openclash_china_ip_route_pass.list + [ -z `(awk '!/^$/&&!/^#/&&/(^([1-9]|1[0-9]|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.)(([0-9]{1,2}|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.){2}([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-5][0-9]|25[0-4])((\/[0-9][0-9])?)$/{printf(" %s,'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute_pass.list)` ] || { + echo "define china_ip_route_pass = {" >/tmp/openclash_china_ip_route_pass.list + awk '!/^$/&&!/^#/&&/(^([1-9]|1[0-9]|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.)(([0-9]{1,2}|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.){2}([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-5][0-9]|25[0-4])((\/[0-9][0-9])?)$/{printf(" %s,'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute_pass.list >>/tmp/openclash_china_ip_route_pass.list 2>/dev/null + echo "}" >>/tmp/openclash_china_ip_route_pass.list + echo 'add element inet fw4 china_ip_route_pass $china_ip_route_pass' >>/tmp/openclash_china_ip_route_pass.list + } + awk '!/^$/&&!/^#/&&!/(^([1-9]|1[0-9]|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.)(([0-9]{1,2}|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.){2}([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-5][0-9]|25[0-4])((\/[0-9][0-9])?)$/{printf("'${settype}'=/%s/'${nftflag}'china_ip_route_pass'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute_pass.list >>/tmp/dnsmasq.d/dnsmasq_openclash_chnroute_pass.conf 2>/dev/null + nft 'flush set inet fw4 china_ip_route_pass' 2>/dev/null + nft -f '/tmp/openclash_china_ip_route_pass.list' 2>/dev/null + rm -rf /tmp/openclash_china_ip_route_pass.list 2>/dev/null fi - if [ -n "$lan_ip6_cidrs" ]; then - for lan_ip6_cidr in $lan_ip6_cidrs; do - ipset add localnetwork6 "$lan_ip6_cidr" 2>/dev/null - done - fi - - if [ -n "$wan_ip6s" ]; then - for wan_ip6 in $wan_ip6s; do - ipset add localnetwork6 "$wan_ip6" - done - fi - - modprobe xt_TPROXY >/dev/null 2>&1 - ip -6 rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" - ip -6 route add local ::/0 dev lo table "$PROXY_ROUTE_TABLE" - - #Google dns - ip6tables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Hijack" -p tcp -d 2001:4860:4860::8888 --dport 53 -j ACCEPT - ip6tables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Hijack" -p tcp -d 2001:4860:4860::8844 --dport 53 -j ACCEPT - - ip6tables -t mangle -N openclash - ip6tables -t mangle -F openclash - ip6tables -t mangle -A openclash -m set --match-set localnetwork6 dst -j RETURN - ip6tables -t mangle -A openclash -m set --match-set localnetwork6 src -m set --match-set lan_ac_black_ports src -j RETURN - ip6tables -t mangle -A openclash -m set --match-set wan_ac_black_ipv6s dst -j RETURN >/dev/null 2>&1 - if [ "$en_mode" == "redir-host" ]; then - ip6tables -t mangle -A openclash -m set --match-set lan_ac_black_macs src -j RETURN >/dev/null 2>&1 - ip6tables -t mangle -A openclash -m set --match-set lan_ac_black_ipv6s src -j RETURN >/dev/null 2>&1 - ip6tables -t mangle -A openclash -m set ! --match-set lan_ac_white_ipv6s src -j RETURN >/dev/null 2>&1 - ip6tables -t mangle -A openclash -m set ! --match-set lan_ac_white_macs src -j RETURN >/dev/null 2>&1 - ip6tables -t mangle -A openclash -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 - fi - if [ "$china_ip6_route" = "1" ]; then - ip6tables -t mangle -A openclash -m set --match-set china_ip6_route dst -m set ! --match-set china_ip6_route_pass dst -j RETURN >/dev/null 2>&1 - fi - ip6tables -t mangle -A openclash -p tcp -m comment --comment "OpenClash TCP Tproxy" -j TPROXY --on-port "$tproxy_port" --tproxy-mark "$PROXY_FWMARK" - ip6tables -t mangle -A PREROUTING -j openclash - - if [ -z "$_koolshare" ]; then - ip6tables -t mangle -N openclash_output - ip6tables -t mangle -F openclash_output - ip6tables -t mangle -A openclash_output -m set --match-set localnetwork6 dst -j RETURN - ip6tables -t mangle -A openclash_output -m set --match-set localnetwork6 src -m set --match-set lan_ac_black_ports src -j RETURN - ip6tables -t mangle -A openclash_output -m set --match-set wan_ac_black_ipv6s dst -j RETURN >/dev/null 2>&1 - ip6tables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 - if [ "$china_ip6_route" = "1" ]; then - ip6tables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -m set --match-set china_ip6_route dst -m set ! --match-set china_ip6_route_pass dst -j RETURN >/dev/null 2>&1 + if [ "$enable_redirect_dns" -eq 1 ] && [ -z "$(nft list chain inet fw4 dstnat |grep 'OpenClash DNS Hijack')"]; then + DNSPORT=$(uci -q get dhcp.@dnsmasq[0].port) + if [ -z "$DNSPORT" ]; then + DNSPORT=$(netstat -nlp |grep -E '127.0.0.1:.*dnsmasq' |awk -F '127.0.0.1:' '{print $2}' |awk '{print $1}' |head -1 || echo "$dns_port") fi - ip6tables -t mangle -A openclash_output -p tcp -m owner ! --uid-owner 65534 -j MARK --set-xmark "$PROXY_FWMARK" - ip6tables -t mangle -A OUTPUT -j openclash_output + nft insert rule inet fw4 dstnat position 0 tcp dport 53 redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\" 2>/dev/null + nft insert rule inet fw4 dstnat position 0 udp dport 53 redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\" 2>/dev/null fi - - #udp - if [ "$enable_udp_proxy" -eq 1 ] || [ -n "$en_mode_tun" ]; then - ip6tables -t mangle -A openclash_output -p udp -m owner ! --uid-owner 65534 -j MARK --set-xmark "$PROXY_FWMARK" - ip6tables -t mangle -A openclash -p udp -m comment --comment "OpenClash TCP Tproxy" -j TPROXY --on-port "$tproxy_port" --tproxy-mark "$PROXY_FWMARK" + + #lan_google_dns_ac + if [ -n "$(uci -q get openclash.config.lan_block_google_dns_ips)" ]; then + nft 'add set inet fw4 lan_block_google_dns_ips { type ipv4_addr; flags interval; auto-merge; }' 2>/dev/null + nft 'add set inet fw4 lan_block_google_dns_ipv6s { type ipv6_addr; flags interval; auto-merge; }' 2>/dev/null + config_load "openclash" + config_list_foreach "config" "lan_block_google_dns_ips" nft_ac_add "lan_block_google_dns_ips" "lan_block_google_dns_ipv6s" fi - - #quic - if [ "$disable_udp_quic" -eq 1 ]; then - ip6tables -I INPUT -p udp --dport 443 -m comment --comment "OpenClash QUIC REJECT" -m set ! --match-set china_ip6_route dst -j REJECT >/dev/null 2>&1 + if [ -n "$(uci -q get openclash.config.lan_block_google_dns_macs)" ]; then + nft 'add set inet fw4 lan_block_google_dns_macs { type ether_addr; }' 2>/dev/null + config_load "openclash" + config_list_foreach "config" "lan_block_google_dns_macs" nft_ac_add "lan_block_google_dns_macs" fi - + + #lan_ac + if [ "$operation_mode" = "redir-host" ] && [ "$en_mode" = "redir-host" ]; then + if [ "$lan_ac_mode" = "0" ]; then + if [ -n "$(uci -q get openclash.config.lan_ac_black_ips)" ]; then + nft 'add set inet fw4 lan_ac_black_ips { type ipv4_addr; flags interval; auto-merge; }' 2>/dev/null + nft 'add set inet fw4 lan_ac_black_ipv6s { type ipv6_addr; flags interval; auto-merge; }' 2>/dev/null + config_load "openclash" + config_list_foreach "config" "lan_ac_black_ips" nft_ac_add "lan_ac_black_ips" "lan_ac_black_ipv6s" + fi + if [ -n "$(uci -q get openclash.config.lan_ac_black_macs)" ]; then + nft 'add set inet fw4 lan_ac_black_macs { type ether_addr; }' 2>/dev/null + config_load "openclash" + config_list_foreach "config" "lan_ac_black_macs" nft_ac_add "lan_ac_black_macs" + fi + elif [ "$lan_ac_mode" = "1" ]; then + if [ -n "$(uci -q get openclash.config.lan_ac_white_ips)" ]; then + nft 'add set inet fw4 lan_ac_white_ips { type ipv4_addr; flags interval; auto-merge; }' 2>/dev/null + nft 'add set inet fw4 lan_ac_white_ipv6s { type ipv6_addr; flags interval; auto-merge; }' 2>/dev/null + config_load "openclash" + config_list_foreach "config" "lan_ac_white_ips" nft_ac_add "lan_ac_white_ips" "lan_ac_white_ipv6s" + fi + if [ -n "$(uci -q get openclash.config.lan_ac_white_macs)" ]; then + nft 'add set inet fw4 lan_ac_white_macs { type ether_addr; }' 2>/dev/null + config_load "openclash" + config_list_foreach "config" "lan_ac_white_macs" nft_ac_add "lan_ac_white_macs" + fi + fi + fi + + #wan ac + if [ -n "$(uci -q get openclash.config.wan_ac_black_ips)" ]; then + nft 'add set inet fw4 wan_ac_black_ips { type ipv4_addr; flags interval; auto-merge; }' 2>/dev/null + nft 'add set inet fw4 wan_ac_black_ipv6s { type ipv6_addr; flags interval; auto-merge; }' 2>/dev/null + config_load "openclash" + config_list_foreach "config" "wan_ac_black_ips" nft_ac_add "wan_ac_black_ips" "wan_ac_black_ipv6s" + fi + + #lan port ac + if [ -n "$(uci -q get openclash.config.lan_ac_black_ports)" ]; then + nft 'add set inet fw4 lan_ac_black_ports { type inet_service; }' 2>/dev/null + config_load "openclash" + config_list_foreach "config" "lan_ac_black_ports" nft_ac_add "lan_ac_black_ports" + fi + + #local + nft 'add set inet fw4 localnetwork { type ipv4_addr; flags interval; auto-merge; }' + #nft 'delete set inet fw4 localnetwork' + if [ -f "/etc/openclash/custom/openclash_custom_localnetwork_ipv4.list" ]; then + for line in `cat "/etc/openclash/custom/openclash_custom_localnetwork_ipv4.list"` + do + nft add element inet fw4 localnetwork { "$line" } 2>/dev/null + done 2>/dev/null + else + nft 'add element inet fw4 localnetwork { 0.0.0.0/8, 127.0.0.0/8, 10.0.0.0/8, 169.254.0.0/16, 192.168.0.0/16, 224.0.0.0/4, 240.0.0.0/4, 172.16.0.0/12, 100.64.0.0/10}' + fi + + if [ -n "$lan_ip_cidrs" ]; then + for lan_ip_cidr in $lan_ip_cidrs; do + nft add element inet fw4 localnetwork { "$lan_ip_cidr" } 2>/dev/null + done + fi + + if [ -n "$wan_ip4s" ]; then + for wan_ip4 in $wan_ip4s; do + nft add element inet fw4 localnetwork { "$wan_ip4" } 2>/dev/null + done + fi + + #common ports + if [ "$common_ports" = "1" ]; then + common_port="21 22 23 53 80 123 143 194 443 465 587 853 993 995 998 2052 2053 2082 2083 2086 2095 2096 5222 5228 5229 5230 8080 8443 8880 8888 8889" + nft 'add set inet fw4 common_ports { type inet_service; }' + for i in $common_port; do + nft add element inet fw4 common_ports { "$i" } + done + fi + #bypass gateway compatible if [ "$bypass_gateway_compatible" -eq 1 ]; then - ip6tables -t nat -N openclash_post - ip6tables -t nat -F openclash_post - ip6tables -t nat -A openclash_post -m mark --mark "$PROXY_FWMARK" -m comment --comment "OpenClash Bypass Gateway Compatible" -j ACCEPT - ip6tables -t nat -A openclash_post -m comment --comment "OpenClash Bypass Gateway Compatible" -m set --match-set localnetwork6 dst -j RETURN - ip6tables -t nat -A openclash_post -m addrtype ! --src-type LOCAL -m owner ! --uid-owner 65534 -m comment --comment "OpenClash Bypass Gateway Compatible" -j MASQUERADE - ip6tables -t nat -A POSTROUTING -j openclash_post + #nft 'delete chain inet fw4 openclash_post' 2>/dev/null + nft 'add chain inet fw4 openclash_post' 2>/dev/null + nft 'flush chain inet fw4 openclash_post' 2>/dev/null + nft add rule inet fw4 openclash_post meta mark "$PROXY_FWMARK" counter accept 2>/dev/null + nft 'add rule inet fw4 openclash_post ip daddr @localnetwork counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_post meta nfproto {ipv4} fib saddr type != { local } meta skuid != 65534 counter masquerade' 2>/dev/null + nft add rule inet fw4 srcnat meta nfproto {ipv4} counter jump openclash_post comment \"OpenClash Bypass Gateway Compatible\" 2>/dev/null + fi + + #intranet allowed + if [ "$intranet_allowed" -eq 1 ]; then + wan_ints=$(nft list chain inet fw4 input |grep -e "jump input_wan" 2>/dev/null |awk '{for (i=1;i<=NF;i++) {if ($i ~ /iifname/) {print $(i+1)}}}' 2>/dev/null |sed 's/"//g') + if [ -n "$wan_ints" ]; then + nft 'add chain inet fw4 openclash_wan_input' 2>/dev/null + nft 'flush chain inet fw4 openclash_wan_input' 2>/dev/null + for wan_int in $wan_ints; do + #nft delete rule inet fw4 input $(nft -a list chain inet fw4 input |grep "@localnetwork" |awk -F '# ' '{print$2}') + nft insert rule inet fw4 input position 0 iifname "$wan_int" ip saddr != @localnetwork counter jump openclash_wan_input 2>/dev/null + done + nft add rule inet fw4 openclash_wan_input udp dport {$proxy_port,$tproxy_port,$cn_port,$http_port,$socks_port,$mixed_port,$dns_port} counter reject + nft add rule inet fw4 openclash_wan_input tcp dport {$proxy_port,$tproxy_port,$cn_port,$http_port,$socks_port,$mixed_port,$dns_port} counter reject + fi + fi + + if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 2 ]; then + #tcp + nft 'add chain inet fw4 openclash' 2>/dev/null + nft 'flush chain inet fw4 openclash' 2>/dev/null + nft 'add rule inet fw4 openclash ip daddr @localnetwork counter return' 2>/dev/null + if [ -z "$en_mode_tun" ] && [ "$en_mode" = "fake-ip" ]; then + nft add rule inet fw4 openclash ip protocol tcp ip daddr {198.18.0.0/16} counter redirect to "$proxy_port" 2>/dev/null + fi + nft 'add rule inet fw4 openclash ip saddr @localnetwork tcp sport @lan_ac_black_ports counter return' 2>/dev/null + nft 'add rule inet fw4 openclash ip daddr @wan_ac_black_ips counter return' 2>/dev/null + nft 'add rule inet fw4 openclash ip saddr @lan_ac_black_ips counter return' 2>/dev/null + nft 'add rule inet fw4 openclash ether saddr @lan_ac_black_macs counter return' 2>/dev/null + nft 'add rule inet fw4 openclash ether saddr != @lan_ac_white_macs counter return' 2>/dev/null + nft 'add rule inet fw4 openclash ip saddr != @lan_ac_white_ips counter return' 2>/dev/null + + if [ "$en_mode" = "redir-host" ]; then + nft 'add rule inet fw4 openclash tcp dport != @common_ports counter return' 2>/dev/null + if [ "$china_ip_route" = "1" ]; then + nft 'add rule inet fw4 openclash ip daddr @china_ip_route ip daddr != @china_ip_route_pass counter return' 2>/dev/null + fi + fi + nft add rule inet fw4 openclash ip protocol tcp counter redirect to "$proxy_port" 2>/dev/null + nft 'add rule inet fw4 dstnat ip protocol tcp counter jump openclash' 2>/dev/null + if [ -z "$en_mode_tun" ]; then + #Google dns + nft insert rule inet fw4 dstnat position 0 ip daddr { 8.8.8.8, 8.8.4.4 } tcp dport 53 counter redirect to "$proxy_port" comment \"OpenClash Google DNS Hijack\" 2>/dev/null + #udp + if [ "$enable_udp_proxy" -eq 1 ]; then + modprobe nft_tproxy >/dev/null 2>&1 + ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" + ip route add local 0.0.0.0/0 dev lo table "$PROXY_ROUTE_TABLE" + nft 'add chain inet fw4 openclash_mangle' 2>/dev/null + nft 'flush chain inet fw4 openclash_mangle' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle ip daddr @localnetwork counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle udp dport 53 counter return' 2>/dev/null + if [ "$en_mode" = "fake-ip" ]; then + nft add rule inet fw4 openclash_mangle meta l4proto { udp } ip daddr {198.18.0.0/16} mark set "$PROXY_FWMARK" tproxy ip to 127.0.0.1:"$tproxy_port" counter accept 2>/dev/null + fi + nft 'add rule inet fw4 openclash_mangle ip saddr @localnetwork udp sport @lan_ac_black_ports counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle ip daddr @wan_ac_black_ips counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle ip saddr @lan_ac_black_ips counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle ether saddr @lan_ac_black_macs counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle ether saddr != @lan_ac_white_macs counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle ip saddr != @lan_ac_white_ips counter return' 2>/dev/null + + if [ "$en_mode" = "redir-host" ]; then + nft 'add rule inet fw4 openclash_mangle udp dport != @common_ports counter return' 2>/dev/null + if [ "$china_ip_route" = "1" ]; then + nft 'add rule inet fw4 openclash_mangle ip daddr @china_ip_route ip daddr != @china_ip_route_pass counter return' 2>/dev/null + fi + fi + + nft add rule inet fw4 openclash_mangle meta l4proto { udp } mark set "$PROXY_FWMARK" tproxy ip to 127.0.0.1:"$tproxy_port" counter accept 2>/dev/null + nft 'add rule inet fw4 mangle_prerouting ip protocol udp counter jump openclash_mangle' 2>/dev/null + + elif [ "$en_mode" = "fake-ip" ]; then + modprobe nft_tproxy >/dev/null 2>&1 + ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" + ip route add local 0.0.0.0/0 dev lo table "$PROXY_ROUTE_TABLE" + nft 'add chain inet fw4 openclash_mangle' 2>/dev/null + nft 'flush chain inet fw4 openclash_mangle' 2>/dev/null + nft add rule inet fw4 openclash_mangle meta l4proto { udp } ip daddr {198.18.0.0/16} mark set "$PROXY_FWMARK" tproxy ip to 127.0.0.1:"$tproxy_port" counter accept 2>/dev/null + nft 'add rule inet fw4 mangle_prerouting ip protocol udp counter jump openclash_mangle' 2>/dev/null + + nft 'add chain inet fw4 openclash_mangle_output' 2>/dev/null + nft 'flush chain inet fw4 openclash_mangle_output' 2>/dev/null + nft add rule inet fw4 openclash_mangle_output meta l4proto { udp } ip daddr {198.18.0.0/16} mark set "$PROXY_FWMARK" 2>/dev/null + nft 'add rule inet fw4 mangle_output ip protocol udp counter jump openclash_mangle_output' 2>/dev/null + fi + + #quic + if [ "$disable_udp_quic" -eq 1 ]; then + nft insert rule inet fw4 input position 0 udp dport 443 ip daddr != @china_ip_route counter reject comment \"OpenClash QUIC REJECT\" 2>/dev/null + fi + fi + + nft 'add chain inet fw4 openclash_output' 2>/dev/null + nft 'flush chain inet fw4 openclash_output' 2>/dev/null + nft 'add rule inet fw4 openclash_output ip daddr @localnetwork counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_output ip saddr @localnetwork tcp sport @lan_ac_black_ports counter return' 2>/dev/null + + if [ "$en_mode" = "fake-ip" ]; then + nft add rule inet fw4 openclash_output ip protocol tcp ip daddr {198.18.0.0/16} skuid != 65534 counter redirect to "$proxy_port" 2>/dev/null + fi + nft add rule inet fw4 openclash_output tcp dport != @common_ports skuid != 65534 counter return 2>/dev/null + if [ "$en_mode" = "redir-host" ]; then + nft 'add rule inet fw4 openclash_output ip daddr @wan_ac_black_ips counter return' 2>/dev/null + if [ "$china_ip_route" = "1" ]; then + nft 'add rule inet fw4 openclash_output skuid != 65534 ip daddr @china_ip_route ip daddr != @china_ip_route_pass counter return' 2>/dev/null + fi + fi + nft add rule inet fw4 openclash_output ip protocol tcp skuid != 65534 counter redirect to "$proxy_port" 2>/dev/null + nft 'add chain inet fw4 nat_output { type nat hook output priority -1; }' + nft 'add rule inet fw4 nat_output ip protocol tcp counter jump openclash_output' 2>/dev/null + fi + + if [ -n "$en_mode_tun" ]; then + #TUN模式 + #启动TUN + TUN_WAIT=0 + ip link set utun up + + while ( [ -n "$(pidof clash)" ] && [ -z "$(ip route list |grep utun)" ] && [ "$TUN_WAIT" -le 3 ] ) + do + ip link set utun up + let TUN_WAIT++ + sleep 2 + done + + ip route replace default dev utun table "$PROXY_ROUTE_TABLE" + ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" + + #MTU UP TO 65535 + ifconfig utun mtu 65535 >/dev/null 2>&1 + + #设置防火墙 + nft 'add chain inet fw4 openclash_mangle_output' 2>/dev/null + nft 'flush chain inet fw4 openclash_mangle_output' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_output ip daddr @localnetwork counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_output ip saddr @localnetwork meta l4proto {tcp,udp} th sport @lan_ac_black_ports counter return' 2>/dev/null + if [ "$en_mode" = "fake-ip" ]; then + if [ "$en_mode_tun" -eq 1 ]; then + nft add rule inet fw4 openclash_mangle_output meta l4proto {tcp,udp} th dport { 0-65535 } ip daddr {198.18.0.0/16} mark set "$PROXY_FWMARK" 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_output meta l4proto {tcp,udp} th dport != @common_ports skuid != 65534 counter return' 2>/dev/null + nft add rule inet fw4 openclash_mangle_output tcp dport { 0-65535 } skuid != 65534 meta mark set "$PROXY_FWMARK" 2>/dev/null + else + nft add rule inet fw4 openclash_mangle_output skuid != 65534 udp dport { 0-65535 } ip daddr {198.18.0.0/16} meta mark set "$PROXY_FWMARK" 2>/dev/null + fi + elif [ "$en_mode" = "redir-host" ] && [ "$en_mode_tun" -eq 1 ]; then + nft 'add rule inet fw4 openclash_mangle_output ip daddr @wan_ac_black_ips counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_output meta l4proto {tcp,udp} th dport != @common_ports skuid != 65534 counter return' 2>/dev/null + if [ "$china_ip_route" = "1" ]; then + nft 'add rule inet fw4 openclash_mangle_output skuid != 65534 ip daddr @china_ip_route ip daddr != @china_ip_route_pass counter return' 2>/dev/null + fi + nft add rule inet fw4 openclash_mangle_output tcp dport { 0-65535 } skuid != 65534 meta mark set "$PROXY_FWMARK" 2>/dev/null + fi + nft 'add rule inet fw4 mangle_output meta l4proto {tcp,udp} counter jump openclash_mangle_output' 2>/dev/null + + nft 'add chain inet fw4 openclash_mangle' 2>/dev/null + nft 'flush chain inet fw4 openclash_mangle' 2>/dev/null + nft 'add chain inet fw4 openclash_dns_hijack' 2>/dev/null + nft 'flush chain inet fw4 openclash_dns_hijack' 2>/dev/null + + #其他流量 + nft 'add rule inet fw4 openclash_mangle ip daddr @localnetwork counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle ip saddr @localnetwork meta l4proto {tcp,udp} th sport @lan_ac_black_ports counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle ip daddr @wan_ac_black_ips counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle ip saddr @lan_ac_black_ips counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle ether saddr @lan_ac_black_macs counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle ether saddr != @lan_ac_white_macs counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle ip saddr != @lan_ac_white_ips counter return' 2>/dev/null + + if [ "$en_mode" = "redir-host" ]; then + nft 'add rule inet fw4 openclash_mangle meta l4proto {tcp,udp} th dport != @common_ports counter return' 2>/dev/null + if [ "$china_ip_route" = "1" ]; then + nft 'add rule inet fw4 openclash_mangle ip daddr @china_ip_route ip daddr != @china_ip_route_pass counter return' 2>/dev/null + fi + fi + nft add rule inet fw4 openclash_mangle meta l4proto {tcp,udp} th dport { 0-65535 } mark set "$PROXY_FWMARK" 2>/dev/null + + if [ "$en_mode_tun" -eq 1 ]; then + nft 'insert rule inet fw4 mangle_prerouting position 0 meta l4proto {tcp,udp} counter jump openclash_mangle' 2>/dev/null + nft insert rule inet fw4 dstnat position 0 meta nfproto {ipv4} tcp dport 53 counter accept comment \"OpenClash TCP DNS Hijack\" 2>/dev/null + else + nft 'insert rule inet fw4 mangle_prerouting position 0 meta nfproto {ipv4} tcp dport 53 counter jump openclash_dns_hijack' 2>/dev/null + nft add rule inet fw4 openclash_dns_hijack meta nfproto {ipv4} tcp dport 53 mark set "$PROXY_FWMARK" comment \"OpenClash TCP DNS Hijack\" 2>/dev/null + nft insert rule inet fw4 dstnat position 0 meta nfproto {ipv4} tcp dport 53 counter accept comment \"OpenClash TCP DNS Hijack\" 2>/dev/null + nft 'insert rule inet fw4 mangle_prerouting position 0 ip protocol udp counter jump openclash_mangle' 2>/dev/null + fi + + #TUN FORWORD + nft insert rule inet fw4 forward position 0 meta l4proto {tcp,udp} oifname utun counter accept comment \"OpenClash TUN Forward\" 2>/dev/null + + #quic + if [ "$disable_udp_quic" -eq 1 ]; then + nft insert rule inet fw4 forward position 0 oifname utun udp dport 443 ip daddr != @china_ip_route counter reject comment \"OpenClash QUIC REJECT\" 2>/dev/null + fi fi #google_dns_block if [ -n "$(uci -q get openclash.config.lan_block_google_dns_ips)" ] || [ -n "$(uci -q get openclash.config.lan_block_google_dns_macs)" ]; then - ipset create openclash_google_dns_ipv6s hash:net family inet6 - ipset add openclash_google_dns_ipv6s 2001:4860:4860::8888 - ipset add openclash_google_dns_ipv6s 2001:4860:4860::8844 - ipset add openclash_google_dns_ipv6s 2001:4860:4860::6464 - ipset add openclash_google_dns_ipv6s 2001:4860:4860::64 - - ip6tables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Block" -m set --match-set lan_block_google_dns_ipv6s src -m set --match-set openclash_google_dns_ipv6s dst -j ACCEPT - ip6tables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Block" -m set --match-set lan_block_google_dns_macs src -m set --match-set openclash_google_dns_ipv6s dst -j ACCEPT - ip6tables -t filter -I FORWARD -m set --match-set lan_block_google_dns_ipv6s src -m set --match-set openclash_google_dns_ipv6s dst -j REJECT >/dev/null 2>&1 - ip6tables -t filter -I FORWARD -m set --match-set lan_block_google_dns_macs src -m set --match-set openclash_google_dns_ipv6s dst -j REJECT >/dev/null 2>&1 + nft 'add set inet fw4 openclash_google_dns_ips { type ipv4_addr; flags interval; auto-merge; }' + nft 'add element inet fw4 openclash_google_dns_ips { 8.8.8.8, 8.8.4.4 }' + if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 2 ]; then + nft insert rule inet fw4 dstnat position 0 ip saddr @lan_block_google_dns_ips ip daddr @openclash_google_dns_ips counter accept comment \"OpenClash Google DNS Block\" 2>/dev/null + nft insert rule inet fw4 dstnat position 0 ether saddr @lan_block_google_dns_macs ip daddr @openclash_google_dns_ips counter accept comment \"OpenClash Google DNS Block\" 2>/dev/null + fi + nft insert rule inet fw4 forward position 0 ip saddr @lan_block_google_dns_ips ip daddr @openclash_google_dns_ips counter reject comment \"OpenClash Google DNS Block\" 2>/dev/null + nft insert rule inet fw4 forward position 0 ether saddr @lan_block_google_dns_macs ip daddr @openclash_google_dns_ips counter reject comment \"OpenClash Google DNS Block\" 2>/dev/null fi - - #intranet allowed - if [ "$intranet_allowed" -eq 1 ]; then - wan6_ints=$(ip6tables-save -t filter |grep -e "-j zone_wan_input" 2>/dev/null |awk '{for (i=1;i<=NF;i++) {if ($i ~ /-i/) {print $(i+1)}}}' 2>/dev/null) - if [ -n "$wan_ints" ]; then - ip6tables -t filter -N openclash_wan_input - ip6tables -t filter -F openclash_wan_input - for wan6_int in $wan6_ints; do - ip6tables -t filter -I INPUT -i "$wan_int" -m set --match-set localnetwork6 src -j openclash_wan_input + + #ipv6 + if [ "$ipv6_enable" -eq 1 ]; then + if [ "$enable_redirect_dns" -eq 1 ] && [ -z "$(nft list chain inet fw4 dstnat |grep 'OpenClash DNS Hijack')"]; then + nft insert rule inet fw4 dstnat position 0 meta nfproto {ipv6} tcp dport 53 counter redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\" 2>/dev/null + nft insert rule inet fw4 dstnat position 0 meta nfproto {ipv6} udp dport 53 counter redirect to "$DNSPORT" comment \"OpenClash DNS Hijack\" 2>/dev/null + fi + + if [ "$china_ip6_route" = "1" ] || [ "$disable_udp_quic" = "1" ]; then + nft 'flush set inet fw4 china_ip6_route' + nft -f '/etc/openclash/china_ip6_route.ipset' 2>/dev/null + CHNROUTE_WAIT=0 + while ( [ -z "$(nft list sets |grep "set china_ip6_route {")" ] && [ "$CHNROUTE_WAIT" -le 3 ] ) + do + nft -f '/etc/openclash/china_ip6_route.ipset' 2>/dev/null done - ip6tables -t filter -A openclash_wan_input -p udp -m multiport --dport "$proxy_port,$tproxy_port,$cn_port,$http_port,$socks_port,$mixed_port,$dns_port" -j REJECT >/dev/null 2>&1 - ip6tables -t filter -A openclash_wan_input -p tcp -m multiport --dport "$proxy_port,$tproxy_port,$cn_port,$http_port,$socks_port,$mixed_port,$dns_port" -j REJECT >/dev/null 2>&1 + + mkdir -p /tmp/dnsmasq.d 2>/dev/null + + echo "add set inet fw4 china_ip6_route_pass { type ipv6_addr; flags interval; auto-merge; }" >>/tmp/openclash_china_ip6_route_pass.list + [ -z `(awk '!/^$/&&!/^#/&&!/^(\*?\.?)*[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})*$/{printf(" %s,'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute6_pass.list)` ] || { + echo "define china_ip6_route_pass = {" >/tmp/openclash_china_ip6_route_pass.list + awk '!/^$/&&!/^#/&&!/^(\*?\.?)*[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})*$/{printf(" %s,'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute6_pass.list >>/tmp/openclash_china_ip6_route_pass.list 2>/dev/null + echo "}" >>/tmp/openclash_china_ip6_route_pass.list + echo 'add element inet fw4 china_ip6_route_pass $china_ip6_route_pass' >>/tmp/openclash_china_ip6_route_pass.list + } + awk '!/^$/&&!/^#/&&/^(\*?\.?)*[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})*$/{printf("'${settype}'=/%s/'${nftflag}'china_ip6_route_pass'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute6_pass.list >>/tmp/dnsmasq.d/dnsmasq_openclash_chnroute6_pass.conf 2>/dev/null + + nft 'flush set inet fw4 china_ip6_route_pass' 2>/dev/null + nft -f '/tmp/openclash_china_ip6_route_pass.list' 2>/dev/null + rm -rf /tmp/openclash_china_ip6_route_pass.list 2>/dev/null + fi + + #local + nft 'add set inet fw4 localnetwork6 { type ipv6_addr; flags interval; auto-merge; }' + #nft 'delete set inet fw4 localnetwork6' + if [ -f "/etc/openclash/custom/openclash_custom_localnetwork_ipv6.list" ]; then + for line in `cat "/etc/openclash/custom/openclash_custom_localnetwork_ipv6.list"` + do + nft add element inet fw4 localnetwork6 { "$line" } 2>/dev/null + done 2>/dev/null + else + nft 'add element inet fw4 localnetwork6 { ::/128, ::1/128, ::ffff:0:0/96, ::ffff:0:0:0/96, 64:ff9b::/96, 100::/64, 2001::/32, 2001:20::/28, 2001:db8::/32, 2002::/16, fc00::/7, fe80::/10, ff00::/8}' + fi + + if [ -n "$lan_ip6_cidrs" ]; then + for lan_ip6_cidr in $lan_ip6_cidrs; do + nft add element inet fw4 localnetwork6 { "$lan_ip6_cidr" } 2>/dev/null + done + fi + + if [ -n "$wan_ip6s" ]; then + for wan_ip6 in $wan_ip6s; do + nft add element inet fw4 localnetwork6 { "$wan_ip6" } 2>/dev/null + done + fi + + modprobe nft_tproxy >/dev/null 2>&1 + ip -6 rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" + ip -6 route add local ::/0 dev lo table "$PROXY_ROUTE_TABLE" + + #Google dns + nft insert rule inet fw4 dstnat position 0 ip6 daddr { 2001:4860:4860::8888, 2001:4860:4860::8844 } tcp dport 53 counter accept comment \"OpenClash Google DNS Hijack\" 2>/dev/null + + nft 'add chain inet fw4 openclash_mangle_v6' 2>/dev/null + nft 'flush chain inet fw4 openclash_mangle_v6' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_v6 ip6 daddr @localnetwork6 counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_v6 meta nfproto {ipv6} udp dport 53 counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_v6 ip6 saddr @localnetwork6 meta nfproto {ipv6} sport @lan_ac_black_ports counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_v6 ip6 daddr @wan_ac_black_ipv6s counter return' 2>/dev/null + + if [ "$en_mode" == "redir-host" ]; then + nft 'add rule inet fw4 openclash_mangle_v6 meta nfproto {ipv6} th dport != @common_ports counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_v6 ip6 saddr @lan_ac_black_ipv6s counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_v6 ether saddr @lan_ac_black_macs counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_v6 ether saddr != @lan_ac_white_macs counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_v6 ip6 saddr != @lan_ac_white_ipv6s counter return' 2>/dev/null + fi + if [ "$china_ip6_route" = "1" ]; then + nft 'add rule inet fw4 openclash_mangle_v6 ip6 daddr @china_ip6_route ip6 daddr != @china_ip6_route_pass counter return' 2>/dev/null + fi + nft add rule inet fw4 openclash_mangle_v6 meta nfproto {ipv6} tcp dport { 0-65535 } mark set "$PROXY_FWMARK" tproxy ip6 to :"$tproxy_port" counter accept comment \"OpenClash TCP Tproxy\" 2>/dev/null + nft 'add rule inet fw4 mangle_prerouting meta nfproto {ipv6} jump openclash_mangle_v6' 2>/dev/null + + if [ -z "$_koolshare" ]; then + nft 'add chain inet fw4 openclash_mangle_output_v6' 2>/dev/null + nft 'flush chain inet fw4 openclash_mangle_output_v6' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_output_v6 ip6 daddr @localnetwork6 counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_output_v6 ip6 saddr @localnetwork6 meta nfproto {ipv6} sport @lan_ac_black_ports counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_output_v6 ip6 daddr @wan_ac_black_ipv6s counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_mangle_output_v6 meta nfproto {ipv6} th dport != @common_ports skuid != 65534 counter return' 2>/dev/null + + if [ "$china_ip6_route" = "1" ]; then + nft 'add rule inet fw4 openclash_mangle_output_v6 skuid != 65534 ip6 daddr @china_ip6_route ip6 daddr != @china_ip6_route_pass counter return' 2>/dev/null + fi + nft add rule inet fw4 openclash_mangle_output_v6 meta nfproto {ipv6} skuid != 65534 tcp dport { 0-65535 } mark set "$PROXY_FWMARK" 2>/dev/null + nft 'add rule inet fw4 mangle_output meta nfproto {ipv6} counter jump openclash_mangle_output_v6' 2>/dev/null + fi + + #udp + if [ "$enable_udp_proxy" -eq 1 ] || [ -n "$en_mode_tun" ]; then + nft add rule inet fw4 openclash_mangle_v6 meta nfproto {ipv6} udp dport { 0-65535 } mark set "$PROXY_FWMARK" tproxy ip6 to :"$tproxy_port" counter accept comment \"OpenClash UDP Tproxy\" 2>/dev/null + fi + + #quic + if [ "$disable_udp_quic" -eq 1 ]; then + nft insert rule inet fw4 input position 0 udp dport 443 ip6 daddr != @china_ip6_route counter reject comment \"OpenClash QUIC REJECT\" 2>/dev/null + fi + + #bypass gateway compatible + if [ "$bypass_gateway_compatible" -eq 1 ]; then + #nft 'delete chain inet fw4 openclash_post_v6' 2>/dev/null + nft 'add chain inet fw4 openclash_post_v6' 2>/dev/null + nft 'flush chain inet fw4 openclash_post_v6' 2>/dev/null + nft add rule inet fw4 openclash_post_v6 meta nfproto {ipv6} meta mark "$PROXY_FWMARK" counter accept 2>/dev/null + nft 'add rule inet fw4 openclash_post_v6 ip6 daddr @localnetwork6 counter return' 2>/dev/null + nft 'add rule inet fw4 openclash_post_v6 meta nfproto {ipv6} fib saddr type != { local } meta skuid != 65534 counter masquerade' 2>/dev/null + nft add rule inet fw4 srcnat meta nfproto {ipv6} counter jump openclash_post_v6 comment \"OpenClash Bypass Gateway Compatible\" 2>/dev/null + fi + + #google_dns_block + if [ -n "$(uci -q get openclash.config.lan_block_google_dns_ips)" ] || [ -n "$(uci -q get openclash.config.lan_block_google_dns_macs)" ]; then + nft 'add set inet fw4 openclash_google_dns_ipv6s { type ipv6_addr; flags interval; auto-merge; }' + nft 'add element inet fw4 openclash_google_dns_ipv6s { 2001:4860:4860::8888, 2001:4860:4860::8844, 2001:4860:4860::6464, 2001:4860:4860::64 }' + nft insert rule inet fw4 dstnat position 0 ip6 saddr @lan_block_google_dns_ipv6s ip6 daddr @openclash_google_dns_ipv6s counter accept comment \"OpenClash Google DNS Block\" 2>/dev/null + nft insert rule inet fw4 dstnat position 0 ether saddr @lan_block_google_dns_macs ip6 daddr @openclash_google_dns_ipv6s counter accept comment \"OpenClash Google DNS Block\" 2>/dev/null + nft insert rule inet fw4 forward position 0 ip6 saddr @lan_block_google_dns_ipv6s ip6 daddr @openclash_google_dns_ipv6s counter reject comment \"OpenClash Google DNS Block\" 2>/dev/null + nft insert rule inet fw4 forward position 0 ether saddr @lan_block_google_dns_macs ip6 daddr @openclash_google_dns_ipv6s counter reject comment \"OpenClash Google DNS Block\" 2>/dev/null + fi + + #intranet allowed + if [ "$intranet_allowed" -eq 1 ]; then + wan6_ints=$(nft list chain inet fw4 input |grep -e "jump input_wan" 2>/dev/null |awk '{for (i=1;i<=NF;i++) {if ($i ~ /iifname/) {print $(i+1)}}}' 2>/dev/null |sed 's/"//g') + if [ -n "$wan6_ints" ]; then + nft 'add chain inet fw4 openclash_wan6_input' 2>/dev/null + nft 'flush chain inet fw4 openclash_wan6_input' 2>/dev/null + for wan6_int in $wan6_ints; do + #nft delete rule inet fw4 input $(nft -a list chain inet fw4 input |grep "@localnetwork6" |awk -F '# ' '{print$2}') + nft insert rule inet fw4 input position 0 iifname "$wan6_int" ip6 saddr != @localnetwork6 counter jump openclash_wan6_input 2>/dev/null + done + nft add rule inet fw4 openclash_wan6_input udp dport {$proxy_port,$tproxy_port,$cn_port,$http_port,$socks_port,$mixed_port,$dns_port} counter reject 2>/dev/null + nft add rule inet fw4 openclash_wan6_input tcp dport {$proxy_port,$tproxy_port,$cn_port,$http_port,$socks_port,$mixed_port,$dns_port} counter reject 2>/dev/null + fi + fi + fi 2>/dev/null +else + if [ "$china_ip_route" = "1" ] || [ "$disable_udp_quic" = "1" ]; then + ipset -! flush china_ip_route 2>/dev/null + ipset -! restore /dev/null + mkdir -p /tmp/dnsmasq.d 2>/dev/null + echo "create china_ip_route_pass hash:net family inet hashsize 1024 maxelem 1000000" >/tmp/openclash_china_ip_route_pass.list + awk '!/^$/&&!/^#/&&/(^([1-9]|1[0-9]|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.)(([0-9]{1,2}|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.){2}([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-5][0-9]|25[0-4])((\/[0-9][0-9])?)$/{printf("add china_ip_route_pass %s'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute_pass.list >>/tmp/openclash_china_ip_route_pass.list 2>/dev/null + awk '!/^$/&&!/^#/&&!/(^([1-9]|1[0-9]|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.)(([0-9]{1,2}|1[1-9]{2}|2[0-4][0-9]|25[0-5])\.){2}([1-9]|[1-9][0-9]|1[0-9]{2}|2[0-5][0-9]|25[0-4])((\/[0-9][0-9])?)$/{printf("ipset=/%s/china_ip_route_pass'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute_pass.list >>/tmp/dnsmasq.d/dnsmasq_openclash_chnroute_pass.conf 2>/dev/null + ipset -! flush china_ip_route_pass 2>/dev/null + ipset -! restore /dev/null + rm -rf /tmp/openclash_china_ip_route_pass.list 2>/dev/null + fi + + if [ "$enable_redirect_dns" -eq 1 ] && [ -z "$(iptables -t nat -nL PREROUTING --line-number |grep 'OpenClash DNS Hijack')"]; then + DNSPORT=$(uci -q get dhcp.@dnsmasq[0].port) + if [ -z "$DNSPORT" ]; then + DNSPORT=$(netstat -nlp |grep -E '127.0.0.1:.*dnsmasq' |awk -F '127.0.0.1:' '{print $2}' |awk '{print $1}' |head -1 || echo "$dns_port") + fi + iptables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" + iptables -t nat -I PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" + fi + + #lan_google_dns_ac + if [ -n "$(uci -q get openclash.config.lan_block_google_dns_ips)" ]; then + ipset create lan_block_google_dns_ips hash:net + ipset create lan_block_google_dns_ipv6s hash:net family inet6 + config_load "openclash" + config_list_foreach "config" "lan_block_google_dns_ips" ac_add "lan_block_google_dns_ips" "lan_block_google_dns_ipv6s" + fi + if [ -n "$(uci -q get openclash.config.lan_block_google_dns_macs)" ]; then + ipset create lan_block_google_dns_macs hash:mac + config_load "openclash" + config_list_foreach "config" "lan_block_google_dns_macs" ac_add "lan_block_google_dns_macs" + fi + + #lan_ac + if [ "$operation_mode" = "redir-host" ] && [ "$en_mode" = "redir-host" ]; then + if [ "$lan_ac_mode" = "0" ]; then + if [ -n "$(uci -q get openclash.config.lan_ac_black_ips)" ]; then + ipset create lan_ac_black_ips hash:net + ipset create lan_ac_black_ipv6s hash:net family inet6 + config_load "openclash" + config_list_foreach "config" "lan_ac_black_ips" ac_add "lan_ac_black_ips" "lan_ac_black_ipv6s" + fi + if [ -n "$(uci -q get openclash.config.lan_ac_black_macs)" ]; then + ipset create lan_ac_black_macs hash:mac + config_load "openclash" + config_list_foreach "config" "lan_ac_black_macs" ac_add "lan_ac_black_macs" + fi + elif [ "$lan_ac_mode" = "1" ]; then + if [ -n "$(uci -q get openclash.config.lan_ac_white_ips)" ]; then + ipset create lan_ac_white_ips hash:net + ipset create lan_ac_white_ipv6s hash:net family inet6 + config_load "openclash" + config_list_foreach "config" "lan_ac_white_ips" ac_add "lan_ac_white_ips" "lan_ac_white_ipv6s" + fi + if [ -n "$(uci -q get openclash.config.lan_ac_white_macs)" ]; then + ipset create lan_ac_white_macs hash:mac + config_load "openclash" + config_list_foreach "config" "lan_ac_white_macs" ac_add "lan_ac_white_macs" + fi fi fi -fi 2>/dev/null + + #wan ac + if [ -n "$(uci -q get openclash.config.wan_ac_black_ips)" ]; then + ipset create wan_ac_black_ips hash:net + ipset create wan_ac_black_ipv6s hash:net family inet6 + config_load "openclash" + config_list_foreach "config" "wan_ac_black_ips" ac_add "wan_ac_black_ips" "wan_ac_black_ipv6s" + fi + + #lan port ac + if [ -n "$(uci -q get openclash.config.lan_ac_black_ports)" ]; then + ipset create lan_ac_black_ports bitmap:port range 0-65535 + config_load "openclash" + config_list_foreach "config" "lan_ac_black_ports" ac_add "lan_ac_black_ports" + fi + + #local + ipset create localnetwork hash:net + if [ -f "/etc/openclash/custom/openclash_custom_localnetwork_ipv4.list" ]; then + for line in `cat "/etc/openclash/custom/openclash_custom_localnetwork_ipv4.list"` + do + ipset add localnetwork "$line" + done 2>/dev/null + else + ipset add localnetwork 0.0.0.0/8 + ipset add localnetwork 127.0.0.0/8 + ipset add localnetwork 10.0.0.0/8 + ipset add localnetwork 169.254.0.0/16 + ipset add localnetwork 192.168.0.0/16 + ipset add localnetwork 224.0.0.0/4 + ipset add localnetwork 240.0.0.0/4 + ipset add localnetwork 172.16.0.0/12 + ipset add localnetwork 100.64.0.0/10 + fi + + if [ -n "$lan_ip_cidrs" ]; then + for lan_ip_cidr in $lan_ip_cidrs; do + ipset add localnetwork "$lan_ip_cidr" 2>/dev/null + done + fi + + if [ -n "$wan_ip4s" ]; then + for wan_ip4 in $wan_ip4s; do + ipset add localnetwork "$wan_ip4" 2>/dev/null + done + fi + + #common ports + if [ "$common_ports" = "1" ]; then + common_port="21 22 23 53 80 123 143 194 443 465 587 853 993 995 998 2052 2053 2082 2083 2086 2095 2096 5222 5228 5229 5230 8080 8443 8880 8888 8889" + ipset create common_ports bitmap:port range 0-65535 + for i in $common_port; do + ipset add common_ports $i + done + fi + + #bypass gateway compatible + if [ "$bypass_gateway_compatible" -eq 1 ]; then + iptables -t nat -N openclash_post + iptables -t nat -F openclash_post + iptables -t nat -A openclash_post -m mark --mark "$PROXY_FWMARK" -m comment --comment "OpenClash Bypass Gateway Compatible" -j ACCEPT + iptables -t nat -A openclash_post -m comment --comment "OpenClash Bypass Gateway Compatible" -m set --match-set localnetwork dst -j RETURN + iptables -t nat -A openclash_post -m addrtype ! --src-type LOCAL -m owner ! --uid-owner 65534 -m comment --comment "OpenClash Bypass Gateway Compatible" -j MASQUERADE + iptables -t nat -A POSTROUTING -j openclash_post + fi + + #intranet allowed + if [ "$intranet_allowed" -eq 1 ]; then + wan_ints=$(iptables-save -t filter |grep -e "-j zone_wan_input" 2>/dev/null |awk '{for (i=1;i<=NF;i++) {if ($i ~ /-i/) {print $(i+1)}}}' 2>/dev/null) + if [ -n "$wan_ints" ]; then + iptables -t filter -N openclash_wan_input + iptables -t filter -F openclash_wan_input + for wan_int in $wan_ints; do + iptables -t filter -I INPUT -i "$wan_int" -m set ! --match-set localnetwork src -j openclash_wan_input + done + iptables -t filter -A openclash_wan_input -p udp -m multiport --dport "$proxy_port,$tproxy_port,$cn_port,$http_port,$socks_port,$mixed_port,$dns_port" -j REJECT >/dev/null 2>&1 + iptables -t filter -A openclash_wan_input -p tcp -m multiport --dport "$proxy_port,$tproxy_port,$cn_port,$http_port,$socks_port,$mixed_port,$dns_port" -j REJECT >/dev/null 2>&1 + fi + fi + + if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 2 ]; then + #tcp + iptables -t nat -N openclash + iptables -t nat -F openclash + iptables -t nat -A openclash -m set --match-set localnetwork dst -j RETURN + if [ -z "$en_mode_tun" ] && [ "$en_mode" = "fake-ip" ]; then + iptables -t nat -A openclash -p tcp -d 198.18.0.0/16 -j REDIRECT --to-ports "$proxy_port" + fi + iptables -t nat -A openclash -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN + iptables -t nat -A openclash -m set --match-set wan_ac_black_ips dst -j RETURN >/dev/null 2>&1 + iptables -t nat -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 + iptables -t nat -A openclash -m set --match-set lan_ac_black_macs src -j RETURN >/dev/null 2>&1 + iptables -t nat -A openclash -m set ! --match-set lan_ac_white_macs src -j RETURN >/dev/null 2>&1 + iptables -t nat -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 + if [ "$en_mode" = "redir-host" ]; then + iptables -t nat -A openclash -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 + if [ "$china_ip_route" = "1" ]; then + iptables -t nat -A openclash -m set --match-set china_ip_route dst -m set ! --match-set china_ip_route_pass dst -j RETURN >/dev/null 2>&1 + fi + fi + iptables -t nat -A openclash -p tcp -j REDIRECT --to-ports "$proxy_port" + iptables -t nat -A PREROUTING -p tcp -j openclash + if [ -z "$en_mode_tun" ]; then + #Google dns + iptables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Hijack" -p tcp -d 8.8.8.8 --dport 53 -j REDIRECT --to-ports "$proxy_port" + iptables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Hijack" -p tcp -d 8.8.4.4 --dport 53 -j REDIRECT --to-ports "$proxy_port" + #udp + if [ "$enable_udp_proxy" -eq 1 ]; then + modprobe xt_TPROXY >/dev/null 2>&1 + ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" + ip route add local 0.0.0.0/0 dev lo table "$PROXY_ROUTE_TABLE" + iptables -t mangle -N openclash + iptables -t mangle -F openclash + iptables -t mangle -A openclash -m set --match-set localnetwork dst -j RETURN + iptables -t mangle -A openclash -p udp --dport 53 -j RETURN >/dev/null 2>&1 + if [ "$en_mode" = "fake-ip" ]; then + iptables -t mangle -A openclash -p udp -d 198.18.0.0/16 -j TPROXY --on-port "$tproxy_port" --tproxy-mark "$PROXY_FWMARK" + fi + iptables -t mangle -A openclash -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN + iptables -t mangle -A openclash -m set --match-set wan_ac_black_ips dst -j RETURN >/dev/null 2>&1 + iptables -t mangle -A openclash -m set --match-set lan_ac_black_macs src -j RETURN >/dev/null 2>&1 + iptables -t mangle -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 + iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 + iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_macs src -j RETURN >/dev/null 2>&1 + if [ "$en_mode" = "redir-host" ]; then + iptables -t mangle -A openclash -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 + if [ "$china_ip_route" = "1" ]; then + iptables -t mangle -A openclash -m set --match-set china_ip_route dst -m set ! --match-set china_ip_route_pass dst -j RETURN >/dev/null 2>&1 + fi + fi + + iptables -t mangle -A openclash -p udp -j TPROXY --on-port "$tproxy_port" --tproxy-mark "$PROXY_FWMARK" + iptables -t mangle -A PREROUTING -p udp -j openclash + + elif [ "$en_mode" = "fake-ip" ]; then + modprobe xt_TPROXY >/dev/null 2>&1 + ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" + ip route add local 0.0.0.0/0 dev lo table "$PROXY_ROUTE_TABLE" + iptables -t mangle -N openclash + iptables -t mangle -F openclash + iptables -t mangle -A openclash -p udp -d 198.18.0.0/16 -j TPROXY --on-port "$tproxy_port" --tproxy-mark "$PROXY_FWMARK" + iptables -t mangle -A PREROUTING -p udp -j openclash + + iptables -t mangle -N openclash_output + iptables -t mangle -F openclash_output + iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -p udp -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK" + iptables -t mangle -A OUTPUT -p udp -j openclash_output + fi + + #quic + if [ "$disable_udp_quic" -eq 1 ]; then + iptables -I INPUT -p udp --dport 443 -m comment --comment "OpenClash QUIC REJECT" -m set ! --match-set china_ip_route dst -j REJECT >/dev/null 2>&1 + fi + fi + + if [ -z "$_koolshare" ]; then + iptables -t nat -N openclash_output + iptables -t nat -F openclash_output + if [ "$en_mode" = "fake-ip" ] && [ -z "$en_mode_tun" ]; then + iptables -t nat -A openclash_output -m owner ! --uid-owner 65534 -p tcp -d 198.18.0.0/16 -j REDIRECT --to-ports "$proxy_port" + fi + iptables -t nat -A openclash_output -m set --match-set localnetwork dst -j RETURN + iptables -t nat -A openclash_output -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN + iptables -t nat -A openclash_output -m owner ! --uid-owner 65534 -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 + if [ "$en_mode" = "redir-host" ]; then + iptables -t nat -A openclash_output -m set --match-set wan_ac_black_ips dst -j RETURN >/dev/null 2>&1 + if [ "$china_ip_route" = "1" ]; then + iptables -t nat -A openclash_output -m owner ! --uid-owner 65534 -m set --match-set china_ip_route dst -m set ! --match-set china_ip_route_pass dst -j RETURN >/dev/null 2>&1 + fi + fi + iptables -t nat -A openclash_output -m owner ! --uid-owner 65534 -p tcp -j REDIRECT --to-ports "$proxy_port" + else + if [ "$en_mode" = "fake-ip" ]; then + iptables -t nat -N openclash_output + iptables -t nat -F openclash_output + iptables -t nat -A openclash_output -m set --match-set localnetwork dst -j RETURN + iptables -t nat -A openclash_output -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN + iptables -t nat -A openclash_output -p tcp -d 198.18.0.0/16 -j REDIRECT --to-ports "$proxy_port" + fi + fi + iptables -t nat -A OUTPUT -j openclash_output >/dev/null 2>&1 + fi + + if [ -n "$en_mode_tun" ]; then + #TUN模式 + #启动TUN + TUN_WAIT=0 + ip link set utun up + + while ( [ -n "$(pidof clash)" ] && [ -z "$(ip route list |grep utun)" ] && [ "$TUN_WAIT" -le 3 ] ) + do + ip link set utun up + let TUN_WAIT++ + sleep 2 + done + + ip route replace default dev utun table "$PROXY_ROUTE_TABLE" + ip rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" + + #MTU UP TO 65535 + ifconfig utun mtu 65535 >/dev/null 2>&1 + + #设置防火墙 + if [ "$en_mode" = "fake-ip" ]; then + iptables -t mangle -N openclash_output + iptables -t mangle -F openclash_output + iptables -t mangle -A openclash_output -m set --match-set localnetwork dst -j RETURN + iptables -t mangle -A openclash_output -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN + if [ "$en_mode_tun" -eq 1 ]; then + if [ -z "$_koolshare" ]; then + iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK" + iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 + iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -p tcp -j MARK --set-mark "$PROXY_FWMARK" + else + iptables -t mangle -A openclash_output -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK" + fi + elif [ -z "$_koolshare" ]; then + iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -p udp -d 198.18.0.0/16 -j MARK --set-mark "$PROXY_FWMARK" + fi + iptables -t mangle -A OUTPUT -j openclash_output + elif [ -z "$_koolshare" ] && [ "$en_mode" = "redir-host" ] && [ "$en_mode_tun" -eq 1 ]; then + iptables -t mangle -N openclash_output + iptables -t mangle -F openclash_output + iptables -t mangle -A openclash_output -m set --match-set localnetwork dst -j RETURN + iptables -t mangle -A openclash_output -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN + iptables -t mangle -A openclash_output -m set --match-set wan_ac_black_ips dst -j RETURN >/dev/null 2>&1 + iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 + if [ "$china_ip_route" = "1" ]; then + iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -m set --match-set china_ip_route dst -m set ! --match-set china_ip_route_pass dst -j RETURN >/dev/null 2>&1 + fi + iptables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -p tcp -j MARK --set-mark "$PROXY_FWMARK" + iptables -t mangle -A OUTPUT -j openclash_output + fi + + iptables -t mangle -N openclash + iptables -t mangle -F openclash + iptables -t mangle -N openclash_dns_hijack + iptables -t mangle -F openclash_dns_hijack + #其他流量 + iptables -t mangle -A openclash -m set --match-set localnetwork dst -j RETURN >/dev/null 2>&1 + iptables -t mangle -A openclash -m set --match-set localnetwork src -m set --match-set lan_ac_black_ports src -j RETURN + iptables -t mangle -A openclash -m set --match-set wan_ac_black_ips dst -j RETURN >/dev/null 2>&1 + iptables -t mangle -A openclash -m set --match-set lan_ac_black_ips src -j RETURN >/dev/null 2>&1 + iptables -t mangle -A openclash -m set --match-set lan_ac_black_macs src -j RETURN >/dev/null 2>&1 + iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_ips src -j RETURN >/dev/null 2>&1 + iptables -t mangle -A openclash -m set ! --match-set lan_ac_white_macs src -j RETURN >/dev/null 2>&1 + if [ "$en_mode" = "redir-host" ]; then + iptables -t mangle -A openclash -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 + if [ "$china_ip_route" = "1" ]; then + iptables -t mangle -A openclash -m set --match-set china_ip_route dst -m set ! --match-set china_ip_route_pass dst -j RETURN >/dev/null 2>&1 + fi + fi + iptables -t mangle -A openclash -j MARK --set-mark "$PROXY_FWMARK" + + if [ "$en_mode_tun" -eq 1 ]; then + iptables -t mangle -I PREROUTING -j openclash + iptables -t nat -I PREROUTING -m comment --comment "OpenClash TCP DNS Hijack" -p tcp --dport 53 -j ACCEPT + else + iptables -t mangle -I PREROUTING -p tcp --dport 53 -j openclash_dns_hijack + iptables -t mangle -A openclash_dns_hijack -m comment --comment "OpenClash TCP DNS Hijack" -p tcp --dport 53 -j MARK --set-mark "$PROXY_FWMARK" + iptables -t mangle -I PREROUTING -p udp -j openclash + iptables -t nat -I PREROUTING -m comment --comment "OpenClash TCP DNS Hijack" -p tcp --dport 53 -j ACCEPT + fi + + #TUN FORWORD + iptables -I FORWARD -m comment --comment "OpenClash TUN Forward" -o utun -j ACCEPT + + #quic + if [ "$disable_udp_quic" -eq 1 ]; then + iptables -I FORWARD -p udp --dport 443 -o utun -m comment --comment "OpenClash QUIC REJECT" -m set ! --match-set china_ip_route dst -j REJECT >/dev/null 2>&1 + fi + fi + + #google_dns_block + if [ -n "$(uci -q get openclash.config.lan_block_google_dns_ips)" ] || [ -n "$(uci -q get openclash.config.lan_block_google_dns_macs)" ]; then + ipset create openclash_google_dns_ips hash:net + ipset add openclash_google_dns_ips 8.8.8.8 + ipset add openclash_google_dns_ips 8.8.4.4 + + if [ -z "$en_mode_tun" ] || [ "$en_mode_tun" -eq 2 ]; then + iptables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Block" -m set --match-set lan_block_google_dns_ips src -m set --match-set openclash_google_dns_ips dst -j ACCEPT >/dev/null 2>&1 + iptables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Block" -m set --match-set lan_block_google_dns_macs src -m set --match-set openclash_google_dns_ips dst -j ACCEPT >/dev/null 2>&1 + fi + iptables -t filter -I FORWARD -m set --match-set lan_block_google_dns_ips src -m set --match-set openclash_google_dns_ips dst -j REJECT >/dev/null 2>&1 + iptables -t filter -I FORWARD -m set --match-set lan_block_google_dns_macs src -m set --match-set openclash_google_dns_ips dst -j REJECT >/dev/null 2>&1 + fi + + #ipv6 + if [ "$ipv6_enable" -eq 1 ] && [ -n "$(ip6tables -t mangle -L 2>&1 | grep -o 'Chain')" ]; then + if [ "$enable_redirect_dns" -eq 1 ] && [ -z "$(ip6tables -t nat -nL PREROUTING --line-number |grep 'DNS Hijack')"]; then + ip6tables -t nat -I PREROUTING -p udp --dport 53 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" + ip6tables -t nat -I PREROUTING -p tcp --dport 53 -j REDIRECT --to-ports "$DNSPORT" -m comment --comment "OpenClash DNS Hijack" + fi + + if [ "$china_ip6_route" = "1" ] || [ "$disable_udp_quic" = "1" ]; then + ipset -! flush china_ip6_route 2>/dev/null + ipset -! restore /dev/null + mkdir -p /tmp/dnsmasq.d 2>/dev/null + echo "create china_ip6_route_pass hash:net family inet6 hashsize 1024 maxelem 1000000" >/tmp/openclash_china_ip6_route_pass.list + awk '!/^$/&&!/^#/&&!/^(\*?\.?)*[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})*$/{printf("add china_ip6_route_pass %s'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute6_pass.list >>/tmp/openclash_china_ip6_route_pass.list 2>/dev/null + awk '!/^$/&&!/^#/&&/^(\*?\.?)*[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})*$/{printf("ipset=/%s/china_ip6_route_pass'" "'\n",$0)}' /etc/openclash/custom/openclash_custom_chnroute6_pass.list >>/tmp/dnsmasq.d/dnsmasq_openclash_chnroute6_pass.conf 2>/dev/null + ipset -! flush china_ip6_route_pass 2>/dev/null + ipset -! restore /dev/null + rm -rf /tmp/openclash_china_ip6_route_pass.list 2>/dev/null + fi + + #local + ipset create localnetwork6 hash:net family inet6 + if [ -f "/etc/openclash/custom/openclash_custom_localnetwork_ipv6.list" ]; then + for line in `cat "/etc/openclash/custom/openclash_custom_localnetwork_ipv6.list"` + do + ipset add localnetwork6 "$line" + done 2>/dev/null + else + ipset add localnetwork6 ::/128 + ipset add localnetwork6 ::1/128 + ipset add localnetwork6 ::ffff:0:0/96 + ipset add localnetwork6 ::ffff:0:0:0/96 + ipset add localnetwork6 64:ff9b::/96 + ipset add localnetwork6 100::/64 + ipset add localnetwork6 2001::/32 + ipset add localnetwork6 2001:20::/28 + ipset add localnetwork6 2001:db8::/32 + ipset add localnetwork6 2002::/16 + ipset add localnetwork6 fc00::/7 + ipset add localnetwork6 fe80::/10 + ipset add localnetwork6 ff00::/8 + fi + + if [ -n "$lan_ip6_cidrs" ]; then + for lan_ip6_cidr in $lan_ip6_cidrs; do + ipset add localnetwork6 "$lan_ip6_cidr" 2>/dev/null + done + fi + + if [ -n "$wan_ip6s" ]; then + for wan_ip6 in $wan_ip6s; do + ipset add localnetwork6 "$wan_ip6" + done + fi + + modprobe xt_TPROXY >/dev/null 2>&1 + ip -6 rule add fwmark "$PROXY_FWMARK" table "$PROXY_ROUTE_TABLE" + ip -6 route add local ::/0 dev lo table "$PROXY_ROUTE_TABLE" + + #Google dns + ip6tables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Hijack" -p tcp -d 2001:4860:4860::8888 --dport 53 -j ACCEPT + ip6tables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Hijack" -p tcp -d 2001:4860:4860::8844 --dport 53 -j ACCEPT + + ip6tables -t mangle -N openclash + ip6tables -t mangle -F openclash + ip6tables -t mangle -A openclash -m set --match-set localnetwork6 dst -j RETURN + ip6tables -t mangle -A openclash -p udp --dport 53 -j RETURN >/dev/null 2>&1 + ip6tables -t mangle -A openclash -m set --match-set localnetwork6 src -m set --match-set lan_ac_black_ports src -j RETURN + ip6tables -t mangle -A openclash -m set --match-set wan_ac_black_ipv6s dst -j RETURN >/dev/null 2>&1 + if [ "$en_mode" == "redir-host" ]; then + ip6tables -t mangle -A openclash -m set --match-set lan_ac_black_macs src -j RETURN >/dev/null 2>&1 + ip6tables -t mangle -A openclash -m set --match-set lan_ac_black_ipv6s src -j RETURN >/dev/null 2>&1 + ip6tables -t mangle -A openclash -m set ! --match-set lan_ac_white_ipv6s src -j RETURN >/dev/null 2>&1 + ip6tables -t mangle -A openclash -m set ! --match-set lan_ac_white_macs src -j RETURN >/dev/null 2>&1 + ip6tables -t mangle -A openclash -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 + fi + if [ "$china_ip6_route" = "1" ]; then + ip6tables -t mangle -A openclash -m set --match-set china_ip6_route dst -m set ! --match-set china_ip6_route_pass dst -j RETURN >/dev/null 2>&1 + fi + ip6tables -t mangle -A openclash -p tcp -m comment --comment "OpenClash TCP Tproxy" -j TPROXY --on-port "$tproxy_port" --tproxy-mark "$PROXY_FWMARK" + ip6tables -t mangle -A PREROUTING -j openclash + + if [ -z "$_koolshare" ]; then + ip6tables -t mangle -N openclash_output + ip6tables -t mangle -F openclash_output + ip6tables -t mangle -A openclash_output -m set --match-set localnetwork6 dst -j RETURN + ip6tables -t mangle -A openclash_output -m set --match-set localnetwork6 src -m set --match-set lan_ac_black_ports src -j RETURN + ip6tables -t mangle -A openclash_output -m set --match-set wan_ac_black_ipv6s dst -j RETURN >/dev/null 2>&1 + ip6tables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -m set ! --match-set common_ports dst -j RETURN >/dev/null 2>&1 + if [ "$china_ip6_route" = "1" ]; then + ip6tables -t mangle -A openclash_output -m owner ! --uid-owner 65534 -m set --match-set china_ip6_route dst -m set ! --match-set china_ip6_route_pass dst -j RETURN >/dev/null 2>&1 + fi + ip6tables -t mangle -A openclash_output -p tcp -m owner ! --uid-owner 65534 -j MARK --set-xmark "$PROXY_FWMARK" + ip6tables -t mangle -A OUTPUT -j openclash_output + fi + + #udp + if [ "$enable_udp_proxy" -eq 1 ]; then + ip6tables -t mangle -A openclash -p udp -m comment --comment "OpenClash UDP Tproxy" -j TPROXY --on-port "$tproxy_port" --tproxy-mark "$PROXY_FWMARK" + fi + + #quic + if [ "$disable_udp_quic" -eq 1 ]; then + ip6tables -I INPUT -p udp --dport 443 -m comment --comment "OpenClash QUIC REJECT" -m set ! --match-set china_ip6_route dst -j REJECT >/dev/null 2>&1 + fi + + #bypass gateway compatible + if [ "$bypass_gateway_compatible" -eq 1 ]; then + ip6tables -t nat -N openclash_post + ip6tables -t nat -F openclash_post + ip6tables -t nat -A openclash_post -m mark --mark "$PROXY_FWMARK" -m comment --comment "OpenClash Bypass Gateway Compatible" -j ACCEPT + ip6tables -t nat -A openclash_post -m comment --comment "OpenClash Bypass Gateway Compatible" -m set --match-set localnetwork6 dst -j RETURN + ip6tables -t nat -A openclash_post -m addrtype ! --src-type LOCAL -m owner ! --uid-owner 65534 -m comment --comment "OpenClash Bypass Gateway Compatible" -j MASQUERADE + ip6tables -t nat -A POSTROUTING -j openclash_post + fi + + #google_dns_block + if [ -n "$(uci -q get openclash.config.lan_block_google_dns_ips)" ] || [ -n "$(uci -q get openclash.config.lan_block_google_dns_macs)" ]; then + ipset create openclash_google_dns_ipv6s hash:net family inet6 + ipset add openclash_google_dns_ipv6s 2001:4860:4860::8888 + ipset add openclash_google_dns_ipv6s 2001:4860:4860::8844 + ipset add openclash_google_dns_ipv6s 2001:4860:4860::6464 + ipset add openclash_google_dns_ipv6s 2001:4860:4860::64 + + ip6tables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Block" -m set --match-set lan_block_google_dns_ipv6s src -m set --match-set openclash_google_dns_ipv6s dst -j ACCEPT + ip6tables -t nat -I PREROUTING -m comment --comment "OpenClash Google DNS Block" -m set --match-set lan_block_google_dns_macs src -m set --match-set openclash_google_dns_ipv6s dst -j ACCEPT + ip6tables -t filter -I FORWARD -m set --match-set lan_block_google_dns_ipv6s src -m set --match-set openclash_google_dns_ipv6s dst -j REJECT >/dev/null 2>&1 + ip6tables -t filter -I FORWARD -m set --match-set lan_block_google_dns_macs src -m set --match-set openclash_google_dns_ipv6s dst -j REJECT >/dev/null 2>&1 + fi + + #intranet allowed + if [ "$intranet_allowed" -eq 1 ]; then + wan6_ints=$(ip6tables-save -t filter |grep -e "-j zone_wan_input" 2>/dev/null |awk '{for (i=1;i<=NF;i++) {if ($i ~ /-i/) {print $(i+1)}}}' 2>/dev/null) + if [ -n "$wan_ints" ]; then + ip6tables -t filter -N openclash_wan_input + ip6tables -t filter -F openclash_wan_input + for wan6_int in $wan6_ints; do + ip6tables -t filter -I INPUT -i "$wan_int" -m set --match-set localnetwork6 src -j openclash_wan_input + done + ip6tables -t filter -A openclash_wan_input -p udp -m multiport --dport "$proxy_port,$tproxy_port,$cn_port,$http_port,$socks_port,$mixed_port,$dns_port" -j REJECT >/dev/null 2>&1 + ip6tables -t filter -A openclash_wan_input -p tcp -m multiport --dport "$proxy_port,$tproxy_port,$cn_port,$http_port,$socks_port,$mixed_port,$dns_port" -j REJECT >/dev/null 2>&1 + fi + fi + fi 2>/dev/null +fi #端口转发 config_load "firewall" @@ -1575,54 +2220,71 @@ revert_firewall() route delete -net 198.18.0.0/16 dev utun >/dev/null 2>&1 ip link set dev utun down >/dev/null 2>&1 ip tuntap del utun mode tun >/dev/null 2>&1 - - for ipt in "iptables -nvL INPUT" "iptables -nvL FORWARD" "iptables -nvL POSTROUTING -t nat" "iptables -nvL OUTPUT -t nat" "iptables -nvL OUTPUT -t mangle" "iptables -nvL PREROUTING -t nat" "iptables -nvL PREROUTING -t mangle" "ip6tables -nvL PREROUTING -t mangle" "ip6tables -nvL OUTPUT -t mangle" "ip6tables -nvL PREROUTING -t nat" "ip6tables -nvL INPUT" "ip6tables -nvL POSTROUTING -t nat"; do - for comment in "openclash" "OpenClash"; do - local lines=$($ipt |sed 1,2d |sed -n "/${comment}/=" 2>/dev/null |sort -rn) - if [ -n "$lines" ]; then - for line in $lines; do - $(echo "$ipt" |awk -v OFS=" " '{print $1,$4,$5}' |sed 's/[ ]*$//g') -D $(echo "$ipt" |awk '{print $3}') $line - done - fi - done - done >/dev/null 2>&1 - - for chain in "openclash" "openclash_output" "openclash_post" "openclash_dns_hijack" "openclash_wan_input"; do - iptables -t nat -F $chain - iptables -t nat -X $chain - iptables -t mangle -F $chain - iptables -t mangle -X $chain - iptables -t filter -F $chain - iptables -t filter -X $chain - ip6tables -t nat -F $chain - ip6tables -t nat -X $chain - ip6tables -t mangle -F $chain - ip6tables -t mangle -X $chain - ip6tables -t filter -F $chain - ip6tables -t filter -X $chain - done >/dev/null 2>&1 - ipset destroy localnetwork6 >/dev/null 2>&1 - ipset destroy china_ip6_route >/dev/null 2>&1 - ipset destroy china_ip6_route_pass >/dev/null 2>&1 - ipset destroy lan_ac_white_ipv6s >/dev/null 2>&1 - ipset destroy lan_ac_black_ipv6s >/dev/null 2>&1 - ipset destroy wan_ac_black_ipv6s >/dev/null 2>&1 - ipset destroy openclash_google_dns_ipv6s >/dev/null 2>&1 - ipset destroy lan_block_google_dns_ipv6s >/dev/null 2>&1 + if [ -n "$FW4" ]; then + for nft in "input" "forward" "dstnat" "srcnat" "nat_output" "mangle_prerouting" "mangle_output"; do + local handles=$(nft -a list chain inet fw4 ${nft} |grep -E "openclash|OpenClash" |awk -F '# handle ' '{print$2}') + for handle in $handles; do + nft delete rule inet fw4 ${nft} handle ${handle} + done + done >/dev/null 2>&1 - ipset destroy localnetwork >/dev/null 2>&1 - ipset destroy china_ip_route >/dev/null 2>&1 - ipset destroy china_ip_route_pass >/dev/null 2>&1 - ipset destroy lan_ac_white_ips >/dev/null 2>&1 - ipset destroy lan_ac_black_ips >/dev/null 2>&1 - ipset destroy lan_ac_white_macs >/dev/null 2>&1 - ipset destroy lan_ac_black_macs >/dev/null 2>&1 - ipset destroy wan_ac_black_ips >/dev/null 2>&1 - ipset destroy common_ports >/dev/null 2>&1 - ipset destroy lan_block_google_dns_ips >/dev/null 2>&1 - ipset destroy lan_block_google_dns_macs >/dev/null 2>&1 - ipset destroy openclash_google_dns_ips >/dev/null 2>&1 + for handle in $(nft -a list chains |grep -E "chain openclash|OpenClash" |awk -F '# handle ' '{print$2}'); do + nft delete chain inet fw4 handle ${handle} + done >/dev/null 2>&1 + + for handle in $(nft -a list sets |grep -E "set localnetwork|china_ip|lan_ac_|wan_ac_black_|_google_dns_|common_ports" |awk -F '# handle ' '{print$2}'); do + nft delete set inet fw4 handle ${handle} + done >/dev/null 2>&1 + else + for ipt in "iptables -nvL INPUT" "iptables -nvL FORWARD" "iptables -nvL POSTROUTING -t nat" "iptables -nvL OUTPUT -t nat" "iptables -nvL OUTPUT -t mangle" "iptables -nvL PREROUTING -t nat" "iptables -nvL PREROUTING -t mangle" "ip6tables -nvL PREROUTING -t mangle" "ip6tables -nvL OUTPUT -t mangle" "ip6tables -nvL PREROUTING -t nat" "ip6tables -nvL INPUT" "ip6tables -nvL POSTROUTING -t nat"; do + for comment in "openclash" "OpenClash"; do + local lines=$($ipt |sed 1,2d |sed -n "/${comment}/=" 2>/dev/null |sort -rn) + if [ -n "$lines" ]; then + for line in $lines; do + $(echo "$ipt" |awk -v OFS=" " '{print $1,$4,$5}' |sed 's/[ ]*$//g') -D $(echo "$ipt" |awk '{print $3}') $line + done + fi + done + done >/dev/null 2>&1 + + for chain in "openclash" "openclash_output" "openclash_post" "openclash_dns_hijack" "openclash_wan_input"; do + iptables -t nat -F $chain + iptables -t nat -X $chain + iptables -t mangle -F $chain + iptables -t mangle -X $chain + iptables -t filter -F $chain + iptables -t filter -X $chain + ip6tables -t nat -F $chain + ip6tables -t nat -X $chain + ip6tables -t mangle -F $chain + ip6tables -t mangle -X $chain + ip6tables -t filter -F $chain + ip6tables -t filter -X $chain + done >/dev/null 2>&1 + + ipset destroy localnetwork6 >/dev/null 2>&1 + ipset destroy china_ip6_route >/dev/null 2>&1 + ipset destroy china_ip6_route_pass >/dev/null 2>&1 + ipset destroy lan_ac_white_ipv6s >/dev/null 2>&1 + ipset destroy lan_ac_black_ipv6s >/dev/null 2>&1 + ipset destroy wan_ac_black_ipv6s >/dev/null 2>&1 + ipset destroy openclash_google_dns_ipv6s >/dev/null 2>&1 + ipset destroy lan_block_google_dns_ipv6s >/dev/null 2>&1 + + ipset destroy localnetwork >/dev/null 2>&1 + ipset destroy china_ip_route >/dev/null 2>&1 + ipset destroy china_ip_route_pass >/dev/null 2>&1 + ipset destroy lan_ac_white_ips >/dev/null 2>&1 + ipset destroy lan_ac_black_ips >/dev/null 2>&1 + ipset destroy lan_ac_white_macs >/dev/null 2>&1 + ipset destroy lan_ac_black_macs >/dev/null 2>&1 + ipset destroy wan_ac_black_ips >/dev/null 2>&1 + ipset destroy common_ports >/dev/null 2>&1 + ipset destroy lan_block_google_dns_ips >/dev/null 2>&1 + ipset destroy lan_block_google_dns_macs >/dev/null 2>&1 + ipset destroy openclash_google_dns_ips >/dev/null 2>&1 + fi } get_config() diff --git a/luci-app-openclash/root/etc/openclash/custom/openclash_custom_fake_filter.list b/luci-app-openclash/root/etc/openclash/custom/openclash_custom_fake_filter.list index 275af261e..260c5da32 100644 --- a/luci-app-openclash/root/etc/openclash/custom/openclash_custom_fake_filter.list +++ b/luci-app-openclash/root/etc/openclash/custom/openclash_custom_fake_filter.list @@ -128,4 +128,7 @@ ff.dorado.sdo.com shark007.net #Mijia Mijia Cloud -+.dns.google \ No newline at end of file ++.dns.google +#招商银行 ++.cmbchina.com ++.cmbimg.com \ No newline at end of file diff --git a/luci-app-openclash/root/etc/uci-defaults/luci-openclash b/luci-app-openclash/root/etc/uci-defaults/luci-openclash index 74f1b8ad4..129e85057 100644 --- a/luci-app-openclash/root/etc/uci-defaults/luci-openclash +++ b/luci-app-openclash/root/etc/uci-defaults/luci-openclash @@ -9,7 +9,7 @@ uci -q delete firewall.openclash uci -q set firewall.openclash=include uci -q set firewall.openclash.type=script uci -q set firewall.openclash.path=/var/etc/openclash.include -uci -q set firewall.openclash.reload=1 +[ -n "$(command -v fw4)" ] || uci -q set firewall.openclash.reload=1 uci -q commit firewall mkdir -p /etc/openclash/config diff --git a/luci-app-openclash/root/usr/share/openclash/openclash.sh b/luci-app-openclash/root/usr/share/openclash/openclash.sh index 3d42cd083..1127a6182 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash.sh @@ -24,6 +24,7 @@ dns_port=$(uci -q get openclash.config.dns_port) enable_redirect_dns=$(uci -q get openclash.config.enable_redirect_dns) disable_masq_cache=$(uci -q get openclash.config.disable_masq_cache) default_resolvfile=$(uci -q get openclash.config.default_resolvfile) +FW4="$(command -v fw4)" if_restart=0 only_download=0 set_lock @@ -237,10 +238,28 @@ change_dns() uci commit dhcp /etc/init.d/dnsmasq restart >/dev/null 2>&1 fi - iptables -t nat -D OUTPUT -j openclash_output >/dev/null 2>&1 - iptables -t mangle -D OUTPUT -j openclash_output >/dev/null 2>&1 - iptables -t nat -I OUTPUT -j openclash_output >/dev/null 2>&1 - iptables -t mangle -I OUTPUT -j openclash_output >/dev/null 2>&1 + + if [ -n "$FW4" ]; then + for nft in "nat_output" "mangle_output"; do + local handles=$(nft -a list chain inet fw4 ${nft} |grep -E "openclash|OpenClash" |awk -F '# handle ' '{print$2}') + for handle in $handles; do + nft delete rule inet fw4 ${nft} handle ${handle} + done + done >/dev/null 2>&1 + echo "$nat_output_rules" |while read line + do >/dev/null 2>&1 + nft add rule inet fw4 nat_output ${line} + done + echo "$mangle_output_rules" |while read line + do + nft add rule inet fw4 mangle_output ${line} + done >/dev/null 2>&1 + else + iptables -t nat -D OUTPUT -j openclash_output >/dev/null 2>&1 + iptables -t mangle -D OUTPUT -j openclash_output >/dev/null 2>&1 + iptables -t nat -A OUTPUT -j openclash_output >/dev/null 2>&1 + iptables -t mangle -A OUTPUT -j openclash_output >/dev/null 2>&1 + fi [ "$(unify_ps_status "openclash_watchdog.sh")" -eq 0 ] && [ "$(unify_ps_prevent)" -eq 0 ] && nohup /usr/share/openclash/openclash_watchdog.sh & fi } @@ -304,8 +323,19 @@ EOF uci commit dhcp /etc/init.d/dnsmasq restart >/dev/null 2>&1 fi - iptables -t nat -D OUTPUT -j openclash_output >/dev/null 2>&1 - iptables -t mangle -D OUTPUT -j openclash_output >/dev/null 2>&1 + if [ -n "$FW4" ]; then + nat_output_rules=$(nft -a list chain inet fw4 nat_output |grep -E "openclash|OpenClash" |awk -F '# handle ' '{print$1}' |sed 's/^[ \t]*//g') + mangle_output_rules=$(nft -a list chain inet fw4 mangle_output |grep -E "openclash|OpenClash" |awk -F '# handle ' '{print$1}' |sed 's/^[ \t]*//g') + for nft in "nat_output" "mangle_output"; do + local handles=$(nft -a list chain inet fw4 ${nft} |grep -E "openclash|OpenClash" |awk -F '# handle ' '{print$2}') + for handle in $handles; do + nft delete rule inet fw4 ${nft} handle ${handle} + done + done >/dev/null 2>&1 + else + iptables -t nat -D OUTPUT -j openclash_output >/dev/null 2>&1 + iptables -t mangle -D OUTPUT -j openclash_output >/dev/null 2>&1 + fi sleep 3 config_download diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_chnroute.sh b/luci-app-openclash/root/usr/share/openclash/openclash_chnroute.sh index a9b15f3c7..267d5260b 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_chnroute.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_chnroute.sh @@ -2,6 +2,8 @@ . /usr/share/openclash/openclash_ps.sh . /usr/share/openclash/log.sh + FW4="$(command -v fw4)" + set_lock() { exec 879>"/tmp/lock/openclash_chn.lock" 2>/dev/null flock -x 879 2>/dev/null @@ -44,8 +46,16 @@ if [ "$?" -eq "0" ] && [ -s "/tmp/china_ip_route.txt" ]; then LOG_OUT "Chnroute Cidr List Download Success, Check Updated..." #预处理 - echo "create china_ip_route hash:net family inet hashsize 1024 maxelem 1000000" >/tmp/china_ip_route.list - awk '!/^$/&&!/^#/{printf("add china_ip_route %s'" "'\n",$0)}' /tmp/china_ip_route.txt >>/tmp/china_ip_route.list + if [ -n "$FW4" ]; then + echo "define china_ip_route = {" >/tmp/china_ip_route.list + awk '!/^$/&&!/^#/{printf(" %s,'" "'\n",$0)}' /tmp/china_ip_route.txt >>/tmp/china_ip_route.list + echo "}" >>/tmp/china_ip_route.list + echo "add set inet fw4 china_ip_route { type ipv4_addr; flags interval; auto-merge; }" >>/tmp/china_ip_route.list + echo 'add element inet fw4 china_ip_route $china_ip_route' >>/tmp/china_ip_route.list + else + echo "create china_ip_route hash:net family inet hashsize 1024 maxelem 1000000" >/tmp/china_ip_route.list + awk '!/^$/&&!/^#/{printf("add china_ip_route %s'" "'\n",$0)}' /tmp/china_ip_route.txt >>/tmp/china_ip_route.list + fi cmp -s /tmp/china_ip_route.list "$chnr_path" if [ "$?" -ne "0" ]; then LOG_OUT "Chnroute Cidr List Has Been Updated, Starting To Replace The Old Version..." @@ -74,8 +84,16 @@ if [ "$?" -eq "0" ] && [ -s "/tmp/china_ip6_route.txt" ]; then LOG_OUT "Chnroute6 Cidr List Download Success, Check Updated..." #预处理 - echo "create china_ip6_route hash:net family inet6 hashsize 1024 maxelem 1000000" >/tmp/china_ip6_route.list - awk '!/^$/&&!/^#/{printf("add china_ip6_route %s'" "'\n",$0)}' /tmp/china_ip6_route.txt >>/tmp/china_ip6_route.list + if [ -n "$FW4" ]; then + echo "define china_ip6_route = {" >/tmp/china_ip6_route.list + awk '!/^$/&&!/^#/{printf(" %s,'" "'\n",$0)}' /tmp/china_ip6_route.txt >>/tmp/china_ip6_route.list + echo "}" >>/tmp/china_ip6_route.list + echo "add set inet fw4 china_ip6_route { type ipv6_addr; flags interval; auto-merge; }" >>/tmp/china_ip6_route.list + echo 'add element inet fw4 china_ip6_route $china_ip6_route' >>/tmp/china_ip6_route.list + else + echo "create china_ip6_route hash:net family inet6 hashsize 1024 maxelem 1000000" >/tmp/china_ip6_route.list + awk '!/^$/&&!/^#/{printf("add china_ip6_route %s'" "'\n",$0)}' /tmp/china_ip6_route.txt >>/tmp/china_ip6_route.list + fi cmp -s /tmp/china_ip6_route.list "$chnr6_path" if [ "$?" -ne "0" ]; then LOG_OUT "Chnroute6 Cidr List Has Been Updated, Starting To Replace The Old Version..." diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_debug.sh b/luci-app-openclash/root/usr/share/openclash/openclash_debug.sh index 73fb547c6..b95f630df 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_debug.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_debug.sh @@ -109,10 +109,6 @@ curl: $(ts_re "$(opkg status curl 2>/dev/null |grep 'Status' |awk -F ': ' '{prin ca-certificates: $(ts_re "$(opkg status ca-certificates 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") ipset: $(ts_re "$(opkg status ipset 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") ip-full: $(ts_re "$(opkg status ip-full 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") -iptables-mod-tproxy: $(ts_re "$(opkg status iptables-mod-tproxy 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") -kmod-ipt-tproxy: $(ts_re "$(opkg status kmod-ipt-tproxy 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") -iptables-mod-extra: $(ts_re "$(opkg status iptables-mod-extra 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") -kmod-ipt-extra: $(ts_re "$(opkg status kmod-ipt-extra 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") libcap: $(ts_re "$(opkg status libcap 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") libcap-bin: $(ts_re "$(opkg status libcap-bin 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") ruby: $(ts_re "$(opkg status ruby 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") @@ -120,9 +116,24 @@ ruby-yaml: $(ts_re "$(opkg status ruby-yaml 2>/dev/null |grep 'Status' |awk -F ' ruby-psych: $(ts_re "$(opkg status ruby-psych 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") ruby-pstore: $(ts_re "$(opkg status ruby-pstore 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") kmod-tun(TUN模式): $(ts_re "$(opkg status kmod-tun 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") -luci-compat(Luci-19.07): $(ts_re "$(opkg status luci-compat 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") +luci-compat(Luci >= 19.07): $(ts_re "$(opkg status luci-compat 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") kmod-inet-diag(PROCESS-NAME): $(ts_re "$(opkg status kmod-inet-diag 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") unzip: $(ts_re "$(opkg status unzip 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") +EOF +if [ -n "$(command -v fw4)" ]; then +cat >> "$DEBUG_LOG" <<-EOF +kmod-nft-tproxy: $(ts_re "$(opkg status kmod-nft-tproxy 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") +EOF +else +cat >> "$DEBUG_LOG" <<-EOF +iptables-mod-tproxy: $(ts_re "$(opkg status iptables-mod-tproxy 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") +kmod-ipt-tproxy: $(ts_re "$(opkg status kmod-ipt-tproxy 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") +iptables-mod-extra: $(ts_re "$(opkg status iptables-mod-extra 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") +kmod-ipt-extra: $(ts_re "$(opkg status kmod-ipt-extra 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") +kmod-ipt-nat: $(ts_re "$(opkg status kmod-ipt-nat 2>/dev/null |grep 'Status' |awk -F ': ' '{print $2}' 2>/dev/null)") +EOF +fi + EOF #core @@ -285,7 +296,7 @@ sed -i '/^ \{0,\}secret:/d' "$DEBUG_LOG" 2>/dev/null #firewall cat >> "$DEBUG_LOG" <<-EOF -#===================== 防火墙设置 =====================# +#===================== IPTABLES 防火墙设置 =====================# #IPv4 NAT chain @@ -327,6 +338,17 @@ cat >> "$DEBUG_LOG" <<-EOF EOF ip6tables-save -t filter >> "$DEBUG_LOG" 2>/dev/null +if [ -n "$(command -v fw4)" ]; then +cat >> "$DEBUG_LOG" <<-EOF + +#===================== NFTABLES 防火墙设置 =====================# + +EOF + for nft in "input" "forward" "dstnat" "srcnat" "nat_output" "mangle_prerouting" "mangle_output"; do + nft list chain inet fw4 dstnat >> "$DEBUG_LOG" 2>/dev/null + done >/dev/null 2>&1 +fi + cat >> "$DEBUG_LOG" <<-EOF #===================== IPSET状态 =====================# diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_streaming_unlock.lua b/luci-app-openclash/root/usr/share/openclash/openclash_streaming_unlock.lua index 9c1aa8f32..936778fba 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_streaming_unlock.lua +++ b/luci-app-openclash/root/usr/share/openclash/openclash_streaming_unlock.lua @@ -111,6 +111,8 @@ function unlock_auto_select() key_group = uci:get("openclash", "config", "stream_auto_select_group_key_discovery_plus") or "discovery" elseif type == "Bilibili" then key_group = uci:get("openclash", "config", "stream_auto_select_group_key_bilibili") or "bilibili" + elseif type == "Google" then + key_group = uci:get("openclash", "config", "stream_auto_select_group_key_google_not_cn") or "google|谷歌" end if not key_group then key_group = type end else @@ -210,10 +212,10 @@ function unlock_auto_select() value.all = nodes_filter(value.all, info) if select_logic == "random" then --sort by random - value.all = table_rand(value.all) + value.all = table_rand(value.all, proxy_default) else --sort by urltest - value.all = table_sort_by_urltest(value.all) + value.all = table_sort_by_urltest(value.all, proxy_default) end end if #(value.all) == 0 then @@ -507,7 +509,7 @@ function datamatch(data, regex) if result == "true" then return true else return false end end -function table_rand(t) +function table_rand(t, d) if t == nil then return end @@ -516,16 +518,19 @@ function table_rand(t) while #t ~= 0 do local n = math.random(0, #t) if t[n] ~= nil then - table.insert(tab, t[n]) + if d ~= nil and table_include(groups, d) and d == t[n] then + table.insert(tab, 1, t[n]) + else + table.insert(tab, t[n]) + end table.remove(t, n) end end return tab end -function table_sort_by_urltest(t) +function table_sort_by_urltest(t, d) local info, get_delay, group_delay - local count = 1 local tab = {} local result = {} @@ -577,7 +582,11 @@ function table_sort_by_urltest(t) end) for _, value in pairs(tab) do - table.insert(result, value[1]) + if d ~= nil and table_include(groups, d) and d == value[1] then + table.insert(result, 1, value[1]) + else + table.insert(result, value[1]) + end end return result @@ -666,6 +675,8 @@ function nodes_filter(t, info) regex = uci:get("openclash", "config", "stream_auto_select_node_key_discovery_plus") or "" elseif type == "Bilibili" then regex = uci:get("openclash", "config", "stream_auto_select_node_key_bilibili") or "" + elseif type == "Google" then + regex = uci:get("openclash", "config", "stream_auto_select_node_key_google_not_cn") or "" end if class_type(t) == "table" then @@ -725,6 +736,8 @@ function proxy_unlock_test() region = discovery_plus_unlock_test() elseif type == "Bilibili" then region = bilibili_unlock_test() + elseif type == "Google" then + region = google_not_cn_test() end return region end @@ -756,6 +769,8 @@ function auto_get_policy_group(passwd, ip, port) luci.sys.call('curl -sL -m 5 --limit-rate 1k -o /dev/null https://www.discoveryplus.com/ &') elseif type == "Bilibili" then luci.sys.call('curl -sL -m 5 --limit-rate 1k -o /dev/null https://www.bilibili.com/ &') + elseif type == "Google" then + luci.sys.call('curl -sL -m 5 --limit-rate 1k -o /dev/null https://timeline.google.com &') end os.execute("sleep 1") con = luci.sys.exec(string.format('curl -sL -m 5 --retry 2 -H "Content-Type: application/json" -H "Authorization: Bearer %s" -XGET http://%s:%s/connections', passwd, ip, port)) @@ -824,6 +839,11 @@ function auto_get_policy_group(passwd, ip, port) auto_get_group = con.connections[i].chains[#(con.connections[i].chains)] break end + elseif type == "Google" then + if string.match(con.connections[i].metadata.host, "timeline%.google%.com") then + auto_get_group = con.connections[i].chains[#(con.connections[i].chains)] + break + end end end end @@ -1391,4 +1411,21 @@ function bilibili_unlock_test() end end +function google_not_cn_test() + status = 0 + local url = "https://timeline.google.com" + local region + local httpcode = luci.sys.exec(string.format("curl -sL --connect-timeout 5 -m 10 --speed-time 5 --speed-limit 1 --retry 2 -o /dev/null -w %%{http_code} -H 'Accept-Language: en' -H 'Content-Type: application/json' -H 'User-Agent: %s' '%s'", UA, url)) + if httpcode then + if tonumber(httpcode) == 200 then + status = 2 + region = "NOT CN" + else + region = "CN" + status = 1 + end + return region + end +end + unlock_auto_select() \ No newline at end of file diff --git a/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh b/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh index ec0fe0f75..c14a558a8 100644 --- a/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh +++ b/luci-app-openclash/root/usr/share/openclash/openclash_watchdog.sh @@ -6,6 +6,7 @@ CLASH_CONFIG="/etc/openclash" LOG_FILE="/tmp/openclash.log" PROXY_FWMARK="0x162" PROXY_ROUTE_TABLE="0x162" +ipv6_enable=$(uci -q get openclash.config.ipv6_enable) enable_redirect_dns=$(uci -q get openclash.config.enable_redirect_dns) dns_port=$(uci -q get openclash.config.dns_port) disable_masq_cache=$(uci -q get openclash.config.disable_masq_cache) @@ -23,6 +24,7 @@ CRASH_NUM=0 CFG_UPDATE_INT=1 STREAM_DOMAINS_PREFETCH=1 STREAM_AUTO_SELECT=1 +FW4="$(command -v fw4)" sleep 60 while :; @@ -46,6 +48,7 @@ do stream_auto_select_paramount_plus=$(uci -q get openclash.config.stream_auto_select_paramount_plus || echo 0) stream_auto_select_discovery_plus=$(uci -q get openclash.config.stream_auto_select_discovery_plus || echo 0) stream_auto_select_bilibili=$(uci -q get openclash.config.stream_auto_select_bilibili || echo 0) + stream_auto_select_google_not_cn=$(uci -q get openclash.config.stream_auto_select_google_not_cn || echo 0) enable=$(uci -q get openclash.config.enable) @@ -116,7 +119,64 @@ fi iptables -t nat -A PREROUTING -p tcp -j openclash LOG_OUT "Watchdog: Setting Firewall For Enabling Redirect..." fi - + +## Localnetwork 刷新 + lan_ip_cidrs=$(ip route | grep "/" | awk '{print $1}' | grep -vE "^198.18" 2>/dev/null) + lan_ip6_cidrs=$(ip -6 route | grep "/" | awk '{print $1}' | grep -vE "^unreachable" 2>/dev/null) + wan_ip4s=$(ifconfig | grep 'inet addr' | awk '{print $2}' | cut -d: -f2 | grep -vE "(^198.18|^192.168|^127.0)" 2>/dev/null) + if [ -n "$FW4" ]; then + if [ -n "$lan_ip_cidrs" ]; then + for lan_ip_cidr in $lan_ip_cidrs; do + nft add element inet fw4 localnetwork { "$lan_ip_cidr" } 2>/dev/null + done + fi + + if [ -n "$wan_ip4s" ]; then + for wan_ip4 in $wan_ip4s; do + nft add element inet fw4 localnetwork { "$wan_ip4" } 2>/dev/null + done + fi + + if [ "$ipv6_enable" -eq 1 ]; then + if [ -n "$lan_ip6_cidrs" ]; then + for lan_ip6_cidr in $lan_ip6_cidrs; do + nft add element inet fw4 localnetwork6 { "$lan_ip6_cidr" } 2>/dev/null + done + fi + + if [ -n "$wan_ip6s" ]; then + for wan_ip6 in $wan_ip6s; do + nft add element inet fw4 localnetwork6 { "$wan_ip6" } 2>/dev/null + done + fi + fi + else + if [ -n "$lan_ip_cidrs" ]; then + for lan_ip_cidr in $lan_ip_cidrs; do + ipset add localnetwork "$lan_ip_cidr" 2>/dev/null + done + fi + + if [ -n "$wan_ip4s" ]; then + for wan_ip4 in $wan_ip4s; do + ipset add localnetwork "$wan_ip4" 2>/dev/null + done + fi + if [ "$ipv6_enable" -eq 1 ]; then + if [ -n "$lan_ip6_cidrs" ]; then + for lan_ip6_cidr in $lan_ip6_cidrs; do + ipset add localnetwork6 "$lan_ip6_cidr" 2>/dev/null + done + fi + + if [ -n "$wan_ip6s" ]; then + for wan_ip6 in $wan_ip6s; do + ipset add localnetwork6 "$wan_ip6" 2>/dev/null + done + fi + fi + fi + ## DNS转发劫持 if [ "$enable_redirect_dns" -ne 0 ]; then if [ -z "$(uci -q get dhcp.@dnsmasq[0].server |grep "$dns_port")" ] || [ ! -z "$(uci -q get dhcp.@dnsmasq[0].server |awk -F ' ' '{print $2}')" ]; then @@ -198,6 +258,10 @@ fi LOG_OUT "Tip: Start Auto Select Proxy For Bilibili Unlock..." /usr/share/openclash/openclash_streaming_unlock.lua "Bilibili" >> $LOG_FILE fi + if [ "$stream_auto_select_google_not_cn" -eq 1 ]; then + LOG_OUT "Tip: Start Auto Select Proxy For Google Not CN Unlock..." + /usr/share/openclash/openclash_streaming_unlock.lua "Google" >> $LOG_FILE + fi fi fi STREAM_AUTO_SELECT=$(expr "$STREAM_AUTO_SELECT" + 1) diff --git a/luci-app-openclash/root/usr/share/openclash/res/lhie1.yaml b/luci-app-openclash/root/usr/share/openclash/res/lhie1.yaml index e13ef1dc3..bd3611da9 100644 --- a/luci-app-openclash/root/usr/share/openclash/res/lhie1.yaml +++ b/luci-app-openclash/root/usr/share/openclash/res/lhie1.yaml @@ -16,6 +16,7 @@ rules: - RULE-SET,ABC,Global TV - RULE-SET,Abema TV,Global TV - RULE-SET,Amazon,Global TV +- RULE-SET,Apple Music,Global TV - RULE-SET,Apple News,Global TV - RULE-SET,Apple TV,Global TV - RULE-SET,Bahamut,Global TV @@ -43,7 +44,7 @@ rules: - RULE-SET,ViuTV,Global TV - RULE-SET,Telegram,Telegram - RULE-SET,Crypto,Crypto -- RULE-SET,Douyin,Douyin +- RULE-SET,Discord,Discord - RULE-SET,Steam,Steam - RULE-SET,Speedtest,Speedtest - RULE-SET,PayPal,PayPal @@ -77,6 +78,7 @@ script: "ABC": "Global TV", "Abema TV": "Global TV", "Amazon": "Global TV", + "Apple Music": "Global TV", "Apple News": "Global TV", "Apple TV": "Global TV", "Bahamut": "Global TV", @@ -104,7 +106,7 @@ script: "ViuTV": "Global TV", "Telegram": "Telegram", "Crypto": "Crypto", - "Douyin": "Douyin", + "Discord": "Discord", "Steam": "Steam", "Speedtest": "Speedtest", "PayPal": "PayPal", @@ -244,6 +246,12 @@ rule-providers: url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Amazon.yaml path: "./Rules/Media/Amazon" interval: 86400 + Apple Music: + type: http + behavior: classical + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Media/Apple%20Music.yaml + path: "./Rules/Media/Apple_Music" + interval: 86400 Apple News: type: http behavior: classical @@ -412,11 +420,11 @@ rule-providers: url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Crypto.yaml path: "./Rules/Crypto" interval: 86400 - Douyin: + Discord: type: http behavior: classical - url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Douyin.yaml - path: "./Rules/Douyin" + url: https://fastly.jsdelivr.net/gh/dler-io/Rules@main/Clash/Provider/Discord.yaml + path: "./Rules/Discord" interval: 86400 Steam: type: http diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config.6828b15b.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config.6828b15b.js deleted file mode 100644 index f98184fc1..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config.6828b15b.js +++ /dev/null @@ -1 +0,0 @@ -var J=Object.defineProperty,K=Object.defineProperties;var Q=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable;var $=(e,t,a)=>t in e?J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a,p=(e,t)=>{for(var a in t||(t={}))R.call(t,a)&&$(e,a,t[a]);if(b)for(var a of b(t))T.call(t,a)&&$(e,a,t[a]);return e},f=(e,t)=>K(e,Q(t));var M=(e,t)=>{var a={};for(var o in e)R.call(e,o)&&t.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&b)for(var o of b(e))t.indexOf(o)<0&&T.call(e,o)&&(a[o]=e[o]);return a};import{r as X,b as c,j as n,P as w,s as A,R as Y,c as Z,i as ee,k as z,l as E,n as te,h as B,d as D,o as ne,g as U,q as ae,t as oe,v as _,w as le,u as se,C as re,x as ce,B as ie,y as de,z as ue}from"./index.5901d226.js";import{r as pe}from"./logs.36f1d416.js";import{S as x}from"./Select.f72e6abf.js";function he(e,t){if(e==null)return{};var a=ge(e,t),o,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&(!Object.prototype.propertyIsEnumerable.call(e,o)||(a[o]=e[o]))}return a}function ge(e,t){if(e==null)return{};var a={},o=Object.keys(e),r,s;for(s=0;s=0)&&(a[r]=e[r]);return a}var I=X.exports.forwardRef(function(e,t){var a=e.color,o=a===void 0?"currentColor":a,r=e.size,s=r===void 0?24:r,u=he(e,["color","size"]);return c("svg",f(p({ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},u),{children:[n("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),n("polyline",{points:"16 17 21 12 16 7"}),n("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]}))});I.propTypes={color:w.string,size:w.oneOfType([w.string,w.number])};I.displayName="LogOut";var fe=I;const{useState:me,useRef:ve,useEffect:ye,useCallback:Ce}=Y;function be(e){return n("input",p({className:A.input},e))}function we(a){var o=a,{value:e}=o,t=M(o,["value"]);const[r,s]=me(e),u=ve(e);ye(()=>{u.current!==e&&s(e),u.current=e},[e]);const g=Ce(k=>s(k.target.value),[s]);return n("input",p({className:A.input,value:r,onChange:g},t))}const ke="_root_1tdl3_1",Se="_section_1tdl3_2",_e="_wrapSwitch_1tdl3_26",xe="_sep_1tdl3_32",Oe="_label_1tdl3_45";var d={root:ke,section:Se,wrapSwitch:_e,sep:xe,label:Oe};const Ie="_fieldset_1ghjp_1",Ne="_input_1ghjp_9",Pe="_cnt_1ghjp_9";var O={fieldset:Ie,input:Ne,cnt:Pe};function Le({OptionComponent:e,optionPropsList:t,selectedIndex:a,onChange:o}){const r=Z("visually-hidden",O.input),s=u=>{o(u.target.value)};return n("fieldset",{className:O.fieldset,children:t.map((u,g)=>c("label",{children:[n("input",{type:"radio",checked:a===g,name:"selection",value:g,"aria-labelledby":"traffic chart type "+g,onChange:s,className:r}),n("div",{className:O.cnt,children:n(e,p({},u))})]},g))})}const{useMemo:je}=B,$e={plugins:{legend:{display:!1}},scales:{x:{display:!1,type:"category"},y:{display:!1,type:"linear"}}},V=[23e3,35e3,46e3,33e3,9e4,68e3,23e3,45e3],Re=[184e3,183e3,196e3,182e3,19e4,186e3,182e3,189e3],Te=V;function Me({id:e}){const t=ee.read(),a=je(()=>({labels:Te,datasets:[f(p(p({},z),E[e].up),{data:V}),f(p(p({},z),E[e].down),{data:Re})]}),[e]),o="chart-"+e;return te(t.Chart,o,a,null,$e),n("div",{style:{width:100,padding:5},children:n("canvas",{id:o})})}const{useEffect:W,useState:ze,useCallback:m,useRef:Ee,useMemo:Ae}=B,Be=[{id:0},{id:1},{id:2},{id:3}],De=[["debug","Debug"],["info","Info"],["warning","Warning"],["error","Error"],["silent","Silent"]],Ue=[{key:"port",label:"HTTP Proxy Port"},{key:"socks-port",label:"SOCKS5 Proxy Port"},{key:"mixed-port",label:"Mixed Port"},{key:"redir-port",label:"Redir Port"}],Ve=[["zh","\u4E2D\u6587"],["en","English"]],We=[["Global","Global"],["Rule","Rule"],["Direct","Direct"]],He=e=>({configs:ne(e),apiConfig:U(e)}),Ge=e=>({selectedChartStyleIndex:de(e),latencyTestUrl:ue(e),apiConfig:U(e)}),qe=D(Ge)(Je);var Ze=D(He)(Fe);function Fe({dispatch:e,configs:t,apiConfig:a}){return W(()=>{e(ae(a))},[e,a]),n(qe,{configs:t})}function Je({dispatch:e,configs:t,selectedChartStyleIndex:a,latencyTestUrl:o,apiConfig:r}){const[s,u]=ze(t),g=Ee(t);W(()=>{g.current!==t&&u(t),g.current=t},[t]);const k=m(()=>{e(oe("apiConfig"))},[e]),v=m((l,i)=>{u(f(p({},s),{[l]:i}))},[s]),H=m(l=>{const i="allow-lan",h=l;v(i,h),e(_(r,{"allow-lan":h}))},[r,e,v]),y=m(({name:l,value:i})=>{switch(l){case"mode":case"log-level":v(l,i),e(_(r,{[l]:i})),l==="log-level"&&pe(f(p({},r),{logLevel:i}));break;case"redir-port":case"socks-port":case"mixed-port":case"port":if(i!==""){const h=parseInt(i,10);if(h<0||h>65535)return}v(l,i);break;default:return}},[r,e,v]),G=m(l=>y(l.target),[y]),{selectChartStyleIndex:q,updateAppConfig:N}=le(),P=m(l=>{const i=l.target,{name:h,value:j}=i;switch(h){case"port":case"socks-port":case"mixed-port":case"redir-port":{const S=parseInt(j,10);if(S<0||S>65535)return;e(_(r,{[h]:S}));break}case"latencyTestUrl":{N(h,j);break}default:throw new Error(`unknown input name ${h}`)}},[r,e,N]),F=Ae(()=>{const l=s.mode;return typeof l=="string"&&l[0].toUpperCase()+l.slice(1)},[s.mode]),{t:C,i18n:L}=se();return c("div",{children:[n(re,{title:C("Config")}),c("div",{className:d.root,children:[Ue.map(l=>s[l.key]!==void 0?c("div",{children:[n("div",{className:d.label,children:l.label}),n(be,{name:l.key,value:s[l.key],onChange:G,onBlur:P})]},l.key):null),c("div",{children:[n("div",{className:d.label,children:"Mode"}),n(x,{options:We,selected:F,onChange:l=>y({name:"mode",value:l.target.value})})]}),c("div",{children:[n("div",{className:d.label,children:"Log Level"}),n(x,{options:De,selected:s["log-level"],onChange:l=>y({name:"log-level",value:l.target.value})})]}),c("div",{children:[n("div",{className:d.label,children:"Allow LAN"}),n("div",{className:d.wrapSwitch,children:n(ce,{name:"allow-lan",checked:s["allow-lan"],onChange:H})})]})]}),n("div",{className:d.sep,children:n("div",{})}),c("div",{className:d.section,children:[c("div",{children:[n("div",{className:d.label,children:C("latency_test_url")}),n(we,{name:"latencyTestUrl",type:"text",value:o,onBlur:P})]}),c("div",{children:[n("div",{className:d.label,children:C("lang")}),n("div",{children:n(x,{options:Ve,selected:L.language,onChange:l=>L.changeLanguage(l.target.value)})})]}),c("div",{children:[n("div",{className:d.label,children:C("chart_style")}),n(Le,{OptionComponent:Me,optionPropsList:Be,selectedIndex:a,onChange:q})]}),c("div",{children:[n("div",{className:d.label,children:"Action"}),n(ie,{start:n(fe,{size:16}),label:"Switch backend",onClick:k})]})]})]})}export{Ze as default}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config.58870520.css b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config.7bc73fad.css similarity index 100% rename from luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config.58870520.css rename to luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config.7bc73fad.css diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config.fa1e4fae.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config.fa1e4fae.js new file mode 100644 index 000000000..2fc609274 --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Config.fa1e4fae.js @@ -0,0 +1 @@ +import{r as U,b as c,j as t,i as y,s as j,h as S,c as V,k as W,l as L,n as P,o as H,d as T,q as G,g as $,t as q,v as F,w as b,x as J,u as K,C as Q,y as X,B as Y,z as Z,A as ee}from"./index.2addc377.js";import{r as te}from"./logs.e4cdcb93.js";import{S as w}from"./Select.ef9dc454.js";function ne(e,s){if(e==null)return{};var r=ae(e,s),l,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&(!Object.prototype.propertyIsEnumerable.call(e,l)||(r[l]=e[l]))}return r}function ae(e,s){if(e==null)return{};var r={},l=Object.keys(e),a,o;for(o=0;o=0)&&(r[a]=e[a]);return r}var _=U.exports.forwardRef(function(e,s){var r=e.color,l=r===void 0?"currentColor":r,a=e.size,o=a===void 0?24:a,u=ne(e,["color","size"]);return c("svg",{ref:s,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:l,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...u,children:[t("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}),t("polyline",{points:"16 17 21 12 16 7"}),t("line",{x1:"21",y1:"12",x2:"9",y2:"12"})]})});_.propTypes={color:y.exports.string,size:y.exports.oneOfType([y.exports.string,y.exports.number])};_.displayName="LogOut";const oe=_,{useState:se,useRef:le,useEffect:re,useCallback:ce}=S;function ie(e){return t("input",{className:j.input,...e})}function de({value:e,...s}){const[r,l]=se(e),a=le(e);re(()=>{a.current!==e&&l(e),a.current=e},[e]);const o=ce(u=>l(u.target.value),[l]);return t("input",{className:j.input,value:r,onChange:o,...s})}const ue="_root_1tdl3_1",pe="_section_1tdl3_2",he="_wrapSwitch_1tdl3_26",ge="_sep_1tdl3_32",fe="_label_1tdl3_45",d={root:ue,section:pe,wrapSwitch:he,sep:ge,label:fe},me="_fieldset_1ghjp_1",ve="_input_1ghjp_9",ye="_cnt_1ghjp_9",k={fieldset:me,input:ve,cnt:ye};function Ce({OptionComponent:e,optionPropsList:s,selectedIndex:r,onChange:l}){const a=V("visually-hidden",k.input),o=u=>{l(u.target.value)};return t("fieldset",{className:k.fieldset,children:s.map((u,h)=>c("label",{children:[t("input",{type:"radio",checked:r===h,name:"selection",value:h,"aria-labelledby":"traffic chart type "+h,onChange:o,className:a}),t("div",{className:k.cnt,children:t(e,{...u})})]},h))})}const{useMemo:be}=S,we={plugins:{legend:{display:!1}},scales:{x:{display:!1,type:"category"},y:{display:!1,type:"linear"}}},M=[23e3,35e3,46e3,33e3,9e4,68e3,23e3,45e3],ke=[184e3,183e3,196e3,182e3,19e4,186e3,182e3,189e3],Se=M;function _e({id:e}){const s=W.read(),r=be(()=>({labels:Se,datasets:[{...L,...P[e].up,data:M},{...L,...P[e].down,data:ke}]}),[e]),l="chart-"+e;return H(s.Chart,l,r,null,we),t("div",{style:{width:100,padding:5},children:t("canvas",{id:l})})}const{useEffect:R,useState:xe,useCallback:g,useRef:Oe,useMemo:Ie}=S,Ne=[{id:0},{id:1},{id:2},{id:3}],Le=[["debug","Debug"],["info","Info"],["warning","Warning"],["error","Error"],["silent","Silent"]],Pe=[{key:"port",label:"HTTP Proxy Port"},{key:"socks-port",label:"SOCKS5 Proxy Port"},{key:"mixed-port",label:"Mixed Port"},{key:"redir-port",label:"Redir Port"}],je=[["zh","\u4E2D\u6587"],["en","English"]],Te=[["Global","Global"],["Rule","Rule"],["Direct","Direct"]],$e=e=>({configs:G(e),apiConfig:$(e)}),Me=e=>({selectedChartStyleIndex:Z(e),latencyTestUrl:ee(e),apiConfig:$(e)}),Re=T(Me)(Ae),Ue=T($e)(ze);function ze({dispatch:e,configs:s,apiConfig:r}){return R(()=>{e(q(r))},[e,r]),t(Re,{configs:s})}function Ae({dispatch:e,configs:s,selectedChartStyleIndex:r,latencyTestUrl:l,apiConfig:a}){const[o,u]=xe(s),h=Oe(s);R(()=>{h.current!==s&&u(s),h.current=s},[s]);const z=g(()=>{e(F("apiConfig"))},[e]),f=g((n,i)=>{u({...o,[n]:i})},[o]),A=g(n=>{const i="allow-lan",p=n;f(i,p),e(b(a,{"allow-lan":p}))},[a,e,f]),m=g(({name:n,value:i})=>{switch(n){case"mode":case"log-level":f(n,i),e(b(a,{[n]:i})),n==="log-level"&&te({...a,logLevel:i});break;case"redir-port":case"socks-port":case"mixed-port":case"port":if(i!==""){const p=parseInt(i,10);if(p<0||p>65535)return}f(n,i);break;default:return}},[a,e,f]),E=g(n=>m(n.target),[m]),{selectChartStyleIndex:B,updateAppConfig:x}=J(),O=g(n=>{const i=n.target,{name:p,value:N}=i;switch(p){case"port":case"socks-port":case"mixed-port":case"redir-port":{const C=parseInt(N,10);if(C<0||C>65535)return;e(b(a,{[p]:C}));break}case"latencyTestUrl":{x(p,N);break}default:throw new Error(`unknown input name ${p}`)}},[a,e,x]),D=Ie(()=>{const n=o.mode;return typeof n=="string"&&n[0].toUpperCase()+n.slice(1)},[o.mode]),{t:v,i18n:I}=K();return c("div",{children:[t(Q,{title:v("Config")}),c("div",{className:d.root,children:[Pe.map(n=>o[n.key]!==void 0?c("div",{children:[t("div",{className:d.label,children:n.label}),t(ie,{name:n.key,value:o[n.key],onChange:E,onBlur:O})]},n.key):null),c("div",{children:[t("div",{className:d.label,children:"Mode"}),t(w,{options:Te,selected:D,onChange:n=>m({name:"mode",value:n.target.value})})]}),c("div",{children:[t("div",{className:d.label,children:"Log Level"}),t(w,{options:Le,selected:o["log-level"],onChange:n=>m({name:"log-level",value:n.target.value})})]}),c("div",{children:[t("div",{className:d.label,children:"Allow LAN"}),t("div",{className:d.wrapSwitch,children:t(X,{name:"allow-lan",checked:o["allow-lan"],onChange:A})})]})]}),t("div",{className:d.sep,children:t("div",{})}),c("div",{className:d.section,children:[c("div",{children:[t("div",{className:d.label,children:v("latency_test_url")}),t(de,{name:"latencyTestUrl",type:"text",value:l,onBlur:O})]}),c("div",{children:[t("div",{className:d.label,children:v("lang")}),t("div",{children:t(w,{options:je,selected:I.language,onChange:n=>I.changeLanguage(n.target.value)})})]}),c("div",{children:[t("div",{className:d.label,children:v("chart_style")}),t(Ce,{OptionComponent:_e,optionPropsList:Ne,selectedIndex:r,onChange:B})]}),c("div",{children:[t("div",{className:d.label,children:"Action"}),t(Y,{start:t(oe,{size:16}),label:"Switch backend",onClick:z})]})]})]})}export{Ue as default}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections.c7e8fa7e.css b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections.1e70ab68.css similarity index 100% rename from luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections.c7e8fa7e.css rename to luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections.1e70ab68.css diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections.55a90f3d.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections.55a90f3d.js new file mode 100644 index 000000000..8eb5bfc75 --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections.55a90f3d.js @@ -0,0 +1 @@ +import{r as ue,R as Pe,c as Ae,a as to,j as U,b as we,p as pn,m as gn,M as no,B as vn,d as ro,e as oo,f as io,u as ao,C as uo,F as so,I as lo,g as co,S as fo}from"./index.2addc377.js";import{u as po}from"./useRemainingViewPortHeight.4e5a0898.js";import{C as go}from"./chevron-down.0fe59cac.js";import{f as vo}from"./index.47b45d26.js";import{F as mo,p as ho,A as yo}from"./Fab.ac4f3b29.js";import{P as wo,a as bo}from"./play.f2fb5ccc.js";function yt(C){return function(v){return!!v.type&&v.type.tabsRole===C}}var tt=yt("Tab"),wt=yt("TabList"),bt=yt("TabPanel");function Ro(C){return tt(C)||wt(C)||bt(C)}function vt(C,v){return ue.exports.Children.map(C,function(f){return f===null?null:Ro(f)?v(f):f.props&&f.props.children&&typeof f.props.children=="object"?ue.exports.cloneElement(f,Object.assign({},f.props,{children:vt(f.props.children,v)})):f})}function Cn(C,v){return ue.exports.Children.forEach(C,function(f){f!==null&&(tt(f)||bt(f)?v(f):f.props&&f.props.children&&typeof f.props.children=="object"&&(wt(f)&&v(f),Cn(f.props.children,v)))})}function Sn(C){var v=0;return Cn(C,function(f){tt(f)&&v++}),v}var Co=["children","className","disabledTabClassName","domRef","focus","forceRenderTabPanel","onSelect","selectedIndex","selectedTabClassName","selectedTabPanelClassName","environment","disableUpDownKeys"];function So(C,v){if(C==null)return{};var f={},g=Object.keys(C),O,_;for(_=0;_=0)&&(f[O]=C[O]);return f}function Pn(C){return C&&"getAttribute"in C}function mn(C){return Pn(C)&&C.getAttribute("data-rttab")}function Te(C){return Pn(C)&&C.getAttribute("aria-disabled")==="true"}var et;function Po(C){var v=C||(typeof window<"u"?window:void 0);try{et=!!(typeof v<"u"&&v.document&&v.document.activeElement)}catch{et=!1}}var xo={className:"react-tabs",focus:!1},Rt=function(v){var f=ue.exports.useRef([]),g=ue.exports.useRef([]),O=ue.exports.useRef();function _(m,N){if(!(m<0||m>=J())){var L=v.onSelect,K=v.selectedIndex;L(m,K,N)}}function l(m){for(var N=J(),L=m+1;Lm;)if(!Te(te(N)))return N;return m}function se(){for(var m=J(),N=0;N=0)&&(f[O]=C[O]);return f}var Ao={className:"react-tabs__tab-list"},rt=function(v){var f=v.children,g=v.className,O=Fo(v,To);return Pe.createElement("ul",Object.assign({},O,{className:Ae(g),role:"tablist"}),f)};rt.tabsRole="TabList";rt.propTypes={};rt.defaultProps=Ao;var ko=["children","className","disabled","disabledClassName","focus","id","selected","selectedClassName","tabIndex","tabRef"];function Go(C,v){if(C==null)return{};var f={},g=Object.keys(C),O,_;for(_=0;_=0)&&(f[O]=C[O]);return f}var gt="react-tabs__tab",Ho={className:gt,disabledClassName:gt+"--disabled",focus:!1,id:null,selected:!1,selectedClassName:gt+"--selected"},Le=function(v){var f,g=ue.exports.useRef(),O=v.children,_=v.className,l=v.disabled,Z=v.disabledClassName,se=v.focus,u=v.id,J=v.selected,te=v.selectedClassName,le=v.tabIndex,de=v.tabRef,D=Go(v,ko);return ue.exports.useEffect(function(){J&&se&&g.current.focus()},[J,se]),Pe.createElement("li",Object.assign({},D,{className:Ae(_,(f={},f[te]=J,f[Z]=l,f)),ref:function(ce){g.current=ce,de&&de(ce)},role:"tab",id:"tab"+u,"aria-selected":J?"true":"false","aria-disabled":l?"true":"false","aria-controls":"panel"+u,tabIndex:le||(J?"0":null),"data-rttab":!0}),O)};Le.propTypes={};Le.tabsRole="Tab";Le.defaultProps=Ho;var No=["children","className","forceRender","id","selected","selectedClassName"];function Oo(C,v){if(C==null)return{};var f={},g=Object.keys(C),O,_;for(_=0;_=0)&&(f[O]=C[O]);return f}var hn="react-tabs__tab-panel",Wo={className:hn,forceRender:!1,selectedClassName:hn+"--selected"},De=function(v){var f,g=v.children,O=v.className,_=v.forceRender,l=v.id,Z=v.selected,se=v.selectedClassName,u=Oo(v,No);return Pe.createElement("div",Object.assign({},u,{className:Ae(O,(f={},f[se]=Z,f)),role:"tabpanel",id:"panel"+l,"aria-labelledby":"tab"+l}),_||Z?g:null)};De.tabsRole="TabPanel";De.propTypes={};De.defaultProps=Wo;const _o="_placeHolder_12xws_1",zo="_connQty_12xws_10",Mo="_inputWrapper_12xws_22",jo="_input_12xws_22",je={placeHolder:_o,connQty:zo,inputWrapper:Mo,input:jo};var mt={exports:{}},ht={exports:{}};(function(C,v){(function(f,g){g(v,ue.exports)})(to,function(f,g){function O(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(d){return void n(d)}s.done?t(c):Promise.resolve(c).then(r,i)}function _(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(c){O(o,r,i,a,s,"next",c)}function s(c){O(o,r,i,a,s,"throw",c)}a(void 0)})}}function l(){return(l=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function se(e){var t=function(n,r){if(typeof n!="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var o=i.call(n,r||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(e,"string");return typeof t=="symbol"?t:String(t)}g=g&&Object.prototype.hasOwnProperty.call(g,"default")?g.default:g;var u={init:"init"},J=function(e){var t=e.value;return t===void 0?"":t},te=function(){return g.createElement(g.Fragment,null,"\xA0")},le={Cell:J,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function de(){for(var e=arguments.length,t=new Array(e),n=0;n(o=typeof o=="number"?o:1/0)){var a=i;i=o,o=a}return e.filter(function(s){return t.some(function(c){var d=s.values[c];return d>=i&&d<=o})})};Ot.autoRemove=function(e){return!e||typeof e[0]!="number"&&typeof e[1]!="number"};var Oe=Object.freeze({__proto__:null,text:Et,exactText:It,exactTextCase:Tt,includes:Ft,includesAll:At,includesSome:kt,includesValue:Gt,exact:Ht,equals:Nt,between:Ot});u.resetFilters="resetFilters",u.setFilter="setFilter",u.setAllFilters="setAllFilters";var Wt=function(e){e.stateReducers.push(Xn),e.useInstance.push(Qn)};function Xn(e,t,n,r){if(t.type===u.init)return l({filters:[]},e);if(t.type===u.resetFilters)return l({},e,{filters:r.initialState.filters||[]});if(t.type===u.setFilter){var i=t.columnId,o=t.filterValue,a=r.allColumns,s=r.filterTypes,c=a.find(function(S){return S.id===i});if(!c)throw new Error("React-Table: Could not find a column with id: "+i);var d=Ce(c.filter,s||{},Oe),b=e.filters.find(function(S){return S.id===i}),h=ne(o,b&&b.value);return Be(d.autoRemove,h,c)?l({},e,{filters:e.filters.filter(function(S){return S.id!==i})}):l({},e,b?{filters:e.filters.map(function(S){return S.id===i?{id:i,value:h}:S})}:{filters:[].concat(e.filters,[{id:i,value:h}])})}if(t.type===u.setAllFilters){var y=t.filters,p=r.allColumns,w=r.filterTypes;return l({},e,{filters:ne(y,e.filters).filter(function(S){var P=p.find(function(E){return E.id===S.id});return!Be(Ce(P.filter,w||{},Oe).autoRemove,S.value,P)})})}}function Qn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,a=e.filterTypes,s=e.manualFilters,c=e.defaultCanFilter,d=c!==void 0&&c,b=e.disableFilters,h=e.state.filters,y=e.dispatch,p=e.autoResetFilters,w=p===void 0||p,S=g.useCallback(function(x,k){y({type:u.setFilter,columnId:x,filterValue:k})},[y]),P=g.useCallback(function(x){y({type:u.setAllFilters,filters:x})},[y]);o.forEach(function(x){var k=x.id,z=x.accessor,T=x.defaultCanFilter,A=x.disableFilters;x.canFilter=z?ie(A!==!0&&void 0,b!==!0&&void 0,!0):ie(T,d,!1),x.setFilter=function(G){return S(x.id,G)};var $=h.find(function(G){return G.id===k});x.filterValue=$&&$.value});var E=g.useMemo(function(){if(s||!h.length)return[n,r,i];var x=[],k={};return[function z(T,A){A===void 0&&(A=0);var $=T;return($=h.reduce(function(G,V){var j=V.id,q=V.value,I=o.find(function(ee){return ee.id===j});if(!I)return G;A===0&&(I.preFilteredRows=G);var M=Ce(I.filter,a||{},Oe);return M?(I.filteredRows=M(G,[j],q),I.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+I.id+"."),G)},T)).forEach(function(G){x.push(G),k[G.id]=G,G.subRows&&(G.subRows=G.subRows&&G.subRows.length>0?z(G.subRows,A+1):G.subRows)}),$}(n),x,k]},[s,h,n,r,i,o,a]),W=E[0],B=E[1],R=E[2];g.useMemo(function(){o.filter(function(x){return!h.find(function(k){return k.id===x.id})}).forEach(function(x){x.preFilteredRows=W,x.filteredRows=W})},[W,h,o]);var H=m(w);L(function(){H()&&y({type:u.resetFilters})},[y,s?null:t]),Object.assign(e,{preFilteredRows:n,preFilteredFlatRows:r,preFilteredRowsById:i,filteredRows:W,filteredFlatRows:B,filteredRowsById:R,rows:W,flatRows:B,rowsById:R,setFilter:S,setAllFilters:P})}Wt.pluginName="useFilters",u.resetGlobalFilter="resetGlobalFilter",u.setGlobalFilter="setGlobalFilter";var _t=function(e){e.stateReducers.push(Jn),e.useInstance.push(Yn)};function Jn(e,t,n,r){if(t.type===u.resetGlobalFilter)return l({},e,{globalFilter:r.initialState.globalFilter||void 0});if(t.type===u.setGlobalFilter){var i=t.filterValue,o=r.userFilterTypes,a=Ce(r.globalFilter,o||{},Oe),s=ne(i,e.globalFilter);return Be(a.autoRemove,s)?(e.globalFilter,Z(e,["globalFilter"])):l({},e,{globalFilter:s})}}function Yn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,a=e.filterTypes,s=e.globalFilter,c=e.manualGlobalFilter,d=e.state.globalFilter,b=e.dispatch,h=e.autoResetGlobalFilter,y=h===void 0||h,p=e.disableGlobalFilter,w=g.useCallback(function(R){b({type:u.setGlobalFilter,filterValue:R})},[b]),S=g.useMemo(function(){if(c||d===void 0)return[n,r,i];var R=[],H={},x=Ce(s,a||{},Oe);if(!x)return console.warn("Could not find a valid 'globalFilter' option."),n;o.forEach(function(z){var T=z.disableGlobalFilter;z.canFilter=ie(T!==!0&&void 0,p!==!0&&void 0,!0)});var k=o.filter(function(z){return z.canFilter===!0});return[function z(T){return(T=x(T,k.map(function(A){return A.id}),d)).forEach(function(A){R.push(A),H[A.id]=A,A.subRows=A.subRows&&A.subRows.length?z(A.subRows):A.subRows}),T}(n),R,H]},[c,d,s,a,o,n,r,i,p]),P=S[0],E=S[1],W=S[2],B=m(y);L(function(){B()&&b({type:u.resetGlobalFilter})},[b,c?null:t]),Object.assign(e,{preGlobalFilteredRows:n,preGlobalFilteredFlatRows:r,preGlobalFilteredRowsById:i,globalFilteredRows:P,globalFilteredFlatRows:E,globalFilteredRowsById:W,rows:P,flatRows:E,rowsById:W,setGlobalFilter:w,disableGlobalFilter:p})}function zt(e,t){return t.reduce(function(n,r){return n+(typeof r=="number"?r:0)},0)}_t.pluginName="useGlobalFilter";var Mt=Object.freeze({__proto__:null,sum:zt,min:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.min(t,n))}),t},max:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.max(t,n))}),t},minMax:function(e){var t=e[0]||0,n=e[0]||0;return e.forEach(function(r){typeof r=="number"&&(t=Math.min(t,r),n=Math.max(n,r))}),t+".."+n},average:function(e){return zt(0,e)/e.length},median:function(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort(function(r,i){return r-i});return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},unique:function(e){return Array.from(new Set(e).values())},uniqueCount:function(e){return new Set(e).size},count:function(e){return e.length}}),Zn=[],er={};u.resetGroupBy="resetGroupBy",u.setGroupBy="setGroupBy",u.toggleGroupBy="toggleGroupBy";var jt=function(e){e.getGroupByToggleProps=[tr],e.stateReducers.push(nr),e.visibleColumnsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.groupBy])}),e.visibleColumns.push(rr),e.useInstance.push(ir),e.prepareRow.push(ar)};jt.pluginName="useGroupBy";var tr=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(r){r.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function nr(e,t,n,r){if(t.type===u.init)return l({groupBy:[]},e);if(t.type===u.resetGroupBy)return l({},e,{groupBy:r.initialState.groupBy||[]});if(t.type===u.setGroupBy)return l({},e,{groupBy:t.value});if(t.type===u.toggleGroupBy){var i=t.columnId,o=t.value,a=o!==void 0?o:!e.groupBy.includes(i);return l({},e,a?{groupBy:[].concat(e.groupBy,[i])}:{groupBy:e.groupBy.filter(function(s){return s!==i})})}}function rr(e,t){var n=t.instance.state.groupBy,r=n.map(function(o){return e.find(function(a){return a.id===o})}).filter(Boolean),i=e.filter(function(o){return!n.includes(o.id)});return(e=[].concat(r,i)).forEach(function(o){o.isGrouped=n.includes(o.id),o.groupedIndex=n.indexOf(o.id)}),e}var or={};function ir(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,a=e.flatHeaders,s=e.groupByFn,c=s===void 0?Lt:s,d=e.manualGroupBy,b=e.aggregations,h=b===void 0?or:b,y=e.plugins,p=e.state.groupBy,w=e.dispatch,S=e.autoResetGroupBy,P=S===void 0||S,E=e.disableGroupBy,W=e.defaultCanGroupBy,B=e.getHooks;Y(y,["useColumnOrder","useFilters"],"useGroupBy");var R=m(e);o.forEach(function(I){var M=I.accessor,ee=I.defaultGroupBy,fe=I.disableGroupBy;I.canGroupBy=M?ie(I.canGroupBy,fe!==!0&&void 0,E!==!0&&void 0,!0):ie(I.canGroupBy,ee,W,!1),I.canGroupBy&&(I.toggleGroupBy=function(){return e.toggleGroupBy(I.id)}),I.Aggregated=I.Aggregated||I.Cell});var H=g.useCallback(function(I,M){w({type:u.toggleGroupBy,columnId:I,value:M})},[w]),x=g.useCallback(function(I){w({type:u.setGroupBy,value:I})},[w]);a.forEach(function(I){I.getGroupByToggleProps=D(B().getGroupByToggleProps,{instance:R(),header:I})});var k=g.useMemo(function(){if(d||!p.length)return[n,r,i,Zn,er,r,i];var I=p.filter(function(ae){return o.find(function(Se){return Se.id===ae})}),M=[],ee={},fe=[],F={},Q=[],re={},pe=function ae(Se,be,un){if(be===void 0&&(be=0),be===I.length)return Se.map(function(Ue){return l({},Ue,{depth:be})});var dt=I[be],qr=c(Se,dt);return Object.entries(qr).map(function(Ue,Xr){var sn=Ue[0],qe=Ue[1],Xe=dt+":"+sn,ln=ae(qe,be+1,Xe=un?un+">"+Xe:Xe),cn=be?xe(qe,"leafRows"):qe,Qr=function(ye,ft,Yr){var Qe={};return o.forEach(function(oe){if(I.includes(oe.id))Qe[oe.id]=ft[0]?ft[0].values[oe.id]:null;else{var dn=typeof oe.aggregate=="function"?oe.aggregate:h[oe.aggregate]||Mt[oe.aggregate];if(dn){var Zr=ft.map(function(Je){return Je.values[oe.id]}),eo=ye.map(function(Je){var pt=Je.values[oe.id];if(!Yr&&oe.aggregateValue){var fn=typeof oe.aggregateValue=="function"?oe.aggregateValue:h[oe.aggregateValue]||Mt[oe.aggregateValue];if(!fn)throw console.info({column:oe}),new Error("React Table: Invalid column.aggregateValue option for column listed above");pt=fn(pt,Je,oe)}return pt});Qe[oe.id]=dn(eo,Zr)}else{if(oe.aggregate)throw console.info({column:oe}),new Error("React Table: Invalid column.aggregate option for column listed above");Qe[oe.id]=null}}}),Qe}(cn,qe,be),Jr={id:Xe,isGrouped:!0,groupByID:dt,groupByVal:sn,values:Qr,subRows:ln,leafRows:cn,depth:be,index:Xr};return ln.forEach(function(ye){M.push(ye),ee[ye.id]=ye,ye.isGrouped?(fe.push(ye),F[ye.id]=ye):(Q.push(ye),re[ye.id]=ye)}),Jr})}(n);return pe.forEach(function(ae){M.push(ae),ee[ae.id]=ae,ae.isGrouped?(fe.push(ae),F[ae.id]=ae):(Q.push(ae),re[ae.id]=ae)}),[pe,M,ee,fe,F,Q,re]},[d,p,n,r,i,o,h,c]),z=k[0],T=k[1],A=k[2],$=k[3],G=k[4],V=k[5],j=k[6],q=m(P);L(function(){q()&&w({type:u.resetGroupBy})},[w,d?null:t]),Object.assign(e,{preGroupedRows:n,preGroupedFlatRow:r,preGroupedRowsById:i,groupedRows:z,groupedFlatRows:T,groupedRowsById:A,onlyGroupedFlatRows:$,onlyGroupedRowsById:G,nonGroupedFlatRows:V,nonGroupedRowsById:j,rows:z,flatRows:T,rowsById:A,toggleGroupBy:H,setGroupBy:x})}function ar(e){e.allCells.forEach(function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&((n=e.subRows)==null?void 0:n.length)})}function Lt(e,t){return e.reduce(function(n,r,i){var o=""+r.values[t];return n[o]=Array.isArray(n[o])?n[o]:[],n[o].push(r),n},{})}var Dt=/([0-9]+)/gm;function it(e,t){return e===t?0:e>t?1:-1}function We(e,t,n){return[e.values[n],t.values[n]]}function Vt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}var ur=Object.freeze({__proto__:null,alphanumeric:function(e,t,n){var r=We(e,t,n),i=r[0],o=r[1];for(i=Vt(i),o=Vt(o),i=i.split(Dt).filter(Boolean),o=o.split(Dt).filter(Boolean);i.length&&o.length;){var a=i.shift(),s=o.shift(),c=parseInt(a,10),d=parseInt(s,10),b=[c,d].sort();if(isNaN(b[0])){if(a>s)return 1;if(s>a)return-1}else{if(isNaN(b[1]))return isNaN(c)?-1:1;if(c>d)return 1;if(d>c)return-1}}return i.length-o.length},datetime:function(e,t,n){var r=We(e,t,n),i=r[0],o=r[1];return it(i=i.getTime(),o=o.getTime())},basic:function(e,t,n){var r=We(e,t,n);return it(r[0],r[1])},string:function(e,t,n){var r=We(e,t,n),i=r[0],o=r[1];for(i=i.split("").filter(Boolean),o=o.split("").filter(Boolean);i.length&&o.length;){var a=i.shift(),s=o.shift(),c=a.toLowerCase(),d=s.toLowerCase();if(c>d)return 1;if(d>c)return-1;if(a>s)return 1;if(s>a)return-1}return i.length-o.length},number:function(e,t,n){var r=We(e,t,n),i=r[0],o=r[1],a=/[^0-9.]/gi;return it(i=Number(String(i).replace(a,"")),o=Number(String(o).replace(a,"")))}});u.resetSortBy="resetSortBy",u.setSortBy="setSortBy",u.toggleSortBy="toggleSortBy",u.clearSortBy="clearSortBy",le.sortType="alphanumeric",le.sortDescFirst=!1;var $t=function(e){e.getSortByToggleProps=[sr],e.stateReducers.push(lr),e.useInstance.push(cr)};$t.pluginName="useSortBy";var sr=function(e,t){var n=t.instance,r=t.column,i=n.isMultiSortEvent,o=i===void 0?function(a){return a.shiftKey}:i;return[e,{onClick:r.canSort?function(a){a.persist(),r.toggleSortBy(void 0,!n.disableMultiSort&&o(a))}:void 0,style:{cursor:r.canSort?"pointer":void 0},title:r.canSort?"Toggle SortBy":void 0}]};function lr(e,t,n,r){if(t.type===u.init)return l({sortBy:[]},e);if(t.type===u.resetSortBy)return l({},e,{sortBy:r.initialState.sortBy||[]});if(t.type===u.clearSortBy)return l({},e,{sortBy:e.sortBy.filter(function(R){return R.id!==t.columnId})});if(t.type===u.setSortBy)return l({},e,{sortBy:t.sortBy});if(t.type===u.toggleSortBy){var i,o=t.columnId,a=t.desc,s=t.multi,c=r.allColumns,d=r.disableMultiSort,b=r.disableSortRemove,h=r.disableMultiRemove,y=r.maxMultiSortColCount,p=y===void 0?Number.MAX_SAFE_INTEGER:y,w=e.sortBy,S=c.find(function(R){return R.id===o}).sortDescFirst,P=w.find(function(R){return R.id===o}),E=w.findIndex(function(R){return R.id===o}),W=a!=null,B=[];return(i=!d&&s?P?"toggle":"add":E!==w.length-1||w.length!==1?"replace":P?"toggle":"replace")!="toggle"||b||W||s&&h||!(P&&P.desc&&!S||!P.desc&&S)||(i="remove"),i==="replace"?B=[{id:o,desc:W?a:S}]:i==="add"?(B=[].concat(w,[{id:o,desc:W?a:S}])).splice(0,B.length-p):i==="toggle"?B=w.map(function(R){return R.id===o?l({},R,{desc:W?a:!P.desc}):R}):i==="remove"&&(B=w.filter(function(R){return R.id!==o})),l({},e,{sortBy:B})}}function cr(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.allColumns,o=e.orderByFn,a=o===void 0?Kt:o,s=e.sortTypes,c=e.manualSortBy,d=e.defaultCanSort,b=e.disableSortBy,h=e.flatHeaders,y=e.state.sortBy,p=e.dispatch,w=e.plugins,S=e.getHooks,P=e.autoResetSortBy,E=P===void 0||P;Y(w,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var W=g.useCallback(function(T){p({type:u.setSortBy,sortBy:T})},[p]),B=g.useCallback(function(T,A,$){p({type:u.toggleSortBy,columnId:T,desc:A,multi:$})},[p]),R=m(e);h.forEach(function(T){var A=T.accessor,$=T.canSort,G=T.disableSortBy,V=T.id,j=A?ie(G!==!0&&void 0,b!==!0&&void 0,!0):ie(d,$,!1);T.canSort=j,T.canSort&&(T.toggleSortBy=function(I,M){return B(T.id,I,M)},T.clearSortBy=function(){p({type:u.clearSortBy,columnId:T.id})}),T.getSortByToggleProps=D(S().getSortByToggleProps,{instance:R(),column:T});var q=y.find(function(I){return I.id===V});T.isSorted=!!q,T.sortedIndex=y.findIndex(function(I){return I.id===V}),T.isSortedDesc=T.isSorted?q.desc:void 0});var H=g.useMemo(function(){if(c||!y.length)return[n,r];var T=[],A=y.filter(function($){return i.find(function(G){return G.id===$.id})});return[function $(G){var V=a(G,A.map(function(j){var q=i.find(function(ee){return ee.id===j.id});if(!q)throw new Error("React-Table: Could not find a column with id: "+j.id+" while sorting");var I=q.sortType,M=Ge(I)||(s||{})[I]||ur[I];if(!M)throw new Error("React-Table: Could not find a valid sortType of '"+I+"' for column '"+j.id+"'.");return function(ee,fe){return M(ee,fe,j.id,j.desc)}}),A.map(function(j){var q=i.find(function(I){return I.id===j.id});return q&&q.sortInverted?j.desc:!j.desc}));return V.forEach(function(j){T.push(j),j.subRows&&j.subRows.length!==0&&(j.subRows=$(j.subRows))}),V}(n),T]},[c,y,n,r,i,a,s]),x=H[0],k=H[1],z=m(E);L(function(){z()&&p({type:u.resetSortBy})},[c?null:t]),Object.assign(e,{preSortedRows:n,preSortedFlatRows:r,sortedRows:x,sortedFlatRows:k,rows:x,flatRows:k,setSortBy:W,toggleSortBy:B})}function Kt(e,t,n){return[].concat(e).sort(function(r,i){for(var o=0;oe.pageIndex?s=i===-1?o.length>=e.pageSize:a-1),s?l({},e,{pageIndex:a}):e}if(t.type===u.setPageSize){var c=t.pageSize,d=e.pageSize*e.pageIndex;return l({},e,{pageIndex:Math.floor(d/c),pageSize:c})}}function fr(e){var t=e.rows,n=e.autoResetPage,r=n===void 0||n,i=e.manualExpandedKey,o=i===void 0?"expanded":i,a=e.plugins,s=e.pageCount,c=e.paginateExpandedRows,d=c===void 0||c,b=e.expandSubRows,h=b===void 0||b,y=e.state,p=y.pageSize,w=y.pageIndex,S=y.expanded,P=y.globalFilter,E=y.filters,W=y.groupBy,B=y.sortBy,R=e.dispatch,H=e.data,x=e.manualPagination;Y(a,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var k=m(r);L(function(){k()&&R({type:u.resetPage})},[R,x?null:H,P,E,W,B]);var z=x?s:Math.ceil(t.length/p),T=g.useMemo(function(){return z>0?[].concat(new Array(z)).fill(null).map(function(M,ee){return ee}):[]},[z]),A=g.useMemo(function(){var M;if(x)M=t;else{var ee=p*w,fe=ee+p;M=t.slice(ee,fe)}return d?M:He(M,{manualExpandedKey:o,expanded:S,expandSubRows:h})},[h,S,o,x,w,p,d,t]),$=w>0,G=z===-1?A.length>=p:w-1&&o.push(i.splice(c,1)[0])};i.length&&r.length;)a();return[].concat(o,i)}function Nr(e){var t=e.dispatch;e.setColumnOrder=g.useCallback(function(n){return t({type:u.setColumnOrder,columnOrder:n})},[t])}en.pluginName="useColumnOrder",le.canResize=!0,u.columnStartResizing="columnStartResizing",u.columnResizing="columnResizing",u.columnDoneResizing="columnDoneResizing",u.resetResize="resetResize";var tn=function(e){e.getResizerProps=[Or],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(Wr),e.useInstance.push(zr),e.useInstanceBeforeDimensions.push(_r)},Or=function(e,t){var n=t.instance,r=t.header,i=n.dispatch,o=function(a,s){var c=!1;if(a.type==="touchstart"){if(a.touches&&a.touches.length>1)return;c=!0}var d,b,h=function(B){var R=[];return function H(x){x.columns&&x.columns.length&&x.columns.map(H),R.push(x)}(B),R}(s).map(function(B){return[B.id,B.totalWidth]}),y=c?Math.round(a.touches[0].clientX):a.clientX,p=function(){window.cancelAnimationFrame(d),d=null,i({type:u.columnDoneResizing})},w=function(){window.cancelAnimationFrame(d),d=null,i({type:u.columnResizing,clientX:b})},S=function(B){b=B,d||(d=window.requestAnimationFrame(w))},P={mouse:{moveEvent:"mousemove",moveHandler:function(B){return S(B.clientX)},upEvent:"mouseup",upHandler:function(B){document.removeEventListener("mousemove",P.mouse.moveHandler),document.removeEventListener("mouseup",P.mouse.upHandler),p()}},touch:{moveEvent:"touchmove",moveHandler:function(B){return B.cancelable&&(B.preventDefault(),B.stopPropagation()),S(B.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(B){document.removeEventListener(P.touch.moveEvent,P.touch.moveHandler),document.removeEventListener(P.touch.upEvent,P.touch.moveHandler),p()}}},E=c?P.touch:P.mouse,W=!!function(){if(typeof Ie=="boolean")return Ie;var B=!1;try{var R={get passive(){return B=!0,!1}};window.addEventListener("test",null,R),window.removeEventListener("test",null,R)}catch{B=!1}return Ie=B}()&&{passive:!1};document.addEventListener(E.moveEvent,E.moveHandler,W),document.addEventListener(E.upEvent,E.upHandler,W),i({type:u.columnStartResizing,columnId:s.id,columnWidth:s.totalWidth,headerIdWidths:h,clientX:y})};return[e,{onMouseDown:function(a){return a.persist()||o(a,r)},onTouchStart:function(a){return a.persist()||o(a,r)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function Wr(e,t){if(t.type===u.init)return l({columnResizing:{columnWidths:{}}},e);if(t.type===u.resetResize)return l({},e,{columnResizing:{columnWidths:{}}});if(t.type===u.columnStartResizing){var n=t.clientX,r=t.columnId,i=t.columnWidth,o=t.headerIdWidths;return l({},e,{columnResizing:l({},e.columnResizing,{startX:n,headerIdWidths:o,columnWidth:i,isResizingColumn:r})})}if(t.type===u.columnResizing){var a=t.clientX,s=e.columnResizing,c=s.startX,d=s.columnWidth,b=s.headerIdWidths,h=(a-c)/d,y={};return(b===void 0?[]:b).forEach(function(p){var w=p[0],S=p[1];y[w]=Math.max(S+S*h,0)}),l({},e,{columnResizing:l({},e.columnResizing,{columnWidths:l({},e.columnResizing.columnWidths,{},y)})})}return t.type===u.columnDoneResizing?l({},e,{columnResizing:l({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}tn.pluginName="useResizeColumns";var _r=function(e){var t=e.flatHeaders,n=e.disableResizing,r=e.getHooks,i=e.state.columnResizing,o=m(e);t.forEach(function(a){var s=ie(a.disableResizing!==!0&&void 0,n!==!0&&void 0,!0);a.canResize=s,a.width=i.columnWidths[a.id]||a.originalWidth||a.width,a.isResizing=i.isResizingColumn===a.id,s&&(a.getResizerProps=D(r().getResizerProps,{instance:o(),header:a}))})};function zr(e){var t=e.plugins,n=e.dispatch,r=e.autoResetResize,i=r===void 0||r,o=e.columns;Y(t,["useAbsoluteLayout"],"useResizeColumns");var a=m(i);L(function(){a()&&n({type:u.resetResize})},[o]);var s=g.useCallback(function(){return n({type:u.resetResize})},[n]);Object.assign(e,{resetResizing:s})}var at={position:"absolute",top:0},nn=function(e){e.getTableBodyProps.push(Ke),e.getRowProps.push(Ke),e.getHeaderGroupProps.push(Ke),e.getFooterGroupProps.push(Ke),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:l({},at,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:l({},at,{left:r.column.totalLeft+"px",width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:l({},at,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]})};nn.pluginName="useAbsoluteLayout";var Ke=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},ut={display:"inline-block",boxSizing:"border-box"},st=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},rn=function(e){e.getRowProps.push(st),e.getHeaderGroupProps.push(st),e.getFooterGroupProps.push(st),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:l({},ut,{width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:l({},ut,{width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:l({},ut,{width:r.totalWidth+"px"})}]})};function on(e){e.getTableProps.push(Mr),e.getRowProps.push(lt),e.getHeaderGroupProps.push(lt),e.getFooterGroupProps.push(lt),e.getHeaderProps.push(jr),e.getCellProps.push(Lr),e.getFooterProps.push(Dr)}rn.pluginName="useBlockLayout",on.pluginName="useFlexLayout";var Mr=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},lt=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},jr=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},Lr=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},Dr=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function an(e){e.stateReducers.push(Ur),e.getTableProps.push(Vr),e.getHeaderProps.push($r),e.getRowProps.push(Kr)}u.columnStartResizing="columnStartResizing",u.columnResizing="columnResizing",u.columnDoneResizing="columnDoneResizing",u.resetResize="resetResize",an.pluginName="useGridLayout";var Vr=function(e,t){var n=t.instance;return[e,{style:{display:"grid",gridTemplateColumns:n.visibleColumns.map(function(r){var i;return n.state.gridLayout.columnWidths[r.id]?n.state.gridLayout.columnWidths[r.id]+"px":(i=n.state.columnResizing)!=null&&i.isResizingColumn?n.state.gridLayout.startWidths[r.id]+"px":typeof r.width=="number"?r.width+"px":r.width}).join(" ")}}]},$r=function(e,t){var n=t.column;return[e,{id:"header-cell-"+n.id,style:{position:"sticky",gridColumn:"span "+n.totalVisibleHeaderCount}}]},Kr=function(e,t){var n=t.row;return n.isExpanded?[e,{style:{gridColumn:"1 / "+(n.cells.length+1)}}]:[e,{}]};function Ur(e,t,n,r){if(t.type===u.init)return l({gridLayout:{columnWidths:{}}},e);if(t.type===u.resetResize)return l({},e,{gridLayout:{columnWidths:{}}});if(t.type===u.columnStartResizing){var i=t.columnId,o=t.headerIdWidths,a=ct(i);if(a!==void 0){var s=r.visibleColumns.reduce(function(R,H){var x;return l({},R,((x={})[H.id]=ct(H.id),x))},{}),c=r.visibleColumns.reduce(function(R,H){var x;return l({},R,((x={})[H.id]=H.minWidth,x))},{}),d=r.visibleColumns.reduce(function(R,H){var x;return l({},R,((x={})[H.id]=H.maxWidth,x))},{}),b=o.map(function(R){var H=R[0];return[H,ct(H)]});return l({},e,{gridLayout:l({},e.gridLayout,{startWidths:s,minWidths:c,maxWidths:d,headerIdGridWidths:b,columnWidth:a})})}return e}if(t.type===u.columnResizing){var h=t.clientX,y=e.columnResizing.startX,p=e.gridLayout,w=p.columnWidth,S=p.minWidths,P=p.maxWidths,E=p.headerIdGridWidths,W=(h-y)/w,B={};return(E===void 0?[]:E).forEach(function(R){var H=R[0],x=R[1];B[H]=Math.min(Math.max(S[H],x+x*W),P[H])}),l({},e,{gridLayout:l({},e.gridLayout,{columnWidths:l({},e.gridLayout.columnWidths,{},B)})})}return t.type===u.columnDoneResizing?l({},e,{gridLayout:l({},e.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function ct(e){var t,n=(t=document.getElementById("header-cell-"+e))==null?void 0:t.offsetWidth;if(n!==void 0)return n}f._UNSTABLE_usePivotColumns=qt,f.actions=u,f.defaultColumn=le,f.defaultGroupByFn=Lt,f.defaultOrderByFn=Kt,f.defaultRenderer=J,f.emptyRenderer=te,f.ensurePluginOrder=Y,f.flexRender=ge,f.functionalUpdate=ne,f.loopHooks=ce,f.makePropGetter=D,f.makeRenderer=K,f.reduceHooks=X,f.safeUseLayoutEffect=N,f.useAbsoluteLayout=nn,f.useAsyncDebounce=function(e,t){t===void 0&&(t=0);var n=g.useRef({}),r=m(e),i=m(t);return g.useCallback(function(){var o=_(regeneratorRuntime.mark(function a(){var s,c,d,b=arguments;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:for(s=b.length,c=new Array(s),d=0;d1?t-1:0),r=1;rwe("div",{..._.getHeaderGroupProps(),className:Fe.tr,children:[_.headers.map(l=>we("div",{...l.getHeaderProps(l.getSortByToggleProps()),className:Fe.th,children:[U("span",{children:l.render("Header")}),U("span",{className:Fe.sortIconContainer,children:l.isSorted?U("span",{className:l.isSortedDesc?"":Fe.rotate180,children:U(go,{size:16})}):null})]})),g.map((l,Z)=>(O(l),l.cells.map((se,u)=>U("div",{...se.getCellProps(),className:Ae(Fe.td,Z%2===0?Fe.odd:!1,u>=1&&u<=4?Fe.du:!1),children:Qo(se)}))))]}))})}const ei="_overlay_148w6_1",ti="_cnt_148w6_5",ni="_afterOpen_148w6_15",ri="_btngrp_148w6_20",Ye={overlay:ei,cnt:ti,afterOpen:ni,btngrp:ri},{useRef:oi,useCallback:ii,useMemo:ai}=Pe;function ui({isOpen:C,onRequestClose:v,primaryButtonOnTap:f}){const g=oi(null),O=ii(()=>{g.current.focus()},[]),_=ai(()=>({base:Ae(gn.content,Ye.cnt),afterOpen:Ye.afterOpen,beforeClose:""}),[]);return we(no,{isOpen:C,onRequestClose:v,onAfterOpen:O,className:_,overlayClassName:Ae(gn.overlay,Ye.overlay),children:[U("p",{children:"Are you sure you want to close all connections?"}),we("div",{className:Ye.btngrp,children:[U(vn,{onClick:f,ref:g,children:"I'm sure"}),U("div",{style:{width:20}}),U(vn,{onClick:v,children:"No"})]})]})}const{useEffect:si,useState:ze,useRef:li,useCallback:Me}=Pe,yn=30;function ci(C){const v={};for(let f=0;f[f.host,f.sourceIP,f.sourcePort,f.destinationIP,f.chains,f.rule,f.type,f.network].some(g=>di(g,v))):C}function fi(C,v,f){const{id:g,metadata:O,upload:_,download:l,start:Z,chains:se,rule:u,rulePayload:J}=C,{host:te,destinationPort:le,destinationIP:de,network:D,type:X,sourceIP:ce,sourcePort:Y}=O;let ne=te;ne===""&&(ne=de);const m=v[g];return{id:g,upload:_,download:l,start:f-new Date(Z).valueOf(),chains:se.reverse().join(" / "),rule:J?`${u}(${J})`:u,...O,host:`${ne}:${le}`,type:`${X}(${D})`,source:`${ce}:${Y}`,downloadSpeedCurr:l-(m?m.download:0),uploadSpeedCurr:_-(m?m.upload:0)}}function bn(C){return C.length>0?U(Zo,{data:C}):U("div",{className:je.placeHolder,children:U(fo,{width:200,height:200,c1:"var(--color-text)"})})}function Rn({qty:C}){return C<100?""+C:"99+"}function pi({apiConfig:C}){const[v,f]=po(),[g,O]=ze([]),[_,l]=ze([]),[Z,se]=ze(""),u=wn(g,Z),J=wn(_,Z),[te,le]=ze(!1),de=Me(()=>le(!0),[]),D=Me(()=>le(!1),[]),[X,ce]=ze(!1),Y=Me(()=>{ce(K=>!K)},[]),ne=Me(()=>{oo(C),D()},[C,D]),m=li(g),N=Me(({connections:K})=>{const ge=ci(m.current),ve=Date.now(),me=K.map(he=>fi(he,ge,ve)),Re=[];for(const he of m.current)me.findIndex(ke=>ke.id===he.id)<0&&Re.push(he);l(he=>[...Re,...he].slice(0,101)),me&&(me.length!==0||m.current.length!==0)&&!X?(m.current=me,O(me)):m.current=me},[O,X]);si(()=>io(C,N),[C,N]);const{t:L}=ao();return we("div",{children:[U(uo,{title:L("Connections")}),we(nt,{children:[we("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"space-between"},children:[we(rt,{children:[we(Le,{children:[U("span",{children:L("Active")}),U("span",{className:je.connQty,children:Rn({qty:u.length})})]}),we(Le,{children:[U("span",{children:L("Closed")}),U("span",{className:je.connQty,children:Rn({qty:J.length})})]})]}),U("div",{className:je.inputWrapper,children:U("input",{type:"text",name:"filter",autoComplete:"off",className:je.input,placeholder:"Filter",onChange:K=>se(K.target.value)})})]}),U("div",{ref:v,style:{padding:30,paddingBottom:yn,paddingTop:0},children:we("div",{style:{height:f-yn,overflow:"auto"},children:[we(De,{children:[U(so,{children:bn(u)}),U(mo,{icon:X?U(wo,{size:16}):U(bo,{size:16}),mainButtonStyles:X?{background:"#e74c3c"}:{},style:ho,text:L(X?"Resume Refresh":"Pause Refresh"),onClick:Y,children:U(yo,{text:"Close All Connections",onClick:de,children:U(lo,{size:10})})})]}),U(De,{children:bn(J)})]})}),U(ui,{isOpen:te,primaryButtonOnTap:ne,onRequestClose:D})]})]})}const gi=C=>({apiConfig:co(C)}),Ri=ro(gi)(pi);export{Ri as default}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections.57d57b9f.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections.57d57b9f.js deleted file mode 100644 index 41d46a825..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Connections.57d57b9f.js +++ /dev/null @@ -1 +0,0 @@ -var io=Object.defineProperty,ao=Object.defineProperties;var uo=Object.getOwnPropertyDescriptors;var vn=Object.getOwnPropertySymbols;var so=Object.prototype.hasOwnProperty,lo=Object.prototype.propertyIsEnumerable;var mn=(y,p,d)=>p in y?io(y,p,{enumerable:!0,configurable:!0,writable:!0,value:d}):y[p]=d,_e=(y,p)=>{for(var d in p||(p={}))so.call(p,d)&&mn(y,d,p[d]);if(vn)for(var d of vn(p))lo.call(p,d)&&mn(y,d,p[d]);return y},He=(y,p)=>ao(y,uo(p));import{r as ue,R as xe,c as Ae,a as co,j as U,b as be,p as hn,m as yn,M as fo,B as bn,d as po,e as go,f as vo,u as mo,C as ho,F as yo,S as bo,I as wo,g as Ro}from"./index.5901d226.js";import{u as Co}from"./useRemainingViewPortHeight.d051faee.js";import{C as So}from"./chevron-down.e7f05dbc.js";import{f as xo}from"./index.e97a91e5.js";import{F as Po,p as Bo,A as Eo}from"./Fab.93225453.js";import{P as Io,a as To}from"./play.56145bca.js";function wt(y){return function(p){return!!p.type&&p.type.tabsRole===y}}var rt=wt("Tab"),Rt=wt("TabList"),Ct=wt("TabPanel");function Fo(y){return rt(y)||Rt(y)||Ct(y)}function ht(y,p){return ue.exports.Children.map(y,function(d){return d===null?null:Fo(d)?p(d):d.props&&d.props.children&&typeof d.props.children=="object"?ue.exports.cloneElement(d,Object.assign({},d.props,{children:ht(d.props.children,p)})):d})}function Bn(y,p){return ue.exports.Children.forEach(y,function(d){d!==null&&(rt(d)||Ct(d)?p(d):d.props&&d.props.children&&typeof d.props.children=="object"&&(Rt(d)&&p(d),Bn(d.props.children,p)))})}function En(y){var p=0;return Bn(y,function(d){rt(d)&&p++}),p}var Ao=["children","className","disabledTabClassName","domRef","focus","forceRenderTabPanel","onSelect","selectedIndex","selectedTabClassName","selectedTabPanelClassName","environment","disableUpDownKeys"];function ko(y,p){if(y==null)return{};var d={},v=Object.keys(y),N,W;for(W=0;W=0)&&(d[N]=y[N]);return d}function In(y){return y&&"getAttribute"in y}function wn(y){return In(y)&&y.getAttribute("data-rttab")}function Te(y){return In(y)&&y.getAttribute("aria-disabled")==="true"}var nt;function Go(y){var p=y||(typeof window!="undefined"?window:void 0);try{nt=!!(typeof p!="undefined"&&p.document&&p.document.activeElement)}catch{nt=!1}}var _o={className:"react-tabs",focus:!1},St=function(p){var d=ue.exports.useRef([]),v=ue.exports.useRef([]),N=ue.exports.useRef();function W(m,H){if(!(m<0||m>=J())){var L=p.onSelect,K=p.selectedIndex;L(m,K,H)}}function l(m){for(var H=J(),L=m+1;Lm;)if(!Te(te(H)))return H;return m}function se(){for(var m=J(),H=0;H=0)&&(d[N]=y[N]);return d}var Mo={className:"react-tabs__tab-list"},it=function(p){var d=p.children,v=p.className,N=zo(p,Wo);return xe.createElement("ul",Object.assign({},N,{className:Ae(v),role:"tablist"}),d)};it.tabsRole="TabList";it.propTypes={};it.defaultProps=Mo;var jo=["children","className","disabled","disabledClassName","focus","id","selected","selectedClassName","tabIndex","tabRef"];function Lo(y,p){if(y==null)return{};var d={},v=Object.keys(y),N,W;for(W=0;W=0)&&(d[N]=y[N]);return d}var mt="react-tabs__tab",Do={className:mt,disabledClassName:mt+"--disabled",focus:!1,id:null,selected:!1,selectedClassName:mt+"--selected"},Ve=function(p){var d,v=ue.exports.useRef(),N=p.children,W=p.className,l=p.disabled,Z=p.disabledClassName,se=p.focus,u=p.id,J=p.selected,te=p.selectedClassName,le=p.tabIndex,de=p.tabRef,D=Lo(p,jo);return ue.exports.useEffect(function(){J&&se&&v.current.focus()},[J,se]),xe.createElement("li",Object.assign({},D,{className:Ae(W,(d={},d[te]=J,d[Z]=l,d)),ref:function(ce){v.current=ce,de&&de(ce)},role:"tab",id:"tab"+u,"aria-selected":J?"true":"false","aria-disabled":l?"true":"false","aria-controls":"panel"+u,tabIndex:le||(J?"0":null),"data-rttab":!0}),N)};Ve.propTypes={};Ve.tabsRole="Tab";Ve.defaultProps=Do;var Vo=["children","className","forceRender","id","selected","selectedClassName"];function $o(y,p){if(y==null)return{};var d={},v=Object.keys(y),N,W;for(W=0;W=0)&&(d[N]=y[N]);return d}var Rn="react-tabs__tab-panel",Ko={className:Rn,forceRender:!1,selectedClassName:Rn+"--selected"},$e=function(p){var d,v=p.children,N=p.className,W=p.forceRender,l=p.id,Z=p.selected,se=p.selectedClassName,u=$o(p,Vo);return xe.createElement("div",Object.assign({},u,{className:Ae(N,(d={},d[se]=Z,d)),role:"tabpanel",id:"panel"+l,"aria-labelledby":"tab"+l}),W||Z?v:null)};$e.tabsRole="TabPanel";$e.propTypes={};$e.defaultProps=Ko;const Uo="_placeHolder_12xws_1",qo="_connQty_12xws_10",Xo="_inputWrapper_12xws_22",Qo="_input_12xws_22";var De={placeHolder:Uo,connQty:qo,inputWrapper:Xo,input:Qo},yt={exports:{}},bt={exports:{}};(function(y,p){(function(d,v){v(p,ue.exports)})(co,function(d,v){function N(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(f){return void n(f)}s.done?t(c):Promise.resolve(c).then(r,i)}function W(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(c){N(o,r,i,a,s,"next",c)}function s(c){N(o,r,i,a,s,"throw",c)}a(void 0)})}}function l(){return(l=Object.assign||function(e){for(var t=1;t=0||(i[n]=e[n]);return i}function se(e){var t=function(n,r){if(typeof n!="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var o=i.call(n,r||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(e,"string");return typeof t=="symbol"?t:String(t)}v=v&&Object.prototype.hasOwnProperty.call(v,"default")?v.default:v;var u={init:"init"},J=function(e){var t=e.value;return t===void 0?"":t},te=function(){return v.createElement(v.Fragment,null,"\xA0")},le={Cell:J,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function de(){for(var e=arguments.length,t=new Array(e),n=0;n(o=typeof o=="number"?o:1/0)){var a=i;i=o,o=a}return e.filter(function(s){return t.some(function(c){var f=s.values[c];return f>=i&&f<=o})})};Wt.autoRemove=function(e){return!e||typeof e[0]!="number"&&typeof e[1]!="number"};var We=Object.freeze({__proto__:null,text:Tt,exactText:Ft,exactTextCase:At,includes:kt,includesAll:Gt,includesSome:_t,includesValue:Ht,exact:Nt,equals:Ot,between:Wt});u.resetFilters="resetFilters",u.setFilter="setFilter",u.setAllFilters="setAllFilters";var zt=function(e){e.stateReducers.push(Zn),e.useInstance.push(er)};function Zn(e,t,n,r){if(t.type===u.init)return l({filters:[]},e);if(t.type===u.resetFilters)return l({},e,{filters:r.initialState.filters||[]});if(t.type===u.setFilter){var i=t.columnId,o=t.filterValue,a=r.allColumns,s=r.filterTypes,c=a.find(function(S){return S.id===i});if(!c)throw new Error("React-Table: Could not find a column with id: "+i);var f=Ce(c.filter,s||{},We),R=e.filters.find(function(S){return S.id===i}),h=ne(o,R&&R.value);return Be(f.autoRemove,h,c)?l({},e,{filters:e.filters.filter(function(S){return S.id!==i})}):l({},e,R?{filters:e.filters.map(function(S){return S.id===i?{id:i,value:h}:S})}:{filters:[].concat(e.filters,[{id:i,value:h}])})}if(t.type===u.setAllFilters){var b=t.filters,g=r.allColumns,w=r.filterTypes;return l({},e,{filters:ne(b,e.filters).filter(function(S){var x=g.find(function(E){return E.id===S.id});return!Be(Ce(x.filter,w||{},We).autoRemove,S.value,x)})})}}function er(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,a=e.filterTypes,s=e.manualFilters,c=e.defaultCanFilter,f=c!==void 0&&c,R=e.disableFilters,h=e.state.filters,b=e.dispatch,g=e.autoResetFilters,w=g===void 0||g,S=v.useCallback(function(P,k){b({type:u.setFilter,columnId:P,filterValue:k})},[b]),x=v.useCallback(function(P){b({type:u.setAllFilters,filters:P})},[b]);o.forEach(function(P){var k=P.id,z=P.accessor,T=P.defaultCanFilter,A=P.disableFilters;P.canFilter=z?ie(A!==!0&&void 0,R!==!0&&void 0,!0):ie(T,f,!1),P.setFilter=function(G){return S(P.id,G)};var $=h.find(function(G){return G.id===k});P.filterValue=$&&$.value});var E=v.useMemo(function(){if(s||!h.length)return[n,r,i];var P=[],k={};return[function z(T,A){A===void 0&&(A=0);var $=T;return($=h.reduce(function(G,V){var j=V.id,q=V.value,I=o.find(function(ee){return ee.id===j});if(!I)return G;A===0&&(I.preFilteredRows=G);var M=Ce(I.filter,a||{},We);return M?(I.filteredRows=M(G,[j],q),I.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+I.id+"."),G)},T)).forEach(function(G){P.push(G),k[G.id]=G,G.subRows&&(G.subRows=G.subRows&&G.subRows.length>0?z(G.subRows,A+1):G.subRows)}),$}(n),P,k]},[s,h,n,r,i,o,a]),O=E[0],B=E[1],C=E[2];v.useMemo(function(){o.filter(function(P){return!h.find(function(k){return k.id===P.id})}).forEach(function(P){P.preFilteredRows=O,P.filteredRows=O})},[O,h,o]);var _=m(w);L(function(){_()&&b({type:u.resetFilters})},[b,s?null:t]),Object.assign(e,{preFilteredRows:n,preFilteredFlatRows:r,preFilteredRowsById:i,filteredRows:O,filteredFlatRows:B,filteredRowsById:C,rows:O,flatRows:B,rowsById:C,setFilter:S,setAllFilters:x})}zt.pluginName="useFilters",u.resetGlobalFilter="resetGlobalFilter",u.setGlobalFilter="setGlobalFilter";var Mt=function(e){e.stateReducers.push(tr),e.useInstance.push(nr)};function tr(e,t,n,r){if(t.type===u.resetGlobalFilter)return l({},e,{globalFilter:r.initialState.globalFilter||void 0});if(t.type===u.setGlobalFilter){var i=t.filterValue,o=r.userFilterTypes,a=Ce(r.globalFilter,o||{},We),s=ne(i,e.globalFilter);return Be(a.autoRemove,s)?(e.globalFilter,Z(e,["globalFilter"])):l({},e,{globalFilter:s})}}function nr(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,a=e.filterTypes,s=e.globalFilter,c=e.manualGlobalFilter,f=e.state.globalFilter,R=e.dispatch,h=e.autoResetGlobalFilter,b=h===void 0||h,g=e.disableGlobalFilter,w=v.useCallback(function(C){R({type:u.setGlobalFilter,filterValue:C})},[R]),S=v.useMemo(function(){if(c||f===void 0)return[n,r,i];var C=[],_={},P=Ce(s,a||{},We);if(!P)return console.warn("Could not find a valid 'globalFilter' option."),n;o.forEach(function(z){var T=z.disableGlobalFilter;z.canFilter=ie(T!==!0&&void 0,g!==!0&&void 0,!0)});var k=o.filter(function(z){return z.canFilter===!0});return[function z(T){return(T=P(T,k.map(function(A){return A.id}),f)).forEach(function(A){C.push(A),_[A.id]=A,A.subRows=A.subRows&&A.subRows.length?z(A.subRows):A.subRows}),T}(n),C,_]},[c,f,s,a,o,n,r,i,g]),x=S[0],E=S[1],O=S[2],B=m(b);L(function(){B()&&R({type:u.resetGlobalFilter})},[R,c?null:t]),Object.assign(e,{preGlobalFilteredRows:n,preGlobalFilteredFlatRows:r,preGlobalFilteredRowsById:i,globalFilteredRows:x,globalFilteredFlatRows:E,globalFilteredRowsById:O,rows:x,flatRows:E,rowsById:O,setGlobalFilter:w,disableGlobalFilter:g})}function jt(e,t){return t.reduce(function(n,r){return n+(typeof r=="number"?r:0)},0)}Mt.pluginName="useGlobalFilter";var Lt=Object.freeze({__proto__:null,sum:jt,min:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.min(t,n))}),t},max:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.max(t,n))}),t},minMax:function(e){var t=e[0]||0,n=e[0]||0;return e.forEach(function(r){typeof r=="number"&&(t=Math.min(t,r),n=Math.max(n,r))}),t+".."+n},average:function(e){return jt(0,e)/e.length},median:function(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort(function(r,i){return r-i});return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},unique:function(e){return Array.from(new Set(e).values())},uniqueCount:function(e){return new Set(e).size},count:function(e){return e.length}}),rr=[],or={};u.resetGroupBy="resetGroupBy",u.setGroupBy="setGroupBy",u.toggleGroupBy="toggleGroupBy";var Dt=function(e){e.getGroupByToggleProps=[ir],e.stateReducers.push(ar),e.visibleColumnsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.groupBy])}),e.visibleColumns.push(ur),e.useInstance.push(lr),e.prepareRow.push(cr)};Dt.pluginName="useGroupBy";var ir=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(r){r.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function ar(e,t,n,r){if(t.type===u.init)return l({groupBy:[]},e);if(t.type===u.resetGroupBy)return l({},e,{groupBy:r.initialState.groupBy||[]});if(t.type===u.setGroupBy)return l({},e,{groupBy:t.value});if(t.type===u.toggleGroupBy){var i=t.columnId,o=t.value,a=o!==void 0?o:!e.groupBy.includes(i);return l({},e,a?{groupBy:[].concat(e.groupBy,[i])}:{groupBy:e.groupBy.filter(function(s){return s!==i})})}}function ur(e,t){var n=t.instance.state.groupBy,r=n.map(function(o){return e.find(function(a){return a.id===o})}).filter(Boolean),i=e.filter(function(o){return!n.includes(o.id)});return(e=[].concat(r,i)).forEach(function(o){o.isGrouped=n.includes(o.id),o.groupedIndex=n.indexOf(o.id)}),e}var sr={};function lr(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,a=e.flatHeaders,s=e.groupByFn,c=s===void 0?Vt:s,f=e.manualGroupBy,R=e.aggregations,h=R===void 0?sr:R,b=e.plugins,g=e.state.groupBy,w=e.dispatch,S=e.autoResetGroupBy,x=S===void 0||S,E=e.disableGroupBy,O=e.defaultCanGroupBy,B=e.getHooks;Y(b,["useColumnOrder","useFilters"],"useGroupBy");var C=m(e);o.forEach(function(I){var M=I.accessor,ee=I.defaultGroupBy,fe=I.disableGroupBy;I.canGroupBy=M?ie(I.canGroupBy,fe!==!0&&void 0,E!==!0&&void 0,!0):ie(I.canGroupBy,ee,O,!1),I.canGroupBy&&(I.toggleGroupBy=function(){return e.toggleGroupBy(I.id)}),I.Aggregated=I.Aggregated||I.Cell});var _=v.useCallback(function(I,M){w({type:u.toggleGroupBy,columnId:I,value:M})},[w]),P=v.useCallback(function(I){w({type:u.setGroupBy,value:I})},[w]);a.forEach(function(I){I.getGroupByToggleProps=D(B().getGroupByToggleProps,{instance:C(),header:I})});var k=v.useMemo(function(){if(f||!g.length)return[n,r,i,rr,or,r,i];var I=g.filter(function(ae){return o.find(function(Se){return Se.id===ae})}),M=[],ee={},fe=[],F={},Q=[],re={},pe=function ae(Se,we,ln){if(we===void 0&&(we=0),we===I.length)return Se.map(function(Xe){return l({},Xe,{depth:we})});var pt=I[we],Yr=c(Se,pt);return Object.entries(Yr).map(function(Xe,Zr){var cn=Xe[0],Qe=Xe[1],Je=pt+":"+cn,dn=ae(Qe,we+1,Je=ln?ln+">"+Je:Je),fn=we?Pe(Qe,"leafRows"):Qe,eo=function(ye,gt,no){var Ye={};return o.forEach(function(oe){if(I.includes(oe.id))Ye[oe.id]=gt[0]?gt[0].values[oe.id]:null;else{var pn=typeof oe.aggregate=="function"?oe.aggregate:h[oe.aggregate]||Lt[oe.aggregate];if(pn){var ro=gt.map(function(Ze){return Ze.values[oe.id]}),oo=ye.map(function(Ze){var vt=Ze.values[oe.id];if(!no&&oe.aggregateValue){var gn=typeof oe.aggregateValue=="function"?oe.aggregateValue:h[oe.aggregateValue]||Lt[oe.aggregateValue];if(!gn)throw console.info({column:oe}),new Error("React Table: Invalid column.aggregateValue option for column listed above");vt=gn(vt,Ze,oe)}return vt});Ye[oe.id]=pn(oo,ro)}else{if(oe.aggregate)throw console.info({column:oe}),new Error("React Table: Invalid column.aggregate option for column listed above");Ye[oe.id]=null}}}),Ye}(fn,Qe,we),to={id:Je,isGrouped:!0,groupByID:pt,groupByVal:cn,values:eo,subRows:dn,leafRows:fn,depth:we,index:Zr};return dn.forEach(function(ye){M.push(ye),ee[ye.id]=ye,ye.isGrouped?(fe.push(ye),F[ye.id]=ye):(Q.push(ye),re[ye.id]=ye)}),to})}(n);return pe.forEach(function(ae){M.push(ae),ee[ae.id]=ae,ae.isGrouped?(fe.push(ae),F[ae.id]=ae):(Q.push(ae),re[ae.id]=ae)}),[pe,M,ee,fe,F,Q,re]},[f,g,n,r,i,o,h,c]),z=k[0],T=k[1],A=k[2],$=k[3],G=k[4],V=k[5],j=k[6],q=m(x);L(function(){q()&&w({type:u.resetGroupBy})},[w,f?null:t]),Object.assign(e,{preGroupedRows:n,preGroupedFlatRow:r,preGroupedRowsById:i,groupedRows:z,groupedFlatRows:T,groupedRowsById:A,onlyGroupedFlatRows:$,onlyGroupedRowsById:G,nonGroupedFlatRows:V,nonGroupedRowsById:j,rows:z,flatRows:T,rowsById:A,toggleGroupBy:_,setGroupBy:P})}function cr(e){e.allCells.forEach(function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&((n=e.subRows)==null?void 0:n.length)})}function Vt(e,t){return e.reduce(function(n,r,i){var o=""+r.values[t];return n[o]=Array.isArray(n[o])?n[o]:[],n[o].push(r),n},{})}var $t=/([0-9]+)/gm;function ut(e,t){return e===t?0:e>t?1:-1}function ze(e,t,n){return[e.values[n],t.values[n]]}function Kt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}var dr=Object.freeze({__proto__:null,alphanumeric:function(e,t,n){var r=ze(e,t,n),i=r[0],o=r[1];for(i=Kt(i),o=Kt(o),i=i.split($t).filter(Boolean),o=o.split($t).filter(Boolean);i.length&&o.length;){var a=i.shift(),s=o.shift(),c=parseInt(a,10),f=parseInt(s,10),R=[c,f].sort();if(isNaN(R[0])){if(a>s)return 1;if(s>a)return-1}else{if(isNaN(R[1]))return isNaN(c)?-1:1;if(c>f)return 1;if(f>c)return-1}}return i.length-o.length},datetime:function(e,t,n){var r=ze(e,t,n),i=r[0],o=r[1];return ut(i=i.getTime(),o=o.getTime())},basic:function(e,t,n){var r=ze(e,t,n);return ut(r[0],r[1])},string:function(e,t,n){var r=ze(e,t,n),i=r[0],o=r[1];for(i=i.split("").filter(Boolean),o=o.split("").filter(Boolean);i.length&&o.length;){var a=i.shift(),s=o.shift(),c=a.toLowerCase(),f=s.toLowerCase();if(c>f)return 1;if(f>c)return-1;if(a>s)return 1;if(s>a)return-1}return i.length-o.length},number:function(e,t,n){var r=ze(e,t,n),i=r[0],o=r[1],a=/[^0-9.]/gi;return ut(i=Number(String(i).replace(a,"")),o=Number(String(o).replace(a,"")))}});u.resetSortBy="resetSortBy",u.setSortBy="setSortBy",u.toggleSortBy="toggleSortBy",u.clearSortBy="clearSortBy",le.sortType="alphanumeric",le.sortDescFirst=!1;var Ut=function(e){e.getSortByToggleProps=[fr],e.stateReducers.push(pr),e.useInstance.push(gr)};Ut.pluginName="useSortBy";var fr=function(e,t){var n=t.instance,r=t.column,i=n.isMultiSortEvent,o=i===void 0?function(a){return a.shiftKey}:i;return[e,{onClick:r.canSort?function(a){a.persist(),r.toggleSortBy(void 0,!n.disableMultiSort&&o(a))}:void 0,style:{cursor:r.canSort?"pointer":void 0},title:r.canSort?"Toggle SortBy":void 0}]};function pr(e,t,n,r){if(t.type===u.init)return l({sortBy:[]},e);if(t.type===u.resetSortBy)return l({},e,{sortBy:r.initialState.sortBy||[]});if(t.type===u.clearSortBy)return l({},e,{sortBy:e.sortBy.filter(function(C){return C.id!==t.columnId})});if(t.type===u.setSortBy)return l({},e,{sortBy:t.sortBy});if(t.type===u.toggleSortBy){var i,o=t.columnId,a=t.desc,s=t.multi,c=r.allColumns,f=r.disableMultiSort,R=r.disableSortRemove,h=r.disableMultiRemove,b=r.maxMultiSortColCount,g=b===void 0?Number.MAX_SAFE_INTEGER:b,w=e.sortBy,S=c.find(function(C){return C.id===o}).sortDescFirst,x=w.find(function(C){return C.id===o}),E=w.findIndex(function(C){return C.id===o}),O=a!=null,B=[];return(i=!f&&s?x?"toggle":"add":E!==w.length-1||w.length!==1?"replace":x?"toggle":"replace")!="toggle"||R||O||s&&h||!(x&&x.desc&&!S||!x.desc&&S)||(i="remove"),i==="replace"?B=[{id:o,desc:O?a:S}]:i==="add"?(B=[].concat(w,[{id:o,desc:O?a:S}])).splice(0,B.length-g):i==="toggle"?B=w.map(function(C){return C.id===o?l({},C,{desc:O?a:!x.desc}):C}):i==="remove"&&(B=w.filter(function(C){return C.id!==o})),l({},e,{sortBy:B})}}function gr(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.allColumns,o=e.orderByFn,a=o===void 0?qt:o,s=e.sortTypes,c=e.manualSortBy,f=e.defaultCanSort,R=e.disableSortBy,h=e.flatHeaders,b=e.state.sortBy,g=e.dispatch,w=e.plugins,S=e.getHooks,x=e.autoResetSortBy,E=x===void 0||x;Y(w,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var O=v.useCallback(function(T){g({type:u.setSortBy,sortBy:T})},[g]),B=v.useCallback(function(T,A,$){g({type:u.toggleSortBy,columnId:T,desc:A,multi:$})},[g]),C=m(e);h.forEach(function(T){var A=T.accessor,$=T.canSort,G=T.disableSortBy,V=T.id,j=A?ie(G!==!0&&void 0,R!==!0&&void 0,!0):ie(f,$,!1);T.canSort=j,T.canSort&&(T.toggleSortBy=function(I,M){return B(T.id,I,M)},T.clearSortBy=function(){g({type:u.clearSortBy,columnId:T.id})}),T.getSortByToggleProps=D(S().getSortByToggleProps,{instance:C(),column:T});var q=b.find(function(I){return I.id===V});T.isSorted=!!q,T.sortedIndex=b.findIndex(function(I){return I.id===V}),T.isSortedDesc=T.isSorted?q.desc:void 0});var _=v.useMemo(function(){if(c||!b.length)return[n,r];var T=[],A=b.filter(function($){return i.find(function(G){return G.id===$.id})});return[function $(G){var V=a(G,A.map(function(j){var q=i.find(function(ee){return ee.id===j.id});if(!q)throw new Error("React-Table: Could not find a column with id: "+j.id+" while sorting");var I=q.sortType,M=Ge(I)||(s||{})[I]||dr[I];if(!M)throw new Error("React-Table: Could not find a valid sortType of '"+I+"' for column '"+j.id+"'.");return function(ee,fe){return M(ee,fe,j.id,j.desc)}}),A.map(function(j){var q=i.find(function(I){return I.id===j.id});return q&&q.sortInverted?j.desc:!j.desc}));return V.forEach(function(j){T.push(j),j.subRows&&j.subRows.length!==0&&(j.subRows=$(j.subRows))}),V}(n),T]},[c,b,n,r,i,a,s]),P=_[0],k=_[1],z=m(E);L(function(){z()&&g({type:u.resetSortBy})},[c?null:t]),Object.assign(e,{preSortedRows:n,preSortedFlatRows:r,sortedRows:P,sortedFlatRows:k,rows:P,flatRows:k,setSortBy:O,toggleSortBy:B})}function qt(e,t,n){return[].concat(e).sort(function(r,i){for(var o=0;oe.pageIndex?s=i===-1?o.length>=e.pageSize:a-1),s?l({},e,{pageIndex:a}):e}if(t.type===u.setPageSize){var c=t.pageSize,f=e.pageSize*e.pageIndex;return l({},e,{pageIndex:Math.floor(f/c),pageSize:c})}}function mr(e){var t=e.rows,n=e.autoResetPage,r=n===void 0||n,i=e.manualExpandedKey,o=i===void 0?"expanded":i,a=e.plugins,s=e.pageCount,c=e.paginateExpandedRows,f=c===void 0||c,R=e.expandSubRows,h=R===void 0||R,b=e.state,g=b.pageSize,w=b.pageIndex,S=b.expanded,x=b.globalFilter,E=b.filters,O=b.groupBy,B=b.sortBy,C=e.dispatch,_=e.data,P=e.manualPagination;Y(a,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var k=m(r);L(function(){k()&&C({type:u.resetPage})},[C,P?null:_,x,E,O,B]);var z=P?s:Math.ceil(t.length/g),T=v.useMemo(function(){return z>0?[].concat(new Array(z)).fill(null).map(function(M,ee){return ee}):[]},[z]),A=v.useMemo(function(){var M;if(P)M=t;else{var ee=g*w,fe=ee+g;M=t.slice(ee,fe)}return f?M:Ne(M,{manualExpandedKey:o,expanded:S,expandSubRows:h})},[h,S,o,P,w,g,f,t]),$=w>0,G=z===-1?A.length>=g:w-1&&o.push(i.splice(c,1)[0])};i.length&&r.length;)a();return[].concat(o,i)}function zr(e){var t=e.dispatch;e.setColumnOrder=v.useCallback(function(n){return t({type:u.setColumnOrder,columnOrder:n})},[t])}nn.pluginName="useColumnOrder",le.canResize=!0,u.columnStartResizing="columnStartResizing",u.columnResizing="columnResizing",u.columnDoneResizing="columnDoneResizing",u.resetResize="resetResize";var rn=function(e){e.getResizerProps=[Mr],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(jr),e.useInstance.push(Dr),e.useInstanceBeforeDimensions.push(Lr)},Mr=function(e,t){var n=t.instance,r=t.header,i=n.dispatch,o=function(a,s){var c=!1;if(a.type==="touchstart"){if(a.touches&&a.touches.length>1)return;c=!0}var f,R,h=function(B){var C=[];return function _(P){P.columns&&P.columns.length&&P.columns.map(_),C.push(P)}(B),C}(s).map(function(B){return[B.id,B.totalWidth]}),b=c?Math.round(a.touches[0].clientX):a.clientX,g=function(){window.cancelAnimationFrame(f),f=null,i({type:u.columnDoneResizing})},w=function(){window.cancelAnimationFrame(f),f=null,i({type:u.columnResizing,clientX:R})},S=function(B){R=B,f||(f=window.requestAnimationFrame(w))},x={mouse:{moveEvent:"mousemove",moveHandler:function(B){return S(B.clientX)},upEvent:"mouseup",upHandler:function(B){document.removeEventListener("mousemove",x.mouse.moveHandler),document.removeEventListener("mouseup",x.mouse.upHandler),g()}},touch:{moveEvent:"touchmove",moveHandler:function(B){return B.cancelable&&(B.preventDefault(),B.stopPropagation()),S(B.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(B){document.removeEventListener(x.touch.moveEvent,x.touch.moveHandler),document.removeEventListener(x.touch.upEvent,x.touch.moveHandler),g()}}},E=c?x.touch:x.mouse,O=!!function(){if(typeof Ie=="boolean")return Ie;var B=!1;try{var C={get passive(){return B=!0,!1}};window.addEventListener("test",null,C),window.removeEventListener("test",null,C)}catch{B=!1}return Ie=B}()&&{passive:!1};document.addEventListener(E.moveEvent,E.moveHandler,O),document.addEventListener(E.upEvent,E.upHandler,O),i({type:u.columnStartResizing,columnId:s.id,columnWidth:s.totalWidth,headerIdWidths:h,clientX:b})};return[e,{onMouseDown:function(a){return a.persist()||o(a,r)},onTouchStart:function(a){return a.persist()||o(a,r)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function jr(e,t){if(t.type===u.init)return l({columnResizing:{columnWidths:{}}},e);if(t.type===u.resetResize)return l({},e,{columnResizing:{columnWidths:{}}});if(t.type===u.columnStartResizing){var n=t.clientX,r=t.columnId,i=t.columnWidth,o=t.headerIdWidths;return l({},e,{columnResizing:l({},e.columnResizing,{startX:n,headerIdWidths:o,columnWidth:i,isResizingColumn:r})})}if(t.type===u.columnResizing){var a=t.clientX,s=e.columnResizing,c=s.startX,f=s.columnWidth,R=s.headerIdWidths,h=(a-c)/f,b={};return(R===void 0?[]:R).forEach(function(g){var w=g[0],S=g[1];b[w]=Math.max(S+S*h,0)}),l({},e,{columnResizing:l({},e.columnResizing,{columnWidths:l({},e.columnResizing.columnWidths,{},b)})})}return t.type===u.columnDoneResizing?l({},e,{columnResizing:l({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}rn.pluginName="useResizeColumns";var Lr=function(e){var t=e.flatHeaders,n=e.disableResizing,r=e.getHooks,i=e.state.columnResizing,o=m(e);t.forEach(function(a){var s=ie(a.disableResizing!==!0&&void 0,n!==!0&&void 0,!0);a.canResize=s,a.width=i.columnWidths[a.id]||a.originalWidth||a.width,a.isResizing=i.isResizingColumn===a.id,s&&(a.getResizerProps=D(r().getResizerProps,{instance:o(),header:a}))})};function Dr(e){var t=e.plugins,n=e.dispatch,r=e.autoResetResize,i=r===void 0||r,o=e.columns;Y(t,["useAbsoluteLayout"],"useResizeColumns");var a=m(i);L(function(){a()&&n({type:u.resetResize})},[o]);var s=v.useCallback(function(){return n({type:u.resetResize})},[n]);Object.assign(e,{resetResizing:s})}var st={position:"absolute",top:0},on=function(e){e.getTableBodyProps.push(qe),e.getRowProps.push(qe),e.getHeaderGroupProps.push(qe),e.getFooterGroupProps.push(qe),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:l({},st,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:l({},st,{left:r.column.totalLeft+"px",width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:l({},st,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]})};on.pluginName="useAbsoluteLayout";var qe=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},lt={display:"inline-block",boxSizing:"border-box"},ct=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},an=function(e){e.getRowProps.push(ct),e.getHeaderGroupProps.push(ct),e.getFooterGroupProps.push(ct),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:l({},lt,{width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:l({},lt,{width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:l({},lt,{width:r.totalWidth+"px"})}]})};function un(e){e.getTableProps.push(Vr),e.getRowProps.push(dt),e.getHeaderGroupProps.push(dt),e.getFooterGroupProps.push(dt),e.getHeaderProps.push($r),e.getCellProps.push(Kr),e.getFooterProps.push(Ur)}an.pluginName="useBlockLayout",un.pluginName="useFlexLayout";var Vr=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},dt=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},$r=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},Kr=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},Ur=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function sn(e){e.stateReducers.push(Jr),e.getTableProps.push(qr),e.getHeaderProps.push(Xr),e.getRowProps.push(Qr)}u.columnStartResizing="columnStartResizing",u.columnResizing="columnResizing",u.columnDoneResizing="columnDoneResizing",u.resetResize="resetResize",sn.pluginName="useGridLayout";var qr=function(e,t){var n=t.instance;return[e,{style:{display:"grid",gridTemplateColumns:n.visibleColumns.map(function(r){var i;return n.state.gridLayout.columnWidths[r.id]?n.state.gridLayout.columnWidths[r.id]+"px":(i=n.state.columnResizing)!=null&&i.isResizingColumn?n.state.gridLayout.startWidths[r.id]+"px":typeof r.width=="number"?r.width+"px":r.width}).join(" ")}}]},Xr=function(e,t){var n=t.column;return[e,{id:"header-cell-"+n.id,style:{position:"sticky",gridColumn:"span "+n.totalVisibleHeaderCount}}]},Qr=function(e,t){var n=t.row;return n.isExpanded?[e,{style:{gridColumn:"1 / "+(n.cells.length+1)}}]:[e,{}]};function Jr(e,t,n,r){if(t.type===u.init)return l({gridLayout:{columnWidths:{}}},e);if(t.type===u.resetResize)return l({},e,{gridLayout:{columnWidths:{}}});if(t.type===u.columnStartResizing){var i=t.columnId,o=t.headerIdWidths,a=ft(i);if(a!==void 0){var s=r.visibleColumns.reduce(function(C,_){var P;return l({},C,((P={})[_.id]=ft(_.id),P))},{}),c=r.visibleColumns.reduce(function(C,_){var P;return l({},C,((P={})[_.id]=_.minWidth,P))},{}),f=r.visibleColumns.reduce(function(C,_){var P;return l({},C,((P={})[_.id]=_.maxWidth,P))},{}),R=o.map(function(C){var _=C[0];return[_,ft(_)]});return l({},e,{gridLayout:l({},e.gridLayout,{startWidths:s,minWidths:c,maxWidths:f,headerIdGridWidths:R,columnWidth:a})})}return e}if(t.type===u.columnResizing){var h=t.clientX,b=e.columnResizing.startX,g=e.gridLayout,w=g.columnWidth,S=g.minWidths,x=g.maxWidths,E=g.headerIdGridWidths,O=(h-b)/w,B={};return(E===void 0?[]:E).forEach(function(C){var _=C[0],P=C[1];B[_]=Math.min(Math.max(S[_],P+P*O),x[_])}),l({},e,{gridLayout:l({},e.gridLayout,{columnWidths:l({},e.gridLayout.columnWidths,{},B)})})}return t.type===u.columnDoneResizing?l({},e,{gridLayout:l({},e.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function ft(e){var t,n=(t=document.getElementById("header-cell-"+e))==null?void 0:t.offsetWidth;if(n!==void 0)return n}d._UNSTABLE_usePivotColumns=Qt,d.actions=u,d.defaultColumn=le,d.defaultGroupByFn=Vt,d.defaultOrderByFn=qt,d.defaultRenderer=J,d.emptyRenderer=te,d.ensurePluginOrder=Y,d.flexRender=ge,d.functionalUpdate=ne,d.loopHooks=ce,d.makePropGetter=D,d.makeRenderer=K,d.reduceHooks=X,d.safeUseLayoutEffect=H,d.useAbsoluteLayout=on,d.useAsyncDebounce=function(e,t){t===void 0&&(t=0);var n=v.useRef({}),r=m(e),i=m(t);return v.useCallback(function(){var o=W(regeneratorRuntime.mark(function a(){var s,c,f,R=arguments;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:for(s=R.length,c=new Array(s),f=0;f1?t-1:0),r=1;rbe("div",He(_e({},W.getHeaderGroupProps()),{className:Fe.tr,children:[W.headers.map(l=>be("div",He(_e({},l.getHeaderProps(l.getSortByToggleProps())),{className:Fe.th,children:[U("span",{children:l.render("Header")}),U("span",{className:Fe.sortIconContainer,children:l.isSorted?U("span",{className:l.isSortedDesc?"":Fe.rotate180,children:U(So,{size:16})}):null})]}))),v.map((l,Z)=>(N(l),l.cells.map((se,u)=>U("div",He(_e({},se.getCellProps()),{className:Ae(Fe.td,Z%2===0?Fe.odd:!1,u>=1&&u<=4?Fe.du:!1),children:ii(se)})))))]})))}))}const li="_overlay_148w6_1",ci="_cnt_148w6_5",di="_afterOpen_148w6_15",fi="_btngrp_148w6_20";var et={overlay:li,cnt:ci,afterOpen:di,btngrp:fi};const{useRef:pi,useCallback:gi,useMemo:vi}=xe;function mi({isOpen:y,onRequestClose:p,primaryButtonOnTap:d}){const v=pi(null),N=gi(()=>{v.current.focus()},[]),W=vi(()=>({base:Ae(yn.content,et.cnt),afterOpen:et.afterOpen,beforeClose:""}),[]);return be(fo,{isOpen:y,onRequestClose:p,onAfterOpen:N,className:W,overlayClassName:Ae(yn.overlay,et.overlay),children:[U("p",{children:"Are you sure you want to close all connections?"}),be("div",{className:et.btngrp,children:[U(bn,{onClick:d,ref:v,children:"I'm sure"}),U("div",{style:{width:20}}),U(bn,{onClick:p,children:"No"})]})]})}const{useEffect:hi,useState:je,useRef:yi,useCallback:Le}=xe,Cn=30;function bi(y){const p={};for(let d=0;d[d.host,d.sourceIP,d.sourcePort,d.destinationIP,d.chains,d.rule,d.type,d.network].some(v=>wi(v,p))):y}function Ri(y,p,d){const{id:v,metadata:N,upload:W,download:l,start:Z,chains:se,rule:u,rulePayload:J}=y,{host:te,destinationPort:le,destinationIP:de,network:D,type:X,sourceIP:ce,sourcePort:Y}=N;let ne=te;ne===""&&(ne=de);const m=p[v];return He(_e({id:v,upload:W,download:l,start:d-new Date(Z).valueOf(),chains:se.reverse().join(" / "),rule:J?`${u}(${J})`:u},N),{host:`${ne}:${le}`,type:`${X}(${D})`,source:`${ce}:${Y}`,downloadSpeedCurr:l-(m?m.download:0),uploadSpeedCurr:W-(m?m.upload:0)})}function xn(y){return y.length>0?U(si,{data:y}):U("div",{className:De.placeHolder,children:U(bo,{width:200,height:200,c1:"var(--color-text)"})})}function Pn({qty:y}){return y<100?""+y:"99+"}function Ci({apiConfig:y}){const[p,d]=Co(),[v,N]=je([]),[W,l]=je([]),[Z,se]=je(""),u=Sn(v,Z),J=Sn(W,Z),[te,le]=je(!1),de=Le(()=>le(!0),[]),D=Le(()=>le(!1),[]),[X,ce]=je(!1),Y=Le(()=>{ce(K=>!K)},[]),ne=Le(()=>{go(y),D()},[y,D]),m=yi(v),H=Le(({connections:K})=>{const ge=bi(m.current),ve=Date.now(),me=K.map(he=>Ri(he,ge,ve)),Re=[];for(const he of m.current)me.findIndex(ke=>ke.id===he.id)<0&&Re.push(he);l(he=>[...Re,...he].slice(0,101)),me&&(me.length!==0||m.current.length!==0)&&!X?(m.current=me,N(me)):m.current=me},[N,X]);hi(()=>vo(y,H),[y,H]);const{t:L}=mo();return be("div",{children:[U(ho,{title:L("Connections")}),be(ot,{children:[be("div",{style:{display:"flex",flexWrap:"wrap",justifyContent:"space-between"},children:[be(it,{children:[be(Ve,{children:[U("span",{children:L("Active")}),U("span",{className:De.connQty,children:Pn({qty:u.length})})]}),be(Ve,{children:[U("span",{children:L("Closed")}),U("span",{className:De.connQty,children:Pn({qty:J.length})})]})]}),U("div",{className:De.inputWrapper,children:U("input",{type:"text",name:"filter",autoComplete:"off",className:De.input,placeholder:"Filter",onChange:K=>se(K.target.value)})})]}),U("div",{ref:p,style:{padding:30,paddingBottom:Cn,paddingTop:0},children:be("div",{style:{height:d-Cn,overflow:"auto"},children:[be($e,{children:[U(yo,{children:xn(u)}),U(Po,{icon:X?U(Io,{size:16}):U(To,{size:16}),mainButtonStyles:X?{background:"#e74c3c"}:{},style:Bo,text:L(X?"Resume Refresh":"Pause Refresh"),onClick:Y,children:U(Eo,{text:"Close All Connections",onClick:de,children:U(wo,{size:10})})})]}),U($e,{children:xn(J)})]})}),U(mi,{isOpen:te,primaryButtonOnTap:ne,onRequestClose:D})]})]})}const Si=y=>({apiConfig:Ro(y)});var Ai=po(Si)(Ci);export{Ai as default}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Fab.93225453.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Fab.93225453.js deleted file mode 100644 index 4b532a8ae..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Fab.93225453.js +++ /dev/null @@ -1 +0,0 @@ -var E=Object.defineProperty,O=Object.defineProperties;var A=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,k=Object.prototype.propertyIsEnumerable;var Y=(t,a,r)=>a in t?E(t,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[a]=r,o=(t,a)=>{for(var r in a||(a={}))w.call(a,r)&&Y(t,r,a[r]);if(c)for(var r of c(a))k.call(a,r)&&Y(t,r,a[r]);return t},i=(t,a)=>O(t,A(a));var f=(t,a)=>{var r={};for(var n in t)w.call(t,n)&&a.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&c)for(var n of c(t))a.indexOf(n)<0&&k.call(t,n)&&(r[n]=t[n]);return r};import{j as e,b as y,r as d,h as B}from"./index.5901d226.js";const H="_spining_4i8sg_1",L="_spining_keyframes_4i8sg_1";var R={spining:H,spining_keyframes:L};const{useState:V}=B;function P({children:t}){return e("span",{className:R.spining,children:t})}const Q={right:10,bottom:10},S=r=>{var n=r,{children:t}=n,a=f(n,["children"]);return e("button",i(o({type:"button"},a),{className:"rtf--ab",children:t}))},q=r=>{var n=r,{children:t}=n,a=f(n,["children"]);return e("button",i(o({type:"button",className:"rtf--mb"},a),{children:t}))},D={bottom:24,right:24},U=G=>{var _=G,{event:t="hover",style:a=D,alwaysShowTitle:r=!1,children:n,icon:v,mainButtonStyles:z,onClick:m,text:h}=_,N=f(_,["event","style","alwaysShowTitle","children","icon","mainButtonStyles","onClick","text"]);const[l,b]=V(!1),x=r||!l,g=()=>b(!0),u=()=>b(!1),$=()=>t==="hover"&&g(),j=()=>t==="hover"&&u(),C=s=>m?m(s):(s.persist(),t==="click"?l?u():g():null),I=(s,p)=>{s.persist(),b(!1),setTimeout(()=>{p(s)},1)},F=()=>d.exports.Children.map(n,(s,p)=>d.exports.isValidElement(s)?y("li",{className:`rtf--ab__c ${"top"in a?"top":""}`,children:[d.exports.cloneElement(s,i(o({"data-testid":`action-button-${p}`,"aria-label":s.props.text||`Menu button ${p+1}`,"aria-hidden":x,tabIndex:l?0:-1},s.props),{onClick:M=>{s.props.onClick&&I(M,s.props.onClick)}})),s.props.text&&e("span",{className:`${"right"in a?"right":""} ${r?"always-show":""}`,"aria-hidden":x,children:s.props.text})]}):null);return e("ul",i(o({onMouseEnter:$,onMouseLeave:j,className:`rtf ${l?"open":"closed"}`,"data-testid":"fab",style:a},N),{children:y("li",{className:"rtf--mb__c",children:[e(q,{onClick:C,style:z,"data-testid":"main-button",role:"button","aria-label":"Floating menu",tabIndex:0,children:v}),h&&e("span",{className:`${"right"in a?"right":""} ${r?"always-show":""}`,"aria-hidden":x,children:h}),e("ul",{children:F()})]})}))};export{S as A,U as F,P as I,Q as p}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Fab.33a60e0e.css b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Fab.a0a7e573.css similarity index 100% rename from luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Fab.33a60e0e.css rename to luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Fab.a0a7e573.css diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Fab.ac4f3b29.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Fab.ac4f3b29.js new file mode 100644 index 000000000..8dfa0e2bd --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Fab.ac4f3b29.js @@ -0,0 +1 @@ +import{j as e,b,h as y,r as l}from"./index.2addc377.js";const F="_spining_4i8sg_1",M="_spining_keyframes_4i8sg_1",j={spining:F,spining_keyframes:M},{useState:v}=y;function B({children:s}){return e("span",{className:j.spining,children:s})}const H={right:10,bottom:10},L=({children:s,...n})=>e("button",{type:"button",...n,className:"rtf--ab",children:s}),E=({children:s,...n})=>e("button",{type:"button",className:"rtf--mb",...n,children:s}),O={bottom:24,right:24},R=({event:s="hover",style:n=O,alwaysShowTitle:i=!1,children:f,icon:g,mainButtonStyles:h,onClick:p,text:d,..._})=>{const[a,r]=v(!1),c=i||!a,u=()=>r(!0),m=()=>r(!1),x=()=>s==="hover"&&u(),k=()=>s==="hover"&&m(),N=t=>p?p(t):(t.persist(),s==="click"?a?m():u():null),$=(t,o)=>{t.persist(),r(!1),setTimeout(()=>{o(t)},1)},C=()=>l.exports.Children.map(f,(t,o)=>l.exports.isValidElement(t)?b("li",{className:`rtf--ab__c ${"top"in n?"top":""}`,children:[l.exports.cloneElement(t,{"data-testid":`action-button-${o}`,"aria-label":t.props.text||`Menu button ${o+1}`,"aria-hidden":c,tabIndex:a?0:-1,...t.props,onClick:I=>{t.props.onClick&&$(I,t.props.onClick)}}),t.props.text&&e("span",{className:`${"right"in n?"right":""} ${i?"always-show":""}`,"aria-hidden":c,children:t.props.text})]}):null);return e("ul",{onMouseEnter:x,onMouseLeave:k,className:`rtf ${a?"open":"closed"}`,"data-testid":"fab",style:n,..._,children:b("li",{className:"rtf--mb__c",children:[e(E,{onClick:N,style:h,"data-testid":"main-button",role:"button","aria-label":"Floating menu",tabIndex:0,children:g}),d&&e("span",{className:`${"right"in n?"right":""} ${i?"always-show":""}`,"aria-hidden":c,children:d}),e("ul",{children:C()})]})})};export{L as A,R as F,B as I,H as p}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs.029b1e0c.css b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs.029b1e0c.css deleted file mode 100644 index 1617041a2..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs.029b1e0c.css +++ /dev/null @@ -1 +0,0 @@ -._RuleSearch_1gcst_1{padding:0 40px 5px}._RuleSearchContainer_1gcst_5{position:relative;height:40px}._inputWrapper_1gcst_10{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);left:0;width:100%}._input_1gcst_10{-webkit-appearance:none;background-color:var(--color-input-bg);background-image:none;border-radius:20px;border:1px solid var(--color-input-border);box-sizing:border-box;color:#c1c1c1;display:inline-block;font-size:inherit;height:40px;outline:none;padding:0 15px 0 35px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}._iconWrapper_1gcst_35{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);left:10px}._logMeta_1dg5t_1{display:flex;align-items:center;flex-wrap:wrap;font-size:.9em}._logType_1dg5t_8{color:#eee;flex-shrink:0;text-align:center;width:66px;border-radius:100px;padding:3px 5px;margin:0 8px}._logTime_1dg5t_18{flex-shrink:0;color:#999;font-size:14px}._logText_1dg5t_24{flex-shrink:0;display:flex;font-family:Roboto Mono,Menlo,monospace;align-items:center;padding:8px 0;width:100%;white-space:pre;overflow:auto}._logsWrapper_1dg5t_37{margin:0;padding:0;color:var(--color-text)}._logsWrapper_1dg5t_37 .log{padding:10px 40px;background:var(--color-background)}._logsWrapper_1dg5t_37 .log.even{background:var(--color-background)}._logPlaceholder_1dg5t_51{display:flex;flex-direction:column;align-items:center;justify-content:center;color:#2d2d30}._logPlaceholder_1dg5t_51 div:nth-child(2){color:var(--color-text-secondary);font-size:1.4em;opacity:.6}._logPlaceholderIcon_1dg5t_64{opacity:.3} diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs.285710c1.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs.285710c1.js deleted file mode 100644 index 1e51af72b..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs.285710c1.js +++ /dev/null @@ -1 +0,0 @@ -var R=Object.defineProperty,w=Object.defineProperties;var C=Object.getOwnPropertyDescriptors;var S=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var T=(e,t,o)=>t in e?R(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,p=(e,t)=>{for(var o in t||(t={}))N.call(t,o)&&T(e,o,t[o]);if(S)for(var o of S(t))W.call(t,o)&&T(e,o,t[o]);return e},m=(e,t)=>w(e,C(t));import{r as _,b as l,j as a,P as f,d as P,G as k,H as j,w as z,J as I,u as O,C as F,S as M,K as $,L as H,g as A,N as B,h as D,c as E}from"./index.5901d226.js";import{a as K,F as q}from"./index.esm.390d1b7a.js";import{r as G,s as J,f as V}from"./logs.36f1d416.js";import{d as Y}from"./debounce.d080d5e1.js";import{u as Q}from"./useRemainingViewPortHeight.d051faee.js";import{F as U,p as X}from"./Fab.93225453.js";import{P as Z,a as ee}from"./play.56145bca.js";function te(e,t){if(e==null)return{};var o=oe(e,t),n,r;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&(!Object.prototype.propertyIsEnumerable.call(e,n)||(o[n]=e[n]))}return o}function oe(e,t){if(e==null)return{};var o={},n=Object.keys(e),r,s;for(s=0;s=0)&&(o[r]=e[r]);return o}var x=_.exports.forwardRef(function(e,t){var o=e.color,n=o===void 0?"currentColor":o,r=e.size,s=r===void 0?24:r,g=te(e,["color","size"]);return l("svg",m(p({ref:t,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},g),{children:[a("circle",{cx:"11",cy:"11",r:"8"}),a("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}))});x.propTypes={color:f.string,size:f.oneOfType([f.string,f.number])};x.displayName="Search";var re=x;const ae="_RuleSearch_1gcst_1",ne="_RuleSearchContainer_1gcst_5",se="_inputWrapper_1gcst_10",ce="_input_1gcst_10",ie="_iconWrapper_1gcst_35";var d={RuleSearch:ae,RuleSearchContainer:ne,inputWrapper:se,input:ce,iconWrapper:ie};function le({dispatch:e,searchText:t,updateSearchText:o}){const[n,r]=_.exports.useState(t),s=_.exports.useCallback(i=>{e(o(i))},[e,o]),g=_.exports.useMemo(()=>Y(s,300),[s]),h=i=>{r(i.target.value),g(i.target.value)};return a("div",{className:d.RuleSearch,children:l("div",{className:d.RuleSearchContainer,children:[a("div",{className:d.inputWrapper,children:a("input",{type:"text",value:n,onChange:h,className:d.input})}),a("div",{className:d.iconWrapper,children:a(re,{size:20})})]})})}const ge=e=>({searchText:k(e),updateSearchText:j});var pe=P(ge)(le);const de="_logMeta_1dg5t_1",he="_logType_1dg5t_8",ue="_logTime_1dg5t_18",me="_logText_1dg5t_24",fe="_logsWrapper_1dg5t_37",_e="_logPlaceholder_1dg5t_51",ve="_logPlaceholderIcon_1dg5t_64";var c={logMeta:de,logType:he,logTime:ue,logText:me,logsWrapper:fe,logPlaceholder:_e,logPlaceholderIcon:ve};const{useCallback:b,memo:xe,useEffect:ye}=D,v=30,Se={debug:"#28792c",info:"var(--bg-log-info-tag)",warning:"#b99105",error:"#c11c1c"};function Te({time:e,even:t,payload:o,type:n}){const r=E({even:t},"log");return a("div",{className:r,children:l("div",{className:c.logMeta,children:[a("div",{className:c.logTime,children:e}),a("div",{className:c.logType,style:{backgroundColor:Se[n]},children:n}),a("div",{className:c.logText,children:o})]})})}function be(e,t){return t[e].id}const Pe=xe(({index:e,style:t,data:o})=>{const n=o[e];return a("div",{style:t,children:a(Te,p({},n))})},K);function Le({dispatch:e,logLevel:t,apiConfig:o,logs:n,logStreamingPaused:r}){const s=z(),g=b(()=>{r?G(m(p({},o),{logLevel:t})):J(),s.app.updateAppConfig("logStreamingPaused",!r)},[o,t,r,s.app]),h=b(L=>e(I(L)),[e]);ye(()=>{V(m(p({},o),{logLevel:t}),h)},[o,t,h]);const[i,y]=Q(),{t:u}=O();return l("div",{children:[a(F,{title:u("Logs")}),a(pe,{}),a("div",{ref:i,style:{paddingBottom:v},children:n.length===0?l("div",{className:c.logPlaceholder,style:{height:y-v},children:[a("div",{className:c.logPlaceholderIcon,children:a(M,{width:200,height:200})}),a("div",{children:u("no_logs")})]}):l("div",{className:c.logsWrapper,children:[a(q,{height:y-v,width:"100%",itemCount:n.length,itemSize:80,itemData:n,itemKey:be,children:Pe}),a(U,{icon:r?a(Z,{size:16}):a(ee,{size:16}),mainButtonStyles:r?{background:"#e74c3c"}:{},style:X,text:u(r?"Resume Refresh":"Pause Refresh"),onClick:g})]})})]})}const Re=e=>({logs:$(e),logLevel:H(e),apiConfig:A(e),logStreamingPaused:B(e)});var Oe=P(Re)(Le);export{Oe as default}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs.3d717679.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs.3d717679.js new file mode 100644 index 000000000..bc04a87f6 --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs.3d717679.js @@ -0,0 +1 @@ +import{r as m,b as l,j as t,i as u,d as y,H as T,J as b,x as L,K as P,u as R,C as N,S as z,L as C,N as W,g as w,O as k,h as j,c as I}from"./index.2addc377.js";import{a as O,F}from"./index.esm.d79e6b4f.js";import{r as M,s as $,f as H}from"./logs.e4cdcb93.js";import{d as A}from"./debounce.c2d20996.js";import{u as B}from"./useRemainingViewPortHeight.4e5a0898.js";import{F as D,p as E}from"./Fab.ac4f3b29.js";import{P as K,a as q}from"./play.f2fb5ccc.js";function J(e,n){if(e==null)return{};var r=V(e,n),a,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,a)||(r[a]=e[a]))}return r}function V(e,n){if(e==null)return{};var r={},a=Object.keys(e),o,s;for(s=0;s=0)&&(r[o]=e[o]);return r}var f=m.exports.forwardRef(function(e,n){var r=e.color,a=r===void 0?"currentColor":r,o=e.size,s=o===void 0?24:o,p=J(e,["color","size"]);return l("svg",{ref:n,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:a,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...p,children:[t("circle",{cx:"11",cy:"11",r:"8"}),t("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})});f.propTypes={color:u.exports.string,size:u.exports.oneOfType([u.exports.string,u.exports.number])};f.displayName="Search";const Y=f,G="_RuleSearch_1oz2t_1",Q="_RuleSearchContainer_1oz2t_5",U="_inputWrapper_1oz2t_10",X="_input_1oz2t_10",Z="_iconWrapper_1oz2t_35",g={RuleSearch:G,RuleSearchContainer:Q,inputWrapper:U,input:X,iconWrapper:Z};function ee({dispatch:e,searchText:n,updateSearchText:r}){const[a,o]=m.exports.useState(n),s=m.exports.useCallback(i=>{e(r(i))},[e,r]),p=m.exports.useMemo(()=>A(s,300),[s]),h=i=>{o(i.target.value),p(i.target.value)};return t("div",{className:g.RuleSearch,children:l("div",{className:g.RuleSearchContainer,children:[t("div",{className:g.inputWrapper,children:t("input",{type:"text",value:a,onChange:h,className:g.input})}),t("div",{className:g.iconWrapper,children:t(Y,{size:20})})]})})}const te=e=>({searchText:T(e),updateSearchText:b}),oe=y(te)(ee),re="_logMeta_7a1x3_1",ae="_logType_7a1x3_8",ne="_logTime_7a1x3_18",se="_logText_7a1x3_24",ce="_logsWrapper_7a1x3_37",ie="_logPlaceholder_7a1x3_51",le="_logPlaceholderIcon_7a1x3_64",pe="_search_7a1x3_68",c={logMeta:re,logType:ae,logTime:ne,logText:se,logsWrapper:ce,logPlaceholder:ie,logPlaceholderIcon:le,search:pe},{useCallback:v,memo:ge,useEffect:he}=j,_=30,de={debug:"#28792c",info:"var(--bg-log-info-tag)",warning:"#b99105",error:"#c11c1c"};function ue({time:e,even:n,payload:r,type:a}){const o=I({even:n},"log");return t("div",{className:o,children:l("div",{className:c.logMeta,children:[t("div",{className:c.logTime,children:e}),t("div",{className:c.logType,style:{backgroundColor:de[a]},children:a}),t("div",{className:c.logText,children:r})]})})}function me(e,n){return n[e].id}const _e=ge(({index:e,style:n,data:r})=>{const a=r[e];return t("div",{style:n,children:t(ue,{...a})})},O);function fe({dispatch:e,logLevel:n,apiConfig:r,logs:a,logStreamingPaused:o}){const s=L(),p=v(()=>{o?M({...r,logLevel:n}):$(),s.app.updateAppConfig("logStreamingPaused",!o)},[r,n,o,s.app]),h=v(S=>e(P(S)),[e]);he(()=>{H({...r,logLevel:n},h)},[r,n,h]);const[i,x]=B(),{t:d}=R();return l("div",{children:[t(N,{title:d("Logs")}),t("div",{className:c.search,children:t(oe,{})}),t("div",{ref:i,style:{paddingBottom:_},children:a.length===0?l("div",{className:c.logPlaceholder,style:{height:x-_},children:[t("div",{className:c.logPlaceholderIcon,children:t(z,{width:200,height:200})}),t("div",{children:d("no_logs")})]}):l("div",{className:c.logsWrapper,children:[t(F,{height:x-_,width:"100%",itemCount:a.length,itemSize:80,itemData:a,itemKey:me,children:_e}),t(D,{icon:o?t(K,{size:16}):t(q,{size:16}),mainButtonStyles:o?{background:"#e74c3c"}:{},style:E,text:d(o?"Resume Refresh":"Pause Refresh"),onClick:p})]})})]})}const xe=e=>({logs:C(e),logLevel:W(e),apiConfig:w(e),logStreamingPaused:k(e)}),Re=y(xe)(fe);export{Re as default}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs.4b8e75d1.css b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs.4b8e75d1.css new file mode 100644 index 000000000..821aba4b1 --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Logs.4b8e75d1.css @@ -0,0 +1 @@ +._RuleSearch_1oz2t_1{padding:0 40px 5px}._RuleSearchContainer_1oz2t_5{position:relative;height:40px}._inputWrapper_1oz2t_10{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);left:0;width:100%}._input_1oz2t_10{-webkit-appearance:none;background-color:var(--color-input-bg);background-image:none;border-radius:20px;border:1px solid var(--color-input-border);box-sizing:border-box;color:#c1c1c1;display:inline-block;font-size:inherit;height:40px;outline:none;padding:0 15px 0 35px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}._iconWrapper_1oz2t_35{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);left:10px;display:flex;justify-content:center;align-items:center}._logMeta_7a1x3_1{display:flex;align-items:center;flex-wrap:wrap;font-size:.9em}._logType_7a1x3_8{color:#eee;flex-shrink:0;text-align:center;width:66px;border-radius:100px;padding:3px 5px;margin:0 8px}._logTime_7a1x3_18{flex-shrink:0;color:#999;font-size:14px}._logText_7a1x3_24{flex-shrink:0;display:flex;font-family:Roboto Mono,Menlo,monospace;align-items:center;padding:8px 0;width:100%;white-space:pre;overflow:auto}._logsWrapper_7a1x3_37{margin:0;padding:0;color:var(--color-text)}._logsWrapper_7a1x3_37 .log{padding:10px 40px;background:var(--color-background)}._logsWrapper_7a1x3_37 .log.even{background:var(--color-background)}._logPlaceholder_7a1x3_51{display:flex;flex-direction:column;align-items:center;justify-content:center;color:#2d2d30}._logPlaceholder_7a1x3_51 div:nth-child(2){color:var(--color-text-secondary);font-size:1.4em;opacity:.6}._logPlaceholderIcon_7a1x3_64{opacity:.3}._search_7a1x3_68{max-width:1000px} diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies.2359f6a1.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies.2359f6a1.js deleted file mode 100644 index 261ec9bd1..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies.2359f6a1.js +++ /dev/null @@ -1 +0,0 @@ -var be=Object.defineProperty,we=Object.defineProperties;var Ce=Object.getOwnPropertyDescriptors;var Z=Object.getOwnPropertySymbols;var ke=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable;var G=(e,t,r)=>t in e?be(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,F=(e,t)=>{for(var r in t||(t={}))ke.call(t,r)&&G(e,r,t[r]);if(Z)for(var r of Z(t))Pe.call(t,r)&&G(e,r,t[r]);return e},j=(e,t)=>we(e,Ce(t));import{r as g,j as n,P as $,c as w,T as Se,b as c,B as b,h as f,U as Ne,V as $e,W as oe,X as se,d as C,Y as Ae,F as T,Z as Le,$ as ae,a0 as U,w as D,a1 as Oe,a2 as le,a3 as O,a4 as ie,a5 as q,a6 as E,a7 as Te,a8 as De,u as K,a9 as Be,aa as Ie,ab as Fe,g as ce,C as ue,x as Y,ac as je,m as X,M as Re,ad as ze,ae as Me,af as He,ag as Ue}from"./index.5901d226.js";import{C as qe}from"./chevron-down.e7f05dbc.js";import{F as Ee,p as Ke,A as Ve,I as We}from"./Fab.93225453.js";import{R as Ze,a as Ge,T as Ye}from"./TextFitler.f9fb92be.js";import{f as Xe}from"./index.e97a91e5.js";import{S as Je}from"./Select.f72e6abf.js";import"./debounce.d080d5e1.js";function Qe(e,t){if(e==null)return{};var r=et(e,t),o,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&(!Object.prototype.propertyIsEnumerable.call(e,o)||(r[o]=e[o]))}return r}function et(e,t){if(e==null)return{};var r={},o=Object.keys(e),s,a;for(a=0;a=0)&&(r[s]=e[s]);return r}var V=g.exports.forwardRef(function(e,t){var r=e.color,o=r===void 0?"currentColor":r,s=e.size,a=s===void 0?24:s,l=Qe(e,["color","size"]);return n("svg",j(F({ref:t,xmlns:"http://www.w3.org/2000/svg",width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),{children:n("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})}))});V.propTypes={color:$.string,size:$.oneOfType([$.string,$.number])};V.displayName="Zap";var J=V;function de(e){const t=e.size||24,r=w({[Se.animate]:e.animate});return n("svg",{className:r,xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:n("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})})}const tt="_FlexCenter_1380a_1";var rt={FlexCenter:tt};function nt({children:e}){return n("div",{className:rt.FlexCenter,children:e})}const{useRef:Q,useEffect:ot}=f;function st({onClickPrimaryButton:e,onClickSecondaryButton:t}){const r=Q(null),o=Q(null);return ot(()=>{r.current.focus()},[]),c("div",{onKeyDown:a=>{a.keyCode===39?o.current.focus():a.keyCode===37&&r.current.focus()},children:[n("h2",{children:"Close Connections?"}),n("p",{children:'Click "Yes" to close those connections that are still using the old selected proxy in this group'}),n("div",{style:{height:30}}),c(nt,{children:[n(b,{onClick:e,ref:r,children:"Yes"}),n("div",{style:{width:20}}),n(b,{onClick:t,ref:o,children:"No"})]})]})}const at="_header_1y9js_1",lt="_arrow_1y9js_8",it="_isOpen_1y9js_13",ct="_btn_1y9js_20",ut="_qty_1y9js_25";var k={header:at,arrow:lt,isOpen:it,btn:ct,qty:ut};function pe({name:e,type:t,toggle:r,isOpen:o,qty:s}){const a=g.exports.useCallback(l=>{l.preventDefault(),(l.key==="Enter"||l.key===" ")&&r()},[r]);return c("div",{className:k.header,onClick:r,style:{cursor:"pointer"},tabIndex:0,onKeyDown:a,role:"button",children:[n("div",{children:n(Ne,{name:e,type:t})}),typeof s=="number"?n("span",{className:k.qty,children:s}):null,n(b,{kind:"minimal",onClick:r,className:k.btn,title:"Toggle collapsible section",children:n("span",{className:w(k.arrow,{[k.isOpen]:o}),children:n(qe,{size:20})})})]})}const{useMemo:dt}=f;function pt(e,t){return e.filter(r=>{const o=t[r];return o===void 0?!0:o.number!==0})}const A=(e,t)=>{if(e&&typeof e.number=="number"&&e.number>0)return e.number;const r=t&&t.type;return r&&se.indexOf(r)>-1?-1:999999},ht={Natural:e=>e,LatencyAsc:(e,t,r)=>e.sort((o,s)=>{const a=A(t[o],r&&r[o]),l=A(t[s],r&&r[s]);return a-l}),LatencyDesc:(e,t,r)=>e.sort((o,s)=>{const a=A(t[o],r&&r[o]);return A(t[s],r&&r[s])-a}),NameAsc:e=>e.sort(),NameDesc:e=>e.sort((t,r)=>t>r?-1:to.trim()).filter(o=>!!o);return r.length===0?e:e.filter(o=>{let s=0;for(;s-1)return!0}return!1})}function ft(e,t,r,o,s,a){let l=[...e];return r&&(l=pt(e,t)),typeof o=="string"&&o!==""&&(l=yt(l,o)),ht[s](l,t,a)}function he(e,t,r,o,s){const[a]=$e(oe);return dt(()=>ft(e,t,r,a,o,s),[e,t,r,a,o,s])}const mt="_header_5pmv2_1",vt="_groupHead_5pmv2_5",_t="_action_5pmv2_11";var R={header:mt,groupHead:vt,action:_t};const xt="_proxy_8ev0l_1",gt="_now_8ev0l_25",bt="_error_8ev0l_29",wt="_selectable_8ev0l_32",Ct="_proxyType_8ev0l_40",kt="_row_8ev0l_51",Pt="_proxyName_8ev0l_57",St="_proxySmall_8ev0l_66";var m={proxy:xt,now:gt,error:bt,selectable:wt,proxyType:Ct,row:kt,proxyName:Pt,proxySmall:St};const Nt="_proxyLatency_hz69v_1";var $t={proxyLatency:Nt};function At({number:e,color:t}){return n("span",{className:$t.proxyLatency,style:{color:t},children:typeof e=="number"&&e!==0?e+" ms":" "})}const{useMemo:N}=f,P={good:"#67c23a",normal:"#d4b75c",bad:"#e67f3c",na:"#909399"};function ye({number:e}={}){return e===0?P.na:e<200?P.good:e<400?P.normal:typeof e=="number"?P.bad:P.na}function Lt(e,t){return se.indexOf(t)>-1?{border:"1px dotted #777"}:{background:ye(e)}}function Ot({now:e,name:t,proxy:r,latency:o,isSelectable:s,onClick:a}){const l=N(()=>Lt(o,r.type),[o,r]),i=N(()=>{let d=t;return o&&typeof o.number=="number"&&(d+=" "+o.number+" ms"),d},[t,o]),u=g.exports.useCallback(()=>{s&&a&&a(t)},[t,a,s]),p=N(()=>w(m.proxySmall,{[m.now]:e,[m.selectable]:s}),[s,e]),h=g.exports.useCallback(d=>{d.key==="Enter"&&u()},[u]);return n("div",{title:i,className:p,style:l,onClick:u,onKeyDown:h,role:s?"menuitem":""})}function Tt(e){return e==="Shadowsocks"?"SS":e}const Dt=e=>({left:e.left+window.scrollX-5,top:e.top+window.scrollY-38});function Bt({children:e,label:t,"aria-label":r}){const[o,s]=Ae();return c(T,{children:[g.exports.cloneElement(e,o),n(Le,j(F({},s),{label:t,"aria-label":r,position:Dt}))]})}function It({now:e,name:t,proxy:r,latency:o,isSelectable:s,onClick:a}){const l=N(()=>ye(o),[o]),i=g.exports.useCallback(()=>{s&&a&&a(t)},[t,a,s]),u=g.exports.useCallback(h=>{h.key==="Enter"&&i()},[i]),p=N(()=>w(m.proxy,{[m.now]:e,[m.selectable]:s}),[s,e]);return c("div",{tabIndex:0,className:p,onClick:i,onKeyDown:u,role:s?"menuitem":"",children:[n("div",{className:m.proxyName,children:n(Bt,{label:t,"aria-label":"proxy name: "+t,children:n("span",{children:t})})}),c("div",{className:m.row,children:[n("span",{className:m.proxyType,style:{opacity:e?.6:.2},children:Tt(r.type)}),n(At,{number:o==null?void 0:o.number,color:l})]})]})}const fe=(e,{name:t})=>{const r=ae(e),o=U(e);return{proxy:r[t]||{name:t,type:"Unknown",history:[]},latency:o[t]}},Ft=C(fe)(It),jt=C(fe)(Ot),Rt="_list_1oy7w_1",zt="_listSummaryView_1oy7w_8";var me={list:Rt,listSummaryView:zt};function ve({all:e,now:t,isSelectable:r,itemOnTapCallback:o}){const s=e;return n("div",{className:me.list,children:s.map(a=>n(Ft,{onClick:o,isSelectable:r,name:a,now:a===t},a))})}function _e({all:e,now:t,isSelectable:r,itemOnTapCallback:o}){return n("div",{className:me.listSummaryView,children:e.map(s=>n(jt,{onClick:o,isSelectable:r,name:s,now:s===t},s))})}const{createElement:Mt,useCallback:z,useMemo:Ht}=f;function Ut({name:e,all:t,delay:r,hideUnavailableProxies:o,proxySortBy:s,proxies:a,type:l,now:i,isOpen:u,apiConfig:p,dispatch:h}){const d=he(t,r,o,s,a),_=Ht(()=>l==="Selector",[l]),{app:{updateCollapsibleIsOpen:x},proxies:{requestDelayForProxies:y}}=D(),B=z(()=>{x("proxyGroup",e,!u)},[u,x,e]),I=z(W=>{!_||h(Oe(p,e,W))},[p,h,e,_]),v=le(!1),ge=z(async()=>{if(!v.value){v.set(!0);try{await y(p,d)}catch{}v.set(!1)}},[d,p,y,v]);return c("div",{className:R.group,children:[c("div",{className:R.groupHead,children:[n(pe,{name:e,type:l,toggle:B,qty:d.length,isOpen:u}),n("div",{className:R.action,children:n(O,{label:"Test latency",children:n(b,{kind:"circular",onClick:ge,children:n(de,{animate:v.value,size:16})})})})]}),Mt(u?ve:_e,{all:d,now:i,isSelectable:_,itemOnTapCallback:I})]})}const qt=C((e,{name:t,delay:r})=>{const o=ae(e),s=ie(e),a=q(e),l=E(e),i=o[t],{all:u,type:p,now:h}=i;return{all:u,delay:r,hideUnavailableProxies:l,proxySortBy:a,proxies:o,type:p,now:h,isOpen:s[`proxyGroup:${t}`]}})(Ut),{useCallback:xe,useState:Et}=f;function Kt({dispatch:e,apiConfig:t,name:r}){return xe(()=>e(Te(t,r)),[t,e,r])}function Vt({dispatch:e,apiConfig:t,names:r}){const[o,s]=Et(!1);return[xe(async()=>{if(!o){s(!0);try{await e(De(t,r))}catch{}s(!1)}},[t,e,r,o]),o]}const{useState:Wt,useCallback:Zt}=f;function Gt({isLoading:e}){return e?n(We,{children:n(J,{width:16,height:16})}):n(J,{width:16,height:16})}function Yt({dispatch:e,apiConfig:t}){const[r,o]=Wt(!1);return[Zt(()=>{r||(o(!0),e(Be(t)).then(()=>o(!1),()=>o(!1)))},[t,e,r]),r]}function Xt({dispatch:e,apiConfig:t,proxyProviders:r}){const{t:o}=K(),[s,a]=Yt({dispatch:e,apiConfig:t}),[l,i]=Vt({apiConfig:t,dispatch:e,names:r.map(u=>u.name)});return n(Ee,{icon:n(Gt,{isLoading:a}),onClick:s,text:o("Test Latency"),style:Ke,children:r.length>0?n(Ve,{text:o("update_all_proxy_provider"),onClick:l,children:n(Ze,{isRotating:i})}):null})}const Jt="_updatedAt_1rx92_1",Qt="_main_1rx92_8",er="_head_1rx92_17",tr="_action_1rx92_23",rr="_refresh_1rx92_31";var S={updatedAt:Jt,main:Qt,head:er,action:tr,refresh:rr};const{useCallback:ee}=f;function nr({name:e,proxies:t,delay:r,hideUnavailableProxies:o,proxySortBy:s,vehicleType:a,updatedAt:l,isOpen:i,dispatch:u,apiConfig:p}){const h=he(t,r,o,s),d=le(!1),_=Kt({dispatch:u,apiConfig:p,name:e}),x=ee(()=>{if(d.value)return;d.set(!0);const v=()=>d.set(!1);u(Ie(p,e)).then(v,v)},[p,u,e,d]),{app:{updateCollapsibleIsOpen:y}}=D(),B=ee(()=>{y("proxyProvider",e,!i)},[i,y,e]),I=Xe(new Date(l),new Date);return c("div",{className:S.main,children:[c("div",{className:S.head,children:[n(pe,{name:e,toggle:B,type:a,isOpen:i,qty:h.length}),c("div",{className:S.action,children:[n(O,{label:"Update",children:n(b,{kind:"circular",onClick:_,children:n(ar,{})})}),n(O,{label:"Health Check",children:n(b,{kind:"circular",onClick:x,children:n(de,{animate:d.value,size:16})})})]})]}),n("div",{className:S.updatedAt,children:c("small",{children:["Updated ",I," ago"]})}),i?n(ve,{all:h}):n(_e,{all:h})]})}const or={rest:{scale:1},pressed:{scale:.95}},sr={rest:{rotate:0},hover:{rotate:360,transition:{duration:.3}}};function ar(){const t=Fe.read().motion;return n(t.div,{className:S.refresh,variants:or,initial:"rest",whileHover:"hover",whileTap:"pressed",children:n(t.div,{className:"flexCenter",variants:sr,children:n(Ge,{size:16})})})}const lr=(e,{proxies:t,name:r})=>{const o=E(e),s=U(e),a=ie(e),l=ce(e),i=q(e);return{apiConfig:l,proxies:t,delay:s,hideUnavailableProxies:o,proxySortBy:i,isOpen:a[`proxyProvider:${r}`]}},ir=C(lr)(nr);function cr({items:e}){return e.length===0?null:c(T,{children:[n(ue,{title:"Proxy Provider"}),n("div",{children:e.map(t=>n(ir,{name:t.name,proxies:t.proxies,type:t.type,vehicleType:t.vehicleType,updatedAt:t.updatedAt},t.name))})]})}const ur="_labeledInput_cmki0_1";var M={labeledInput:ur};const dr=[["Natural","order_natural"],["LatencyAsc","order_latency_asc"],["LatencyDesc","order_latency_desc"],["NameAsc","order_name_asc"],["NameDesc","order_name_desc"]],{useCallback:te}=f;function pr({appConfig:e}){const{app:{updateAppConfig:t}}=D(),r=te(a=>{t("proxySortBy",a.target.value)},[t]),o=te(a=>{t("hideUnavailableProxies",a)},[t]),{t:s}=K();return c(T,{children:[c("div",{className:M.labeledInput,children:[n("span",{children:s("sort_in_grp")}),n("div",{children:n(Je,{options:dr.map(a=>[a[0],s(a[1])]),selected:e.proxySortBy,onChange:r})})]}),n("hr",{}),c("div",{className:M.labeledInput,children:[n("span",{children:s("hide_unavail_proxies")}),n("div",{children:n(Y,{name:"hideUnavailableProxies",checked:e.hideUnavailableProxies,onChange:o})})]}),c("div",{className:M.labeledInput,children:[n("span",{children:s("auto_close_conns")}),n("div",{children:n(Y,{name:"autoCloseOldConns",checked:e.autoCloseOldConns,onChange:a=>t("autoCloseOldConns",a)})})]})]})}const hr=e=>{const t=q(e),r=E(e),o=je(e);return{appConfig:{proxySortBy:t,hideUnavailableProxies:r,autoCloseOldConns:o}}};var yr=C(hr)(pr);const fr="_overlay_uuk3b_1",mr="_cnt_uuk3b_5",vr="_afterOpen_uuk3b_16";var H={overlay:fr,cnt:mr,afterOpen:vr};const{useMemo:_r}=f;function re({isOpen:e,onRequestClose:t,children:r}){const o=_r(()=>({base:w(X.content,H.cnt),afterOpen:H.afterOpen,beforeClose:""}),[]);return n(Re,{isOpen:e,onRequestClose:t,className:o,overlayClassName:w(X.overlay,H.overlay),children:r})}function xr({color:e="currentColor",size:t=24}){return c("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n("path",{d:"M2 6h9M18.5 6H22"}),n("circle",{cx:"16",cy:"6",r:"2"}),n("path",{d:"M22 18h-9M6 18H2"}),n("circle",{r:"2",transform:"matrix(-1 0 0 1 8 18)"})]})}const gr="_topBar_jgy4z_1",br="_topBarRight_jgy4z_13",wr="_textFilterContainer_jgy4z_22",Cr="_group_jgy4z_29";var L={topBar:gr,topBarRight:br,textFilterContainer:wr,group:Cr};const{useState:kr,useEffect:Pr,useCallback:ne,useRef:Sr}=f;function Nr({dispatch:e,groupNames:t,delay:r,proxyProviders:o,apiConfig:s,showModalClosePrevConns:a}){const l=Sr({}),i=ne(()=>{l.current.startAt=Date.now(),e(ze(s)).then(()=>{l.current.completeAt=Date.now()})},[s,e]);Pr(()=>{i();const y=()=>{l.current.startAt&&Date.now()-l.current.startAt>3e4&&i()};return window.addEventListener("focus",y,!1),()=>window.removeEventListener("focus",y,!1)},[i]);const[u,p]=kr(!1),h=ne(()=>{p(!1)},[]),{proxies:{closeModalClosePrevConns:d,closePrevConnsAndTheModal:_}}=D(),{t:x}=K();return c(T,{children:[n(re,{isOpen:u,onRequestClose:h,children:n(yr,{})}),c("div",{className:L.topBar,children:[n(ue,{title:x("Proxies")}),c("div",{className:L.topBarRight,children:[n("div",{className:L.textFilterContainer,children:n(Ye,{textAtom:oe})}),n(O,{label:x("settings"),children:n(b,{kind:"minimal",onClick:()=>p(!0),children:n(xr,{size:16})})})]})]}),n("div",{children:t.map(y=>n("div",{className:L.group,children:n(qt,{name:y,delay:r,apiConfig:s,dispatch:e})},y))}),n(cr,{items:o}),n("div",{style:{height:60}}),n(Xt,{dispatch:e,apiConfig:s,proxyProviders:o}),n(re,{isOpen:a,onRequestClose:d,children:n(st,{onClickPrimaryButton:()=>_(s),onClickSecondaryButton:d})})]})}const $r=e=>({apiConfig:ce(e),groupNames:Me(e),proxyProviders:He(e),delay:U(e),showModalClosePrevConns:Ue(e)});var jr=C($r)(Nr);export{jr as default}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies.db2d4119.css b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies.3fa3509d.css similarity index 100% rename from luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies.db2d4119.css rename to luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies.3fa3509d.css diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies.98885c78.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies.98885c78.js new file mode 100644 index 000000000..2bff82d2d --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Proxies.98885c78.js @@ -0,0 +1 @@ +import{r as g,j as r,i as $,c as w,T as xe,b as i,B as b,h as f,U as _e,V as ve,W as ee,X as te,d as C,Y as ge,F as T,Z as be,$ as ne,a0 as M,x as D,a1 as we,a2 as re,a3 as O,a4 as oe,a5 as H,a6 as U,a7 as Ce,a8 as ke,u as q,a9 as Pe,aa as Se,ab as Ne,g as se,C as ae,y as V,ac as $e,m as W,M as Ae,ad as Le,ae as Oe,af as Te,ag as De}from"./index.2addc377.js";import{C as Be}from"./chevron-down.0fe59cac.js";import{F as Ie,p as Fe,A as je,I as Re}from"./Fab.ac4f3b29.js";import{R as ze,a as Me,T as He}from"./TextFitler.3362aec6.js";import{f as Ue}from"./index.47b45d26.js";import{S as qe}from"./Select.ef9dc454.js";import"./debounce.c2d20996.js";function Ee(e,t){if(e==null)return{};var n=Ke(e,t),o,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&(!Object.prototype.propertyIsEnumerable.call(e,o)||(n[o]=e[o]))}return n}function Ke(e,t){if(e==null)return{};var n={},o=Object.keys(e),s,a;for(a=0;a=0)&&(n[s]=e[s]);return n}var E=g.exports.forwardRef(function(e,t){var n=e.color,o=n===void 0?"currentColor":n,s=e.size,a=s===void 0?24:s,l=Ee(e,["color","size"]);return r("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...l,children:r("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})})});E.propTypes={color:$.exports.string,size:$.exports.oneOfType([$.exports.string,$.exports.number])};E.displayName="Zap";const Z=E;function le(e){const t=e.size||24,n=w({[xe.animate]:e.animate});return r("svg",{className:n,xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:r("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})})}const Ve="_FlexCenter_1380a_1",We={FlexCenter:Ve};function Ze({children:e}){return r("div",{className:We.FlexCenter,children:e})}const{useRef:G,useEffect:Ge}=f;function Ye({onClickPrimaryButton:e,onClickSecondaryButton:t}){const n=G(null),o=G(null);return Ge(()=>{n.current.focus()},[]),i("div",{onKeyDown:a=>{a.keyCode===39?o.current.focus():a.keyCode===37&&n.current.focus()},children:[r("h2",{children:"Close Connections?"}),r("p",{children:'Click "Yes" to close those connections that are still using the old selected proxy in this group'}),r("div",{style:{height:30}}),i(Ze,{children:[r(b,{onClick:e,ref:n,children:"Yes"}),r("div",{style:{width:20}}),r(b,{onClick:t,ref:o,children:"No"})]})]})}const Xe="_header_1y9js_1",Je="_arrow_1y9js_8",Qe="_isOpen_1y9js_13",et="_btn_1y9js_20",tt="_qty_1y9js_25",k={header:Xe,arrow:Je,isOpen:Qe,btn:et,qty:tt};function ce({name:e,type:t,toggle:n,isOpen:o,qty:s}){const a=g.exports.useCallback(l=>{l.preventDefault(),(l.key==="Enter"||l.key===" ")&&n()},[n]);return i("div",{className:k.header,onClick:n,style:{cursor:"pointer"},tabIndex:0,onKeyDown:a,role:"button",children:[r("div",{children:r(_e,{name:e,type:t})}),typeof s=="number"?r("span",{className:k.qty,children:s}):null,r(b,{kind:"minimal",onClick:n,className:k.btn,title:"Toggle collapsible section",children:r("span",{className:w(k.arrow,{[k.isOpen]:o}),children:r(Be,{size:20})})})]})}const{useMemo:nt}=f;function rt(e,t){return e.filter(n=>{const o=t[n];return o===void 0?!0:o.number!==0})}const A=(e,t)=>{if(e&&typeof e.number=="number"&&e.number>0)return e.number;const n=t&&t.type;return n&&te.indexOf(n)>-1?-1:999999},ot={Natural:e=>e,LatencyAsc:(e,t,n)=>e.sort((o,s)=>{const a=A(t[o],n&&n[o]),l=A(t[s],n&&n[s]);return a-l}),LatencyDesc:(e,t,n)=>e.sort((o,s)=>{const a=A(t[o],n&&n[o]);return A(t[s],n&&n[s])-a}),NameAsc:e=>e.sort(),NameDesc:e=>e.sort((t,n)=>t>n?-1:to.trim()).filter(o=>!!o);return n.length===0?e:e.filter(o=>{let s=0;for(;s-1)return!0}return!1})}function at(e,t,n,o,s,a){let l=[...e];return n&&(l=rt(e,t)),typeof o=="string"&&o!==""&&(l=st(l,o)),ot[s](l,t,a)}function ie(e,t,n,o,s){const[a]=ve(ee);return nt(()=>at(e,t,n,a,o,s),[e,t,n,a,o,s])}const lt="_header_5pmv2_1",ct="_groupHead_5pmv2_5",it="_action_5pmv2_11",F={header:lt,groupHead:ct,action:it},ut="_proxy_8ev0l_1",dt="_now_8ev0l_25",pt="_error_8ev0l_29",ht="_selectable_8ev0l_32",yt="_proxyType_8ev0l_40",ft="_row_8ev0l_51",mt="_proxyName_8ev0l_57",xt="_proxySmall_8ev0l_66",m={proxy:ut,now:dt,error:pt,selectable:ht,proxyType:yt,row:ft,proxyName:mt,proxySmall:xt},_t="_proxyLatency_hz69v_1",vt={proxyLatency:_t};function gt({number:e,color:t}){return r("span",{className:vt.proxyLatency,style:{color:t},children:typeof e=="number"&&e!==0?e+" ms":" "})}const{useMemo:N}=f,P={good:"#67c23a",normal:"#d4b75c",bad:"#e67f3c",na:"#909399"};function ue({number:e}={}){return e===0?P.na:e<200?P.good:e<400?P.normal:typeof e=="number"?P.bad:P.na}function bt(e,t){return te.indexOf(t)>-1?{border:"1px dotted #777"}:{background:ue(e)}}function wt({now:e,name:t,proxy:n,latency:o,isSelectable:s,onClick:a}){const l=N(()=>bt(o,n.type),[o,n]),c=N(()=>{let d=t;return o&&typeof o.number=="number"&&(d+=" "+o.number+" ms"),d},[t,o]),u=g.exports.useCallback(()=>{s&&a&&a(t)},[t,a,s]),p=N(()=>w(m.proxySmall,{[m.now]:e,[m.selectable]:s}),[s,e]),h=g.exports.useCallback(d=>{d.key==="Enter"&&u()},[u]);return r("div",{title:c,className:p,style:l,onClick:u,onKeyDown:h,role:s?"menuitem":""})}function Ct(e){return e==="Shadowsocks"?"SS":e}const kt=e=>({left:e.left+window.scrollX-5,top:e.top+window.scrollY-38});function Pt({children:e,label:t,"aria-label":n}){const[o,s]=ge();return i(T,{children:[g.exports.cloneElement(e,o),r(be,{...s,label:t,"aria-label":n,position:kt})]})}function St({now:e,name:t,proxy:n,latency:o,isSelectable:s,onClick:a}){const l=N(()=>ue(o),[o]),c=g.exports.useCallback(()=>{s&&a&&a(t)},[t,a,s]),u=g.exports.useCallback(h=>{h.key==="Enter"&&c()},[c]),p=N(()=>w(m.proxy,{[m.now]:e,[m.selectable]:s}),[s,e]);return i("div",{tabIndex:0,className:p,onClick:c,onKeyDown:u,role:s?"menuitem":"",children:[r("div",{className:m.proxyName,children:r(Pt,{label:t,"aria-label":"proxy name: "+t,children:r("span",{children:t})})}),i("div",{className:m.row,children:[r("span",{className:m.proxyType,style:{opacity:e?.6:.2},children:Ct(n.type)}),r(gt,{number:o==null?void 0:o.number,color:l})]})]})}const de=(e,{name:t})=>{const n=ne(e),o=M(e);return{proxy:n[t]||{name:t,type:"Unknown",history:[]},latency:o[t]}},Nt=C(de)(St),$t=C(de)(wt),At="_list_1oy7w_1",Lt="_listSummaryView_1oy7w_8",pe={list:At,listSummaryView:Lt};function he({all:e,now:t,isSelectable:n,itemOnTapCallback:o}){const s=e;return r("div",{className:pe.list,children:s.map(a=>r(Nt,{onClick:o,isSelectable:n,name:a,now:a===t},a))})}function ye({all:e,now:t,isSelectable:n,itemOnTapCallback:o}){return r("div",{className:pe.listSummaryView,children:e.map(s=>r($t,{onClick:o,isSelectable:n,name:s,now:s===t},s))})}const{createElement:Ot,useCallback:j,useMemo:Tt}=f;function Dt({name:e,all:t,delay:n,hideUnavailableProxies:o,proxySortBy:s,proxies:a,type:l,now:c,isOpen:u,apiConfig:p,dispatch:h}){const d=ie(t,n,o,s,a),_=Tt(()=>l==="Selector",[l]),{app:{updateCollapsibleIsOpen:v},proxies:{requestDelayForProxies:y}}=D(),B=j(()=>{v("proxyGroup",e,!u)},[u,v,e]),I=j(K=>{!_||h(we(p,e,K))},[p,h,e,_]),x=re(!1),me=j(async()=>{if(!x.value){x.set(!0);try{await y(p,d)}catch{}x.set(!1)}},[d,p,y,x]);return i("div",{className:F.group,children:[i("div",{className:F.groupHead,children:[r(ce,{name:e,type:l,toggle:B,qty:d.length,isOpen:u}),r("div",{className:F.action,children:r(O,{label:"Test latency",children:r(b,{kind:"circular",onClick:me,children:r(le,{animate:x.value,size:16})})})})]}),Ot(u?he:ye,{all:d,now:c,isSelectable:_,itemOnTapCallback:I})]})}const Bt=C((e,{name:t,delay:n})=>{const o=ne(e),s=oe(e),a=H(e),l=U(e),c=o[t],{all:u,type:p,now:h}=c;return{all:u,delay:n,hideUnavailableProxies:l,proxySortBy:a,proxies:o,type:p,now:h,isOpen:s[`proxyGroup:${t}`]}})(Dt),{useCallback:fe,useState:It}=f;function Ft({dispatch:e,apiConfig:t,name:n}){return fe(()=>e(Ce(t,n)),[t,e,n])}function jt({dispatch:e,apiConfig:t,names:n}){const[o,s]=It(!1);return[fe(async()=>{if(!o){s(!0);try{await e(ke(t,n))}catch{}s(!1)}},[t,e,n,o]),o]}const{useState:Rt,useCallback:zt}=f;function Mt({isLoading:e}){return e?r(Re,{children:r(Z,{width:16,height:16})}):r(Z,{width:16,height:16})}function Ht({dispatch:e,apiConfig:t}){const[n,o]=Rt(!1);return[zt(()=>{n||(o(!0),e(Pe(t)).then(()=>o(!1),()=>o(!1)))},[t,e,n]),n]}function Ut({dispatch:e,apiConfig:t,proxyProviders:n}){const{t:o}=q(),[s,a]=Ht({dispatch:e,apiConfig:t}),[l,c]=jt({apiConfig:t,dispatch:e,names:n.map(u=>u.name)});return r(Ie,{icon:r(Mt,{isLoading:a}),onClick:s,text:o("Test Latency"),style:Fe,children:n.length>0?r(je,{text:o("update_all_proxy_provider"),onClick:l,children:r(ze,{isRotating:c})}):null})}const qt="_updatedAt_1rx92_1",Et="_main_1rx92_8",Kt="_head_1rx92_17",Vt="_action_1rx92_23",Wt="_refresh_1rx92_31",S={updatedAt:qt,main:Et,head:Kt,action:Vt,refresh:Wt},{useCallback:Y}=f;function Zt({name:e,proxies:t,delay:n,hideUnavailableProxies:o,proxySortBy:s,vehicleType:a,updatedAt:l,isOpen:c,dispatch:u,apiConfig:p}){const h=ie(t,n,o,s),d=re(!1),_=Ft({dispatch:u,apiConfig:p,name:e}),v=Y(()=>{if(d.value)return;d.set(!0);const x=()=>d.set(!1);u(Se(p,e)).then(x,x)},[p,u,e,d]),{app:{updateCollapsibleIsOpen:y}}=D(),B=Y(()=>{y("proxyProvider",e,!c)},[c,y,e]),I=Ue(new Date(l),new Date);return i("div",{className:S.main,children:[i("div",{className:S.head,children:[r(ce,{name:e,toggle:B,type:a,isOpen:c,qty:h.length}),i("div",{className:S.action,children:[r(O,{label:"Update",children:r(b,{kind:"circular",onClick:_,children:r(Xt,{})})}),r(O,{label:"Health Check",children:r(b,{kind:"circular",onClick:v,children:r(le,{animate:d.value,size:16})})})]})]}),r("div",{className:S.updatedAt,children:i("small",{children:["Updated ",I," ago"]})}),c?r(he,{all:h}):r(ye,{all:h})]})}const Gt={rest:{scale:1},pressed:{scale:.95}},Yt={rest:{rotate:0},hover:{rotate:360,transition:{duration:.3}}};function Xt(){const t=Ne.read().motion;return r(t.div,{className:S.refresh,variants:Gt,initial:"rest",whileHover:"hover",whileTap:"pressed",children:r(t.div,{className:"flexCenter",variants:Yt,children:r(Me,{size:16})})})}const Jt=(e,{proxies:t,name:n})=>{const o=U(e),s=M(e),a=oe(e),l=se(e),c=H(e);return{apiConfig:l,proxies:t,delay:s,hideUnavailableProxies:o,proxySortBy:c,isOpen:a[`proxyProvider:${n}`]}},Qt=C(Jt)(Zt);function en({items:e}){return e.length===0?null:i(T,{children:[r(ae,{title:"Proxy Provider"}),r("div",{children:e.map(t=>r(Qt,{name:t.name,proxies:t.proxies,type:t.type,vehicleType:t.vehicleType,updatedAt:t.updatedAt},t.name))})]})}const tn="_labeledInput_cmki0_1",R={labeledInput:tn},nn=[["Natural","order_natural"],["LatencyAsc","order_latency_asc"],["LatencyDesc","order_latency_desc"],["NameAsc","order_name_asc"],["NameDesc","order_name_desc"]],{useCallback:X}=f;function rn({appConfig:e}){const{app:{updateAppConfig:t}}=D(),n=X(a=>{t("proxySortBy",a.target.value)},[t]),o=X(a=>{t("hideUnavailableProxies",a)},[t]),{t:s}=q();return i(T,{children:[i("div",{className:R.labeledInput,children:[r("span",{children:s("sort_in_grp")}),r("div",{children:r(qe,{options:nn.map(a=>[a[0],s(a[1])]),selected:e.proxySortBy,onChange:n})})]}),r("hr",{}),i("div",{className:R.labeledInput,children:[r("span",{children:s("hide_unavail_proxies")}),r("div",{children:r(V,{name:"hideUnavailableProxies",checked:e.hideUnavailableProxies,onChange:o})})]}),i("div",{className:R.labeledInput,children:[r("span",{children:s("auto_close_conns")}),r("div",{children:r(V,{name:"autoCloseOldConns",checked:e.autoCloseOldConns,onChange:a=>t("autoCloseOldConns",a)})})]})]})}const on=e=>{const t=H(e),n=U(e),o=$e(e);return{appConfig:{proxySortBy:t,hideUnavailableProxies:n,autoCloseOldConns:o}}},sn=C(on)(rn),an="_overlay_uuk3b_1",ln="_cnt_uuk3b_5",cn="_afterOpen_uuk3b_16",z={overlay:an,cnt:ln,afterOpen:cn},{useMemo:un}=f;function J({isOpen:e,onRequestClose:t,children:n}){const o=un(()=>({base:w(W.content,z.cnt),afterOpen:z.afterOpen,beforeClose:""}),[]);return r(Ae,{isOpen:e,onRequestClose:t,className:o,overlayClassName:w(W.overlay,z.overlay),children:n})}function dn({color:e="currentColor",size:t=24}){return i("svg",{fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:t,height:t,stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r("path",{d:"M2 6h9M18.5 6H22"}),r("circle",{cx:"16",cy:"6",r:"2"}),r("path",{d:"M22 18h-9M6 18H2"}),r("circle",{r:"2",transform:"matrix(-1 0 0 1 8 18)"})]})}const pn="_topBar_jgy4z_1",hn="_topBarRight_jgy4z_13",yn="_textFilterContainer_jgy4z_22",fn="_group_jgy4z_29",L={topBar:pn,topBarRight:hn,textFilterContainer:yn,group:fn},{useState:mn,useEffect:xn,useCallback:Q,useRef:_n}=f;function vn({dispatch:e,groupNames:t,delay:n,proxyProviders:o,apiConfig:s,showModalClosePrevConns:a}){const l=_n({}),c=Q(()=>{l.current.startAt=Date.now(),e(Le(s)).then(()=>{l.current.completeAt=Date.now()})},[s,e]);xn(()=>{c();const y=()=>{l.current.startAt&&Date.now()-l.current.startAt>3e4&&c()};return window.addEventListener("focus",y,!1),()=>window.removeEventListener("focus",y,!1)},[c]);const[u,p]=mn(!1),h=Q(()=>{p(!1)},[]),{proxies:{closeModalClosePrevConns:d,closePrevConnsAndTheModal:_}}=D(),{t:v}=q();return i(T,{children:[r(J,{isOpen:u,onRequestClose:h,children:r(sn,{})}),i("div",{className:L.topBar,children:[r(ae,{title:v("Proxies")}),i("div",{className:L.topBarRight,children:[r("div",{className:L.textFilterContainer,children:r(He,{textAtom:ee})}),r(O,{label:v("settings"),children:r(b,{kind:"minimal",onClick:()=>p(!0),children:r(dn,{size:16})})})]})]}),r("div",{children:t.map(y=>r("div",{className:L.group,children:r(Bt,{name:y,delay:n,apiConfig:s,dispatch:e})},y))}),r(en,{items:o}),r("div",{style:{height:60}}),r(Ut,{dispatch:e,apiConfig:s,proxyProviders:o}),r(J,{isOpen:a,onRequestClose:d,children:r(Ye,{onClickPrimaryButton:()=>_(s),onClickSecondaryButton:d})})]})}const gn=e=>({apiConfig:se(e),groupNames:Oe(e),proxyProviders:Te(e),delay:M(e),showModalClosePrevConns:De(e)}),$n=C(gn)(vn);export{$n as default}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Rules.2fdbf529.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Rules.2fdbf529.js deleted file mode 100644 index 38fa71161..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Rules.2fdbf529.js +++ /dev/null @@ -1 +0,0 @@ -var A=Object.defineProperty,$=Object.defineProperties;var F=Object.getOwnPropertyDescriptors;var O=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,q=Object.prototype.propertyIsEnumerable;var I=(e,s,r)=>s in e?A(e,s,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[s]=r,h=(e,s)=>{for(var r in s||(s={}))L.call(s,r)&&I(e,r,s[r]);if(O)for(var r of O(s))q.call(s,r)&&I(e,r,s[r]);return e},_=(e,s)=>$(e,F(s));import{_ as D,Q as b,ah as Q,ai as M,aj as j,R as m,ak as z,al as P,am as V,an as W,D as w,ao as H,ap as S,V as G,b as c,j as o,U as J,B as K,u as x,d as X,g as Y,C as Z,h as ee}from"./index.5901d226.js";import{a as te,V as re}from"./index.esm.390d1b7a.js";import{R as N,T as ne}from"./TextFitler.f9fb92be.js";import{f as se}from"./index.e97a91e5.js";import{F as ie,p as ae}from"./Fab.93225453.js";import{u as oe}from"./useRemainingViewPortHeight.d051faee.js";import"./debounce.d080d5e1.js";var ue=function(e){D(s,e);function s(i,n){var t;return t=e.call(this)||this,t.client=i,t.setOptions(n),t.bindMethods(),t.updateResult(),t}var r=s.prototype;return r.bindMethods=function(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)},r.setOptions=function(n){this.options=this.client.defaultMutationOptions(n)},r.onUnsubscribe=function(){if(!this.listeners.length){var n;(n=this.currentMutation)==null||n.removeObserver(this)}},r.onMutationUpdate=function(n){this.updateResult();var t={listeners:!0};n.type==="success"?t.onSuccess=!0:n.type==="error"&&(t.onError=!0),this.notify(t)},r.getCurrentResult=function(){return this.currentResult},r.reset=function(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})},r.mutate=function(n,t){return this.mutateOptions=t,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,b({},this.options,{variables:typeof n!="undefined"?n:this.options.variables})),this.currentMutation.addObserver(this),this.currentMutation.execute()},r.updateResult=function(){var n=this.currentMutation?this.currentMutation.state:Q(),t=b({},n,{isLoading:n.status==="loading",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset});this.currentResult=t},r.notify=function(n){var t=this;M.batch(function(){t.mutateOptions&&(n.onSuccess?(t.mutateOptions.onSuccess==null||t.mutateOptions.onSuccess(t.currentResult.data,t.currentResult.variables,t.currentResult.context),t.mutateOptions.onSettled==null||t.mutateOptions.onSettled(t.currentResult.data,null,t.currentResult.variables,t.currentResult.context)):n.onError&&(t.mutateOptions.onError==null||t.mutateOptions.onError(t.currentResult.error,t.currentResult.variables,t.currentResult.context),t.mutateOptions.onSettled==null||t.mutateOptions.onSettled(void 0,t.currentResult.error,t.currentResult.variables,t.currentResult.context))),n.listeners&&t.listeners.forEach(function(a){a(t.currentResult)})})},s}(j);function E(e,s,r){var i=m.useRef(!1),n=m.useState(0),t=n[1],a=z(e,s,r),d=P(),u=m.useRef();u.current?u.current.setOptions(a):u.current=new ue(d,a);var l=u.current.getCurrentResult();m.useEffect(function(){i.current=!0;var R=u.current.subscribe(M.batchCalls(function(){i.current&&t(function(y){return y+1})}));return function(){i.current=!1,R()}},[]);var p=m.useCallback(function(R,y){u.current.mutate(R,y).catch(V)},[]);if(l.error&&W(void 0,u.current.options.useErrorBoundary,[l.error]))throw l.error;return b({},l,{mutate:p,mutateAsync:l.mutate})}function le(e){const s=e.providers,r=Object.keys(s),i={};for(let n=0;n=0,"there is no valid rules list in the rules API response"),e.rules.map((s,r)=>_(h({},s),{id:r}))}async function ve(e,s){let r={rules:[]};try{const{url:i,init:n}=w(s),t=await fetch(i+e,n);t.ok&&(r=await t.json())}catch(i){console.log("failed to fetch rules",i)}return me(r)}const B=H({key:"ruleFilterText",default:""});function pe(e,s){const r=P(),{mutate:i,isLoading:n}=E(k,{onSuccess:()=>{r.invalidateQueries("/providers/rules")}});return[a=>{a.preventDefault(),i({name:e,apiConfig:s})},n]}function Re(e){const s=P(),{data:r}=T(e),{mutate:i,isLoading:n}=E(de,{onSuccess:()=>{s.invalidateQueries("/providers/rules")}});return[a=>{a.preventDefault(),i({names:r.names,apiConfig:e})},n]}function T(e){return S(["/providers/rules",e],()=>ce("/providers/rules",e))}function ye(e){const{data:s,isFetching:r}=S(["/rules",e],()=>ve("/rules",e)),{data:i}=T(e),[n]=G(B);if(n==="")return{rules:s,provider:i,isFetching:r};{const t=n.toLowerCase();return{rules:s.filter(a=>a.payload.toLowerCase().indexOf(t)>=0),isFetching:r,provider:{byName:i.byName,names:i.names.filter(a=>a.toLowerCase().indexOf(t)>=0)}}}}const _e="_RuleProviderItem_12aid_1",ge="_left_12aid_7",be="_middle_12aid_14",Pe="_gray_12aid_21",we="_action_12aid_25",Oe="_refreshBtn_12aid_32";var f={RuleProviderItem:_e,left:ge,middle:be,gray:Pe,action:we,refreshBtn:Oe};function Ie({idx:e,name:s,vehicleType:r,behavior:i,updatedAt:n,ruleCount:t,apiConfig:a}){const[d,u]=pe(s,a),l=se(new Date(n),new Date);return c("div",{className:f.RuleProviderItem,children:[o("span",{className:f.left,children:e}),c("div",{className:f.middle,children:[o(J,{name:s,type:`${r} / ${i}`}),o("div",{className:f.gray,children:t<2?`${t} rule`:`${t} rules`}),c("div",{className:f.action,children:[c(K,{onClick:d,disabled:u,className:f.refreshBtn,children:[o(N,{isRotating:u,size:13}),o("span",{className:"visually-hidden",children:"Refresh"})]}),c("small",{className:f.gray,children:["Updated ",l," ago"]})]})]})]})}function Ce({apiConfig:e}){const[s,r]=Re(e),{t:i}=x();return o(ie,{icon:o(N,{isRotating:r}),text:i("update_all_rule_provider"),style:ae,onClick:s})}const Me="_rule_1ymqx_1",Se="_left_1ymqx_12",xe="_a_1ymqx_19",Ne="_b_1ymqx_26",Ee="_type_1ymqx_37";var v={rule:Me,left:Se,a:xe,b:Ne,type:Ee};const g={_default:"#59caf9",DIRECT:"#f5bc41",REJECT:"#cb3166"};function ke({proxy:e}){let s=g._default;return g[e]&&(s=g[e]),{color:s}}function Be({type:e,payload:s,proxy:r,id:i}){const n=ke({proxy:r});return c("div",{className:v.rule,children:[o("div",{className:v.left,children:i}),c("div",{children:[o("div",{className:v.b,children:s}),c("div",{className:v.a,children:[o("div",{className:v.type,children:e}),o("div",{style:n,children:r})]})]})]})}const Te="_header_1j1w3_1",Ue="_RuleProviderItemWrapper_1j1w3_17";var U={header:Te,RuleProviderItemWrapper:Ue};const{memo:Ae}=ee,C=30;function $e(e,{rules:s,provider:r}){const i=r.names.length;return e{const{rules:i,provider:n,apiConfig:t}=r,a=n.names.length;if(e({apiConfig:Y(e)});var Ke=X(qe)(De);function De({apiConfig:e}){const[s,r]=oe(),{rules:i,provider:n}=ye(e),t=Fe({provider:n}),{t:a}=x();return c("div",{children:[c("div",{className:U.header,children:[o(Z,{title:a("Rules")}),o(ne,{placeholder:"Filter",textAtom:B})]}),o("div",{ref:s,style:{paddingBottom:C},children:o(re,{height:r-C,width:"100%",itemCount:i.length+n.names.length,itemSize:t,itemData:{rules:i,provider:n,apiConfig:e},itemKey:$e,children:Le})}),n&&n.names&&n.names.length>0?o(Ce,{apiConfig:e}):null]})}export{Ke as default}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Rules.651d070a.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Rules.651d070a.js new file mode 100644 index 000000000..d9495b91a --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Rules.651d070a.js @@ -0,0 +1 @@ +import{E as v,ah as C,ai as _,V as k,aj as y,ak as R,b as c,j as a,U as B,B as T,u as g,d as F,g as S,C as $,h as A}from"./index.2addc377.js";import{a as j,V as q}from"./index.esm.d79e6b4f.js";import{R as P,T as z}from"./TextFitler.3362aec6.js";import{f as E}from"./index.47b45d26.js";import{F as L,p as Q}from"./Fab.ac4f3b29.js";import{u as D}from"./useRemainingViewPortHeight.4e5a0898.js";import"./debounce.c2d20996.js";function U(e){const r=e.providers,t=Object.keys(r),s={};for(let n=0;n=0,"there is no valid rules list in the rules API response"),e.rules.map((r,t)=>({...r,id:t}))}async function G(e,r){let t={rules:[]};try{const{url:s,init:n}=v(r),i=await fetch(s+e,n);i.ok&&(t=await i.json())}catch(s){console.log("failed to fetch rules",s)}return O(t)}const w=C({key:"ruleFilterText",default:""});function J(e,r){const t=y(),{mutate:s,isLoading:n}=R(I,{onSuccess:()=>{t.invalidateQueries(["/providers/rules"])}});return[o=>{o.preventDefault(),s({name:e,apiConfig:r})},n]}function K(e){const r=y(),{data:t}=N(e),{mutate:s,isLoading:n}=R(W,{onSuccess:()=>{r.invalidateQueries(["/providers/rules"])}});return[o=>{o.preventDefault(),s({names:t.names,apiConfig:e})},n]}function N(e){return _(["/providers/rules",e],()=>V("/providers/rules",e))}function X(e){const{data:r,isFetching:t}=_(["/rules",e],()=>G("/rules",e)),{data:s}=N(e),[n]=k(w);if(n==="")return{rules:r,provider:s,isFetching:t};{const i=n.toLowerCase();return{rules:r.filter(o=>o.payload.toLowerCase().indexOf(i)>=0),isFetching:t,provider:{byName:s.byName,names:s.names.filter(o=>o.toLowerCase().indexOf(i)>=0)}}}}const Y="_RuleProviderItem_12aid_1",Z="_left_12aid_7",ee="_middle_12aid_14",te="_gray_12aid_21",re="_action_12aid_25",ne="_refreshBtn_12aid_32",u={RuleProviderItem:Y,left:Z,middle:ee,gray:te,action:re,refreshBtn:ne};function se({idx:e,name:r,vehicleType:t,behavior:s,updatedAt:n,ruleCount:i,apiConfig:o}){const[d,l]=J(r,o),m=E(new Date(n),new Date);return c("div",{className:u.RuleProviderItem,children:[a("span",{className:u.left,children:e}),c("div",{className:u.middle,children:[a(B,{name:r,type:`${t} / ${s}`}),a("div",{className:u.gray,children:i<2?`${i} rule`:`${i} rules`}),c("div",{className:u.action,children:[c(T,{onClick:d,disabled:l,className:u.refreshBtn,children:[a(P,{isRotating:l,size:13}),a("span",{className:"visually-hidden",children:"Refresh"})]}),c("small",{className:u.gray,children:["Updated ",m," ago"]})]})]})]})}function ie({apiConfig:e}){const[r,t]=K(e),{t:s}=g();return a(L,{icon:a(P,{isRotating:t}),text:s("update_all_rule_provider"),style:Q,onClick:r})}const ae="_rule_1ymqx_1",oe="_left_1ymqx_12",le="_a_1ymqx_19",ce="_b_1ymqx_26",ue="_type_1ymqx_37",f={rule:ae,left:oe,a:le,b:ce,type:ue},h={_default:"#59caf9",DIRECT:"#f5bc41",REJECT:"#cb3166"};function de({proxy:e}){let r=h._default;return h[e]&&(r=h[e]),{color:r}}function me({type:e,payload:r,proxy:t,id:s}){const n=de({proxy:t});return c("div",{className:f.rule,children:[a("div",{className:f.left,children:s}),c("div",{children:[a("div",{className:f.b,children:r}),c("div",{className:f.a,children:[a("div",{className:f.type,children:e}),a("div",{style:n,children:t})]})]})]})}const fe="_header_1j1w3_1",he="_RuleProviderItemWrapper_1j1w3_17",b={header:fe,RuleProviderItemWrapper:he},{memo:ve}=A,p=30;function pe(e,{rules:r,provider:t}){const s=t.names.length;return e{const{rules:s,provider:n,apiConfig:i}=t,o=n.names.length;if(e({apiConfig:S(e)}),ke=F(Re)(ge);function ge({apiConfig:e}){const[r,t]=D(),{rules:s,provider:n}=X(e),i=_e({provider:n}),{t:o}=g();return c("div",{children:[c("div",{className:b.header,children:[a($,{title:o("Rules")}),a(z,{placeholder:"Filter",textAtom:w})]}),a("div",{ref:r,style:{paddingBottom:p},children:a(q,{height:t-p,width:"100%",itemCount:s.length+n.names.length,itemSize:i,itemData:{rules:s,provider:n,apiConfig:e},itemKey:pe,children:ye})}),n&&n.names&&n.names.length>0?a(ie,{apiConfig:e}):null]})}export{ke as default}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Rules.faccd448.css b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Rules.e03c54a8.css similarity index 100% rename from luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Rules.faccd448.css rename to luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Rules.e03c54a8.css diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Select.aace7191.css b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Select.1e55eba1.css similarity index 100% rename from luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Select.aace7191.css rename to luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Select.1e55eba1.css diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Select.ef9dc454.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Select.ef9dc454.js new file mode 100644 index 000000000..161c98d7f --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Select.ef9dc454.js @@ -0,0 +1 @@ +import{j as s}from"./index.2addc377.js";const o="_select_13zm8_1",r={select:o};function i({options:t,selected:c,onChange:l}){return s("select",{className:r.select,value:c,onChange:l,children:t.map(([e,n])=>s("option",{value:e,children:n},e))})}export{i as S}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Select.f72e6abf.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Select.f72e6abf.js deleted file mode 100644 index 61cc2986b..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/Select.f72e6abf.js +++ /dev/null @@ -1 +0,0 @@ -import{j as s}from"./index.5901d226.js";const n="_select_13zm8_1";var o={select:n};function i({options:t,selected:c,onChange:l}){return s("select",{className:o.select,value:c,onChange:l,children:t.map(([e,r])=>s("option",{value:e,children:r},e))})}export{i as S}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFitler.3362aec6.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFitler.3362aec6.js new file mode 100644 index 000000000..b6292b876 --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFitler.3362aec6.js @@ -0,0 +1 @@ +import{r as u,b as g,j as i,i as c,c as f,V as x,h as d}from"./index.2addc377.js";import{d as h}from"./debounce.c2d20996.js";function v(t,n){if(t==null)return{};var o=_(t,n),r,e;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(e=0;e=0)&&(!Object.prototype.propertyIsEnumerable.call(t,r)||(o[r]=t[r]))}return o}function _(t,n){if(t==null)return{};var o={},r=Object.keys(t),e,s;for(s=0;s=0)&&(o[e]=t[e]);return o}var l=u.exports.forwardRef(function(t,n){var o=t.color,r=o===void 0?"currentColor":o,e=t.size,s=e===void 0?24:e,a=v(t,["color","size"]);return g("svg",{ref:n,xmlns:"http://www.w3.org/2000/svg",width:s,height:s,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[i("polyline",{points:"23 4 23 10 17 10"}),i("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]})});l.propTypes={color:c.exports.string,size:c.exports.oneOfType([c.exports.string,c.exports.number])};l.displayName="RotateCw";const b=l,y="_rotate_1dspl_1",m="_isRotating_1dspl_5",R="_rotating_1dspl_1",p={rotate:y,isRotating:m,rotating:R};function P(t){const n=t.size||16,o=f(p.rotate,{[p.isRotating]:t.isRotating});return i("span",{className:o,children:i(b,{size:n})})}const{useCallback:w,useState:j,useMemo:O}=d;function T(t){const[,n]=x(t),[o,r]=j(""),e=O(()=>h(n,300),[n]);return[w(a=>{r(a.target.value),e(a.target.value)},[e]),o]}const k="_input_16a1f_1",C={input:k};function $(t){const[n,o]=T(t.textAtom);return i("input",{className:C.input,type:"text",value:o,onChange:n,placeholder:t.placeholder})}export{P as R,$ as T,b as a}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFitler.3d9182a0.css b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFitler.b21c0577.css similarity index 100% rename from luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFitler.3d9182a0.css rename to luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFitler.b21c0577.css diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFitler.f9fb92be.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFitler.f9fb92be.js deleted file mode 100644 index 63be92ff3..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/TextFitler.f9fb92be.js +++ /dev/null @@ -1 +0,0 @@ -var v=Object.defineProperty,h=Object.defineProperties;var x=Object.getOwnPropertyDescriptors;var u=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var p=(t,e,o)=>e in t?v(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,g=(t,e)=>{for(var o in e||(e={}))_.call(e,o)&&p(t,o,e[o]);if(u)for(var o of u(e))b.call(e,o)&&p(t,o,e[o]);return t},f=(t,e)=>h(t,x(e));import{r as y,b as m,j as i,P as c,c as R,V as w,h as j}from"./index.5901d226.js";import{d as O}from"./debounce.d080d5e1.js";function T(t,e){if(t==null)return{};var o=k(t,e),r,n;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(n=0;n=0)&&(!Object.prototype.propertyIsEnumerable.call(t,r)||(o[r]=t[r]))}return o}function k(t,e){if(t==null)return{};var o={},r=Object.keys(t),n,a;for(a=0;a=0)&&(o[n]=t[n]);return o}var l=y.exports.forwardRef(function(t,e){var o=t.color,r=o===void 0?"currentColor":o,n=t.size,a=n===void 0?24:n,s=T(t,["color","size"]);return m("svg",f(g({ref:e,xmlns:"http://www.w3.org/2000/svg",width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},s),{children:[i("polyline",{points:"23 4 23 10 17 10"}),i("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}))});l.propTypes={color:c.string,size:c.oneOfType([c.string,c.number])};l.displayName="RotateCw";var C=l;const z="_rotate_1dspl_1",P="_isRotating_1dspl_5",L="_rotating_1dspl_1";var d={rotate:z,isRotating:P,rotating:L};function E(t){const e=t.size||16,o=R(d.rotate,{[d.isRotating]:t.isRotating});return i("span",{className:o,children:i(C,{size:e})})}const{useCallback:$,useState:I,useMemo:N}=j;function W(t){const[,e]=w(t),[o,r]=I(""),n=N(()=>O(e,300),[e]);return[$(s=>{r(s.target.value),n(s.target.value)},[n]),o]}const M="_input_16a1f_1";var S={input:M};function F(t){const[e,o]=W(t.textAtom);return i("input",{className:S.input,type:"text",value:o,onChange:e,placeholder:t.placeholder})}export{E as R,F as T,C as a}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/chart-lib.a8ad03fd.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/chart-lib.a8ad03fd.js new file mode 100644 index 000000000..8ed37cc9d --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/chart-lib.a8ad03fd.js @@ -0,0 +1,18 @@ +/*! + * Chart.js v3.9.1 + * https://www.chartjs.org + * (c) 2022 Chart.js Contributors + * Released under the MIT License + */const Gn=function(){let i=0;return function(){return i++}}();function E(i){return i===null||typeof i>"u"}function z(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function C(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}const W=i=>(typeof i=="number"||i instanceof Number)&&isFinite(+i);function J(i,t){return W(i)?i:t}function D(i,t){return typeof i>"u"?t:i}const Zn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:i/t,qs=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function I(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function R(i,t,e,s){let n,o,r;if(z(i))if(o=i.length,s)for(n=o-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;ni,x:i=>i.x,y:i=>i.y};function mt(i,t){return(Ii[t]||(Ii[t]=to(t)))(i)}function to(i){const t=eo(i);return e=>{for(const s of t){if(s==="")break;e=e&&e[s]}return e}}function eo(i){const t=i.split("."),e=[];let s="";for(const n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function pi(i){return i.charAt(0).toUpperCase()+i.slice(1)}const tt=i=>typeof i<"u",bt=i=>typeof i=="function",zi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function io(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const V=Math.PI,F=2*V,so=F+V,we=Number.POSITIVE_INFINITY,no=V/180,B=V/2,Nt=V/4,Bi=V*2/3,Q=Math.log10,ot=Math.sign;function Vi(i){const t=Math.round(i);i=qt(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(Q(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function oo(i){const t=[],e=Math.sqrt(i);let s;for(s=1;sn-o).pop(),t}function Ft(i){return!isNaN(parseFloat(i))&&isFinite(i)}function qt(i,t,e){return Math.abs(i-t)=i}function Zs(i,t,e){let s,n,o;for(s=0,n=i.length;sl&&c=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function bi(i,t,e){e=e||(r=>i[r]1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const St=(i,t,e,s)=>bi(i,e,s?n=>i[n][t]<=e:n=>i[n][t]bi(i,e,s=>i[s][t]>=e);function ho(i,t,e){let s=0,n=i.length;for(;ss&&i[n-1]>e;)n--;return s>0||n{const s="_onData"+pi(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function Wi(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(Qs.forEach(o=>{delete i[o]}),delete i._chartjs)}function tn(i){const t=new Set;let e,s;for(e=0,s=i.length;e"u"?function(i){return i()}:window.requestAnimationFrame}();function sn(i,t,e){const s=e||(r=>Array.prototype.slice.call(r));let n=!1,o=[];return function(...r){o=s(r),n||(n=!0,en.call(window,()=>{n=!1,i.apply(t,o)}))}}function fo(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const nn=i=>i==="start"?"left":i==="end"?"right":"center",q=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,go=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function on(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,_parsed:a}=i,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(n=Y(Math.min(St(a,r.axis,c).lo,e?s:St(t,l,r.getPixelForValue(c)).lo),0,s-1)),u?o=Y(Math.max(St(a,r.axis,h,!0).hi+1,e?0:St(t,l,r.getPixelForValue(h),!0).hi+1),n,s)-n:o=s-n}return{start:n,count:o}}function rn(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}const le=i=>i===0||i===1,Hi=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*F/e)),ji=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*F/e)+1,Gt={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*B)+1,easeOutSine:i=>Math.sin(i*B),easeInOutSine:i=>-.5*(Math.cos(V*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>le(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>le(i)?i:Hi(i,.075,.3),easeOutElastic:i=>le(i)?i:ji(i,.075,.3),easeInOutElastic(i){return le(i)?i:i<.5?.5*Hi(i*2,.1125,.45):.5+.5*ji(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Gt.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Gt.easeInBounce(i*2)*.5:Gt.easeOutBounce(i*2-1)*.5+.5};/*! + * @kurkle/color v0.2.1 + * https://github.com/kurkle/color#readme + * (c) 2022 Jukka Kurkela + * Released under the MIT License + */function se(i){return i+.5|0}const ut=(i,t,e)=>Math.max(Math.min(i,e),t);function Xt(i){return ut(se(i*2.55),0,255)}function pt(i){return ut(se(i*255),0,255)}function ct(i){return ut(se(i/2.55)/100,0,1)}function $i(i){return ut(se(i*100),0,100)}const Z={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},oi=[..."0123456789ABCDEF"],po=i=>oi[i&15],mo=i=>oi[(i&240)>>4]+oi[i&15],ce=i=>(i&240)>>4===(i&15),bo=i=>ce(i.r)&&ce(i.g)&&ce(i.b)&&ce(i.a);function _o(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&Z[i[1]]*17,g:255&Z[i[2]]*17,b:255&Z[i[3]]*17,a:t===5?Z[i[4]]*17:255}:(t===7||t===9)&&(e={r:Z[i[1]]<<4|Z[i[2]],g:Z[i[3]]<<4|Z[i[4]],b:Z[i[5]]<<4|Z[i[6]],a:t===9?Z[i[7]]<<4|Z[i[8]]:255})),e}const xo=(i,t)=>i<255?t(i):"";function yo(i){var t=bo(i)?po:mo;return i?"#"+t(i.r)+t(i.g)+t(i.b)+xo(i.a,t):void 0}const vo=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function an(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function Mo(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function ko(i,t,e){const s=an(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function wo(i,t,e,s,n){return i===n?(t-e)/s+(t.5?h/(2-o-r):h/(o+r),l=wo(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function xi(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(pt)}function yi(i,t,e){return xi(an,i,t,e)}function So(i,t,e){return xi(ko,i,t,e)}function Po(i,t,e){return xi(Mo,i,t,e)}function ln(i){return(i%360+360)%360}function Do(i){const t=vo.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Xt(+t[5]):pt(+t[5]));const n=ln(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=So(n,o,r):t[1]==="hsv"?s=Po(n,o,r):s=yi(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function Co(i,t){var e=_i(i);e[0]=ln(e[0]+t),e=yi(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Oo(i){if(!i)return;const t=_i(i),e=t[0],s=$i(t[1]),n=$i(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${ct(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const Yi={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Xi={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Ao(){const i={},t=Object.keys(Xi),e=Object.keys(Yi);let s,n,o,r,a;for(s=0;s>16&255,o>>8&255,o&255]}return i}let he;function Lo(i){he||(he=Ao(),he.transparent=[0,0,0,0]);const t=he[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const To=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Ro(i){const t=To.exec(i);let e=255,s,n,o;if(!!t){if(t[7]!==s){const r=+t[7];e=t[8]?Xt(r):ut(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Xt(s):ut(s,0,255)),n=255&(t[4]?Xt(n):ut(n,0,255)),o=255&(t[6]?Xt(o):ut(o,0,255)),{r:s,g:n,b:o,a:e}}}function Eo(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${ct(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Ye=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Tt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Fo(i,t,e){const s=Tt(ct(i.r)),n=Tt(ct(i.g)),o=Tt(ct(i.b));return{r:pt(Ye(s+e*(Tt(ct(t.r))-s))),g:pt(Ye(n+e*(Tt(ct(t.g))-n))),b:pt(Ye(o+e*(Tt(ct(t.b))-o))),a:i.a+e*(t.a-i.a)}}function de(i,t,e){if(i){let s=_i(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=yi(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function cn(i,t){return i&&Object.assign(t||{},i)}function Ui(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=pt(i[3]))):(t=cn(i,{r:0,g:0,b:0,a:1}),t.a=pt(t.a)),t}function Io(i){return i.charAt(0)==="r"?Ro(i):Do(i)}class Se{constructor(t){if(t instanceof Se)return t;const e=typeof t;let s;e==="object"?s=Ui(t):e==="string"&&(s=_o(t)||Lo(t)||Io(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=cn(this._rgb);return t&&(t.a=ct(t.a)),t}set rgb(t){this._rgb=Ui(t)}rgbString(){return this._valid?Eo(this._rgb):void 0}hexString(){return this._valid?yo(this._rgb):void 0}hslString(){return this._valid?Oo(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=Fo(this._rgb,t._rgb,e)),this}clone(){return new Se(this.rgb)}alpha(t){return this._rgb.a=pt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=se(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return de(this._rgb,2,t),this}darken(t){return de(this._rgb,2,-t),this}saturate(t){return de(this._rgb,1,t),this}desaturate(t){return de(this._rgb,1,-t),this}rotate(t){return Co(this._rgb,t),this}}function hn(i){return new Se(i)}function dn(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ki(i){return dn(i)?i:hn(i)}function Xe(i){return dn(i)?i:hn(i).saturate(.5).darken(.1).hexString()}const Ct=Object.create(null),ri=Object.create(null);function Zt(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;se.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,s)=>Xe(s.backgroundColor),this.hoverBorderColor=(e,s)=>Xe(s.borderColor),this.hoverColor=(e,s)=>Xe(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return Ue(this,t,e)}get(t){return Zt(this,t)}describe(t,e){return Ue(ri,t,e)}override(t,e){return Ue(Ct,t,e)}route(t,e,s,n){const o=Zt(this,t),r=Zt(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return C(l)?Object.assign({},c,l):D(l,c)},set(l){this[a]=l}}})}}var A=new zo({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Bo(i){return!i||E(i.size)||E(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function Pe(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function Vo(i,t,e,s){s=s||{};let n=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},o=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let r=0;const a=e.length;let l,c,h,d,u;for(l=0;le.length){for(l=0;l0&&i.stroke()}}function te(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,Ho(i,o),l=0;l+i||0;function vi(i,t){const e={},s=C(t),n=s?Object.keys(t):t,o=C(i)?s?r=>D(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=Uo(o(r));return e}function fn(i){return vi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Pt(i){return vi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function U(i){const t=fn(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function $(i,t){i=i||{},t=t||A.font;let e=D(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=D(i.style,t.style);s&&!(""+s).match(Yo)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");const n={family:D(i.family,t.family),lineHeight:Xo(D(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:D(i.weight,t.weight),string:""};return n.string=Bo(n),n}function ue(i,t,e,s){let n=!0,o,r,a;for(o=0,r=i.length;oe&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function _t(i,t){return Object.assign(Object.create(i),t)}function Mi(i,t=[""],e=i,s,n=()=>i[0]){tt(s)||(s=bn("_fallback",i));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:e,_fallback:s,_getTarget:n,override:r=>Mi([r,...i],t,e,s)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete i[0][a],!0},get(r,a){return pn(r,a,()=>ir(a,t,i,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,a){return Zi(r).includes(a)},ownKeys(r){return Zi(r)},set(r,a,l){const c=r._storage||(r._storage=n());return r[a]=c[a]=l,delete r._keys,!0}})}function zt(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:gn(i,s),setContext:o=>zt(i,o,e,s),override:o=>zt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return pn(o,r,()=>Go(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function gn(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:bt(e)?e:()=>e,isIndexable:bt(s)?s:()=>s}}const qo=(i,t)=>i?i+pi(t):t,ki=(i,t)=>C(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function pn(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const s=e();return i[t]=s,s}function Go(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return bt(a)&&r.isScriptable(t)&&(a=Zo(t,a,i,e)),z(a)&&a.length&&(a=Jo(t,a,i,r.isIndexable)),ki(t,a)&&(a=zt(a,n,o&&o[t],r)),a}function Zo(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);return a.add(i),t=t(o,r||s),a.delete(i),ki(i,t)&&(t=wi(n._scopes,n,i,t)),t}function Jo(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(tt(o.index)&&s(i))t=t[o.index%t.length];else if(C(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=wi(c,n,i,h);t.push(zt(d,o,r&&r[i],a))}}return t}function mn(i,t,e){return bt(i)?i(t,e):i}const Qo=(i,t)=>i===!0?t:typeof i=="string"?mt(t,i):void 0;function tr(i,t,e,s,n){for(const o of t){const r=Qo(e,o);if(r){i.add(r);const a=mn(r._fallback,e,n);if(tt(a)&&a!==e&&a!==s)return a}else if(r===!1&&tt(s)&&e!==s)return null}return!1}function wi(i,t,e,s){const n=t._rootScopes,o=mn(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=Gi(a,r,e,o||e,s);return l===null||tt(o)&&o!==e&&(l=Gi(a,r,o,l,s),l===null)?!1:Mi(Array.from(a),[""],n,o,()=>er(t,e,s))}function Gi(i,t,e,s,n){for(;e;)e=tr(i,t,e,s,n);return e}function er(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return z(n)&&C(e)?e:n}function ir(i,t,e,s){let n;for(const o of t)if(n=bn(qo(o,i),e),tt(n))return ki(i,n)?wi(e,s,i,n):n}function bn(i,t){for(const e of t){if(!e)continue;const s=e[i];if(tt(s))return s}}function Zi(i){let t=i._keys;return t||(t=i._keys=sr(i._scopes)),t}function sr(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function _n(i,t,e,s){const{iScale:n}=i,{key:o="r"}=this._parsing,r=new Array(s);let a,l,c,h;for(a=0,l=s;ati==="x"?"y":"x";function or(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=ni(o,n),l=ni(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,u=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function rr(i,t,e){const s=i.length;let n,o,r,a,l,c=Bt(i,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")lr(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;owindow.getComputedStyle(i,null);function dr(i,t){return Ee(i).getPropertyValue(t)}const ur=["top","right","bottom","left"];function Dt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=ur[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const fr=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function gr(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(fr(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function kt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=Ee(e),o=n.boxSizing==="border-box",r=Dt(n,"padding"),a=Dt(n,"border","width"),{x:l,y:c,box:h}=gr(i,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-d)/f*e.width/s),y:Math.round((c-u)/g*e.height/s)}}function pr(i,t,e){let s,n;if(t===void 0||e===void 0){const o=Si(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=Ee(o),l=Dt(a,"border","width"),c=Dt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=De(a.maxWidth,o,"clientWidth"),n=De(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||we,maxHeight:n||we}}const Ke=i=>Math.round(i*10)/10;function mr(i,t,e,s){const n=Ee(i),o=Dt(n,"margin"),r=De(n.maxWidth,i,"clientWidth")||we,a=De(n.maxHeight,i,"clientHeight")||we,l=pr(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const d=Dt(n,"border","width"),u=Dt(n,"padding");c-=u.width+d.width,h-=u.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?Math.floor(c/s):h-o.height),c=Ke(Math.min(c,r,l.maxWidth)),h=Ke(Math.min(h,a,l.maxHeight)),c&&!h&&(h=Ke(c/2)),{width:c,height:h}}function Ji(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=n/s,i.width=o/s;const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const br=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function Qi(i,t){const e=dr(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function wt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function _r(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function xr(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=wt(i,n,e),a=wt(n,o,e),l=wt(o,t,e),c=wt(r,a,e),h=wt(a,l,e);return wt(c,h,e)}const ts=new Map;function yr(i,t){t=t||{};const e=i+JSON.stringify(t);let s=ts.get(e);return s||(s=new Intl.NumberFormat(i,t),ts.set(e,s)),s}function ne(i,t,e){return yr(t,e).format(i)}const vr=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},Mr=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Et(i,t,e){return i?vr(t,e):Mr()}function vn(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Mn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function kn(i){return i==="angle"?{between:Qt,compare:ao,normalize:G}:{between:ht,compare:(t,e)=>t-e,normalize:t=>t}}function es({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function kr(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=kn(s),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;ul(n,y,b)&&a(n,y)!==0,x=()=>a(o,b)===0||l(o,y,b),k=()=>p||v(),M=()=>!p||x();for(let S=h,w=h;S<=d;++S)_=t[S%r],!_.skip&&(b=c(_[s]),b!==y&&(p=l(b,n,o),m===null&&k()&&(m=a(b,n)===0?S:w),m!==null&&M()&&(g.push(es({start:m,end:S,loop:u,count:r,style:f})),m=null),w=S,y=b));return m!==null&&g.push(es({start:m,end:d,loop:u,count:r,style:f})),g}function Sn(i,t){const e=[],s=i.segments;for(let n=0;nn&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function Sr(i,t,e,s){const n=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function Pr(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=wr(e,n,o,s);if(s===!0)return is(i,[{start:r,end:a,loop:o}],e,t);const l=aa({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=en.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);!e||(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var at=new Or;const ns="transparent",Ar={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=Ki(i||ns),n=s.valid&&Ki(t||ns);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Lr{constructor(t,e,s,n){const o=e[s];n=ue([t.to,n,o,t.from]);const r=ue([t.from,o,n]);this._active=!0,this._fn=t.fn||Ar[t.type||typeof r],this._easing=Gt[t.easing]||Gt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ue([t.to,e,n,t.from]),this._from=ue([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;ni!=="onProgress"&&i!=="onComplete"&&i!=="fn"});A.set("animations",{colors:{type:"color",properties:Rr},numbers:{type:"number",properties:Tr}});A.describe("animations",{_fallback:"animation"});A.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:i=>i|0}}}});class Pn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!C(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const n=t[s];if(!C(n))return;const o={};for(const r of Er)o[r]=n[r];(z(n.properties)&&n.properties||[s]).forEach(r=>{(r===s||!e.has(r))&&e.set(r,o)})})}_animateOptions(t,e){const s=e.options,n=Ir(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Fr(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new Lr(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return at.add(this._chart,s),!0}}function Fr(i,t){const e=[],s=Object.keys(t);for(let n=0;n0||!e&&o<0)return n.index}return null}function cs(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=Nr(o,r,s),d=t.length;let u;for(let f=0;fe[s].axis===t).shift()}function jr(i,t){return _t(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function $r(i,t,e){return _t(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Wt(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(!!s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e]}}}const Ge=i=>i==="reset"||i==="none",hs=(i,t)=>t?i:Object.assign({},i),Yr=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:Dn(e,!0),values:null};class it{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=as(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Wt(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,u,f,g)=>d==="x"?u:d==="r"?g:f,o=e.xAxisID=D(s.xAxisID,qe(t,"x")),r=e.yAxisID=D(s.yAxisID,qe(t,"y")),a=e.rAxisID=D(s.rAxisID,qe(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Wi(this._data,this),t._stacked&&Wt(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(C(e))this._data=Vr(e);else if(s!==e){if(s){Wi(s,this);const n=this._cachedMeta;Wt(n),n._parsed=[]}e&&Object.isExtensible(e)&&uo(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=as(e.vScale,e),e.stack!==s.stack&&(n=!0,Wt(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&cs(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,u;if(this._parsing===!1)s._parsed=n,s._sorted=!0,u=n;else{z(n[t])?u=this.parseArrayData(s,n,t,e):C(n[t])?u=this.parseObjectData(s,n,t,e):u=this.parsePrimitiveData(s,n,t,e);const f=()=>d[a]===null||c&&d[a]p||d=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n=0&&tthis.getContext(s,n),p=c.resolveNamedOptions(u,f,g,d);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(hs(p,l))),p}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,e))}const c=new Pn(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(!!t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ge(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:r}}updateElement(t,e,s,n){Ge(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!Ge(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;an-o))}return i._cache.$bar}function Ur(i){const t=i.iScale,e=Xr(t,i.type);let s=t._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(tt(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(n=0,o=e.length;n0?n[i-1]:null,a=iMath.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:r,max:a}}function Cn(i,t,e,s){return z(i)?Gr(i,t,e,s):t[e.axis]=e.parse(i,s),t}function ds(i,t,e,s){const n=i.iScale,o=i.vScale,r=n.getLabels(),a=n===o,l=[];let c,h,d,u;for(c=e,h=e+s;c=e?1:-1)}function Jr(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.basel.controller.options.grouped),o=s.options.stacked,r=[],a=l=>{const c=l.controller.getParsed(e),h=c&&c[l.vScale.axis];if(E(h)||isNaN(h))return!0};for(const l of n)if(!(e!==void 0&&a(l))&&((o===!1||r.indexOf(l.stack)===-1||o===void 0&&l.stack===void 0)&&r.push(l.stack),l.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,s){const n=this._getStacks(t,s),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,s=e.iScale,n=[];let o,r;for(o=0,r=e.data.length;o=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:s,yScale:n}=e,o=this.getParsed(t),r=s.getLabelForValue(o.x),a=n.getLabelForValue(o.y),l=o._custom;return{label:e.label,value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:c}=this._getSharedOptions(e,n),h=r.axis,d=a.axis;for(let u=e;uQt(y,a,l,!0)?1:Math.max(v,v*e,x,x*e),g=(y,v,x)=>Qt(y,a,l,!0)?-1:Math.min(v,v*e,x,x*e),p=f(0,c,d),m=f(B,h,u),b=g(V,c,d),_=g(V+B,h,u);s=(p-b)/2,n=(m-_)/2,o=-(p+b)/2,r=-(m+_)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:r}}class oe extends it{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=l=>+s[l];if(C(s[t])){const{key:l="value"}=this._parsing;o=c=>+mt(s[c],l)}let r,a;for(r=t,a=t+e;r0&&!isNaN(t)?F*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=ne(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,o,r,a,l;if(!t){for(n=0,o=s.data.datasets.length;ni!=="spacing",_indexable:i=>i!=="spacing"};oe.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((s,n)=>{const r=i.getDatasetMeta(0).controller.getStyle(n);return{text:s,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(n),index:n}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){let t=i.label;const e=": "+i.formattedValue;return z(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};class Fe extends it{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=on(e,n,r);this._drawStart=a,this._drawCount=l,rn(e)&&(a=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,{sharedOptions:h,includeOptions:d}=this._getSharedOptions(e,n),u=r.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=Ft(g)?g:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||n==="none";let _=e>0&&this.getParsed(e-1);for(let y=e;y0&&Math.abs(x[u]-_[u])>m,p&&(k.parsed=x,k.raw=c.data[y]),d&&(k.options=h||this.resolveDataElementOptions(y,v.active?"active":n)),b||this.updateElement(v,y,k,n),_=x}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Fe.id="line";Fe.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Fe.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class Ci extends it{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=ne(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return _n.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,n)=>{const o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(oe.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),r=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,s,n){const o=n==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*V;let f=u,g;const p=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?et(this.resolveDataElementOptions(t,e).angle||s):0}}Ci.id="polarArea";Ci.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ci.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((s,n)=>{const r=i.getDatasetMeta(0).controller.getStyle(n);return{text:s,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(n),index:n}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){return i.chart.data.labels[i.dataIndex]+": "+i.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class On extends oe{}On.id="pie";On.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Oi extends it{getLabelAndValue(t){const e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,n){return _n.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta,s=e.dataset,n=e.data||[],o=e.iScale.getLabels();if(s.points=n,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===n.length,options:r};this.updateElement(s,void 0,a,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,s,n){const o=this._cachedMeta.rScale,r=n==="reset";for(let a=e;a{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}rt.defaults={};rt.defaultRoutes=void 0;const An={values(i){return z(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=sa(i,e)}const r=Q(Math.abs(o)),a=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),ne(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=i/Math.pow(10,Math.floor(Q(i)));return s===1||s===2||s===5?An.numeric.call(this,i,t,e):""}};function sa(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Ie={formatters:An};A.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ie.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});A.route("scale.ticks","color","","color");A.route("scale.grid","color","","borderColor");A.route("scale.grid","borderColor","","borderColor");A.route("scale.title","color","","color");A.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"});A.describe("scales",{_fallback:"scale"});A.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"});function na(i,t){const e=i.options.ticks,s=e.maxTicksLimit||oa(i),n=e.major.enabled?aa(t):[],o=n.length,r=n[0],a=n[o-1],l=[];if(o>s)return la(t,l,n,o/s),l;const c=ra(n,t,s);if(o>0){let h,d;const u=o>1?Math.round((a-r)/(o-1)):null;for(ge(t,l,c,E(u)?0:r-u,r),h=0,d=o-1;hn)return l}return Math.max(n,1)}function aa(i){const t=[];let e,s;for(e=0,s=i.length;ei==="left"?"right":i==="right"?"left":i,gs=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e;function ps(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;or+a)))return l}function ua(i,t){R(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;os?s:e,s=n&&e>s?e:s,{min:J(e,J(s,e)),max:J(s,J(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){I(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Ko(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=Y(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),d+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-Ht(t.grid)-e.padding-ms(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=mi(Math.min(Math.asin(Y((h.highest.height+6)/a,-1,1)),Math.asin(Y(l/c,-1,1))-Math.asin(Y(u/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){I(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){I(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=ms(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=Ht(o)+l):(t.height=this.maxHeight,t.width=Ht(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,g=et(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){const b=s.mirror?0:m*d.width+p*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=s.mirror?0:p*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,m,p)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){I(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e({width:o[M]||0,height:r[M]||0});return{first:k(0),last:k(e-1),widest:k(v),highest:k(x),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return lo(this._alignToPixels?vt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*n?a/s:l/n:l*n0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r}=n,a=o.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),d=Ht(o),u=[],f=o.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,p=g/2,m=function(P){return vt(s,P,g)};let b,_,y,v,x,k,M,S,w,L,T,O;if(r==="top")b=m(this.bottom),k=this.bottom-d,S=b-p,L=m(t.top)+p,O=t.bottom;else if(r==="bottom")b=m(this.top),L=t.top,O=m(t.bottom)-p,k=b+p,S=this.top+d;else if(r==="left")b=m(this.right),x=this.right-d,M=b-p,w=m(t.left)+p,T=t.right;else if(r==="right")b=m(this.left),w=t.left,T=m(t.right)-p,x=b+p,M=this.left+d;else if(e==="x"){if(r==="center")b=m((t.top+t.bottom)/2+.5);else if(C(r)){const P=Object.keys(r)[0],j=r[P];b=m(this.chart.scales[P].getPixelForValue(j))}L=t.top,O=t.bottom,k=b+p,S=k+d}else if(e==="y"){if(r==="center")b=m((t.left+t.right)/2);else if(C(r)){const P=Object.keys(r)[0],j=r[P];b=m(this.chart.scales[P].getPixelForValue(j))}x=b-p,M=x-d,w=t.left,T=t.right}const H=D(n.ticks.maxTicksLimit,h),X=Math.max(1,Math.ceil(h/H));for(_=0;_o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o{this.draw(n)}}]:[{z:s,draw:n=>{this.drawBackground(),this.drawGrid(n),this.drawTitle()}},{z:s+1,draw:()=>{this.drawBorder()}},{z:e,draw:n=>{this.drawLabels(n)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");A.route(o,n,l,a)})}function xa(i){return"id"in i&&"defaults"in i}class ya{constructor(){this.controllers=new pe(it,"datasets",!0),this.elements=new pe(rt,"elements"),this.plugins=new pe(Object,"plugins"),this.scales=new pe(Ot,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):R(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=pi(t);I(s["before"+n],[],s),e[t](s),I(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;e0&&this.getParsed(e-1);for(let v=e;v0&&Math.abs(k[f]-y[f])>b,m&&(M.parsed=k,M.raw=c.data[v]),u&&(M.options=d||this.resolveDataElementOptions(v,x.active?"active":n)),_||this.updateElement(x,v,M,n),y=k}this.updateSharedOptions(d,n,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.data||[];if(!this.options.showLine){let a=0;for(let l=e.length-1;l>=0;--l)a=Math.max(a,e[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const s=t.dataset,n=s.options&&s.options.borderWidth||0;if(!e.length)return n;const o=e[0].size(this.resolveDataElementOptions(0)),r=e[e.length-1].size(this.resolveDataElementOptions(e.length-1));return Math.max(n,o,r)/2}}Ai.id="scatter";Ai.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Ai.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(i){return"("+i.label+", "+i.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Mt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class li{constructor(t){this.options=t||{}}init(t){}formats(){return Mt()}parse(t,e){return Mt()}format(t,e){return Mt()}add(t,e,s){return Mt()}diff(t,e,s){return Mt()}startOf(t,e,s){return Mt()}endOf(t,e){return Mt()}}li.override=function(i){Object.assign(li.prototype,i)};var va={_date:li};function Ma(i,t,e,s){const{controller:n,data:o,_sorted:r}=i,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?co:St;if(s){if(n._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,e-h),u=l(o,t,e+h);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function re(i,t,e,s,n){const o=i.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a{l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var Pa={evaluateInteractionItems:re,modes:{index(i,t,e,s){const n=kt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?Je(i,n,o,s,r):Qe(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=kt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?Je(i,n,o,s,r):Qe(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function _s(i,t){return i.filter(e=>Ln.indexOf(e.pos)===-1&&e.box.axis===t)}function $t(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Da(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;ec.box.fullSize),!0),s=$t(jt(t,"left"),!0),n=$t(jt(t,"right")),o=$t(jt(t,"top"),!0),r=$t(jt(t,"bottom")),a=_s(t,"x"),l=_s(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:jt(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function xs(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function Tn(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function La(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!C(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&Tn(r,o.getPadding());const a=Math.max(0,t.outerWidth-xs(r,i,"left","right")),l=Math.max(0,t.outerHeight-xs(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Ta(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function Ra(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function Ut(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);Tn(u,U(s));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),g=Oa(l.concat(c),d);Ut(a.fullSize,f,d,g),Ut(l,f,d,g),Ut(c,f,d,g)&&Ut(l,f,d,g),Ta(f),ys(a.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,ys(a.rightAndBottom,f,d,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},R(a.chartArea,p=>{const m=p.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Rn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class Ea extends Rn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const ye="$chartjs",Fa={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},vs=i=>i===null||i==="";function Ia(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[ye]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",vs(n)){const o=Qi(i,"width");o!==void 0&&(i.width=o)}if(vs(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Qi(i,"height");o!==void 0&&(i.height=o)}return i}const En=br?{passive:!0}:!1;function za(i,t,e){i.addEventListener(t,e,En)}function Ba(i,t,e){i.canvas.removeEventListener(t,e,En)}function Va(i,t){const e=Fa[i.type]||i.type,{x:s,y:n}=kt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Ce(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function Na(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ce(a.addedNodes,s),r=r&&!Ce(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Wa(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Ce(a.removedNodes,s),r=r&&!Ce(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const ie=new Map;let Ms=0;function Fn(){const i=window.devicePixelRatio;i!==Ms&&(Ms=i,ie.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Ha(i,t){ie.size||window.addEventListener("resize",Fn),ie.set(i,t)}function ja(i){ie.delete(i),ie.size||window.removeEventListener("resize",Fn)}function $a(i,t,e){const s=i.canvas,n=s&&Si(s);if(!n)return;const o=sn((a,l)=>{const c=n.clientWidth;e(a,l),c{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),Ha(i,o),r}function ti(i,t,e){e&&e.disconnect(),t==="resize"&&ja(i)}function Ya(i,t,e){const s=i.canvas,n=sn(o=>{i.ctx!==null&&e(Va(o,i))},i,o=>{const r=o[0];return[r,r.offsetX,r.offsetY]});return za(s,t,n),n}class Xa extends Rn{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(Ia(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[ye])return!1;const s=e[ye].initial;["height","width"].forEach(o=>{const r=s[o];E(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[ye],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Na,detach:Wa,resize:$a}[e]||Ya;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ti,detach:ti,resize:ti}[e]||Ba)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return mr(t,e,s,n)}isAttached(t){const e=Si(t);return!!(e&&e.isConnected)}}function Ua(i){return!yn()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?Ea:Xa}class Ka{constructor(){this._init=[]}notify(t,e,s,n){e==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install"));const o=n?this._descriptors(t).filter(n):this._descriptors(t),r=this._notify(o,t,e,s);return e==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall")),r}_notify(t,e,s,n){n=n||{};for(const o of t){const r=o.plugin,a=r[s],l=[e,n,o.options];if(I(a,l,r)===!1&&n.cancelable)return!1}return!0}invalidate(){E(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const e=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),e}_createDescriptors(t,e){const s=t&&t.config,n=D(s.options&&s.options.plugins,{}),o=qa(s);return n===!1&&!e?[]:Za(t,o,n,e)}_notifyStateChanges(t){const e=this._oldCache||[],s=this._cache,n=(o,r)=>o.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function qa(i){const t={},e=[],s=Object.keys(nt.plugins.items);for(let o=0;o{const l=s[a];if(!C(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=hi(a,l),h=tl(c,n),d=e.scales||{};o[c]=o[c]||a,r[a]=Kt(Object.create(null),[{axis:c},l,d[c],d[h]])}),i.data.datasets.forEach(a=>{const l=a.type||i.type,c=a.indexAxis||ci(l,t),d=(Ct[l]||{}).scales||{};Object.keys(d).forEach(u=>{const f=Qa(u,c),g=a[f+"AxisID"]||o[f]||f;r[g]=r[g]||Object.create(null),Kt(r[g],[{axis:f},s[g],d[u]])})}),Object.keys(r).forEach(a=>{const l=r[a];Kt(l,[A.scales[l.type],A.scale])}),r}function In(i){const t=i.options||(i.options={});t.plugins=D(t.plugins,{}),t.scales=il(i,t)}function zn(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function sl(i){return i=i||{},i.data=zn(i.data),In(i),i}const ks=new Map,Bn=new Set;function be(i,t){let e=ks.get(i);return e||(e=t(),ks.set(i,e),Bn.add(e)),e}const Yt=(i,t,e)=>{const s=mt(t,e);s!==void 0&&i.add(s)};class nl{constructor(t){this._config=sl(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=zn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),In(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return be(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return be(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return be(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return be(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Yt(l,t,d))),h.forEach(d=>Yt(l,n,d)),h.forEach(d=>Yt(l,Ct[o]||{},d)),h.forEach(d=>Yt(l,A,d)),h.forEach(d=>Yt(l,ri,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Bn.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ct[e]||{},A.datasets[e]||{},{type:e},A,ri]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=ws(this._resolverCache,t,n);let l=r;if(rl(r,e)){o.$shared=!1,s=bt(s)?s():s;const c=this.createResolver(t,s,a);l=zt(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=ws(this._resolverCache,t,s);return C(e)?zt(o,e,void 0,n):o}}function ws(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:Mi(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const ol=i=>C(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||bt(i[e]),!1);function rl(i,t){const{isScriptable:e,isIndexable:s}=gn(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(bt(a)||ol(a))||r&&z(a))return!0}return!1}var al="3.9.1";const ll=["top","bottom","left","right","chartArea"];function Ss(i,t){return i==="top"||i==="bottom"||ll.indexOf(i)===-1&&t==="x"}function Ps(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Ds(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),I(e&&e.onComplete,[i],t)}function cl(i){const t=i.chart,e=t.options.animation;I(e&&e.onProgress,[i],t)}function Vn(i){return yn()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Oe={},Nn=i=>{const t=Vn(i);return Object.values(Oe).filter(e=>e.canvas===t).pop()};function hl(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function dl(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}class Li{constructor(t,e){const s=this.config=new nl(e),n=Vn(t),o=Nn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Ua(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Gn(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ka,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=fo(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],Oe[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}at.listen(this,"complete",Ds),at.listen(this,"progress",cl),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return E(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ji(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return qi(this.canvas,this.ctx),this}stop(){return at.stop(this),this}resize(t,e){at.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Ji(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),I(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};R(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=hi(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),R(o,r=>{const a=r.options,l=a.id,c=hi(l,a),h=D(a.type,r.dtype);(a.position===void 0||Ss(a.position,c)!==Ss(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const u=nt.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),R(n,(r,a)=>{r||delete s[a]}),R(s,r=>{ft.configure(this,r,r.options),ft.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ps("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){R(this.scales,t=>{ft.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!zi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;hl(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ft.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],R(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=this.chartArea,r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&Te(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&Re(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return te(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=Pa.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=_t(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);tt(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),at.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};R(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){R(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},R(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Me(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=io(t),c=dl(t,this._lastEvent,s,l);s&&(this._lastEvent=null,I(o.onHover,[t,a,this],this),l&&I(o.onClick,[t,a,this],this));const h=!Me(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}const Cs=()=>R(Li.instances,i=>i._plugins.invalidate()),dt=!0;Object.defineProperties(Li,{defaults:{enumerable:dt,value:A},instances:{enumerable:dt,value:Oe},overrides:{enumerable:dt,value:Ct},registry:{enumerable:dt,value:nt},version:{enumerable:dt,value:al},getChart:{enumerable:dt,value:Nn},register:{enumerable:dt,value:(...i)=>{nt.add(...i),Cs()}},unregister:{enumerable:dt,value:(...i)=>{nt.remove(...i),Cs()}}});function Wn(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=n/a;i.beginPath(),i.arc(o,r,a,s-c,e+c),l>n?(c=n/l,i.arc(o,r,l,e+c,s-c,!0)):i.arc(o,r,n,e+B,s-B),i.closePath(),i.clip()}function ul(i){return vi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function fl(i,t,e,s){const n=ul(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,s*t/2),a=l=>{const c=(e-Math.min(o,l))*s/2;return Y(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:Y(n.innerStart,0,r),innerEnd:Y(n.innerEnd,0,r)}}function Rt(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function di(i,t,e,s,n,o){const{x:r,y:a,startAngle:l,pixelMargin:c,innerRadius:h}=t,d=Math.max(t.outerRadius+s+e-c,0),u=h>0?h+s+e+c:0;let f=0;const g=n-l;if(s){const P=h>0?h-s:0,j=d>0?d-s:0,N=(P+j)/2,yt=N!==0?g*N/(N+s):g;f=(g-yt)/2}const p=Math.max(.001,g*d-e/V)/d,m=(g-p)/2,b=l+m+f,_=n-m-f,{outerStart:y,outerEnd:v,innerStart:x,innerEnd:k}=fl(t,u,d,_-b),M=d-y,S=d-v,w=b+y/M,L=_-v/S,T=u+x,O=u+k,H=b+x/T,X=_-k/O;if(i.beginPath(),o){if(i.arc(r,a,d,w,L),v>0){const N=Rt(S,L,r,a);i.arc(N.x,N.y,v,L,_+B)}const P=Rt(O,_,r,a);if(i.lineTo(P.x,P.y),k>0){const N=Rt(O,X,r,a);i.arc(N.x,N.y,k,_+B,X+Math.PI)}if(i.arc(r,a,u,_-k/u,b+x/u,!0),x>0){const N=Rt(T,H,r,a);i.arc(N.x,N.y,x,H+Math.PI,b-B)}const j=Rt(M,b,r,a);if(i.lineTo(j.x,j.y),y>0){const N=Rt(M,w,r,a);i.arc(N.x,N.y,y,b-B,w)}}else{i.moveTo(r,a);const P=Math.cos(w)*d+r,j=Math.sin(w)*d+a;i.lineTo(P,j);const N=Math.cos(L)*d+r,yt=Math.sin(L)*d+a;i.lineTo(N,yt)}i.closePath()}function gl(i,t,e,s,n){const{fullCircles:o,startAngle:r,circumference:a}=t;let l=t.endAngle;if(o){di(i,t,e,s,r+F,n);for(let c=0;c=F||Qt(o,a,l),p=ht(r,c+u,h+u);return g&&p}getCenterPoint(t){const{x:e,y:s,startAngle:n,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(n+o)/2,d=(r+a+c+l)/2;return{x:e+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:s}=this,n=(e.offset||0)/2,o=(e.spacing||0)/2,r=e.circular;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=s>F?Math.floor(s/F):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let a=0;if(n){a=n/2;const c=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(c)*a,Math.sin(c)*a),this.circumference>=V&&(a=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const l=gl(t,this,a,o,r);ml(t,this,a,o,l,r),t.restore()}}Ti.id="arc";Ti.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};Ti.defaultRoutes={backgroundColor:"backgroundColor"};function Hn(i,t,e=t){i.lineCap=D(e.borderCapStyle,t.borderCapStyle),i.setLineDash(D(e.borderDash,t.borderDash)),i.lineDashOffset=D(e.borderDashOffset,t.borderDashOffset),i.lineJoin=D(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=D(e.borderWidth,t.borderWidth),i.strokeStyle=D(e.borderColor,t.borderColor)}function bl(i,t,e){i.lineTo(e.x,e.y)}function _l(i){return i.stepped?No:i.tension||i.cubicInterpolationMode==="monotone"?Wo:bl}function jn(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=na&&o>a;return{count:s,start:l,loop:t.loop,ilen:c(r+(c?a-v:v))%o,y=()=>{p!==m&&(i.lineTo(h,m),i.lineTo(h,p),i.lineTo(h,b))};for(l&&(f=n[_(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[_(u)],f.skip)continue;const v=f.x,x=f.y,k=v|0;k===g?(xm&&(m=x),h=(d*h+v)/++d):(y(),i.lineTo(v,x),g=k,d=0,p=m=x),b=x}y()}function ui(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?yl:xl}function vl(i){return i.stepped?_r:i.tension||i.cubicInterpolationMode==="monotone"?xr:wt}function Ml(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Hn(i,t.options),i.stroke(n)}function kl(i,t,e,s){const{segments:n,options:o}=t,r=ui(t);for(const a of n)Hn(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const wl=typeof Path2D=="function";function Sl(i,t,e,s){wl&&!t.options.segment?Ml(i,t,e,s):kl(i,t,e,s)}class xt extends rt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;hr(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Pr(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=Sn(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=vl(s);let c,h;for(c=0,h=r.length;ci!=="borderDash"&&i!=="fill"};function Os(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o){a=Ei(r,a,n);const l=n[r],c=n[a];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Ei(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function As(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function Yn(i,t){let e=[],s=!1;return z(i)?(s=!0,e=i):e=Tl(i,t),e.length?new xt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Ls(i){return i&&i.fill!==!1}function Rl(i,t,e){let n=i[t].fill;const o=[t];let r;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!W(n))return n;if(r=i[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function El(i,t,e){const s=Bl(i);if(C(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return W(n)&&Math.floor(n)===n?Fl(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Fl(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function Il(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:C(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function zl(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:C(i)?s=i.value:s=t.getBaseValue(),s}function Bl(i){const t=i.options,e=t.fill;let s=D(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function Vl(i){const{scale:t,index:e,line:s}=i,n=[],o=s.segments,r=s.points,a=Nl(t,e);a.push(Yn({x:null,y:t.bottom},s));for(let l=0;l=0;--r){const a=n[r].$filler;!a||(a.line.updateControlPoints(o,a.axis),s&&a.fill&&si(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const o=s[n].$filler;Ls(o)&&si(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!Ls(s)||e.drawTime!=="beforeDatasetDraw"||si(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Fs=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},Zl=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Is extends rt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=I(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=$(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Fs(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,o,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((g,p)=>{const m=s+e/2+o.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(p>0?0:1)]=0,f+=h,u++),l[p]={left:0,top:f,row:u,width:m,height:n},c[c.length-1]+=m+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{const _=s+e/2+o.measureText(m.text).width;b>0&&f+n+2*a>h&&(d+=u+a,c.push({width:u,height:f}),g+=u+a,p++,u=f=0),l[b]={left:g,top:f,col:p,width:_,height:n},u=Math.max(u,_),f+=n+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=Et(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=q(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=q(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=q(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=q(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Te(t,this),this._draw(),Re(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=A.color,l=Et(t.rtl,this.left,this.width),c=$(r.font),{color:h,padding:d}=r,u=c.size,f=u/2;let g;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:b}=Fs(r,u),_=function(M,S,w){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;n.save();const L=D(w.lineWidth,1);if(n.fillStyle=D(w.fillStyle,a),n.lineCap=D(w.lineCap,"butt"),n.lineDashOffset=D(w.lineDashOffset,0),n.lineJoin=D(w.lineJoin,"miter"),n.lineWidth=L,n.strokeStyle=D(w.strokeStyle,a),n.setLineDash(D(w.lineDash,[])),r.usePointStyle){const T={radius:m*Math.SQRT2/2,pointStyle:w.pointStyle,rotation:w.rotation,borderWidth:L},O=l.xPlus(M,p/2),H=S+f;un(n,T,O,H,r.pointStyleWidth&&p)}else{const T=S+Math.max((u-m)/2,0),O=l.leftForLtr(M,p),H=Pt(w.borderRadius);n.beginPath(),Object.values(H).some(X=>X!==0)?ee(n,{x:O,y:T,w:p,h:m,radius:H}):n.rect(O,T,p,m),n.fill(),L!==0&&n.stroke()}n.restore()},y=function(M,S,w){It(n,w.text,M,S+b/2,c,{strikethrough:w.hidden,textAlign:l.textAlign(w.textAlign)})},v=this.isHorizontal(),x=this._computeTitleHeight();v?g={x:q(o,this.left+d,this.right-s[0]),y:this.top+d+x,line:0}:g={x:this.left+d,y:q(o,this.top+x+d,this.bottom-e[0].height),line:0},vn(this.ctx,t.textDirection);const k=b+d;this.legendItems.forEach((M,S)=>{n.strokeStyle=M.fontColor||h,n.fillStyle=M.fontColor||h;const w=n.measureText(M.text).width,L=l.textAlign(M.textAlign||(M.textAlign=r.textAlign)),T=p+f+w;let O=g.x,H=g.y;l.setWidth(this.width),v?S>0&&O+T+d>this.right&&(H=g.y+=k,g.line++,O=g.x=q(o,this.left+d,this.right-s[g.line])):S>0&&H+k>this.bottom&&(O=g.x=O+e[g.line].width+d,g.line++,H=g.y=q(o,this.top+x+d,this.bottom-e[g.line].height));const X=l.x(O);_(X,H,M),O=go(L,O+p+f,v?O+T:this.right,t.rtl),y(l.x(O),H,M),v?g.x+=T+d:g.y+=k}),Mn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=$(e.font),n=U(e.padding);if(!e.display)return;const o=Et(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=q(t.align,d,this.right-u);else{const g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);h=c+q(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=q(a,d,d+u);r.textAlign=o.textAlign(nn(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,It(r,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=$(t.font),s=U(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(ht(t,this.left,this.right)&&ht(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;si.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o}}=i.legend.options;return i._getSortedDatasetMetas().map(r=>{const a=r.controller.getStyle(e?0:void 0),l=U(a.borderWidth);return{text:t[r.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!r.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:0,datasetIndex:r.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};const ve={average(i){if(!i.length)return!1;let t,e,s=0,n=0,o=0;for(t=0,e=i.length;t-1?i.split(` +`):i}function tc(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function zs(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=$(t.bodyFont),c=$(t.titleFont),h=$(t.footerFont),d=o.length,u=n.length,f=s.length,g=U(t.padding);let p=g.height,m=0,b=s.reduce((v,x)=>v+x.before.length+x.lines.length+x.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const v=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*v+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(p+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let _=0;const y=function(v){m=Math.max(m,e.measureText(v).width+_)};return e.save(),e.font=c.string,R(i.title,y),e.font=l.string,R(i.beforeBody.concat(i.afterBody),y),_=t.displayColors?r+2+t.boxPadding:0,R(s,v=>{R(v.before,y),R(v.lines,y),R(v.after,y)}),_=0,e.font=h.string,R(i.footer,y),e.restore(),m+=g.width,{width:m,height:p}}function ec(i,t){const{y:e,height:s}=t;return ei.height-s/2?"bottom":"center"}function ic(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function sc(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),ic(c,i,t,e)&&(c="center"),c}function Bs(i,t,e){const s=e.yAlign||t.yAlign||ec(i,e);return{xAlign:e.xAlign||t.xAlign||sc(i,t,e,s),yAlign:s}}function nc(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function oc(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Vs(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Pt(r);let g=nc(t,a);const p=oc(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,u)+n:a==="right"&&(g+=Math.max(d,f)+n),{x:Y(g,0,s.width-t.width),y:Y(p,0,s.height-t.height)}}function _e(i,t,e){const s=U(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Ns(i){return st([],lt(i))}function rc(i,t,e){return _t(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ws(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}class ac extends rt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new Pn(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=rc(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=s.beforeTitle.apply(this,[t]),o=s.title.apply(this,[t]),r=s.afterTitle.apply(this,[t]);let a=[];return a=st(a,lt(n)),a=st(a,lt(o)),a=st(a,lt(r)),a}getBeforeBody(t,e){return Ns(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:s}=e,n=[];return R(t,o=>{const r={before:[],lines:[],after:[]},a=Ws(s,o);st(r.before,lt(a.beforeLabel.call(this,o))),st(r.lines,a.label.call(this,o)),st(r.after,lt(a.afterLabel.call(this,o))),n.push(r)}),n}getAfterBody(t,e){return Ns(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:s}=e,n=s.beforeFooter.apply(this,[t]),o=s.footer.apply(this,[t]),r=s.afterFooter.apply(this,[t]);let a=[];return a=st(a,lt(n)),a=st(a,lt(o)),a=st(a,lt(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;lt.filter(h,d,u,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),R(a,h=>{const d=Ws(t.callbacks,h);n.push(d.labelColor.call(this,h)),o.push(d.labelPointStyle.call(this,h)),r.push(d.labelTextColor.call(this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=ve[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=zs(this,s),c=Object.assign({},a,l),h=Bs(this.chart,s,c),d=Vs(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Pt(a),{x:u,y:f}=t,{width:g,height:p}=e;let m,b,_,y,v,x;return o==="center"?(v=f+p/2,n==="left"?(m=u,b=m-r,y=v+r,x=v-r):(m=u+g,b=m+r,y=v-r,x=v+r),_=m):(n==="left"?b=u+Math.max(l,h)+r:n==="right"?b=u+g-Math.max(c,d)-r:b=this.caretX,o==="top"?(y=f,v=y-r,m=b-r,_=b+r):(y=f+p,v=y+r,m=b+r,_=b-r),x=y),{x1:m,x2:b,x3:_,y1:y,y2:v,y3:x}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=Et(s.rtl,this.x,this.width);for(t.x=_e(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=$(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ee(t,{x:m,y:p,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ee(t,{x:b,y:p+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=$(s.bodyFont);let u=d.lineHeight,f=0;const g=Et(s.rtl,this.x,this.width),p=function(S){e.fillText(S,g.x(t.x+f),t.y+u/2),t.y+=u+o},m=g.textAlign(r);let b,_,y,v,x,k,M;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=_e(this,m,s),e.fillStyle=s.bodyColor,R(this.beforeBody,p),f=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,v=0,k=n.length;v0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=ve[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=zs(this,t),l=Object.assign({},r,this._size),c=Bs(e,t,l),h=Vs(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=U(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),vn(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Mn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Me(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!Me(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=ve[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}ac.positioners=ve;const lc=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function cc(i,t,e,s){const n=i.indexOf(t);if(n===-1)return lc(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const hc=(i,t)=>i===null?null:Y(Math.round(i),0,t);class Ae extends Ot{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(E(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:cc(s,t,D(e,t),this._addedLabels),hc(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Ae.id="category";Ae.defaults={ticks:{callback:Ae.prototype.getLabelForValue}};function dc(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,g=h-1,{min:p,max:m}=t,b=!E(r),_=!E(a),y=!E(c),v=(m-p)/(d+1);let x=Vi((m-p)/g/f)*f,k,M,S,w;if(x<1e-14&&!b&&!_)return[{value:p},{value:m}];w=Math.ceil(m/x)-Math.floor(p/x),w>g&&(x=Vi(w*x/g/f)*f),E(l)||(k=Math.pow(10,l),x=Math.ceil(x*k)/k),n==="ticks"?(M=Math.floor(p/x)*x,S=Math.ceil(m/x)*x):(M=p,S=m),b&&_&&o&&ro((a-r)/o,x/1e3)?(w=Math.round(Math.min((a-r)/x,h)),x=(a-r)/w,M=r,S=a):y?(M=b?r:M,S=_?a:S,w=c-1,x=(S-M)/w):(w=(S-M)/x,qt(w,Math.round(w),x/1e3)?w=Math.round(w):w=Math.ceil(w));const L=Math.max(Ni(x),Ni(M));k=Math.pow(10,E(l)?L:l),M=Math.round(M*k)/k,S=Math.round(S*k)/k;let T=0;for(b&&(u&&M!==r?(e.push({value:r}),Mn=e?n:l,a=l=>o=s?o:l;if(t){const l=ot(n),c=ot(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=1;(o>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(o*.05)),a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=dc(n,o);return t.bounds==="ticks"&&Zs(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return ne(t,this.chart.options.locale,this.options.ticks.format)}}class Fi extends Le{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?t:0,this.max=W(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=et(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Fi.id="linear";Fi.defaults={ticks:{callback:Ie.formatters.numeric}};function js(i){return i/Math.pow(10,Math.floor(Q(i)))===1}function uc(i,t){const e=Math.floor(Q(t.max)),s=Math.ceil(t.max/Math.pow(10,e)),n=[];let o=J(i.min,Math.pow(10,Math.floor(Q(t.min)))),r=Math.floor(Q(o)),a=Math.floor(o/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do n.push({value:o,major:js(o)}),++a,a===10&&(a=1,++r,l=r>=0?1:l),o=Math.round(a*Math.pow(10,r)*l)/l;while(r0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?Math.max(0,t):null,this.max=W(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,n=this.max;const o=l=>s=t?s:l,r=l=>n=e?n:l,a=(l,c)=>Math.pow(10,Math.floor(Q(l))+c);s===n&&(s<=0?(o(1),r(10)):(o(a(s,-1)),r(a(n,1)))),s<=0&&o(a(n,-1)),n<=0&&r(a(s,1)),this._zero&&this.min!==this._suggestedMin&&s===a(this.min,0)&&o(a(s,-1)),this.min=s,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=uc(e,this);return t.bounds==="ticks"&&Zs(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":ne(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Q(t),this._valueRange=Q(this.max)-Q(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Q(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}Un.id="logarithmic";Un.defaults={ticks:{callback:Ie.formatters.logarithmic,major:{enabled:!0}}};function gi(i){const t=i.ticks;if(t.display&&i.display){const e=U(t.backdropPadding);return D(t.font&&t.font.size,A.font.size)+e.height}return 0}function fc(i,t,e){return e=z(e)?e:[e],{w:Vo(i,t.string,e),h:e.length*t.lineHeight}}function $s(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:in?{start:t-e,end:t}:{start:t,end:t+e}}function gc(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?V/o:0;for(let l=0;lt.r&&(a=(s.end-t.r)/o,i.r=Math.max(i.r,t.r+a)),n.startt.b&&(l=(n.end-t.b)/r,i.b=Math.max(i.b,t.b+l))}function mc(i,t,e){const s=[],n=i._pointLabels.length,o=i.options,r=gi(o)/2,a=i.drawingArea,l=o.pointLabels.centerPointLabels?V/n:0;for(let c=0;c270||e<90)&&(i-=t),i}function yc(i,t){const{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){const o=s.setContext(i.getPointLabelContext(n)),r=$(o.font),{x:a,y:l,textAlign:c,left:h,top:d,right:u,bottom:f}=i._pointLabelItems[n],{backdropColor:g}=o;if(!E(g)){const p=Pt(o.borderRadius),m=U(o.backdropPadding);e.fillStyle=g;const b=h-m.left,_=d-m.top,y=u-h+m.width,v=f-d+m.height;Object.values(p).some(x=>x!==0)?(e.beginPath(),ee(e,{x:b,y:_,w:y,h:v,radius:p}),e.fill()):e.fillRect(b,_,y,v)}It(e,i._pointLabels[n],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}function Kn(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,F);else{let o=i.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let r=1;r{const n=I(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?gc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){const e=F/(this._pointLabels.length||1),s=this.options.startAngle||0;return G(t*e+et(s))}getDistanceFromCenterForValue(t){if(E(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(E(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t{if(h!==0){a=this.getDistanceFromCenterForValue(c.value);const d=n.setContext(this.getContext(h-1));vc(this,d,a,o)}}),s.display){for(t.save(),r=o-1;r>=0;r--){const c=s.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:d}=c;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;const n=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;const c=s.setContext(this.getContext(l)),h=$(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=U(c.backdropPadding);t.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}It(t,a.label,0,-o,h,{color:c.color})}),t.restore()}drawTitle(){}}Be.id="radialLinear";Be.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ie.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}};Be.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Be.descriptors={angleLines:{_fallback:"grid"}};const Ve={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},K=Object.keys(Ve);function kc(i,t){return i-t}function Ys(i,t){if(E(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),W(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Ft(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function Xs(i,t,e,s){const n=K.length;for(let o=K.indexOf(i);o=K.indexOf(e);o--){const r=K[o];if(Ve[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return K[e?K.indexOf(e):0]}function Sc(i){for(let t=K.indexOf(i)+1,e=K.length;t=t?e[s]:e[n];i[o]=!0}}function Pc(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function Ks(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=Y(e,0,r),s=Y(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||Xs(o.minUnit,e,s,this._getLabelCapacity(e)),a=D(o.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Ft(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const g=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;up-m).map(p=>+p)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=s[e],u=l&&h&&d&&d.major,f=this._adapter.format(t,n||(u?h:c)),g=o.ticks.callback;return g?I(g,[f,e,s],this):f}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=St(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=St(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class qn extends Ne{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=xe(e,this.min),this._tableRange=xe(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;rArray.prototype.slice.call(r));let n=!1,o=[];return function(...r){o=s(r),n||(n=!0,Ks.call(window,()=>{n=!1,i.apply(t,o)}))}}function Xn(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}const Gs=i=>i==="start"?"left":i==="end"?"right":"center",K=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Un=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t,Kn=function(){let i=0;return function(){return i++}}();function E(i){return i===null||typeof i=="undefined"}function B(i){if(Array.isArray&&Array.isArray(i))return!0;const t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function D(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}const W=i=>(typeof i=="number"||i instanceof Number)&&isFinite(+i);function Z(i,t){return W(i)?i:t}function P(i,t){return typeof i=="undefined"?t:i}const qn=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:i/t,Zs=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function z(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function R(i,t,e,s){let n,o,r;if(B(i))if(o=i.length,s)for(n=o-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;ne;)i=i[t.slice(e,s)],e=s+1,s=Ii(t,e);return i}function pi(i){return i.charAt(0).toUpperCase()+i.slice(1)}const Q=i=>typeof i!="undefined",mt=i=>typeof i=="function",zi=(i,t)=>{if(i.size!==t.size)return!1;for(const e of i)if(!t.has(e))return!1;return!0};function to(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}const N=Math.PI,I=2*N,eo=I+N,Pe=Number.POSITIVE_INFINITY,io=N/180,V=N/2,Nt=N/4,Bi=N*2/3,J=Math.log10,it=Math.sign;function Vi(i){const t=Math.round(i);i=qt(i,t,i/1e3)?t:i;const e=Math.pow(10,Math.floor(J(i))),s=i/e;return(s<=1?1:s<=2?2:s<=5?5:10)*e}function so(i){const t=[],e=Math.sqrt(i);let s;for(s=1;sn-o).pop(),t}function Qt(i){return!isNaN(parseFloat(i))&&isFinite(i)}function qt(i,t,e){return Math.abs(i-t)=i}function Qs(i,t,e){let s,n,o;for(s=0,n=i.length;sl&&c=Math.min(t,e)-s&&i<=Math.max(t,e)+s}const he=i=>i===0||i===1,Wi=(i,t,e)=>-(Math.pow(2,10*(i-=1))*Math.sin((i-t)*I/e)),Hi=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*I/e)+1,Gt={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>-Math.cos(i*V)+1,easeOutSine:i=>Math.sin(i*V),easeInOutSine:i=>-.5*(Math.cos(N*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:-Math.pow(2,-10*i)+1,easeInOutExpo:i=>he(i)?i:i<.5?.5*Math.pow(2,10*(i*2-1)):.5*(-Math.pow(2,-10*(i*2-1))+2),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>he(i)?i:Wi(i,.075,.3),easeOutElastic:i=>he(i)?i:Hi(i,.075,.3),easeInOutElastic(i){return he(i)?i:i<.5?.5*Wi(i*2,.1125,.45):.5+.5*Hi(i*2-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?.5*(i*i*(((t*=1.525)+1)*i-t)):.5*((i-=2)*i*(((t*=1.525)+1)*i+t)+2)},easeInBounce:i=>1-Gt.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?Gt.easeInBounce(i*2)*.5:Gt.easeOutBounce(i*2-1)*.5+.5};/*! - * @kurkle/color v0.2.1 - * https://github.com/kurkle/color#readme - * (c) 2022 Jukka Kurkela - * Released under the MIT License - */function ne(i){return i+.5|0}const dt=(i,t,e)=>Math.max(Math.min(i,e),t);function Xt(i){return dt(ne(i*2.55),0,255)}function gt(i){return dt(ne(i*255),0,255)}function at(i){return dt(ne(i/2.55)/100,0,1)}function ji(i){return dt(ne(i*100),0,100)}const G={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ri=[..."0123456789ABCDEF"],ao=i=>ri[i&15],lo=i=>ri[(i&240)>>4]+ri[i&15],de=i=>(i&240)>>4===(i&15),co=i=>de(i.r)&&de(i.g)&&de(i.b)&&de(i.a);function ho(i){var t=i.length,e;return i[0]==="#"&&(t===4||t===5?e={r:255&G[i[1]]*17,g:255&G[i[2]]*17,b:255&G[i[3]]*17,a:t===5?G[i[4]]*17:255}:(t===7||t===9)&&(e={r:G[i[1]]<<4|G[i[2]],g:G[i[3]]<<4|G[i[4]],b:G[i[5]]<<4|G[i[6]],a:t===9?G[i[7]]<<4|G[i[8]]:255})),e}const uo=(i,t)=>i<255?t(i):"";function fo(i){var t=co(i)?ao:lo;return i?"#"+t(i.r)+t(i.g)+t(i.b)+uo(i.a,t):void 0}const go=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function en(i,t,e){const s=t*Math.min(e,1-e),n=(o,r=(o+i/30)%12)=>e-s*Math.max(Math.min(r-3,9-r,1),-1);return[n(0),n(8),n(4)]}function po(i,t,e){const s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function mo(i,t,e){const s=en(i,1,.5);let n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function bo(i,t,e,s,n){return i===n?(t-e)/s+(t.5?h/(2-o-r):h/(o+r),l=bo(e,s,n,h,o),l=l*60+.5),[l|0,c||0,a]}function xi(i,t,e,s){return(Array.isArray(t)?i(t[0],t[1],t[2]):i(t,e,s)).map(gt)}function _i(i,t,e){return xi(en,i,t,e)}function xo(i,t,e){return xi(mo,i,t,e)}function _o(i,t,e){return xi(po,i,t,e)}function sn(i){return(i%360+360)%360}function yo(i){const t=go.exec(i);let e=255,s;if(!t)return;t[5]!==s&&(e=t[6]?Xt(+t[5]):gt(+t[5]));const n=sn(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?s=xo(n,o,r):t[1]==="hsv"?s=_o(n,o,r):s=_i(n,o,r),{r:s[0],g:s[1],b:s[2],a:e}}function vo(i,t){var e=bi(i);e[0]=sn(e[0]+t),e=_i(e),i.r=e[0],i.g=e[1],i.b=e[2]}function Mo(i){if(!i)return;const t=bi(i),e=t[0],s=ji(t[1]),n=ji(t[2]);return i.a<255?`hsla(${e}, ${s}%, ${n}%, ${at(i.a)})`:`hsl(${e}, ${s}%, ${n}%)`}const $i={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Yi={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function ko(){const i={},t=Object.keys(Yi),e=Object.keys($i);let s,n,o,r,a;for(s=0;s>16&255,o>>8&255,o&255]}return i}let ue;function wo(i){ue||(ue=ko(),ue.transparent=[0,0,0,0]);const t=ue[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const So=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Po(i){const t=So.exec(i);let e=255,s,n,o;if(!!t){if(t[7]!==s){const r=+t[7];e=t[8]?Xt(r):dt(r*255,0,255)}return s=+t[1],n=+t[3],o=+t[5],s=255&(t[2]?Xt(s):dt(s,0,255)),n=255&(t[4]?Xt(n):dt(n,0,255)),o=255&(t[6]?Xt(o):dt(o,0,255)),{r:s,g:n,b:o,a:e}}}function Co(i){return i&&(i.a<255?`rgba(${i.r}, ${i.g}, ${i.b}, ${at(i.a)})`:`rgb(${i.r}, ${i.g}, ${i.b})`)}const Xe=i=>i<=.0031308?i*12.92:Math.pow(i,1/2.4)*1.055-.055,Lt=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function Do(i,t,e){const s=Lt(at(i.r)),n=Lt(at(i.g)),o=Lt(at(i.b));return{r:gt(Xe(s+e*(Lt(at(t.r))-s))),g:gt(Xe(n+e*(Lt(at(t.g))-n))),b:gt(Xe(o+e*(Lt(at(t.b))-o))),a:i.a+e*(t.a-i.a)}}function fe(i,t,e){if(i){let s=bi(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=_i(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function nn(i,t){return i&&Object.assign(t||{},i)}function Xi(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=gt(i[3]))):(t=nn(i,{r:0,g:0,b:0,a:1}),t.a=gt(t.a)),t}function Oo(i){return i.charAt(0)==="r"?Po(i):yo(i)}class Ce{constructor(t){if(t instanceof Ce)return t;const e=typeof t;let s;e==="object"?s=Xi(t):e==="string"&&(s=ho(t)||wo(t)||Oo(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=nn(this._rgb);return t&&(t.a=at(t.a)),t}set rgb(t){this._rgb=Xi(t)}rgbString(){return this._valid?Co(this._rgb):void 0}hexString(){return this._valid?fo(this._rgb):void 0}hslString(){return this._valid?Mo(this._rgb):void 0}mix(t,e){if(t){const s=this.rgb,n=t.rgb;let o;const r=e===o?.5:e,a=2*r-1,l=s.a-n.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-c,s.r=255&c*s.r+o*n.r+.5,s.g=255&c*s.g+o*n.g+.5,s.b=255&c*s.b+o*n.b+.5,s.a=r*s.a+(1-r)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=Do(this._rgb,t._rgb,e)),this}clone(){return new Ce(this.rgb)}alpha(t){return this._rgb.a=gt(t),this}clearer(t){const e=this._rgb;return e.a*=1-t,this}greyscale(){const t=this._rgb,e=ne(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=e,this}opaquer(t){const e=this._rgb;return e.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return fe(this._rgb,2,t),this}darken(t){return fe(this._rgb,2,-t),this}saturate(t){return fe(this._rgb,1,t),this}desaturate(t){return fe(this._rgb,1,-t),this}rotate(t){return vo(this._rgb,t),this}}function on(i){return new Ce(i)}function rn(i){if(i&&typeof i=="object"){const t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Ui(i){return rn(i)?i:on(i)}function Ue(i){return rn(i)?i:on(i).saturate(.5).darken(.1).hexString()}const Ct=Object.create(null),ai=Object.create(null);function Zt(i,t){if(!t)return i;const e=t.split(".");for(let s=0,n=e.length;se.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(e,s)=>Ue(s.backgroundColor),this.hoverBorderColor=(e,s)=>Ue(s.borderColor),this.hoverColor=(e,s)=>Ue(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return Ke(this,t,e)}get(t){return Zt(this,t)}describe(t,e){return Ke(ai,t,e)}override(t,e){return Ke(Ct,t,e)}route(t,e,s,n){const o=Zt(this,t),r=Zt(this,s),a="_"+e;Object.defineProperties(o,{[a]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){const l=this[a],c=r[n];return D(l)?Object.assign({},c,l):P(l,c)},set(l){this[a]=l}}})}}var O=new Ao({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function Lo(i){return!i||E(i.size)||E(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function De(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function To(i,t,e,s){s=s||{};let n=s.data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},o=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let r=0;const a=e.length;let l,c,h,d,u;for(l=0;le.length){for(l=0;l0&&i.stroke()}}function ee(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="";let l,c;for(i.save(),i.font=n.string,Fo(i,o),l=0;l+i||0;function yi(i,t){const e={},s=D(t),n=s?Object.keys(t):t,o=D(i)?s?r=>P(i[r],i[t[r]]):r=>i[r]:()=>i;for(const r of n)e[r]=No(o(r));return e}function an(i){return yi(i,{top:"y",right:"x",bottom:"y",left:"x"})}function St(i){return yi(i,["topLeft","topRight","bottomLeft","bottomRight"])}function X(i){const t=an(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function j(i,t){i=i||{},t=t||O.font;let e=P(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=P(i.style,t.style);s&&!(""+s).match(Bo)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");const n={family:P(i.family,t.family),lineHeight:Vo(P(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:P(i.weight,t.weight),string:""};return n.string=Lo(n),n}function ge(i,t,e,s){let n=!0,o,r,a;for(o=0,r=i.length;oe&&a===0?0:a+l;return{min:r(s,-Math.abs(o)),max:r(n,o)}}function bt(i,t){return Object.assign(Object.create(i),t)}function vi(i,t,e){e=e||(r=>i[r]1;)o=n+s>>1,e(o)?n=o:s=o;return{lo:n,hi:s}}const wt=(i,t,e)=>vi(i,e,s=>i[s][t]vi(i,e,s=>i[s][t]>=e);function jo(i,t,e){let s=0,n=i.length;for(;ss&&i[n-1]>e;)n--;return s>0||n{const s="_onData"+pi(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){const r=n.apply(this,o);return i._chartjs.listeners.forEach(a=>{typeof a[s]=="function"&&a[s](...o)}),r}})})}function qi(i,t){const e=i._chartjs;if(!e)return;const s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),!(s.length>0)&&(ln.forEach(o=>{delete i[o]}),delete i._chartjs)}function cn(i){const t=new Set;let e,s;for(e=0,s=i.length;ei[0]){Q(s)||(s=fn("_fallback",i));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:e,_fallback:s,_getTarget:n,override:r=>Mi([r,...i],t,e,s)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete i[0][a],!0},get(r,a){return dn(r,a,()=>Jo(a,t,i,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(i[0])},has(r,a){return Zi(r).includes(a)},ownKeys(r){return Zi(r)},set(r,a,l){const c=r._storage||(r._storage=n());return r[a]=c[a]=l,delete r._keys,!0}})}function Ft(i,t,e,s){const n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:hn(i,s),setContext:o=>Ft(i,o,e,s),override:o=>Ft(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty(o,r){return delete o[r],delete i[r],!0},get(o,r,a){return dn(o,r,()=>Xo(o,r,a))},getOwnPropertyDescriptor(o,r){return o._descriptors.allKeys?Reflect.has(i,r)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,r)},getPrototypeOf(){return Reflect.getPrototypeOf(i)},has(o,r){return Reflect.has(i,r)},ownKeys(){return Reflect.ownKeys(i)},set(o,r,a){return i[r]=a,delete o[r],!0}})}function hn(i,t={scriptable:!0,indexable:!0}){const{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:mt(e)?e:()=>e,isIndexable:mt(s)?s:()=>s}}const Yo=(i,t)=>i?i+pi(t):t,ki=(i,t)=>D(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function dn(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t))return i[t];const s=e();return i[t]=s,s}function Xo(i,t,e){const{_proxy:s,_context:n,_subProxy:o,_descriptors:r}=i;let a=s[t];return mt(a)&&r.isScriptable(t)&&(a=Uo(t,a,i,e)),B(a)&&a.length&&(a=Ko(t,a,i,r.isIndexable)),ki(t,a)&&(a=Ft(a,n,o&&o[t],r)),a}function Uo(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_stack:a}=e;if(a.has(i))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+i);return a.add(i),t=t(o,r||s),a.delete(i),ki(i,t)&&(t=wi(n._scopes,n,i,t)),t}function Ko(i,t,e,s){const{_proxy:n,_context:o,_subProxy:r,_descriptors:a}=e;if(Q(o.index)&&s(i))t=t[o.index%t.length];else if(D(t[0])){const l=t,c=n._scopes.filter(h=>h!==l);t=[];for(const h of l){const d=wi(c,n,i,h);t.push(Ft(d,o,r&&r[i],a))}}return t}function un(i,t,e){return mt(i)?i(t,e):i}const qo=(i,t)=>i===!0?t:typeof i=="string"?pt(t,i):void 0;function Go(i,t,e,s,n){for(const o of t){const r=qo(e,o);if(r){i.add(r);const a=un(r._fallback,e,n);if(Q(a)&&a!==e&&a!==s)return a}else if(r===!1&&Q(s)&&e!==s)return null}return!1}function wi(i,t,e,s){const n=t._rootScopes,o=un(t._fallback,e,s),r=[...i,...n],a=new Set;a.add(s);let l=Gi(a,r,e,o||e,s);return l===null||Q(o)&&o!==e&&(l=Gi(a,r,o,l,s),l===null)?!1:Mi(Array.from(a),[""],n,o,()=>Zo(t,e,s))}function Gi(i,t,e,s,n){for(;e;)e=Go(i,t,e,s,n);return e}function Zo(i,t,e){const s=i._getTarget();t in s||(s[t]={});const n=s[t];return B(n)&&D(e)?e:n}function Jo(i,t,e,s){let n;for(const o of t)if(n=fn(Yo(o,i),e),Q(n))return ki(i,n)?wi(e,s,i,n):n}function fn(i,t){for(const e of t){if(!e)continue;const s=e[i];if(Q(s))return s}}function Zi(i){let t=i._keys;return t||(t=i._keys=Qo(i._scopes)),t}function Qo(i){const t=new Set;for(const e of i)for(const s of Object.keys(e).filter(n=>!n.startsWith("_")))t.add(s);return Array.from(t)}function gn(i,t,e,s){const{iScale:n}=i,{key:o="r"}=this._parsing,r=new Array(s);let a,l,c,h;for(a=0,l=s;ati==="x"?"y":"x";function er(i,t,e,s){const n=i.skip?t:i,o=t,r=e.skip?t:e,a=oi(o,n),l=oi(r,o);let c=a/(a+l),h=l/(a+l);c=isNaN(c)?0:c,h=isNaN(h)?0:h;const d=s*c,u=s*h;return{previous:{x:o.x-d*(r.x-n.x),y:o.y-d*(r.y-n.y)},next:{x:o.x+u*(r.x-n.x),y:o.y+u*(r.y-n.y)}}}function ir(i,t,e){const s=i.length;let n,o,r,a,l,c=It(i,0);for(let h=0;h!c.skip)),t.cubicInterpolationMode==="monotone")nr(i,n);else{let c=s?i[i.length-1]:i[0];for(o=0,r=i.length;owindow.getComputedStyle(i,null);function ar(i,t){return ze(i).getPropertyValue(t)}const lr=["top","right","bottom","left"];function Pt(i,t,e){const s={};e=e?"-"+e:"";for(let n=0;n<4;n++){const o=lr[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}const cr=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function hr(i,t){const e=i.touches,s=e&&e.length?e[0]:i,{offsetX:n,offsetY:o}=s;let r=!1,a,l;if(cr(n,o,i.target))a=n,l=o;else{const c=t.getBoundingClientRect();a=s.clientX-c.left,l=s.clientY-c.top,r=!0}return{x:a,y:l,box:r}}function Mt(i,t){if("native"in i)return i;const{canvas:e,currentDevicePixelRatio:s}=t,n=ze(e),o=n.boxSizing==="border-box",r=Pt(n,"padding"),a=Pt(n,"border","width"),{x:l,y:c,box:h}=hr(i,e),d=r.left+(h&&a.left),u=r.top+(h&&a.top);let{width:f,height:g}=t;return o&&(f-=r.width+a.width,g-=r.height+a.height),{x:Math.round((l-d)/f*e.width/s),y:Math.round((c-u)/g*e.height/s)}}function dr(i,t,e){let s,n;if(t===void 0||e===void 0){const o=Si(i);if(!o)t=i.clientWidth,e=i.clientHeight;else{const r=o.getBoundingClientRect(),a=ze(o),l=Pt(a,"border","width"),c=Pt(a,"padding");t=r.width-c.width-l.width,e=r.height-c.height-l.height,s=Ae(a.maxWidth,o,"clientWidth"),n=Ae(a.maxHeight,o,"clientHeight")}}return{width:t,height:e,maxWidth:s||Pe,maxHeight:n||Pe}}const qe=i=>Math.round(i*10)/10;function ur(i,t,e,s){const n=ze(i),o=Pt(n,"margin"),r=Ae(n.maxWidth,i,"clientWidth")||Pe,a=Ae(n.maxHeight,i,"clientHeight")||Pe,l=dr(i,t,e);let{width:c,height:h}=l;if(n.boxSizing==="content-box"){const d=Pt(n,"border","width"),u=Pt(n,"padding");c-=u.width+d.width,h-=u.height+d.height}return c=Math.max(0,c-o.width),h=Math.max(0,s?Math.floor(c/s):h-o.height),c=qe(Math.min(c,r,l.maxWidth)),h=qe(Math.min(h,a,l.maxHeight)),c&&!h&&(h=qe(c/2)),{width:c,height:h}}function Ji(i,t,e){const s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=n/s,i.width=o/s;const r=i.canvas;return r.style&&(e||!r.style.height&&!r.style.width)&&(r.style.height=`${i.height}px`,r.style.width=`${i.width}px`),i.currentDevicePixelRatio!==s||r.height!==n||r.width!==o?(i.currentDevicePixelRatio=s,r.height=n,r.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0):!1}const fr=function(){let i=!1;try{const t={get passive(){return i=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch{}return i}();function Qi(i,t){const e=ar(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function kt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function gr(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function pr(i,t,e,s){const n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},r=kt(i,n,e),a=kt(n,o,e),l=kt(o,t,e),c=kt(r,a,e),h=kt(a,l,e);return kt(c,h,e)}const ts=new Map;function mr(i,t){t=t||{};const e=i+JSON.stringify(t);let s=ts.get(e);return s||(s=new Intl.NumberFormat(i,t),ts.set(e,s)),s}function oe(i,t,e){return mr(t,e).format(i)}const br=function(i,t){return{x(e){return i+i+t-e},setWidth(e){t=e},textAlign(e){return e==="center"?e:e==="right"?"left":"right"},xPlus(e,s){return e-s},leftForLtr(e,s){return e-s}}},xr=function(){return{x(i){return i},setWidth(i){},textAlign(i){return i},xPlus(i,t){return i+t},leftForLtr(i,t){return i}}};function Rt(i,t,e){return i?br(t,e):xr()}function bn(i,t){let e,s;(t==="ltr"||t==="rtl")&&(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function xn(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function _n(i){return i==="angle"?{between:te,compare:oo,normalize:q}:{between:lt,compare:(t,e)=>t-e,normalize:t=>t}}function es({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e===0,style:n}}function _r(i,t,e){const{property:s,start:n,end:o}=e,{between:r,normalize:a}=_n(s),l=t.length;let{start:c,end:h,loop:d}=i,u,f;if(d){for(c+=l,h+=l,u=0,f=l;ul(n,y,b)&&a(n,y)!==0,v=()=>a(o,b)===0||l(o,y,b),k=()=>p||_(),M=()=>!p||v();for(let S=h,w=h;S<=d;++S)x=t[S%r],!x.skip&&(b=c(x[s]),b!==y&&(p=l(b,n,o),m===null&&k()&&(m=a(b,n)===0?S:w),m!==null&&M()&&(g.push(es({start:m,end:S,loop:u,count:r,style:f})),m=null),w=S,y=b));return m!==null&&g.push(es({start:m,end:d,loop:u,count:r,style:f})),g}function vn(i,t){const e=[],s=i.segments;for(let n=0;nn&&i[o%t].skip;)o--;return o%=t,{start:n,end:o}}function vr(i,t,e,s){const n=i.length,o=[];let r=t,a=i[t],l;for(l=t+1;l<=e;++l){const c=i[l%n];c.skip||c.stop?a.skip||(s=!1,o.push({start:t%n,end:(l-1)%n,loop:s}),t=r=c.stop?l:null):(r=l,a.skip&&(t=l)),a=c}return r!==null&&o.push({start:t%n,end:r%n,loop:s}),o}function Mr(i,t){const e=i.points,s=i.options.spanGaps,n=e.length;if(!n)return[];const o=!!i._loop,{start:r,end:a}=yr(e,n,o,s);if(s===!0)return is(i,[{start:r,end:a,loop:o}],e,t);const l=aa({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(s-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=Ks.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;const o=s.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>s.duration&&(s.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);!e||(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const s=e.items;let n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var ot=new Sr;const ns="transparent",Pr={boolean(i,t,e){return e>.5?t:i},color(i,t,e){const s=Ui(i||ns),n=s.valid&&Ui(t||ns);return n&&n.valid?n.mix(s,e).hexString():t},number(i,t,e){return i+(t-i)*e}};class Cr{constructor(t,e,s,n){const o=e[s];n=ge([t.to,n,o,t.from]);const r=ge([t.from,o,n]);this._active=!0,this._fn=t.fn||Pr[t.type||typeof r],this._easing=Gt[t.easing]||Gt.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);const n=this._target[this._prop],o=s-this._start,r=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=ge([t.to,e,n,t.from]),this._from=ge([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,s=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){const e=t?"res":"rej",s=this._promises||[];for(let n=0;ni!=="onProgress"&&i!=="onComplete"&&i!=="fn"});O.set("animations",{colors:{type:"color",properties:Or},numbers:{type:"number",properties:Dr}});O.describe("animations",{_fallback:"animation"});O.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:i=>i|0}}}});class Mn{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!D(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const n=t[s];if(!D(n))return;const o={};for(const r of Ar)o[r]=n[r];(B(n.properties)&&n.properties||[s]).forEach(r=>{(r===s||!e.has(r))&&e.set(r,o)})})}_animateOptions(t,e){const s=e.options,n=Tr(t,s);if(!n)return[];const o=this._createAnimations(n,s);return s.$shared&&Lr(t.options.$animations,s).then(()=>{t.options=s},()=>{}),o}_createAnimations(t,e){const s=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=s.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new Cr(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const s=this._createAnimations(t,e);if(s.length)return ot.add(this._chart,s),!0}}function Lr(i,t){const e=[],s=Object.keys(t);for(let n=0;n0||!e&&o<0)return n.index}return null}function cs(i,t){const{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=s,l=o.axis,c=r.axis,h=Ir(o,r,s),d=t.length;let u;for(let f=0;fe[s].axis===t).shift()}function Vr(i,t){return bt(i,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function Nr(i,t,e){return bt(i,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function Wt(i,t){const e=i.controller.index,s=i.vScale&&i.vScale.axis;if(!!s){t=t||i._parsed;for(const n of t){const o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e]}}}const Ze=i=>i==="reset"||i==="none",hs=(i,t)=>t?i:Object.assign({},i),Wr=(i,t,e)=>i&&!t.hidden&&t._stacked&&{keys:kn(e,!0),values:null};class st{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=as(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Wt(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(d,u,f,g)=>d==="x"?u:d==="r"?g:f,o=e.xAxisID=P(s.xAxisID,Ge(t,"x")),r=e.yAxisID=P(s.yAxisID,Ge(t,"y")),a=e.rAxisID=P(s.rAxisID,Ge(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&qi(this._data,this),t._stacked&&Wt(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(D(e))this._data=Fr(e);else if(s!==e){if(s){qi(s,this);const n=this._cachedMeta;Wt(n),n._parsed=[]}e&&Object.isExtensible(e)&&$o(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,s=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=as(e.vScale,e),e.stack!==s.stack&&(n=!0,Wt(e),e.stack=s.stack),this._resyncElements(t),(n||o!==e._stacked)&&cs(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),s=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(s,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:s,_data:n}=this,{iScale:o,_stacked:r}=s,a=o.axis;let l=t===0&&e===n.length?!0:s._sorted,c=t>0&&s._parsed[t-1],h,d,u;if(this._parsing===!1)s._parsed=n,s._sorted=!0,u=n;else{B(n[t])?u=this.parseArrayData(s,n,t,e):D(n[t])?u=this.parseObjectData(s,n,t,e):u=this.parsePrimitiveData(s,n,t,e);const f=()=>d[a]===null||c&&d[a]p||d=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,s=[];let n,o,r;for(n=0,o=e.length;n=0&&tthis.getContext(s,n),p=c.resolveNamedOptions(u,f,g,d);return p.$shared&&(p.$shared=l,o[r]=Object.freeze(hs(p,l))),p}_resolveAnimations(t,e,s){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,s,e))}const c=new Mn(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(!!t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Ze(t)||this.chart._animationsDisabled}updateElement(t,e,s,n){Ze(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!Ze(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,s=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=s.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;an-o))}return i._cache.$bar}function jr(i){const t=i.iScale,e=Hr(t,i.type);let s=t._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(Q(a)&&(s=Math.min(s,Math.abs(r-a)||s)),a=r)};for(n=0,o=e.length;n0?n[i-1]:null,a=iMath.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:r,max:a}}function wn(i,t,e,s){return B(i)?Xr(i,t,e,s):t[e.axis]=e.parse(i,s),t}function ds(i,t,e,s){const n=i.iScale,o=i.vScale,r=n.getLabels(),a=n===o,l=[];let c,h,d,u;for(c=e,h=e+s;c=e?1:-1)}function Kr(i){let t,e,s,n,o;return i.horizontal?(t=i.base>i.x,e="left",s="right"):(t=i.base=0;--s)e=Math.max(e,t[s].size(this.resolveDataElementOptions(s))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:s,yScale:n}=e,o=this.getParsed(t),r=s.getLabelForValue(o.x),a=n.getLabelForValue(o.y),l=o._custom;return{label:e.label,value:"("+r+", "+a+(l?", "+l:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a}=this._cachedMeta,l=this.resolveDataElementOptions(e,n),c=this.getSharedOptions(l),h=this.includeOptions(n,c),d=r.axis,u=a.axis;for(let f=e;fte(y,a,l,!0)?1:Math.max(_,_*e,v,v*e),g=(y,_,v)=>te(y,a,l,!0)?-1:Math.min(_,_*e,v,v*e),p=f(0,c,d),m=f(V,h,u),b=g(N,c,d),x=g(N+V,h,u);s=(p-b)/2,n=(m-x)/2,o=-(p+b)/2,r=-(m+x)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:r}}class re extends st{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o=l=>+s[l];if(D(s[t])){const{key:l="value"}=this._parsing;o=c=>+pt(s[c],l)}let r,a;for(r=t,a=t+e;r0&&!isNaN(t)?I*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=oe(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0;const s=this.chart;let n,o,r,a,l;if(!t){for(n=0,o=s.data.datasets.length;ni!=="spacing",_indexable:i=>i!=="spacing"};re.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((s,n)=>{const r=i.getDatasetMeta(0).controller.getStyle(n);return{text:s,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(n),index:n}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){let t=i.label;const e=": "+i.formattedValue;return B(t)?(t=t.slice(),t[0]+=e):t+=e,t}}}}};class ae extends st{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:s,data:n=[],_dataset:o}=e,r=this.chart._animationsDisabled;let{start:a,count:l}=Qr(e,n,r);this._drawStart=a,this._drawCount=l,ta(e)&&(a=0,l=n.length),s._chart=this.chart,s._datasetIndex=this.index,s._decimated=!!o._decimated,s.points=n;const c=this.resolveDatasetElementOptions(t);this.options.showLine||(c.borderWidth=0),c.segment=this.options.segment,this.updateElement(s,void 0,{animated:!r,options:c},t),this.updateElements(n,a,l,t)}updateElements(t,e,s,n){const o=n==="reset",{iScale:r,vScale:a,_stacked:l,_dataset:c}=this._cachedMeta,h=this.resolveDataElementOptions(e,n),d=this.getSharedOptions(h),u=this.includeOptions(n,d),f=r.axis,g=a.axis,{spanGaps:p,segment:m}=this.options,b=Qt(p)?p:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||o||n==="none";let y=e>0&&this.getParsed(e-1);for(let _=e;_0&&Math.abs(k[f]-y[f])>b,m&&(M.parsed=k,M.raw=c.data[_]),u&&(M.options=d||this.resolveDataElementOptions(_,v.active?"active":n)),x||this.updateElement(v,_,M,n),y=k}this.updateSharedOptions(d,n,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,s=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return s;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(s,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}ae.id="line";ae.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};ae.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};function Qr(i,t,e){const s=t.length;let n=0,o=s;if(i._sorted){const{iScale:r,_parsed:a}=i,l=r.axis,{min:c,max:h,minDefined:d,maxDefined:u}=r.getUserBounds();d&&(n=$(Math.min(wt(a,r.axis,c).lo,e?s:wt(t,l,r.getPixelForValue(c)).lo),0,s-1)),u?o=$(Math.max(wt(a,r.axis,h).hi+1,e?0:wt(t,l,r.getPixelForValue(h)).hi+1),n,s)-n:o=s-n}return{start:n,count:o}}function ta(i){const{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;const o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}class Di extends st{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=oe(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return gn.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){const t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,n)=>{const o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(oe.max&&(e.max=o))}),e}_updateRadius(){const t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),r=Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0),a=(o-r)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,s,n){const o=n==="reset",r=this.chart,l=r.options.animation,c=this._cachedMeta.rScale,h=c.xCenter,d=c.yCenter,u=c.getIndexAngle(0)-.5*N;let f=u,g;const p=360/this.countVisibleElements();for(g=0;g{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?tt(this.resolveDataElementOptions(t,e).angle||s):0}}Di.id="polarArea";Di.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Di.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(i){const t=i.data;if(t.labels.length&&t.datasets.length){const{labels:{pointStyle:e}}=i.legend.options;return t.labels.map((s,n)=>{const r=i.getDatasetMeta(0).controller.getStyle(n);return{text:s,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,lineWidth:r.borderWidth,pointStyle:e,hidden:!i.getDataVisibility(n),index:n}})}return[]}},onClick(i,t,e){e.chart.toggleDataVisibility(t.index),e.chart.update()}},tooltip:{callbacks:{title(){return""},label(i){return i.chart.data.labels[i.dataIndex]+": "+i.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class Sn extends re{}Sn.id="pie";Sn.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Oi extends st{getLabelAndValue(t){const e=this._cachedMeta.vScale,s=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(s[e.axis])}}parseObjectData(t,e,s,n){return gn.bind(this)(t,e,s,n)}update(t){const e=this._cachedMeta,s=e.dataset,n=e.data||[],o=e.iScale.getLabels();if(s.points=n,t!=="resize"){const r=this.resolveDatasetElementOptions(t);this.options.showLine||(r.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===n.length,options:r};this.updateElement(s,void 0,a,t)}this.updateElements(n,0,n.length,t)}updateElements(t,e,s,n){const o=this._cachedMeta.rScale,r=n==="reset";for(let a=e;a{l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),s&&!a?[]:o}var ra={evaluateInteractionItems:le,modes:{index(i,t,e,s){const n=Mt(t,i),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?Qe(i,n,o,s,r):ti(i,n,o,!1,s,r),l=[];return a.length?(i.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(i,t,e,s){const n=Mt(t,i),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?Qe(i,n,o,s,r):ti(i,n,o,!1,s,r);if(a.length>0){const l=a[0].datasetIndex,c=i.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function ps(i,t){return i.filter(e=>Pn.indexOf(e.pos)===-1&&e.box.axis===t)}function jt(i,t){return i.sort((e,s)=>{const n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function aa(i){const t=[];let e,s,n,o,r,a;for(e=0,s=(i||[]).length;ec.box.fullSize),!0),s=jt(Ht(t,"left"),!0),n=jt(Ht(t,"right")),o=jt(Ht(t,"top"),!0),r=jt(Ht(t,"bottom")),a=ps(t,"x"),l=ps(t,"y");return{fullSize:e,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:Ht(t,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function ms(i,t,e,s){return Math.max(i[e],t[e])+Math.max(i[s],t[s])}function Cn(i,t){i.top=Math.max(i.top,t.top),i.left=Math.max(i.left,t.left),i.bottom=Math.max(i.bottom,t.bottom),i.right=Math.max(i.right,t.right)}function da(i,t,e,s){const{pos:n,box:o}=e,r=i.maxPadding;if(!D(n)){e.size&&(i[n]-=e.size);const d=s[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,i[n]+=e.size}o.getPadding&&Cn(r,o.getPadding());const a=Math.max(0,t.outerWidth-ms(r,i,"left","right")),l=Math.max(0,t.outerHeight-ms(r,i,"top","bottom")),c=a!==i.w,h=l!==i.h;return i.w=a,i.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function ua(i){const t=i.maxPadding;function e(s){const n=Math.max(t[s]-i[s],0);return i[s]+=n,n}i.y+=e("top"),i.x+=e("left"),e("right"),e("bottom")}function fa(i,t){const e=t.maxPadding;function s(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return s(i?["left","right"]:["top","bottom"])}function Ut(i,t,e,s){const n=[];let o,r,a,l,c,h;for(o=0,r=i.length,c=0;o{typeof p.beforeLayout=="function"&&p.beforeLayout()});const h=l.reduce((p,m)=>m.box.options&&m.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);Cn(u,X(s));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),g=ca(l.concat(c),d);Ut(a.fullSize,f,d,g),Ut(l,f,d,g),Ut(c,f,d,g)&&Ut(l,f,d,g),ua(f),bs(a.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,bs(a.rightAndBottom,f,d,g),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},R(a.chartArea,p=>{const m=p.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Dn{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class ga extends Dn{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Me="$chartjs",pa={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},xs=i=>i===null||i==="";function ma(i,t){const e=i.style,s=i.getAttribute("height"),n=i.getAttribute("width");if(i[Me]={initial:{height:s,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",xs(n)){const o=Qi(i,"width");o!==void 0&&(i.width=o)}if(xs(s))if(i.style.height==="")i.height=i.width/(t||2);else{const o=Qi(i,"height");o!==void 0&&(i.height=o)}return i}const On=fr?{passive:!0}:!1;function ba(i,t,e){i.addEventListener(t,e,On)}function xa(i,t,e){i.canvas.removeEventListener(t,e,On)}function _a(i,t){const e=pa[i.type]||i.type,{x:s,y:n}=Mt(i,t);return{type:e,chart:t,native:i,x:s!==void 0?s:null,y:n!==void 0?n:null}}function Le(i,t){for(const e of i)if(e===t||e.contains(t))return!0}function ya(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Le(a.addedNodes,s),r=r&&!Le(a.removedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function va(i,t,e){const s=i.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||Le(a.removedNodes,s),r=r&&!Le(a.addedNodes,s);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const se=new Map;let _s=0;function An(){const i=window.devicePixelRatio;i!==_s&&(_s=i,se.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function Ma(i,t){se.size||window.addEventListener("resize",An),se.set(i,t)}function ka(i){se.delete(i),se.size||window.removeEventListener("resize",An)}function wa(i,t,e){const s=i.canvas,n=s&&Si(s);if(!n)return;const o=qs((a,l)=>{const c=n.clientWidth;e(a,l),c{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),Ma(i,o),r}function ei(i,t,e){e&&e.disconnect(),t==="resize"&&ka(i)}function Sa(i,t,e){const s=i.canvas,n=qs(o=>{i.ctx!==null&&e(_a(o,i))},i,o=>{const r=o[0];return[r,r.offsetX,r.offsetY]});return ba(s,t,n),n}class Pa extends Dn{acquireContext(t,e){const s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(ma(t,e),s):null}releaseContext(t){const e=t.canvas;if(!e[Me])return!1;const s=e[Me].initial;["height","width"].forEach(o=>{const r=s[o];E(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Me],!0}addEventListener(t,e,s){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:ya,detach:va,resize:wa}[e]||Sa;n[e]=r(t,e,s)}removeEventListener(t,e){const s=t.$proxies||(t.$proxies={}),n=s[e];if(!n)return;({attach:ei,detach:ei,resize:ei}[e]||xa)(t,e,n),s[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return ur(t,e,s,n)}isAttached(t){const e=Si(t);return!!(e&&e.isConnected)}}function Ca(i){return!mn()||typeof OffscreenCanvas!="undefined"&&i instanceof OffscreenCanvas?ga:Pa}class nt{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(t){const{x:e,y:s}=this.getProps(["x","y"],t);return{x:e,y:s}}hasValue(){return Qt(this.x)&&Qt(this.y)}getProps(t,e){const s=this.$animations;if(!e||!s)return this;const n={};return t.forEach(o=>{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}nt.defaults={};nt.defaultRoutes=void 0;const Ln={values(i){return B(i)?i:""+i},numeric(i,t,e){if(i===0)return"0";const s=this.chart.options.locale;let n,o=i;if(e.length>1){const c=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(c<1e-4||c>1e15)&&(n="scientific"),o=Da(i,e)}const r=J(Math.abs(o)),a=Math.max(Math.min(-1*Math.floor(r),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),oe(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";const s=i/Math.pow(10,Math.floor(J(i)));return s===1||s===2||s===5?Ln.numeric.call(this,i,t,e):""}};function Da(i,t){let e=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(e)>=1&&i!==Math.floor(i)&&(e=i-Math.floor(i)),e}var Be={formatters:Ln};O.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(i,t)=>t.lineWidth,tickColor:(i,t)=>t.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Be.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});O.route("scale.ticks","color","","color");O.route("scale.grid","color","","borderColor");O.route("scale.grid","borderColor","","borderColor");O.route("scale.title","color","","color");O.describe("scale",{_fallback:!1,_scriptable:i=>!i.startsWith("before")&&!i.startsWith("after")&&i!=="callback"&&i!=="parser",_indexable:i=>i!=="borderDash"&&i!=="tickBorderDash"});O.describe("scales",{_fallback:"scale"});O.describe("scale.ticks",{_scriptable:i=>i!=="backdropPadding"&&i!=="callback",_indexable:i=>i!=="backdropPadding"});function Oa(i,t){const e=i.options.ticks,s=e.maxTicksLimit||Aa(i),n=e.major.enabled?Ta(t):[],o=n.length,r=n[0],a=n[o-1],l=[];if(o>s)return Ra(t,l,n,o/s),l;const c=La(n,t,s);if(o>0){let h,d;const u=o>1?Math.round((a-r)/(o-1)):null;for(be(t,l,c,E(u)?0:r-u,r),h=0,d=o-1;hn)return l}return Math.max(n,1)}function Ta(i){const t=[];let e,s;for(e=0,s=i.length;ei==="left"?"right":i==="right"?"left":i,ys=(i,t,e)=>t==="top"||t==="left"?i[t]+e:i[t]-e;function vs(i,t){const e=[],s=i.length/t,n=i.length;let o=0;for(;or+a)))return l}function za(i,t){R(i,e=>{const s=e.gc,n=s.length/2;let o;if(n>t){for(o=0;os?s:e,s=n&&e>s?e:s,{min:Z(e,Z(s,e)),max:Z(s,Z(e,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){z(this.options.beforeUpdate,[this])}update(t,e,s){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=Wo(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||s<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=$(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),d+6>a&&(a=f/(s-(t.offset?.5:1)),l=this.maxHeight-$t(t.grid)-e.padding-Ms(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=mi(Math.min(Math.asin($((h.highest.height+6)/a,-1,1)),Math.asin($(l/c,-1,1))-Math.asin($(u/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){z(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){z(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Ms(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=$t(o)+l):(t.height=this.maxHeight,t.width=$t(o)+l),s.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=s.padding*2,g=tt(this.labelRotation),p=Math.cos(g),m=Math.sin(g);if(a){const b=s.mirror?0:m*d.width+p*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{const b=s.mirror?0:p*d.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(c,h,m,p)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){z(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,s;for(e=0,s=t.length;e({width:o[M]||0,height:r[M]||0});return{first:k(0),last:k(e-1),widest:k(_),highest:k(v),widths:o,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return ro(this._alignToPixels?yt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*n?a/s:l/n:l*n0}_computeGridLineItems(t){const e=this.axis,s=this.chart,n=this.options,{grid:o,position:r}=n,a=o.offset,l=this.isHorizontal(),h=this.ticks.length+(a?1:0),d=$t(o),u=[],f=o.setContext(this.getContext()),g=f.drawBorder?f.borderWidth:0,p=g/2,m=function(C){return yt(s,C,g)};let b,x,y,_,v,k,M,S,w,T,L,A;if(r==="top")b=m(this.bottom),k=this.bottom-d,S=b-p,T=m(t.top)+p,A=t.bottom;else if(r==="bottom")b=m(this.top),T=t.top,A=m(t.bottom)-p,k=b+p,S=this.top+d;else if(r==="left")b=m(this.right),v=this.right-d,M=b-p,w=m(t.left)+p,L=t.right;else if(r==="right")b=m(this.left),w=t.left,L=m(t.right)-p,v=b+p,M=this.left+d;else if(e==="x"){if(r==="center")b=m((t.top+t.bottom)/2+.5);else if(D(r)){const C=Object.keys(r)[0],F=r[C];b=m(this.chart.scales[C].getPixelForValue(F))}T=t.top,A=t.bottom,k=b+p,S=k+d}else if(e==="y"){if(r==="center")b=m((t.left+t.right)/2);else if(D(r)){const C=Object.keys(r)[0],F=r[C];b=m(this.chart.scales[C].getPixelForValue(F))}v=b-p,M=v-d,w=t.left,L=t.right}const H=P(n.ticks.maxTicksLimit,h),Y=Math.max(1,Math.ceil(h/H));for(x=0;xo.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(s.save(),s.lineWidth=h.width,s.strokeStyle=h.color,s.setLineDash(h.borderDash||[]),s.lineDashOffset=h.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(c.x,c.y),s.stroke(),s.restore())};if(e.display)for(o=0,r=n.length;o{this.draw(n)}}]:[{z:s,draw:n=>{this.drawBackground(),this.drawGrid(n),this.drawTitle()}},{z:s+1,draw:()=>{this.drawBorder()}},{z:e,draw:n=>{this.drawLabels(n)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o{const s=e.split("."),n=s.pop(),o=[i].concat(s).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");O.route(o,n,l,a)})}function $a(i){return"id"in i&&"defaults"in i}class Ya{constructor(){this.controllers=new xe(st,"datasets",!0),this.elements=new xe(nt,"elements"),this.plugins=new xe(Object,"plugins"),this.scales=new xe(Dt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{const o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):R(n,r=>{const a=s||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,s){const n=pi(t);z(s["before"+n],[],s),e[t](s),z(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;eo.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function Ua(i){const t=[],e=Object.keys(ct.plugins.items);for(let n=0;n{const l=s[a];if(!D(l))return console.error(`Invalid scale configuration for scale: ${a}`);if(l._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);const c=hi(a,l),h=Ja(c,n),d=e.scales||{};o[c]=o[c]||a,r[a]=Kt(Object.create(null),[{axis:c},l,d[c],d[h]])}),i.data.datasets.forEach(a=>{const l=a.type||i.type,c=a.indexAxis||ci(l,t),d=(Ct[l]||{}).scales||{};Object.keys(d).forEach(u=>{const f=Za(u,c),g=a[f+"AxisID"]||o[f]||f;r[g]=r[g]||Object.create(null),Kt(r[g],[{axis:f},s[g],d[u]])})}),Object.keys(r).forEach(a=>{const l=r[a];Kt(l,[O.scales[l.type],O.scale])}),r}function Tn(i){const t=i.options||(i.options={});t.plugins=P(t.plugins,{}),t.scales=tl(i,t)}function Rn(i){return i=i||{},i.datasets=i.datasets||[],i.labels=i.labels||[],i}function el(i){return i=i||{},i.data=Rn(i.data),Tn(i),i}const ks=new Map,En=new Set;function _e(i,t){let e=ks.get(i);return e||(e=t(),ks.set(i,e),En.add(e)),e}const Yt=(i,t,e)=>{const s=pt(t,e);s!==void 0&&i.add(s)};class il{constructor(t){this._config=el(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Rn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Tn(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return _e(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return _e(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return _e(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,s=this.type;return _e(`${s}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const s=this._scopeCache;let n=s.get(t);return(!n||e)&&(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){const{options:n,type:o}=this,r=this._cachedScopes(t,s),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>Yt(l,t,d))),h.forEach(d=>Yt(l,n,d)),h.forEach(d=>Yt(l,Ct[o]||{},d)),h.forEach(d=>Yt(l,O,d)),h.forEach(d=>Yt(l,ai,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),En.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ct[e]||{},O.datasets[e]||{},{type:e},O,ai]}resolveNamedOptions(t,e,s,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=ws(this._resolverCache,t,n);let l=r;if(nl(r,e)){o.$shared=!1,s=mt(s)?s():s;const c=this.createResolver(t,s,a);l=Ft(r,s,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,s=[""],n){const{resolver:o}=ws(this._resolverCache,t,s);return D(e)?Ft(o,e,void 0,n):o}}function ws(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));const n=e.join();let o=s.get(n);return o||(o={resolver:Mi(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}const sl=i=>D(i)&&Object.getOwnPropertyNames(i).reduce((t,e)=>t||mt(i[e]),!1);function nl(i,t){const{isScriptable:e,isIndexable:s}=hn(i);for(const n of t){const o=e(n),r=s(n),a=(r||o)&&i[n];if(o&&(mt(a)||sl(a))||r&&B(a))return!0}return!1}var ol="3.8.0";const rl=["top","bottom","left","right","chartArea"];function Ss(i,t){return i==="top"||i==="bottom"||rl.indexOf(i)===-1&&t==="x"}function Ps(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Cs(i){const t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),z(e&&e.onComplete,[i],t)}function al(i){const t=i.chart,e=t.options.animation;z(e&&e.onProgress,[i],t)}function Fn(i){return mn()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}const Te={},In=i=>{const t=Fn(i);return Object.values(Te).filter(e=>e.canvas===t).pop()};function ll(i,t,e){const s=Object.keys(i);for(const n of s){const o=+n;if(o>=t){const r=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=r)}}}function cl(i,t,e,s){return!e||i.type==="mouseout"?null:s?t:i}class Li{constructor(t,e){const s=this.config=new il(e),n=Fn(t),o=In(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Ca(n)),this.platform.updateConfig(s);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=Kn(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Xa,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Xn(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],Te[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}ot.listen(this,"complete",Cs),ot.listen(this,"progress",al),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return E(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ji(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Ki(this.canvas,this.ctx),this}stop(){return ot.stop(this),this}resize(t,e){ot.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Ji(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),z(s.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};R(e,(s,n)=>{s.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=hi(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),R(o,r=>{const a=r.options,l=a.id,c=hi(l,a),h=P(a.type,r.dtype);(a.position===void 0||Ss(a.position,c)!==Ss(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in s&&s[l].type===h)d=s[l];else{const u=ct.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),s[d.id]=d}d.init(a,t)}),R(n,(r,a)=>{r||delete s[a]}),R(s,r=>{ut.configure(this,r,r.options),ut.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Ps("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){R(this.scales,t=>{ut.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);(!zi(e,s)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:s,start:n,count:o}of e){const r=s==="_removeElements"?-o:o;ll(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,s=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=s(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;ut.update(this,this.width,this.height,t);const e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],R(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,s=t._clip,n=!s.disabled,o=this.chartArea,r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&Fe(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&Ie(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return ee(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){const o=ra.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],s=this._metasets;let n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=bt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){const s=this.getDatasetMeta(t);s.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){const n=s?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);Q(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),r.update(o,{visible:s}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),ot.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};R(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,s=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),s("resize",o),s("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){R(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},R(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){const n=s?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!we(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}_updateHoverStyles(t,e,s){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=s?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;const o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,s,r),l=to(t),c=cl(t,this._lastEvent,s,l);s&&(this._lastEvent=null,z(o.onHover,[t,a,this],this),l&&z(o.onClick,[t,a,this],this));const h=!we(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}const Ds=()=>R(Li.instances,i=>i._plugins.invalidate()),ht=!0;Object.defineProperties(Li,{defaults:{enumerable:ht,value:O},instances:{enumerable:ht,value:Te},overrides:{enumerable:ht,value:Ct},registry:{enumerable:ht,value:ct},version:{enumerable:ht,value:ol},getChart:{enumerable:ht,value:In},register:{enumerable:ht,value:(...i)=>{ct.add(...i),Ds()}},unregister:{enumerable:ht,value:(...i)=>{ct.remove(...i),Ds()}}});function zn(i,t,e){const{startAngle:s,pixelMargin:n,x:o,y:r,outerRadius:a,innerRadius:l}=t;let c=n/a;i.beginPath(),i.arc(o,r,a,s-c,e+c),l>n?(c=n/l,i.arc(o,r,l,e+c,s-c,!0)):i.arc(o,r,n,e+V,s-V),i.closePath(),i.clip()}function hl(i){return yi(i,["outerStart","outerEnd","innerStart","innerEnd"])}function dl(i,t,e,s){const n=hl(i.options.borderRadius),o=(e-t)/2,r=Math.min(o,s*t/2),a=l=>{const c=(e-Math.min(o,l))*s/2;return $(l,0,Math.min(o,c))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:$(n.innerStart,0,r),innerEnd:$(n.innerEnd,0,r)}}function Tt(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function di(i,t,e,s,n){const{x:o,y:r,startAngle:a,pixelMargin:l,innerRadius:c}=t,h=Math.max(t.outerRadius+s+e-l,0),d=c>0?c+s+e+l:0;let u=0;const f=n-a;if(s){const F=c>0?c-s:0,zt=h>0?h-s:0,_t=(F+zt)/2,Bt=_t!==0?f*_t/(_t+s):f;u=(f-Bt)/2}const g=Math.max(.001,f*h-e/N)/h,p=(f-g)/2,m=a+p+u,b=n-p-u,{outerStart:x,outerEnd:y,innerStart:_,innerEnd:v}=dl(t,d,h,b-m),k=h-x,M=h-y,S=m+x/k,w=b-y/M,T=d+_,L=d+v,A=m+_/T,H=b-v/L;if(i.beginPath(),i.arc(o,r,h,S,w),y>0){const F=Tt(M,w,o,r);i.arc(F.x,F.y,y,w,b+V)}const Y=Tt(L,b,o,r);if(i.lineTo(Y.x,Y.y),v>0){const F=Tt(L,H,o,r);i.arc(F.x,F.y,v,b+V,H+Math.PI)}if(i.arc(o,r,d,b-v/d,m+_/d,!0),_>0){const F=Tt(T,A,o,r);i.arc(F.x,F.y,_,A+Math.PI,m-V)}const C=Tt(k,m,o,r);if(i.lineTo(C.x,C.y),x>0){const F=Tt(k,S,o,r);i.arc(F.x,F.y,x,m-V,S)}i.closePath()}function ul(i,t,e,s){const{fullCircles:n,startAngle:o,circumference:r}=t;let a=t.endAngle;if(n){di(i,t,e,s,o+I);for(let l=0;l=I||te(o,a,l),p=lt(r,c+u,h+u);return g&&p}getCenterPoint(t){const{x:e,y:s,startAngle:n,endAngle:o,innerRadius:r,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:l,spacing:c}=this.options,h=(n+o)/2,d=(r+a+c+l)/2;return{x:e+Math.cos(h)*d,y:s+Math.sin(h)*d}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:s}=this,n=(e.offset||0)/2,o=(e.spacing||0)/2;if(this.pixelMargin=e.borderAlign==="inner"?.33:0,this.fullCircles=s>I?Math.floor(s/I):0,s===0||this.innerRadius<0||this.outerRadius<0)return;t.save();let r=0;if(n){r=n/2;const l=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(l)*r,Math.sin(l)*r),this.circumference>=N&&(r=n)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const a=ul(t,this,r,o);gl(t,this,r,o,a),t.restore()}}Ti.id="arc";Ti.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0};Ti.defaultRoutes={backgroundColor:"backgroundColor"};function Bn(i,t,e=t){i.lineCap=P(e.borderCapStyle,t.borderCapStyle),i.setLineDash(P(e.borderDash,t.borderDash)),i.lineDashOffset=P(e.borderDashOffset,t.borderDashOffset),i.lineJoin=P(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=P(e.borderWidth,t.borderWidth),i.strokeStyle=P(e.borderColor,t.borderColor)}function pl(i,t,e){i.lineTo(e.x,e.y)}function ml(i){return i.stepped?Ro:i.tension||i.cubicInterpolationMode==="monotone"?Eo:pl}function Vn(i,t,e={}){const s=i.length,{start:n=0,end:o=s-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=na&&o>a;return{count:s,start:l,loop:t.loop,ilen:c(r+(c?a-_:_))%o,y=()=>{p!==m&&(i.lineTo(h,m),i.lineTo(h,p),i.lineTo(h,b))};for(l&&(f=n[x(0)],i.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[x(u)],f.skip)continue;const _=f.x,v=f.y,k=_|0;k===g?(vm&&(m=v),h=(d*h+_)/++d):(y(),i.lineTo(_,v),g=k,d=0,p=m=v),b=v}y()}function ui(i){const t=i.options,e=t.borderDash&&t.borderDash.length;return!i._decimated&&!i._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?xl:bl}function _l(i){return i.stepped?gr:i.tension||i.cubicInterpolationMode==="monotone"?pr:kt}function yl(i,t,e,s){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,s)&&n.closePath()),Bn(i,t.options),i.stroke(n)}function vl(i,t,e,s){const{segments:n,options:o}=t,r=ui(t);for(const a of n)Bn(i,o,a.style),i.beginPath(),r(i,t,a,{start:e,end:e+s-1})&&i.closePath(),i.stroke()}const Ml=typeof Path2D=="function";function kl(i,t,e,s){Ml&&!t.options.segment?yl(i,t,e,s):vl(i,t,e,s)}class xt extends nt{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){const n=s.spanGaps?this._loop:this._fullLoop;rr(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Mr(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){const s=this.options,n=t[e],o=this.points,r=vn(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=_l(s);let c,h;for(c=0,h=r.length;ci!=="borderDash"&&i!=="fill"};function Os(i,t,e,s){const n=i.options,{[e]:o}=i.getProps([e],s);return Math.abs(t-o){a=Ei(r,a,n);const l=n[r],c=n[a];s!==null?(o.push({x:l.x,y:s}),o.push({x:c.x,y:s})):e!==null&&(o.push({x:e,y:l.y}),o.push({x:e,y:c.y}))}),o}function Ei(i,t,e){for(;t>i;t--){const s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function As(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function Wn(i,t){let e=[],s=!1;return B(i)?(s=!0,e=i):e=Al(i,t),e.length?new xt({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Ll(i,t,e){let n=i[t].fill;const o=[t];let r;if(!e)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!W(n))return n;if(r=i[n],!r)return!1;if(r.visible)return n;o.push(n),n=r.fill}return!1}function Tl(i,t,e){const s=Il(i);if(D(s))return isNaN(s.value)?!1:s;let n=parseFloat(s);return W(n)&&Math.floor(n)===n?Rl(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function Rl(i,t,e,s){return(i==="-"||i==="+")&&(e=t+e),e===t||e<0||e>=s?!1:e}function El(i,t){let e=null;return i==="start"?e=t.bottom:i==="end"?e=t.top:D(i)?e=t.getPixelForValue(i.value):t.getBasePixel&&(e=t.getBasePixel()),e}function Fl(i,t,e){let s;return i==="start"?s=e:i==="end"?s=t.options.reverse?t.min:t.max:D(i)?s=i.value:s=t.getBaseValue(),s}function Il(i){const t=i.options,e=t.fill;let s=P(e&&e.target,e);return s===void 0&&(s=!!t.backgroundColor),s===!1||s===null?!1:s===!0?"origin":s}function zl(i){const{scale:t,index:e,line:s}=i,n=[],o=s.segments,r=s.points,a=Bl(t,e);a.push(Wn({x:null,y:t.bottom},s));for(let l=0;l=0;--r){const a=n[r].$filler;!a||(a.line.updateControlPoints(o,a.axis),s&&ni(i.ctx,a,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;const s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){const o=s[n].$filler;o&&ni(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){const s=t.meta.$filler;!s||s.fill===!1||e.drawTime!=="beforeDatasetDraw"||ni(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Es=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}},ql=(i,t)=>i!==null&&t!==null&&i.datasetIndex===t.datasetIndex&&i.index===t.index;class Fs extends nt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=z(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const s=t.labels,n=j(s.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Es(s,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,o,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((g,p)=>{const m=s+e/2+o.measureText(g.text).width;(p===0||c[c.length-1]+m+2*a>r)&&(d+=h,c[c.length-(p>0?0:1)]=0,f+=h,u++),l[p]={left:0,top:f,row:u,width:m,height:n},c[c.length-1]+=m+a}),d}_fitCols(t,e,s,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,g=0,p=0;return this.legendItems.forEach((m,b)=>{const x=s+e/2+o.measureText(m.text).width;b>0&&f+n+2*a>h&&(d+=u+a,c.push({width:u,height:f}),g+=u+a,p++,u=f=0),l[b]={left:g,top:f,col:p,width:x,height:n},u=Math.max(u,x),f+=n+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,r=Rt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=K(s,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=K(s,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=K(s,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=K(s,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Fe(t,this),this._draw(),Ie(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:r}=t,a=O.color,l=Rt(t.rtl,this.left,this.width),c=j(r.font),{color:h,padding:d}=r,u=c.size,f=u/2;let g;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:p,boxHeight:m,itemHeight:b}=Es(r,u),x=function(M,S,w){if(isNaN(p)||p<=0||isNaN(m)||m<0)return;n.save();const T=P(w.lineWidth,1);if(n.fillStyle=P(w.fillStyle,a),n.lineCap=P(w.lineCap,"butt"),n.lineDashOffset=P(w.lineDashOffset,0),n.lineJoin=P(w.lineJoin,"miter"),n.lineWidth=T,n.strokeStyle=P(w.strokeStyle,a),n.setLineDash(P(w.lineDash,[])),r.usePointStyle){const L={radius:p*Math.SQRT2/2,pointStyle:w.pointStyle,rotation:w.rotation,borderWidth:T},A=l.xPlus(M,p/2),H=S+f;Oe(n,L,A,H)}else{const L=S+Math.max((u-m)/2,0),A=l.leftForLtr(M,p),H=St(w.borderRadius);n.beginPath(),Object.values(H).some(Y=>Y!==0)?ie(n,{x:A,y:L,w:p,h:m,radius:H}):n.rect(A,L,p,m),n.fill(),T!==0&&n.stroke()}n.restore()},y=function(M,S,w){Et(n,w.text,M,S+b/2,c,{strikethrough:w.hidden,textAlign:l.textAlign(w.textAlign)})},_=this.isHorizontal(),v=this._computeTitleHeight();_?g={x:K(o,this.left+d,this.right-s[0]),y:this.top+d+v,line:0}:g={x:this.left+d,y:K(o,this.top+v+d,this.bottom-e[0].height),line:0},bn(this.ctx,t.textDirection);const k=b+d;this.legendItems.forEach((M,S)=>{n.strokeStyle=M.fontColor||h,n.fillStyle=M.fontColor||h;const w=n.measureText(M.text).width,T=l.textAlign(M.textAlign||(M.textAlign=r.textAlign)),L=p+f+w;let A=g.x,H=g.y;l.setWidth(this.width),_?S>0&&A+L+d>this.right&&(H=g.y+=k,g.line++,A=g.x=K(o,this.left+d,this.right-s[g.line])):S>0&&H+k>this.bottom&&(A=g.x=A+e[g.line].width+d,g.line++,H=g.y=K(o,this.top+v+d,this.bottom-e[g.line].height));const Y=l.x(A);x(Y,H,M),A=Un(T,A+p+f,_?A+L:this.right,t.rtl),y(l.x(A),H,M),_?g.x+=L+d:g.y+=k}),xn(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,s=j(e.font),n=X(e.padding);if(!e.display)return;const o=Rt(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=s.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=K(t.align,d,this.right-u);else{const g=this.columnSizes.reduce((p,m)=>Math.max(p,m.height),0);h=c+K(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=K(a,d,d+u);r.textAlign=o.textAlign(Gs(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=s.string,Et(r,e.text,f,h,s)}_computeTitleHeight(){const t=this.options.title,e=j(t.font),s=X(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(lt(t,this.left,this.right)&<(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;si.chart.options.color,boxWidth:40,padding:10,generateLabels(i){const t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o}}=i.legend.options;return i._getSortedDatasetMetas().map(r=>{const a=r.controller.getStyle(e?0:void 0),l=X(a.borderWidth);return{text:t[r.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!r.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(l.width+l.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:0,datasetIndex:r.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};const ke={average(i){if(!i.length)return!1;let t,e,s=0,n=0,o=0;for(t=0,e=i.length;t-1?i.split(` -`):i}function Jl(i,t){const{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:i,label:r,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function Is(i,t){const e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:r,boxHeight:a}=t,l=j(t.bodyFont),c=j(t.titleFont),h=j(t.footerFont),d=o.length,u=n.length,f=s.length,g=X(t.padding);let p=g.height,m=0,b=s.reduce((_,v)=>_+v.before.length+v.lines.length+v.after.length,0);if(b+=i.beforeBody.length+i.afterBody.length,d&&(p+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=f*_+(b-f)*l.lineHeight+(b-1)*t.bodySpacing}u&&(p+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let x=0;const y=function(_){m=Math.max(m,e.measureText(_).width+x)};return e.save(),e.font=c.string,R(i.title,y),e.font=l.string,R(i.beforeBody.concat(i.afterBody),y),x=t.displayColors?r+2+t.boxPadding:0,R(s,_=>{R(_.before,y),R(_.lines,y),R(_.after,y)}),x=0,e.font=h.string,R(i.footer,y),e.restore(),m+=g.width,{width:m,height:p}}function Ql(i,t){const{y:e,height:s}=t;return ei.height-s/2?"bottom":"center"}function tc(i,t,e,s){const{x:n,width:o}=s,r=e.caretSize+e.caretPadding;if(i==="left"&&n+o+r>t.width||i==="right"&&n-o-r<0)return!0}function ec(i,t,e,s){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=i;let c="center";return s==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),tc(c,i,t,e)&&(c="center"),c}function zs(i,t,e){const s=e.yAlign||t.yAlign||Ql(i,e);return{xAlign:e.xAlign||t.xAlign||ec(i,t,e,s),yAlign:s}}function ic(i,t){let{x:e,width:s}=i;return t==="right"?e-=s:t==="center"&&(e-=s/2),e}function sc(i,t,e){let{y:s,height:n}=i;return t==="top"?s+=e:t==="bottom"?s-=n+e:s-=n/2,s}function Bs(i,t,e,s){const{caretSize:n,caretPadding:o,cornerRadius:r}=i,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=St(r);let g=ic(t,a);const p=sc(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,u)+n:a==="right"&&(g+=Math.max(d,f)+n),{x:$(g,0,s.width-t.width),y:$(p,0,s.height-t.height)}}function ye(i,t,e){const s=X(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function Vs(i){return et([],rt(i))}function nc(i,t,e){return bt(i,{tooltip:t,tooltipItems:e,type:"tooltip"})}function Ns(i,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}class oc extends nt{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,s=this.options.setContext(this.getContext()),n=s.enabled&&e.options.animation&&s.animations,o=new Mn(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=nc(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:s}=e,n=s.beforeTitle.apply(this,[t]),o=s.title.apply(this,[t]),r=s.afterTitle.apply(this,[t]);let a=[];return a=et(a,rt(n)),a=et(a,rt(o)),a=et(a,rt(r)),a}getBeforeBody(t,e){return Vs(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:s}=e,n=[];return R(t,o=>{const r={before:[],lines:[],after:[]},a=Ns(s,o);et(r.before,rt(a.beforeLabel.call(this,o))),et(r.lines,a.label.call(this,o)),et(r.after,rt(a.afterLabel.call(this,o))),n.push(r)}),n}getAfterBody(t,e){return Vs(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:s}=e,n=s.beforeFooter.apply(this,[t]),o=s.footer.apply(this,[t]),r=s.afterFooter.apply(this,[t]);let a=[];return a=et(a,rt(n)),a=et(a,rt(o)),a=et(a,rt(r)),a}_createItems(t){const e=this._active,s=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;lt.filter(h,d,u,s))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,s))),R(a,h=>{const d=Ns(t.callbacks,h);n.push(d.labelColor.call(this,h)),o.push(d.labelPointStyle.call(this,h)),r.push(d.labelTextColor.call(this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const s=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=ke[s.position].call(this,n,this._eventPosition);r=this._createItems(s),this.title=this.getTitle(r,s),this.beforeBody=this.getBeforeBody(r,s),this.body=this.getBody(r,s),this.afterBody=this.getAfterBody(r,s),this.footer=this.getFooter(r,s);const l=this._size=Is(this,s),c=Object.assign({},a,l),h=zs(this.chart,s,c),d=Bs(s,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){const o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=s,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=St(a),{x:u,y:f}=t,{width:g,height:p}=e;let m,b,x,y,_,v;return o==="center"?(_=f+p/2,n==="left"?(m=u,b=m-r,y=_+r,v=_-r):(m=u+g,b=m+r,y=_-r,v=_+r),x=m):(n==="left"?b=u+Math.max(l,h)+r:n==="right"?b=u+g-Math.max(c,d)-r:b=this.caretX,o==="top"?(y=f,_=y-r,m=b-r,x=b+r):(y=f+p,_=y+r,m=b+r,x=b-r),v=y),{x1:m,x2:b,x3:x,y1:y,y2:_,y3:v}}drawTitle(t,e,s){const n=this.title,o=n.length;let r,a,l;if(o){const c=Rt(s.rtl,this.x,this.width);for(t.x=ye(this,s.titleAlign,s),e.textAlign=c.textAlign(s.titleAlign),e.textBaseline="middle",r=j(s.titleFont),a=s.titleSpacing,e.fillStyle=s.titleColor,e.font=r.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ie(t,{x:m,y:p,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ie(t,{x:b,y:p+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,p,c,l),t.strokeRect(m,p,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,p+1,c-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=s,d=j(s.bodyFont);let u=d.lineHeight,f=0;const g=Rt(s.rtl,this.x,this.width),p=function(S){e.fillText(S,g.x(t.x+f),t.y+u/2),t.y+=u+o},m=g.textAlign(r);let b,x,y,_,v,k,M;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=ye(this,m,s),e.fillStyle=s.bodyColor,R(this.beforeBody,p),f=a&&m!=="right"?r==="center"?c/2+h:c+2+h:0,_=0,k=n.length;_0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){const r=ke[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=Is(this,t),l=Object.assign({},r,this._size),c=zs(e,t,l),h=Bs(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let s=this.opacity;if(!s)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;const r=X(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),bn(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),xn(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const s=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!we(s,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,s),a=this._positionChanged(r,t),l=e||!we(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e;const r=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:s,caretY:n,options:o}=this,r=ke[o.position].call(this,t,e);return r!==!1&&(s!==r.x||n!==r.y)}}oc.positioners=ke;const rc=(i,t,e,s)=>(typeof t=="string"?(e=i.push(t)-1,s.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function ac(i,t,e,s){const n=i.indexOf(t);if(n===-1)return rc(i,t,e,s);const o=i.lastIndexOf(t);return n!==o?e:n}const lc=(i,t)=>i===null?null:$(Math.round(i),0,t);class Re extends Dt{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const s=this.getLabels();for(const{index:n,label:o}of e)s[n]===o&&s.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,e){if(E(t))return null;const s=this.getLabels();return e=isFinite(e)&&s[e]===t?e:ac(s,t,P(e,t),this._addedLabels),lc(e,s.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:s,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(s=0),e||(n=this.getLabels().length-1)),this.min=s,this.max=n}buildTicks(){const t=this.min,e=this.max,s=this.options.offset,n=[];let o=this.getLabels();o=t===0&&e===o.length-1?o:o.slice(t,e+1),this._valueRange=Math.max(o.length-(s?0:1),1),this._startValue=this.min-(s?.5:0);for(let r=t;r<=e;r++)n.push({value:r});return n}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}Re.id="category";Re.defaults={ticks:{callback:Re.prototype.getLabelForValue}};function cc(i,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=i,f=o||1,g=h-1,{min:p,max:m}=t,b=!E(r),x=!E(a),y=!E(c),_=(m-p)/(d+1);let v=Vi((m-p)/g/f)*f,k,M,S,w;if(v<1e-14&&!b&&!x)return[{value:p},{value:m}];w=Math.ceil(m/v)-Math.floor(p/v),w>g&&(v=Vi(w*v/g/f)*f),E(l)||(k=Math.pow(10,l),v=Math.ceil(v*k)/k),n==="ticks"?(M=Math.floor(p/v)*v,S=Math.ceil(m/v)*v):(M=p,S=m),b&&x&&o&&no((a-r)/o,v/1e3)?(w=Math.round(Math.min((a-r)/v,h)),v=(a-r)/w,M=r,S=a):y?(M=b?r:M,S=x?a:S,w=c-1,v=(S-M)/w):(w=(S-M)/v,qt(w,Math.round(w),v/1e3)?w=Math.round(w):w=Math.ceil(w));const T=Math.max(Ni(v),Ni(M));k=Math.pow(10,E(l)?T:l),M=Math.round(M*k)/k,S=Math.round(S*k)/k;let L=0;for(b&&(u&&M!==r?(e.push({value:r}),Mn=e?n:l,a=l=>o=s?o:l;if(t){const l=it(n),c=it(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=1;(o>=Number.MAX_SAFE_INTEGER||n<=Number.MIN_SAFE_INTEGER)&&(l=Math.abs(o*.05)),a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:s}=t,n;return s?(n=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let s=this.getTickLimit();s=Math.max(2,s);const n={maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=cc(n,o);return t.bounds==="ticks"&&Qs(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){const n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return oe(t,this.chart.options.locale,this.options.ticks.format)}}class Fi extends Ee{determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?t:0,this.max=W(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,s=tt(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}Fi.id="linear";Fi.defaults={ticks:{callback:Be.formatters.numeric}};function Hs(i){return i/Math.pow(10,Math.floor(J(i)))===1}function hc(i,t){const e=Math.floor(J(t.max)),s=Math.ceil(t.max/Math.pow(10,e)),n=[];let o=Z(i.min,Math.pow(10,Math.floor(J(t.min)))),r=Math.floor(J(o)),a=Math.floor(o/Math.pow(10,r)),l=r<0?Math.pow(10,Math.abs(r)):1;do n.push({value:o,major:Hs(o)}),++a,a===10&&(a=1,++r,l=r>=0?1:l),o=Math.round(a*Math.pow(10,r)*l)/l;while(r0?s:null}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=W(t)?Math.max(0,t):null,this.max=W(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let s=this.min,n=this.max;const o=l=>s=t?s:l,r=l=>n=e?n:l,a=(l,c)=>Math.pow(10,Math.floor(J(l))+c);s===n&&(s<=0?(o(1),r(10)):(o(a(s,-1)),r(a(n,1)))),s<=0&&o(a(n,-1)),n<=0&&r(a(s,1)),this._zero&&this.min!==this._suggestedMin&&s===a(this.min,0)&&o(a(s,-1)),this.min=s,this.max=n}buildTicks(){const t=this.options,e={min:this._userMin,max:this._userMax},s=hc(e,this);return t.bounds==="ticks"&&Qs(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}getLabelForValue(t){return t===void 0?"0":oe(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=J(t),this._valueRange=J(this.max)-J(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(J(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}jn.id="logarithmic";jn.defaults={ticks:{callback:Be.formatters.logarithmic,major:{enabled:!0}}};function gi(i){const t=i.ticks;if(t.display&&i.display){const e=X(t.backdropPadding);return P(t.font&&t.font.size,O.font.size)+e.height}return 0}function dc(i,t,e){return e=B(e)?e:[e],{w:To(i,t.string,e),h:e.length*t.lineHeight}}function js(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:in?{start:t-e,end:t}:{start:t,end:t+e}}function uc(i){const t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],o=i._pointLabels.length,r=i.options.pointLabels,a=r.centerPointLabels?N/o:0;for(let l=0;lt.r&&(a=(s.end-t.r)/o,i.r=Math.max(i.r,t.r+a)),n.startt.b&&(l=(n.end-t.b)/r,i.b=Math.max(i.b,t.b+l))}function gc(i,t,e){const s=[],n=i._pointLabels.length,o=i.options,r=gi(o)/2,a=i.drawingArea,l=o.pointLabels.centerPointLabels?N/n:0;for(let c=0;c270||e<90)&&(i-=t),i}function xc(i,t){const{ctx:e,options:{pointLabels:s}}=i;for(let n=t-1;n>=0;n--){const o=s.setContext(i.getPointLabelContext(n)),r=j(o.font),{x:a,y:l,textAlign:c,left:h,top:d,right:u,bottom:f}=i._pointLabelItems[n],{backdropColor:g}=o;if(!E(g)){const p=St(o.borderRadius),m=X(o.backdropPadding);e.fillStyle=g;const b=h-m.left,x=d-m.top,y=u-h+m.width,_=f-d+m.height;Object.values(p).some(v=>v!==0)?(e.beginPath(),ie(e,{x:b,y:x,w:y,h:_,radius:p}),e.fill()):e.fillRect(b,x,y,_)}Et(e,i._pointLabels[n],a,l+r.lineHeight/2,r,{color:o.color,textAlign:c,textBaseline:"middle"})}}function $n(i,t,e,s){const{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,I);else{let o=i.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let r=1;r{const n=z(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){const t=this.options;t.display&&t.pointLabels.display?uc(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){const e=I/(this._pointLabels.length||1),s=this.options.startAngle||0;return q(t*e+tt(s))}getDistanceFromCenterForValue(t){if(E(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(E(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t{if(h!==0){a=this.getDistanceFromCenterForValue(c.value);const d=n.setContext(this.getContext(h-1));_c(this,d,a,o)}}),s.display){for(t.save(),r=o-1;r>=0;r--){const c=s.setContext(this.getPointLabelContext(r)),{color:h,lineWidth:d}=c;!d||!h||(t.lineWidth=d,t.strokeStyle=h,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),l=this.getPointPosition(r,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(l.x,l.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;const n=this.getIndexAngle(0);let o,r;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&!e.reverse)return;const c=s.setContext(this.getContext(l)),h=j(c.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),c.showLabelBackdrop){t.font=h.string,r=t.measureText(a.label).width,t.fillStyle=c.backdropColor;const d=X(c.backdropPadding);t.fillRect(-r/2-d.left,-o-h.size/2-d.top,r+d.width,h.size+d.height)}Et(t,a.label,0,-o,h,{color:c.color})}),t.restore()}drawTitle(){}}Ne.id="radialLinear";Ne.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Be.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(i){return i},padding:5,centerPointLabels:!1}};Ne.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Ne.descriptors={angleLines:{_fallback:"grid"}};const We={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},U=Object.keys(We);function vc(i,t){return i-t}function $s(i,t){if(E(t))return null;const e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts;let r=t;return typeof s=="function"&&(r=s(r)),W(r)||(r=typeof s=="string"?e.parse(r,s):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Qt(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function Ys(i,t,e,s){const n=U.length;for(let o=U.indexOf(i);o=U.indexOf(e);o--){const r=U[o];if(We[r].common&&i._adapter.diff(n,s,r)>=t-1)return r}return U[e?U.indexOf(e):0]}function kc(i){for(let t=U.indexOf(i)+1,e=U.length;t=t?e[s]:e[n];i[o]=!0}}function wc(i,t,e,s){const n=i._adapter,o=+n.startOf(t[0].value,s),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,s))l=e[a],l>=0&&(t[l].major=!0);return t}function Us(i,t,e){const s=[],n={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t){let e=0,s=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?s=o:s=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=$(e,0,r),s=$(s,0,r),this._offsets={start:e,end:s,factor:1/(e+1+s)}}_generate(){const t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,r=o.unit||Ys(o.minUnit,e,s,this._getLabelCapacity(e)),a=P(o.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Qt(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(s,e,r)>1e5*a)throw new Error(e+" and "+s+" are too far apart with stepSize of "+a+" "+r);const g=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;up-m).map(p=>+p)}getLabelForValue(t){const e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}_tickFormatFunction(t,e,s,n){const o=this.options,r=o.time.displayFormats,a=this._unit,l=this._majorUnit,c=a&&r[a],h=l&&r[l],d=s[e],u=l&&h&&d&&d.major,f=this._adapter.format(t,n||(u?h:c)),g=o.ticks.callback;return g?z(g,[f,e,s],this):f}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,s;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,s=n.length;e=i[s].pos&&t<=i[n].pos&&({lo:s,hi:n}=wt(i,"pos",t)),{pos:o,time:a}=i[s],{pos:r,time:l}=i[n]):(t>=i[s].time&&t<=i[n].time&&({lo:s,hi:n}=wt(i,"time",t)),{time:o,pos:a}=i[s],{time:r,pos:l}=i[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Yn extends He{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=ve(e,this.min),this._tableRange=ve(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:s}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r=e&&c<=s&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:s,pos:1}];for(r=0,a=n.length;r=0)&&(!Object.prototype.propertyIsEnumerable.call(r,o)||(n[o]=r[o]))}return n}function v(r,i){if(r==null)return{};var n={},o=Object.keys(r),e,t;for(t=0;t=0)&&(n[e]=r[e]);return n}var p=f.exports.forwardRef(function(r,i){var n=r.color,o=n===void 0?"currentColor":n,e=r.size,t=e===void 0?24:e,a=c(r,["color","size"]);return l("svg",{ref:i,xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:o,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:l("polyline",{points:"6 9 12 15 18 9"})})});p.propTypes={color:s.exports.string,size:s.exports.oneOfType([s.exports.string,s.exports.number])};p.displayName="ChevronDown";const u=p;export{u as C}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/chevron-down.e7f05dbc.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/chevron-down.e7f05dbc.js deleted file mode 100644 index 053f26ec2..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/chevron-down.e7f05dbc.js +++ /dev/null @@ -1 +0,0 @@ -var u=Object.defineProperty,y=Object.defineProperties;var g=Object.getOwnPropertyDescriptors;var l=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var p=(r,e,o)=>e in r?u(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,f=(r,e)=>{for(var o in e||(e={}))w.call(e,o)&&p(r,o,e[o]);if(l)for(var o of l(e))b.call(e,o)&&p(r,o,e[o]);return r},v=(r,e)=>y(r,g(e));import{r as d,j as c,P as s}from"./index.5901d226.js";function j(r,e){if(r==null)return{};var o=O(r,e),n,t;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(t=0;t=0)&&(!Object.prototype.propertyIsEnumerable.call(r,n)||(o[n]=r[n]))}return o}function O(r,e){if(r==null)return{};var o={},n=Object.keys(r),t,i;for(i=0;i=0)&&(o[t]=r[t]);return o}var a=d.exports.forwardRef(function(r,e){var o=r.color,n=o===void 0?"currentColor":o,t=r.size,i=t===void 0?24:t,h=j(r,["color","size"]);return c("svg",v(f({ref:e,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:n,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},h),{children:c("polyline",{points:"6 9 12 15 18 9"})}))});a.propTypes={color:s.string,size:s.oneOfType([s.string,s.number])};a.displayName="ChevronDown";var x=a;export{x as C}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/debounce.c2d20996.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/debounce.c2d20996.js new file mode 100644 index 000000000..3f3779c44 --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/debounce.c2d20996.js @@ -0,0 +1 @@ +function O(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var M=typeof global=="object"&&global&&global.Object===Object&&global;const R=M;var w=typeof self=="object"&&self&&self.Object===Object&&self,B=R||w||Function("return this")();const W=B;var F=function(){return W.Date.now()};const S=F;var G=/\s/;function U(e){for(var n=e.length;n--&&G.test(e.charAt(n)););return n}var _=/^\s+/;function D(e){return e&&e.slice(0,U(e)+1).replace(_,"")}var H=W.Symbol;const y=H;var L=Object.prototype,X=L.hasOwnProperty,q=L.toString,g=y?y.toStringTag:void 0;function z(e){var n=X.call(e,g),i=e[g];try{e[g]=void 0;var o=!0}catch{}var f=q.call(e);return o&&(n?e[g]=i:delete e[g]),f}var J=Object.prototype,K=J.toString;function Q(e){return K.call(e)}var V="[object Null]",Y="[object Undefined]",$=y?y.toStringTag:void 0;function Z(e){return e==null?e===void 0?Y:V:$&&$ in Object(e)?z(e):Q(e)}function ee(e){return e!=null&&typeof e=="object"}var ne="[object Symbol]";function te(e){return typeof e=="symbol"||ee(e)&&Z(e)==ne}var E=0/0,re=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,oe=/^0o[0-7]+$/i,ae=parseInt;function k(e){if(typeof e=="number")return e;if(te(e))return E;if(O(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=O(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=D(e);var i=ie.test(e);return i||oe.test(e)?ae(e.slice(2),i?2:8):re.test(e)?E:+e}var fe="Expected a function",ce=Math.max,ue=Math.min;function se(e,n,i){var o,f,s,u,r,c,d=0,v=!1,l=!1,T=!0;if(typeof e!="function")throw new TypeError(fe);n=k(n)||0,O(i)&&(v=!!i.leading,l="maxWait"in i,s=l?ce(k(i.maxWait)||0,n):s,T="trailing"in i?!!i.trailing:T);function j(t){var a=o,b=f;return o=f=void 0,d=t,u=e.apply(b,a),u}function N(t){return d=t,r=setTimeout(m,n),v?j(t):u}function P(t){var a=t-c,b=t-d,I=n-a;return l?ue(I,s-b):I}function h(t){var a=t-c,b=t-d;return c===void 0||a>=n||a<0||l&&b>=s}function m(){var t=S();if(h(t))return x(t);r=setTimeout(m,P(t))}function x(t){return r=void 0,T&&o?j(t):(o=f=void 0,u)}function A(){r!==void 0&&clearTimeout(r),d=0,o=c=f=r=void 0}function C(){return r===void 0?u:x(S())}function p(){var t=S(),a=h(t);if(o=arguments,f=this,c=t,a){if(r===void 0)return N(c);if(l)return clearTimeout(r),r=setTimeout(m,n),j(c)}return r===void 0&&(r=setTimeout(m,n)),u}return p.cancel=A,p.flush=C,p}export{se as d}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/debounce.d080d5e1.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/debounce.d080d5e1.js deleted file mode 100644 index fd75806ae..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/debounce.d080d5e1.js +++ /dev/null @@ -1 +0,0 @@ -function S(e){var n=typeof e;return e!=null&&(n=="object"||n=="function")}var M=typeof global=="object"&&global&&global.Object===Object&&global,R=M,w=typeof self=="object"&&self&&self.Object===Object&&self,B=R||w||Function("return this")(),W=B,F=function(){return W.Date.now()},p=F,G=/\s/;function U(e){for(var n=e.length;n--&&G.test(e.charAt(n)););return n}var _=/^\s+/;function D(e){return e&&e.slice(0,U(e)+1).replace(_,"")}var H=W.Symbol,y=H,L=Object.prototype,X=L.hasOwnProperty,q=L.toString,g=y?y.toStringTag:void 0;function z(e){var n=X.call(e,g),i=e[g];try{e[g]=void 0;var o=!0}catch{}var f=q.call(e);return o&&(n?e[g]=i:delete e[g]),f}var J=Object.prototype,K=J.toString;function Q(e){return K.call(e)}var V="[object Null]",Y="[object Undefined]",$=y?y.toStringTag:void 0;function Z(e){return e==null?e===void 0?Y:V:$&&$ in Object(e)?z(e):Q(e)}function ee(e){return e!=null&&typeof e=="object"}var ne="[object Symbol]";function te(e){return typeof e=="symbol"||ee(e)&&Z(e)==ne}var E=0/0,re=/^[-+]0x[0-9a-f]+$/i,ie=/^0b[01]+$/i,oe=/^0o[0-7]+$/i,ae=parseInt;function k(e){if(typeof e=="number")return e;if(te(e))return E;if(S(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=S(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=D(e);var i=ie.test(e);return i||oe.test(e)?ae(e.slice(2),i?2:8):re.test(e)?E:+e}var fe="Expected a function",ce=Math.max,ue=Math.min;function se(e,n,i){var o,f,s,u,r,c,d=0,O=!1,l=!1,T=!0;if(typeof e!="function")throw new TypeError(fe);n=k(n)||0,S(i)&&(O=!!i.leading,l="maxWait"in i,s=l?ce(k(i.maxWait)||0,n):s,T="trailing"in i?!!i.trailing:T);function j(t){var a=o,b=f;return o=f=void 0,d=t,u=e.apply(b,a),u}function N(t){return d=t,r=setTimeout(m,n),O?j(t):u}function P(t){var a=t-c,b=t-d,I=n-a;return l?ue(I,s-b):I}function h(t){var a=t-c,b=t-d;return c===void 0||a>=n||a<0||l&&b>=s}function m(){var t=p();if(h(t))return x(t);r=setTimeout(m,P(t))}function x(t){return r=void 0,T&&o?j(t):(o=f=void 0,u)}function A(){r!==void 0&&clearTimeout(r),d=0,o=c=f=r=void 0}function C(){return r===void 0?u:x(p())}function v(){var t=p(),a=h(t);if(o=arguments,f=this,c=t,a){if(r===void 0)return N(c);if(l)return clearTimeout(r),r=setTimeout(m,n),j(c)}return r===void 0&&(r=setTimeout(m,n)),u}return v.cancel=A,v.flush=C,v}export{se as d}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.0e7e7dfd.css b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.0e7e7dfd.css deleted file mode 100644 index 4f664011b..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.0e7e7dfd.css +++ /dev/null @@ -1 +0,0 @@ -@charset "UTF-8";/*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */*,:before,:after{box-sizing:border-box}html{tab-size:4}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"}hr{height:0;color:inherit}abbr[title]{-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button}::-moz-focus-inner{border-style:none;padding:0}:-moz-focusring{outline:1px dotted ButtonText}:-moz-ui-invalid{box-shadow:none}legend{padding:0}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}.relative,.border-left,.border-top,.border-bottom{position:relative}.border-bottom:after,.border-top:before{position:absolute;content:"";height:1px;width:100%;-webkit-transform:scaleY(.5) translateZ(0);transform:scaleY(.5) translateZ(0);left:0;right:0;background:#555}.border-left:before{position:absolute;content:"";height:100%;width:1px;-webkit-transform:scaleX(.5) translateZ(0);transform:scaleX(.5) translateZ(0);top:0;bottom:0;background:#555}.border-top:before{top:0}.border-bottom:after{bottom:0}.border-left:before{left:0}*,*:before,*:after{box-sizing:border-box}:root{--font-mono: "Roboto Mono", Menlo, monospace;--font-normal: Inter, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, "PingFang SC", "Microsoft YaHei", "\5fae\8f6f\96c5\9ed1", Arial, sans-serif;--color-focus-blue: #1a73e8;--btn-bg: #387cec}body{font-family:var(--font-normal);-webkit-tap-highlight-color:rgba(0,0,0,0);-webkit-text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;margin:0;padding:0}@media (prefers-color-scheme: dark){:root[data-theme=auto]{--color-background: #202020;--color-background2: rgba(32, 32, 32, .3);--color-bg-card: #2d2d2d;--card-hover-border-lightness: 30%;--color-text: #ddd;--color-text-secondary: #ccc;--color-text-highlight: #fff;--color-bg-sidebar: #2d2d30;--color-sb-active-row-bg: #494b4e;--color-input-bg: #2d2d30;--color-input-border: #3f3f3f;--color-toggle-bg: #353535;--color-toggle-selected: #181818;--color-icon: #c7c7c7;--color-separator: #333;--color-btn-bg: #232323;--color-btn-fg: #bebebe;--color-bg-proxy: #303030;--color-row-odd: #282828;--bg-log-info-tag: #454545;--bg-modal: #1f1f20;--bg-near-transparent: rgba(255, 255, 255, .1);--bg-tooltip: #111;--bc-tooltip: #555;--select-border-color: #040404;--select-bg-hover: url(data:image/svg+xml,%0A%20%20%20%20%3Csvg%20width%3D%228%22%20height%3D%2224%22%20viewBox%3D%220%200%208%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%20%20%3Cpath%20d%3D%22M4%207L7%2011H1L4%207Z%22%20fill%3D%22%23ffffff%22%20%2F%3E%0A%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2017L1%2013L7%2013L4%2017Z%22%20fill%3D%22%23ffffff%22%20%2F%3E%0A%20%20%20%20%3C%2Fsvg%3E%0A%20%20);--color-proxy-dot-selected-ind-bo: transparent;color-scheme:dark}}@media (prefers-color-scheme: light){:root[data-theme=auto]{--color-background: #eee;--color-background2: rgba(240, 240, 240, .3);--color-bg-card: #fafafa;--card-hover-border-lightness: 80%;--color-text: #222;--color-text-secondary: #646464;--color-text-highlight: #040404;--color-bg-sidebar: #f8f8f8;--color-sb-active-row-bg: #d8d8d8;--color-input-bg: #f0f0f0;--color-input-border: #c0c0c0;--color-toggle-bg: #ffffff;--color-toggle-selected: #d7d7d7;--color-icon: #5b5b5b;--color-separator: #ccc;--color-btn-bg: #f4f4f4;--color-btn-fg: #101010;--color-bg-proxy: #fafafa;--color-row-odd: #f5f5f5;--bg-log-info-tag: #888;--bg-modal: #fbfbfb;--bg-near-transparent: rgba(0, 0, 0, .1);--bg-tooltip: #f0f0f0;--bc-tooltip: #ccc;--select-border-color: #999999;--select-bg-hover: url(data:image/svg+xml,%0A%20%20%20%20%3Csvg%20width%3D%228%22%20height%3D%2224%22%20viewBox%3D%220%200%208%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%20%20%3Cpath%20d%3D%22M4%207L7%2011H1L4%207Z%22%20fill%3D%22%23222222%22%20%2F%3E%0A%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2017L1%2013L7%2013L4%2017Z%22%20fill%3D%22%23222222%22%20%2F%3E%0A%20%20%20%20%3C%2Fsvg%3E%0A%20%20);--color-proxy-dot-selected-ind-bo: #888;color-scheme:light}}:root[data-theme=dark]{--color-background: #202020;--color-background2: rgba(32, 32, 32, .3);--color-bg-card: #2d2d2d;--card-hover-border-lightness: 30%;--color-text: #ddd;--color-text-secondary: #ccc;--color-text-highlight: #fff;--color-bg-sidebar: #2d2d30;--color-sb-active-row-bg: #494b4e;--color-input-bg: #2d2d30;--color-input-border: #3f3f3f;--color-toggle-bg: #353535;--color-toggle-selected: #181818;--color-icon: #c7c7c7;--color-separator: #333;--color-btn-bg: #232323;--color-btn-fg: #bebebe;--color-bg-proxy: #303030;--color-row-odd: #282828;--bg-log-info-tag: #454545;--bg-modal: #1f1f20;--bg-near-transparent: rgba(255, 255, 255, .1);--bg-tooltip: #111;--bc-tooltip: #555;--select-border-color: #040404;--select-bg-hover: url(data:image/svg+xml,%0A%20%20%20%20%3Csvg%20width%3D%228%22%20height%3D%2224%22%20viewBox%3D%220%200%208%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%20%20%3Cpath%20d%3D%22M4%207L7%2011H1L4%207Z%22%20fill%3D%22%23ffffff%22%20%2F%3E%0A%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2017L1%2013L7%2013L4%2017Z%22%20fill%3D%22%23ffffff%22%20%2F%3E%0A%20%20%20%20%3C%2Fsvg%3E%0A%20%20);--color-proxy-dot-selected-ind-bo: transparent;color-scheme:dark}:root[data-theme=light]{--color-background: #eee;--color-background2: rgba(240, 240, 240, .3);--color-bg-card: #fafafa;--card-hover-border-lightness: 80%;--color-text: #222;--color-text-secondary: #646464;--color-text-highlight: #040404;--color-bg-sidebar: #f8f8f8;--color-sb-active-row-bg: #d8d8d8;--color-input-bg: #f0f0f0;--color-input-border: #c0c0c0;--color-toggle-bg: #ffffff;--color-toggle-selected: #d7d7d7;--color-icon: #5b5b5b;--color-separator: #ccc;--color-btn-bg: #f4f4f4;--color-btn-fg: #101010;--color-bg-proxy: #fafafa;--color-row-odd: #f5f5f5;--bg-log-info-tag: #888;--bg-modal: #fbfbfb;--bg-near-transparent: rgba(0, 0, 0, .1);--bg-tooltip: #f0f0f0;--bc-tooltip: #ccc;--select-border-color: #999999;--select-bg-hover: url(data:image/svg+xml,%0A%20%20%20%20%3Csvg%20width%3D%228%22%20height%3D%2224%22%20viewBox%3D%220%200%208%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%20%20%3Cpath%20d%3D%22M4%207L7%2011H1L4%207Z%22%20fill%3D%22%23222222%22%20%2F%3E%0A%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2017L1%2013L7%2013L4%2017Z%22%20fill%3D%22%23222222%22%20%2F%3E%0A%20%20%20%20%3C%2Fsvg%3E%0A%20%20);--color-proxy-dot-selected-ind-bo: #888;color-scheme:light}.flexCenter{display:flex;align-items:center;justify-content:center}.fabgrp{position:fixed;z-index:3;right:20px;bottom:20px}.visually-hidden{position:absolute;overflow:hidden;clip:rect(0 0 0 0);width:1px;height:1px;margin:-1px;border:0;padding:0}:root{--reach-tooltip: 1}[data-reach-tooltip]{z-index:1;pointer-events:none;position:absolute;padding:.25em .5em;box-shadow:2px 2px 10px #0000001a;white-space:nowrap;font-size:85%;background:var(--bg-tooltip);color:var(--color-text);border:solid 1px var(--bc-tooltip);border-radius:4px}@font-face{font-family:Roboto Mono;font-style:normal;font-display:swap;font-weight:400;src:url(./roboto-mono-latin-400-normal.e1fd013a.woff2) format("woff2"),url(./roboto-mono-latin-400-normal.2dfc0e86.woff) format("woff")}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:400;src:url(./inter-latin-400-normal.d56fec21.woff2) format("woff2"),url(./inter-latin-400-normal.9ec803ce.woff) format("woff")}@font-face{font-family:Inter;font-style:normal;font-display:swap;font-weight:800;src:url(./inter-latin-800-normal.5eea1309.woff2) format("woff2"),url(./inter-latin-800-normal.98c540b2.woff) format("woff")}._root_1o14m_1{height:76px;display:flex;align-items:center}._h1_1o14m_7{padding:0 15px;font-size:1.7em;text-align:left;margin:0}@media screen and (min-width: 30em){._h1_1o14m_7{padding:0 40px;font-size:2em}}._root_dn70c_1{padding:6px 15px}@media screen and (min-width: 30em){._root_dn70c_1{padding:10px 40px}}._mono_dn70c_10{font-family:var(--font-mono)}._link_dn70c_14{color:var(--color-text-secondary);display:inline-flex}._link_dn70c_14:hover{color:var(--color-text-highlight)}._loading_74j3j_1{width:100%;height:100%;display:flex;justify-content:center;align-items:center}._spinner_74j3j_9{width:20px;height:20px;display:inline-block;vertical-align:middle;-webkit-animation:_rotate_74j3j_1 1s steps(12,end) infinite;animation:_rotate_74j3j_1 1s steps(12,end) infinite;background:transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;background-size:100%}@-webkit-keyframes _rotate_74j3j_1{0%{-webkit-transform:rotate3d(0,0,1,0deg);transform:rotate3d(0,0,1,0)}to{-webkit-transform:rotate3d(0,0,1,360deg);transform:rotate3d(0,0,1,360deg)}}@keyframes _rotate_74j3j_1{0%{-webkit-transform:rotate3d(0,0,1,0deg);transform:rotate3d(0,0,1,0)}to{-webkit-transform:rotate3d(0,0,1,360deg);transform:rotate3d(0,0,1,360deg)}}._ul_1d6f2_1{position:relative;margin:0;padding:0;list-style:none;line-height:1.8;--width-max-content: 230px}._li_1d6f2_10{position:relative;margin:5px 0;padding:10px 0;border-radius:10px;display:grid;place-content:center;grid-template-columns:40px 1fr 40px;grid-template-rows:30px;grid-template-areas:"close url .";-webkit-column-gap:10px;column-gap:10px;border:1px solid var(--bg-near-transparent)}._li_1d6f2_10:hover{background-color:var(--bg-near-transparent)}._close_1d6f2_28{opacity:0;grid-area:close;place-self:center;cursor:pointer}._li_1d6f2_10:hover ._close_1d6f2_28,._li_1d6f2_10:hover ._eye_1d6f2_36{opacity:1}._close_1d6f2_28:focus,._eye_1d6f2_36:focus{opacity:1}._hasSecret_1d6f2_45{grid-template-rows:repeat(2,30px);grid-template-areas:"close url ." "close secret eye"}._url_1d6f2_50{grid-area:url}._secret_1d6f2_54{grid-area:secret}._eye_1d6f2_36{grid-area:eye;opacity:0;place-self:center;cursor:pointer}._url_1d6f2_50,._secret_1d6f2_54{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}._btn_1d6f2_72{outline:none;-webkit-appearance:none;appearance:none;border:1px solid transparent;background-color:transparent;color:inherit;display:flex;align-items:center;padding:5px;border-radius:100px}._btn_1d6f2_72:focus{border-color:var(--color-focus-blue)}._btn_1d6f2_72:hover:enabled{background-color:var(--color-focus-blue);color:#fff}._btn_1d6f2_72:active:enabled{-webkit-transform:scale(.97);transform:scale(.97)}._btn_1d6f2_72:disabled{color:var(--color-text-secondary)}._url_1d6f2_50{cursor:pointer}._url_1d6f2_50:hover{color:var(--color-text-highlight)}._root_zwtea_1:focus{outline:none}._header_zwtea_5{display:flex;justify-content:center;align-items:center}._header_zwtea_5 ._icon_zwtea_10{--stroke: #f3f3f3;color:#20497e;opacity:.7;transition:opacity .4s}._header_zwtea_5 ._icon_zwtea_10:hover{opacity:1}._body_zwtea_20{padding:15px 0 0}._hostnamePort_zwtea_24{display:flex}._hostnamePort_zwtea_24 div{flex:1 1 auto}._hostnamePort_zwtea_24 div:nth-child(2){flex-grow:0;flex-basis:120px;margin-left:10px}._error_zwtea_36{height:20px;font-size:.8em;color:#ff8b8b}._footer_zwtea_42{padding:5px 0 10px;display:flex;justify-content:flex-end;align-items:center}._btn_lzu00_1{-webkit-appearance:none;outline:none;-webkit-user-select:none;user-select:none;position:relative;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;color:var(--color-btn-fg);background:var(--color-btn-bg);border:1px solid #555;border-radius:100px;padding:10px 13px}._btn_lzu00_1:focus{border-color:var(--color-focus-blue)}._btn_lzu00_1:hover{background:#387cec;border:1px solid #387cec;color:#fff}._btn_lzu00_1:active{-webkit-transform:scale(.97);transform:scale(.97)}._btn_lzu00_1._circular_lzu00_27{padding:8px}._btn_lzu00_1._minimal_lzu00_30{border-color:transparent;background:none;padding:6px 12px}._btn_lzu00_1._minimal_lzu00_30:focus{border-color:var(--color-focus-blue)}._btn_lzu00_1._minimal_lzu00_30:hover{color:#fff;background:#387cec;border:1px solid #387cec}._btn_lzu00_1:disabled{opacity:.5}._btnStart_lzu00_48{margin-right:5px;display:inline-flex;align-items:center;justify-content:center}._loadingContainer_lzu00_55{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);display:inline-flex}h2._sectionNameType_8lri2_1{margin:0;font-size:1.3em}@media screen and (min-width: 30em){h2._sectionNameType_8lri2_1{font-size:1.5em}}h2._sectionNameType_8lri2_1 span:nth-child(2){font-size:12px;color:#777;font-weight:400;margin:0 .3em}:root[data-theme=light]{--loading-dot-1-1: rgba(0, 0, 0, .1);--loading-dot-1-2: rgba(0, 0, 0, .5);--loading-dot-1-3: rgba(0, 0, 0, .3);--loading-dot-2-1: rgba(0, 0, 0, .3);--loading-dot-2-2: rgba(0, 0, 0, .1);--loading-dot-2-3: rgba(0, 0, 0, .5);--loading-dot-3-1: rgba(0, 0, 0, .5);--loading-dot-3-2: rgba(0, 0, 0, .3);--loading-dot-3-3: rgba(0, 0, 0, .1)}:root[data-theme=dark]{--loading-dot-1-1: rgba(255, 255, 255, .5);--loading-dot-1-2: rgba(255, 255, 255, .1);--loading-dot-1-3: rgba(255, 255, 255, .3);--loading-dot-2-1: rgba(255, 255, 255, .3);--loading-dot-2-2: rgba(255, 255, 255, .5);--loading-dot-2-3: rgba(255, 255, 255, .1);--loading-dot-3-1: rgba(255, 255, 255, .1);--loading-dot-3-2: rgba(255, 255, 255, .3);--loading-dot-3-3: rgba(255, 255, 255, .5)}._loadingDot_8lri2_66,._loadingDot_8lri2_66:before,._loadingDot_8lri2_66:after{display:inline-block;vertical-align:middle;width:6px;height:6px;border-radius:50%;font-size:0}._loadingDot_8lri2_66{position:relative;background-color:var(--loading-dot-2-1);-webkit-animation:_dot2_8lri2_1 1s step-start infinite;animation:_dot2_8lri2_1 1s step-start infinite}._loadingDot_8lri2_66:before{content:"";position:absolute;left:-12px;background-color:var(--loading-dot-1-1);-webkit-animation:_dot1_8lri2_1 1s step-start infinite;animation:_dot1_8lri2_1 1s step-start infinite}._loadingDot_8lri2_66:after{content:"";position:absolute;right:-12px;background-color:var(--loading-dot-3-1);-webkit-animation:_dot3_8lri2_1 1s step-start infinite;animation:_dot3_8lri2_1 1s step-start infinite}@-webkit-keyframes _dot1_8lri2_1{0%,to{background-color:var(--loading-dot-1-1)}33%{background-color:var(--loading-dot-1-2)}66%{background-color:var(--loading-dot-1-3)}}@keyframes _dot1_8lri2_1{0%,to{background-color:var(--loading-dot-1-1)}33%{background-color:var(--loading-dot-1-2)}66%{background-color:var(--loading-dot-1-3)}}@-webkit-keyframes _dot2_8lri2_1{0%,to{background-color:var(--loading-dot-2-1)}33%{background-color:var(--loading-dot-2-2)}66%{background-color:var(--loading-dot-2-3)}}@keyframes _dot2_8lri2_1{0%,to{background-color:var(--loading-dot-2-1)}33%{background-color:var(--loading-dot-2-2)}66%{background-color:var(--loading-dot-2-3)}}@-webkit-keyframes _dot3_8lri2_1{0%,to{background-color:var(--loading-dot-3-1)}33%{background-color:var(--loading-dot-3-2)}66%{background-color:var(--loading-dot-3-3)}}@keyframes _dot3_8lri2_1{0%,to{background-color:var(--loading-dot-3-1)}33%{background-color:var(--loading-dot-3-2)}66%{background-color:var(--loading-dot-3-3)}}._root_1or8t_1{position:relative;padding:10px 0}._root_1or8t_1 input{-webkit-appearance:none;background-color:transparent;background-image:none;border:none;border-radius:0;border-bottom:1px solid var(--color-input-border);box-sizing:border-box;color:inherit;display:inline-block;font-size:inherit;height:40px;outline:none;padding:0 4px;width:100%}._root_1or8t_1 input:focus{border-color:var(--color-focus-blue)}._root_1or8t_1 label{position:absolute;left:5px;bottom:22px;transition:-webkit-transform .15s ease-in-out;transition:transform .15s ease-in-out;transition:transform .15s ease-in-out,-webkit-transform .15s ease-in-out;-webkit-transform-origin:0 0;transform-origin:0 0;font-size:.9em}._root_1or8t_1 label._floatAbove_1or8t_32{-webkit-transform:scale(.75) translateY(-25px);transform:scale(.75) translateY(-25px)}._root_1or8t_1 input:focus+label{color:var(--color-focus-blue);-webkit-transform:scale(.75) translateY(-25px);transform:scale(.75) translateY(-25px)}._path_r8pm3_1{stroke-dasharray:890;stroke-dashoffset:890;-webkit-animation:_dash_r8pm3_1 3s ease-in-out forwards normal infinite;animation:_dash_r8pm3_1 3s ease-in-out forwards normal infinite}@-webkit-keyframes _dash_r8pm3_1{0%{stroke-dashoffset:890}to{stroke-dashoffset:0}}@keyframes _dash_r8pm3_1{0%{stroke-dashoffset:890}to{stroke-dashoffset:0}}[data-reach-menu-button]{--sz: 40px;width:var(--sz);height:var(--sz);display:inline-flex;align-items:center;justify-content:center;-webkit-appearance:none;outline:none;-webkit-user-select:none;user-select:none;cursor:pointer;color:var(--color-btn-fg);background:none;border:1px solid transparent;border-radius:20px}[data-reach-menu-button]:hover{opacity:.6}[data-reach-menu-button]:focus{border-color:var(--color-focus-blue)}[data-reach-menu-list]{background:var(--bg-tooltip);color:var(--color-text);border:1px solid #555;padding:4px;border-radius:8px}[data-reach-menu-item]{padding:5px 16px 5px 6px;border-radius:7px;cursor:pointer;display:flex;align-items:center}[data-reach-menu-item][data-selected]{background:var(--color-focus-blue);color:#f7f7f7}._checkWrapper_1nrct_45{display:inline-flex;align-items:center;margin-right:2px;visibility:hidden}._checkWrapper_1nrct_45._active_1nrct_51{visibility:visible}._content_b98hm_1._content_b98hm_1{background:none;position:fixed;top:0;bottom:0;left:0;right:0;-webkit-transform:none;transform:none;padding:0;border-radius:0;display:flex;justify-content:center;overflow-y:auto}._container_b98hm_16{position:relative;margin-left:20px;margin-right:20px}._overlay_b98hm_22._overlay_b98hm_22{background-color:var(--color-background)}._fixed_b98hm_26{position:fixed;padding:16px;bottom:0;right:0}._overlay_1i06e_1{position:fixed;top:0;right:0;left:0;bottom:0;background:#444}._content_1i06e_10{outline:none;position:relative;color:var(--color-text);background:#444;top:50%;left:50%;-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);padding:20px;border-radius:10px}._root_4m2cd_1{position:fixed;top:0;bottom:0;left:0;right:0;overflow:hidden;padding:20px;background:var(--color-background);color:var(--color-text);text-align:center}._yacd_4m2cd_14{color:#2a477a;opacity:.6;display:flex;justify-content:center;align-items:center;padding:40px}._link_4m2cd_23{display:inline-flex;align-items:center;color:var(--color-text-secondary)}._link_4m2cd_23:hover,._link_4m2cd_23:active{color:#387cec}._link_4m2cd_23 svg{margin-right:5px}._root_ecp08_1{padding:6px 15px}@media screen and (min-width: 30em){._root_ecp08_1{padding:10px 40px}}._TrafficNow_hzna1_1{color:var(--color-text);display:flex;align-items:center;flex-wrap:wrap;display:grid;grid-template-columns:repeat(auto-fit,180px);grid-gap:10px}._TrafficNow_hzna1_1 ._sec_hzna1_10{padding:10px;background-color:var(--color-bg-card);border-radius:10px;box-shadow:0 1px 5px #0000001a}._TrafficNow_hzna1_1 ._sec_hzna1_10 div:nth-child(1){color:var(--color-text-secondary);font-size:.7em}._TrafficNow_hzna1_1 ._sec_hzna1_10 div:nth-child(2){padding:10px 0 0;font-size:1.8em}._lo_pmly2_1{opacity:.5;width:100%;height:100%;display:flex;justify-content:center;align-items:center}._app_1q2jw_1{position:fixed;top:0;bottom:0;left:0;right:0;display:flex;background:var(--color-background);color:var(--color-text)}@media (max-width: 768px){._app_1q2jw_1{flex-direction:column}}._content_1q2jw_17{flex-grow:1;overflow:auto}._root_wh224_1{background:var(--color-bg-sidebar);min-width:150px;position:relative}._logoPlaceholder_wh224_7{height:15px}@media (max-width: 768px){._logoPlaceholder_wh224_7{display:none}}@media (max-width: 768px){._rows_wh224_17{display:flex;justify-content:space-between;overflow:auto}}._row_wh224_17{color:var(--color-text);text-decoration:none;display:flex;align-items:center;padding:6px 16px}@media screen and (min-width: 30em){._row_wh224_17{padding:8px 20px}}@media (max-width: 768px){._row_wh224_17{flex-direction:column}}._row_wh224_17 svg{color:var(--color-icon);width:22px;height:22px}@media screen and (min-width: 30em){._row_wh224_17 svg{width:24px;height:24px}}._rowActive_wh224_54{background:var(--color-sb-active-row-bg)}@media (max-width: 768px){._rowActive_wh224_54{background:none;border-bottom:2px solid #387cec}}._label_wh224_64{padding-left:14px;font-size:.75em}@media (max-width: 768px){._label_wh224_64{padding-left:0;padding-top:5px}}@media screen and (min-width: 30em){._label_wh224_64{font-size:1em}}._footer_wh224_80{position:absolute;bottom:10px;left:50%;-webkit-transform:translateX(-50%);transform:translate(-50%)}@media (max-width: 768px){._footer_wh224_80{display:none}}._iconWrapper_wh224_92{--sz: 40px;width:var(--sz);height:var(--sz);display:flex;justify-content:center;align-items:center;outline:none;padding:5px;color:var(--color-text);border-radius:100%;border:1px solid transparent}._iconWrapper_wh224_92:hover{opacity:.6}._iconWrapper_wh224_92:focus{border-color:var(--color-focus-blue)}._input_4ejw0_1{-webkit-appearance:none;background-color:var(--color-input-bg);background-image:none;border-radius:4px;border:1px solid var(--color-input-border);box-sizing:border-box;color:inherit;display:inline-block;font-size:inherit;height:40px;outline:none;padding:0 15px;width:100%}._input_4ejw0_1:focus{box-shadow:#4299e199 0 0 0 3px}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}._animate_1w0e8_1{--saturation: 70%;stroke:hsl(46deg,var(--saturation),45%);-webkit-transform:scale(1);transform:scale(1);-webkit-animation:_zap-pulse_1w0e8_1 .7s 0s ease-in-out none normal infinite;animation:_zap-pulse_1w0e8_1 .7s 0s ease-in-out none normal infinite}@-webkit-keyframes _zap-pulse_1w0e8_1{0%{stroke:hsl(46deg,var(--saturation),45%);-webkit-transform:scale(1);transform:scale(1)}50%{stroke:hsl(46deg,var(--saturation),95%);-webkit-transform:scale(1.1);transform:scale(1.1)}to{stroke:hsl(46deg,var(--saturation),45%);-webkit-transform:scale(1);transform:scale(1)}}@keyframes _zap-pulse_1w0e8_1{0%{stroke:hsl(46deg,var(--saturation),45%);-webkit-transform:scale(1);transform:scale(1)}50%{stroke:hsl(46deg,var(--saturation),95%);-webkit-transform:scale(1.1);transform:scale(1.1)}to{stroke:hsl(46deg,var(--saturation),45%);-webkit-transform:scale(1);transform:scale(1)}}._ToggleSwitch_10mtp_1{-webkit-user-select:none;user-select:none;border-radius:4px;border:1px solid #525252;color:var(--color-text);background:var(--color-toggle-bg);display:flex;position:relative;outline:none}._ToggleSwitch_10mtp_1:focus{border-color:var(--color-focus-blue)}._ToggleSwitch_10mtp_1 input{position:absolute;left:0;opacity:0}._ToggleSwitch_10mtp_1 label{z-index:2;display:flex;align-items:center;justify-content:center;padding:10px 0;cursor:pointer}._slider_10mtp_28{z-index:1;position:absolute;display:block;left:0;height:100%;transition:left .2s ease-out;background:var(--color-toggle-selected)} diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.2addc377.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.2addc377.js new file mode 100644 index 000000000..f45aee12f --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.2addc377.js @@ -0,0 +1,109 @@ +function Og(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerpolicy&&(i.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?i.credentials="include":o.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();const pb="modulepreload",hb=function(e,t){return new URL(e,t).href},hh={},Rn=function(t,n,r){return!n||n.length===0?t():Promise.all(n.map(o=>{if(o=hb(o,r),o in hh)return;hh[o]=!0;const i=o.endsWith(".css"),a=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${a}`))return;const s=document.createElement("link");if(s.rel=i?"stylesheet":pb,i||(s.as="script",s.crossOrigin=""),s.href=o,document.head.appendChild(s),i)return new Promise((l,u)=>{s.addEventListener("load",l),s.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t())};function Qn(e){return Qn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qn(e)}function $t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vh(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};$t(this,e),this.init(t,n)}return Ut(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||gb,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o1?r-1:0),i=1;i-1?s.replace(/###/g,"."):s}function o(){return!e||typeof e=="string"}for(var i=typeof t!="string"?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return o()?{}:{obj:e,k:r(i.shift())}}function Sh(e,t,n){var r=dd(e,t,Object),o=r.obj,i=r.k;o[i]=n}function Sb(e,t,n,r){var o=dd(e,t,Object),i=o.obj,a=o.k;i[a]=i[a]||[],r&&(i[a]=i[a].concat(n)),r||i[a].push(n)}function Ds(e,t){var n=dd(e,t),r=n.obj,o=n.k;if(!!r)return r[o]}function bh(e,t,n){var r=Ds(e,n);return r!==void 0?r:Ds(t,n)}function Ng(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):Ng(e[r],t[r],n):e[r]=t[r]);return e}function Zr(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var bb={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function _b(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return bb[t]}):e}var Tl=typeof window<"u"&&window.navigator&&typeof window.navigator.userAgentData>"u"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,xb=[" ",",","?","!",";"];function Rb(e,t,n){t=t||"",n=n||"";var r=xb.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var o=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}function _h(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ia(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ag(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;ii+a;)a++,s=r.slice(i,i+a).join(n),l=o[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(i+a).join(n);return u?Ag(l,u,n):void 0}o=o[r[i]]}return o}}var kb=function(e){Pl(n,e);var t=Eb(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return $t(this,n),o=t.call(this),Tl&&ar.call(Gn(o)),o.data=r||{},o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.options.ignoreJSONStructure===void 0&&(o.options.ignoreJSONStructure=!0),o}return Ut(n,[{key:"addNamespaces",value:function(o){this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}},{key:"removeNamespaces",value:function(o){var i=this.options.ns.indexOf(o);i>-1&&this.options.ns.splice(i,1)}},{key:"getResource",value:function(o,i,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[o,i];a&&typeof a!="string"&&(c=c.concat(a)),a&&typeof a=="string"&&(c=c.concat(l?a.split(l):a)),o.indexOf(".")>-1&&(c=o.split("."));var f=Ds(this.data,c);return f||!u||typeof a!="string"?f:Ag(this.data&&this.data[o]&&this.data[o][i],a,l)}},{key:"addResource",value:function(o,i,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var c=[o,i];a&&(c=c.concat(u?a.split(u):a)),o.indexOf(".")>-1&&(c=o.split("."),s=i,i=c[1]),this.addNamespaces(i),Sh(this.data,c,s),l.silent||this.emit("added",o,i,a,s)}},{key:"addResources",value:function(o,i,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(o,i,l,a[l],{silent:!0});s.silent||this.emit("added",o,i,a)}},{key:"addResourceBundle",value:function(o,i,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[o,i];o.indexOf(".")>-1&&(c=o.split("."),s=a,a=i,i=c[1]),this.addNamespaces(i);var f=Ds(this.data,c)||{};s?Ng(f,a,l):f=Ia(Ia({},f),a),Sh(this.data,c,f),u.silent||this.emit("added",o,i,a)}},{key:"removeResourceBundle",value:function(o,i){this.hasResourceBundle(o,i)&&delete this.data[o][i],this.removeNamespaces(i),this.emit("removed",o,i)}},{key:"hasResourceBundle",value:function(o,i){return this.getResource(o,i)!==void 0}},{key:"getResourceBundle",value:function(o,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?Ia(Ia({},{}),this.getResource(o,i)):this.getResource(o,i)}},{key:"getDataByLanguage",value:function(o){return this.data[o]}},{key:"hasLanguageSomeTranslations",value:function(o){var i=this.getDataByLanguage(o),a=i&&Object.keys(i)||[];return!!a.find(function(s){return i[s]&&Object.keys(i[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(ar),Mg={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,o,i){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,o,i))}),n}};function xh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function et(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var Rh={},Eh=function(e){Pl(n,e);var t=Ob(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return $t(this,n),o=t.call(this),Tl&&ar.call(Gn(o)),wb(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Gn(o)),o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=sn.create("translator"),o}return Ut(n,[{key:"changeLanguage",value:function(o){o&&(this.language=o)}},{key:"exists",value:function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;var a=this.resolve(o,i);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(o,i){var a=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,l=i.ns||this.options.defaultNS||[],u=a&&o.indexOf(a)>-1,c=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!Rb(o,a,s);if(u&&!c){var f=o.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:o,namespaces:l};var p=o.split(a);(a!==s||a===s&&this.options.ns.indexOf(p[0])>-1)&&(l=p.shift()),o=p.join(s)}return typeof l=="string"&&(l=[l]),{key:o,namespaces:l}}},{key:"translate",value:function(o,i,a){var s=this;if(Qn(i)!=="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),i||(i={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);var l=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,u=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,c=this.extractFromKey(o[o.length-1],i),f=c.key,p=c.namespaces,m=p[p.length-1],g=i.lng||this.language,y=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(y){var b=i.nsSeparator||this.options.nsSeparator;return l?(h.res="".concat(m).concat(b).concat(f),h):"".concat(m).concat(b).concat(f)}return l?(h.res=f,h):f}var h=this.resolve(o,i),d=h&&h.res,v=h&&h.usedKey||f,w=h&&h.exactUsedKey||f,O=Object.prototype.toString.apply(d),R=["[object Number]","[object Function]","[object RegExp]"],A=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,I=typeof d!="string"&&typeof d!="boolean"&&typeof d!="number";if(C&&d&&I&&R.indexOf(O)<0&&!(typeof A=="string"&&O==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var M=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,d,et(et({},i),{},{ns:p})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(h.res=M,h):M}if(u){var W=O==="[object Array]",oe=W?[]:{},X=W?w:v;for(var S in d)if(Object.prototype.hasOwnProperty.call(d,S)){var L="".concat(X).concat(u).concat(S);oe[S]=this.translate(L,et(et({},i),{joinArrays:!1,ns:p})),oe[S]===L&&(oe[S]=d[S])}d=oe}}else if(C&&typeof A=="string"&&O==="[object Array]")d=d.join(A),d&&(d=this.extendTranslation(d,o,i,a));else{var B=!1,P=!1,N=i.count!==void 0&&typeof i.count!="string",D=n.hasDefaultValue(i),$=N?this.pluralResolver.getSuffix(g,i.count,i):"",U=i["defaultValue".concat($)]||i.defaultValue;!this.isValidLookup(d)&&D&&(B=!0,d=U),this.isValidLookup(d)||(P=!0,d=f);var E=i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,V=E&&P?void 0:d,z=D&&U!==d&&this.options.updateMissing;if(P||B||z){if(this.logger.log(z?"updateKey":"missingKey",g,m,f,z?U:d),u){var J=this.resolve(f,et(et({},i),{},{keySeparator:!1}));J&&J.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var H=[],Z=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&Z&&Z[0])for(var se=0;se1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,c,f;return typeof o=="string"&&(o=[o]),o.forEach(function(p){if(!i.isValidLookup(s)){var m=i.extractFromKey(p,a),g=m.key;l=g;var y=m.namespaces;i.options.fallbackNS&&(y=y.concat(i.options.fallbackNS));var b=a.count!==void 0&&typeof a.count!="string",h=b&&!a.ordinal&&a.count===0&&i.pluralResolver.shouldUseIntlApi(),d=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",v=a.lngs?a.lngs:i.languageUtils.toResolveHierarchy(a.lng||i.language,a.fallbackLng);y.forEach(function(w){i.isValidLookup(s)||(f=w,!Rh["".concat(v[0],"-").concat(w)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(f)&&(Rh["".concat(v[0],"-").concat(w)]=!0,i.logger.warn('key "'.concat(l,'" for languages "').concat(v.join(", "),`" won't get resolved as namespace "`).concat(f,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(function(O){if(!i.isValidLookup(s)){c=O;var R=[g];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(R,g,O,w,a);else{var A;b&&(A=i.pluralResolver.getSuffix(O,a.count,a));var C="".concat(i.options.pluralSeparator,"zero");if(b&&(R.push(g+A),h&&R.push(g+C)),d){var I="".concat(g).concat(i.options.contextSeparator).concat(a.context);R.push(I),b&&(R.push(I+A),h&&R.push(I+C))}}for(var M;M=R.pop();)i.isValidLookup(s)||(u=M,s=i.getResource(O,w,M,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:c,usedNS:f}}},{key:"isValidLookup",value:function(o){return o!==void 0&&!(!this.options.returnNull&&o===null)&&!(!this.options.returnEmptyString&&o==="")}},{key:"getResource",value:function(o,i,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(o,i,a,s):this.resourceStore.getResource(o,i,a,s)}}],[{key:"hasDefaultValue",value:function(o){var i="defaultValue";for(var a in o)if(Object.prototype.hasOwnProperty.call(o,a)&&i===a.substring(0,i.length)&&o[a]!==void 0)return!0;return!1}}]),n}(ar);function Mu(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Tb=function(){function e(t){$t(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=sn.create("languageUtils")}return Ut(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],o=n.split("-");return this.options.lowerCaseLng?o=o.map(function(i){return i.toLowerCase()}):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Mu(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=Mu(o[1].toLowerCase())),r.indexOf(o[2].toLowerCase())>-1&&(o[2]=Mu(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var o;return n.forEach(function(i){if(!o){var a=r.formatLanguageCode(i);(!r.options.supportedLngs||r.isSupportedCode(a))&&(o=a)}}),!o&&this.options.supportedLngs&&n.forEach(function(i){if(!o){var a=r.getLanguagePartFromCode(i);if(r.isSupportedCode(a))return o=a;o=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var o=n[r];return o||(o=n[this.getScriptPartFromCode(r)]),o||(o=n[this.formatLanguageCode(r)]),o||(o=n[this.getLanguagePartFromCode(r)]),o||(o=n.default),o||[]}},{key:"toResolveHierarchy",value:function(n,r){var o=this,i=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){!u||(o.isSupportedCode(u)?a.push(u):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),i.forEach(function(l){a.indexOf(l)<0&&s(o.formatLanguageCode(l))}),a}}]),e}(),Lb=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Nb={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},Ab=["v1","v2","v3"],Ch={zero:0,one:1,two:2,few:3,many:4,other:5};function Mb(){var e={};return Lb.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:Nb[t.fc]}})}),e}var Db=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$t(this,e),this.languageUtils=t,this.options=n,this.logger=sn.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Mb()}return Ut(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,r);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,o).map(function(i){return"".concat(r).concat(i)})}},{key:"getSuffixes",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort(function(a,s){return Ch[a]-Ch[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):i.numbers.map(function(a){return r.getSuffix(n,a,o)}):[]}},{key:"getSuffix",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(i.select(r)):this.getSuffixRetroCompatible(i,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var o=this,i=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[i];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return o.options.prepend&&a.toString()?o.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!Ab.includes(this.options.compatibilityJSON)}}]),e}();function kh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function jt(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};$t(this,e),this.logger=sn.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return Ut(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:_b,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?Zr(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?Zr(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?Zr(r.nestingPrefix):r.nestingPrefixEscaped||Zr("$t("),this.nestingSuffix=r.nestingSuffix?Zr(r.nestingSuffix):r.nestingSuffixEscaped||Zr(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(n,r,o,i){var a=this,s,l,u,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(b){return b.replace(/\$/g,"$$$$")}var p=function(h){if(h.indexOf(a.formatSeparator)<0){var d=bh(r,c,h);return a.alwaysFormat?a.format(d,void 0,o,jt(jt(jt({},i),r),{},{interpolationkey:h})):d}var v=h.split(a.formatSeparator),w=v.shift().trim(),O=v.join(a.formatSeparator).trim();return a.format(bh(r,c,w),O,o,jt(jt(jt({},i),r),{},{interpolationkey:w}))};this.resetRegExp();var m=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,g=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,y=[{regex:this.regexpUnescape,safeValue:function(h){return f(h)}},{regex:this.regexp,safeValue:function(h){return a.escapeValue?f(a.escape(h)):f(h)}}];return y.forEach(function(b){for(u=0;s=b.regex.exec(n);){var h=s[1].trim();if(l=p(h),l===void 0)if(typeof m=="function"){var d=m(n,s,i);l=typeof d=="string"?d:""}else if(i&&i.hasOwnProperty(h))l="";else if(g){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(h," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=wh(l));var v=b.safeValue(l);if(n=n.replace(s[0],v),g?(b.regex.lastIndex+=l.length,b.regex.lastIndex-=s[0].length):b.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l=jt({},i);l.applyPostProcessor=!1,delete l.defaultValue;function u(m,g){var y=this.nestingOptionsSeparator;if(m.indexOf(y)<0)return m;var b=m.split(new RegExp("".concat(y,"[ ]*{"))),h="{".concat(b[1]);m=b[0],h=this.interpolate(h,l),h=h.replace(/'/g,'"');try{l=JSON.parse(h),g&&(l=jt(jt({},g),l))}catch(d){return this.logger.warn("failed parsing options string in nesting for key ".concat(m),d),"".concat(m).concat(y).concat(h)}return delete l.defaultValue,m}for(;a=this.nestingRegexp.exec(n);){var c=[],f=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var p=a[1].split(this.formatSeparator).map(function(m){return m.trim()});a[1]=p.shift(),c=p,f=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=wh(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),f&&(s=c.reduce(function(m,g){return o.format(m,g,i.lng,jt(jt({},i),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function Oh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Nn(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);if(t==="currency"&&o.indexOf(":")<0)n.currency||(n.currency=o.trim());else if(t==="relativetime"&&o.indexOf(":")<0)n.range||(n.range=o.trim());else{var i=o.split(";");i.forEach(function(a){if(!!a){var s=a.split(":"),l=mb(s),u=l[0],c=l.slice(1),f=c.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=f),f==="false"&&(n[u.trim()]=!1),f==="true"&&(n[u.trim()]=!0),isNaN(f)||(n[u.trim()]=parseInt(f,10))}})}}return{formatName:t,formatOptions:n}}var Ub=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};$t(this,e),this.logger=sn.create("formatter"),this.options=t,this.formats={number:function(r,o,i){return new Intl.NumberFormat(o,i).format(r)},currency:function(r,o,i){return new Intl.NumberFormat(o,Nn(Nn({},i),{},{style:"currency"})).format(r)},datetime:function(r,o,i){return new Intl.DateTimeFormat(o,Nn({},i)).format(r)},relativetime:function(r,o,i){return new Intl.RelativeTimeFormat(o,Nn({},i)).format(r,i.range||"day")},list:function(r,o,i){return new Intl.ListFormat(o,Nn({},i)).format(r)}},this.init(t)}return Ut(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},o=r.interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"format",value:function(n,r,o,i){var a=this,s=r.split(this.formatSeparator),l=s.reduce(function(u,c){var f=$b(c),p=f.formatName,m=f.formatOptions;if(a.formats[p]){var g=u;try{var y=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},b=y.locale||y.lng||i.locale||i.lng||o;g=a.formats[p](u,b,Nn(Nn(Nn({},m),i),y))}catch(h){a.logger.warn(h)}return g}else a.logger.warn("there was no format function for ".concat(p));return u},n);return l}}]),e}();function Ph(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Th(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function zb(e,t){e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)}var Bb=function(e){Pl(n,e);var t=Fb(n);function n(r,o,i){var a,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return $t(this,n),a=t.call(this),Tl&&ar.call(Gn(a)),a.backend=r,a.store=o,a.services=i,a.languageUtils=i.languageUtils,a.options=s,a.logger=sn.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(i,s.backend,s),a}return Ut(n,[{key:"queueLoad",value:function(o,i,a,s){var l=this,u={},c={},f={},p={};return o.forEach(function(m){var g=!0;i.forEach(function(y){var b="".concat(m,"|").concat(y);!a.reload&&l.store.hasResourceBundle(m,y)?l.state[b]=2:l.state[b]<0||(l.state[b]===1?c[b]===void 0&&(c[b]=!0):(l.state[b]=1,g=!1,c[b]===void 0&&(c[b]=!0),u[b]===void 0&&(u[b]=!0),p[y]===void 0&&(p[y]=!0)))}),g||(f[m]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(p)}}},{key:"loaded",value:function(o,i,a){var s=o.split("|"),l=s[0],u=s[1];i&&this.emit("failedLoading",l,u,i),a&&this.store.addResourceBundle(l,u,a),this.state[o]=i?-1:2;var c={};this.queue.forEach(function(f){Sb(f.loaded,[l],u),zb(f,o),i&&f.errors.push(i),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(p){c[p]||(c[p]={});var m=f.loaded[p];m.length&&m.forEach(function(g){c[p][g]===void 0&&(c[p][g]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(o,i,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,c=arguments.length>5?arguments[5]:void 0;if(!o.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:i,fcName:a,tried:l,wait:u,callback:c});return}return this.readingCalls++,this.backend[a](o,i,function(f,p){if(s.readingCalls--,s.waitingReads.length>0){var m=s.waitingReads.shift();s.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(f&&p&&l2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof o=="string"&&(o=this.languageUtils.toResolveHierarchy(o)),typeof i=="string"&&(i=[i]);var u=this.queueLoad(o,i,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(c){a.loadOne(c)})}},{key:"load",value:function(o,i,a){this.prepareLoading(o,i,{},a)}},{key:"reload",value:function(o,i,a){this.prepareLoading(o,i,{reload:!0},a)}},{key:"loadOne",value:function(o){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=o.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(c,f){c&&i.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),c),!c&&f&&i.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),f),i.loaded(o,c,f)})}},{key:"saveMissing",value:function(o,i,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}a==null||a===""||(this.backend&&this.backend.create&&this.backend.create(o,i,a,s,null,Th(Th({},u),{},{isUpdate:l})),!(!o||!o[0])&&this.store.addResource(o[0],i,a,s))}}]),n}(ar);function Vb(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Qn(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Qn(t[2])==="object"||Qn(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(o){n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,o){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Lh(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Nh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function tn(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function $a(){}function Kb(e){var t=Object.getOwnPropertyNames(Object.getPrototypeOf(e));t.forEach(function(n){typeof e[n]=="function"&&(e[n]=e[n].bind(e))})}var Is=function(e){Pl(n,e);var t=Wb(n);function n(){var r,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if($t(this,n),r=t.call(this),Tl&&ar.call(Gn(r)),r.options=Lh(o),r.services={},r.logger=sn,r.modules={external:[]},Kb(Gn(r)),i&&!r.isInitialized&&!o.isClone){if(!r.options.initImmediate)return r.init(o,i),pa(r,Gn(r));setTimeout(function(){r.init(o,i)},0)}return r}return Ut(n,[{key:"init",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(a=i,i={}),!i.defaultNS&&i.defaultNS!==!1&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));var s=Vb();this.options=tn(tn(tn({},s),this.options),Lh(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=tn(tn({},s.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function l(h){return h?typeof h=="function"?new h:h:null}if(!this.options.isClone){this.modules.logger?sn.init(l(this.modules.logger),this.options):sn.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=Ub);var c=new Tb(this.options);this.store=new kb(this.options.resources,this.options);var f=this.services;f.logger=sn,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new Db(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=l(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Ib(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Bb(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(h){for(var d=arguments.length,v=new Array(d>1?d-1:0),w=1;w1?d-1:0),w=1;w0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var m=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];m.forEach(function(h){o[h]=function(){var d;return(d=o.store)[h].apply(d,arguments)}});var g=["addResource","addResources","addResourceBundle","removeResourceBundle"];g.forEach(function(h){o[h]=function(){var d;return(d=o.store)[h].apply(d,arguments),o}});var y=ti(),b=function(){var d=function(w,O){o.isInitialized&&!o.initializedStoreOnce&&o.logger.warn("init: i18next is already initialized. You should call init just once!"),o.isInitialized=!0,o.options.isClone||o.logger.log("initialized",o.options),o.emit("initialized",o.options),y.resolve(O),a(w,O)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return d(null,o.t.bind(o));o.changeLanguage(o.options.lng,d)};return this.options.resources||!this.options.initImmediate?b():setTimeout(b,0),y}},{key:"loadResources",value:function(o){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$a,s=a,l=typeof o=="string"?o:this.language;if(typeof o=="function"&&(s=o),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],c=function(m){if(!!m){var g=i.services.languageUtils.toResolveHierarchy(m);g.forEach(function(y){u.indexOf(y)<0&&u.push(y)})}};if(l)c(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(p){return c(p)})}this.options.preload&&this.options.preload.forEach(function(p){return c(p)}),this.services.backendConnector.load(u,this.options.ns,function(p){!p&&!i.resolvedLanguage&&i.language&&i.setResolvedLanguage(i.language),s(p)})}else s(null)}},{key:"reloadResources",value:function(o,i,a){var s=ti();return o||(o=this.languages),i||(i=this.options.ns),a||(a=$a),this.services.backendConnector.reload(o,i,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(o){if(!o)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!o.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return o.type==="backend"&&(this.modules.backend=o),(o.type==="logger"||o.log&&o.warn&&o.error)&&(this.modules.logger=o),o.type==="languageDetector"&&(this.modules.languageDetector=o),o.type==="i18nFormat"&&(this.modules.i18nFormat=o),o.type==="postProcessor"&&Mg.addPostProcessor(o),o.type==="formatter"&&(this.modules.formatter=o),o.type==="3rdParty"&&this.modules.external.push(o),this}},{key:"setResolvedLanguage",value:function(o){if(!(!o||!this.languages)&&!(["cimode","dev"].indexOf(o)>-1))for(var i=0;i-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(o,i){var a=this;this.isLanguageChangingTo=o;var s=ti();this.emit("languageChanging",o);var l=function(p){a.language=p,a.languages=a.services.languageUtils.toResolveHierarchy(p),a.resolvedLanguage=void 0,a.setResolvedLanguage(p)},u=function(p,m){m?(l(m),a.translator.changeLanguage(m),a.isLanguageChangingTo=void 0,a.emit("languageChanged",m),a.logger.log("languageChanged",m)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),i&&i(p,function(){return a.t.apply(a,arguments)})},c=function(p){!o&&!p&&a.services.languageDetector&&(p=[]);var m=typeof p=="string"?p:a.services.languageUtils.getBestMatchFromCodes(p);m&&(a.language||l(m),a.translator.language||a.translator.changeLanguage(m),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage(m)),a.loadResources(m,function(g){u(g,m)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(c):c(o),s}},{key:"getFixedT",value:function(o,i,a){var s=this,l=function u(c,f){var p;if(Qn(f)!=="object"){for(var m=arguments.length,g=new Array(m>2?m-2:0),y=2;y1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var c=function(m,g){var y=i.services.backendConnector.state["".concat(m,"|").concat(g)];return y===-1||y===2};if(a.precheck){var f=a.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(s,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(s,o)&&(!l||c(u,o)))}},{key:"loadNamespaces",value:function(o,i){var a=this,s=ti();return this.options.ns?(typeof o=="string"&&(o=[o]),o.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),i&&i(l)}),s):(i&&i(),Promise.resolve())}},{key:"loadLanguages",value:function(o,i){var a=ti();typeof o=="string"&&(o=[o]);var s=this.options.preload||[],l=o.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),i&&i(u)}),a):(i&&i(),Promise.resolve())}},{key:"dir",value:function(o){if(o||(o=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!o)return"rtl";var i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return i.indexOf(this.services.languageUtils.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$a,s=tn(tn(tn({},this.options),i),{isClone:!0}),l=new n(s),u=["store","services","language"];return u.forEach(function(c){l[c]=o[c]}),l.services=tn({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new Eh(l.services,l.options),l.translator.on("*",function(c){for(var f=arguments.length,p=new Array(f>1?f-1:0),m=1;m0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Is(e,t)});var rt=Is.createInstance();rt.createInstance=Is.createInstance;rt.createInstance;rt.init;rt.loadResources;rt.reloadResources;rt.use;rt.changeLanguage;rt.getFixedT;rt.t;rt.exists;rt.setDefaultNamespace;rt.hasLoadedNamespace;rt.loadNamespaces;rt.loadLanguages;var Dg=[],qb=Dg.forEach,Qb=Dg.slice;function Gb(e){return qb.call(Qb.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var Ah=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Xb=function(t,n,r){var o=r||{};o.path=o.path||"/";var i=encodeURIComponent(n),a="".concat(t,"=").concat(i);if(o.maxAge>0){var s=o.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age=".concat(Math.floor(s))}if(o.domain){if(!Ah.test(o.domain))throw new TypeError("option domain is invalid");a+="; Domain=".concat(o.domain)}if(o.path){if(!Ah.test(o.path))throw new TypeError("option path is invalid");a+="; Path=".concat(o.path)}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires=".concat(o.expires.toUTCString())}if(o.httpOnly&&(a+="; HttpOnly"),o.secure&&(a+="; Secure"),o.sameSite){var l=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},Mh={create:function(t,n,r,o){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+r*60*1e3)),o&&(i.domain=o),document.cookie=Xb(t,encodeURIComponent(n),i)},read:function(t){for(var n="".concat(t,"="),r=document.cookie.split(";"),o=0;o-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=r.substring(1),i=o.split("&"),a=0;a0){var l=i[a].substring(0,s);l===t.lookupQuerystring&&(n=i[a].substring(s+1))}}}return n}},ni=null,Dh=function(){if(ni!==null)return ni;try{ni=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{ni=!1}return ni},Zb={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&Dh()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&Dh()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},ri=null,Ih=function(){if(ri!==null)return ri;try{ri=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{ri=!1}return ri},e_={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&Ih()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&Ih()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},t_={name:"navigator",lookup:function(t){var n=[];if(typeof navigator<"u"){if(navigator.languages)for(var r=0;r0?n:void 0}},n_={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},r_={name:"path",lookup:function(t){var n;if(typeof window<"u"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},o_={name:"subdomain",lookup:function(t){var n=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,r=typeof window<"u"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!!r)return r[n]}};function i_(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Ig=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};$t(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return Ut(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Gb(r,this.options||{},i_()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(Yb),this.addDetector(Jb),this.addDetector(Zb),this.addDetector(e_),this.addDetector(t_),this.addDetector(n_),this.addDetector(r_),this.addDetector(o_)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var o=[];return n.forEach(function(i){if(r.detectors[i]){var a=r.detectors[i].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(o=o.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var o=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(i){o.detectors[i]&&o.detectors[i].cacheUserLanguage(n,o.options)}))}}]),e}();Ig.type="languageDetector";function Mc(e){return Mc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mc(e)}var $g=[],a_=$g.forEach,s_=$g.slice;function Dc(e){return a_.call(s_.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function Ug(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Mc(XMLHttpRequest))==="object"}function l_(e){return!!e&&typeof e.then=="function"}function u_(e){return l_(e)?e:Promise.resolve(e)}var vs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function c_(e){var t=e.default;if(typeof t=="function"){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}function f_(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var $s={exports:{}},Ua={exports:{}},$h;function d_(){return $h||($h=1,function(e,t){var n=typeof self<"u"?self:vs,r=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(a){var s={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};function l(S){return S&&DataView.prototype.isPrototypeOf(S)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(S){return S&&u.indexOf(Object.prototype.toString.call(S))>-1};function f(S){if(typeof S!="string"&&(S=String(S)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(S))throw new TypeError("Invalid character in header field name");return S.toLowerCase()}function p(S){return typeof S!="string"&&(S=String(S)),S}function m(S){var L={next:function(){var B=S.shift();return{done:B===void 0,value:B}}};return s.iterable&&(L[Symbol.iterator]=function(){return L}),L}function g(S){this.map={},S instanceof g?S.forEach(function(L,B){this.append(B,L)},this):Array.isArray(S)?S.forEach(function(L){this.append(L[0],L[1])},this):S&&Object.getOwnPropertyNames(S).forEach(function(L){this.append(L,S[L])},this)}g.prototype.append=function(S,L){S=f(S),L=p(L);var B=this.map[S];this.map[S]=B?B+", "+L:L},g.prototype.delete=function(S){delete this.map[f(S)]},g.prototype.get=function(S){return S=f(S),this.has(S)?this.map[S]:null},g.prototype.has=function(S){return this.map.hasOwnProperty(f(S))},g.prototype.set=function(S,L){this.map[f(S)]=p(L)},g.prototype.forEach=function(S,L){for(var B in this.map)this.map.hasOwnProperty(B)&&S.call(L,this.map[B],B,this)},g.prototype.keys=function(){var S=[];return this.forEach(function(L,B){S.push(B)}),m(S)},g.prototype.values=function(){var S=[];return this.forEach(function(L){S.push(L)}),m(S)},g.prototype.entries=function(){var S=[];return this.forEach(function(L,B){S.push([B,L])}),m(S)},s.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function y(S){if(S.bodyUsed)return Promise.reject(new TypeError("Already read"));S.bodyUsed=!0}function b(S){return new Promise(function(L,B){S.onload=function(){L(S.result)},S.onerror=function(){B(S.error)}})}function h(S){var L=new FileReader,B=b(L);return L.readAsArrayBuffer(S),B}function d(S){var L=new FileReader,B=b(L);return L.readAsText(S),B}function v(S){for(var L=new Uint8Array(S),B=new Array(L.length),P=0;P-1?L:S}function C(S,L){L=L||{};var B=L.body;if(S instanceof C){if(S.bodyUsed)throw new TypeError("Already read");this.url=S.url,this.credentials=S.credentials,L.headers||(this.headers=new g(S.headers)),this.method=S.method,this.mode=S.mode,this.signal=S.signal,!B&&S._bodyInit!=null&&(B=S._bodyInit,S.bodyUsed=!0)}else this.url=String(S);if(this.credentials=L.credentials||this.credentials||"same-origin",(L.headers||!this.headers)&&(this.headers=new g(L.headers)),this.method=A(L.method||this.method||"GET"),this.mode=L.mode||this.mode||null,this.signal=L.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&B)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(B)}C.prototype.clone=function(){return new C(this,{body:this._bodyInit})};function I(S){var L=new FormData;return S.trim().split("&").forEach(function(B){if(B){var P=B.split("="),N=P.shift().replace(/\+/g," "),D=P.join("=").replace(/\+/g," ");L.append(decodeURIComponent(N),decodeURIComponent(D))}}),L}function M(S){var L=new g,B=S.replace(/\r?\n[\t ]+/g," ");return B.split(/\r?\n/).forEach(function(P){var N=P.split(":"),D=N.shift().trim();if(D){var $=N.join(":").trim();L.append(D,$)}}),L}O.call(C.prototype);function W(S,L){L||(L={}),this.type="default",this.status=L.status===void 0?200:L.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in L?L.statusText:"OK",this.headers=new g(L.headers),this.url=L.url||"",this._initBody(S)}O.call(W.prototype),W.prototype.clone=function(){return new W(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},W.error=function(){var S=new W(null,{status:0,statusText:""});return S.type="error",S};var oe=[301,302,303,307,308];W.redirect=function(S,L){if(oe.indexOf(L)===-1)throw new RangeError("Invalid status code");return new W(null,{status:L,headers:{location:S}})},a.DOMException=i.DOMException;try{new a.DOMException}catch{a.DOMException=function(L,B){this.message=L,this.name=B;var P=Error(L);this.stack=P.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function X(S,L){return new Promise(function(B,P){var N=new C(S,L);if(N.signal&&N.signal.aborted)return P(new a.DOMException("Aborted","AbortError"));var D=new XMLHttpRequest;function $(){D.abort()}D.onload=function(){var U={status:D.status,statusText:D.statusText,headers:M(D.getAllResponseHeaders()||"")};U.url="responseURL"in D?D.responseURL:U.headers.get("X-Request-URL");var E="response"in D?D.response:D.responseText;B(new W(E,U))},D.onerror=function(){P(new TypeError("Network request failed"))},D.ontimeout=function(){P(new TypeError("Network request failed"))},D.onabort=function(){P(new a.DOMException("Aborted","AbortError"))},D.open(N.method,N.url,!0),N.credentials==="include"?D.withCredentials=!0:N.credentials==="omit"&&(D.withCredentials=!1),"responseType"in D&&s.blob&&(D.responseType="blob"),N.headers.forEach(function(U,E){D.setRequestHeader(E,U)}),N.signal&&(N.signal.addEventListener("abort",$),D.onreadystatechange=function(){D.readyState===4&&N.signal.removeEventListener("abort",$)}),D.send(typeof N._bodyInit>"u"?null:N._bodyInit)})}return X.polyfill=!0,i.fetch||(i.fetch=X,i.Headers=g,i.Request=C,i.Response=W),a.Headers=g,a.Request=C,a.Response=W,a.fetch=X,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;t=o.fetch,t.default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t}(Ua,Ua.exports)),Ua.exports}(function(e,t){var n;if(typeof fetch=="function"&&(typeof vs<"u"&&vs.fetch?n=vs.fetch:typeof window<"u"&&window.fetch&&(n=window.fetch)),typeof f_<"u"&&(typeof window>"u"||typeof window.document>"u")){var r=n||d_();r.default&&(r=r.default),t.default=r,e.exports=t.default}})($s,$s.exports);const Fg=$s.exports,Uh=Og({__proto__:null,default:Fg},[$s.exports]);function Us(e){return Us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Us(e)}var sr;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?sr=global.fetch:typeof window<"u"&&window.fetch&&(sr=window.fetch));var ji;Ug()&&(typeof global<"u"&&global.XMLHttpRequest?ji=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(ji=window.XMLHttpRequest));var Fs;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Fs=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Fs=window.ActiveXObject));!sr&&Uh&&!ji&&!Fs&&(sr=Fg||Uh);typeof sr!="function"&&(sr=void 0);var Ic=function(t,n){if(n&&Us(n)==="object"){var r="";for(var o in n)r+="&"+encodeURIComponent(o)+"="+encodeURIComponent(n[o]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},p_=function(t,n,r,o){t.queryStringParams&&(n=Ic(n,t.queryStringParams));var i=Dc({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(i["Content-Type"]="application/json"),sr(n,Dc({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:i},typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions)).then(function(a){if(!a.ok)return o(a.statusText||"Error",{status:a.status});a.text().then(function(s){o(null,{status:a.status,data:s})}).catch(o)}).catch(o)},h_=function(t,n,r,o){r&&Us(r)==="object"&&(r=Ic("",r).slice(1)),t.queryStringParams&&(n=Ic(n,t.queryStringParams));try{var i;ji?i=new ji:i=new Fs("MSXML2.XMLHTTP.3.0"),i.open(r?"POST":"GET",n,1),t.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!t.withCredentials,r&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)i.setRequestHeader(s,a[s]);i.onreadystatechange=function(){i.readyState>3&&o(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(r)}catch(l){console&&console.log(l)}},v_=function(t,n,r,o){if(typeof r=="function"&&(o=r,r=void 0),o=o||function(){},sr)return p_(t,n,r,o);if(Ug()||typeof ActiveXObject=="function")return h_(t,n,r,o)};function m_(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fh(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};m_(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return g_(e,[{key:"init",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Dc(o,this.options||{},w_()),this.allOptions=i,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,o){this._readAny(n,n,r,r,o)}},{key:"read",value:function(n,r,o){this._readAny([n],n,[r],r,o)}},{key:"_readAny",value:function(n,r,o,i,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,o)),l=u_(l),l.then(function(u){if(!u)return a(null,{});var c=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:o.join("+")});s.loadUrl(c,a,r,i)})}},{key:"loadUrl",value:function(n,r,o,i){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,c;try{typeof l.data=="string"?u=a.options.parse(l.data,o,i):u=l.data}catch{c="failed parsing "+n+" to json"}if(c)return r(c,!1);r(null,u)})}},{key:"create",value:function(n,r,o,i,a){var s=this;if(!!this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,o,i),u=0,c=[],f=[];n.forEach(function(p){var m=s.options.addPath;typeof s.options.addPath=="function"&&(m=s.options.addPath(p,r));var g=s.services.interpolator.interpolate(m,{lng:p,ns:r});s.options.request(s.options,g,l,function(y,b){u+=1,c.push(y),f.push(b),u===n.length&&a&&a(c,f)})})}}},{key:"reload",value:function(){var n=this,r=this.services,o=r.backendConnector,i=r.languageUtils,a=r.logger,s=o.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(f){var p=i.toResolveHierarchy(f);p.forEach(function(m){l.indexOf(m)<0&&l.push(m)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){n.allOptions.ns.forEach(function(f){o.read(c,f,"read",null,null,function(p,m){p&&a.warn("loading namespace ".concat(f," for language ").concat(c," failed"),p),!p&&m&&a.log("loaded namespace ".concat(f," for language ").concat(c),m),o.loaded("".concat(c,"|").concat(f),p,m)})})})}}}]),e}();jg.type="backend";var x={exports:{}},fe={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var ha=Symbol.for("react.element"),S_=Symbol.for("react.portal"),b_=Symbol.for("react.fragment"),__=Symbol.for("react.strict_mode"),x_=Symbol.for("react.profiler"),R_=Symbol.for("react.provider"),E_=Symbol.for("react.context"),C_=Symbol.for("react.forward_ref"),k_=Symbol.for("react.suspense"),O_=Symbol.for("react.memo"),P_=Symbol.for("react.lazy"),jh=Symbol.iterator;function T_(e){return e===null||typeof e!="object"?null:(e=jh&&e[jh]||e["@@iterator"],typeof e=="function"?e:null)}var zg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Bg=Object.assign,Vg={};function Bo(e,t,n){this.props=e,this.context=t,this.refs=Vg,this.updater=n||zg}Bo.prototype.isReactComponent={};Bo.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Bo.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Wg(){}Wg.prototype=Bo.prototype;function hd(e,t,n){this.props=e,this.context=t,this.refs=Vg,this.updater=n||zg}var vd=hd.prototype=new Wg;vd.constructor=hd;Bg(vd,Bo.prototype);vd.isPureReactComponent=!0;var zh=Array.isArray,Hg=Object.prototype.hasOwnProperty,md={current:null},Kg={key:!0,ref:!0,__self:!0,__source:!0};function qg(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)Hg.call(t,r)&&!Kg.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(1",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026","/":"/","/":"/"},$_=function(t){return I_[t]},U_=function(t){return t.replace(D_,$_)};function Vh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Wh(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};$c=Wh(Wh({},$c),e)}function z_(){return $c}var B_=function(){function e(){$t(this,e),this.usedNamespaces={}}return Ut(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(o){r.usedNamespaces[o]||(r.usedNamespaces[o]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function V_(e){Qg=e}function W_(){return Qg}var H_={type:"3rdParty",init:function(t){j_(t.options.react),V_(t)}};function K_(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],o=t.options?t.options.fallbackLng:!1,i=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var c=t.services.backendConnector.state["".concat(l,"|").concat(u)];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!o||a(i,e)))}function Q_(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Uc("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(i,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!a(i.isLanguageChangingTo,e))return!1}}):q_(e,t,n)}function G_(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,a,s;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));o=!0);}catch(l){i=!0,s=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw s}}return r}}function X_(e,t){return Pg(e)||G_(e,t)||Tg(e,t)||Lg()}function qh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Iu(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=x.exports.useContext(F_)||{},o=r.i18n,i=r.defaultNS,a=n||o||W_();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new B_),!a){Uc("You will need to pass in an i18next instance by using initReactI18next");var s=function(I){return Array.isArray(I)?I[I.length-1]:I},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&Uc("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=Iu(Iu(Iu({},z_()),a.options.react),t),c=u.useSuspense,f=u.keyPrefix,p=e||i||a.options&&a.options.defaultNS;p=typeof p=="string"?[p]:p||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(p);var m=(a.isInitialized||a.initializedStoreOnce)&&p.every(function(C){return Q_(C,a,u)});function g(){return a.getFixedT(null,u.nsMode==="fallback"?p:p[0],f)}var y=x.exports.useState(g),b=X_(y,2),h=b[0],d=b[1],v=p.join(),w=Y_(v),O=x.exports.useRef(!0);x.exports.useEffect(function(){var C=u.bindI18n,I=u.bindI18nStore;O.current=!0,!m&&!c&&Kh(a,p,function(){O.current&&d(g)}),m&&w&&w!==v&&O.current&&d(g);function M(){O.current&&d(g)}return C&&a&&a.on(C,M),I&&a&&a.store.on(I,M),function(){O.current=!1,C&&a&&C.split(" ").forEach(function(W){return a.off(W,M)}),I&&a&&I.split(" ").forEach(function(W){return a.store.off(W,M)})}},[a,v]);var R=x.exports.useRef(!0);x.exports.useEffect(function(){O.current&&!R.current&&d(g),R.current=!1},[a,f]);var A=[h,a,m];if(A.t=h,A.i18n=a,A.ready=m,m||!m&&!c)return A;throw new Promise(function(C){Kh(a,p,function(){C()})})}const Qh={zh:Rn(()=>import("./zh.9b79b7bf.js"),[],import.meta.url),en:Rn(()=>import("./en.fb34eaf7.js"),[],import.meta.url)};rt.use(jg).use(H_).use(Ig).init({debug:!1,backend:{loadPath:"/__{{lng}}/{{ns}}.json",request:function(e,t,n,r){let o;switch(t){case"/__zh/translation.json":case"/__zh-CN/translation.json":o=Qh.zh;break;case"/__en/translation.json":default:o=Qh.en;break}o&&o.then(i=>{r(null,{status:200,data:i.data})})}},supportedLngs:["en","zh"],fallbackLng:"en",interpolation:{escapeValue:!1}});const J_=""+new URL("inter-latin-400-normal.0364d368.woff2",import.meta.url).href,Z_=""+new URL("inter-latin-800-normal.a51ac27d.woff2",import.meta.url).href,ex=""+new URL("roboto-mono-latin-400-normal.7295944e.woff2",import.meta.url).href;var ma={exports:{}},xt={},Gg={exports:{}},Xg={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */(function(e){function t(N,D){var $=N.length;N.push(D);e:for(;0<$;){var U=$-1>>>1,E=N[U];if(0>>1;Uo(J,$))Ho(Z,J)?(N[U]=Z,N[H]=$,U=H):(N[U]=J,N[z]=$,U=z);else if(Ho(Z,$))N[U]=Z,N[H]=$,U=H;else break e}}return D}function o(N,D){var $=N.sortIndex-D.sortIndex;return $!==0?$:N.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,f=null,p=3,m=!1,g=!1,y=!1,b=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(N){for(var D=n(u);D!==null;){if(D.callback===null)r(u);else if(D.startTime<=N)r(u),D.sortIndex=D.expirationTime,t(l,D);else break;D=n(u)}}function w(N){if(y=!1,v(N),!g)if(n(l)!==null)g=!0,B(O);else{var D=n(u);D!==null&&P(w,D.startTime-N)}}function O(N,D){g=!1,y&&(y=!1,h(C),C=-1),m=!0;var $=p;try{for(v(D),f=n(l);f!==null&&(!(f.expirationTime>D)||N&&!W());){var U=f.callback;if(typeof U=="function"){f.callback=null,p=f.priorityLevel;var E=U(f.expirationTime<=D);D=e.unstable_now(),typeof E=="function"?f.callback=E:f===n(l)&&r(l),v(D)}else r(l);f=n(l)}if(f!==null)var V=!0;else{var z=n(u);z!==null&&P(w,z.startTime-D),V=!1}return V}finally{f=null,p=$,m=!1}}var R=!1,A=null,C=-1,I=5,M=-1;function W(){return!(e.unstable_now()-MN||125U?(N.sortIndex=$,t(u,N),n(l)===null&&N===n(u)&&(y?(h(C),C=-1):y=!0,P(w,$-U))):(N.sortIndex=E,t(l,N),g||m||(g=!0,B(O))),N},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(N){var D=p;return function(){var $=p;p=D;try{return N.apply(this,arguments)}finally{p=$}}}})(Xg);(function(e){e.exports=Xg})(Gg);/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Yg=x.exports,St=Gg.exports;function j(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fc=Object.prototype.hasOwnProperty,tx=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Gh={},Xh={};function nx(e){return Fc.call(Xh,e)?!0:Fc.call(Gh,e)?!1:tx.test(e)?Xh[e]=!0:(Gh[e]=!0,!1)}function rx(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ox(e,t,n,r){if(t===null||typeof t>"u"||rx(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function it(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var qe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){qe[e]=new it(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];qe[t]=new it(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qe[e]=new it(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qe[e]=new it(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){qe[e]=new it(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qe[e]=new it(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qe[e]=new it(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qe[e]=new it(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qe[e]=new it(e,5,!1,e.toLowerCase(),null,!1,!1)});var yd=/[\-:]([a-z])/g;function wd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(yd,wd);qe[t]=new it(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(yd,wd);qe[t]=new it(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(yd,wd);qe[t]=new it(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qe[e]=new it(e,1,!1,e.toLowerCase(),null,!1,!1)});qe.xlinkHref=new it("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qe[e]=new it(e,1,!1,e.toLowerCase(),null,!0,!0)});function Sd(e,t,n,r){var o=qe.hasOwnProperty(t)?qe[t]:null;(o!==null?o.type!==0:r||!(2s||o[a]!==i[s]){var l=` +`+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{Uu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?yi(e):""}function ix(e){switch(e.tag){case 5:return yi(e.type);case 16:return yi("Lazy");case 13:return yi("Suspense");case 19:return yi("SuspenseList");case 0:case 2:case 15:return e=Fu(e.type,!1),e;case 11:return e=Fu(e.type.render,!1),e;case 1:return e=Fu(e.type,!0),e;default:return""}}function Vc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case oo:return"Fragment";case ro:return"Portal";case jc:return"Profiler";case bd:return"StrictMode";case zc:return"Suspense";case Bc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ey:return(e.displayName||"Context")+".Consumer";case Zg:return(e._context.displayName||"Context")+".Provider";case _d:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case xd:return t=e.displayName||null,t!==null?t:Vc(e.type)||"Memo";case In:t=e._payload,e=e._init;try{return Vc(e(t))}catch{}}return null}function ax(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Vc(t);case 8:return t===bd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function lr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ny(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function sx(e){var t=ny(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function za(e){e._valueTracker||(e._valueTracker=sx(e))}function ry(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ny(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function js(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Wc(e,t){var n=t.checked;return Ae({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n!=null?n:e._wrapperState.initialChecked})}function Jh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=lr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function oy(e,t){t=t.checked,t!=null&&Sd(e,"checked",t,!1)}function Hc(e,t){oy(e,t);var n=lr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Kc(e,t.type,n):t.hasOwnProperty("defaultValue")&&Kc(e,t.type,lr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Zh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Kc(e,t,n){(t!=="number"||js(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var wi=Array.isArray;function yo(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ba.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Bi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ei={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},lx=["Webkit","ms","Moz","O"];Object.keys(Ei).forEach(function(e){lx.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ei[t]=Ei[e]})});function ly(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ei.hasOwnProperty(e)&&Ei[e]?(""+t).trim():t+"px"}function uy(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=ly(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var ux=Ae({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Gc(e,t){if(t){if(ux[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(j(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(j(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(j(61))}if(t.style!=null&&typeof t.style!="object")throw Error(j(62))}}function Xc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Yc=null;function Rd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Jc=null,wo=null,So=null;function nv(e){if(e=wa(e)){if(typeof Jc!="function")throw Error(j(280));var t=e.stateNode;t&&(t=Dl(t),Jc(e.stateNode,e.type,t))}}function cy(e){wo?So?So.push(e):So=[e]:wo=e}function fy(){if(wo){var e=wo,t=So;if(So=wo=null,nv(e),t)for(e=0;e>>=0,e===0?32:31-(Sx(e)/bx|0)|0}var Va=64,Wa=4194304;function Si(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ws(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~o;s!==0?r=Si(s):(i&=a,i!==0&&(r=Si(i)))}else a=n&~o,a!==0?r=Si(a):i!==0&&(r=Si(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ga(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Gt(t),e[t]=n}function Ex(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ki),fv=String.fromCharCode(32),dv=!1;function Ly(e,t){switch(e){case"keyup":return Zx.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ny(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var io=!1;function tR(e,t){switch(e){case"compositionend":return Ny(t);case"keypress":return t.which!==32?null:(dv=!0,fv);case"textInput":return e=t.data,e===fv&&dv?null:e;default:return null}}function nR(e,t){if(io)return e==="compositionend"||!Nd&&Ly(e,t)?(e=Py(),ws=Pd=Vn=null,io=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=mv(n)}}function Iy(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Iy(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function $y(){for(var e=window,t=js();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=js(e.document)}return t}function Ad(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function fR(e){var t=$y(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Iy(n.ownerDocument.documentElement,n)){if(r!==null&&Ad(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=gv(n,i);var a=gv(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ao=null,of=null,Pi=null,af=!1;function yv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;af||ao==null||ao!==js(r)||(r=ao,"selectionStart"in r&&Ad(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Pi&&Qi(Pi,r)||(Pi=r,r=qs(of,"onSelect"),0uo||(e.current=df[uo],df[uo]=null,uo--)}function _e(e,t){uo++,df[uo]=e.current,e.current=t}var ur={},Ze=gr(ur),ct=gr(!1),Ir=ur;function ko(e,t){var n=e.type.contextTypes;if(!n)return ur;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ft(e){return e=e.childContextTypes,e!=null}function Gs(){Ee(ct),Ee(Ze)}function Ev(e,t,n){if(Ze.current!==ur)throw Error(j(168));_e(Ze,t),_e(ct,n)}function Ky(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(j(108,ax(e)||"Unknown",o));return Ae({},n,r)}function Xs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ur,Ir=Ze.current,_e(Ze,e),_e(ct,ct.current),!0}function Cv(e,t,n){var r=e.stateNode;if(!r)throw Error(j(169));n?(e=Ky(e,t,Ir),r.__reactInternalMemoizedMergedChildContext=e,Ee(ct),Ee(Ze),_e(Ze,e)):Ee(ct),_e(ct,n)}var wn=null,Il=!1,Zu=!1;function qy(e){wn===null?wn=[e]:wn.push(e)}function xR(e){Il=!0,qy(e)}function yr(){if(!Zu&&wn!==null){Zu=!0;var e=0,t=ge;try{var n=wn;for(ge=1;e>=a,o-=a,Sn=1<<32-Gt(t)+o|n<C?(I=A,A=null):I=A.sibling;var M=p(h,A,v[C],w);if(M===null){A===null&&(A=I);break}e&&A&&M.alternate===null&&t(h,A),d=i(M,d,C),R===null?O=M:R.sibling=M,R=M,A=I}if(C===v.length)return n(h,A),ke&&xr(h,C),O;if(A===null){for(;CC?(I=A,A=null):I=A.sibling;var W=p(h,A,M.value,w);if(W===null){A===null&&(A=I);break}e&&A&&W.alternate===null&&t(h,A),d=i(W,d,C),R===null?O=W:R.sibling=W,R=W,A=I}if(M.done)return n(h,A),ke&&xr(h,C),O;if(A===null){for(;!M.done;C++,M=v.next())M=f(h,M.value,w),M!==null&&(d=i(M,d,C),R===null?O=M:R.sibling=M,R=M);return ke&&xr(h,C),O}for(A=r(h,A);!M.done;C++,M=v.next())M=m(A,h,C,M.value,w),M!==null&&(e&&M.alternate!==null&&A.delete(M.key===null?C:M.key),d=i(M,d,C),R===null?O=M:R.sibling=M,R=M);return e&&A.forEach(function(oe){return t(h,oe)}),ke&&xr(h,C),O}function b(h,d,v,w){if(typeof v=="object"&&v!==null&&v.type===oo&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case ja:e:{for(var O=v.key,R=d;R!==null;){if(R.key===O){if(O=v.type,O===oo){if(R.tag===7){n(h,R.sibling),d=o(R,v.props.children),d.return=h,h=d;break e}}else if(R.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===In&&Av(O)===R.type){n(h,R.sibling),d=o(R,v.props),d.ref=ui(h,R,v),d.return=h,h=d;break e}n(h,R);break}else t(h,R);R=R.sibling}v.type===oo?(d=Mr(v.props.children,h.mode,w,v.key),d.return=h,h=d):(w=ks(v.type,v.key,v.props,null,h.mode,w),w.ref=ui(h,d,v),w.return=h,h=w)}return a(h);case ro:e:{for(R=v.key;d!==null;){if(d.key===R)if(d.tag===4&&d.stateNode.containerInfo===v.containerInfo&&d.stateNode.implementation===v.implementation){n(h,d.sibling),d=o(d,v.children||[]),d.return=h,h=d;break e}else{n(h,d);break}else t(h,d);d=d.sibling}d=sc(v,h.mode,w),d.return=h,h=d}return a(h);case In:return R=v._init,b(h,d,R(v._payload),w)}if(wi(v))return g(h,d,v,w);if(oi(v))return y(h,d,v,w);Ya(h,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,d!==null&&d.tag===6?(n(h,d.sibling),d=o(d,v),d.return=h,h=d):(n(h,d),d=ac(v,h.mode,w),d.return=h,h=d),a(h)):n(h,d)}return b}var Po=t0(!0),n0=t0(!1),Sa={},un=gr(Sa),Ji=gr(Sa),Zi=gr(Sa);function Tr(e){if(e===Sa)throw Error(j(174));return e}function Bd(e,t){switch(_e(Zi,t),_e(Ji,e),_e(un,Sa),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Qc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Qc(t,e)}Ee(un),_e(un,t)}function To(){Ee(un),Ee(Ji),Ee(Zi)}function r0(e){Tr(Zi.current);var t=Tr(un.current),n=Qc(t,e.type);t!==n&&(_e(Ji,e),_e(un,n))}function Vd(e){Ji.current===e&&(Ee(un),Ee(Ji))}var Le=gr(0);function nl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ec=[];function Wd(){for(var e=0;en?n:4,e(!0);var r=tc.transition;tc.transition={};try{e(!1),t()}finally{ge=n,tc.transition=r}}function w0(){return It().memoizedState}function kR(e,t,n){var r=nr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},S0(e))b0(t,n);else if(n=Yy(e,t,n,r),n!==null){var o=nt();Xt(n,e,r,o),_0(n,t,r)}}function OR(e,t,n){var r=nr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(S0(e))b0(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,Jt(s,a)){var l=t.interleaved;l===null?(o.next=o,jd(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=Yy(e,t,o,r),n!==null&&(o=nt(),Xt(n,e,r,o),_0(n,t,r))}}function S0(e){var t=e.alternate;return e===Ne||t!==null&&t===Ne}function b0(e,t){Ti=rl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _0(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Cd(e,n)}}var ol={readContext:Dt,useCallback:Qe,useContext:Qe,useEffect:Qe,useImperativeHandle:Qe,useInsertionEffect:Qe,useLayoutEffect:Qe,useMemo:Qe,useReducer:Qe,useRef:Qe,useState:Qe,useDebugValue:Qe,useDeferredValue:Qe,useTransition:Qe,useMutableSource:Qe,useSyncExternalStore:Qe,useId:Qe,unstable_isNewReconciler:!1},PR={readContext:Dt,useCallback:function(e,t){return rn().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Dv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xs(4194308,4,h0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xs(4194308,4,e,t)},useInsertionEffect:function(e,t){return xs(4,2,e,t)},useMemo:function(e,t){var n=rn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=rn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=kR.bind(null,Ne,e),[r.memoizedState,e]},useRef:function(e){var t=rn();return e={current:e},t.memoizedState=e},useState:Mv,useDebugValue:Gd,useDeferredValue:function(e){return rn().memoizedState=e},useTransition:function(){var e=Mv(!1),t=e[0];return e=CR.bind(null,e[1]),rn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ne,o=rn();if(ke){if(n===void 0)throw Error(j(407));n=n()}else{if(n=t(),Ve===null)throw Error(j(349));(Ur&30)!==0||a0(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Dv(l0.bind(null,r,i,e),[e]),r.flags|=2048,na(9,s0.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=rn(),t=Ve.identifierPrefix;if(ke){var n=bn,r=Sn;n=(r&~(1<<32-Gt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ea++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[an]=t,e[Yi]=r,L0(e,t,!1,!1),t.stateNode=e;e:{switch(a=Xc(n,r),n){case"dialog":Re("cancel",e),Re("close",e),o=r;break;case"iframe":case"object":case"embed":Re("load",e),o=r;break;case"video":case"audio":for(o=0;oNo&&(t.flags|=128,r=!0,ci(i,!1),t.lanes=4194304)}else{if(!r)if(e=nl(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ci(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!ke)return Ge(t),null}else 2*$e()-i.renderingStartTime>No&&n!==1073741824&&(t.flags|=128,r=!0,ci(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=$e(),t.sibling=null,n=Le.current,_e(Le,r?n&1|2:n&1),t):(Ge(t),null);case 22:case 23:return tp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(gt&1073741824)!==0&&(Ge(t),t.subtreeFlags&6&&(t.flags|=8192)):Ge(t),null;case 24:return null;case 25:return null}throw Error(j(156,t.tag))}function $R(e,t){switch(Dd(t),t.tag){case 1:return ft(t.type)&&Gs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return To(),Ee(ct),Ee(Ze),Wd(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Vd(t),null;case 13:if(Ee(Le),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(j(340));Oo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ee(Le),null;case 4:return To(),null;case 10:return Fd(t.type._context),null;case 22:case 23:return tp(),null;case 24:return null;default:return null}}var Za=!1,Je=!1,UR=typeof WeakSet=="function"?WeakSet:Set,Q=null;function ho(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Me(e,t,r)}else n.current=null}function Rf(e,t,n){try{n()}catch(r){Me(e,t,r)}}var Wv=!1;function FR(e,t){if(sf=Hs,e=$y(),Ad(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,f=e,p=null;t:for(;;){for(var m;f!==n||o!==0&&f.nodeType!==3||(s=a+o),f!==i||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break t;if(p===n&&++u===o&&(s=a),p===i&&++c===r&&(l=a),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(lf={focusedElem:e,selectionRange:n},Hs=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var g=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,b=g.memoizedState,h=t.stateNode,d=h.getSnapshotBeforeUpdate(t.elementType===t.type?y:Vt(t.type,y),b);h.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(j(163))}}catch(w){Me(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return g=Wv,Wv=!1,g}function Li(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Rf(t,n,i)}o=o.next}while(o!==r)}}function Fl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ef(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function M0(e){var t=e.alternate;t!==null&&(e.alternate=null,M0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[an],delete t[Yi],delete t[ff],delete t[bR],delete t[_R])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function D0(e){return e.tag===5||e.tag===3||e.tag===4}function Hv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||D0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Cf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qs));else if(r!==4&&(e=e.child,e!==null))for(Cf(e,t,n),e=e.sibling;e!==null;)Cf(e,t,n),e=e.sibling}function kf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(kf(e,t,n),e=e.sibling;e!==null;)kf(e,t,n),e=e.sibling}var He=null,Kt=!1;function An(e,t,n){for(n=n.child;n!==null;)I0(e,t,n),n=n.sibling}function I0(e,t,n){if(ln&&typeof ln.onCommitFiberUnmount=="function")try{ln.onCommitFiberUnmount(Ll,n)}catch{}switch(n.tag){case 5:Je||ho(n,t);case 6:var r=He,o=Kt;He=null,An(e,t,n),He=r,Kt=o,He!==null&&(Kt?(e=He,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):He.removeChild(n.stateNode));break;case 18:He!==null&&(Kt?(e=He,n=n.stateNode,e.nodeType===8?Ju(e.parentNode,n):e.nodeType===1&&Ju(e,n),Ki(e)):Ju(He,n.stateNode));break;case 4:r=He,o=Kt,He=n.stateNode.containerInfo,Kt=!0,An(e,t,n),He=r,Kt=o;break;case 0:case 11:case 14:case 15:if(!Je&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&((i&2)!==0||(i&4)!==0)&&Rf(n,t,a),o=o.next}while(o!==r)}An(e,t,n);break;case 1:if(!Je&&(ho(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Me(n,t,s)}An(e,t,n);break;case 21:An(e,t,n);break;case 22:n.mode&1?(Je=(r=Je)||n.memoizedState!==null,An(e,t,n),Je=r):An(e,t,n);break;default:An(e,t,n)}}function Kv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new UR),t.forEach(function(r){var o=QR.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function zt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=a),r&=~i}if(r=o,r=$e()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zR(r/1960))-r,10e?16:e,Wn===null)var r=!1;else{if(e=Wn,Wn=null,sl=0,(pe&6)!==0)throw Error(j(331));var o=pe;for(pe|=4,Q=e.current;Q!==null;){var i=Q,a=i.child;if((Q.flags&16)!==0){var s=i.deletions;if(s!==null){for(var l=0;l$e()-Zd?Ar(e,0):Jd|=n),dt(e,t)}function W0(e,t){t===0&&((e.mode&1)===0?t=1:(t=Wa,Wa<<=1,(Wa&130023424)===0&&(Wa=4194304)));var n=nt();e=kn(e,t),e!==null&&(ga(e,t,n),dt(e,n))}function qR(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),W0(e,n)}function QR(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(j(314))}r!==null&&r.delete(t),W0(e,n)}var H0;H0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ct.current)ut=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return ut=!1,DR(e,t,n);ut=(e.flags&131072)!==0}else ut=!1,ke&&(t.flags&1048576)!==0&&Qy(t,Js,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Rs(e,t),e=t.pendingProps;var o=ko(t,Ze.current);_o(t,n),o=Kd(null,t,r,e,o,n);var i=qd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ft(r)?(i=!0,Xs(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,zd(t),o.updater=$l,t.stateNode=o,o._reactInternals=t,gf(t,r,e,n),t=Sf(null,t,r,!0,i,n)):(t.tag=0,ke&&i&&Md(t),tt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Rs(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=XR(r),e=Vt(r,e),o){case 0:t=wf(null,t,r,e,n);break e;case 1:t=zv(null,t,r,e,n);break e;case 11:t=Fv(null,t,r,e,n);break e;case 14:t=jv(null,t,r,Vt(r.type,e),n);break e}throw Error(j(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Vt(r,o),wf(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Vt(r,o),zv(e,t,r,o,n);case 3:e:{if(O0(t),e===null)throw Error(j(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Jy(e,t),tl(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Lo(Error(j(423)),t),t=Bv(e,t,r,n,o);break e}else if(r!==o){o=Lo(Error(j(424)),t),t=Bv(e,t,r,n,o);break e}else for(yt=Zn(t.stateNode.containerInfo.firstChild),wt=t,ke=!0,qt=null,n=n0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Oo(),r===o){t=On(e,t,n);break e}tt(e,t,r,n)}t=t.child}return t;case 5:return r0(t),e===null&&hf(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,uf(r,o)?a=null:i!==null&&uf(r,i)&&(t.flags|=32),k0(e,t),tt(e,t,a,n),t.child;case 6:return e===null&&hf(t),null;case 13:return P0(e,t,n);case 4:return Bd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Po(t,null,r,n):tt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Vt(r,o),Fv(e,t,r,o,n);case 7:return tt(e,t,t.pendingProps,n),t.child;case 8:return tt(e,t,t.pendingProps.children,n),t.child;case 12:return tt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,_e(Zs,r._currentValue),r._currentValue=a,i!==null)if(Jt(i.value,a)){if(i.children===o.children&&!ct.current){t=On(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){a=i.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=_n(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),vf(i.return,n,t),s.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(j(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),vf(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}tt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,_o(t,n),o=Dt(o),r=r(o),t.flags|=1,tt(e,t,r,n),t.child;case 14:return r=t.type,o=Vt(r,t.pendingProps),o=Vt(r.type,o),jv(e,t,r,o,n);case 15:return E0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Vt(r,o),Rs(e,t),t.tag=1,ft(r)?(e=!0,Xs(t)):e=!1,_o(t,n),e0(t,r,o),gf(t,r,o,n),Sf(null,t,r,!0,e,n);case 19:return T0(e,t,n);case 22:return C0(e,t,n)}throw Error(j(156,t.tag))};function K0(e,t){return yy(e,t)}function GR(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Nt(e,t,n,r){return new GR(e,t,n,r)}function rp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function XR(e){if(typeof e=="function")return rp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===_d)return 11;if(e===xd)return 14}return 2}function rr(e,t){var n=e.alternate;return n===null?(n=Nt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ks(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")rp(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case oo:return Mr(n.children,o,i,t);case bd:a=8,o|=8;break;case jc:return e=Nt(12,n,t,o|2),e.elementType=jc,e.lanes=i,e;case zc:return e=Nt(13,n,t,o),e.elementType=zc,e.lanes=i,e;case Bc:return e=Nt(19,n,t,o),e.elementType=Bc,e.lanes=i,e;case ty:return zl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Zg:a=10;break e;case ey:a=9;break e;case _d:a=11;break e;case xd:a=14;break e;case In:a=16,r=null;break e}throw Error(j(130,e==null?e:typeof e,""))}return t=Nt(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Mr(e,t,n,r){return e=Nt(7,e,r,t),e.lanes=n,e}function zl(e,t,n,r){return e=Nt(22,e,r,t),e.elementType=ty,e.lanes=n,e.stateNode={isHidden:!1},e}function ac(e,t,n){return e=Nt(6,e,null,t),e.lanes=n,e}function sc(e,t,n){return t=Nt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function YR(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zu(0),this.expirationTimes=zu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function op(e,t,n,r,o,i,a,s,l){return e=new YR(e,t,n,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Nt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},zd(i),e}function JR(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}t(),e.exports=xt})(ma);const rE=pd(ma.exports);var X0,em=ma.exports;X0=em.createRoot,em.hydrateRoot;var Nf={exports:{}},zr={},be={exports:{}},oE="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",iE=oE,aE=iE;function Y0(){}function J0(){}J0.resetWarningCache=Y0;var sE=function(){function e(r,o,i,a,s,l){if(l!==aE){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:J0,resetWarningCache:Y0};return n.PropTypes=n,n};be.exports=sE();var Af={exports:{}},Zt={},cl={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=s;/*! + * Adapted from jQuery UI core + * + * http://jqueryui.com + * + * Copyright 2014 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://api.jqueryui.com/category/ui-core/ + */var n=/input|select|textarea|button|object|iframe/;function r(l){var u=l.offsetWidth<=0&&l.offsetHeight<=0;if(u&&!l.innerHTML)return!0;try{var c=window.getComputedStyle(l);return u?c.getPropertyValue("overflow")!=="visible"||l.scrollWidth<=0&&l.scrollHeight<=0:c.getPropertyValue("display")=="none"}catch{return console.warn("Failed to inspect element style"),!1}}function o(l){for(var u=l,c=l.getRootNode&&l.getRootNode();u&&u!==document.body;){if(c&&u===c&&(u=c.host.parentNode),r(u))return!1;u=u.parentNode}return!0}function i(l,u){var c=l.nodeName.toLowerCase(),f=n.test(c)&&!l.disabled||c==="a"&&l.href||u;return f&&o(l)}function a(l){var u=l.getAttribute("tabindex");u===null&&(u=void 0);var c=isNaN(u);return(c||u>=0)&&i(l,!c)}function s(l){var u=[].slice.call(l.querySelectorAll("*"),0).reduce(function(c,f){return c.concat(f.shadowRoot?s(f.shadowRoot):[f])},[]);return u.filter(a)}e.exports=t.default})(cl,cl.exports);Object.defineProperty(Zt,"__esModule",{value:!0});Zt.resetState=fE;Zt.log=dE;Zt.handleBlur=oa;Zt.handleFocus=ia;Zt.markForFocusLater=pE;Zt.returnFocus=hE;Zt.popWithoutFocus=vE;Zt.setupScopedFocus=mE;Zt.teardownScopedFocus=gE;var lE=cl.exports,uE=cE(lE);function cE(e){return e&&e.__esModule?e:{default:e}}var Ao=[],mo=null,Mf=!1;function fE(){Ao=[]}function dE(){}function oa(){Mf=!0}function ia(){if(Mf){if(Mf=!1,!mo)return;setTimeout(function(){if(!mo.contains(document.activeElement)){var e=(0,uE.default)(mo)[0]||mo;e.focus()}},0)}}function pE(){Ao.push(document.activeElement)}function hE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=null;try{Ao.length!==0&&(t=Ao.pop(),t.focus({preventScroll:e}));return}catch{console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}}function vE(){Ao.length>0&&Ao.pop()}function mE(e){mo=e,window.addEventListener?(window.addEventListener("blur",oa,!1),document.addEventListener("focus",ia,!0)):(window.attachEvent("onBlur",oa),document.attachEvent("onFocus",ia))}function gE(){mo=null,window.addEventListener?(window.removeEventListener("blur",oa),document.removeEventListener("focus",ia)):(window.detachEvent("onBlur",oa),document.detachEvent("onFocus",ia))}var Df={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=cl.exports,r=o(n);function o(s){return s&&s.__esModule?s:{default:s}}function i(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return s.activeElement.shadowRoot?i(s.activeElement.shadowRoot):s.activeElement}function a(s,l){var u=(0,r.default)(s);if(!u.length){l.preventDefault();return}var c=void 0,f=l.shiftKey,p=u[0],m=u[u.length-1],g=i();if(s===g){if(!f)return;c=m}if(m===g&&!f&&(c=p),p===g&&f&&(c=m),c){l.preventDefault(),c.focus();return}var y=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),b=y!=null&&y[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(!!b){var h=u.indexOf(g);if(h>-1&&(h+=f?-1:1),c=u[h],typeof c>"u"){l.preventDefault(),c=f?m:p,c.focus();return}l.preventDefault(),c.focus()}}e.exports=t.default})(Df,Df.exports);var en={},yE=function(){},wE=yE,Yt={},Z0={exports:{}};/*! + Copyright (c) 2015 Jed Watson. + Based on code that is Copyright 2013-2015, Facebook, Inc. + All rights reserved. +*/(function(e){(function(){var t=!!(typeof window<"u"&&window.document&&window.document.createElement),n={canUseDOM:t,canUseWorkers:typeof Worker<"u",canUseEventListeners:t&&!!(window.addEventListener||window.attachEvent),canUseViewport:t&&!!window.screen};e.exports?e.exports=n:window.ExecutionEnvironment=n})()})(Z0);Object.defineProperty(Yt,"__esModule",{value:!0});Yt.canUseDOM=Yt.SafeNodeList=Yt.SafeHTMLCollection=void 0;var SE=Z0.exports,bE=_E(SE);function _E(e){return e&&e.__esModule?e:{default:e}}var Kl=bE.default,xE=Kl.canUseDOM?window.HTMLElement:{};Yt.SafeHTMLCollection=Kl.canUseDOM?window.HTMLCollection:{};Yt.SafeNodeList=Kl.canUseDOM?window.NodeList:{};Yt.canUseDOM=Kl.canUseDOM;Yt.default=xE;Object.defineProperty(en,"__esModule",{value:!0});en.resetState=OE;en.log=PE;en.assertNodeList=e1;en.setElement=TE;en.validateElement=lp;en.hide=LE;en.show=NE;en.documentNotReadyOrSSRTesting=AE;var RE=wE,EE=kE(RE),CE=Yt;function kE(e){return e&&e.__esModule?e:{default:e}}var Pt=null;function OE(){Pt&&(Pt.removeAttribute?Pt.removeAttribute("aria-hidden"):Pt.length!=null?Pt.forEach(function(e){return e.removeAttribute("aria-hidden")}):document.querySelectorAll(Pt).forEach(function(e){return e.removeAttribute("aria-hidden")})),Pt=null}function PE(){}function e1(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function TE(e){var t=e;if(typeof t=="string"&&CE.canUseDOM){var n=document.querySelectorAll(t);e1(n,t),t=n}return Pt=t||Pt,Pt}function lp(e){var t=e||Pt;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,EE.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}function LE(e){var t=!0,n=!1,r=void 0;try{for(var o=lp(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.setAttribute("aria-hidden","true")}}catch(s){n=!0,r=s}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}function NE(e){var t=!0,n=!1,r=void 0;try{for(var o=lp(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.removeAttribute("aria-hidden")}}catch(s){n=!0,r=s}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}function AE(){Pt=null}var Ho={};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.resetState=ME;Ho.log=DE;var Mi={},Di={};function tm(e,t){e.classList.remove(t)}function ME(){var e=document.getElementsByTagName("html")[0];for(var t in Mi)tm(e,Mi[t]);var n=document.body;for(var r in Di)tm(n,Di[r]);Mi={},Di={}}function DE(){}var IE=function(t,n){return t[n]||(t[n]=0),t[n]+=1,n},$E=function(t,n){return t[n]&&(t[n]-=1),n},UE=function(t,n,r){r.forEach(function(o){IE(n,o),t.add(o)})},FE=function(t,n,r){r.forEach(function(o){$E(n,o),n[o]===0&&t.remove(o)})};Ho.add=function(t,n){return UE(t.classList,t.nodeName.toLowerCase()=="html"?Mi:Di,n.split(" "))};Ho.remove=function(t,n){return FE(t.classList,t.nodeName.toLowerCase()=="html"?Mi:Di,n.split(" "))};var Ko={};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.log=zE;Ko.resetState=BE;function jE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var t1=function e(){var t=this;jE(this,e),this.register=function(n){t.openInstances.indexOf(n)===-1&&(t.openInstances.push(n),t.emit("register"))},this.deregister=function(n){var r=t.openInstances.indexOf(n);r!==-1&&(t.openInstances.splice(r,1),t.emit("deregister"))},this.subscribe=function(n){t.subscribers.push(n)},this.emit=function(n){t.subscribers.forEach(function(r){return r(n,t.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},fl=new t1;function zE(){console.log("portalOpenInstances ----------"),console.log(fl.openInstances.length),fl.openInstances.forEach(function(e){return console.log(e)}),console.log("end portalOpenInstances ----------")}function BE(){fl=new t1}Ko.default=fl;var up={};Object.defineProperty(up,"__esModule",{value:!0});up.resetState=KE;up.log=qE;var VE=Ko,WE=HE(VE);function HE(e){return e&&e.__esModule?e:{default:e}}var Xe=void 0,Wt=void 0,Dr=[];function KE(){for(var e=[Xe,Wt],t=0;t0?(document.body.firstChild!==Xe&&document.body.insertBefore(Xe,document.body.firstChild),document.body.lastChild!==Wt&&document.body.appendChild(Wt)):(Xe.parentElement&&Xe.parentElement.removeChild(Xe),Wt.parentElement&&Wt.parentElement.removeChild(Wt))}WE.default.subscribe(QE);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(S){for(var L=1;L0&&(oe-=1,oe===0&&m.show(D)),P.props.shouldFocusAfterRender&&(P.props.shouldReturnFocusAfterClose?(u.returnFocus(P.props.preventScroll),u.teardownScopedFocus()):u.popWithoutFocus()),P.props.onAfterClose&&P.props.onAfterClose(),v.default.deregister(P)},P.open=function(){P.beforeOpen(),P.state.afterOpen&&P.state.beforeClose?(clearTimeout(P.closeTimer),P.setState({beforeClose:!1})):(P.props.shouldFocusAfterRender&&(u.setupScopedFocus(P.node),u.markForFocusLater()),P.setState({isOpen:!0},function(){P.openAnimationFrame=requestAnimationFrame(function(){P.setState({afterOpen:!0}),P.props.isOpen&&P.props.onAfterOpen&&P.props.onAfterOpen({overlayEl:P.overlay,contentEl:P.content})})}))},P.close=function(){P.props.closeTimeoutMS>0?P.closeWithTimeout():P.closeWithoutTimeout()},P.focusContent=function(){return P.content&&!P.contentHasFocus()&&P.content.focus({preventScroll:!0})},P.closeWithTimeout=function(){var N=Date.now()+P.props.closeTimeoutMS;P.setState({beforeClose:!0,closesAt:N},function(){P.closeTimer=setTimeout(P.closeWithoutTimeout,P.state.closesAt-Date.now())})},P.closeWithoutTimeout=function(){P.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},P.afterClose)},P.handleKeyDown=function(N){N.keyCode===M&&(0,f.default)(P.content,N),P.props.shouldCloseOnEsc&&N.keyCode===W&&(N.stopPropagation(),P.requestClose(N))},P.handleOverlayOnClick=function(N){P.shouldClose===null&&(P.shouldClose=!0),P.shouldClose&&P.props.shouldCloseOnOverlayClick&&(P.ownerHandlesClose()?P.requestClose(N):P.focusContent()),P.shouldClose=null},P.handleContentOnMouseUp=function(){P.shouldClose=!1},P.handleOverlayOnMouseDown=function(N){!P.props.shouldCloseOnOverlayClick&&N.target==P.overlay&&N.preventDefault()},P.handleContentOnClick=function(){P.shouldClose=!1},P.handleContentOnMouseDown=function(){P.shouldClose=!1},P.requestClose=function(N){return P.ownerHandlesClose()&&P.props.onRequestClose(N)},P.ownerHandlesClose=function(){return P.props.onRequestClose},P.shouldBeClosed=function(){return!P.state.isOpen&&!P.state.beforeClose},P.contentHasFocus=function(){return document.activeElement===P.content||P.content.contains(document.activeElement)},P.buildClassName=function(N,D){var $=(typeof D>"u"?"undefined":r(D))==="object"?D:{base:I[N],afterOpen:I[N]+"--after-open",beforeClose:I[N]+"--before-close"},U=$.base;return P.state.afterOpen&&(U=U+" "+$.afterOpen),P.state.beforeClose&&(U=U+" "+$.beforeClose),typeof D=="string"&&D?U+" "+D:U},P.attributesFromObject=function(N,D){return Object.keys(D).reduce(function($,U){return $[N+"-"+U]=D[U],$},{})},P.state={afterOpen:!1,beforeClose:!1},P.shouldClose=null,P.moveFromContentToOverlay=null,P}return o(L,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(P,N){this.props.isOpen&&!P.isOpen?this.open():!this.props.isOpen&&P.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!N.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var P=this.props,N=P.appElement,D=P.ariaHideApp,$=P.htmlOpenClassName,U=P.bodyOpenClassName;U&&y.add(document.body,U),$&&y.add(document.getElementsByTagName("html")[0],$),D&&(oe+=1,m.hide(N)),v.default.register(this)}},{key:"render",value:function(){var P=this.props,N=P.id,D=P.className,$=P.overlayClassName,U=P.defaultStyles,E=P.children,V=D?{}:U.content,z=$?{}:U.overlay;if(this.shouldBeClosed())return null;var J={ref:this.setOverlayRef,className:this.buildClassName("overlay",$),style:n({},z,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},H=n({id:N,ref:this.setContentRef,style:n({},V,this.props.style.content),className:this.buildClassName("content",D),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",n({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),Z=this.props.contentElement(H,E);return this.props.overlayElement(J,Z)}}]),L}(i.Component);X.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},X.propTypes={isOpen:s.default.bool.isRequired,defaultStyles:s.default.shape({content:s.default.object,overlay:s.default.object}),style:s.default.shape({content:s.default.object,overlay:s.default.object}),className:s.default.oneOfType([s.default.string,s.default.object]),overlayClassName:s.default.oneOfType([s.default.string,s.default.object]),bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,ariaHideApp:s.default.bool,appElement:s.default.oneOfType([s.default.instanceOf(h.default),s.default.instanceOf(b.SafeHTMLCollection),s.default.instanceOf(b.SafeNodeList),s.default.arrayOf(s.default.instanceOf(h.default))]),onAfterOpen:s.default.func,onAfterClose:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,role:s.default.string,contentLabel:s.default.string,aria:s.default.object,data:s.default.object,children:s.default.node,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func,testId:s.default.string},t.default=X,e.exports=t.default})(Af,Af.exports);function n1(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function r1(e){function t(n){var r=this.constructor.getDerivedStateFromProps(e,n);return r!=null?r:null}this.setState(t.bind(this))}function o1(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}n1.__suppressDeprecationWarning=!0;r1.__suppressDeprecationWarning=!0;o1.__suppressDeprecationWarning=!0;function GE(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var n=null,r=null,o=null;if(typeof t.componentWillMount=="function"?n="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?o="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(o="UNSAFE_componentWillUpdate"),n!==null||r!==null||o!==null){var i=e.displayName||e.name,a=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. + +`+i+" uses "+a+" but also contains the following legacy lifecycles:"+(n!==null?` + `+n:"")+(r!==null?` + `+r:"")+(o!==null?` + `+o:"")+` + +The above lifecycles should be removed. Learn more about this warning here: +https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=n1,t.componentWillReceiveProps=r1),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=o1;var s=t.componentDidUpdate;t.componentDidUpdate=function(u,c,f){var p=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:f;s.call(this,u,c,p)}}return e}const XE=Object.freeze(Object.defineProperty({__proto__:null,polyfill:GE},Symbol.toStringTag,{value:"Module"})),YE=c_(XE);Object.defineProperty(zr,"__esModule",{value:!0});zr.bodyOpenClassName=zr.portalClassName=void 0;var rm=Object.assign||function(e){for(var t=1;t"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?gC:mC;s1.useSyncExternalStore=Mo.useSyncExternalStore!==void 0?Mo.useSyncExternalStore:yC;(function(e){e.exports=s1})(cp);var ql={exports:{}},Ql={};/** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var wC=x.exports,SC=Symbol.for("react.element"),bC=Symbol.for("react.fragment"),_C=Object.prototype.hasOwnProperty,xC=wC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,RC={key:!0,ref:!0,__self:!0,__source:!0};function l1(e,t,n){var r,o={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)_C.call(t,r)&&!RC.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:SC,type:e,key:i,ref:a,props:o,_owner:xC.current}}Ql.Fragment=bC;Ql.jsx=l1;Ql.jsxs=l1;(function(e){e.exports=Ql})(ql);const xn=ql.exports.Fragment,_=ql.exports.jsx,te=ql.exports.jsxs;/** + * react-query + * + * Copyright (c) TanStack + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */class qo{constructor(){this.listeners=[],this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.push(t),this.onSubscribe(),()=>{this.listeners=this.listeners.filter(n=>n!==t),this.onUnsubscribe()}}hasListeners(){return this.listeners.length>0}onSubscribe(){}onUnsubscribe(){}}const aa=typeof window>"u";function Ot(){}function EC(e,t){return typeof e=="function"?e(t):e}function If(e){return typeof e=="number"&&e>=0&&e!==1/0}function u1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Os(e,t,n){return xa(e)?typeof t=="function"?{...n,queryKey:e,queryFn:t}:{...t,queryKey:e}:e}function CC(e,t,n){return xa(e)?typeof t=="function"?{...n,mutationKey:e,mutationFn:t}:{...t,mutationKey:e}:typeof e=="function"?{...t,mutationFn:e}:{...e}}function Un(e,t,n){return xa(e)?[{...t,queryKey:e},n]:[e||{},t]}function um(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:s}=e;if(xa(a)){if(r){if(t.queryHash!==fp(a,t.options))return!1}else if(!hl(t.queryKey,a))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||typeof o<"u"&&o!==t.state.fetchStatus||i&&!i(t))}function cm(e,t){const{exact:n,fetching:r,predicate:o,mutationKey:i}=e;if(xa(i)){if(!t.options.mutationKey)return!1;if(n){if(Lr(t.options.mutationKey)!==Lr(i))return!1}else if(!hl(t.options.mutationKey,i))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||o&&!o(t))}function fp(e,t){return((t==null?void 0:t.queryKeyHashFn)||Lr)(e)}function Lr(e){return JSON.stringify(e,(t,n)=>Uf(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function hl(e,t){return c1(e,t)}function c1(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!c1(e[n],t[n])):!1}function f1(e,t){if(e===t)return e;const n=fm(e)&&fm(t);if(n||Uf(e)&&Uf(t)){const r=n?e.length:Object.keys(e).length,o=n?t:Object.keys(t),i=o.length,a=n?[]:{};let s=0;for(let l=0;l"u")return!0;const n=t.prototype;return!(!dm(n)||!n.hasOwnProperty("isPrototypeOf"))}function dm(e){return Object.prototype.toString.call(e)==="[object Object]"}function xa(e){return Array.isArray(e)}function d1(e){return new Promise(t=>{setTimeout(t,e)})}function pm(e){d1(0).then(e)}function kC(){if(typeof AbortController=="function")return new AbortController}function Ff(e,t,n){return n.isDataEqual!=null&&n.isDataEqual(e,t)?e:typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?f1(e,t):t}class OC extends qo{constructor(){super(),this.setup=t=>{if(!aa&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(t){this.focused=t,t&&this.onFocus()}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document>"u"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const vl=new OC;class PC extends qo{constructor(){super(),this.setup=t=>{if(!aa&&window.addEventListener){const n=()=>t();return window.addEventListener("online",n,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var t;(t=this.cleanup)==null||t.call(this),this.cleanup=void 0}}setEventListener(t){var n;this.setup=t,(n=this.cleanup)==null||n.call(this),this.cleanup=t(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(t){this.online=t,t&&this.onOnline()}onOnline(){this.listeners.forEach(t=>{t()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator>"u"||typeof navigator.onLine>"u"?!0:navigator.onLine}}const ml=new PC;function TC(e){return Math.min(1e3*2**e,3e4)}function Gl(e){return(e!=null?e:"online")==="online"?ml.isOnline():!0}class p1{constructor(t){this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}}function Ps(e){return e instanceof p1}function h1(e){let t=!1,n=0,r=!1,o,i,a;const s=new Promise((b,h)=>{i=b,a=h}),l=b=>{r||(m(new p1(b)),e.abort==null||e.abort())},u=()=>{t=!0},c=()=>{t=!1},f=()=>!vl.isFocused()||e.networkMode!=="always"&&!ml.isOnline(),p=b=>{r||(r=!0,e.onSuccess==null||e.onSuccess(b),o==null||o(),i(b))},m=b=>{r||(r=!0,e.onError==null||e.onError(b),o==null||o(),a(b))},g=()=>new Promise(b=>{o=h=>{if(r||!f())return b(h)},e.onPause==null||e.onPause()}).then(()=>{o=void 0,r||e.onContinue==null||e.onContinue()}),y=()=>{if(r)return;let b;try{b=e.fn()}catch(h){b=Promise.reject(h)}Promise.resolve(b).then(p).catch(h=>{var d,v;if(r)return;const w=(d=e.retry)!=null?d:3,O=(v=e.retryDelay)!=null?v:TC,R=typeof O=="function"?O(n,h):O,A=w===!0||typeof w=="number"&&n{if(f())return g()}).then(()=>{t?m(h):y()})})};return Gl(e.networkMode)?y():g().then(y),{promise:s,cancel:l,continue:()=>{o==null||o()},cancelRetry:u,continueRetry:c}}const dp=console;function LC(){let e=[],t=0,n=c=>{c()},r=c=>{c()};const o=c=>{let f;t++;try{f=c()}finally{t--,t||s()}return f},i=c=>{t?e.push(c):pm(()=>{n(c)})},a=c=>(...f)=>{i(()=>{c(...f)})},s=()=>{const c=e;e=[],c.length&&pm(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:o,batchCalls:a,schedule:i,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c}}}const De=LC();class v1{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),If(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(t){this.cacheTime=Math.max(this.cacheTime||0,t!=null?t:aa?1/0:5*60*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class NC extends v1{constructor(t){super(),this.abortSignalConsumed=!1,this.defaultOptions=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.cache=t.cache,this.logger=t.logger||dp,this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.initialState=t.state||AC(this.options),this.state=this.initialState,this.meta=t.meta}setOptions(t){this.options={...this.defaultOptions,...t},this.meta=t==null?void 0:t.meta,this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(t,n){const r=Ff(this.state.data,t,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){this.dispatch({type:"setState",state:t,setStateOptions:n})}cancel(t){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(t),r?r.then(Ot).catch(Ot):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!u1(this.state.dataUpdatedAt,t)}onFocus(){var t;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}onOnline(){var t;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(t=this.retryer)==null||t.continue()}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.indexOf(t)!==-1&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(t,n){var r,o;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var i;return(i=this.retryer)==null||i.continueRetry(),this.promise}}if(t&&this.setOptions(t),!this.options.queryFn){const m=this.observers.find(g=>g.options.queryFn);m&&this.setOptions(m.options)}Array.isArray(this.options.queryKey);const a=kC(),s={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},l=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>{if(a)return this.abortSignalConsumed=!0,a.signal}})};l(s);const u=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(s)):Promise.reject("Missing queryFn"),c={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:u,meta:this.meta};if(l(c),(r=this.options.behavior)==null||r.onFetch(c),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((o=c.fetchOptions)==null?void 0:o.meta)){var f;this.dispatch({type:"fetch",meta:(f=c.fetchOptions)==null?void 0:f.meta})}const p=m=>{if(Ps(m)&&m.silent||this.dispatch({type:"error",error:m}),!Ps(m)){var g,y;(g=(y=this.cache.config).onError)==null||g.call(y,m,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=h1({fn:c.fetchFn,abort:a==null?void 0:a.abort.bind(a),onSuccess:m=>{var g,y;if(typeof m>"u"){p(new Error("Query data cannot be undefined"));return}this.setData(m),(g=(y=this.cache.config).onSuccess)==null||g.call(y,m,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:p,onFail:()=>{this.dispatch({type:"failed"})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(t){const n=r=>{var o,i;switch(t.type){case"failed":return{...r,fetchFailureCount:r.fetchFailureCount+1};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,fetchFailureCount:0,fetchMeta:(o=t.meta)!=null?o:null,fetchStatus:Gl(this.options.networkMode)?"fetching":"paused",...!r.dataUpdatedAt&&{error:null,status:"loading"}};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(i=t.dataUpdatedAt)!=null?i:Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0}};case"error":const a=t.error;return Ps(a)&&a.revert&&this.revertState?{...this.revertState}:{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),De.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(t)}),this.cache.notify({query:this,type:"updated",action:t})})}}function AC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=typeof e.initialData<"u"?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0,o=typeof t<"u";return{data:t,dataUpdateCount:0,dataUpdatedAt:o?r!=null?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchMeta:null,isInvalidated:!1,status:o?"success":"loading",fetchStatus:"idle"}}class m1 extends qo{constructor(t){super(),this.config=t||{},this.queries=[],this.queriesMap={}}build(t,n,r){var o;const i=n.queryKey,a=(o=n.queryHash)!=null?o:fp(i,n);let s=this.get(a);return s||(s=new NC({cache:this,logger:t.getLogger(),queryKey:i,queryHash:a,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i),meta:n.meta}),this.add(s)),s}add(t){this.queriesMap[t.queryHash]||(this.queriesMap[t.queryHash]=t,this.queries.push(t),this.notify({type:"added",query:t}))}remove(t){const n=this.queriesMap[t.queryHash];n&&(t.destroy(),this.queries=this.queries.filter(r=>r!==t),n===t&&delete this.queriesMap[t.queryHash],this.notify({type:"removed",query:t}))}clear(){De.batch(()=>{this.queries.forEach(t=>{this.remove(t)})})}get(t){return this.queriesMap[t]}getAll(){return this.queries}find(t,n){const[r]=Un(t,n);return typeof r.exact>"u"&&(r.exact=!0),this.queries.find(o=>um(r,o))}findAll(t,n){const[r]=Un(t,n);return Object.keys(r).length>0?this.queries.filter(o=>um(r,o)):this.queries}notify(t){De.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){De.batch(()=>{this.queries.forEach(t=>{t.onFocus()})})}onOnline(){De.batch(()=>{this.queries.forEach(t=>{t.onOnline()})})}}class MC extends v1{constructor(t){super(),this.options={...t.defaultOptions,...t.options},this.mutationId=t.mutationId,this.mutationCache=t.mutationCache,this.logger=t.logger||dp,this.observers=[],this.state=t.state||g1(),this.meta=t.meta,this.updateCacheTime(this.options.cacheTime),this.scheduleGc()}setState(t){this.dispatch({type:"setState",state:t})}addObserver(t){this.observers.indexOf(t)===-1&&(this.observers.push(t),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.observers=this.observers.filter(n=>n!==t),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()}async execute(){const t=()=>{var v;return this.retryer=h1({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:()=>{this.dispatch({type:"failed"})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(v=this.options.retry)!=null?v:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,o,i,a,s,l;if(!n){var u,c,f,p;this.dispatch({type:"loading",variables:this.options.variables}),(u=(c=this.mutationCache.config).onMutate)==null||u.call(c,this.state.variables,this);const w=await((f=(p=this.options).onMutate)==null?void 0:f.call(p,this.state.variables));w!==this.state.context&&this.dispatch({type:"loading",context:w,variables:this.state.variables})}const v=await t();return(r=(o=this.mutationCache.config).onSuccess)==null||r.call(o,v,this.state.variables,this.state.context,this),await((i=(a=this.options).onSuccess)==null?void 0:i.call(a,v,this.state.variables,this.state.context)),await((s=(l=this.options).onSettled)==null?void 0:s.call(l,v,null,this.state.variables,this.state.context)),this.dispatch({type:"success",data:v}),v}catch(v){try{var m,g,y,b,h,d;throw(m=(g=this.mutationCache.config).onError)==null||m.call(g,v,this.state.variables,this.state.context,this),await((y=(b=this.options).onError)==null?void 0:y.call(b,v,this.state.variables,this.state.context)),await((h=(d=this.options).onSettled)==null?void 0:h.call(d,void 0,v,this.state.variables,this.state.context)),v}finally{this.dispatch({type:"error",error:v})}}}dispatch(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:r.failureCount+1};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"loading":return{...r,context:t.context,data:void 0,error:null,isPaused:!Gl(this.options.networkMode),status:"loading",variables:t.variables};case"success":return{...r,data:t.data,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,isPaused:!1,status:"error"};case"setState":return{...r,...t.state}}};this.state=n(this.state),De.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(t)}),this.mutationCache.notify({mutation:this,type:"updated",action:t})})}}function g1(){return{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0}}class DC extends qo{constructor(t){super(),this.config=t||{},this.mutations=[],this.mutationId=0}build(t,n,r){const o=new MC({mutationCache:this,logger:t.getLogger(),mutationId:++this.mutationId,options:t.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?t.getMutationDefaults(n.mutationKey):void 0,meta:n.meta});return this.add(o),o}add(t){this.mutations.push(t),this.notify({type:"added",mutation:t})}remove(t){this.mutations=this.mutations.filter(n=>n!==t),this.notify({type:"removed",mutation:t})}clear(){De.batch(()=>{this.mutations.forEach(t=>{this.remove(t)})})}getAll(){return this.mutations}find(t){return typeof t.exact>"u"&&(t.exact=!0),this.mutations.find(n=>cm(t,n))}findAll(t){return this.mutations.filter(n=>cm(t,n))}notify(t){De.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.mutations.filter(n=>n.state.isPaused);return De.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Ot)),Promise.resolve()))}}function IC(){return{onFetch:e=>{e.fetchFn=()=>{var t,n,r,o,i,a;const s=(t=e.fetchOptions)==null||(n=t.meta)==null?void 0:n.refetchPage,l=(r=e.fetchOptions)==null||(o=r.meta)==null?void 0:o.fetchMore,u=l==null?void 0:l.pageParam,c=(l==null?void 0:l.direction)==="forward",f=(l==null?void 0:l.direction)==="backward",p=((i=e.state.data)==null?void 0:i.pages)||[],m=((a=e.state.data)==null?void 0:a.pageParams)||[];let g=m,y=!1;const b=R=>{Object.defineProperty(R,"signal",{enumerable:!0,get:()=>{var A;if((A=e.signal)!=null&&A.aborted)y=!0;else{var C;(C=e.signal)==null||C.addEventListener("abort",()=>{y=!0})}return e.signal}})},h=e.options.queryFn||(()=>Promise.reject("Missing queryFn")),d=(R,A,C,I)=>(g=I?[A,...g]:[...g,A],I?[C,...R]:[...R,C]),v=(R,A,C,I)=>{if(y)return Promise.reject("Cancelled");if(typeof C>"u"&&!A&&R.length)return Promise.resolve(R);const M={queryKey:e.queryKey,pageParam:C,meta:e.meta};b(M);const W=h(M);return Promise.resolve(W).then(X=>d(R,C,X,I))};let w;if(!p.length)w=v([]);else if(c){const R=typeof u<"u",A=R?u:hm(e.options,p);w=v(p,R,A)}else if(f){const R=typeof u<"u",A=R?u:$C(e.options,p);w=v(p,R,A,!0)}else{g=[];const R=typeof e.options.getNextPageParam>"u";w=(s&&p[0]?s(p[0],0,p):!0)?v([],R,m[0]):Promise.resolve(d([],m[0],p[0]));for(let C=1;C{if(s&&p[C]?s(p[C],C,p):!0){const W=R?m[C]:hm(e.options,I);return v(I,R,W)}return Promise.resolve(d(I,m[C],p[C]))})}return w.then(R=>({pages:R,pageParams:g}))}}}}function hm(e,t){return e.getNextPageParam==null?void 0:e.getNextPageParam(t[t.length-1],t)}function $C(e,t){return e.getPreviousPageParam==null?void 0:e.getPreviousPageParam(t[0],t)}class UC{constructor(t={}){this.queryCache=t.queryCache||new m1,this.mutationCache=t.mutationCache||new DC,this.logger=t.logger||dp,this.defaultOptions=t.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[]}mount(){this.unsubscribeFocus=vl.subscribe(()=>{vl.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=ml.subscribe(()=>{ml.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())})}unmount(){var t,n;(t=this.unsubscribeFocus)==null||t.call(this),(n=this.unsubscribeOnline)==null||n.call(this)}isFetching(t,n){const[r]=Un(t,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(t){return this.mutationCache.findAll({...t,fetching:!0}).length}getQueryData(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state.data}getQueriesData(t){return this.getQueryCache().findAll(t).map(({queryKey:n,state:r})=>{const o=r.data;return[n,o]})}setQueryData(t,n,r){const o=this.queryCache.find(t),i=o==null?void 0:o.state.data,a=EC(n,i);if(typeof a>"u")return;const s=Os(t),l=this.defaultQueryOptions(s);return this.queryCache.build(this,l).setData(a,{...r,manual:!0})}setQueriesData(t,n,r){return De.batch(()=>this.getQueryCache().findAll(t).map(({queryKey:o})=>[o,this.setQueryData(o,n,r)]))}getQueryState(t,n){var r;return(r=this.queryCache.find(t,n))==null?void 0:r.state}removeQueries(t,n){const[r]=Un(t,n),o=this.queryCache;De.batch(()=>{o.findAll(r).forEach(i=>{o.remove(i)})})}resetQueries(t,n,r){const[o,i]=Un(t,n,r),a=this.queryCache,s={type:"active",...o};return De.batch(()=>(a.findAll(o).forEach(l=>{l.reset()}),this.refetchQueries(s,i)))}cancelQueries(t,n,r){const[o,i={}]=Un(t,n,r);typeof i.revert>"u"&&(i.revert=!0);const a=De.batch(()=>this.queryCache.findAll(o).map(s=>s.cancel(i)));return Promise.all(a).then(Ot).catch(Ot)}invalidateQueries(t,n,r){const[o,i]=Un(t,n,r);return De.batch(()=>{var a,s;if(this.queryCache.findAll(o).forEach(u=>{u.invalidate()}),o.refetchType==="none")return Promise.resolve();const l={...o,type:(a=(s=o.refetchType)!=null?s:o.type)!=null?a:"active"};return this.refetchQueries(l,i)})}refetchQueries(t,n,r){const[o,i]=Un(t,n,r),a=De.batch(()=>this.queryCache.findAll(o).filter(l=>!l.isDisabled()).map(l=>{var u;return l.fetch(void 0,{...i,cancelRefetch:(u=i==null?void 0:i.cancelRefetch)!=null?u:!0,meta:{refetchPage:o.refetchPage}})}));let s=Promise.all(a).then(Ot);return i!=null&&i.throwOnError||(s=s.catch(Ot)),s}fetchQuery(t,n,r){const o=Os(t,n,r),i=this.defaultQueryOptions(o);typeof i.retry>"u"&&(i.retry=!1);const a=this.queryCache.build(this,i);return a.isStaleByTime(i.staleTime)?a.fetch(i):Promise.resolve(a.state.data)}prefetchQuery(t,n,r){return this.fetchQuery(t,n,r).then(Ot).catch(Ot)}fetchInfiniteQuery(t,n,r){const o=Os(t,n,r);return o.behavior=IC(),this.fetchQuery(o)}prefetchInfiniteQuery(t,n,r){return this.fetchInfiniteQuery(t,n,r).then(Ot).catch(Ot)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(t){this.defaultOptions=t}setQueryDefaults(t,n){const r=this.queryDefaults.find(o=>Lr(t)===Lr(o.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:t,defaultOptions:n})}getQueryDefaults(t){if(!t)return;const n=this.queryDefaults.find(r=>hl(t,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(t,n){const r=this.mutationDefaults.find(o=>Lr(t)===Lr(o.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:t,defaultOptions:n})}getMutationDefaults(t){if(!t)return;const n=this.mutationDefaults.find(r=>hl(t,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(t){if(t!=null&&t._defaulted)return t;const n={...this.defaultOptions.queries,...this.getQueryDefaults(t==null?void 0:t.queryKey),...t,_defaulted:!0};return!n.queryHash&&n.queryKey&&(n.queryHash=fp(n.queryKey,n)),typeof n.refetchOnReconnect>"u"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary>"u"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...this.defaultOptions.mutations,...this.getMutationDefaults(t==null?void 0:t.mutationKey),...t,_defaulted:!0}}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class FC extends qo{constructor(t,n){super(),this.client=t,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.length===1&&(this.currentQuery.addObserver(this),vm(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.listeners.length||this.destroy()}shouldFetchOnReconnect(){return jf(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return jf(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=[],this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(t,n){const r=this.options,o=this.currentQuery;if(this.options=this.client.defaultQueryOptions(t),$f(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const i=this.hasListeners();i&&mm(this.currentQuery,o,this.options,r)&&this.executeFetch(),this.updateResult(n),i&&(this.currentQuery!==o||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const a=this.computeRefetchInterval();i&&(this.currentQuery!==o||this.options.enabled!==r.enabled||a!==this.currentRefetchInterval)&&this.updateRefetchInterval(a)}getOptimisticResult(t){const n=this.client.getQueryCache().build(this.client,t);return this.createResult(n,t)}getCurrentResult(){return this.currentResult}trackResult(t){const n={};return Object.keys(t).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),t[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch({refetchPage:t,...n}={}){return this.fetch({...n,meta:{refetchPage:t}})}fetchOptimistic(t){const n=this.client.defaultQueryOptions(t),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){var n;return this.executeFetch({...t,cancelRefetch:(n=t.cancelRefetch)!=null?n:!0}).then(()=>(this.updateResult(),this.currentResult))}executeFetch(t){this.updateQuery();let n=this.currentQuery.fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Ot)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),aa||this.currentResult.isStale||!If(this.options.staleTime))return;const n=u1(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var t;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(t=this.options.refetchInterval)!=null?t:!1}updateRefetchInterval(t){this.clearRefetchInterval(),this.currentRefetchInterval=t,!(aa||this.options.enabled===!1||!If(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||vl.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(t,n){const r=this.currentQuery,o=this.options,i=this.currentResult,a=this.currentResultState,s=this.currentResultOptions,l=t!==r,u=l?t.state:this.currentQueryInitialState,c=l?this.currentResult:this.previousQueryResult,{state:f}=t;let{dataUpdatedAt:p,error:m,errorUpdatedAt:g,fetchStatus:y,status:b}=f,h=!1,d=!1,v;if(n._optimisticResults){const R=this.hasListeners(),A=!R&&vm(t,n),C=R&&mm(t,r,n,o);(A||C)&&(y=Gl(t.options.networkMode)?"fetching":"paused",p||(b="loading")),n._optimisticResults==="isRestoring"&&(y="idle")}if(n.keepPreviousData&&!f.dataUpdateCount&&c!=null&&c.isSuccess&&b!=="error")v=c.data,p=c.dataUpdatedAt,b=c.status,h=!0;else if(n.select&&typeof f.data<"u")if(i&&f.data===(a==null?void 0:a.data)&&n.select===this.selectFn)v=this.selectResult;else try{this.selectFn=n.select,v=n.select(f.data),v=Ff(i==null?void 0:i.data,v,n),this.selectResult=v,this.selectError=null}catch(R){this.selectError=R}else v=f.data;if(typeof n.placeholderData<"u"&&typeof v>"u"&&b==="loading"){let R;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(s==null?void 0:s.placeholderData))R=i.data;else if(R=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof R<"u")try{R=n.select(R),R=Ff(i==null?void 0:i.data,R,n),this.selectError=null}catch(A){this.selectError=A}typeof R<"u"&&(b="success",v=R,d=!0)}this.selectError&&(m=this.selectError,v=this.selectResult,g=Date.now(),b="error");const w=y==="fetching";return{status:b,fetchStatus:y,isLoading:b==="loading",isSuccess:b==="success",isError:b==="error",data:v,dataUpdatedAt:p,error:m,errorUpdatedAt:g,failureCount:f.fetchFailureCount,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&b!=="loading",isLoadingError:b==="error"&&f.dataUpdatedAt===0,isPaused:y==="paused",isPlaceholderData:d,isPreviousData:h,isRefetchError:b==="error"&&f.dataUpdatedAt!==0,isStale:pp(t,n),refetch:this.refetch,remove:this.remove}}updateResult(t){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,$f(r,n))return;this.currentResult=r;const o={cache:!0},i=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options;if(a==="all"||!a&&!this.trackedProps.size)return!0;const s=new Set(a!=null?a:this.trackedProps);return this.options.useErrorBoundary&&s.add("error"),Object.keys(this.currentResult).some(l=>{const u=l;return this.currentResult[u]!==n[u]&&s.has(u)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),this.notify({...o,...t})}updateQuery(){const t=this.client.getQueryCache().build(this.client,this.options);if(t===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=t,this.currentQueryInitialState=t.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))}onQueryUpdate(t){const n={};t.type==="success"?n.onSuccess=!t.manual:t.type==="error"&&!Ps(t.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(t){De.batch(()=>{if(t.onSuccess){var n,r,o,i;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(o=(i=this.options).onSettled)==null||o.call(i,this.currentResult.data,null)}else if(t.onError){var a,s,l,u;(a=(s=this.options).onError)==null||a.call(s,this.currentResult.error),(l=(u=this.options).onSettled)==null||l.call(u,void 0,this.currentResult.error)}t.listeners&&this.listeners.forEach(c=>{c(this.currentResult)}),t.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function jC(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function vm(e,t){return jC(e,t)||e.state.dataUpdatedAt>0&&jf(e,t,t.refetchOnMount)}function jf(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&pp(e,t)}return!1}function mm(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&pp(e,n)}function pp(e,t){return e.isStaleByTime(t.staleTime)}class zC extends qo{constructor(t,n){super(),this.client=t,this.setOptions(n),this.bindMethods(),this.updateResult()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.client.defaultMutationOptions(t),$f(n,this.options)||this.client.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.currentMutation,observer:this})}onUnsubscribe(){if(!this.listeners.length){var t;(t=this.currentMutation)==null||t.removeObserver(this)}}onMutationUpdate(t){this.updateResult();const n={listeners:!0};t.type==="success"?n.onSuccess=!0:t.type==="error"&&(n.onError=!0),this.notify(n)}getCurrentResult(){return this.currentResult}reset(){this.currentMutation=void 0,this.updateResult(),this.notify({listeners:!0})}mutate(t,n){return this.mutateOptions=n,this.currentMutation&&this.currentMutation.removeObserver(this),this.currentMutation=this.client.getMutationCache().build(this.client,{...this.options,variables:typeof t<"u"?t:this.options.variables}),this.currentMutation.addObserver(this),this.currentMutation.execute()}updateResult(){const t=this.currentMutation?this.currentMutation.state:g1(),n={...t,isLoading:t.status==="loading",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset};this.currentResult=n}notify(t){De.batch(()=>{if(this.mutateOptions){if(t.onSuccess){var n,r,o,i;(n=(r=this.mutateOptions).onSuccess)==null||n.call(r,this.currentResult.data,this.currentResult.variables,this.currentResult.context),(o=(i=this.mutateOptions).onSettled)==null||o.call(i,this.currentResult.data,null,this.currentResult.variables,this.currentResult.context)}else if(t.onError){var a,s,l,u;(a=(s=this.mutateOptions).onError)==null||a.call(s,this.currentResult.error,this.currentResult.variables,this.currentResult.context),(l=(u=this.mutateOptions).onSettled)==null||l.call(u,void 0,this.currentResult.error,this.currentResult.variables,this.currentResult.context)}}t.listeners&&this.listeners.forEach(c=>{c(this.currentResult)})})}}const gm=x.exports.createContext(void 0),y1=x.exports.createContext(!1);function w1(e,t){return e||(t&&typeof window<"u"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=gm),window.ReactQueryClientContext):gm)}const S1=({context:e}={})=>{const t=x.exports.useContext(w1(e,x.exports.useContext(y1)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},BC=({client:e,children:t,context:n,contextSharing:r=!1})=>{x.exports.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]);const o=w1(n,r);return _(y1.Provider,{value:!n&&r,children:_(o.Provider,{value:e,children:t})})},b1=x.exports.createContext(!1),VC=()=>x.exports.useContext(b1);b1.Provider;function WC(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}const HC=x.exports.createContext(WC()),KC=()=>x.exports.useContext(HC);function _1(e,t){return typeof e=="function"?e(...t):!!e}function qC(e,t){const n=S1({context:e.context}),r=VC(),o=KC(),i=n.defaultQueryOptions(e);i._optimisticResults=r?"isRestoring":"optimistic",i.onError&&(i.onError=De.batchCalls(i.onError)),i.onSuccess&&(i.onSuccess=De.batchCalls(i.onSuccess)),i.onSettled&&(i.onSettled=De.batchCalls(i.onSettled)),i.suspense&&typeof i.staleTime!="number"&&(i.staleTime=1e3),(i.suspense||i.useErrorBoundary)&&(o.isReset()||(i.retryOnMount=!1));const[a]=x.exports.useState(()=>new t(n,i)),s=a.getOptimisticResult(i);if(cp.exports.useSyncExternalStore(x.exports.useCallback(l=>r?()=>{}:a.subscribe(De.batchCalls(l)),[a,r]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),x.exports.useEffect(()=>{o.clearReset()},[o]),x.exports.useEffect(()=>{a.setOptions(i,{listeners:!1})},[i,a]),i.suspense&&s.isLoading&&s.isFetching&&!r)throw a.fetchOptimistic(i).then(({data:l})=>{i.onSuccess==null||i.onSuccess(l),i.onSettled==null||i.onSettled(l,null)}).catch(l=>{o.clearReset(),i.onError==null||i.onError(l),i.onSettled==null||i.onSettled(void 0,l)});if(s.isError&&!o.isReset()&&!s.isFetching&&_1(i.useErrorBoundary,[s.error,a.getCurrentQuery()]))throw s.error;return i.notifyOnChangeProps?s:a.trackResult(s)}function QC(e,t,n){const r=Os(e,t,n);return qC(r,FC)}function iU(e,t,n){const r=CC(e,t,n),o=S1({context:r.context}),[i]=x.exports.useState(()=>new zC(o,r));x.exports.useEffect(()=>{i.setOptions(r)},[i,r]);const a=cp.exports.useSyncExternalStore(x.exports.useCallback(l=>i.subscribe(De.batchCalls(l)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),s=x.exports.useCallback((l,u)=>{i.mutate(l,u).catch(GC)},[i]);if(a.error&&_1(i.options.useErrorBoundary,[a.error]))throw a.error;return{...a,mutate:s,mutateAsync:a.mutate}}function GC(){}function gl(){return gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}/** + * React Router v6.3.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */const hp=x.exports.createContext(null),vp=x.exports.createContext(null),Xl=x.exports.createContext({outlet:null,matches:[]});function fr(e,t){if(!e)throw new Error(t)}function e2(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?cr(t):t,o=E1(r.pathname||"/",n);if(o==null)return null;let i=x1(e);t2(i);let a=null;for(let s=0;a==null&&s{let a={relativePath:o.path||"",caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};a.relativePath.startsWith("/")&&(a.relativePath.startsWith(r)||fr(!1),a.relativePath=a.relativePath.slice(r.length));let s=or([r,a.relativePath]),l=n.concat(a);o.children&&o.children.length>0&&(o.index===!0&&fr(!1),x1(o.children,t,l,s)),!(o.path==null&&!o.index)&&t.push({path:s,score:l2(s,o.index),routesMeta:l})}),t}function t2(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:u2(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const n2=/^:\w+$/,r2=3,o2=2,i2=1,a2=10,s2=-2,_m=e=>e==="*";function l2(e,t){let n=e.split("/"),r=n.length;return n.some(_m)&&(r+=s2),t&&(r+=o2),n.filter(o=>!_m(o)).reduce((o,i)=>o+(n2.test(i)?r2:i===""?i2:a2),r)}function u2(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function c2(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a{if(c==="*"){let p=s[f]||"";a=i.slice(0,i.length-p.length).replace(/(.)\/+$/,"$1")}return u[c]=p2(s[f]||""),u},{}),pathname:i,pathnameBase:a,pattern:e}}function d2(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,(a,s)=>(r.push(s),"([^\\/]+)"));return e.endsWith("*")?(r.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o+=n?"\\/*$":"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)",[new RegExp(o,t?void 0:"i"),r]}function p2(e,t){try{return decodeURIComponent(e)}catch{return e}}function h2(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?cr(e):e;return{pathname:n?n.startsWith("/")?n:v2(n,t):t,search:g2(r),hash:y2(o)}}function v2(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function R1(e,t,n){let r=typeof e=="string"?cr(e):e,o=e===""||r.pathname===""?"/":r.pathname,i;if(o==null)i=n;else{let s=t.length-1;if(o.startsWith("..")){let l=o.split("/");for(;l[0]==="..";)l.shift(),s-=1;r.pathname=l.join("/")}i=s>=0?t[s]:"/"}let a=h2(r,i);return o&&o!=="/"&&o.endsWith("/")&&!a.pathname.endsWith("/")&&(a.pathname+="/"),a}function m2(e){return e===""||e.pathname===""?"/":typeof e=="string"?cr(e).pathname:e.pathname}function E1(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&n!=="/"?null:e.slice(t.length)||"/"}const or=e=>e.join("/").replace(/\/\/+/g,"/"),C1=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),g2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,y2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function w2(e){Ra()||fr(!1);let{basename:t,navigator:n}=x.exports.useContext(hp),{hash:r,pathname:o,search:i}=k1(e),a=o;if(t!=="/"){let s=m2(e),l=s!=null&&s.endsWith("/");a=o==="/"?t+(l?"/":""):or([t,o])}return n.createHref({pathname:a,search:i,hash:r})}function Ra(){return x.exports.useContext(vp)!=null}function Ea(){return Ra()||fr(!1),x.exports.useContext(vp).location}function S2(){Ra()||fr(!1);let{basename:e,navigator:t}=x.exports.useContext(hp),{matches:n}=x.exports.useContext(Xl),{pathname:r}=Ea(),o=JSON.stringify(n.map(s=>s.pathnameBase)),i=x.exports.useRef(!1);return x.exports.useEffect(()=>{i.current=!0}),x.exports.useCallback(function(s,l){if(l===void 0&&(l={}),!i.current)return;if(typeof s=="number"){t.go(s);return}let u=R1(s,JSON.parse(o),r);e!=="/"&&(u.pathname=or([e,u.pathname])),(l.replace?t.replace:t.push)(u,l.state)},[e,t,o,r])}function k1(e){let{matches:t}=x.exports.useContext(Xl),{pathname:n}=Ea(),r=JSON.stringify(t.map(o=>o.pathnameBase));return x.exports.useMemo(()=>R1(e,JSON.parse(r),n),[e,r,n])}function O1(e,t){Ra()||fr(!1);let{matches:n}=x.exports.useContext(Xl),r=n[n.length-1],o=r?r.params:{};r&&r.pathname;let i=r?r.pathnameBase:"/";r&&r.route;let a=Ea(),s;if(t){var l;let p=typeof t=="string"?cr(t):t;i==="/"||((l=p.pathname)==null?void 0:l.startsWith(i))||fr(!1),s=p}else s=a;let u=s.pathname||"/",c=i==="/"?u:u.slice(i.length)||"/",f=e2(e,{pathname:c});return b2(f&&f.map(p=>Object.assign({},p,{params:Object.assign({},o,p.params),pathname:or([i,p.pathname]),pathnameBase:p.pathnameBase==="/"?i:or([i,p.pathnameBase])})),n)}function b2(e,t){return t===void 0&&(t=[]),e==null?null:e.reduceRight((n,r,o)=>x.exports.createElement(Xl.Provider,{children:r.route.element!==void 0?r.route.element:n,value:{outlet:n,matches:t.concat(e.slice(0,o+1))}}),null)}function _2(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Nr.Pop,navigator:i,static:a=!1}=e;Ra()&&fr(!1);let s=C1(t),l=x.exports.useMemo(()=>({basename:s,navigator:i,static:a}),[s,i,a]);typeof r=="string"&&(r=cr(r));let{pathname:u="/",search:c="",hash:f="",state:p=null,key:m="default"}=r,g=x.exports.useMemo(()=>{let y=E1(u,s);return y==null?null:{pathname:y,search:c,hash:f,state:p,key:m}},[s,u,c,f,p,m]);return g==null?null:x.exports.createElement(hp.Provider,{value:l},x.exports.createElement(vp.Provider,{children:n,value:{location:g,navigationType:o}}))}/** + * React Router DOM v6.3.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function zf(){return zf=Object.assign||function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}const R2=["onClick","reloadDocument","replace","state","target","to"];function E2(e){let{basename:t,children:n,window:r}=e,o=x.exports.useRef();o.current==null&&(o.current=JC({window:r}));let i=o.current,[a,s]=x.exports.useState({action:i.action,location:i.location});return x.exports.useLayoutEffect(()=>i.listen(s),[i]),x.exports.createElement(_2,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:i})}function C2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}const P1=x.exports.forwardRef(function(t,n){let{onClick:r,reloadDocument:o,replace:i=!1,state:a,target:s,to:l}=t,u=x2(t,R2),c=w2(l),f=k2(l,{replace:i,state:a,target:s});function p(m){r&&r(m),!m.defaultPrevented&&!o&&f(m)}return x.exports.createElement("a",zf({},u,{href:c,onClick:p,ref:n,target:s}))});function k2(e,t){let{target:n,replace:r,state:o}=t===void 0?{}:t,i=S2(),a=Ea(),s=k1(e);return x.exports.useCallback(l=>{if(l.button===0&&(!n||n==="_self")&&!C2(l)){l.preventDefault();let u=!!r||Ii(a)===Ii(s);i(e,{replace:u,state:o})}},[a,i,s,r,o,n,e])}function O2(e){const t=new Error(e);if(t.stack===void 0)try{throw t}catch{}return t}var P2=O2,ue=P2;function T2(e){return!!e&&typeof e.then=="function"}var Oe=T2;function L2(e,t){if(e!=null)return e;throw ue(t!=null?t:"Got unexpected null or undefined")}var Pe=L2;function le(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Yl{getValue(){throw ue("BaseLoadable")}toPromise(){throw ue("BaseLoadable")}valueMaybe(){throw ue("BaseLoadable")}valueOrThrow(){throw ue(`Loadable expected value, but in "${this.state}" state`)}promiseMaybe(){throw ue("BaseLoadable")}promiseOrThrow(){throw ue(`Loadable expected promise, but in "${this.state}" state`)}errorMaybe(){throw ue("BaseLoadable")}errorOrThrow(){throw ue(`Loadable expected error, but in "${this.state}" state`)}is(t){return t.state===this.state&&t.contents===this.contents}map(t){throw ue("BaseLoadable")}}class N2 extends Yl{constructor(t){super(),le(this,"state","hasValue"),le(this,"contents",void 0),this.contents=t}getValue(){return this.contents}toPromise(){return Promise.resolve(this.contents)}valueMaybe(){return this.contents}valueOrThrow(){return this.contents}promiseMaybe(){}errorMaybe(){}map(t){try{const n=t(this.contents);return Oe(n)?Br(n):Do(n)?n:Ca(n)}catch(n){return Oe(n)?Br(n.next(()=>this.map(t))):Jl(n)}}}class A2 extends Yl{constructor(t){super(),le(this,"state","hasError"),le(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return Promise.reject(this.contents)}valueMaybe(){}promiseMaybe(){}errorMaybe(){return this.contents}errorOrThrow(){return this.contents}map(t){return this}}class T1 extends Yl{constructor(t){super(),le(this,"state","loading"),le(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return this.contents}valueMaybe(){}promiseMaybe(){return this.contents}promiseOrThrow(){return this.contents}errorMaybe(){}map(t){return Br(this.contents.then(n=>{const r=t(n);if(Do(r)){const o=r;switch(o.state){case"hasValue":return o.contents;case"hasError":throw o.contents;case"loading":return o.contents}}return r}).catch(n=>{if(Oe(n))return n.then(()=>this.map(t).contents);throw n}))}}function Ca(e){return Object.freeze(new N2(e))}function Jl(e){return Object.freeze(new A2(e))}function Br(e){return Object.freeze(new T1(e))}function L1(){return Object.freeze(new T1(new Promise(()=>{})))}function M2(e){return e.every(t=>t.state==="hasValue")?Ca(e.map(t=>t.contents)):e.some(t=>t.state==="hasError")?Jl(Pe(e.find(t=>t.state==="hasError"),"Invalid loadable passed to loadableAll").contents):Br(Promise.all(e.map(t=>t.contents)))}function N1(e){const n=(Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(o=>e[o])).map(o=>Do(o)?o:Oe(o)?Br(o):Ca(o)),r=M2(n);return Array.isArray(e)?r:r.map(o=>Object.getOwnPropertyNames(e).reduce((i,a,s)=>({...i,[a]:o[s]}),{}))}function Do(e){return e instanceof Yl}const D2={of:e=>Oe(e)?Br(e):Do(e)?e:Ca(e),error:e=>Jl(e),loading:()=>L1(),all:N1,isLoadable:Do};var qr={loadableWithValue:Ca,loadableWithError:Jl,loadableWithPromise:Br,loadableLoading:L1,loadableAll:N1,isLoadable:Do,RecoilLoadable:D2},I2=qr.loadableWithValue,$2=qr.loadableWithError,U2=qr.loadableWithPromise,F2=qr.loadableLoading,j2=qr.loadableAll,z2=qr.isLoadable,B2=qr.RecoilLoadable,ka=Object.freeze({__proto__:null,loadableWithValue:I2,loadableWithError:$2,loadableWithPromise:U2,loadableLoading:F2,loadableAll:j2,isLoadable:z2,RecoilLoadable:B2});const Zl=new Map().set("recoil_hamt_2020",!0).set("recoil_sync_external_store",!0).set("recoil_suppress_rerender_in_callback",!0).set("recoil_memory_managament_2020",!0);function eu(e){var t;return(t=Zl.get(e))!==null&&t!==void 0?t:!1}eu.setPass=e=>{Zl.set(e,!0)};eu.setFail=e=>{Zl.set(e,!1)};eu.clear=()=>{Zl.clear()};var Se=eu,uc,cc,fc;const V2=(uc=xe.createMutableSource)!==null&&uc!==void 0?uc:xe.unstable_createMutableSource,A1=(cc=xe.useMutableSource)!==null&&cc!==void 0?cc:xe.unstable_useMutableSource,M1=(fc=xe.useSyncExternalStore)!==null&&fc!==void 0?fc:xe.unstable_useSyncExternalStore;function W2(){return Se("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:Se("recoil_sync_external_store")&&M1!=null?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:Se("recoil_mutable_source")&&A1!=null&&typeof window<"u"&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?Se("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:Se("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}}function H2(){return!1}var Oa={createMutableSource:V2,useMutableSource:A1,useSyncExternalStore:M1,reactMode:W2,isFastRefreshEnabled:H2};class mp{constructor(t){le(this,"key",void 0),this.key=t}toJSON(){return{key:this.key}}}class D1 extends mp{}class I1 extends mp{}function K2(e){return e instanceof D1||e instanceof I1}var tu={AbstractRecoilValue:mp,RecoilState:D1,RecoilValueReadOnly:I1,isRecoilValue:K2},q2=tu.AbstractRecoilValue,Q2=tu.RecoilState,G2=tu.RecoilValueReadOnly,X2=tu.isRecoilValue,Io=Object.freeze({__proto__:null,AbstractRecoilValue:q2,RecoilState:Q2,RecoilValueReadOnly:G2,isRecoilValue:X2});function Y2(e,t){return function*(){let n=0;for(const r of e)yield t(r,n++)}()}var nu=Y2;function J2(e,t,{error:n}={}){return null}var Z2=J2,gp=Z2;class $1{}const ek=new $1,Vr=new Map,yp=new Map;function tk(e){return nu(e,t=>Pe(yp.get(t)))}function nk(e){if(Vr.has(e.key)){const n=`Duplicate atom key "${e.key}". This is a FATAL ERROR in + production. But it is safe to ignore this warning if it occurred because of + hot module replacement.`;console.warn(n)}Vr.set(e.key,e);const t=e.set==null?new Io.RecoilValueReadOnly(e.key):new Io.RecoilState(e.key);return yp.set(e.key,t),t}class U1 extends Error{}function rk(e){const t=Vr.get(e);if(t==null)throw new U1(`Missing definition for RecoilValue: "${e}""`);return t}function ok(e){return Vr.get(e)}const yl=new Map;function ik(e){var t;if(!Se("recoil_memory_managament_2020"))return;const n=Vr.get(e);if(n!=null&&(t=n.shouldDeleteConfigOnRelease)!==null&&t!==void 0&&t.call(n)){var r;Vr.delete(e),(r=F1(e))===null||r===void 0||r(),yl.delete(e)}}function ak(e,t){!Se("recoil_memory_managament_2020")||(t===void 0?yl.delete(e):yl.set(e,t))}function F1(e){return yl.get(e)}var vt={nodes:Vr,recoilValues:yp,registerNode:nk,getNode:rk,getNodeMaybe:ok,deleteNodeConfigIfPossible:ik,setConfigDeletionHandler:ak,getConfigDeletionHandler:F1,recoilValuesForKeys:tk,NodeMissingError:U1,DefaultValue:$1,DEFAULT_VALUE:ek};function sk(e,t){t()}var lk={enqueueExecution:sk};function uk(e,t){return t={exports:{}},e(t,t.exports),t.exports}var ck=uk(function(e){var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(T){return typeof T}:function(T){return T&&typeof Symbol=="function"&&T.constructor===Symbol&&T!==Symbol.prototype?"symbol":typeof T},n={},r=5,o=Math.pow(2,r),i=o-1,a=o/2,s=o/4,l={},u=function(k){return function(){return k}},c=n.hash=function(T){var k=typeof T>"u"?"undefined":t(T);if(k==="number")return T;k!=="string"&&(T+="");for(var F=0,K=0,q=T.length;K>1&1431655765,k=(k&858993459)+(k>>2&858993459),k=k+(k>>4)&252645135,k+=k>>8,k+=k>>16,k&127},p=function(k,F){return F>>>k&i},m=function(k){return 1<=F;)q[ie--]=q[ie];return q[F]=K,q}for(var ne=0,re=0,ce=new Array(G+1);ne>>=1;return ie[F]=K,W(k,re+1,ie)},S=function(k,F,K,q){for(var G=new Array(F-1),ie=0,ne=0,re=0,ce=q.length;re1?I(k,this.hash,ce):ce[0]}var Ce=q();return Ce===l?this:(++ne.value,L(k,K,this.hash,this,G,C(k,G,ie,Ce)))},$=function(k,F,K,q,G,ie,ne){var re=this.mask,ce=this.children,Ce=p(K,G),st=m(Ce),ze=g(re,st),kt=re&st,Ft=kt?ce[ze]:R,Jr=Ft._modify(k,F,K+r,q,G,ie,ne);if(Ft===Jr)return this;var Da=P(k,this),Zo=re,ei=void 0;if(kt&&A(Jr)){if(Zo&=~st,!Zo)return R;if(ce.length<=2&&oe(ce[ze^1]))return ce[ze^1];ei=b(Da,ze,ce)}else if(!kt&&!A(Jr)){if(ce.length>=a)return X(k,Ce,Jr,re,ce);Zo|=st,ei=h(Da,ze,Jr,ce)}else ei=y(Da,ze,Jr,ce);return Da?(this.mask=Zo,this.children=ei,this):M(k,Zo,ei)},U=function(k,F,K,q,G,ie,ne){var re=this.size,ce=this.children,Ce=p(K,G),st=ce[Ce],ze=(st||R)._modify(k,F,K+r,q,G,ie,ne);if(st===ze)return this;var kt=P(k,this),Ft=void 0;if(A(st)&&!A(ze))++re,Ft=y(kt,Ce,ze,ce);else if(!A(st)&&A(ze)){if(--re,re<=s)return S(k,re,Ce,ce);Ft=y(kt,Ce,R,ce)}else Ft=y(kt,Ce,ze,ce);return kt?(this.size=re,this.children=Ft,this):W(k,re,Ft)};R._modify=function(T,k,F,K,q,G,ie){var ne=K();return ne===l?R:(++ie.value,C(T,q,G,ne))};function E(T,k,F,K,q){this._editable=T,this._edit=k,this._config=F,this._root=K,this._size=q}E.prototype.setTree=function(T,k){return this._editable?(this._root=T,this._size=k,this):T===this._root?this:new E(this._editable,this._edit,this._config,T,k)};var V=n.tryGetHash=function(T,k,F,K){for(var q=K._root,G=0,ie=K._config.keyEq;;)switch(q.type){case d:return ie(F,q.key)?q.value:T;case v:{if(k===q.hash)for(var ne=q.children,re=0,ce=ne.length;re{n.set(o,t(r,o))}),n}var wl=mk;function gk(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function yk(e){return{nodeDeps:wl(e.nodeDeps,t=>new Set(t)),nodeToNodeSubscriptions:wl(e.nodeToNodeSubscriptions,t=>new Set(t))}}function dc(e,t,n,r){const{nodeDeps:o,nodeToNodeSubscriptions:i}=n,a=o.get(e);if(a&&r&&a!==r.nodeDeps.get(e))return;o.set(e,t);const s=a==null?t:$i(t,a);for(const l of s)i.has(l)||i.set(l,new Set),Pe(i.get(l)).add(e);if(a){const l=$i(a,t);for(const u of l){if(!i.has(u))return;const c=Pe(i.get(u));c.delete(e),c.size===0&&i.delete(u)}}}function wk(e,t,n,r){var o,i,a,s;const l=n.getState();r===l.currentTree.version||r===((o=l.nextTree)===null||o===void 0?void 0:o.version)||((i=l.previousTree)===null||i===void 0||i.version);const u=n.getGraph(r);if(dc(e,t,u),r===((a=l.previousTree)===null||a===void 0?void 0:a.version)){const f=n.getGraph(l.currentTree.version);dc(e,t,f,u)}if(r===((s=l.previousTree)===null||s===void 0?void 0:s.version)||r===l.currentTree.version){var c;const f=(c=l.nextTree)===null||c===void 0?void 0:c.version;if(f!==void 0){const p=n.getGraph(f);dc(e,t,p,u)}}}var Pa={cloneGraph:yk,graph:gk,saveDepsToStore:wk};let Sk=0;const bk=()=>Sk++;let _k=0;const xk=()=>_k++;let Rk=0;const Ek=()=>Rk++;var ru={getNextTreeStateVersion:bk,getNextStoreID:xk,getNextComponentID:Ek};const{persistentMap:xm}=hk,{graph:Ck}=Pa,{getNextTreeStateVersion:j1}=ru;function z1(){const e=j1();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:xm(),nonvalidatedAtoms:xm()}}function kk(){const e=z1();return{currentTree:e,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(e.version,Ck()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var B1={makeEmptyTreeState:z1,makeEmptyStoreState:kk,getNextTreeStateVersion:j1};class V1{}function Ok(){return new V1}var ou={RetentionZone:V1,retentionZone:Ok};function Pk(e,t){const n=new Set(e);return n.add(t),n}function Tk(e,t){const n=new Set(e);return n.delete(t),n}function Lk(e,t,n){const r=new Map(e);return r.set(t,n),r}function Nk(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r}function Ak(e,t){const n=new Map(e);return n.delete(t),n}function Mk(e,t){const n=new Map(e);return t.forEach(r=>n.delete(r)),n}var W1={setByAddingToSet:Pk,setByDeletingFromSet:Tk,mapBySettingInMap:Lk,mapByUpdatingInMap:Nk,mapByDeletingFromMap:Ak,mapByDeletingMultipleFromMap:Mk};function*Dk(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)}var bp=Dk;function Ik(e,t){return new Proxy(e,{get:(r,o)=>(!(o in r)&&o in t&&(r[o]=t[o]()),r[o]),ownKeys:r=>Object.keys(r)})}var H1=Ik;const{getNode:Ta,getNodeMaybe:$k,recoilValuesForKeys:Rm}=vt,{RetentionZone:Em}=ou,{setByAddingToSet:Uk}=W1,Fk=Object.freeze(new Set);class jk extends Error{}function zk(e,t,n){if(!Se("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=e.getState().retention;function o(i){let a=r.get(i);a||r.set(i,a=new Set),a.add(t)}if(n instanceof Em)o(n);else if(Array.isArray(n))for(const i of n)o(i);return()=>{if(!Se("recoil_memory_managament_2020"))return;const{retention:i}=e.getState();function a(s){const l=i.nodesRetainedByZone.get(s);l==null||l.delete(t),l&&l.size===0&&i.nodesRetainedByZone.delete(s)}if(n instanceof Em)a(n);else if(Array.isArray(n))for(const s of n)a(s)}}function _p(e,t,n,r){const o=e.getState();if(o.nodeCleanupFunctions.has(n))return;const i=Ta(n),a=zk(e,n,i.retainedBy),s=i.init(e,t,r);o.nodeCleanupFunctions.set(n,()=>{s(),a()})}function Bk(e,t,n){_p(e,e.getState().currentTree,t,n)}function Vk(e,t){var n;const r=e.getState();(n=r.nodeCleanupFunctions.get(t))===null||n===void 0||n(),r.nodeCleanupFunctions.delete(t)}function Wk(e,t,n){return _p(e,t,n,"get"),Ta(n).get(e,t)}function K1(e,t,n){return Ta(n).peek(e,t)}function Hk(e,t,n){var r;const o=$k(t);return o==null||(r=o.invalidate)===null||r===void 0||r.call(o,e),{...e,atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:Uk(e.dirtyAtoms,t)}}function Kk(e,t,n,r){const o=Ta(n);if(o.set==null)throw new jk(`Attempt to set read-only RecoilValue: ${n}`);const i=o.set;return _p(e,t,n,"set"),i(e,t,r)}function qk(e,t,n){const r=e.getState(),o=e.getGraph(t.version),i=Ta(n).nodeType;return H1({type:i},{loadable:()=>K1(e,t,n),isActive:()=>r.knownAtoms.has(n)||r.knownSelectors.has(n),isSet:()=>i==="selector"?!1:t.atomValues.has(n),isModified:()=>t.dirtyAtoms.has(n),deps:()=>{var a;return Rm((a=o.nodeDeps.get(n))!==null&&a!==void 0?a:[])},subscribers:()=>{var a,s;return{nodes:Rm(bp(q1(e,t,new Set([n])),l=>l!==n)),components:nu((a=(s=r.nodeToComponentSubscriptions.get(n))===null||s===void 0?void 0:s.values())!==null&&a!==void 0?a:[],([l])=>({name:l}))}}})}function q1(e,t,n){const r=new Set,o=Array.from(n),i=e.getGraph(t.version);for(let s=o.pop();s;s=o.pop()){var a;r.add(s);const l=(a=i.nodeToNodeSubscriptions.get(s))!==null&&a!==void 0?a:Fk;for(const u of l)r.has(u)||o.push(u)}return r}var wr={getNodeLoadable:Wk,peekNodeLoadable:K1,setNodeValue:Kk,initializeNode:Bk,cleanUpNode:Vk,setUnvalidatedAtomValue_DEPRECATED:Hk,peekNodeInfo:qk,getDownstreamNodes:q1};let Q1=null;function Qk(e){Q1=e}function Gk(){var e;(e=Q1)===null||e===void 0||e()}var G1={setInvalidateMemoizedSnapshot:Qk,invalidateMemoizedSnapshot:Gk};const{getDownstreamNodes:Xk,getNodeLoadable:X1,setNodeValue:Yk}=wr,{getNextComponentID:Jk}=ru,{getNode:Zk,getNodeMaybe:Y1}=vt,{DefaultValue:xp}=vt,{reactMode:eO}=Oa,{AbstractRecoilValue:tO,RecoilState:nO,RecoilValueReadOnly:rO,isRecoilValue:oO}=Io,{invalidateMemoizedSnapshot:iO}=G1;function aO(e,{key:t},n=e.getState().currentTree){var r,o;const i=e.getState();n.version===i.currentTree.version||n.version===((r=i.nextTree)===null||r===void 0?void 0:r.version)||(n.version,(o=i.previousTree)===null||o===void 0||o.version);const a=X1(e,n,t);return a.state==="loading"&&a.contents.catch(()=>{}),a}function sO(e,t){const n=e.clone();return t.forEach((r,o)=>{r.state==="hasValue"&&r.contents instanceof xp?n.delete(o):n.set(o,r)}),n}function lO(e,t,{key:n},r){if(typeof r=="function"){const o=X1(e,t,n);if(o.state==="loading"){const i=`Tried to set atom or selector "${n}" using an updater function while the current state is pending, this is not currently supported.`;throw ue(i)}else if(o.state==="hasError")throw o.contents;return r(o.contents)}else return r}function uO(e,t,n){if(n.type==="set"){const{recoilValue:o,valueOrUpdater:i}=n,a=lO(e,t,o,i),s=Yk(e,t,o.key,a);for(const[l,u]of s.entries())Bf(t,l,u)}else if(n.type==="setLoadable"){const{recoilValue:{key:o},loadable:i}=n;Bf(t,o,i)}else if(n.type==="markModified"){const{recoilValue:{key:o}}=n;t.dirtyAtoms.add(o)}else if(n.type==="setUnvalidated"){var r;const{recoilValue:{key:o},unvalidatedValue:i}=n,a=Y1(o);a==null||(r=a.invalidate)===null||r===void 0||r.call(a,t),t.atomValues.delete(o),t.nonvalidatedAtoms.set(o,i),t.dirtyAtoms.add(o)}else gp(`Unknown action ${n.type}`)}function Bf(e,t,n){n.state==="hasValue"&&n.contents instanceof xp?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function J1(e,t){e.replaceState(n=>{const r=Z1(n);for(const o of t)uO(e,r,o);return ew(e,r),iO(),r})}function iu(e,t){if(Ui.length){const n=Ui[Ui.length-1];let r=n.get(e);r||n.set(e,r=[]),r.push(t)}else J1(e,[t])}const Ui=[];function cO(){const e=new Map;return Ui.push(e),()=>{for(const[t,n]of e)J1(t,n);Ui.pop()}}function Z1(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}function ew(e,t){const n=Xk(e,t,t.dirtyAtoms);for(const i of n){var r,o;(r=Y1(i))===null||r===void 0||(o=r.invalidate)===null||o===void 0||o.call(r,t)}}function tw(e,t,n){iu(e,{type:"set",recoilValue:t,valueOrUpdater:n})}function fO(e,t,n){if(n instanceof xp)return tw(e,t,n);iu(e,{type:"setLoadable",recoilValue:t,loadable:n})}function dO(e,t){iu(e,{type:"markModified",recoilValue:t})}function pO(e,t,n){iu(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})}function hO(e,{key:t},n,r=null){const o=Jk(),i=e.getState();i.nodeToComponentSubscriptions.has(t)||i.nodeToComponentSubscriptions.set(t,new Map),Pe(i.nodeToComponentSubscriptions.get(t)).set(o,[r!=null?r:"",n]);const a=eO();if(a.early&&(a.mode==="LEGACY"||a.mode==="MUTABLE_SOURCE")){const s=e.getState().nextTree;s&&s.dirtyAtoms.has(t)&&n(s)}return{release:()=>{const s=e.getState(),l=s.nodeToComponentSubscriptions.get(t);l===void 0||!l.has(o)||(l.delete(o),l.size===0&&s.nodeToComponentSubscriptions.delete(t))}}}function vO(e,t){var n;const{currentTree:r}=e.getState(),o=Zk(t.key);(n=o.clearCache)===null||n===void 0||n.call(o,e,r)}var pn={RecoilValueReadOnly:rO,AbstractRecoilValue:tO,RecoilState:nO,getRecoilValueAsLoadable:aO,setRecoilValue:tw,setRecoilValueLoadable:fO,markRecoilValueModified:dO,setUnvalidatedRecoilValue:pO,subscribeToRecoilValue:hO,isRecoilValue:oO,applyAtomValueWrites:sO,batchStart:cO,writeLoadableToTreeState:Bf,invalidateDownstreams:ew,copyTreeState:Z1,refreshRecoilValue:vO};function mO(e,t,n){const r=e.entries();let o=r.next();for(;!o.done;){const i=o.value;if(t.call(n,i[1],i[0],e))return!0;o=r.next()}return!1}var gO=mO;const{cleanUpNode:yO}=wr,{deleteNodeConfigIfPossible:wO,getNode:nw}=vt,{RetentionZone:rw}=ou,SO=12e4,ow=new Set;function iw(e,t){const n=e.getState(),r=n.currentTree;if(n.nextTree)return;const o=new Set;for(const a of t)if(a instanceof rw)for(const s of RO(n,a))o.add(s);else o.add(a);const i=bO(e,o);for(const a of i)xO(e,r,a)}function bO(e,t){const n=e.getState(),r=n.currentTree,o=e.getGraph(r.version),i=new Set,a=new Set;return s(t),i;function s(l){const u=new Set,c=_O(e,r,l,i,a);for(const g of c){var f;if(nw(g).retainedBy==="recoilRoot"){a.add(g);continue}if(((f=n.retention.referenceCounts.get(g))!==null&&f!==void 0?f:0)>0){a.add(g);continue}if(aw(g).some(b=>n.retention.referenceCounts.get(b))){a.add(g);continue}const y=o.nodeToNodeSubscriptions.get(g);if(y&&gO(y,b=>a.has(b))){a.add(g);continue}i.add(g),u.add(g)}const p=new Set;for(const g of u)for(const y of(m=o.nodeDeps.get(g))!==null&&m!==void 0?m:ow){var m;i.has(y)||p.add(y)}p.size&&s(p)}}function _O(e,t,n,r,o){const i=e.getGraph(t.version),a=[],s=new Set;for(;n.size>0;)l(Pe(n.values().next().value));return a;function l(u){if(r.has(u)||o.has(u)){n.delete(u);return}if(s.has(u))return;const c=i.nodeToNodeSubscriptions.get(u);if(c)for(const f of c)l(f);s.add(u),n.delete(u),a.push(u)}}function xO(e,t,n){if(!Se("recoil_memory_managament_2020"))return;yO(e,n);const r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);const o=aw(n);for(const l of o){var i;(i=r.retention.nodesRetainedByZone.get(l))===null||i===void 0||i.delete(n)}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);const a=r.graphsByVersion.get(t.version);if(a){const l=a.nodeDeps.get(n);if(l!==void 0){a.nodeDeps.delete(n);for(const u of l){var s;(s=a.nodeToNodeSubscriptions.get(u))===null||s===void 0||s.delete(n)}}a.nodeToNodeSubscriptions.delete(n)}wO(n)}function RO(e,t){var n;return(n=e.retention.nodesRetainedByZone.get(t))!==null&&n!==void 0?n:ow}function aw(e){const t=nw(e).retainedBy;return t===void 0||t==="components"||t==="recoilRoot"?[]:t instanceof rw?[t]:t}function EO(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):iw(e,new Set([t]))}function CO(e,t,n){var r;if(!Se("recoil_memory_managament_2020"))return;const o=e.getState().retention.referenceCounts,i=((r=o.get(t))!==null&&r!==void 0?r:0)+n;i===0?sw(e,t):o.set(t,i)}function sw(e,t){if(!Se("recoil_memory_managament_2020"))return;e.getState().retention.referenceCounts.delete(t),EO(e,t)}function kO(e){if(!Se("recoil_memory_managament_2020"))return;const t=e.getState();iw(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()}function OO(e){return e===void 0?"recoilRoot":e}var Qr={SUSPENSE_TIMEOUT_MS:SO,updateRetainCount:CO,updateRetainCountToZero:sw,releaseScheduledRetainablesNow:kO,retainedByOptionWithDefault:OO};const{unstable_batchedUpdates:PO}=rE;var TO={unstable_batchedUpdates:PO};const{unstable_batchedUpdates:LO}=TO;var NO={unstable_batchedUpdates:LO};const{batchStart:AO}=pn,{unstable_batchedUpdates:MO}=NO;let Rp=MO;const DO=e=>{Rp=e},IO=()=>Rp,$O=e=>{Rp(()=>{let t=()=>{};try{t=AO(),e()}finally{t()}})};var au={getBatcher:IO,setBatcher:DO,batchUpdates:$O};function*UO(e){for(const t of e)for(const n of t)yield n}var lw=UO;const uw=typeof Window>"u"||typeof window>"u",FO=e=>!uw&&(e===window||e instanceof Window),jO=typeof navigator<"u"&&navigator.product==="ReactNative";var Ep={isSSR:uw,isReactNative:jO,isWindow:FO};function zO(e,t){let n;return(...o)=>{n||(n={});const i=t(...o);return Object.hasOwnProperty.call(n,i)||(n[i]=e(...o)),n[i]}}function BO(e,t){let n,r;return(...i)=>{const a=t(...i);return n===a||(n=a,r=e(...i)),r}}function VO(e,t){let n,r;return[(...a)=>{const s=t(...a);return n===s||(n=s,r=e(...a)),r},()=>{n=null}]}var WO={memoizeWithArgsHash:zO,memoizeOneWithArgsHash:BO,memoizeOneWithArgsHashAndInvalidation:VO};const{batchUpdates:Vf}=au,{initializeNode:HO,peekNodeInfo:KO}=wr,{graph:qO}=Pa,{getNextStoreID:QO}=ru,{DEFAULT_VALUE:GO,recoilValues:Cm,recoilValuesForKeys:km}=vt,{AbstractRecoilValue:XO,getRecoilValueAsLoadable:YO,setRecoilValue:Om,setUnvalidatedRecoilValue:JO}=pn,{updateRetainCount:Ts}=Qr,{setInvalidateMemoizedSnapshot:ZO}=G1,{getNextTreeStateVersion:eP,makeEmptyStoreState:tP}=B1,{isSSR:nP}=Ep,{memoizeOneWithArgsHashAndInvalidation:rP}=WO;class su{constructor(t,n){le(this,"_store",void 0),le(this,"_refCount",1),le(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),YO(this._store,r))),le(this,"getPromise",r=>(this.checkRefCount_INTERNAL(),this.getLoadable(r).toPromise())),le(this,"getNodes_UNSTABLE",r=>{if(this.checkRefCount_INTERNAL(),(r==null?void 0:r.isModified)===!0){if((r==null?void 0:r.isInitialized)===!1)return[];const a=this._store.getState().currentTree;return km(a.dirtyAtoms)}const o=this._store.getState().knownAtoms,i=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?Cm.values():r.isInitialized===!0?km(lw([o,i])):bp(Cm.values(),({key:a})=>!o.has(a)&&!i.has(a))}),le(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),KO(this._store,this._store.getState().currentTree,r))),le(this,"map",r=>{this.checkRefCount_INTERNAL();const o=new Wf(this,Vf);return r(o),o}),le(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const o=new Wf(this,Vf);return o.retain(),await r(o),o.autoRelease_INTERNAL(),o}),this._store={storeID:QO(),parentStoreID:n,getState:()=>t,replaceState:r=>{t.currentTree=r(t.currentTree)},getGraph:r=>{const o=t.graphsByVersion;if(o.has(r))return Pe(o.get(r));const i=qO();return o.set(r,i),i},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw ue("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)HO(this._store,r,"get"),Ts(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0,this._refCount++;let t=!1;return()=>{t||(t=!0,this._release())}}autoRelease_INTERNAL(){nP||window.setTimeout(()=>this._release(),10)}_release(){if(this._refCount--,this._refCount===0){if(this._store.getState().nodeCleanupFunctions.forEach(t=>t()),this._store.getState().nodeCleanupFunctions.clear(),!Se("recoil_memory_managament_2020"))return}else this._refCount<0}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){Se("recoil_memory_managament_2020")&&this._refCount<=0}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}getStoreID(){return this.checkRefCount_INTERNAL(),this._store.storeID}}function cw(e,t,n=!1){const r=e.getState(),o=n?eP():t.version;return{currentTree:{version:n?o:t.version,stateID:n?o:t.stateID,transactionMetadata:{...t.transactionMetadata},dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()},commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(o,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(nu(r.nodeCleanupFunctions.entries(),([i])=>[i,()=>{}]))}}function oP(e){const t=new su(tP());return e!=null?t.map(e):t}const[Pm,fw]=rP((e,t)=>{var n;const r=e.getState(),o=t==="latest"?(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree:Pe(r.previousTree);return new su(cw(e,o),e.storeID)},(e,t)=>{var n,r;return String(t)+String(e.storeID)+String((n=e.getState().nextTree)===null||n===void 0?void 0:n.version)+String(e.getState().currentTree.version)+String((r=e.getState().previousTree)===null||r===void 0?void 0:r.version)});ZO(fw);function iP(e,t="latest"){const n=Pm(e,t);return n.isRetained()?n:(fw(),Pm(e,t))}class Wf extends su{constructor(t,n){super(cw(t.getStore_INTERNAL(),t.getStore_INTERNAL().getState().currentTree,!0),t.getStoreID()),le(this,"_batch",void 0),le(this,"set",(r,o)=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();this._batch(()=>{Ts(i,r.key,1),Om(this.getStore_INTERNAL(),r,o)})}),le(this,"reset",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();this._batch(()=>{Ts(o,r.key,1),Om(this.getStore_INTERNAL(),r,GO)})}),le(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();Vf(()=>{for(const[i,a]of r.entries())Ts(o,i,1),JO(o,new XO(i),a)})}),this._batch=n}}var lu={Snapshot:su,MutableSnapshot:Wf,freshSnapshot:oP,cloneSnapshot:iP},aP=lu.Snapshot,sP=lu.MutableSnapshot,lP=lu.freshSnapshot,uP=lu.cloneSnapshot,uu=Object.freeze({__proto__:null,Snapshot:aP,MutableSnapshot:sP,freshSnapshot:lP,cloneSnapshot:uP});function cP(...e){const t=new Set;for(const n of e)for(const r of n)t.add(r);return t}var fP=cP;const{useRef:dP}=xe;function pP(e){const t=dP(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var Tm=pP;const{getNextTreeStateVersion:hP,makeEmptyStoreState:dw}=B1,{cleanUpNode:vP,getDownstreamNodes:mP,initializeNode:gP,setNodeValue:yP,setUnvalidatedAtomValue_DEPRECATED:wP}=wr,{graph:SP}=Pa,{cloneGraph:bP}=Pa,{getNextStoreID:pw}=ru,{createMutableSource:pc,reactMode:hw}=Oa,{applyAtomValueWrites:_P}=pn,{releaseScheduledRetainablesNow:vw}=Qr,{freshSnapshot:xP}=uu,{useCallback:RP,useContext:mw,useEffect:Hf,useMemo:EP,useRef:CP,useState:kP}=xe;function di(){throw ue("This component must be used inside a component.")}const gw=Object.freeze({storeID:pw(),getState:di,replaceState:di,getGraph:di,subscribeToTransactions:di,addTransactionMetadata:di});let Kf=!1;function Lm(e){if(Kf)throw ue("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");const t=e.getState();if(t.nextTree===null){Se("recoil_memory_managament_2020")&&Se("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&vw(e);const n=t.currentTree.version,r=hP();t.nextTree={...t.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(r,bP(Pe(t.graphsByVersion.get(n))))}}const yw=xe.createContext({current:gw}),cu=()=>mw(yw),ww=xe.createContext(null);function OP(){return mw(ww)}function Cp(e,t,n){const r=mP(e,n,n.dirtyAtoms);for(const o of r){const i=t.nodeToComponentSubscriptions.get(o);if(i)for(const[a,[s,l]]of i)l(n)}}function Sw(e){const t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){for(const[o,i]of t.nodeTransactionSubscriptions)if(r.has(o))for(const[a,s]of i)s(e);for(const[o,i]of t.transactionSubscriptions)i(e);(!hw().early||t.suspendedComponentResolvers.size>0)&&(Cp(e,t,n),t.suspendedComponentResolvers.forEach(o=>o()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(o=>o(n)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function PP(e){const t=e.getState();t.commitDepth++;try{const{nextTree:n}=t;if(n==null)return;t.previousTree=t.currentTree,t.currentTree=n,t.nextTree=null,Sw(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):gp("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,Se("recoil_memory_managament_2020")&&n==null&&vw(e)}finally{t.commitDepth--}}function TP({setNotifyBatcherOfChange:e}){const t=cu(),[,n]=kP([]);return e(()=>n({})),Hf(()=>(e(()=>n({})),()=>{e(()=>{})}),[e]),Hf(()=>{lk.enqueueExecution("Batcher",()=>{PP(t.current)})}),null}function LP(e,t){const n=dw();return t({set:(r,o)=>{const i=n.currentTree,a=yP(e,i,r.key,o),s=new Set(a.keys()),l=i.nonvalidatedAtoms.clone();for(const u of s)l.delete(u);n.currentTree={...i,dirtyAtoms:fP(i.dirtyAtoms,s),atomValues:_P(i.atomValues,a),nonvalidatedAtoms:l}},setUnvalidatedAtomValues:r=>{r.forEach((o,i)=>{n.currentTree=wP(n.currentTree,i,o)})}}),n}function NP(e){const t=xP(e),n=t.getStore_INTERNAL().getState();return t.retain(),n.nodeCleanupFunctions.forEach(r=>r()),n.nodeCleanupFunctions.clear(),n}let Nm=0;function AP({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:n,children:r}){let o;const i=m=>{const g=o.current.graphsByVersion;if(g.has(m))return Pe(g.get(m));const y=SP();return g.set(m,y),y},a=(m,g)=>{if(g==null){const{transactionSubscriptions:y}=f.current.getState(),b=Nm++;return y.set(b,m),{release:()=>{y.delete(b)}}}else{const{nodeTransactionSubscriptions:y}=f.current.getState();y.has(g)||y.set(g,new Map);const b=Nm++;return Pe(y.get(g)).set(b,m),{release:()=>{const h=y.get(g);h&&(h.delete(b),h.size===0&&y.delete(g))}}}},s=m=>{Lm(f.current);for(const g of Object.keys(m))Pe(f.current.getState().nextTree).transactionMetadata[g]=m[g]},l=m=>{Lm(f.current);const g=Pe(o.current.nextTree);let y;try{Kf=!0,y=m(g)}finally{Kf=!1}y!==g&&(o.current.nextTree=y,hw().early&&Cp(f.current,o.current,y),Pe(u.current)())},u=CP(null),c=RP(m=>{u.current=m},[u]),f=Tm(()=>n!=null?n:{storeID:pw(),getState:()=>o.current,replaceState:l,getGraph:i,subscribeToTransactions:a,addTransactionMetadata:s});n!=null&&(f.current=n),o=Tm(()=>e!=null?LP(f.current,e):t!=null?NP(t):dw());const p=EP(()=>pc==null?void 0:pc(o,()=>o.current.currentTree.version),[o]);return Hf(()=>{const m=f.current;for(const g of new Set(m.getState().knownAtoms))gP(m,g,"get");return()=>{for(const g of m.getState().knownAtoms)vP(m,g)}},[f]),_(yw.Provider,{value:f,children:te(ww.Provider,{value:p,children:[_(TP,{setNotifyBatcherOfChange:c}),r]})})}function MP(e){const{override:t,...n}=e,r=cu();return t===!1&&r.current!==gw?e.children:_(AP,{...n})}function DP(){return cu().current.storeID}var Tn={RecoilRoot:MP,useStoreRef:cu,useRecoilMutableSource:OP,useRecoilStoreID:DP,notifyComponents_FOR_TESTING:Cp,sendEndOfBatchNotifications_FOR_TESTING:Sw};function IP(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{t.current=e}),t.current}var bw=jP;const{useStoreRef:zP}=Tn,{SUSPENSE_TIMEOUT_MS:BP}=Qr,{updateRetainCount:pi}=Qr,{RetentionZone:VP}=ou,{useEffect:WP,useRef:HP}=xe,{isSSR:Am}=Ep;function KP(e){if(!!Se("recoil_memory_managament_2020"))return qP(e)}function qP(e){const n=(Array.isArray(e)?e:[e]).map(a=>a instanceof VP?a:a.key),r=zP();WP(()=>{if(!Se("recoil_memory_managament_2020"))return;const a=r.current;if(o.current&&!Am)window.clearTimeout(o.current),o.current=null;else for(const s of n)pi(a,s,1);return()=>{for(const s of n)pi(a,s,-1)}},[r,...n]);const o=HP(),i=bw(n);if(!Am&&(i===void 0||!$P(i,n))){const a=r.current;for(const s of n)pi(a,s,1);if(i)for(const s of i)pi(a,s,-1);o.current&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null;for(const s of n)pi(a,s,-1)},BP)}}var kp=KP;function QP(){return""}var La=QP;const{batchUpdates:GP}=au,{DEFAULT_VALUE:_w}=vt,{reactMode:Qo,useMutableSource:XP,useSyncExternalStore:YP}=Oa,{useRecoilMutableSource:JP,useStoreRef:hn}=Tn,{AbstractRecoilValue:qf,getRecoilValueAsLoadable:Na,setRecoilValue:Sl,setUnvalidatedRecoilValue:ZP,subscribeToRecoilValue:$o}=pn,{useCallback:pt,useEffect:Uo,useMemo:xw,useRef:Fi,useState:Op}=xe,{setByAddingToSet:eT}=W1;function Pp(e,t,n){if(e.state==="hasValue")return e.contents;throw e.state==="loading"?new Promise(o=>{n.current.getState().suspendedComponentResolvers.add(o)}):e.state==="hasError"?e.contents:ue(`Invalid value of loadable atom "${t.key}"`)}function tT(){const e=La(),t=hn(),[,n]=Op([]),r=Fi(new Set);r.current=new Set;const o=Fi(new Set),i=Fi(new Map),a=pt(l=>{const u=i.current.get(l);u&&(u.release(),i.current.delete(l))},[i]),s=pt((l,u)=>{i.current.has(u)&&n([])},[]);return Uo(()=>{const l=t.current;$i(r.current,o.current).forEach(u=>{if(i.current.has(u))return;const c=$o(l,new qf(u),p=>s(p,u),e);i.current.set(u,c),l.getState().nextTree?l.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{s(l.getState(),u)}):s(l.getState(),u)}),$i(o.current,r.current).forEach(u=>{a(u)}),o.current=r.current}),Uo(()=>{const l=i.current;return $i(r.current,new Set(l.keys())).forEach(u=>{const c=$o(t.current,new qf(u),f=>s(f,u),e);l.set(u,c)}),()=>l.forEach((u,c)=>a(c))},[e,t,a,s]),xw(()=>{function l(g){return y=>{Sl(t.current,g,y)}}function u(g){return()=>Sl(t.current,g,_w)}function c(g){var y;r.current.has(g.key)||(r.current=eT(r.current,g.key));const b=t.current.getState();return Na(t.current,g,Qo().early&&(y=b.nextTree)!==null&&y!==void 0?y:b.currentTree)}function f(g){const y=c(g);return Pp(y,g,t)}function p(g){return[f(g),l(g)]}function m(g){return[c(g),l(g)]}return{getRecoilValue:f,getRecoilValueLoadable:c,getRecoilState:p,getRecoilStateLoadable:m,getSetRecoilState:l,getResetRecoilState:u}},[r,t])}const nT={current:0};function rT(e){const t=hn(),n=La(),r=pt(()=>{var s;const l=t.current,u=l.getState(),c=Qo().early&&(s=u.nextTree)!==null&&s!==void 0?s:u.currentTree;return{loadable:Na(l,e,c),key:e.key}},[t,e]),o=pt(s=>{let l;return()=>{var u,c;const f=s();return(u=l)!==null&&u!==void 0&&u.loadable.is(f.loadable)&&((c=l)===null||c===void 0?void 0:c.key)===f.key?l:(l=f,f)}},[]),i=xw(()=>o(r),[r,o]),a=pt(s=>{const l=t.current;return $o(l,e,s,n).release},[t,e,n]);return YP(a,i,i).loadable}function oT(e){const t=hn(),n=pt(()=>{var u;const c=t.current,f=c.getState(),p=Qo().early&&(u=f.nextTree)!==null&&u!==void 0?u:f.currentTree;return Na(c,e,p)},[t,e]),r=pt(()=>n(),[n]),o=La(),i=pt((u,c)=>{const f=t.current;return $o(f,e,()=>{if(!Se("recoil_suppress_rerender_in_callback"))return c();const m=n();l.current.is(m)||c(),l.current=m},o).release},[t,e,o,n]),a=JP();if(a==null)throw ue("Recoil hooks must be used in components contained within a component.");const s=XP(a,r,i),l=Fi(s);return Uo(()=>{l.current=s}),s}function Rw(e){const t=hn(),n=La(),r=pt(()=>{var l;const u=t.current,c=u.getState(),f=Qo().early&&(l=c.nextTree)!==null&&l!==void 0?l:c.currentTree;return Na(u,e,f)},[t,e]),o=pt(()=>({loadable:r(),key:e.key}),[r,e.key]),i=pt(l=>{const u=o();return l.loadable.is(u.loadable)&&l.key===u.key?l:u},[o]);Uo(()=>{const l=$o(t.current,e,u=>{s(i)},n);return s(i),l.release},[n,e,t,i]);const[a,s]=Op(o);return a.key!==e.key?o().loadable:a.loadable}function iT(e){const t=hn(),[,n]=Op([]),r=La(),o=pt(()=>{var s;const l=t.current,u=l.getState(),c=Qo().early&&(s=u.nextTree)!==null&&s!==void 0?s:u.currentTree;return Na(l,e,c)},[t,e]),i=o(),a=Fi(i);return Uo(()=>{a.current=i}),Uo(()=>{const s=t.current,l=s.getState(),u=$o(s,e,f=>{var p;if(!Se("recoil_suppress_rerender_in_callback"))return n([]);const m=o();(p=a.current)!==null&&p!==void 0&&p.is(m)||n(m),a.current=m},r);if(l.nextTree)s.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a.current=null,n([])});else{var c;if(!Se("recoil_suppress_rerender_in_callback"))return n([]);const f=o();(c=a.current)!==null&&c!==void 0&&c.is(f)||n(f),a.current=f}return u.release},[r,o,e,t]),i}function Tp(e){return Se("recoil_memory_managament_2020")&&kp(e),{TRANSITION_SUPPORT:Rw,SYNC_EXTERNAL_STORE:rT,MUTABLE_SOURCE:oT,LEGACY:iT}[Qo().mode](e)}function Ew(e){const t=hn(),n=Tp(e);return Pp(n,e,t)}function fu(e){const t=hn();return pt(n=>{Sl(t.current,e,n)},[t,e])}function aT(e){const t=hn();return pt(()=>{Sl(t.current,e,_w)},[t,e])}function sT(e){return[Ew(e),fu(e)]}function lT(e){return[Tp(e),fu(e)]}function uT(){const e=hn();return(t,n={})=>{GP(()=>{e.current.addTransactionMetadata(n),t.forEach((r,o)=>ZP(e.current,new qf(o),r))})}}function Cw(e){return Se("recoil_memory_managament_2020")&&kp(e),Rw(e)}function kw(e){const t=hn(),n=Cw(e);return Pp(n,e,t)}function cT(e){return[kw(e),fu(e)]}var fT={recoilComponentGetRecoilValueCount_FOR_TESTING:nT,useRecoilInterface:tT,useRecoilState:sT,useRecoilStateLoadable:lT,useRecoilValue:Ew,useRecoilValueLoadable:Tp,useResetRecoilState:aT,useSetRecoilState:fu,useSetUnvalidatedAtomValues:uT,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:Cw,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:kw,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:cT};function dT(e,t){const n=new Map;for(const[r,o]of e)t(o,r)&&n.set(r,o);return n}var pT=dT;function hT(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n}var vT=hT;function mT(...e){const t=new Map;for(let n=0;nt.current.subscribeToTransactions(e).release,[e,t])}function Im(e){const t=e.atomValues.toMap(),n=wl(pT(t,(r,o)=>{const a=Ow(o).persistence_UNSTABLE;return a!=null&&a.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return gT(e.nonvalidatedAtoms.toMap(),n)}function ET(e){pu(du(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(n=t.getState().currentTree);const o=Im(r),i=Im(n),a=wl(ST,l=>{var u,c,f,p;return{persistence_UNSTABLE:{type:(u=(c=l.persistence_UNSTABLE)===null||c===void 0?void 0:c.type)!==null&&u!==void 0?u:"none",backButton:(f=(p=l.persistence_UNSTABLE)===null||p===void 0?void 0:p.backButton)!==null&&f!==void 0?f:!1}}}),s=vT(r.dirtyAtoms,l=>o.has(l)||i.has(l));e({atomValues:o,previousAtomValues:i,atomInfo:a,modifiedAtoms:s,transactionMetadata:{...r.transactionMetadata}})},[e]))}function CT(e){pu(du(t=>{const n=bl(t,"latest"),r=bl(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))}function kT(){const e=Lp(),[t,n]=RT(()=>bl(e.current)),r=bw(t),o=Mm(),i=Mm();if(pu(du(s=>n(bl(s)),[])),Pw(()=>{const s=t.retain();if(o.current&&!Dm){var l;window.clearTimeout(o.current),o.current=null,(l=i.current)===null||l===void 0||l.call(i),i.current=null}return()=>{window.setTimeout(s,10)}},[t]),r!==t&&!Dm){if(o.current){var a;window.clearTimeout(o.current),o.current=null,(a=i.current)===null||a===void 0||a.call(i),i.current=null}i.current=t.retain(),o.current=window.setTimeout(()=>{var s;o.current=null,(s=i.current)===null||s===void 0||s.call(i),i.current=null},xT)}return t}function Tw(e,t){var n;const r=e.getState(),o=(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree,i=t.getStore_INTERNAL().getState().currentTree;yT(()=>{const a=new Set;for(const u of[o.atomValues.keys(),i.atomValues.keys()])for(const c of u){var s,l;((s=o.atomValues.get(c))===null||s===void 0?void 0:s.contents)!==((l=i.atomValues.get(c))===null||l===void 0?void 0:l.contents)&&Ow(c).shouldRestoreFromSnapshots&&a.add(c)}a.forEach(u=>{_T(e,new bT(u),i.atomValues.has(u)?Pe(i.atomValues.get(u)):wT)}),e.replaceState(u=>({...u,stateID:t.getID()}))})}function OT(){const e=Lp();return du(t=>Tw(e.current,t),[e])}var Lw={useRecoilSnapshot:kT,gotoSnapshot:Tw,useGotoRecoilSnapshot:OT,useRecoilTransactionObserver:CT,useTransactionObservation_DEPRECATED:ET,useTransactionSubscription_DEPRECATED:pu};const{peekNodeInfo:PT}=wr,{useStoreRef:TT}=Tn;function LT(){const e=TT();return({key:t})=>PT(e.current,e.current.getState().currentTree,t)}var NT=LT;const{reactMode:AT}=Oa,{RecoilRoot:MT,useStoreRef:DT}=Tn,{useMemo:IT}=xe;function $T(){AT().mode==="MUTABLE_SOURCE"&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode. Please consider upgrading to recoil_sync_external_store mode.");const e=DT().current;return IT(()=>{function t({children:n}){return _(MT,{store_INTERNAL:e,children:n})}return t},[e])}var UT=$T;const{loadableWithValue:FT}=ka,{initializeNode:jT}=wr,{DEFAULT_VALUE:zT,getNode:BT}=vt,{copyTreeState:VT,getRecoilValueAsLoadable:WT,invalidateDownstreams:HT,writeLoadableToTreeState:KT}=pn;function $m(e){return BT(e.key).nodeType==="atom"}class qT{constructor(t,n){le(this,"_store",void 0),le(this,"_treeState",void 0),le(this,"_changes",void 0),le(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!$m(r))throw ue("Reading selectors within atomicUpdate is not supported");const o=WT(this._store,r,this._treeState);if(o.state==="hasValue")return o.contents;throw o.state==="hasError"?o.contents:ue(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),le(this,"set",(r,o)=>{if(!$m(r))throw ue("Setting selectors within atomicUpdate is not supported");if(typeof o=="function"){const i=this.get(r);this._changes.set(r.key,o(i))}else jT(this._store,r.key,"set"),this._changes.set(r.key,o)}),le(this,"reset",r=>{this.set(r,zT)}),this._store=t,this._treeState=n,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=VT(this._treeState);for(const[n,r]of this._changes)KT(t,n,FT(r));return HT(this._store,t),t}}function QT(e){return t=>{e.replaceState(n=>{const r=new qT(e,n);return t(r),r.newTreeState_INTERNAL()})}}var GT={atomicUpdater:QT},XT=GT.atomicUpdater,Nw=Object.freeze({__proto__:null,atomicUpdater:XT});function YT(e,t){if(!e)throw new Error(t)}var JT=YT,_i=JT;const{atomicUpdater:ZT}=Nw,{batchUpdates:eL}=au,{DEFAULT_VALUE:tL}=vt,{useStoreRef:nL}=Tn,{refreshRecoilValue:rL,setRecoilValue:Um}=pn,{cloneSnapshot:oL}=uu,{gotoSnapshot:iL}=Lw,{useCallback:aL}=xe;class Aw{}const sL=new Aw;function Mw(e,t,n,r){let o=sL,i;if(eL(()=>{const s="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if(typeof t!="function")throw ue(s);const l=H1({...r!=null?r:{},set:(c,f)=>Um(e,c,f),reset:c=>Um(e,c,tL),refresh:c=>rL(e,c),gotoSnapshot:c=>iL(e,c),transact_UNSTABLE:c=>ZT(e)(c)},{snapshot:()=>{const c=oL(e);return i=c.retain(),c}}),u=t(l);if(typeof u!="function")throw ue(s);o=u(...n)}),o instanceof Aw&&_i(!1),Oe(o))o.finally(()=>{var s;(s=i)===null||s===void 0||s()});else{var a;(a=i)===null||a===void 0||a()}return o}function lL(e,t){const n=nL();return aL((...r)=>Mw(n.current,e,r),t!=null?[...t,n]:void 0)}var Dw={recoilCallback:Mw,useRecoilCallback:lL};const{useStoreRef:uL}=Tn,{refreshRecoilValue:cL}=pn,{useCallback:fL}=xe;function dL(e){const t=uL();return fL(()=>{const n=t.current;cL(n,e)},[e,t])}var pL=dL;const{atomicUpdater:hL}=Nw,{useStoreRef:vL}=Tn,{useMemo:mL}=xe;function gL(e,t){const n=vL();return mL(()=>(...r)=>{hL(n.current)(i=>{e(i)(...r)})},t!=null?[...t,n]:void 0)}var yL=gL;class wL{constructor(t){le(this,"value",void 0),this.value=t}}var SL={WrappedValue:wL},bL=SL.WrappedValue,Iw=Object.freeze({__proto__:null,WrappedValue:bL});const{isFastRefreshEnabled:_L}=Oa;class Fm extends Error{}class xL{constructor(t){var n,r,o;le(this,"_name",void 0),le(this,"_numLeafs",void 0),le(this,"_root",void 0),le(this,"_onHit",void 0),le(this,"_onSet",void 0),le(this,"_mapNodeValue",void 0),this._name=t==null?void 0:t.name,this._numLeafs=0,this._root=null,this._onHit=(n=t==null?void 0:t.onHit)!==null&&n!==void 0?n:()=>{},this._onSet=(r=t==null?void 0:t.onSet)!==null&&r!==void 0?r:()=>{},this._mapNodeValue=(o=t==null?void 0:t.mapNodeValue)!==null&&o!==void 0?o:i=>i}size(){return this._numLeafs}root(){return this._root}get(t,n){var r;return(r=this.getLeafNode(t,n))===null||r===void 0?void 0:r.value}getLeafNode(t,n){if(this._root==null)return;let r=this._root;for(;r;){if(n==null||n.onNodeVisit(r),r.type==="leaf")return this._onHit(r),r;const o=this._mapNodeValue(t(r.nodeKey));r=r.branches.get(o)}}set(t,n,r){const o=()=>{var i,a,s,l;let u,c;for(const[b,h]of t){var f,p,m;const d=this._root;if((d==null?void 0:d.type)==="leaf")throw this.invalidCacheError();const v=u;if(u=v?v.branches.get(c):d,u=(f=u)!==null&&f!==void 0?f:{type:"branch",nodeKey:b,parent:v,branches:new Map,branchKey:c},u.type!=="branch"||u.nodeKey!==b)throw this.invalidCacheError();v==null||v.branches.set(c,u),r==null||(p=r.onNodeVisit)===null||p===void 0||p.call(r,u),c=this._mapNodeValue(h),this._root=(m=this._root)!==null&&m!==void 0?m:u}const g=u?(i=u)===null||i===void 0?void 0:i.branches.get(c):this._root;if(g!=null&&(g.type!=="leaf"||g.branchKey!==c))throw this.invalidCacheError();const y={type:"leaf",value:n,parent:u,branchKey:c};(a=u)===null||a===void 0||a.branches.set(c,y),this._root=(s=this._root)!==null&&s!==void 0?s:y,this._numLeafs++,this._onSet(y),r==null||(l=r.onNodeVisit)===null||l===void 0||l.call(r,y)};try{o()}catch(i){if(i instanceof Fm)this.clear(),o();else throw i}}delete(t){const n=this.root();if(!n)return!1;if(t===n)return this._root=null,this._numLeafs=0,!0;let r=t.parent,o=t.branchKey;for(;r;){var i;if(r.branches.delete(o),r===n)return r.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;o=(i=r)===null||i===void 0?void 0:i.branchKey,r=r.parent}for(;r!==n;r=r.parent)if(r==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){const t=_L()?"Possible Fast Refresh module reload detected. This may also be caused by an selector returning inconsistent values. Resetting cache.":"Invalid cache values. This happens when selectors do not return consistent values for the same input dependency values. That may also be caused when using Fast Refresh to change a selector implementation. Resetting cache.";throw gp(t+(this._name!=null?` - ${this._name}`:"")),new Fm}}var RL={TreeCache:xL},EL=RL.TreeCache,$w=Object.freeze({__proto__:null,TreeCache:EL});class CL{constructor(t){var n;le(this,"_maxSize",void 0),le(this,"_size",void 0),le(this,"_head",void 0),le(this,"_tail",void 0),le(this,"_map",void 0),le(this,"_keyMapper",void 0),this._maxSize=t.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(n=t.mapKey)!==null&&n!==void 0?n:r=>r}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(t){return this._map.has(this._keyMapper(t))}get(t){const n=this._keyMapper(t),r=this._map.get(n);if(!!r)return this.set(t,r.value),r.value}set(t,n){const r=this._keyMapper(t);this._map.get(r)&&this.delete(t);const i=this.head(),a={key:t,right:i,left:null,value:n};i?i.left=a:this._tail=a,this._map.set(r,a),this._head=a,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const t=this.tail();t&&this.delete(t.key)}delete(t){const n=this._keyMapper(t);if(!this._size||!this._map.has(n))return;const r=Pe(this._map.get(n)),o=r.right,i=r.left;o&&(o.left=r.left),i&&(i.right=r.right),r===this.head()&&(this._head=o),r===this.tail()&&(this._tail=i),this._map.delete(n),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var kL={LRUCache:CL},OL=kL.LRUCache,Uw=Object.freeze({__proto__:null,LRUCache:OL});const{LRUCache:PL}=Uw,{TreeCache:TL}=$w;function LL({name:e,maxSize:t,mapNodeValue:n=r=>r}){const r=new PL({maxSize:t}),o=new TL({name:e,mapNodeValue:n,onHit:i=>{r.set(i,!0)},onSet:i=>{const a=r.tail();r.set(i,!0),a&&o.size()>t&&o.delete(a.key)}});return o}var jm=LL;function Bt(e,t,n){if(typeof e=="string"&&!e.includes('"')&&!e.includes("\\"))return`"${e}"`;switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if((t==null?void 0:t.allowFunctions)!==!0)throw ue("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(e===null)return"null";if(typeof e!="object"){var r;return(r=JSON.stringify(e))!==null&&r!==void 0?r:""}if(Oe(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((o,i)=>Bt(o,t,i.toString()))}]`;if(typeof e.toJSON=="function")return Bt(e.toJSON(n),t,n);if(e instanceof Map){const o={};for(const[i,a]of e)o[typeof i=="string"?i:Bt(i,t)]=a;return Bt(o,t,n)}return e instanceof Set?Bt(Array.from(e).sort((o,i)=>Bt(o,t).localeCompare(Bt(i,t))),t,n):Symbol!==void 0&&e[Symbol.iterator]!=null&&typeof e[Symbol.iterator]=="function"?Bt(Array.from(e),t,n):`{${Object.keys(e).filter(o=>e[o]!==void 0).sort().map(o=>`${Bt(o,t)}:${Bt(e[o],t,o)}`).join(",")}}`}function NL(e,t={allowFunctions:!1}){return Bt(e,t)}var hu=NL;const{TreeCache:AL}=$w,rs={equality:"reference",eviction:"keep-all",maxSize:1/0};function ML({equality:e=rs.equality,eviction:t=rs.eviction,maxSize:n=rs.maxSize}=rs,r){const o=DL(e);return IL(t,n,o,r)}function DL(e){switch(e){case"reference":return t=>t;case"value":return t=>hu(t)}throw ue(`Unrecognized equality policy ${e}`)}function IL(e,t,n,r){switch(e){case"keep-all":return new AL({name:r,mapNodeValue:n});case"lru":return jm({name:r,maxSize:Pe(t),mapNodeValue:n});case"most-recent":return jm({name:r,maxSize:1,mapNodeValue:n})}throw ue(`Unrecognized eviction policy ${e}`)}var $L=ML;function UL(e){return()=>null}var FL={startPerfBlock:UL};const{isLoadable:jL,loadableWithError:os,loadableWithPromise:zL,loadableWithValue:hc}=ka,{WrappedValue:Fw}=Iw,{getNodeLoadable:is,peekNodeLoadable:BL,setNodeValue:VL}=wr,{saveDepsToStore:WL}=Pa,{DEFAULT_VALUE:HL,getConfigDeletionHandler:KL,getNode:qL,registerNode:zm}=vt,{isRecoilValue:QL}=Io,{markRecoilValueModified:Bm}=pn,{retainedByOptionWithDefault:GL}=Qr,{recoilCallback:XL}=Dw,{startPerfBlock:YL}=FL;class jw{}const hi=new jw,vi=[],as=new Map,JL=(()=>{let e=0;return()=>e++})();function zw(e){let t=null;const{key:n,get:r,cachePolicy_UNSTABLE:o}=e,i=e.set!=null?e.set:void 0,a=new Set,s=$L(o!=null?o:{equality:"reference",eviction:"keep-all"},n),l=GL(e.retainedBy_UNSTABLE),u=new Map;let c=0;function f(){return!Se("recoil_memory_managament_2020")||c>0}function p(E){return E.getState().knownSelectors.add(n),c++,()=>{c--}}function m(){return KL(n)!==void 0&&!f()}function g(E,V,z,J,H){B(V,J,H),y(E,z)}function y(E,V){S(E,V)&&X(E),h(V,!0)}function b(E,V){S(E,V)&&(Pe(M(E)).stateVersions.clear(),h(V,!1))}function h(E,V){const z=as.get(E);if(z!=null){for(const J of z)Bm(J,Pe(t));V&&as.delete(E)}}function d(E,V){let z=as.get(V);z==null&&as.set(V,z=new Set),z.add(E)}function v(E,V,z,J,H,Z){return V.then(se=>{if(!f())throw X(E),hi;const Y=hc(se);return g(E,z,H,Y,J),se}).catch(se=>{if(!f())throw X(E),hi;if(Oe(se))return w(E,se,z,J,H,Z);const Y=os(se);throw g(E,z,H,Y,J),se})}function w(E,V,z,J,H,Z){return V.then(se=>{if(!f())throw X(E),hi;Z.loadingDepKey!=null&&Z.loadingDepPromise===V?z.atomValues.set(Z.loadingDepKey,hc(se)):E.getState().knownSelectors.forEach(de=>{z.atomValues.delete(de)});const Y=A(E,z);if(Y&&Y.state!=="loading"){if((S(E,H)||M(E)==null)&&y(E,H),Y.state==="hasValue")return Y.contents;throw Y.contents}if(!S(E,H)){const de=I(E,z);if(de!=null)return de.loadingLoadable.contents}const[me,we]=R(E,z,H);if(me.state!=="loading"&&g(E,z,H,me,we),me.state==="hasError")throw me.contents;return me.contents}).catch(se=>{if(se instanceof jw)throw hi;if(!f())throw X(E),hi;const Y=os(se);throw g(E,z,H,Y,J),se})}function O(E,V,z,J){var H,Z,se,Y;if(S(E,J)||V.version===((H=E.getState())===null||H===void 0||(Z=H.currentTree)===null||Z===void 0?void 0:Z.version)||V.version===((se=E.getState())===null||se===void 0||(Y=se.nextTree)===null||Y===void 0?void 0:Y.version)){var me,we,de;WL(n,z,E,(me=(we=E.getState())===null||we===void 0||(de=we.nextTree)===null||de===void 0?void 0:de.version)!==null&&me!==void 0?me:E.getState().currentTree.version)}for(const ee of z)a.add(ee)}function R(E,V,z){const J=YL(n);let H=!0,Z=!0;const se=()=>{J(),Z=!1};let Y,me=!1,we;const de={loadingDepKey:null,loadingDepPromise:null},ee=new Map;function Te({key:at}){const mt=is(E,V,at);switch(ee.set(at,mt),H||(O(E,V,new Set(ee.keys()),z),b(E,z)),mt.state){case"hasValue":return mt.contents;case"hasError":throw mt.contents;case"loading":throw de.loadingDepKey=at,de.loadingDepPromise=mt.contents,mt.contents}throw ue("Invalid Loadable state")}const vn=at=>(...mt)=>{if(Z)throw ue("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated. It can be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");return t==null&&_i(!1),XL(E,at,mt,{node:t})};try{Y=r({get:Te,getCallback:vn}),Y=QL(Y)?Te(Y):Y,jL(Y)&&(Y.state==="hasError"&&(me=!0),Y=Y.contents),Oe(Y)?Y=v(E,Y,V,ee,z,de).finally(se):se(),Y=Y instanceof Fw?Y.value:Y}catch(at){Y=at,Oe(Y)?Y=w(E,Y,V,ee,z,de).finally(se):(me=!0,se())}return me?we=os(Y):Oe(Y)?we=zL(Y):we=hc(Y),H=!1,oe(E,z,ee),O(E,V,new Set(ee.keys()),z),[we,ee]}function A(E,V){let z=V.atomValues.get(n);if(z!=null)return z;const J=new Set;try{z=s.get(Z=>(typeof Z!="string"&&_i(!1),is(E,V,Z).contents),{onNodeVisit:Z=>{Z.type==="branch"&&Z.nodeKey!==n&&J.add(Z.nodeKey)}})}catch(Z){throw ue(`Problem with cache lookup for selector "${n}": ${Z.message}`)}if(z){var H;V.atomValues.set(n,z),O(E,V,J,(H=M(E))===null||H===void 0?void 0:H.executionID)}return z}function C(E,V){const z=A(E,V);if(z!=null)return X(E),z;const J=I(E,V);if(J!=null){var H;return((H=J.loadingLoadable)===null||H===void 0?void 0:H.state)==="loading"&&d(E,J.executionID),J.loadingLoadable}const Z=JL(),[se,Y]=R(E,V,Z);return se.state==="loading"?(W(E,Z,se,Y,V),d(E,Z)):(X(E),B(V,se,Y)),se}function I(E,V){const z=lw([u.has(E)?[Pe(u.get(E))]:[],nu(bp(u,([H])=>H!==E),([,H])=>H)]);function J(H){for(const[Z,se]of H)if(!is(E,V,Z).is(se))return!0;return!1}for(const H of z){if(H.stateVersions.get(V.version)||!J(H.depValuesDiscoveredSoFarDuringAsyncWork))return H.stateVersions.set(V.version,!0),H;H.stateVersions.set(V.version,!1)}}function M(E){return u.get(E)}function W(E,V,z,J,H){u.set(E,{depValuesDiscoveredSoFarDuringAsyncWork:J,executionID:V,loadingLoadable:z,stateVersions:new Map([[H.version,!0]])})}function oe(E,V,z){if(S(E,V)){const J=M(E);J!=null&&(J.depValuesDiscoveredSoFarDuringAsyncWork=z)}}function X(E){u.delete(E)}function S(E,V){var z;return V===((z=M(E))===null||z===void 0?void 0:z.executionID)}function L(E){return Array.from(E.entries()).map(([V,z])=>[V,z.contents])}function B(E,V,z){E.atomValues.set(n,V);try{s.set(L(z),V)}catch(J){throw ue(`Problem with setting cache for selector "${n}": ${J.message}`)}}function P(E){if(vi.includes(n)){const V=`Recoil selector has circular dependencies: ${vi.slice(vi.indexOf(n)).join(" \u2192 ")}`;return os(ue(V))}vi.push(n);try{return E()}finally{vi.pop()}}function N(E,V){const z=V.atomValues.get(n);return z!=null?z:s.get(J=>{var H;return typeof J!="string"&&_i(!1),(H=BL(E,V,J))===null||H===void 0?void 0:H.contents})}function D(E,V){return P(()=>C(E,V))}function $(E){E.atomValues.delete(n)}function U(E,V){t==null&&_i(!1);for(const J of a){var z;const H=qL(J);(z=H.clearCache)===null||z===void 0||z.call(H,E,V)}a.clear(),$(V),s.clear(),Bm(E,t)}return i!=null?t=zm({key:n,nodeType:"selector",peek:N,get:D,set:(V,z,J)=>{let H=!1;const Z=new Map;function se({key:de}){if(H)throw ue("Recoil: Async selector sets are not currently supported.");const ee=is(V,z,de);if(ee.state==="hasValue")return ee.contents;if(ee.state==="loading"){const Te=`Getting value of asynchronous atom or selector "${de}" in a pending state while setting selector "${n}" is not yet supported.`;throw ue(Te)}else throw ee.contents}function Y(de,ee){if(H)throw ue("Recoil: Async selector sets are not currently supported.");const Te=typeof ee=="function"?ee(se(de)):ee;VL(V,z,de.key,Te).forEach((at,mt)=>Z.set(mt,at))}function me(de){Y(de,HL)}const we=i({set:Y,get:se,reset:me},J);if(we!==void 0)throw Oe(we)?ue("Recoil: Async selector sets are not currently supported."):ue("Recoil: selector set should be a void function.");return H=!0,Z},init:p,invalidate:$,clearCache:U,shouldDeleteConfigOnRelease:m,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l}):t=zm({key:n,nodeType:"selector",peek:N,get:D,init:p,invalidate:$,clearCache:U,shouldDeleteConfigOnRelease:m,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l})}zw.value=e=>new Fw(e);var Fo=zw;const{isLoadable:ZL,loadableWithError:vc,loadableWithPromise:mc,loadableWithValue:to}=ka,{WrappedValue:Bw}=Iw,{peekNodeInfo:eN}=wr,{DEFAULT_VALUE:kr,DefaultValue:Fn,getConfigDeletionHandler:Vw,registerNode:tN,setConfigDeletionHandler:nN}=vt,{isRecoilValue:rN}=Io,{getRecoilValueAsLoadable:oN,markRecoilValueModified:iN,setRecoilValue:Vm,setRecoilValueLoadable:aN}=pn,{retainedByOptionWithDefault:sN}=Qr,mi=e=>e instanceof Bw?e.value:e;function lN(e){const{key:t,persistence_UNSTABLE:n}=e,r=sN(e.retainedBy_UNSTABLE);let o=0;function i(d){return mc(d.then(v=>(a=to(v),v)).catch(v=>{throw a=vc(v),v}))}let a=Oe(e.default)?i(e.default):ZL(e.default)?e.default.state==="loading"?i(e.default.contents):e.default:to(mi(e.default));a.contents;let s;const l=new Map;function u(d){return d}function c(d,v){const w=v.then(O=>{var R,A;return((A=((R=d.getState().nextTree)!==null&&R!==void 0?R:d.getState().currentTree).atomValues.get(t))===null||A===void 0?void 0:A.contents)===w&&Vm(d,h,O),O}).catch(O=>{var R,A;throw((A=((R=d.getState().nextTree)!==null&&R!==void 0?R:d.getState().currentTree).atomValues.get(t))===null||A===void 0?void 0:A.contents)===w&&aN(d,h,vc(O)),O});return w}function f(d,v,w){var O;o++;const R=()=>{var M;o--,(M=l.get(d))===null||M===void 0||M.forEach(W=>W()),l.delete(d)};if(d.getState().knownAtoms.add(t),a.state==="loading"){const M=()=>{var W;((W=d.getState().nextTree)!==null&&W!==void 0?W:d.getState().currentTree).atomValues.has(t)||iN(d,h)};a.contents.finally(M)}const A=(O=e.effects)!==null&&O!==void 0?O:e.effects_UNSTABLE;if(A!=null){let S=function($){if(W&&$.key===t){const U=M;return U instanceof Fn?p(d,v):Oe(U)?mc(U.then(E=>E instanceof Fn?a.toPromise():E)):to(U)}return oN(d,$)},L=function($){return S($).toPromise()},B=function($){var U;const E=eN(d,(U=d.getState().nextTree)!==null&&U!==void 0?U:d.getState().currentTree,$.key);return W&&$.key===t&&!(M instanceof Fn)?{...E,isSet:!0,loadable:S($)}:E},M=kr,W=!0,oe=!1,X=null;const P=$=>U=>{if(W){const E=S(h),V=E.state==="hasValue"?E.contents:kr;M=typeof U=="function"?U(V):U,Oe(M)&&(M=M.then(z=>(X={effect:$,value:z},z)))}else{if(Oe(U))throw ue("Setting atoms to async values is not implemented.");typeof U!="function"&&(X={effect:$,value:mi(U)}),Vm(d,h,typeof U=="function"?E=>{const V=mi(U(E));return X={effect:$,value:V},V}:mi(U))}},N=$=>()=>P($)(kr),D=$=>U=>{var E;const{release:V}=d.subscribeToTransactions(z=>{var J;let{currentTree:H,previousTree:Z}=z.getState();Z||(Z=H);const se=(J=H.atomValues.get(t))!==null&&J!==void 0?J:a;if(se.state==="hasValue"){var Y,me,we,de;const ee=se.contents,Te=(Y=Z.atomValues.get(t))!==null&&Y!==void 0?Y:a,vn=Te.state==="hasValue"?Te.contents:kr;((me=X)===null||me===void 0?void 0:me.effect)!==$||((we=X)===null||we===void 0?void 0:we.value)!==ee?U(ee,vn,!H.atomValues.has(t)):((de=X)===null||de===void 0?void 0:de.effect)===$&&(X=null)}},t);l.set(d,[...(E=l.get(d))!==null&&E!==void 0?E:[],V])};for(const $ of A)try{const U=$({node:h,storeID:d.storeID,parentStoreID_UNSTABLE:d.parentStoreID,trigger:w,setSelf:P($),resetSelf:N($),onSet:D($),getPromise:L,getLoadable:S,getInfo_UNSTABLE:B});if(U!=null){var C;l.set(d,[...(C=l.get(d))!==null&&C!==void 0?C:[],U])}}catch(U){M=U,oe=!0}if(W=!1,!(M instanceof Fn)){var I;const $=oe?vc(M):Oe(M)?mc(c(d,M)):to(mi(M));$.contents,v.atomValues.set(t,$),(I=d.getState().nextTree)===null||I===void 0||I.atomValues.set(t,$)}}return R}function p(d,v){var w,O;return(w=(O=v.atomValues.get(t))!==null&&O!==void 0?O:s)!==null&&w!==void 0?w:a}function m(d,v){if(v.atomValues.has(t))return Pe(v.atomValues.get(t));if(v.nonvalidatedAtoms.has(t)){if(s!=null)return s;if(n==null)return a;const w=v.nonvalidatedAtoms.get(t),O=n.validator(w,kr);return s=O instanceof Fn?a:to(O),s}else return a}function g(){s=void 0}function y(d,v,w){if(v.atomValues.has(t)){const O=Pe(v.atomValues.get(t));if(O.state==="hasValue"&&w===O.contents)return new Map}else if(!v.nonvalidatedAtoms.has(t)&&w instanceof Fn)return new Map;return s=void 0,new Map().set(t,to(w))}function b(){return Vw(t)!==void 0&&o<=0}const h=tN({key:t,nodeType:"atom",peek:p,get:m,set:y,init:f,invalidate:g,shouldDeleteConfigOnRelease:b,dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return h}function Np(e){const{...t}=e,n="default"in e?e.default:new Promise(()=>{});return rN(n)?uN({...t,default:n}):lN({...t,default:n})}function uN(e){const t=Np({...e,default:kr,persistence_UNSTABLE:e.persistence_UNSTABLE===void 0?void 0:{...e.persistence_UNSTABLE,validator:r=>r instanceof Fn?r:Pe(e.persistence_UNSTABLE).validator(r,kr)},effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE}),n=Fo({key:`${e.key}__withFallback`,get:({get:r})=>{const o=r(t);return o instanceof Fn?e.default:o},set:({set:r},o)=>r(t,o),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return nN(n.key,Vw(e.key)),n}Np.value=e=>new Bw(e);var Ww=Np;class cN{constructor(t){var n;le(this,"_map",void 0),le(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(n=t==null?void 0:t.mapKey)!==null&&n!==void 0?n:r=>r}size(){return this._map.size}has(t){return this._map.has(this._keyMapper(t))}get(t){return this._map.get(this._keyMapper(t))}set(t,n){this._map.set(this._keyMapper(t),n)}delete(t){this._map.delete(this._keyMapper(t))}clear(){this._map.clear()}}var fN={MapCache:cN},dN=fN.MapCache,pN=Object.freeze({__proto__:null,MapCache:dN});const{LRUCache:Wm}=Uw,{MapCache:hN}=pN,ss={equality:"reference",eviction:"none",maxSize:1/0};function vN({equality:e=ss.equality,eviction:t=ss.eviction,maxSize:n=ss.maxSize}=ss){const r=mN(e);return gN(t,n,r)}function mN(e){switch(e){case"reference":return t=>t;case"value":return t=>hu(t)}throw ue(`Unrecognized equality policy ${e}`)}function gN(e,t,n){switch(e){case"keep-all":return new hN({mapKey:n});case"lru":return new Wm({mapKey:n,maxSize:Pe(t)});case"most-recent":return new Wm({mapKey:n,maxSize:1})}throw ue(`Unrecognized eviction policy ${e}`)}var Hw=vN;const{setConfigDeletionHandler:yN}=vt;function wN(e){var t,n;const r=Hw({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i,a;const s=r.get(o);if(s!=null)return s;const{cachePolicyForParams_UNSTABLE:l,...u}=e,c="default"in e?e.default:new Promise(()=>{}),f=Ww({...u,key:`${e.key}__${(i=hu(o))!==null&&i!==void 0?i:"void"}`,default:typeof c=="function"?c(o):c,retainedBy_UNSTABLE:typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE,effects:typeof e.effects=="function"?e.effects(o):typeof e.effects_UNSTABLE=="function"?e.effects_UNSTABLE(o):(a=e.effects)!==null&&a!==void 0?a:e.effects_UNSTABLE});return r.set(o,f),yN(f.key,()=>{r.delete(o)}),f}}var SN=wN;const{setConfigDeletionHandler:bN}=vt;let _N=0;function xN(e){var t,n;const r=Hw({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i;let a;try{a=r.get(o)}catch(p){throw ue(`Problem with cache lookup for selector ${e.key}: ${p.message}`)}if(a!=null)return a;const s=`${e.key}__selectorFamily/${(i=hu(o,{allowFunctions:!0}))!==null&&i!==void 0?i:"void"}/${_N++}`,l=p=>e.get(o)(p),u=e.cachePolicy_UNSTABLE,c=typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE;let f;if(e.set!=null){const p=e.set;f=Fo({key:s,get:l,set:(g,y)=>p(o)(g,y),cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else f=Fo({key:s,get:l,cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return r.set(o,f),bN(f.key,()=>{r.delete(o)}),f}}var Sr=xN;const RN=Sr({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function EN(e){return RN(e)}var CN=EN;const kN=Sr({key:"__error",get:e=>()=>{throw ue(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function ON(e){return kN(e)}var PN=ON;function TN(e){return e}var LN=TN;const{loadableWithError:Kw,loadableWithPromise:qw,loadableWithValue:Qw}=ka;function vu(e,t){const n=Array(t.length).fill(void 0),r=Array(t.length).fill(void 0);for(const[o,i]of t.entries())try{n[o]=e(i)}catch(a){r[o]=a}return[n,r]}function NN(e){return e!=null&&!Oe(e)}function mu(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function Qf(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((n,r,o)=>({...n,[r]:t[o]}),{})}function Ro(e,t,n){const r=n.map((o,i)=>o==null?Qw(t[i]):Oe(o)?qw(o):Kw(o));return Qf(e,r)}function AN(e,t){return t.map((n,r)=>n===void 0?e[r]:n)}const MN=Sr({key:"__waitForNone",get:e=>({get:t})=>{const n=mu(e),[r,o]=vu(t,n);return Ro(e,r,o)},dangerouslyAllowMutability:!0}),DN=Sr({key:"__waitForAny",get:e=>({get:t})=>{const n=mu(e),[r,o]=vu(t,n);return o.some(i=>!Oe(i))?Ro(e,r,o):new Promise(i=>{for(const[a,s]of o.entries())Oe(s)&&s.then(l=>{r[a]=l,o[a]=void 0,i(Ro(e,r,o))}).catch(l=>{o[a]=l,i(Ro(e,r,o))})})},dangerouslyAllowMutability:!0}),IN=Sr({key:"__waitForAll",get:e=>({get:t})=>{const n=mu(e),[r,o]=vu(t,n);if(o.every(a=>a==null))return Qf(e,r);const i=o.find(NN);if(i!=null)throw i;return Promise.all(o).then(a=>Qf(e,AN(r,a)))},dangerouslyAllowMutability:!0}),$N=Sr({key:"__waitForAllSettled",get:e=>({get:t})=>{const n=mu(e),[r,o]=vu(t,n);return o.every(i=>!Oe(i))?Ro(e,r,o):Promise.all(o.map((i,a)=>Oe(i)?i.then(s=>{r[a]=s,o[a]=void 0}).catch(s=>{r[a]=void 0,o[a]=s}):null)).then(()=>Ro(e,r,o))},dangerouslyAllowMutability:!0}),UN=Sr({key:"__noWait",get:e=>({get:t})=>{try{return Fo.value(Qw(t(e)))}catch(n){return Fo.value(Oe(n)?qw(n):Kw(n))}},dangerouslyAllowMutability:!0});var FN={waitForNone:MN,waitForAny:DN,waitForAll:IN,waitForAllSettled:$N,noWait:UN};const{RecoilLoadable:jN}=ka,{DefaultValue:zN}=vt,{RecoilRoot:BN,useRecoilStoreID:VN}=Tn,{isRecoilValue:WN}=Io,{retentionZone:HN}=ou,{freshSnapshot:KN}=uu,{useRecoilState:qN,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:QN,useRecoilStateLoadable:GN,useRecoilValue:XN,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:YN,useRecoilValueLoadable:JN,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:ZN,useResetRecoilState:eA,useSetRecoilState:tA}=fT,{useGotoRecoilSnapshot:nA,useRecoilSnapshot:rA,useRecoilTransactionObserver:oA}=Lw,{useRecoilCallback:iA}=Dw,{noWait:aA,waitForAll:sA,waitForAllSettled:lA,waitForAny:uA,waitForNone:cA}=FN;var Ap={DefaultValue:zN,isRecoilValue:WN,RecoilLoadable:jN,RecoilRoot:BN,useRecoilStoreID:VN,useRecoilBridgeAcrossReactRoots_UNSTABLE:UT,atom:Ww,selector:Fo,atomFamily:SN,selectorFamily:Sr,constSelector:CN,errorSelector:PN,readOnlySelector:LN,noWait:aA,waitForNone:cA,waitForAny:uA,waitForAll:sA,waitForAllSettled:lA,useRecoilValue:XN,useRecoilValueLoadable:JN,useRecoilState:qN,useRecoilStateLoadable:GN,useSetRecoilState:tA,useResetRecoilState:eA,useGetRecoilValueInfo_UNSTABLE:NT,useRecoilRefresher_UNSTABLE:pL,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:ZN,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:YN,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:QN,useRecoilCallback:iA,useRecoilTransaction_UNSTABLE:yL,useGotoRecoilSnapshot:nA,useRecoilSnapshot:rA,useRecoilTransactionObserver_UNSTABLE:oA,snapshot_UNSTABLE:KN,useRetain:kp,retentionZone:HN},fA=Ap.RecoilRoot,dA=Ap.atom,aU=Ap.useRecoilState;function pA(e,t){if(e==null)return{};var n=hA(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function hA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Mp=x.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=pA(e,["color","size"]);return _("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:_("polyline",{points:"20 6 9 17 4 12"})})});Mp.propTypes={color:be.exports.string,size:be.exports.oneOfType([be.exports.string,be.exports.number])};Mp.displayName="Check";const vA=Mp;function mA(e,t){if(e==null)return{};var n=gA(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function gA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Dp=x.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=mA(e,["color","size"]);return te("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[_("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),_("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})});Dp.propTypes={color:be.exports.string,size:be.exports.oneOfType([be.exports.string,be.exports.number])};Dp.displayName="EyeOff";const yA=Dp;function wA(e,t){if(e==null)return{};var n=SA(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function SA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Ip=x.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=wA(e,["color","size"]);return te("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[_("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),_("circle",{cx:"12",cy:"12",r:"3"})]})});Ip.propTypes={color:be.exports.string,size:be.exports.oneOfType([be.exports.string,be.exports.number])};Ip.displayName="Eye";const bA=Ip;function _A(e,t){if(e==null)return{};var n=xA(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function xA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var $p=x.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=_A(e,["color","size"]);return _("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:_("path",{d:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"})})});$p.propTypes={color:be.exports.string,size:be.exports.oneOfType([be.exports.string,be.exports.number])};$p.displayName="GitHub";const RA=$p;function EA(e,t){if(e==null)return{};var n=CA(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function CA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Up=x.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=EA(e,["color","size"]);return te("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[_("circle",{cx:"12",cy:"12",r:"10"}),_("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),_("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]})});Up.propTypes={color:be.exports.string,size:be.exports.oneOfType([be.exports.string,be.exports.number])};Up.displayName="Info";const kA=Up;function OA(e,t){if(e==null)return{};var n=PA(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function PA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Fp=x.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=OA(e,["color","size"]);return te("svg",{ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[_("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})});Fp.propTypes={color:be.exports.string,size:be.exports.oneOfType([be.exports.string,be.exports.number])};Fp.displayName="X";const TA=Fp;function LA(e,t){let n;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function Gw(e){return e.replace(/\/$/,"")}function sU(e,t){let n=String(e);for(;n.length1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:jp(e)?2:zp(e)?3:0}function Gf(e,t){return Go(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function UA(e,t){return Go(e)===2?e.get(t):e[t]}function Zw(e,t,n){var r=Go(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function FA(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function jp(e){return VA&&e instanceof Map}function zp(e){return WA&&e instanceof Set}function Cr(e){return e.o||e.t}function Bp(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=KA(e);delete t[bt];for(var n=Kp(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=jA),Object.freeze(e),t&&sa(e,function(n,r){return Vp(r,!0)},!0)),e}function jA(){Qt(2)}function Wp(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function cn(e){var t=qA[e];return t||Qt(18,e),t}function Km(){return la}function gc(e,t){t&&(cn("Patches"),e.u=[],e.s=[],e.v=t)}function _l(e){Xf(e),e.p.forEach(zA),e.p=null}function Xf(e){e===la&&(la=e.l)}function qm(e){return la={p:[],l:la,h:e,m:!0,_:0}}function zA(e){var t=e[bt];t.i===0||t.i===1?t.j():t.O=!0}function yc(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||cn("ES5").S(t,e,r),r?(n[bt].P&&(_l(t),Qt(4)),Wr(e)&&(e=xl(t,e),t.l||Rl(t,e)),t.u&&cn("Patches").M(n[bt].t,e,t.u,t.s)):e=xl(t,n,[]),_l(t),t.u&&t.v(t.u,t.s),e!==eS?e:void 0}function xl(e,t,n){if(Wp(t))return t;var r=t[bt];if(!r)return sa(t,function(i,a){return Qm(e,r,t,i,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Rl(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=r.i===4||r.i===5?r.o=Bp(r.k):r.o;sa(r.i===3?new Set(o):o,function(i,a){return Qm(e,r,o,i,a,n)}),Rl(e,o,!1),n&&e.u&&cn("Patches").R(r,n,e.u,e.s)}return r.o}function Qm(e,t,n,r,o,i){if(jo(o)){var a=xl(e,o,i&&t&&t.i!==3&&!Gf(t.D,r)?i.concat(r):void 0);if(Zw(n,r,a),!jo(a))return;e.m=!1}if(Wr(o)&&!Wp(o)){if(!e.h.F&&e._<1)return;xl(e,o),t&&t.A.l||Rl(e,o)}}function Rl(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&Vp(t,n)}function wc(e,t){var n=e[bt];return(n?Cr(n):e)[t]}function Gm(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Yf(e){e.P||(e.P=!0,e.l&&Yf(e.l))}function Sc(e){e.o||(e.o=Bp(e.t))}function Jf(e,t,n){var r=jp(t)?cn("MapSet").N(t,n):zp(t)?cn("MapSet").T(t,n):e.g?function(o,i){var a=Array.isArray(o),s={i:a?1:0,A:i?i.A:Km(),P:!1,I:!1,D:{},l:i,t:o,k:null,o:null,j:null,C:!1},l=s,u=Zf;a&&(l=[s],u=xi);var c=Proxy.revocable(l,u),f=c.revoke,p=c.proxy;return s.k=p,s.j=f,p}(t,n):cn("ES5").J(t,n);return(n?n.A:Km()).p.push(r),r}function BA(e){return jo(e)||Qt(22,e),function t(n){if(!Wr(n))return n;var r,o=n[bt],i=Go(n);if(o){if(!o.P&&(o.i<4||!cn("ES5").K(o)))return o.t;o.I=!0,r=Xm(n,i),o.I=!1}else r=Xm(n,i);return sa(r,function(a,s){o&&UA(o.t,a)===s||Zw(r,a,t(s))}),i===3?new Set(r):r}(e)}function Xm(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return Bp(e)}var Ym,la,Hp=typeof Symbol<"u"&&typeof Symbol("x")=="symbol",VA=typeof Map<"u",WA=typeof Set<"u",Jm=typeof Proxy<"u"&&Proxy.revocable!==void 0&&typeof Reflect<"u",eS=Hp?Symbol.for("immer-nothing"):((Ym={})["immer-nothing"]=!0,Ym),Zm=Hp?Symbol.for("immer-draftable"):"__$immer_draftable",bt=Hp?Symbol.for("immer-state"):"__$immer_state",HA=""+Object.prototype.constructor,Kp=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,KA=Object.getOwnPropertyDescriptors||function(e){var t={};return Kp(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},qA={},Zf={get:function(e,t){if(t===bt)return e;var n=Cr(e);if(!Gf(n,t))return function(o,i,a){var s,l=Gm(i,a);return l?"value"in l?l.value:(s=l.get)===null||s===void 0?void 0:s.call(o.k):void 0}(e,n,t);var r=n[t];return e.I||!Wr(r)?r:r===wc(e.t,t)?(Sc(e),e.o[t]=Jf(e.A.h,r,e)):r},has:function(e,t){return t in Cr(e)},ownKeys:function(e){return Reflect.ownKeys(Cr(e))},set:function(e,t,n){var r=Gm(Cr(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=wc(Cr(e),t),i=o==null?void 0:o[bt];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(FA(n,o)&&(n!==void 0||Gf(e.t,t)))return!0;Sc(e),Yf(e)}return e.o[t]===n&&typeof n!="number"&&(n!==void 0||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return wc(e.t,t)!==void 0||t in e.t?(e.D[t]=!1,Sc(e),Yf(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Cr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){Qt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Qt(12)}},xi={};sa(Zf,function(e,t){xi[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),xi.deleteProperty=function(e,t){return xi.set.call(this,e,t,void 0)},xi.set=function(e,t,n){return Zf.set.call(this,e[0],t,n,e[0])};var QA=function(){function e(n){var r=this;this.g=Jm,this.F=!0,this.produce=function(o,i,a){if(typeof o=="function"&&typeof i!="function"){var s=i;i=o;var l=r;return function(y){var b=this;y===void 0&&(y=s);for(var h=arguments.length,d=Array(h>1?h-1:0),v=1;v1?c-1:0),p=1;p=0;o--){var i=r[o];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}o>-1&&(r=r.slice(o+1));var a=cn("Patches").$;return jo(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),_t=new QA,GA=_t.produce;_t.produceWithPatches.bind(_t);var XA=_t.setAutoFreeze.bind(_t);_t.setUseProxies.bind(_t);_t.applyPatches.bind(_t);_t.createDraft.bind(_t);_t.finishDraft.bind(_t);XA(!1);const{createContext:qp,memo:YA,useMemo:JA,useRef:ZA,useEffect:eM,useCallback:eg,useContext:ed,useState:tM}=xe,tS=qp(null),nS=qp(null),rS=qp(null);function nM(){return ed(rS)}function rM({initialState:e,actions:t={},children:n}){const r=ZA(e),[o,i]=tM(e),a=eg(()=>r.current,[]);eM(()=>{},[a]);const s=eg((u,c)=>{if(typeof u=="function")return u(s,a);const f=GA(a(),c);f!==r.current&&(r.current=f,i(f))},[a]),l=JA(()=>oS(t,s),[t,s]);return _(tS.Provider,{value:o,children:_(nS.Provider,{value:s,children:_(rS.Provider,{value:l,children:n})})})}function Ln(e){return t=>{const n=YA(t);function r(o){const i=ed(tS),a=ed(nS),s=e(i,o),l={dispatch:a,...o,...s};return _(n,{...l})}return r}}function oM(e,t){return function(...n){return t(e.apply(this,n))}}function oS(e,t){const n={};for(const r in e){const o=e[r];typeof o=="function"?n[r]=oM(o,t):typeof o=="object"&&(n[r]=oS(o,t))}return n}const iS="yacd.haishan.me";function iM(){try{const e=localStorage.getItem(iS);return e?JSON.parse(e):void 0}catch{return}}function Gr(e){try{const t=JSON.stringify(e);localStorage.setItem(iS,t)}catch{}}const aS="/configs";async function sS(e){const{url:t,init:n}=Et(e);return await fetch(t+aS,n)}function aM(e){return"socks-port"in e&&(e["socket-port"]=e["socks-port"]),e}async function sM(e,t){const{url:n,init:r}=Et(e),o=JSON.stringify(aM(t));return await fetch(n+aS,{...r,body:o,method:"PATCH"})}const lS="/traffic",lM=new TextDecoder("utf-8"),ls=150,ua={labels:Array(ls).fill(0),up:Array(ls),down:Array(ls),size:ls,subscribers:[],appendData(e){this.up.shift(),this.down.shift(),this.labels.shift();const t=Date.now();this.up.push(e.up),this.down.push(e.down),this.labels.push(t),this.subscribers.forEach(n=>n(e))},subscribe(e){return this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}}};let go=!1,us="";function td(e){ua.appendData(JSON.parse(e))}function uS(e){return e.read().then(({done:t,value:n})=>{us+=lM.decode(n,{stream:!t});const o=us.split(` +`),i=o[o.length-1];for(let a=0;a{if(r.ok){const o=r.body.getReader();uS(o)}else go=!1},r=>{console.log("fetch /traffic error",r),go=!1}),ua}function tg(e){return t=>{t(`openModal:${e}`,n=>{n.modals[e]=!0})}}function cM(e){return t=>{t(`closeModal:${e}`,n=>{n.modals[e]=!1})}}const fM={apiConfig:!1},uU=e=>e.configs.configs,dM=e=>e.configs.haveFetchedConfig,cU=e=>e.configs.configs["log-level"];function cS(e){return async(t,n)=>{let r;try{r=await sS(e)}catch{t(tg("apiConfig"));return}if(!r.ok){console.log("Error fetch configs",r.statusText),t(tg("apiConfig"));return}const o=await r.json();t("store/configs#fetchConfigs",a=>{a.configs.configs=o}),dM(n())?Qp(e):t(pM())}}function pM(){return e=>{e("store/configs#markHaveFetchedConfig",t=>{t.configs.haveFetchedConfig=!0})}}function fU(e,t){return async n=>{sM(e,t).then(r=>{r.ok===!1&&console.log("Error update configs",r.statusText)},r=>{throw console.log("Error update configs",r),r}).then(()=>{n(cS(e))}),n("storeConfigsOptimisticUpdateConfigs",r=>{r.configs.configs={...r.configs.configs,...t}})}}const hM={configs:{port:7890,"socks-port":7891,"redir-port":0,"allow-lan":!1,mode:"Rule","log-level":"uninit"},haveFetchedConfig:!1},Xo=e=>{const t=e.app.selectedClashAPIConfigIndex;return e.app.clashAPIConfigs[t]},fS=e=>e.app.selectedClashAPIConfigIndex,Gp=e=>e.app.clashAPIConfigs,Xp=e=>e.app.theme,vM=e=>e.app.selectedChartStyleIndex,dS=e=>e.app.latencyTestUrl,dU=e=>e.app.collapsibleIsOpen,pU=e=>e.app.proxySortBy,hU=e=>e.app.hideUnavailableProxies,mM=e=>e.app.autoCloseOldConns,vU=e=>e.app.logStreamingPaused,gM=LA(Gr,600);function Yp(e,{baseURL:t,secret:n,metaLabel:r}){const o=Gp(e());for(let i=0;i{if(Yp(n,e))return;const o={...e,addedAt:Date.now()};t("addClashAPIConfig",i=>{i.app.clashAPIConfigs.push(o)}),Gr(n().app)}}function wM(e){return async(t,n)=>{const r=Yp(n,e);t("removeClashAPIConfig",o=>{o.app.clashAPIConfigs.splice(r,1)}),Gr(n().app)}}function SM(e){return async(t,n)=>{const r=Yp(n,e);fS(n())!==r&&t("selectClashAPIConfig",i=>{i.app.selectedClashAPIConfigIndex=r}),Gr(n().app);try{window.location.reload()}catch{}}}const bc=document.querySelector("html");function _c(e,t){const n=document.createElement("meta");n.setAttribute("name","theme-color"),n.setAttribute("content",e),t&&n.setAttribute("media",t),document.head.appendChild(n)}function bM(e){const t=Array.from(document.querySelectorAll("meta[name=theme-color]"));let n;for(const r of t)r.getAttribute("media")?document.head.removeChild(r):n=r;if(e==="auto")if(_c("#eeeeee","(prefers-color-scheme: light)"),_c("#202020","(prefers-color-scheme: dark)"),n)document.head.removeChild(n);else return;else{const r=e==="light"?"#eeeeee":"#202020";n?n.setAttribute("content",r):_c(r)}}function pS(e="dark"){e==="auto"?bc.setAttribute("data-theme","auto"):e==="dark"?bc.setAttribute("data-theme","dark"):bc.setAttribute("data-theme","light"),bM(e)}function _M(e="auto"){return(t,n)=>{Xp(n())!==e&&(pS(e),t("storeSwitchTheme",o=>{o.app.theme=e}),Gr(n().app))}}function xM(e){return(t,n)=>{t("appSelectChartStyleIndex",r=>{r.app.selectedChartStyleIndex=Number(e)}),Gr(n().app)}}function ng(e,t){return(n,r)=>{n("appUpdateAppConfig",o=>{o.app[e]=t}),Gr(r().app)}}function RM(e,t,n){return(r,o)=>{r("updateCollapsibleIsOpen",i=>{i.app.collapsibleIsOpen[`${e}:${t}`]=n}),gM(o().app)}}var Cg,kg;const EM={baseURL:(kg=(Cg=document.getElementById("app"))==null?void 0:Cg.getAttribute("data-base-url"))!=null?kg:"http://127.0.0.1:9090",secret:"",addedAt:0},CM={selectedClashAPIConfigIndex:0,clashAPIConfigs:[EM],latencyTestUrl:"http://www.gstatic.com/generate_204",selectedChartStyleIndex:0,theme:"dark",collapsibleIsOpen:{},proxySortBy:"Natural",hideUnavailableProxies:!1,autoCloseOldConns:!1,logStreamingPaused:!1};function kM(){const{search:e}=window.location,t={};if(typeof e!="string"||e==="")return t;const n=e.replace(/^\?/,"").split("&");for(let r=0;rMA("/version",e.apiConfig));return te(xn,{children:[_(Jw,{title:"About"}),t&&t.version?_(rg,{name:"Clash",version:t.version,link:"https://github.com/Dreamacro/clash"}):null,_(rg,{name:"Yacd",version:"0.3.6",link:"https://github.com/haishanh/yacd"})]})}const AM=e=>({apiConfig:Xo(e)}),MM=Ln(AM)(NM),DM="_loading_74j3j_1",IM="_spinner_74j3j_9",$M="_rotate_74j3j_1",og={loading:DM,spinner:IM,rotate:$M},hS=({height:e})=>{const t=e?{height:e}:{};return _("div",{className:og.loading,style:t,children:_("div",{className:og.spinner})})},UM=e=>({apiConfig:Xo(e),apiConfigs:Gp(e)});function FM({apiConfig:e,apiConfigs:t}){return x.exports.useEffect(()=>{let n="yacd";if(t.length>1)try{n=`${e.metaLabel||new URL(e.baseURL).host} - yacd`}catch{}document.title=n}),_(xn,{})}const jM=Ln(UM)(FM),zM=new m1,BM=new UC({queryCache:zM,defaultOptions:{queries:{suspense:!0}}});var El="NOT_FOUND";function VM(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:El},put:function(r,o){t={key:r,value:o}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function WM(e,t){var n=[];function r(s){var l=n.findIndex(function(c){return t(s,c.key)});if(l>-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return El}function o(s,l){r(s)===El&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function i(){return n}function a(){n=[]}return{get:r,put:o,getEntries:i,clear:a}}var HM=function(t,n){return t===n};function KM(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var o=n.length,i=0;i1?t-1:0),r=1;re.logs.logs,mS=e=>e.logs.tail,YM=e=>e.logs.searchText,mU=XM(vS,mS,YM,(e,t,n)=>{const r=[];for(let o=t;o>=0;o--)r.push(e[o]);if(e.length===nd)for(let o=nd-1;o>t;o--)r.push(e[o]);return n===""?r:r.filter(o=>o.payload.toLowerCase().indexOf(n)>=0)});function gU(e){return t=>{t("logsUpdateSearchText",n=>{n.logs.searchText=e.toLowerCase()})}}function yU(e){return(t,n)=>{const r=n(),o=vS(r),i=mS(r),a=i>=nd-1?0:i+1;o[a]=e,t("logsAppendLog",s=>{s.logs.tail=a})}}const JM={searchText:"",logs:[],tail:-1},gu="/connections",Ls=[];function ZM(e){let t;try{t=JSON.parse(e)}catch{console.log("JSON.parse error",JSON.parse(e))}Ls.forEach(n=>n(t))}let Rc;function eD(e,t){if(Rc===1&&t)return ig(t);Rc=1;const n=Yw(e,gu),r=new WebSocket(n);if(r.addEventListener("error",()=>Rc=3),r.addEventListener("message",o=>ZM(o.data)),t)return ig(t)}function ig(e){return Ls.push(e),function(){const n=Ls.indexOf(e);Ls.splice(n,1)}}async function wU(e){const{url:t,init:n}=Et(e);return await fetch(t+gu,{...n,method:"DELETE"})}async function tD(e){const{url:t,init:n}=Et(e);return await fetch(t+gu,{...n})}async function nD(e,t){const{url:n,init:r}=Et(e),o=`${n}${gu}/${t}`;return await fetch(o,{...r,method:"DELETE"})}const Jp="/proxies";async function rD(e){const{url:t,init:n}=Et(e);return await(await fetch(t+Jp,n)).json()}async function oD(e,t,n){const r={name:n},{url:o,init:i}=Et(e),a=encodeURIComponent(t),s=`${o}${Jp}/${a}`;return await fetch(s,{...i,method:"PUT",body:JSON.stringify(r)})}async function gS(e,t,n="http://www.gstatic.com/generate_204"){const{url:r,init:o}=Et(e),i=`timeout=5000&url=${encodeURIComponent(n)}`,a=`${r}${Jp}/${encodeURIComponent(t)}/delay?${i}`;return await fetch(a,o)}async function iD(e){const{url:t,init:n}=Et(e),r=await fetch(t+"/providers/proxies",n);return r.status===404?{providers:{}}:await r.json()}async function yS(e,t){const{url:n,init:r}=Et(e),o={...r,method:"PUT"};return await fetch(n+"/providers/proxies/"+encodeURIComponent(t),o)}async function aD(e,t){const{url:n,init:r}=Et(e),o={...r,method:"GET"};return await fetch(n+"/providers/proxies/"+encodeURIComponent(t)+"/healthcheck",o)}const sD={proxies:{},delay:{},groupNames:[],showModalClosePrevConns:!1},wS=()=>null,lD=["Direct","Reject","Relay","Selector","Fallback","URLTest","LoadBalance","Unknown"],SS=e=>e.proxies.proxies,uD=e=>e.proxies.delay,SU=e=>e.proxies.groupNames,cD=e=>e.proxies.proxyProviders||[],fD=e=>e.proxies.dangleProxyNames,bU=e=>e.proxies.showModalClosePrevConns;function dD(e,t){const n={};for(const r of e){const i=(t(r)||{history:[]}).history,a=i[i.length-1];a&&typeof a.delay=="number"&&(n[r]={number:a.delay})}return n}function Yo(e){return async(t,n)=>{const[r,o]=await Promise.all([rD(e),iD(e)]),{proxyProviders:i,providerProxyRecord:a}=wD(o.providers),s={...a,...r.proxies},[l,u]=yD(s),c={...uD(n()),...dD(Object.keys(s),p=>s[p])},f=[];for(const p of u)a[p]||f.push(p);t("store/proxies#fetchProxies",p=>{p.proxies.proxies=s,p.proxies.groupNames=l,p.proxies.dangleProxyNames=f,p.proxies.delay=c,p.proxies.proxyProviders=i})}}function _U(e,t){return async n=>{try{await yS(e,t)}catch{}n(Yo(e))}}function xU(e,t){return async n=>{for(let r=0;r{await Zp(e,t),await n(Yo(e))}}async function pD(e,t,n){const r=await tD(e);r.ok||console.log("unable to fetch all connections",r.statusText);const i=(await r.json()).connections,a=[];for(const s of i)s.chains.indexOf(t)>-1&&s.chains.indexOf(n)<0&&a.push(s.id);await Promise.all(a.map(s=>nD(e,s).catch(wS)))}function hD(e,t,n){const r=[n,t];let o,i=n;for(;(o=e[i])&&o.now;)r.unshift(o.now),i=o.now;return r}async function vD(e,t,n,r,o){try{if((await oD(n,r,o)).ok===!1)throw new Error("failed to switch proxy: res.statusText")}catch(a){throw console.log(a,"failed to swith proxy"),a}if(e(Yo(n)),mM(t())){const a=SS(t());_S(n,a,{groupName:r,itemName:o})}}function bS(){return e=>{e("closeModalClosePrevConns",t=>{t.proxies.showModalClosePrevConns=!1})}}function _S(e,t,n){const r=hD(t,n.groupName,n.itemName);pD(e,n.groupName,r[0])}function mD(e){return async(t,n)=>{var a;const r=n(),o=(a=r.proxies.switchProxyCtx)==null?void 0:a.to;if(!o){t(bS());return}const i=r.proxies.proxies;_S(e,i,o),t("closePrevConnsAndTheModal",s=>{s.proxies.showModalClosePrevConns=!1,s.proxies.switchProxyCtx=void 0})}}function EU(e,t,n){return async(r,o)=>{vD(r,o,e,t,n).catch(wS),r("store/proxies#switchProxy",i=>{const a=i.proxies.proxies;a[t]&&a[t].now&&(a[t].now=n)})}}function gD(e,t){return async(n,r)=>{const o=SS(r()),i=dS(r()),a=new Map,s=new Map,l=t.map(u=>{const c=o[u];return c.__provider?c.__provider?s.get(c.__provider)?void 0:(s.set(c.__provider,!0),Zp(e,c.__provider)):void 0:a.get(u)?void 0:(a.set(u,!0),gS(e,u,i))});await Promise.all(l),await n(Yo(e))}}function CU(e){return async(t,n)=>{const r=fD(n()),o=dS(n());await Promise.all(r.map(a=>gS(e,a,o)));const i=cD(n());for(const a of i)await Zp(e,a.name);await t(Yo(e))}}function yD(e){let t=[],n;const r=[];for(const o in e){const i=e[o];i.all&&Array.isArray(i.all)?(t.push(o),o==="GLOBAL"&&(n=Array.from(i.all))):lD.indexOf(i.type)<0&&r.push(o)}return n&&(n.push("GLOBAL"),t=t.map(o=>[n.indexOf(o),o]).sort((o,i)=>o[0]-i[0]).map(o=>o[1])),[t,r]}function wD(e){const t=Object.keys(e),n=[],r={};for(let o=0;on(o=>!o),[]);return[t,r]}function OU(e){const[t,n]=RS(e);return{value:t,set:n}}const ED="_ul_1ore2_1",CD="_li_1ore2_10",kD="_right_1ore2_21",OD="_close_1ore2_32",PD="_eye_1ore2_39",TD="_url_1ore2_54",LD="_secret_1ore2_55",ND="_metaLabel_1ore2_56",AD="_btn_1ore2_62",on={ul:ED,li:CD,right:kD,close:OD,eye:PD,url:TD,secret:LD,metaLabel:ND,btn:AD},MD=e=>({apiConfigs:Gp(e),selectedClashAPIConfigIndex:fS(e)}),DD=Ln(MD)(ID);function ID({apiConfigs:e,selectedClashAPIConfigIndex:t}){const{app:{removeClashAPIConfig:n,selectClashAPIConfig:r}}=nM(),o=x.exports.useCallback(a=>{n(a)},[n]),i=x.exports.useCallback(a=>{r(a)},[r]);return _(xn,{children:_("ul",{className:on.ul,children:e.map((a,s)=>_("li",{className:dr(on.li,{[on.isSelected]:s===t}),children:_($D,{disableRemove:s===t,conf:a,onRemove:o,onSelect:i})},a.baseURL+a.secret+a.metaLabel))})})}function $D({conf:e,disableRemove:t,onRemove:n,onSelect:r}){const[o,i]=RD(),a=o?yA:bA,s=x.exports.useCallback(l=>{l.stopPropagation()},[]);return te(xn,{children:[_(ag,{disabled:t,onClick:()=>n(e),className:on.close,children:_(TA,{size:20})}),te("div",{className:on.right,children:[e.metaLabel?te(xn,{children:[_("span",{className:on.metaLabel,tabIndex:0,role:"button",onClick:()=>r(e),onKeyUp:s,children:e.metaLabel}),_("span",{})]}):null,_("span",{className:on.url,tabIndex:0,role:"button",onClick:()=>r(e),onKeyUp:s,children:e.baseURL}),_("span",{}),e.secret?te(xn,{children:[_("span",{className:on.secret,children:o?e.secret:"***"}),_(ag,{onClick:i,className:on.eye,children:_(a,{size:16})})]}):null]})]})}function ag({children:e,onClick:t,className:n,disabled:r}){return _("button",{disabled:r,className:dr(n,on.btn),onClick:t,children:e})}const UD="_root_zwtea_1",FD="_header_zwtea_5",jD="_icon_zwtea_10",zD="_body_zwtea_20",BD="_hostnamePort_zwtea_24",VD="_error_zwtea_36",WD="_footer_zwtea_42",Mn={root:UD,header:FD,icon:jD,body:zD,hostnamePort:BD,error:VD,footer:WD},HD="_btn_lzu00_1",KD="_circular_lzu00_27",qD="_minimal_lzu00_30",QD="_btnStart_lzu00_48",GD="_loadingContainer_lzu00_55",Ri={btn:HD,circular:KD,minimal:qD,btnStart:QD,loadingContainer:GD},XD="_sectionNameType_8lri2_1",YD="_loadingDot_8lri2_66",JD="_dot2_8lri2_1",ZD="_dot1_8lri2_1",eI="_dot3_8lri2_1",ES={sectionNameType:XD,loadingDot:YD,dot2:JD,dot1:ZD,dot3:eI};function PU({name:e,type:t}){return te("h2",{className:ES.sectionNameType,children:[_("span",{children:e}),_("span",{children:t})]})}function tI(){return _("span",{className:ES.loadingDot})}const{forwardRef:nI,useCallback:rI}=vr;function oI(e,t){const{onClick:n,disabled:r=!1,isLoading:o,kind:i="primary",className:a,children:s,label:l,text:u,start:c,...f}=e,p={children:s,label:l,text:u,start:c},m=rI(y=>{o||n&&n(y)},[o,n]),g=dr(Ri.btn,{[Ri.minimal]:i==="minimal",[Ri.circular]:i==="circular"},a);return _("button",{className:g,ref:t,onClick:m,disabled:r,...f,children:o?te(xn,{children:[_("span",{style:{display:"inline-flex",opacity:0},children:_(sg,{...p})}),_("span",{className:Ri.loadingContainer,children:_(tI,{})})]}):_(sg,{...p})})}function sg({children:e,label:t,text:n,start:r}){return te(xn,{children:[r?_("span",{className:Ri.btnStart,children:typeof r=="function"?r():r}):null,e||t||n]})}const iI=nI(oI),aI="_root_1or8t_1",sI="_floatAbove_1or8t_32",lg={root:aI,floatAbove:sI},{useCallback:lI}=vr;function Ec({id:e,label:t,value:n,onChange:r,...o}){const i=lI(a=>r(a),[r]);return te("div",{className:lg.root,children:[_("input",{id:e,value:n,onChange:i,...o}),_("label",{htmlFor:e,className:lg.floatAbove,children:t})]})}const uI="_path_r8pm3_1",cI="_dash_r8pm3_1",fI={path:uI,dash:cI};function eh({width:e=320,height:t=320,animate:n=!1,c0:r="currentColor",stroke:o="#eee",eye:i="#eee",mouth:a="#eee"}){const s=dr({[fI.path]:n});return _("svg",{width:e,height:t,viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",children:te("g",{fill:"none",fillRule:"evenodd",children:[_("path",{d:"M71.689 53.055c9.23-1.487 25.684 27.263 41.411 56.663 18.572-8.017 71.708-7.717 93.775 0 4.714-15.612 31.96-57.405 41.626-56.663 3.992.088 13.07 31.705 23.309 94.96 2.743 16.949 7.537 47.492 14.38 91.63-42.339 17.834-84.37 26.751-126.095 26.751-41.724 0-83.756-8.917-126.095-26.751C52.973 116.244 65.536 54.047 71.689 53.055z",stroke:o,strokeWidth:"4",strokeLinecap:"round",fill:r,className:s}),_("circle",{fill:i,cx:"216.5",cy:"181.5",r:"14.5"}),_("circle",{fill:i,cx:"104.5",cy:"181.5",r:"14.5"}),_("g",{stroke:a,strokeLinecap:"round",strokeWidth:"4",children:_("path",{d:"M175.568 218.694c-2.494 1.582-5.534 2.207-8.563 1.508-3.029-.7-5.487-2.594-7.035-5.11M143.981 218.694c2.494 1.582 5.534 2.207 8.563 1.508 3.03-.7 5.488-2.594 7.036-5.11"})})]})})}const{useState:fs,useRef:ug,useCallback:Cc,useEffect:dI}=vr,CS=0,pI=()=>{},hI=e=>({apiConfig:Xo(e)});function vI({dispatch:e}){const[t,n]=fs(""),[r,o]=fs(""),[i,a]=fs(""),[s,l]=fs(""),u=ug(!1),c=ug(null),f=Cc(y=>{u.current=!0,l("");const b=y.target,{name:h}=b,d=b.value;switch(h){case"baseURL":n(d);break;case"secret":o(d);break;case"metaLabel":a(d);break;default:throw new Error(`unknown input name ${h}`)}},[]),p=Cc(()=>{mI({baseURL:t,secret:r}).then(y=>{y[0]!==CS?l(y[1]):e(yM({baseURL:t,secret:r,metaLabel:i}))})},[t,r,i,e]),m=Cc(y=>{y.target instanceof Element&&(!y.target.tagName||y.target.tagName.toUpperCase()!=="INPUT")||y.key==="Enter"&&p()},[p]),g=async()=>{(await fetch("/")).json().then(b=>{b.hello==="clash"&&n(window.location.origin)},pI)};return dI(()=>{g()},[]),te("div",{className:Mn.root,ref:c,onKeyDown:m,children:[_("div",{className:Mn.header,children:_("div",{className:Mn.icon,children:_(eh,{width:160,height:160,stroke:"var(--stroke)"})})}),te("div",{className:Mn.body,children:[te("div",{className:Mn.hostnamePort,children:[_(Ec,{id:"baseURL",name:"baseURL",label:"API Base URL",type:"text",placeholder:"http://127.0.0.1:9090",value:t,onChange:f}),_(Ec,{id:"secret",name:"secret",label:"Secret(optional)",value:r,type:"text",onChange:f})]}),s?_("div",{className:Mn.error,children:s}):null,_("div",{className:Mn.label,children:_(Ec,{id:"metaLabel",name:"metaLabel",label:"Label(optional)",type:"text",placeholder:"",value:i,onChange:f})})]}),_("div",{className:Mn.footer,children:_(iI,{label:"Add",onClick:p})}),_("div",{style:{height:20}}),_(DD,{})]})}const kS=Ln(hI)(vI);async function mI(e){try{new URL(e.baseURL)}catch{if(e.baseURL){const n=e.baseURL.substring(0,7);if(n!=="http://"&&n!=="https:/")return[1,"Must starts with http:// or https://"]}return[1,"Invalid URL"]}try{const t=await sS(e);return t.status>399?[1,t.statusText]:[CS]}catch{return[1,"Failed to connect"]}}function OS(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Eo=OS()?x.exports.useLayoutEffect:x.exports.useEffect;function PS(){var e=x.exports.useState(Object.create(null)),t=e[1];return x.exports.useCallback(function(){t(Object.create(null))},[])}function gI(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var yI=["unstable_skipInitialRender"],wI=function(t){var n=t.children,r=t.type,o=r===void 0?"reach-portal":r,i=t.containerRef,a=x.exports.useRef(null),s=x.exports.useRef(null),l=PS();return Eo(function(){if(!!a.current){var u=a.current.ownerDocument,c=(i==null?void 0:i.current)||u.body;return s.current=u==null?void 0:u.createElement(o),c.appendChild(s.current),l(),function(){s.current&&c&&c.removeChild(s.current)}}},[o,l,i]),s.current?ma.exports.createPortal(n,s.current):x.exports.createElement("span",{ref:a})},TS=function(t){var n=t.unstable_skipInitialRender,r=gI(t,yI),o=x.exports.useState(!1),i=o[0],a=o[1];return x.exports.useEffect(function(){n&&a(!0)},[n]),n&&!i?null:x.exports.createElement(wI,r)},SI=["bottom","height","left","right","top","width"],bI=function(t,n){return t===void 0&&(t={}),n===void 0&&(n={}),SI.some(function(r){return t[r]!==n[r]})},Dn=new Map,LS,_I=function e(){var t=[];Dn.forEach(function(n,r){var o=r.getBoundingClientRect();bI(o,n.rect)&&(n.rect=o,t.push(n))}),t.forEach(function(n){n.callbacks.forEach(function(r){return r(n.rect)})}),LS=window.requestAnimationFrame(e)};function xI(e,t){return{observe:function(){var r=Dn.size===0;Dn.has(e)?Dn.get(e).callbacks.push(t):Dn.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]}),r&&_I()},unobserve:function(){var r=Dn.get(e);if(r){var o=r.callbacks.indexOf(t);o>=0&&r.callbacks.splice(o,1),r.callbacks.length||Dn.delete(e),Dn.size||cancelAnimationFrame(LS)}}}}function RI(e){return typeof e=="boolean"}function th(e){return!!(e&&{}.toString.call(e)=="[object Function]")}function EI(e){return typeof e=="string"}function Cl(e,t,n){var r,o;if(RI(t))r=t;else{var i;r=(i=t==null?void 0:t.observe)!=null?i:!0,o=t==null?void 0:t.onChange}th(n)&&(o=n);var a=x.exports.useState(e.current),s=a[0],l=a[1],u=x.exports.useRef(!1),c=x.exports.useRef(!1),f=x.exports.useState(null),p=f[0],m=f[1],g=x.exports.useRef(o);return Eo(function(){g.current=o,e.current!==s&&l(e.current)}),Eo(function(){s&&!u.current&&(u.current=!0,m(s.getBoundingClientRect()))},[s]),Eo(function(){if(!!r){var y=s;if(c.current||(c.current=!0,y=e.current),!!y){var b=xI(y,function(h){g.current==null||g.current(h),m(h)});return b.observe(),function(){b.unobserve()}}}},[r,s,e]),p}function pr(e){return OS()?e?e.ownerDocument:document:null}function cg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||e[Symbol.iterator]==null){if(Array.isArray(e)||(n=CI(e))||t&&e&&typeof e.length=="number"){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return n=e[Symbol.iterator](),n.next.bind(n)}function OI(e,t){if(e!=null)if(th(e))e(t);else try{e.current=t}catch{throw new Error('Cannot assign value "'+t+'" to ref "'+e+'"')}}function Xr(){for(var e=arguments.length,t=new Array(e),n=0;n"u"?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function rh(e,t){t=t||{};var n=[],r=[],o=e.querySelectorAll(rd);t.includeContainer&&nh.call(e,rd)&&(o=Array.prototype.slice.apply(o),o.unshift(e));var i,a,s;for(i=0;i=0)&&(n[o]=e[o]);return n}var jI=["unstable_skipInitialPortalRender"],zI=["as","targetRef","position","unstable_observableRefs"],BI=x.exports.forwardRef(function(t,n){var r=t.unstable_skipInitialPortalRender,o=$S(t,jI);return x.exports.createElement(TS,{unstable_skipInitialRender:r},x.exports.createElement(VI,zo({ref:n},o)))}),VI=x.exports.forwardRef(function(t,n){var r=t.as,o=r===void 0?"div":r,i=t.targetRef,a=t.position,s=a===void 0?KI:a,l=t.unstable_observableRefs,u=l===void 0?[]:l,c=$S(t,zI),f=x.exports.useRef(null),p=Cl(f,{observe:!c.hidden}),m=Cl(i,{observe:!c.hidden}),g=Xr(f,n);return QI(i,f),x.exports.createElement(o,zo({"data-reach-popover":"",ref:g},c,{style:zo({position:"absolute"},WI.apply(void 0,[s,m,p].concat(u)),c.style)}))});function WI(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i=0)&&(n[o]=e[o]);return n}function Kn(){return Kn=Object.assign||function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}var i3=["children"];function a3(e,t){var n=x.exports.createContext(t);function r(i){var a=i.children,s=o3(i,i3),l=x.exports.useMemo(function(){return s},Object.values(s));return x.exports.createElement(n.Provider,{value:l},a)}function o(i){var a=x.exports.useContext(n);if(a)return a;if(t)return t;throw Error(i+" must be rendered inside of a "+e+" component.")}return[r,o]}function ca(){for(var e=arguments.length,t=new Array(e),n=0;n=0)&&(n[o]=e[o]);return n}function Ye(){return Ye=Object.assign||function(e){for(var t=1;tTe||at>Te)&&(O.current=!0)}!E&&U!=null&&!p&&d({type:qn,payload:{index:U,dropdownRef:v}})}function we(){O.current=!0,!E&&U!=null&&!p&&d({type:qn,payload:{index:U}})}function de(ee){if(!Ns(ee.nativeEvent)){if(!O.current){O.current=!0;return}r?B.current?B.current=!1:W.current&&W.current.click():p||z()}}return x.exports.useEffect(function(){if(M){var ee=window.setTimeout(function(){O.current=!0},400);return function(){window.clearTimeout(ee)}}else O.current=!1},[M,O]),x.exports.useEffect(function(){var ee=pr(W.current);return ee.addEventListener("mouseup",Te),function(){ee.removeEventListener("mouseup",Te)};function Te(){B.current=!1}},[]),{data:{disabled:p},props:Ye({id:VS(U),tabIndex:-1},b,{ref:V,"data-disabled":p?"":void 0,"data-selected":E?"":void 0,"data-valuetext":X,onClick:Ie(o,J),onDragStart:Ie(i,H),onMouseDown:Ie(a,Z),onMouseEnter:Ie(s,se),onMouseLeave:Ie(l,Y),onMouseMove:Ie(u,me),onFocus:Ie(m,we),onMouseUp:Ie(c,de)})}}function y3(e){e.id;var t=e.onKeyDown,n=e.ref,r=yu(e,c3),o=Aa("useDropdownItems"),i=o.dispatch,a=o.triggerRef,s=o.dropdownRef,l=o.selectCallbacks,u=o.dropdownId,c=o.state,f=c.isExpanded,p=c.triggerId,m=c.selectionIndex,g=c.typeaheadQuery,y=WS(),b=Xr(s,n);x.exports.useEffect(function(){var O=S3(y,g);g&&O!=null&&i({type:qn,payload:{index:O,dropdownRef:s}});var R=window.setTimeout(function(){return g&&i({type:id,payload:""})},1e3);return function(){return window.clearTimeout(R)}},[i,y,g,s]);var h=Oc(y.length),d=Oc(y[m]),v=Oc(m);x.exports.useEffect(function(){m>y.length-1?i({type:qn,payload:{index:y.length-1,dropdownRef:s}}):h!==y.length&&m>-1&&d&&v===m&&y[m]!==d&&i({type:qn,payload:{index:y.findIndex(function(O){return O.key===(d==null?void 0:d.key)}),dropdownRef:s}})},[s,i,y,h,d,v,m]);var w=Ie(function(R){var A=R.key;if(!!f)switch(A){case"Enter":case" ":var C=y.find(function(M){return M.index===m});C&&!C.disabled&&(R.preventDefault(),C.isLink&&C.element?C.element.click():(kl(a.current),l.current[C.index]&&l.current[C.index](),i({type:oh})));break;case"Escape":kl(a.current),i({type:fa});break;case"Tab":R.preventDefault();break;default:if(EI(A)&&A.length===1){var I=g+A.toLowerCase();i({type:id,payload:I})}break}},r3(wu,{currentIndex:m,orientation:"vertical",rotate:!1,filter:function(R){return!R.disabled},callback:function(R){i({type:qn,payload:{index:R,dropdownRef:s}})},key:"index"}));return{data:{activeDescendant:VS(m)||void 0,triggerId:p},props:Ye({tabIndex:-1},r,{ref:b,id:u,onKeyDown:Ie(t,w)})}}function w3(e){var t=e.onBlur,n=e.portal,r=n===void 0?!0:n,o=e.position,i=e.ref,a=yu(e,f3),s=Aa("useDropdownPopover"),l=s.triggerRef,u=s.triggerClickedRef,c=s.dispatch,f=s.dropdownRef,p=s.popoverRef,m=s.state.isExpanded,g=Xr(p,i);return x.exports.useEffect(function(){if(!m)return;var y=pr(p.current);function b(h){u.current?u.current=!1:b3(p.current,h.target)||c({type:fa})}return y.addEventListener("mousedown",b),function(){y.removeEventListener("mousedown",b)}},[u,l,c,f,p,m]),{data:{portal:r,position:o,targetRef:l,isExpanded:m},props:Ye({ref:g,hidden:!m,onBlur:Ie(t,function(y){y.currentTarget.contains(y.relatedTarget)||c({type:fa})})},a)}}function S3(e,t){if(t===void 0&&(t=""),!t)return null;var n=e.find(function(r){var o,i,a;return r.disabled?!1:(o=r.element)==null||(i=o.dataset)==null||(a=i.valuetext)==null?void 0:a.toLowerCase().startsWith(t)});return n?e.indexOf(n):null}function VS(e){var t=Aa("useItemId"),n=t.dropdownId;return e!=null&&e>-1?ca("option-"+e,n):void 0}function kl(e){e&&e.focus()}function b3(e,t){return!!(e&&e.contains(t))}function _3(e,t){switch(t===void 0&&(t={}),t.type){case oh:return Ye({},e,{isExpanded:!1,selectionIndex:-1});case fa:return Ye({},e,{isExpanded:!1,selectionIndex:-1});case d3:return Ye({},e,{isExpanded:!0,selectionIndex:0});case od:return Ye({},e,{isExpanded:!0,selectionIndex:t.payload.index});case jS:return Ye({},e,{isExpanded:!0,selectionIndex:-1});case qn:{var n=t.payload.dropdownRef,r=n===void 0?{current:null}:n;if(t.payload.index>=0&&t.payload.index!==e.selectionIndex){if(r.current){var o=pr(r.current);r.current!==(o==null?void 0:o.activeElement)&&r.current.focus()}return Ye({},e,{selectionIndex:t.payload.max!=null?Math.min(Math.max(t.payload.index,0),t.payload.max):Math.max(t.payload.index,0)})}return e}case FS:return Ye({},e,{selectionIndex:-1});case zS:return Ye({},e,{triggerId:t.payload});case id:return typeof t.payload<"u"?Ye({},e,{typeaheadQuery:t.payload}):e;default:return e}}function WS(){return t3(wu)}var HS={exports:{}},ye={};/** @license React v16.13.1 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var We=typeof Symbol=="function"&&Symbol.for,ih=We?Symbol.for("react.element"):60103,ah=We?Symbol.for("react.portal"):60106,Su=We?Symbol.for("react.fragment"):60107,bu=We?Symbol.for("react.strict_mode"):60108,_u=We?Symbol.for("react.profiler"):60114,xu=We?Symbol.for("react.provider"):60109,Ru=We?Symbol.for("react.context"):60110,sh=We?Symbol.for("react.async_mode"):60111,Eu=We?Symbol.for("react.concurrent_mode"):60111,Cu=We?Symbol.for("react.forward_ref"):60112,ku=We?Symbol.for("react.suspense"):60113,x3=We?Symbol.for("react.suspense_list"):60120,Ou=We?Symbol.for("react.memo"):60115,Pu=We?Symbol.for("react.lazy"):60116,R3=We?Symbol.for("react.block"):60121,E3=We?Symbol.for("react.fundamental"):60117,C3=We?Symbol.for("react.responder"):60118,k3=We?Symbol.for("react.scope"):60119;function Ct(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ih:switch(e=e.type,e){case sh:case Eu:case Su:case _u:case bu:case ku:return e;default:switch(e=e&&e.$$typeof,e){case Ru:case Cu:case Pu:case Ou:case xu:return e;default:return t}}case ah:return t}}}function KS(e){return Ct(e)===Eu}ye.AsyncMode=sh;ye.ConcurrentMode=Eu;ye.ContextConsumer=Ru;ye.ContextProvider=xu;ye.Element=ih;ye.ForwardRef=Cu;ye.Fragment=Su;ye.Lazy=Pu;ye.Memo=Ou;ye.Portal=ah;ye.Profiler=_u;ye.StrictMode=bu;ye.Suspense=ku;ye.isAsyncMode=function(e){return KS(e)||Ct(e)===sh};ye.isConcurrentMode=KS;ye.isContextConsumer=function(e){return Ct(e)===Ru};ye.isContextProvider=function(e){return Ct(e)===xu};ye.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ih};ye.isForwardRef=function(e){return Ct(e)===Cu};ye.isFragment=function(e){return Ct(e)===Su};ye.isLazy=function(e){return Ct(e)===Pu};ye.isMemo=function(e){return Ct(e)===Ou};ye.isPortal=function(e){return Ct(e)===ah};ye.isProfiler=function(e){return Ct(e)===_u};ye.isStrictMode=function(e){return Ct(e)===bu};ye.isSuspense=function(e){return Ct(e)===ku};ye.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Su||e===Eu||e===_u||e===bu||e===ku||e===x3||typeof e=="object"&&e!==null&&(e.$$typeof===Pu||e.$$typeof===Ou||e.$$typeof===xu||e.$$typeof===Ru||e.$$typeof===Cu||e.$$typeof===E3||e.$$typeof===C3||e.$$typeof===k3||e.$$typeof===R3)};ye.typeOf=Ct;(function(e){e.exports=ye})(HS);function ht(){return ht=Object.assign||function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}var O3=["as","id","children"],P3=["as"],T3=["as"],L3=["as"],N3=["as"],A3=["portal"],M3=["as"],D3=x.exports.forwardRef(function(e,t){var n=e.as,r=n===void 0?x.exports.Fragment:n,o=e.id,i=e.children,a=Yr(e,O3),s=x.exports.useMemo(function(){try{return HS.exports.isFragment(x.exports.createElement(r,null))}catch{return!1}},[r]),l=s?{}:ht({ref:t,id:o,"data-reach-menu":""},a);return x.exports.createElement(r,l,x.exports.createElement(v3,{id:o,children:i}))}),I3=x.exports.forwardRef(function(e,t){var n=e.as,r=n===void 0?"button":n,o=Yr(e,P3),i=m3(ht({},o,{ref:t})),a=i.data,s=a.isExpanded,l=a.controls,u=i.props;return x.exports.createElement(r,ht({"aria-expanded":s?!0:void 0,"aria-haspopup":!0,"aria-controls":l},u,{"data-reach-menu-button":""}))}),$3=x.exports.forwardRef(function(e,t){var n=e.as,r=n===void 0?"div":n,o=Yr(e,T3),i=g3(ht({},o,{ref:t})),a=i.data.disabled,s=i.props;return x.exports.createElement(r,ht({role:"menuitem"},s,{"aria-disabled":a||void 0,"data-reach-menu-item":""}))}),U3=x.exports.forwardRef(function(e,t){var n=e.as,r=n===void 0?"div":n,o=Yr(e,L3);return x.exports.createElement($3,ht({},o,{ref:t,as:r}))}),F3=x.exports.forwardRef(function(e,t){var n=e.as,r=n===void 0?"div":n,o=Yr(e,N3),i=y3(ht({},o,{ref:t})),a=i.data,s=a.activeDescendant,l=a.triggerId,u=i.props;return x.exports.createElement(r,ht({"aria-activedescendant":s,"aria-labelledby":l||void 0,role:"menu"},u,{"data-reach-menu-items":""}))}),j3=x.exports.forwardRef(function(e,t){var n=e.portal,r=n===void 0?!0:n,o=Yr(e,A3);return x.exports.createElement(z3,{portal:r},x.exports.createElement(F3,ht({},o,{ref:t,"data-reach-menu-list":""})))}),z3=x.exports.forwardRef(function(e,t){var n=e.as,r=n===void 0?"div":n,o=Yr(e,M3),i=w3(ht({},o,{ref:t})),a=i.data,s=a.portal,l=a.targetRef,u=a.position,c=i.props,f={"data-reach-menu-popover":""};return s?x.exports.createElement(BI,ht({},c,f,{as:r,targetRef:l,position:u,unstable_skipInitialPortalRender:!0})):x.exports.createElement(r,ht({},c,f))});function B3(e){var t,n,r=pr(e),o=r.defaultView||window;return r?{width:(t=r.documentElement.clientWidth)!=null?t:o.innerWidth,height:(n=r.documentElement.clientHeight)!=null?n:o.innerHeight}:{width:0,height:0}}function Ol(){return Ol=Object.assign||function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}var W3=["as","style"],H3=x.exports.forwardRef(function(t,n){var r=t.as,o=r===void 0?"span":r,i=t.style,a=i===void 0?{}:i,s=V3(t,W3);return x.exports.createElement(o,Ol({ref:n,style:Ol({border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},a)},s))});function hr(){return hr=Object.assign||function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}var K3=["children","label","ariaLabel","id","DEBUG_STYLE"],q3=["label","ariaLabel","isVisible","id"],Q3=["ariaLabel","aria-label","as","id","isVisible","label","position","style","triggerRect"],G3=["type"],ds,br,gn,gi,ps,_r,X3=100,Y3=500,ve;(function(e){e.Idle="IDLE",e.Focused="FOCUSED",e.Visible="VISIBLE",e.LeavingVisible="LEAVING_VISIBLE",e.Dismissed="DISMISSED"})(ve||(ve={}));var he;(function(e){e.Blur="BLUR",e.Focus="FOCUS",e.GlobalMouseMove="GLOBAL_MOUSE_MOVE",e.MouseDown="MOUSE_DOWN",e.MouseEnter="MOUSE_ENTER",e.MouseLeave="MOUSE_LEAVE",e.MouseMove="MOUSE_MOVE",e.Rest="REST",e.SelectWithKeyboard="SELECT_WITH_KEYBOARD",e.TimeComplete="TIME_COMPLETE"})(he||(he={}));var ad={initial:ve.Idle,states:(_r={},_r[ve.Idle]={enter:Pc,on:(ds={},ds[he.MouseEnter]=ve.Focused,ds[he.Focus]=ve.Visible,ds)},_r[ve.Focused]={enter:e$,leave:t$,on:(br={},br[he.MouseMove]=ve.Focused,br[he.MouseLeave]=ve.Idle,br[he.MouseDown]=ve.Dismissed,br[he.Blur]=ve.Idle,br[he.Rest]=ve.Visible,br)},_r[ve.Visible]={on:(gn={},gn[he.Focus]=ve.Focused,gn[he.MouseEnter]=ve.Focused,gn[he.MouseLeave]=ve.LeavingVisible,gn[he.Blur]=ve.LeavingVisible,gn[he.MouseDown]=ve.Dismissed,gn[he.SelectWithKeyboard]=ve.Dismissed,gn[he.GlobalMouseMove]=ve.LeavingVisible,gn)},_r[ve.LeavingVisible]={enter:n$,leave:function(){r$(),Pc()},on:(gi={},gi[he.MouseEnter]=ve.Visible,gi[he.Focus]=ve.Visible,gi[he.TimeComplete]=ve.Idle,gi)},_r[ve.Dismissed]={leave:function(){Pc()},on:(ps={},ps[he.MouseLeave]=ve.Idle,ps[he.Blur]=ve.Idle,ps)},_r)},At={value:ad.initial,context:{id:null}},As=[];function J3(e){return As.push(e),function(){As.splice(As.indexOf(e),1)}}function Z3(){As.forEach(function(e){return e(At)})}var sd;function e$(){window.clearTimeout(sd),sd=window.setTimeout(function(){Ht({type:he.Rest})},X3)}function t$(){window.clearTimeout(sd)}var ld;function n$(){window.clearTimeout(ld),ld=window.setTimeout(function(){return Ht({type:he.TimeComplete})},Y3)}function r$(){window.clearTimeout(ld)}function Pc(){At.context.id=null}function o$(e){var t=e===void 0?{}:e,n=t.id,r=t.onPointerEnter,o=t.onPointerMove,i=t.onPointerLeave,a=t.onPointerDown,s=t.onMouseEnter,l=t.onMouseMove,u=t.onMouseLeave,c=t.onMouseDown,f=t.onFocus,p=t.onBlur,m=t.onKeyDown,g=t.disabled,y=t.ref,b=t.DEBUG_STYLE,h=String(US(n)),d=x.exports.useState(b?!0:pg(h,!0)),v=d[0],w=d[1],O=x.exports.useRef(null),R=Xr(y,O),A=Cl(O,{observe:v});x.exports.useEffect(function(){return J3(function(){w(pg(h))})},[h]),x.exports.useEffect(function(){var D=pr(O.current);function $(U){(U.key==="Escape"||U.key==="Esc")&&At.value===ve.Visible&&Ht({type:he.SelectWithKeyboard})}return D.addEventListener("keydown",$),function(){return D.removeEventListener("keydown",$)}},[]),f$({disabled:g,isVisible:v,ref:O});function C(D,$){return typeof window<"u"&&"PointerEvent"in window?D:Ie(D,$)}function I(D){return function(U){U.pointerType==="mouse"&&D(U)}}function M(){Ht({type:he.MouseEnter,id:h})}function W(){Ht({type:he.MouseMove,id:h})}function oe(){Ht({type:he.MouseLeave})}function X(){At.context.id===h&&Ht({type:he.MouseDown})}function S(){window.__REACH_DISABLE_TOOLTIPS||Ht({type:he.Focus,id:h})}function L(){At.context.id===h&&Ht({type:he.Blur})}function B(D){(D.key==="Enter"||D.key===" ")&&Ht({type:he.SelectWithKeyboard})}var P={"aria-describedby":v?ca("tooltip",h):void 0,"data-state":v?"tooltip-visible":"tooltip-hidden","data-reach-tooltip-trigger":"",ref:R,onPointerEnter:Ie(r,I(M)),onPointerMove:Ie(o,I(W)),onPointerLeave:Ie(i,I(oe)),onPointerDown:Ie(a,I(X)),onMouseEnter:C(s,M),onMouseMove:C(l,W),onMouseLeave:C(u,oe),onMouseDown:C(c,X),onFocus:Ie(f,S),onBlur:Ie(p,L),onKeyDown:Ie(m,B)},N={id:h,triggerRect:A,isVisible:v};return[P,N,v]}var i$=x.exports.forwardRef(function(e,t){var n=e.children,r=e.label,o=e.ariaLabel,i=e.id,a=e.DEBUG_STYLE,s=Tu(e,K3),l=x.exports.Children.only(n),u=o$({id:i,onPointerEnter:l.props.onPointerEnter,onPointerMove:l.props.onPointerMove,onPointerLeave:l.props.onPointerLeave,onPointerDown:l.props.onPointerDown,onMouseEnter:l.props.onMouseEnter,onMouseMove:l.props.onMouseMove,onMouseLeave:l.props.onMouseLeave,onMouseDown:l.props.onMouseDown,onFocus:l.props.onFocus,onBlur:l.props.onBlur,onKeyDown:l.props.onKeyDown,disabled:l.props.disabled,ref:l.ref,DEBUG_STYLE:a}),c=u[0],f=u[1];return x.exports.createElement(x.exports.Fragment,null,x.exports.cloneElement(l,c),x.exports.createElement(a$,hr({ref:t,label:r,"aria-label":o},f,s)))}),a$=x.exports.forwardRef(function(t,n){var r=t.label,o=t.ariaLabel,i=t.isVisible,a=t.id,s=Tu(t,q3);return i?x.exports.createElement(TS,null,x.exports.createElement(s$,hr({ref:n,label:r,"aria-label":o,isVisible:i},s,{id:ca("tooltip",String(a))}))):null}),s$=x.exports.forwardRef(function(t,n){var r=t.ariaLabel,o=t["aria-label"],i=t.as,a=i===void 0?"div":i,s=t.id,l=t.isVisible,u=t.label,c=t.position,f=c===void 0?c$:c,p=t.style,m=t.triggerRect,g=Tu(t,Q3),y=(o||r)!=null,b=x.exports.useRef(null),h=Xr(n,b),d=Cl(b,{observe:l});return x.exports.createElement(x.exports.Fragment,null,x.exports.createElement(a,hr({role:y?void 0:"tooltip"},g,{ref:h,"data-reach-tooltip":"",id:y?void 0:s,style:hr({},p,l$(f,m,d))}),u),y&&x.exports.createElement(H3,{role:"tooltip",id:s},o||r))});function l$(e,t,n){var r=!n;return r?{visibility:"hidden"}:e(t,n)}var u$=8,c$=function(t,n,r){r===void 0&&(r=u$);var o=B3(),i=o.width,a=o.height;if(!t||!n)return{};var s={top:t.top-n.height<0,right:i{delete n[l],t[l]=u}).catch(u=>{r[l]=u}),n[l]}function i(l="default"){t[l]!==void 0||n[l]||o(l)}function a(l="default"){if(t[l]!==void 0)return t[l];throw r[l]?r[l]:n[l]?n[l]:o(l)}function s(l){l?delete t[l]:t={}}return{preload:i,read:a,clear:s}}const lh=p$(()=>Rn(()=>import("./index.ad2cee1a.js"),[],import.meta.url)),h$="_checkWrapper_1nrct_45",v$="_active_1nrct_51",hg={checkWrapper:h$,active:v$};function m$({theme:e,dispatch:t}){const{t:n}=va(),r=x.exports.useMemo(()=>{switch(e){case"dark":return _(vg,{});case"auto":return _(y$,{});case"light":return _(g$,{});default:return console.assert(!1,"Unknown theme"),_(vg,{})}},[e]),o=x.exports.useCallback(i=>t(_M(i)),[t]);return te(D3,{children:[_(qS,{label:n("switch_theme"),"aria-label":"switch theme",children:_(I3,{children:r})}),te(j3,{children:[_(Tc,{value:"auto",label:"Auto",active:e==="auto",onSelect:o}),_(Tc,{value:"dark",label:"Dark",active:e==="dark",onSelect:o}),_(Tc,{value:"light",label:"Light",active:e==="light",onSelect:o})]})]})}function Tc(e){const t=dr(hg.checkWrapper,{[hg.active]:e.active});return te(U3,{onSelect:()=>e.onSelect(e.value),children:[_("span",{className:t,children:_(vA,{size:14})}),_("span",{children:e.label})]})}function vg(){const t=lh.read().motion;return _("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:_(t.path,{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z",initial:{rotate:-30},animate:{rotate:0},transition:{duration:.7}})})}function g$(){const t=lh.read().motion;return te("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_("circle",{cx:"12",cy:"12",r:"5"}),te(t.g,{initial:{scale:.7},animate:{scale:1},transition:{duration:.5},children:[_("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),_("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),_("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),_("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),_("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),_("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),_("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),_("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})]})}function y$(){const t=lh.read().motion;return te("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_("circle",{cx:"12",cy:"12",r:"11"}),_("clipPath",{id:"cut-off-bottom",children:_(t.rect,{x:"12",y:"0",width:"12",height:"24",initial:{rotate:-30},animate:{rotate:0},transition:{duration:.7}})}),_("circle",{cx:"12",cy:"12",r:"6",clipPath:"url(#cut-off-bottom)",fill:"currentColor"})]})}const w$=e=>({theme:Xp(e)}),QS=Ln(w$)(m$),ud=0;class S$ extends Error{constructor(t,n){super(t),this.message=t,this.code=n}}const cd={[ud]:{message:"Browser not supported!",detail:'This browser does not support "fetch", please choose another one.'},default:{message:"Oops, something went wrong!"}};function b$(e){const{code:t}=e;return typeof t=="number"?cd[t]:cd.default}const _$="_content_b98hm_1",x$="_container_b98hm_16",R$="_overlay_b98hm_22",E$="_fixed_b98hm_26",hs={content:_$,container:x$,overlay:R$,fixed:E$},C$="_overlay_1i06e_1",k$="_content_1i06e_10",mg={overlay:C$,content:k$};function O$({isOpen:e,onRequestClose:t,className:n,overlayClassName:r,children:o,...i}){const a=dr(n,mg.content),s=dr(r,mg.overlay);return _(a1,{isOpen:e,onRequestClose:t,className:a,overlayClassName:s,...i,children:o})}const P$=x.exports.memo(O$),{useCallback:T$,useEffect:L$}=vr;function N$({dispatch:e,apiConfig:t,modals:n}){if(!window.fetch){const{detail:o}=cd[ud];throw new S$(o,ud)}const r=T$(()=>{e(cM("apiConfig"))},[e]);return L$(()=>{e(cS(t))},[e,t]),te(P$,{isOpen:n.apiConfig,className:hs.content,overlayClassName:hs.overlay,shouldCloseOnOverlayClick:!1,shouldCloseOnEsc:!1,onRequestClose:r,children:[_("div",{className:hs.container,children:_(kS,{})}),_("div",{className:hs.fixed,children:_(QS,{})})]})}const A$=e=>({modals:e.modals,apiConfig:Xo(e)}),M$=Ln(A$)(N$),D$="_root_4m2cd_1",I$="_yacd_4m2cd_14",$$="_link_4m2cd_23",Lc={root:D$,yacd:I$,link:$$};function U$({width:e=24,height:t=24}={}){return _("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:_("path",{d:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"})})}const F$="https://github.com/haishanh/yacd/issues";function j$({message:e,detail:t}){return te("div",{className:Lc.root,children:[_("div",{className:Lc.yacd,children:_(eh,{width:150,height:150})}),e?_("h1",{children:e}):null,t?_("p",{children:t}):null,_("p",{children:te("a",{className:Lc.link,href:F$,children:[_(U$,{width:16,height:16}),"haishanh/yacd"]})})]})}class z$ extends x.exports.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}render(){if(this.state.error){const{message:t,detail:n}=b$(this.state.error);return _(j$,{message:t,detail:n})}else return this.props.children}}const B$="_root_jynjv_1",V$="_chart_jynjv_10",gg={root:B$,chart:V$};var uh=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var a=i[o];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n};function yg(e,t,n,r=0,o=!1){for(const a of t)if(uh(n,a.args)){if(o)return;if(a.error)throw a.error;if(a.response)return a.response;throw a.promise}const i={args:n,promise:e(...n).then(a=>i.response=a!=null?a:!0).catch(a=>i.error=a!=null?a:"unknown error").then(()=>{r>0&&setTimeout(()=>{const a=t.indexOf(i);a!==-1&&t.splice(a,1)},r)})};if(t.push(i),!o)throw i.promise}function W$(e,...t){if(t===void 0||t.length===0)e.splice(0,e.length);else{const n=e.find(r=>uh(t,r.args));if(n){const r=e.indexOf(n);r!==-1&&e.splice(r,1)}}}function H$(e,t=0){const n=[];return{read:(...r)=>yg(e,n,r,t),preload:(...r)=>void yg(e,n,r,t,!0),clear:(...r)=>W$(n,...r),peek:(...r)=>{var o;return(o=n.find(i=>uh(r,i.args)))==null?void 0:o.response}}}const wg=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];function da(e){if(e<1e3)return e+" B";const t=Math.min(Math.floor(Math.log10(e)/3),wg.length-1);e=Number((e/Math.pow(1e3,t)).toPrecision(3));const n=wg[t];return e+" "+n}const K$=H$(()=>Rn(()=>import("./chart-lib.a8ad03fd.js"),[],import.meta.url)),Sg={borderWidth:1,pointRadius:0,tension:.2,fill:!0},q$={responsive:!0,maintainAspectRatio:!0,plugins:{legend:{labels:{boxWidth:20}}},scales:{x:{display:!1,type:"category"},y:{type:"linear",display:!0,grid:{display:!0,color:"#555",drawTicks:!1,borderDash:[3,6],drawBorder:!1},ticks:{callback(e){return da(e)+"/s "}}}}},bg=[{down:{backgroundColor:"rgba(176, 209, 132, 0.8)",borderColor:"rgb(176, 209, 132)"},up:{backgroundColor:"rgba(181, 220, 231, 0.8)",borderColor:"rgb(181, 220, 231)"}},{up:{backgroundColor:"rgb(98, 190, 100)",borderColor:"rgb(78,146,79)"},down:{backgroundColor:"rgb(160, 230, 66)",borderColor:"rgb(110, 156, 44)"}},{up:{backgroundColor:"rgba(94, 175, 223, 0.3)",borderColor:"rgb(94, 175, 223)"},down:{backgroundColor:"rgba(139, 227, 195, 0.3)",borderColor:"rgb(139, 227, 195)"}},{up:{backgroundColor:"rgba(242, 174, 62, 0.3)",borderColor:"rgb(242, 174, 62)"},down:{backgroundColor:"rgba(69, 154, 248, 0.3)",borderColor:"rgb(69, 154, 248)"}}],{useEffect:Q$}=xe;function G$(e,t,n,r,o={}){Q$(()=>{const i=document.getElementById(t).getContext("2d"),a={...q$,...o},s=new e(i,{type:"line",data:n,options:a}),l=r&&r.subscribe(()=>s.update());return()=>{l&&l(),s.destroy()}},[e,t,n,r,o])}const{useMemo:X$}=vr,Y$={position:"relative",maxWidth:1e3},J$=e=>({apiConfig:Xo(e),selectedChartStyleIndex:vM(e)}),Z$=Ln(J$)(e4);function e4({apiConfig:e,selectedChartStyleIndex:t}){const n=K$.read(),r=Qp(e),{t:o}=va(),i=X$(()=>({labels:r.labels,datasets:[{...Sg,...bg[t].up,label:o("Up"),data:r.up},{...Sg,...bg[t].down,label:o("Down"),data:r.down}]}),[r,t,o]);return G$(n.Chart,"trafficChart",i,r),_("div",{style:Y$,children:_("canvas",{id:"trafficChart"})})}const t4="_TrafficNow_hzna1_1",n4="_sec_hzna1_10",no={TrafficNow:t4,sec:n4},{useState:GS,useEffect:XS,useCallback:r4}=vr,o4=e=>({apiConfig:Xo(e)}),i4=Ln(o4)(a4);function a4({apiConfig:e}){const{t}=va(),{upStr:n,downStr:r}=s4(e),{upTotal:o,dlTotal:i,connNumber:a}=l4(e);return te("div",{className:no.TrafficNow,children:[te("div",{className:no.sec,children:[_("div",{children:t("Upload")}),_("div",{children:n})]}),te("div",{className:no.sec,children:[_("div",{children:t("Download")}),_("div",{children:r})]}),te("div",{className:no.sec,children:[_("div",{children:t("Upload Total")}),_("div",{children:o})]}),te("div",{className:no.sec,children:[_("div",{children:t("Download Total")}),_("div",{children:i})]}),te("div",{className:no.sec,children:[_("div",{children:t("Active Connections")}),_("div",{children:a})]})]})}function s4(e){const[t,n]=GS({upStr:"0 B/s",downStr:"0 B/s"});return XS(()=>Qp(e).subscribe(r=>n({upStr:da(r.up)+"/s",downStr:da(r.down)+"/s"})),[e]),t}function l4(e){const[t,n]=GS({upTotal:"0 B",dlTotal:"0 B",connNumber:0}),r=r4(({downloadTotal:o,uploadTotal:i,connections:a})=>{n({upTotal:da(i),dlTotal:da(o),connNumber:a.length})},[n]);return XS(()=>eD(e,r),[e,r]),t}function u4(){const{t:e}=va();return te("div",{children:[_(Jw,{title:e("Overview")}),te("div",{className:gg.root,children:[_("div",{children:_(i4,{})}),_("div",{className:gg.chart,children:_(x.exports.Suspense,{fallback:_(hS,{height:"200px"}),children:_(Z$,{})})})]})]})}const c4="_lo_pmly2_1",f4={lo:c4};function d4(){return _("div",{className:f4.lo,children:_(eh,{width:280,height:280,animate:!0,c0:"transparent",c1:"#646464"})})}const p4="_app_1s3k7_1",h4="_content_1s3k7_18",YS={app:p4,content:h4};var JS={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},_g=xe.createContext&&xe.createContext(JS),ir=globalThis&&globalThis.__assign||function(){return ir=Object.assign||function(e){for(var t,n=1,r=arguments.length;n_(N4,{to:n,isActive:t.pathname===n,iconId:r,labelText:e(o)},n))}),te("div",{className:Bn.footer,children:[_(QS,{}),_(qS,{label:e("about"),children:_(P1,{to:"/about",className:Bn.iconWrapper,children:_(kA,{size:20})})})]})]})}const D4="_input_mh4af_1",TU={input:D4},I4="_animate_1w0e8_1",LU={animate:I4,"zap-pulse":"_zap-pulse_1w0e8_1"};function fd(){return fd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=l)&&this.A(n),this.W&&this.setState({N:!1,j:!1}),this.l=Date.now()},t.prototype.p=function(n){n.preventDefault(),typeof n.button=="number"&&n.button!==0||(this.I(n.clientX),window.addEventListener("mousemove",this.v),window.addEventListener("mouseup",this.g))},t.prototype.v=function(n){n.preventDefault(),this.L(n.clientX)},t.prototype.g=function(n){this.U(n),window.removeEventListener("mousemove",this.v),window.removeEventListener("mouseup",this.g)},t.prototype.k=function(n){this.X=null,this.I(n.touches[0].clientX)},t.prototype.m=function(n){this.L(n.touches[0].clientX)},t.prototype.M=function(n){n.preventDefault(),this.U(n)},t.prototype.$=function(n){Date.now()-this.l>50&&(this.A(n),Date.now()-this.u>50&&this.W&&this.setState({j:!1}))},t.prototype.C=function(){this.u=Date.now()},t.prototype.D=function(){this.setState({j:!0})},t.prototype.O=function(){this.setState({j:!1})},t.prototype.S=function(n){this.H=n},t.prototype.T=function(n){n.preventDefault(),this.H.focus(),this.A(n),this.W&&this.setState({j:!1})},t.prototype.A=function(n){var r=this.props;(0,r.onChange)(!r.checked,n,r.id)},t.prototype.render=function(){var n=this.props,r=n.checked,o=n.disabled,i=n.className,a=n.offColor,s=n.onColor,l=n.offHandleColor,u=n.onHandleColor,c=n.checkedIcon,f=n.uncheckedIcon,p=n.checkedHandleIcon,m=n.uncheckedHandleIcon,g=n.boxShadow,y=n.activeBoxShadow,b=n.height,h=n.width,d=n.borderRadius,v=function(L,B){var P={};for(var N in L)Object.prototype.hasOwnProperty.call(L,N)&&B.indexOf(N)===-1&&(P[N]=L[N]);return P}(n,["checked","disabled","className","offColor","onColor","offHandleColor","onHandleColor","checkedIcon","uncheckedIcon","checkedHandleIcon","uncheckedHandleIcon","boxShadow","activeBoxShadow","height","width","borderRadius","handleDiameter"]),w=this.state,O=w.h,R=w.N,A=w.j,C={position:"relative",display:"inline-block",textAlign:"left",opacity:o?.5:1,direction:"ltr",borderRadius:b/2,WebkitTransition:"opacity 0.25s",MozTransition:"opacity 0.25s",transition:"opacity 0.25s",touchAction:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},I={height:b,width:h,margin:Math.max(0,(this.t-b)/2),position:"relative",background:Rg(O,this.i,this.o,a,s),borderRadius:typeof d=="number"?d:b/2,cursor:o?"default":"pointer",WebkitTransition:R?null:"background 0.25s",MozTransition:R?null:"background 0.25s",transition:R?null:"background 0.25s"},M={height:b,width:Math.min(1.5*b,h-(this.t+b)/2+1),position:"relative",opacity:(O-this.o)/(this.i-this.o),pointerEvents:"none",WebkitTransition:R?null:"opacity 0.25s",MozTransition:R?null:"opacity 0.25s",transition:R?null:"opacity 0.25s"},W={height:b,width:Math.min(1.5*b,h-(this.t+b)/2+1),position:"absolute",opacity:1-(O-this.o)/(this.i-this.o),right:0,top:0,pointerEvents:"none",WebkitTransition:R?null:"opacity 0.25s",MozTransition:R?null:"opacity 0.25s",transition:R?null:"opacity 0.25s"},oe={height:this.t,width:this.t,background:Rg(O,this.i,this.o,l,u),display:"inline-block",cursor:o?"default":"pointer",borderRadius:typeof d=="number"?d-1:"50%",position:"absolute",transform:"translateX("+O+"px)",top:Math.max(0,(b-this.t)/2),outline:0,boxShadow:A?y:g,border:0,WebkitTransition:R?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",MozTransition:R?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",transition:R?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s"},X={height:this.t,width:this.t,opacity:Math.max(2*(1-(O-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:R?null:"opacity 0.25s",MozTransition:R?null:"opacity 0.25s",transition:R?null:"opacity 0.25s"},S={height:this.t,width:this.t,opacity:Math.max(2*((O-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:R?null:"opacity 0.25s",MozTransition:R?null:"opacity 0.25s",transition:R?null:"opacity 0.25s"};return te("div",{className:i,style:C,children:[te("div",{className:"react-switch-bg",style:I,onClick:o?null:this.T,onMouseDown:function(L){return L.preventDefault()},children:[c&&_("div",{style:M,children:c}),f&&_("div",{style:W,children:f})]}),te("div",{className:"react-switch-handle",style:oe,onClick:function(L){return L.preventDefault()},onMouseDown:o?null:this.p,onTouchStart:o?null:this.k,onTouchMove:o?null:this.m,onTouchEnd:o?null:this.M,onTouchCancel:o?null:this.O,children:[m&&_("div",{style:X,children:m}),p&&_("div",{style:S,children:p})]}),_("input",{...fd({},{type:"checkbox",role:"switch","aria-checked":r,checked:r,disabled:o,style:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",width:1}},v,{ref:this.S,onFocus:this.D,onBlur:this.O,onKeyUp:this.C,onChange:this.$})})]})},t}(x.exports.Component);Ms.defaultProps={disabled:!1,offColor:"#888",onColor:"#080",offHandleColor:"#fff",onHandleColor:"#fff",uncheckedIcon:$4,checkedIcon:U4,boxShadow:null,activeBoxShadow:"0 0 2px 3px #3bf",height:28,width:56};const F4=Ms.default?Ms.default:Ms;function j4({checked:e=!1,onChange:t,theme:n,name:r}){return _(F4,{onChange:t,checked:e,uncheckedIcon:!1,checkedIcon:!1,offColor:n==="dark"?"#393939":"#e9e9e9",onColor:"#047aff",offHandleColor:"#fff",onHandleColor:"#fff",handleDiameter:24,height:28,width:44,className:"rs",name:r})}const NU=Ln(e=>({theme:Xp(e)}))(j4),z4="_ToggleSwitch_10mtp_1",B4="_slider_10mtp_28",Eg={ToggleSwitch:z4,slider:B4};function V4({options:e,value:t,name:n,onChange:r}){const o=x.exports.useMemo(()=>e.map(s=>s.value).indexOf(t),[e,t]),i=x.exports.useCallback(s=>{const l=Math.floor(100/e.length);if(s===e.length-1)return 100-e.length*l+l;if(s>-1)return l},[e]),a=x.exports.useMemo(()=>({width:i(o)+"%",left:o*i(0)+"%"}),[o,i]);return te("div",{className:Eg.ToggleSwitch,children:[_("div",{className:Eg.slider,style:a}),e.map((s,l)=>{const u=`${n}-${s.label}`;return te("label",{htmlFor:u,className:l===0?"":"border-left",style:{width:i(l)+"%"},children:[_("input",{id:u,name:n,type:"radio",value:s.value,checked:t===s.value,onChange:r}),_("div",{children:s.label})]},u)})]})}xe.memo(V4);const{lazy:Ma,Suspense:eb}=vr,W4=Ma(()=>Rn(()=>import("./Connections.55a90f3d.js"),["Connections.55a90f3d.js","Connections.1e70ab68.css","useRemainingViewPortHeight.4e5a0898.js","chevron-down.0fe59cac.js","index.47b45d26.js","Fab.ac4f3b29.js","Fab.a0a7e573.css","play.f2fb5ccc.js"],import.meta.url)),H4=Ma(()=>Rn(()=>import("./Config.fa1e4fae.js"),["Config.fa1e4fae.js","Config.7bc73fad.css","logs.e4cdcb93.js","Select.ef9dc454.js","Select.1e55eba1.css"],import.meta.url)),K4=Ma(()=>Rn(()=>import("./Logs.3d717679.js"),["Logs.3d717679.js","Logs.4b8e75d1.css","index.esm.d79e6b4f.js","logs.e4cdcb93.js","debounce.c2d20996.js","useRemainingViewPortHeight.4e5a0898.js","Fab.ac4f3b29.js","Fab.a0a7e573.css","play.f2fb5ccc.js"],import.meta.url)),q4=Ma(()=>Rn(()=>import("./Proxies.98885c78.js"),["Proxies.98885c78.js","Proxies.3fa3509d.css","chevron-down.0fe59cac.js","Fab.ac4f3b29.js","Fab.a0a7e573.css","TextFitler.3362aec6.js","TextFitler.b21c0577.css","debounce.c2d20996.js","index.47b45d26.js","Select.ef9dc454.js","Select.1e55eba1.css"],import.meta.url)),Q4=Ma(()=>Rn(()=>import("./Rules.651d070a.js"),["Rules.651d070a.js","Rules.e03c54a8.css","index.esm.d79e6b4f.js","TextFitler.3362aec6.js","TextFitler.b21c0577.css","debounce.c2d20996.js","index.47b45d26.js","Fab.ac4f3b29.js","Fab.a0a7e573.css","useRemainingViewPortHeight.4e5a0898.js"],import.meta.url)),G4=[{path:"/",element:_(u4,{})},{path:"/connections",element:_(W4,{})},{path:"/configs",element:_(H4,{})},{path:"/logs",element:_(K4,{})},{path:"/proxies",element:_(q4,{})},{path:"/rules",element:_(Q4,{})},{path:"/about",element:_(MM,{})},!1].filter(Boolean);function X4(){return O1(G4)}function Y4(){return te(xn,{children:[_(M$,{}),_(M4,{}),_("div",{className:YS.content,children:_(eb,{fallback:_(d4,{}),children:_(X4,{})})})]})}function J4(){return O1([{path:"/backend",element:_(kS,{})},{path:"*",element:_(Y4,{})}])}const Z4=()=>_(z$,{children:_(fA,{children:_(rM,{initialState:bD,actions:_D,children:_(BC,{client:BM,children:_(E2,{children:te("div",{className:YS.app,children:[_(jM,{}),_(eb,{fallback:_(hS,{}),children:_(J4,{})})]})})})})})}),eU=Boolean(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function tU(e){if("serviceWorker"in navigator){if(new URL("./",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{const n=".//sw.js";eU?(nU(n,e),navigator.serviceWorker.ready.then(()=>{console.log("This web app is being served cache-first by a service worker")})):tb(n,e)})}}function tb(e,t){navigator.serviceWorker.register(e).then(n=>{n.onupdatefound=()=>{const r=n.installing;r!=null&&(r.onstatechange=()=>{r.state==="installed"&&(navigator.serviceWorker.controller?(console.log("New content is available and will be used when all tabs for this page are closed. See https://cra.link/PWA."),t&&t.onUpdate&&t.onUpdate(n)):(console.log("Content is cached for offline use."),t&&t.onSuccess&&t.onSuccess(n)))})}}).catch(n=>{console.error("Error during service worker registration:",n)})}function nU(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(n=>{const r=n.headers.get("content-type");n.status===404||r!=null&&r.indexOf("javascript")===-1?navigator.serviceWorker.ready.then(o=>{o.unregister().then(()=>{window.location.reload()})}):tb(e,t)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}oU();const nb=document.getElementById("app"),rU=X0(nb);function Nc(e){const t=document.createElement("link");t.href=e,t.rel="preload",t.as="font",t.crossOrigin="",document.head.appendChild(t)}function oU(){Nc(J_),Nc(Z_),Nc(ex)}a1.setAppElement(nb);rU.render(_(x.exports.StrictMode,{children:_(Z4,{})}));tU();console.log("Checkout the repo: https://github.com/haishanh/yacd");console.log("Version:","0.3.6");export{SS as $,dS as A,iI as B,Jw as C,lU as D,Et as E,xn as F,sU as G,YM as H,TA as I,gU as J,yU as K,mU as L,a1 as M,cU as N,vU as O,Gn as P,gl as Q,xe as R,eh as S,LU as T,PU as U,aU as V,kU as W,lD as X,o$ as Y,a$ as Z,Ac as _,vs as a,uD as a0,EU as a1,OU as a2,qS as a3,dU as a4,pU as a5,hU as a6,_U as a7,xU as a8,CU as a9,RU as aa,lh as ab,mM as ac,Yo as ad,SU as ae,cD as af,bU as ag,dA as ah,QC as ai,S1 as aj,iU as ak,te as b,dr as c,Ln as d,wU as e,eD as f,Xo as g,vr as h,be as i,_ as j,K$ as k,Sg as l,mg as m,bg as n,G$ as o,da as p,uU as q,x as r,TU as s,cS as t,va as u,tg as v,fU as w,nM as x,NU as y,vM as z}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.47b45d26.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.47b45d26.js new file mode 100644 index 000000000..3932a8aaa --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.47b45d26.js @@ -0,0 +1 @@ +function h(e,a){if(a.length1?"s":"")+" required, but only "+a.length+" present")}function s(e){h(1,arguments);var a=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&a==="[object Date]"?new Date(e.getTime()):typeof e=="number"||a==="[object Number]"?new Date(e):((typeof e=="string"||a==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}var k={};function A(){return k}function P(e){var a=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return a.setUTCFullYear(e.getFullYear()),e.getTime()-a.getTime()}function M(e,a){h(2,arguments);var t=s(e),n=s(a),i=t.getTime()-n.getTime();return i<0?-1:i>0?1:i}function C(e,a){h(2,arguments);var t=s(e),n=s(a),i=t.getFullYear()-n.getFullYear(),u=t.getMonth()-n.getMonth();return i*12+u}function X(e,a){return h(2,arguments),s(e).getTime()-s(a).getTime()}var S={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},I="trunc";function _(e){return e?S[e]:S[I]}function j(e){h(1,arguments);var a=s(e);return a.setHours(23,59,59,999),a}function E(e){h(1,arguments);var a=s(e),t=a.getMonth();return a.setFullYear(a.getFullYear(),t+1,0),a.setHours(23,59,59,999),a}function R(e){h(1,arguments);var a=s(e);return j(a).getTime()===E(a).getTime()}function Y(e,a){h(2,arguments);var t=s(e),n=s(a),i=M(t,n),u=Math.abs(C(t,n)),r;if(u<1)r=0;else{t.getMonth()===1&&t.getDate()>27&&t.setDate(30),t.setMonth(t.getMonth()-i*u);var l=M(t,n)===-i;R(s(e))&&u===1&&M(e,n)===1&&(l=!1),r=i*(u-Number(l))}return r===0?0:r}function z(e,a,t){h(2,arguments);var n=X(e,a)/1e3;return _(t==null?void 0:t.roundingMethod)(n)}var L={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},V=function(e,a,t){var n,i=L[e];return typeof i=="string"?n=i:a===1?n=i.one:n=i.other.replace("{{count}}",a.toString()),t!=null&&t.addSuffix?t.comparison&&t.comparison>0?"in "+n:n+" ago":n};const q=V;function w(e){return function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=a.width?String(a.width):e.defaultWidth,n=e.formats[t]||e.formats[e.defaultWidth];return n}}var H={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},J={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},U={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},$={date:w({formats:H,defaultWidth:"full"}),time:w({formats:J,defaultWidth:"full"}),dateTime:w({formats:U,defaultWidth:"full"})};const Q=$;var B={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},G=function(e,a,t,n){return B[e]};const K=G;function g(e){return function(a,t){var n=t!=null&&t.context?String(t.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var u=e.defaultFormattingWidth||e.defaultWidth,r=t!=null&&t.width?String(t.width):u;i=e.formattingValues[r]||e.formattingValues[u]}else{var l=e.defaultWidth,o=t!=null&&t.width?String(t.width):e.defaultWidth;i=e.values[o]||e.values[l]}var f=e.argumentCallback?e.argumentCallback(a):a;return i[f]}}var Z={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ee={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},te={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ae={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ne={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},re={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ie=function(e,a){var t=Number(e),n=t%100;if(n>20||n<10)switch(n%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd"}return t+"th"},oe={ordinalNumber:ie,era:g({values:Z,defaultWidth:"wide"}),quarter:g({values:ee,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:g({values:te,defaultWidth:"wide"}),day:g({values:ae,defaultWidth:"wide"}),dayPeriod:g({values:ne,defaultWidth:"wide",formattingValues:re,defaultFormattingWidth:"wide"})};const ue=oe;function b(e){return function(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],u=a.match(i);if(!u)return null;var r=u[0],l=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],o=Array.isArray(l)?le(l,function(m){return m.test(r)}):se(l,function(m){return m.test(r)}),f;f=e.valueCallback?e.valueCallback(o):o,f=t.valueCallback?t.valueCallback(f):f;var c=a.slice(r.length);return{value:f,rest:c}}}function se(e,a){for(var t in e)if(e.hasOwnProperty(t)&&a(e[t]))return t}function le(e,a){for(var t=0;t1&&arguments[1]!==void 0?arguments[1]:{},n=a.match(e.matchPattern);if(!n)return null;var i=n[0],u=a.match(e.parsePattern);if(!u)return null;var r=e.valueCallback?e.valueCallback(u[0]):u[0];r=t.valueCallback?t.valueCallback(r):r;var l=a.slice(i.length);return{value:r,rest:l}}}var fe=/^(\d+)(th|st|nd|rd)?/i,me=/\d+/i,he={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ce={any:[/^b/i,/^(a|c)/i]},ve={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ge={any:[/1/i,/2/i,/3/i,/4/i]},be={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Me={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ye={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},we={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},pe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},De={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Pe={ordinalNumber:de({matchPattern:fe,parsePattern:me,valueCallback:function(e){return parseInt(e,10)}}),era:b({matchPatterns:he,defaultMatchWidth:"wide",parsePatterns:ce,defaultParseWidth:"any"}),quarter:b({matchPatterns:ve,defaultMatchWidth:"wide",parsePatterns:ge,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:b({matchPatterns:be,defaultMatchWidth:"wide",parsePatterns:Me,defaultParseWidth:"any"}),day:b({matchPatterns:ye,defaultMatchWidth:"wide",parsePatterns:we,defaultParseWidth:"any"}),dayPeriod:b({matchPatterns:pe,defaultMatchWidth:"any",parsePatterns:De,defaultParseWidth:"any"})};const Se=Pe;var Te={code:"en-US",formatDistance:q,formatLong:Q,formatRelative:K,localize:ue,match:Se,options:{weekStartsOn:0,firstWeekContainsDate:1}};const We=Te;function W(e,a){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t]);return e}function Ne(e){return W({},e)}var T=1440,Oe=2520,p=43200,Fe=86400;function xe(e,a,t){var n,i;h(2,arguments);var u=A(),r=(n=(i=t==null?void 0:t.locale)!==null&&i!==void 0?i:u.locale)!==null&&n!==void 0?n:We;if(!r.formatDistance)throw new RangeError("locale must contain formatDistance property");var l=M(e,a);if(isNaN(l))throw new RangeError("Invalid time value");var o=W(Ne(t),{addSuffix:Boolean(t==null?void 0:t.addSuffix),comparison:l}),f,c;l>0?(f=s(a),c=s(e)):(f=s(e),c=s(a));var m=z(c,f),N=(P(c)-P(f))/1e3,d=Math.round((m-N)/60),v;if(d<2)return t!=null&&t.includeSeconds?m<5?r.formatDistance("lessThanXSeconds",5,o):m<10?r.formatDistance("lessThanXSeconds",10,o):m<20?r.formatDistance("lessThanXSeconds",20,o):m<40?r.formatDistance("halfAMinute",0,o):m<60?r.formatDistance("lessThanXMinutes",1,o):r.formatDistance("xMinutes",1,o):d===0?r.formatDistance("lessThanXMinutes",1,o):r.formatDistance("xMinutes",d,o);if(d<45)return r.formatDistance("xMinutes",d,o);if(d<90)return r.formatDistance("aboutXHours",1,o);if(dt in e?cb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,te=(e,t)=>{for(var n in t||(t={}))hh.call(t,n)&&ph(e,n,t[n]);if(ja)for(var n of ja(t))vh.call(t,n)&&ph(e,n,t[n]);return e},ge=(e,t)=>fb(e,db(t));var xr=(e,t)=>{var n={};for(var r in e)hh.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ja)for(var r of ja(e))t.indexOf(r)<0&&vh.call(e,r)&&(n[r]=e[r]);return n};function Pg(e,t){return t.forEach(function(n){n&&typeof n!="string"&&!Array.isArray(n)&&Object.keys(n).forEach(function(r){if(r!=="default"&&!(r in e)){var o=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:function(){return n[r]}})}})}),Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const pb=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerpolicy&&(i.referrerPolicy=o.referrerpolicy),o.crossorigin==="use-credentials"?i.credentials="include":o.crossorigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}};pb();const hb="modulepreload",mh={},vb="./",Rn=function(t,n){return!n||n.length===0?t():Promise.all(n.map(r=>{if(r=`${vb}${r}`,r in mh)return;mh[r]=!0;const o=r.endsWith(".css"),i=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${r}"]${i}`))return;const a=document.createElement("link");if(a.rel=o?"stylesheet":hb,o||(a.as="script",a.crossOrigin=""),a.href=r,document.head.appendChild(a),o)return new Promise((s,l)=>{a.addEventListener("load",s),a.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${r}`)))})})).then(()=>t())};function Gn(e){return Gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gn(e)}function jt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gh(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:{};jt(this,e),this.init(t,n)}return zt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||yb,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),o=0;o1?r-1:0),i=1;i-1?s.replace(/###/g,"."):s}function o(){return!e||typeof e=="string"}for(var i=typeof t!="string"?[].concat(t):t.split(".");i.length>1;){if(o())return{};var a=r(i.shift());!e[a]&&n&&(e[a]=new n),Object.prototype.hasOwnProperty.call(e,a)?e=e[a]:e={}}return o()?{}:{obj:e,k:r(i.shift())}}function _h(e,t,n){var r=hd(e,t,Object),o=r.obj,i=r.k;o[i]=n}function bb(e,t,n,r){var o=hd(e,t,Object),i=o.obj,a=o.k;i[a]=i[a]||[],r&&(i[a]=i[a].concat(n)),r||i[a].push(n)}function js(e,t){var n=hd(e,t),r=n.obj,o=n.k;if(!!r)return r[o]}function xh(e,t,n){var r=js(e,n);return r!==void 0?r:js(t,n)}function Ag(e,t,n){for(var r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?typeof e[r]=="string"||e[r]instanceof String||typeof t[r]=="string"||t[r]instanceof String?n&&(e[r]=t[r]):Ag(e[r],t[r],n):e[r]=t[r]);return e}function ro(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var _b={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function xb(e){return typeof e=="string"?e.replace(/[&<>"'\/]/g,function(t){return _b[t]}):e}var Il=typeof window!="undefined"&&window.navigator&&typeof window.navigator.userAgentData=="undefined"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Eb=[" ",",","?","!",";"];function Cb(e,t,n){t=t||"",n=n||"";var r=Eb.filter(function(s){return t.indexOf(s)<0&&n.indexOf(s)<0});if(r.length===0)return!0;var o=new RegExp("(".concat(r.map(function(s){return s==="?"?"\\?":s}).join("|"),")")),i=!o.test(e);if(!i){var a=e.indexOf(n);a>0&&!o.test(e.substring(0,a))&&(i=!0)}return i}function Eh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function za(e){for(var t=1;t2&&arguments[2]!==void 0?arguments[2]:".";if(!!e){if(e[t])return e[t];for(var r=t.split(n),o=e,i=0;ii+a;)a++,s=r.slice(i,i+a).join(n),l=o[s];if(l===void 0)return;if(l===null)return null;if(t.endsWith(s)){if(typeof l=="string")return l;if(s&&typeof l[s]=="string")return l[s]}var u=r.slice(i+a).join(n);return u?Dg(l,u,n):void 0}o=o[r[i]]}return o}}var kb=function(e){$l(n,e);var t=Rb(n);function n(r){var o,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return jt(this,n),o=t.call(this),Il&&sr.call(Xn(o)),o.data=r||{},o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.options.ignoreJSONStructure===void 0&&(o.options.ignoreJSONStructure=!0),o}return zt(n,[{key:"addNamespaces",value:function(o){this.options.ns.indexOf(o)<0&&this.options.ns.push(o)}},{key:"removeNamespaces",value:function(o){var i=this.options.ns.indexOf(o);i>-1&&this.options.ns.splice(i,1)}},{key:"getResource",value:function(o,i,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure,c=[o,i];a&&typeof a!="string"&&(c=c.concat(a)),a&&typeof a=="string"&&(c=c.concat(l?a.split(l):a)),o.indexOf(".")>-1&&(c=o.split("."));var f=js(this.data,c);return f||!u||typeof a!="string"?f:Dg(this.data&&this.data[o]&&this.data[o][i],a,l)}},{key:"addResource",value:function(o,i,a,s){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},u=this.options.keySeparator;u===void 0&&(u=".");var c=[o,i];a&&(c=c.concat(u?a.split(u):a)),o.indexOf(".")>-1&&(c=o.split("."),s=i,i=c[1]),this.addNamespaces(i),_h(this.data,c,s),l.silent||this.emit("added",o,i,a,s)}},{key:"addResources",value:function(o,i,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in a)(typeof a[l]=="string"||Object.prototype.toString.apply(a[l])==="[object Array]")&&this.addResource(o,i,l,a[l],{silent:!0});s.silent||this.emit("added",o,i,a)}},{key:"addResourceBundle",value:function(o,i,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},c=[o,i];o.indexOf(".")>-1&&(c=o.split("."),s=a,a=i,i=c[1]),this.addNamespaces(i);var f=js(this.data,c)||{};s?Ag(f,a,l):f=za(za({},f),a),_h(this.data,c,f),u.silent||this.emit("added",o,i,a)}},{key:"removeResourceBundle",value:function(o,i){this.hasResourceBundle(o,i)&&delete this.data[o][i],this.removeNamespaces(i),this.emit("removed",o,i)}},{key:"hasResourceBundle",value:function(o,i){return this.getResource(o,i)!==void 0}},{key:"getResourceBundle",value:function(o,i){return i||(i=this.options.defaultNS),this.options.compatibilityAPI==="v1"?za(za({},{}),this.getResource(o,i)):this.getResource(o,i)}},{key:"getDataByLanguage",value:function(o){return this.data[o]}},{key:"hasLanguageSomeTranslations",value:function(o){var i=this.getDataByLanguage(o),a=i&&Object.keys(i)||[];return!!a.find(function(s){return i[s]&&Object.keys(i[s]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(sr),Mg={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,r,o,i){var a=this;return t.forEach(function(s){a.processors[s]&&(n=a.processors[s].process(n,r,o,i))}),n}};function Ch(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ot(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};return jt(this,n),o=t.call(this),Il&&sr.call(Xn(o)),Sb(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Xn(o)),o.options=i,o.options.keySeparator===void 0&&(o.options.keySeparator="."),o.logger=un.create("translator"),o}return zt(n,[{key:"changeLanguage",value:function(o){o&&(this.language=o)}},{key:"exists",value:function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(o==null)return!1;var a=this.resolve(o,i);return a&&a.res!==void 0}},{key:"extractFromKey",value:function(o,i){var a=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");var s=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,l=i.ns||this.options.defaultNS||[],u=a&&o.indexOf(a)>-1,c=!this.options.userDefinedKeySeparator&&!i.keySeparator&&!this.options.userDefinedNsSeparator&&!i.nsSeparator&&!Cb(o,a,s);if(u&&!c){var f=o.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:o,namespaces:l};var p=o.split(a);(a!==s||a===s&&this.options.ns.indexOf(p[0])>-1)&&(l=p.shift()),o=p.join(s)}return typeof l=="string"&&(l=[l]),{key:o,namespaces:l}}},{key:"translate",value:function(o,i,a){var s=this;if(Gn(i)!=="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),i||(i={}),o==null)return"";Array.isArray(o)||(o=[String(o)]);var l=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,u=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,c=this.extractFromKey(o[o.length-1],i),f=c.key,p=c.namespaces,h=p[p.length-1],g=i.lng||this.language,y=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g&&g.toLowerCase()==="cimode"){if(y){var b=i.nsSeparator||this.options.nsSeparator;return l?(v.res="".concat(h).concat(b).concat(f),v):"".concat(h).concat(b).concat(f)}return l?(v.res=f,v):f}var v=this.resolve(o,i),d=v&&v.res,m=v&&v.usedKey||f,S=v&&v.exactUsedKey||f,E=Object.prototype.toString.apply(d),O=["[object Number]","[object Function]","[object RegExp]"],A=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,P=!this.i18nFormat||this.i18nFormat.handleAsObject,I=typeof d!="string"&&typeof d!="boolean"&&typeof d!="number";if(P&&d&&I&&O.indexOf(E)<0&&!(typeof A=="string"&&E==="[object Array]")){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(m,d,ot(ot({},i),{},{ns:p})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(v.res=D,v):D}if(u){var W=E==="[object Array]",J=W?[]:{},X=W?S:m;for(var w in d)if(Object.prototype.hasOwnProperty.call(d,w)){var T="".concat(X).concat(u).concat(w);J[w]=this.translate(T,ot(ot({},i),{joinArrays:!1,ns:p})),J[w]===T&&(J[w]=d[w])}d=J}}else if(P&&typeof A=="string"&&E==="[object Array]")d=d.join(A),d&&(d=this.extendTranslation(d,o,i,a));else{var U=!1,k=!1,L=i.count!==void 0&&typeof i.count!="string",M=n.hasDefaultValue(i),$=L?this.pluralResolver.getSuffix(g,i.count,i):"",F=i["defaultValue".concat($)]||i.defaultValue;!this.isValidLookup(d)&&M&&(U=!0,d=F),this.isValidLookup(d)||(k=!0,d=f);var _=i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,V=_&&k?void 0:d,B=M&&F!==d&&this.options.updateMissing;if(k||U||B){if(this.logger.log(B?"updateKey":"missingKey",g,h,f,B?F:d),u){var ee=this.resolve(f,ot(ot({},i),{},{keySeparator:!1}));ee&&ee.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var H=[],ne=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ne&&ne[0])for(var le=0;le1&&arguments[1]!==void 0?arguments[1]:{},s,l,u,c,f;return typeof o=="string"&&(o=[o]),o.forEach(function(p){if(!i.isValidLookup(s)){var h=i.extractFromKey(p,a),g=h.key;l=g;var y=h.namespaces;i.options.fallbackNS&&(y=y.concat(i.options.fallbackNS));var b=a.count!==void 0&&typeof a.count!="string",v=b&&!a.ordinal&&a.count===0&&i.pluralResolver.shouldUseIntlApi(),d=a.context!==void 0&&(typeof a.context=="string"||typeof a.context=="number")&&a.context!=="",m=a.lngs?a.lngs:i.languageUtils.toResolveHierarchy(a.lng||i.language,a.fallbackLng);y.forEach(function(S){i.isValidLookup(s)||(f=S,!Rh["".concat(m[0],"-").concat(S)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(f)&&(Rh["".concat(m[0],"-").concat(S)]=!0,i.logger.warn('key "'.concat(l,'" for languages "').concat(m.join(", "),`" won't get resolved as namespace "`).concat(f,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),m.forEach(function(E){if(!i.isValidLookup(s)){c=E;var O=[g];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(O,g,E,S,a);else{var A;b&&(A=i.pluralResolver.getSuffix(E,a.count,a));var P="_zero";if(b&&(O.push(g+A),v&&O.push(g+P)),d){var I="".concat(g).concat(i.options.contextSeparator).concat(a.context);O.push(I),b&&(O.push(I+A),v&&O.push(I+P))}}for(var D;D=O.pop();)i.isValidLookup(s)||(u=D,s=i.getResource(E,S,D,a))}}))})}}),{res:s,usedKey:l,exactUsedKey:u,usedLng:c,usedNS:f}}},{key:"isValidLookup",value:function(o){return o!==void 0&&!(!this.options.returnNull&&o===null)&&!(!this.options.returnEmptyString&&o==="")}},{key:"getResource",value:function(o,i,a){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(o,i,a,s):this.resourceStore.getResource(o,i,a,s)}}],[{key:"hasDefaultValue",value:function(o){var i="defaultValue";for(var a in o)if(Object.prototype.hasOwnProperty.call(o,a)&&i===a.substring(0,i.length)&&o[a]!==void 0)return!0;return!1}}]),n}(sr);function zu(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Lb=function(){function e(t){jt(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=un.create("languageUtils")}return zt(e,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],o=n.split("-");return this.options.lowerCaseLng?o=o.map(function(i){return i.toLowerCase()}):o.length===2?(o[0]=o[0].toLowerCase(),o[1]=o[1].toUpperCase(),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=zu(o[1].toLowerCase()))):o.length===3&&(o[0]=o[0].toLowerCase(),o[1].length===2&&(o[1]=o[1].toUpperCase()),o[0]!=="sgn"&&o[2].length===2&&(o[2]=o[2].toUpperCase()),r.indexOf(o[1].toLowerCase())>-1&&(o[1]=zu(o[1].toLowerCase())),r.indexOf(o[2].toLowerCase())>-1&&(o[2]=zu(o[2].toLowerCase()))),o.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var o;return n.forEach(function(i){if(!o){var a=r.formatLanguageCode(i);(!r.options.supportedLngs||r.isSupportedCode(a))&&(o=a)}}),!o&&this.options.supportedLngs&&n.forEach(function(i){if(!o){var a=r.getLanguagePartFromCode(i);if(r.isSupportedCode(a))return o=a;o=r.options.supportedLngs.find(function(s){if(s.indexOf(a)===0)return s})}}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var o=n[r];return o||(o=n[this.getScriptPartFromCode(r)]),o||(o=n[this.formatLanguageCode(r)]),o||(o=n[this.getLanguagePartFromCode(r)]),o||(o=n.default),o||[]}},{key:"toResolveHierarchy",value:function(n,r){var o=this,i=this.getFallbackCodes(r||this.options.fallbackLng||[],n),a=[],s=function(u){!u||(o.isSupportedCode(u)?a.push(u):o.logger.warn("rejecting language code not found in supportedLngs: ".concat(u)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(n))):typeof n=="string"&&s(this.formatLanguageCode(n)),i.forEach(function(l){a.indexOf(l)<0&&s(o.formatLanguageCode(l))}),a}}]),e}(),Nb=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Ab={1:function(t){return Number(t>1)},2:function(t){return Number(t!=1)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(t==1?0:t>=2&&t<=4?1:2)},7:function(t){return Number(t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(t==1?0:t==2?1:t!=8&&t!=11?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(t==1?0:t==2?1:t<7?2:t<11?3:4)},11:function(t){return Number(t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(t!==0)},14:function(t){return Number(t==1?0:t==2?1:t==3?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:t!==0?1:2)},17:function(t){return Number(t==1||t%10==1&&t%100!=11?0:1)},18:function(t){return Number(t==0?0:t==1?1:2)},19:function(t){return Number(t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(t==1?0:t==0||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0)},22:function(t){return Number(t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3)}},Db=["v1","v2","v3"],kh={zero:0,one:1,two:2,few:3,many:4,other:5};function Mb(){var e={};return Nb.forEach(function(t){t.lngs.forEach(function(n){e[n]={numbers:t.nr,plurals:Ab[t.fc]}})}),e}var $b=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};jt(this,e),this.languageUtils=t,this.options=n,this.logger=un.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=Mb()}return zt(e,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,r);return this.shouldUseIntlApi()?o&&o.resolvedOptions().pluralCategories.length>1:o&&o.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,o).map(function(i){return"".concat(r).concat(i)})}},{key:"getSuffixes",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort(function(a,s){return kh[a]-kh[s]}).map(function(a){return"".concat(r.options.prepend).concat(a)}):i.numbers.map(function(a){return r.getSuffix(n,a,o)}):[]}},{key:"getSuffix",value:function(n,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=this.getRule(n,o);return i?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(i.select(r)):this.getSuffixRetroCompatible(i,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var o=this,i=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),a=n.numbers[i];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));var s=function(){return o.options.prepend&&a.toString()?o.options.prepend+a.toString():a.toString()};return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?"_plural_".concat(a.toString()):s():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?s():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}},{key:"shouldUseIntlApi",value:function(){return!Db.includes(this.options.compatibilityJSON)}}]),e}();function Ph(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Vt(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{};jt(this,e),this.logger=un.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(n){return n},this.init(t)}return zt(e,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:xb,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?ro(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?ro(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?ro(r.nestingPrefix):r.nestingPrefixEscaped||ro("$t("),this.nestingSuffix=r.nestingSuffix?ro(r.nestingSuffix):r.nestingSuffixEscaped||ro(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var o="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(o,"g")}},{key:"interpolate",value:function(n,r,o,i){var a=this,s,l,u,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(b){return b.replace(/\$/g,"$$$$")}var p=function(v){if(v.indexOf(a.formatSeparator)<0){var d=xh(r,c,v);return a.alwaysFormat?a.format(d,void 0,o,Vt(Vt(Vt({},i),r),{},{interpolationkey:v})):d}var m=v.split(a.formatSeparator),S=m.shift().trim(),E=m.join(a.formatSeparator).trim();return a.format(xh(r,c,S),E,o,Vt(Vt(Vt({},i),r),{},{interpolationkey:S}))};this.resetRegExp();var h=i&&i.missingInterpolationHandler||this.options.missingInterpolationHandler,g=i&&i.interpolation&&i.interpolation.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,y=[{regex:this.regexpUnescape,safeValue:function(v){return f(v)}},{regex:this.regexp,safeValue:function(v){return a.escapeValue?f(a.escape(v)):f(v)}}];return y.forEach(function(b){for(u=0;s=b.regex.exec(n);){var v=s[1].trim();if(l=p(v),l===void 0)if(typeof h=="function"){var d=h(n,s,i);l=typeof d=="string"?d:""}else if(i&&i.hasOwnProperty(v))l="";else if(g){l=s[0];continue}else a.logger.warn("missed to pass in variable ".concat(v," for interpolating ").concat(n)),l="";else typeof l!="string"&&!a.useRawValueToEscape&&(l=bh(l));var m=b.safeValue(l);if(n=n.replace(s[0],m),g?(b.regex.lastIndex+=l.length,b.regex.lastIndex-=s[0].length):b.regex.lastIndex=0,u++,u>=a.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var o=this,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,s,l=Vt({},i);l.applyPostProcessor=!1,delete l.defaultValue;function u(h,g){var y=this.nestingOptionsSeparator;if(h.indexOf(y)<0)return h;var b=h.split(new RegExp("".concat(y,"[ ]*{"))),v="{".concat(b[1]);h=b[0],v=this.interpolate(v,l),v=v.replace(/'/g,'"');try{l=JSON.parse(v),g&&(l=Vt(Vt({},g),l))}catch(d){return this.logger.warn("failed parsing options string in nesting for key ".concat(h),d),"".concat(h).concat(y).concat(v)}return delete l.defaultValue,h}for(;a=this.nestingRegexp.exec(n);){var c=[],f=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){var p=a[1].split(this.formatSeparator).map(function(h){return h.trim()});a[1]=p.shift(),c=p,f=!0}if(s=r(u.call(this,a[1].trim(),l),l),s&&a[0]===n&&typeof s!="string")return s;typeof s!="string"&&(s=bh(s)),s||(this.logger.warn("missed to resolve ".concat(a[1]," for nesting ").concat(n)),s=""),f&&(s=c.reduce(function(h,g){return o.format(h,g,i.lng,Vt(Vt({},i),{},{interpolationkey:a[1].trim()}))},s.trim())),n=n.replace(a[0],s),this.regexp.lastIndex=0}return n}}]),e}();function Th(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Dn(e){for(var t=1;t-1){var r=e.split("(");t=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);if(t==="currency"&&o.indexOf(":")<0)n.currency||(n.currency=o.trim());else if(t==="relativetime"&&o.indexOf(":")<0)n.range||(n.range=o.trim());else{var i=o.split(";");i.forEach(function(a){if(!!a){var s=a.split(":"),l=gb(s),u=l[0],c=l.slice(1),f=c.join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=f),f==="false"&&(n[u.trim()]=!1),f==="true"&&(n[u.trim()]=!0),isNaN(f)||(n[u.trim()]=parseInt(f,10))}})}}return{formatName:t,formatOptions:n}}var Ub=function(){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};jt(this,e),this.logger=un.create("formatter"),this.options=t,this.formats={number:function(r,o,i){return new Intl.NumberFormat(o,i).format(r)},currency:function(r,o,i){return new Intl.NumberFormat(o,Dn(Dn({},i),{},{style:"currency"})).format(r)},datetime:function(r,o,i){return new Intl.DateTimeFormat(o,Dn({},i)).format(r)},relativetime:function(r,o,i){return new Intl.RelativeTimeFormat(o,Dn({},i)).format(r,i.range||"day")},list:function(r,o,i){return new Intl.ListFormat(o,Dn({},i)).format(r)}},this.init(t)}return zt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},o=r.interpolation;this.formatSeparator=o.formatSeparator?o.formatSeparator:o.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"format",value:function(n,r,o,i){var a=this,s=r.split(this.formatSeparator),l=s.reduce(function(u,c){var f=Fb(c),p=f.formatName,h=f.formatOptions;if(a.formats[p]){var g=u;try{var y=i&&i.formatParams&&i.formatParams[i.interpolationkey]||{},b=y.locale||y.lng||i.locale||i.lng||o;g=a.formats[p](u,b,Dn(Dn(Dn({},h),i),y))}catch(v){a.logger.warn(v)}return g}else a.logger.warn("there was no format function for ".concat(p));return u},n);return l}}]),e}();function Lh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Nh(e){for(var t=1;t3&&arguments[3]!==void 0?arguments[3]:{};return jt(this,n),a=t.call(this),Il&&sr.call(Xn(a)),a.backend=r,a.store=o,a.services=i,a.languageUtils=i.languageUtils,a.options=s,a.logger=un.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(i,s.backend,s),a}return zt(n,[{key:"queueLoad",value:function(o,i,a,s){var l=this,u={},c={},f={},p={};return o.forEach(function(h){var g=!0;i.forEach(function(y){var b="".concat(h,"|").concat(y);!a.reload&&l.store.hasResourceBundle(h,y)?l.state[b]=2:l.state[b]<0||(l.state[b]===1?c[b]===void 0&&(c[b]=!0):(l.state[b]=1,g=!1,c[b]===void 0&&(c[b]=!0),u[b]===void 0&&(u[b]=!0),p[y]===void 0&&(p[y]=!0)))}),g||(f[h]=!0)}),(Object.keys(u).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(u),pending:Object.keys(c),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(p)}}},{key:"loaded",value:function(o,i,a){var s=o.split("|"),l=s[0],u=s[1];i&&this.emit("failedLoading",l,u,i),a&&this.store.addResourceBundle(l,u,a),this.state[o]=i?-1:2;var c={};this.queue.forEach(function(f){bb(f.loaded,[l],u),Bb(f,o),i&&f.errors.push(i),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(p){c[p]||(c[p]={});var h=f.loaded[p];h.length&&h.forEach(function(g){c[p][g]===void 0&&(c[p][g]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(o,i,a){var s=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,u=arguments.length>4&&arguments[4]!==void 0?arguments[4]:350,c=arguments.length>5?arguments[5]:void 0;if(!o.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:o,ns:i,fcName:a,tried:l,wait:u,callback:c});return}return this.readingCalls++,this.backend[a](o,i,function(f,p){if(f&&p&&l<5){setTimeout(function(){s.read.call(s,o,i,a,l+1,u*2,c)},u);return}if(s.readingCalls--,s.waitingReads.length>0){var h=s.waitingReads.shift();s.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}c(f,p)})}},{key:"prepareLoading",value:function(o,i){var a=this,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof o=="string"&&(o=this.languageUtils.toResolveHierarchy(o)),typeof i=="string"&&(i=[i]);var u=this.queueLoad(o,i,s,l);if(!u.toLoad.length)return u.pending.length||l(),null;u.toLoad.forEach(function(c){a.loadOne(c)})}},{key:"load",value:function(o,i,a){this.prepareLoading(o,i,{},a)}},{key:"reload",value:function(o,i,a){this.prepareLoading(o,i,{reload:!0},a)}},{key:"loadOne",value:function(o){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",s=o.split("|"),l=s[0],u=s[1];this.read(l,u,"read",void 0,void 0,function(c,f){c&&i.logger.warn("".concat(a,"loading namespace ").concat(u," for language ").concat(l," failed"),c),!c&&f&&i.logger.log("".concat(a,"loaded namespace ").concat(u," for language ").concat(l),f),i.loaded(o,c,f)})}},{key:"saveMissing",value:function(o,i,a,s,l){var u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(i)){this.logger.warn('did not save key "'.concat(a,'" as the namespace "').concat(i,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}a==null||a===""||(this.backend&&this.backend.create&&this.backend.create(o,i,a,s,null,Nh(Nh({},u),{},{isUpdate:l})),!(!o||!o[0])&&this.store.addResource(o[0],i,a,s))}}]),n}(sr);function Wb(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if(Gn(t[1])==="object"&&(n=t[1]),typeof t[1]=="string"&&(n.defaultValue=t[1]),typeof t[2]=="string"&&(n.tDescription=t[2]),Gn(t[2])==="object"||Gn(t[3])==="object"){var r=t[3]||t[2];Object.keys(r).forEach(function(o){n[o]=r[o]})}return n},interpolation:{escapeValue:!0,format:function(t,n,r,o){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function Ah(e){return typeof e.ns=="string"&&(e.ns=[e.ns]),typeof e.fallbackLng=="string"&&(e.fallbackLng=[e.fallbackLng]),typeof e.fallbackNS=="string"&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Dh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function on(e){for(var t=1;t0&&arguments[0]!==void 0?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;if(jt(this,n),r=t.call(this),Il&&sr.call(Xn(r)),r.options=Ah(o),r.services={},r.logger=un,r.modules={external:[]},qb(Xn(r)),i&&!r.isInitialized&&!o.isClone){if(!r.options.initImmediate)return r.init(o,i),va(r,Xn(r));setTimeout(function(){r.init(o,i)},0)}return r}return zt(n,[{key:"init",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;typeof i=="function"&&(a=i,i={}),!i.defaultNS&&i.ns&&(typeof i.ns=="string"?i.defaultNS=i.ns:i.ns.indexOf("translation")<0&&(i.defaultNS=i.ns[0]));var s=Wb();this.options=on(on(on({},s),this.options),Ah(i)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=on(on({},s.interpolation),this.options.interpolation)),i.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=i.keySeparator),i.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=i.nsSeparator);function l(v){return v?typeof v=="function"?new v:v:null}if(!this.options.isClone){this.modules.logger?un.init(l(this.modules.logger),this.options):un.init(null,this.options);var u;this.modules.formatter?u=this.modules.formatter:typeof Intl!="undefined"&&(u=Ub);var c=new Lb(this.options);this.store=new kb(this.options.resources,this.options);var f=this.services;f.logger=un,f.resourceStore=this.store,f.languageUtils=c,f.pluralResolver=new $b(c,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(f.formatter=l(u),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Ib(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Vb(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(v){for(var d=arguments.length,m=new Array(d>1?d-1:0),S=1;S1?d-1:0),S=1;S0&&p[0]!=="dev"&&(this.options.lng=p[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var h=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];h.forEach(function(v){o[v]=function(){var d;return(d=o.store)[v].apply(d,arguments)}});var g=["addResource","addResources","addResourceBundle","removeResourceBundle"];g.forEach(function(v){o[v]=function(){var d;return(d=o.store)[v].apply(d,arguments),o}});var y=ri(),b=function(){var d=function(S,E){o.isInitialized&&!o.initializedStoreOnce&&o.logger.warn("init: i18next is already initialized. You should call init just once!"),o.isInitialized=!0,o.options.isClone||o.logger.log("initialized",o.options),o.emit("initialized",o.options),y.resolve(E),a(S,E)};if(o.languages&&o.options.compatibilityAPI!=="v1"&&!o.isInitialized)return d(null,o.t.bind(o));o.changeLanguage(o.options.lng,d)};return this.options.resources||!this.options.initImmediate?b():setTimeout(b,0),y}},{key:"loadResources",value:function(o){var i=this,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ba,s=a,l=typeof o=="string"?o:this.language;if(typeof o=="function"&&(s=o),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return s();var u=[],c=function(h){if(!!h){var g=i.services.languageUtils.toResolveHierarchy(h);g.forEach(function(y){u.indexOf(y)<0&&u.push(y)})}};if(l)c(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(p){return c(p)})}this.options.preload&&this.options.preload.forEach(function(p){return c(p)}),this.services.backendConnector.load(u,this.options.ns,function(p){!p&&!i.resolvedLanguage&&i.language&&i.setResolvedLanguage(i.language),s(p)})}else s(null)}},{key:"reloadResources",value:function(o,i,a){var s=ri();return o||(o=this.languages),i||(i=this.options.ns),a||(a=Ba),this.services.backendConnector.reload(o,i,function(l){s.resolve(),a(l)}),s}},{key:"use",value:function(o){if(!o)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!o.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return o.type==="backend"&&(this.modules.backend=o),(o.type==="logger"||o.log&&o.warn&&o.error)&&(this.modules.logger=o),o.type==="languageDetector"&&(this.modules.languageDetector=o),o.type==="i18nFormat"&&(this.modules.i18nFormat=o),o.type==="postProcessor"&&Mg.addPostProcessor(o),o.type==="formatter"&&(this.modules.formatter=o),o.type==="3rdParty"&&this.modules.external.push(o),this}},{key:"setResolvedLanguage",value:function(o){if(!(!o||!this.languages)&&!(["cimode","dev"].indexOf(o)>-1))for(var i=0;i-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;break}}}},{key:"changeLanguage",value:function(o,i){var a=this;this.isLanguageChangingTo=o;var s=ri();this.emit("languageChanging",o);var l=function(p){a.language=p,a.languages=a.services.languageUtils.toResolveHierarchy(p),a.resolvedLanguage=void 0,a.setResolvedLanguage(p)},u=function(p,h){h?(l(h),a.translator.changeLanguage(h),a.isLanguageChangingTo=void 0,a.emit("languageChanged",h),a.logger.log("languageChanged",h)):a.isLanguageChangingTo=void 0,s.resolve(function(){return a.t.apply(a,arguments)}),i&&i(p,function(){return a.t.apply(a,arguments)})},c=function(p){!o&&!p&&a.services.languageDetector&&(p=[]);var h=typeof p=="string"?p:a.services.languageUtils.getBestMatchFromCodes(p);h&&(a.language||l(h),a.translator.language||a.translator.changeLanguage(h),a.services.languageDetector&&a.services.languageDetector.cacheUserLanguage(h)),a.loadResources(h,function(g){u(g,h)})};return!o&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!o&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(c):c(o),s}},{key:"getFixedT",value:function(o,i,a){var s=this,l=function u(c,f){var p;if(Gn(f)!=="object"){for(var h=arguments.length,g=new Array(h>2?h-2:0),y=2;y1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var s=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,u=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;var c=function(h,g){var y=i.services.backendConnector.state["".concat(h,"|").concat(g)];return y===-1||y===2};if(a.precheck){var f=a.precheck(this,c);if(f!==void 0)return f}return!!(this.hasResourceBundle(s,o)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(s,o)&&(!l||c(u,o)))}},{key:"loadNamespaces",value:function(o,i){var a=this,s=ri();return this.options.ns?(typeof o=="string"&&(o=[o]),o.forEach(function(l){a.options.ns.indexOf(l)<0&&a.options.ns.push(l)}),this.loadResources(function(l){s.resolve(),i&&i(l)}),s):(i&&i(),Promise.resolve())}},{key:"loadLanguages",value:function(o,i){var a=ri();typeof o=="string"&&(o=[o]);var s=this.options.preload||[],l=o.filter(function(u){return s.indexOf(u)<0});return l.length?(this.options.preload=s.concat(l),this.loadResources(function(u){a.resolve(),i&&i(u)}),a):(i&&i(),Promise.resolve())}},{key:"dir",value:function(o){if(o||(o=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!o)return"rtl";var i=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return i.indexOf(this.services.languageUtils.getLanguagePartFromCode(o))>-1||o.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var o=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ba,s=on(on(on({},this.options),i),{isClone:!0}),l=new n(s),u=["store","services","language"];return u.forEach(function(c){l[c]=o[c]}),l.services=on({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new Oh(l.services,l.options),l.translator.on("*",function(c){for(var f=arguments.length,p=new Array(f>1?f-1:0),h=1;h0&&arguments[0]!==void 0?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new zs(e,t)});var st=zs.createInstance();st.createInstance=zs.createInstance;st.createInstance;st.init;st.loadResources;st.reloadResources;st.use;st.changeLanguage;st.getFixedT;st.t;st.exists;st.setDefaultNamespace;st.hasLoadedNamespace;st.loadNamespaces;st.loadLanguages;var $g=[],Qb=$g.forEach,Gb=$g.slice;function Xb(e){return Qb.call(Gb.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}var Mh=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Yb=function(t,n,r){var o=r||{};o.path=o.path||"/";var i=encodeURIComponent(n),a=t+"="+i;if(o.maxAge>0){var s=o.maxAge-0;if(isNaN(s))throw new Error("maxAge should be a Number");a+="; Max-Age="+Math.floor(s)}if(o.domain){if(!Mh.test(o.domain))throw new TypeError("option domain is invalid");a+="; Domain="+o.domain}if(o.path){if(!Mh.test(o.path))throw new TypeError("option path is invalid");a+="; Path="+o.path}if(o.expires){if(typeof o.expires.toUTCString!="function")throw new TypeError("option expires is invalid");a+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(a+="; HttpOnly"),o.secure&&(a+="; Secure"),o.sameSite){var l=typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite;switch(l){case!0:a+="; SameSite=Strict";break;case"lax":a+="; SameSite=Lax";break;case"strict":a+="; SameSite=Strict";break;case"none":a+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return a},$h={create:function(t,n,r,o){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};r&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+r*60*1e3)),o&&(i.domain=o),document.cookie=Yb(t,encodeURIComponent(n),i)},read:function(t){for(var n=t+"=",r=document.cookie.split(";"),o=0;o-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));for(var o=r.substring(1),i=o.split("&"),a=0;a0){var l=i[a].substring(0,s);l===t.lookupQuerystring&&(n=i[a].substring(s+1))}}}return n}},oi=null,Ih=function(){if(oi!==null)return oi;try{oi=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{oi=!1}return oi},e2={name:"localStorage",lookup:function(t){var n;if(t.lookupLocalStorage&&Ih()){var r=window.localStorage.getItem(t.lookupLocalStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupLocalStorage&&Ih()&&window.localStorage.setItem(n.lookupLocalStorage,t)}},ii=null,Fh=function(){if(ii!==null)return ii;try{ii=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{ii=!1}return ii},t2={name:"sessionStorage",lookup:function(t){var n;if(t.lookupSessionStorage&&Fh()){var r=window.sessionStorage.getItem(t.lookupSessionStorage);r&&(n=r)}return n},cacheUserLanguage:function(t,n){n.lookupSessionStorage&&Fh()&&window.sessionStorage.setItem(n.lookupSessionStorage,t)}},n2={name:"navigator",lookup:function(t){var n=[];if(typeof navigator!="undefined"){if(navigator.languages)for(var r=0;r0?n:void 0}},r2={name:"htmlTag",lookup:function(t){var n,r=t.htmlTag||(typeof document!="undefined"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},o2={name:"path",lookup:function(t){var n;if(typeof window!="undefined"){var r=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(r instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof r[t.lookupFromPathIndex]!="string")return;n=r[t.lookupFromPathIndex].replace("/","")}else n=r[0].replace("/","")}return n}},i2={name:"subdomain",lookup:function(t){var n;if(typeof window!="undefined"){var r=window.location.href.match(/(?:http[s]*\:\/\/)*(.*?)\.(?=[^\/]*\..{2,5})/gi);r instanceof Array&&(typeof t.lookupFromSubdomainIndex=="number"?n=r[t.lookupFromSubdomainIndex].replace("http://","").replace("https://","").replace(".",""):n=r[0].replace("http://","").replace("https://","").replace(".",""))}return n}};function a2(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var Ig=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};jt(this,e),this.type="languageDetector",this.detectors={},this.init(t,n)}return zt(e,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Xb(r,this.options||{},a2()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=o,this.addDetector(Zb),this.addDetector(Jb),this.addDetector(e2),this.addDetector(t2),this.addDetector(n2),this.addDetector(r2),this.addDetector(o2),this.addDetector(i2)}},{key:"addDetector",value:function(n){this.detectors[n.name]=n}},{key:"detect",value:function(n){var r=this;n||(n=this.options.order);var o=[];return n.forEach(function(i){if(r.detectors[i]){var a=r.detectors[i].lookup(r.options);a&&typeof a=="string"&&(a=[a]),a&&(o=o.concat(a))}}),this.services.languageUtils.getBestMatchFromCodes?o:o.length>0?o[0]:null}},{key:"cacheUserLanguage",value:function(n,r){var o=this;r||(r=this.options.caches),r&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(n)>-1||r.forEach(function(i){o.detectors[i]&&o.detectors[i].cacheUserLanguage(n,o.options)}))}}]),e}();Ig.type="languageDetector";function Ic(e){return Ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ic(e)}var Fg=[],s2=Fg.forEach,l2=Fg.slice;function Fc(e){return s2.call(l2.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])}),e}function Ug(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest=="undefined"?"undefined":Ic(XMLHttpRequest))==="object"}function u2(e){return!!e&&typeof e.then=="function"}function c2(e){return u2(e)?e:Promise.resolve(e)}var ys=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function f2(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function d2(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach(function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}),t}function p2(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Bs={exports:{}},Uc={exports:{}};(function(e,t){var n=typeof self!="undefined"?self:ys,r=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(a){var s={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};function l(w){return w&&DataView.prototype.isPrototypeOf(w)}if(s.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(w){return w&&u.indexOf(Object.prototype.toString.call(w))>-1};function f(w){if(typeof w!="string"&&(w=String(w)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(w))throw new TypeError("Invalid character in header field name");return w.toLowerCase()}function p(w){return typeof w!="string"&&(w=String(w)),w}function h(w){var T={next:function(){var U=w.shift();return{done:U===void 0,value:U}}};return s.iterable&&(T[Symbol.iterator]=function(){return T}),T}function g(w){this.map={},w instanceof g?w.forEach(function(T,U){this.append(U,T)},this):Array.isArray(w)?w.forEach(function(T){this.append(T[0],T[1])},this):w&&Object.getOwnPropertyNames(w).forEach(function(T){this.append(T,w[T])},this)}g.prototype.append=function(w,T){w=f(w),T=p(T);var U=this.map[w];this.map[w]=U?U+", "+T:T},g.prototype.delete=function(w){delete this.map[f(w)]},g.prototype.get=function(w){return w=f(w),this.has(w)?this.map[w]:null},g.prototype.has=function(w){return this.map.hasOwnProperty(f(w))},g.prototype.set=function(w,T){this.map[f(w)]=p(T)},g.prototype.forEach=function(w,T){for(var U in this.map)this.map.hasOwnProperty(U)&&w.call(T,this.map[U],U,this)},g.prototype.keys=function(){var w=[];return this.forEach(function(T,U){w.push(U)}),h(w)},g.prototype.values=function(){var w=[];return this.forEach(function(T){w.push(T)}),h(w)},g.prototype.entries=function(){var w=[];return this.forEach(function(T,U){w.push([U,T])}),h(w)},s.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function y(w){if(w.bodyUsed)return Promise.reject(new TypeError("Already read"));w.bodyUsed=!0}function b(w){return new Promise(function(T,U){w.onload=function(){T(w.result)},w.onerror=function(){U(w.error)}})}function v(w){var T=new FileReader,U=b(T);return T.readAsArrayBuffer(w),U}function d(w){var T=new FileReader,U=b(T);return T.readAsText(w),U}function m(w){for(var T=new Uint8Array(w),U=new Array(T.length),k=0;k-1?T:w}function P(w,T){T=T||{};var U=T.body;if(w instanceof P){if(w.bodyUsed)throw new TypeError("Already read");this.url=w.url,this.credentials=w.credentials,T.headers||(this.headers=new g(w.headers)),this.method=w.method,this.mode=w.mode,this.signal=w.signal,!U&&w._bodyInit!=null&&(U=w._bodyInit,w.bodyUsed=!0)}else this.url=String(w);if(this.credentials=T.credentials||this.credentials||"same-origin",(T.headers||!this.headers)&&(this.headers=new g(T.headers)),this.method=A(T.method||this.method||"GET"),this.mode=T.mode||this.mode||null,this.signal=T.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&U)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(U)}P.prototype.clone=function(){return new P(this,{body:this._bodyInit})};function I(w){var T=new FormData;return w.trim().split("&").forEach(function(U){if(U){var k=U.split("="),L=k.shift().replace(/\+/g," "),M=k.join("=").replace(/\+/g," ");T.append(decodeURIComponent(L),decodeURIComponent(M))}}),T}function D(w){var T=new g,U=w.replace(/\r?\n[\t ]+/g," ");return U.split(/\r?\n/).forEach(function(k){var L=k.split(":"),M=L.shift().trim();if(M){var $=L.join(":").trim();T.append(M,$)}}),T}E.call(P.prototype);function W(w,T){T||(T={}),this.type="default",this.status=T.status===void 0?200:T.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in T?T.statusText:"OK",this.headers=new g(T.headers),this.url=T.url||"",this._initBody(w)}E.call(W.prototype),W.prototype.clone=function(){return new W(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},W.error=function(){var w=new W(null,{status:0,statusText:""});return w.type="error",w};var J=[301,302,303,307,308];W.redirect=function(w,T){if(J.indexOf(T)===-1)throw new RangeError("Invalid status code");return new W(null,{status:T,headers:{location:w}})},a.DOMException=i.DOMException;try{new a.DOMException}catch{a.DOMException=function(T,U){this.message=T,this.name=U;var k=Error(T);this.stack=k.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function X(w,T){return new Promise(function(U,k){var L=new P(w,T);if(L.signal&&L.signal.aborted)return k(new a.DOMException("Aborted","AbortError"));var M=new XMLHttpRequest;function $(){M.abort()}M.onload=function(){var F={status:M.status,statusText:M.statusText,headers:D(M.getAllResponseHeaders()||"")};F.url="responseURL"in M?M.responseURL:F.headers.get("X-Request-URL");var _="response"in M?M.response:M.responseText;U(new W(_,F))},M.onerror=function(){k(new TypeError("Network request failed"))},M.ontimeout=function(){k(new TypeError("Network request failed"))},M.onabort=function(){k(new a.DOMException("Aborted","AbortError"))},M.open(L.method,L.url,!0),L.credentials==="include"?M.withCredentials=!0:L.credentials==="omit"&&(M.withCredentials=!1),"responseType"in M&&s.blob&&(M.responseType="blob"),L.headers.forEach(function(F,_){M.setRequestHeader(_,F)}),L.signal&&(L.signal.addEventListener("abort",$),M.onreadystatechange=function(){M.readyState===4&&L.signal.removeEventListener("abort",$)}),M.send(typeof L._bodyInit=="undefined"?null:L._bodyInit)})}return X.polyfill=!0,i.fetch||(i.fetch=X,i.Headers=g,i.Request=P,i.Response=W),a.Headers=g,a.Request=P,a.Response=W,a.fetch=X,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;t=o.fetch,t.default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t})(Uc,Uc.exports);(function(e,t){var n;if(typeof fetch=="function"&&(typeof ys!="undefined"&&ys.fetch?n=ys.fetch:typeof window!="undefined"&&window.fetch&&(n=window.fetch)),typeof p2!="undefined"&&(typeof window=="undefined"||typeof window.document=="undefined")){var r=n||Uc.exports;r.default&&(r=r.default),t.default=r,e.exports=t.default}})(Bs,Bs.exports);var jg=Bs.exports,Uh=Pg({__proto__:null,default:jg},[Bs.exports]);function Vs(e){return Vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vs(e)}var lr;typeof fetch=="function"&&(typeof global!="undefined"&&global.fetch?lr=global.fetch:typeof window!="undefined"&&window.fetch&&(lr=window.fetch));var Vi;Ug()&&(typeof global!="undefined"&&global.XMLHttpRequest?Vi=global.XMLHttpRequest:typeof window!="undefined"&&window.XMLHttpRequest&&(Vi=window.XMLHttpRequest));var Ws;typeof ActiveXObject=="function"&&(typeof global!="undefined"&&global.ActiveXObject?Ws=global.ActiveXObject:typeof window!="undefined"&&window.ActiveXObject&&(Ws=window.ActiveXObject));!lr&&Uh&&!Vi&&!Ws&&(lr=jg||Uh);typeof lr!="function"&&(lr=void 0);var jc=function(t,n){if(n&&Vs(n)==="object"){var r="";for(var o in n)r+="&"+encodeURIComponent(o)+"="+encodeURIComponent(n[o]);if(!r)return t;t=t+(t.indexOf("?")!==-1?"&":"?")+r.slice(1)}return t},h2=function(t,n,r,o){t.queryStringParams&&(n=jc(n,t.queryStringParams));var i=Fc({},typeof t.customHeaders=="function"?t.customHeaders():t.customHeaders);r&&(i["Content-Type"]="application/json"),lr(n,Fc({method:r?"POST":"GET",body:r?t.stringify(r):void 0,headers:i},typeof t.requestOptions=="function"?t.requestOptions(r):t.requestOptions)).then(function(a){if(!a.ok)return o(a.statusText||"Error",{status:a.status});a.text().then(function(s){o(null,{status:a.status,data:s})}).catch(o)}).catch(o)},v2=function(t,n,r,o){r&&Vs(r)==="object"&&(r=jc("",r).slice(1)),t.queryStringParams&&(n=jc(n,t.queryStringParams));try{var i;Vi?i=new Vi:i=new Ws("MSXML2.XMLHTTP.3.0"),i.open(r?"POST":"GET",n,1),t.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!t.withCredentials,r&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var a=t.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)i.setRequestHeader(s,a[s]);i.onreadystatechange=function(){i.readyState>3&&o(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(r)}catch(l){console&&console.log(l)}},m2=function(t,n,r,o){if(typeof r=="function"&&(o=r,r=void 0),o=o||function(){},lr)return h2(t,n,r,o);if(Ug()||typeof ActiveXObject=="function")return v2(t,n,r,o)};function g2(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function jh(e,t){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};g2(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}return y2(e,[{key:"init",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=n,this.options=Fc(o,this.options||{},S2()),this.allOptions=i,this.services&&this.options.reloadInterval&&setInterval(function(){return r.reload()},this.options.reloadInterval)}},{key:"readMulti",value:function(n,r,o){this._readAny(n,n,r,r,o)}},{key:"read",value:function(n,r,o){this._readAny([n],n,[r],r,o)}},{key:"_readAny",value:function(n,r,o,i,a){var s=this,l=this.options.loadPath;typeof this.options.loadPath=="function"&&(l=this.options.loadPath(n,o)),l=c2(l),l.then(function(u){if(!u)return a(null,{});var c=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:o.join("+")});s.loadUrl(c,a,r,i)})}},{key:"loadUrl",value:function(n,r,o,i){var a=this;this.options.request(this.options,n,void 0,function(s,l){if(l&&(l.status>=500&&l.status<600||!l.status))return r("failed loading "+n+"; status code: "+l.status,!0);if(l&&l.status>=400&&l.status<500)return r("failed loading "+n+"; status code: "+l.status,!1);if(!l&&s&&s.message&&s.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+s.message,!0);if(s)return r(s,!1);var u,c;try{typeof l.data=="string"?u=a.options.parse(l.data,o,i):u=l.data}catch{c="failed parsing "+n+" to json"}if(c)return r(c,!1);r(null,u)})}},{key:"create",value:function(n,r,o,i,a){var s=this;if(!!this.options.addPath){typeof n=="string"&&(n=[n]);var l=this.options.parsePayload(r,o,i),u=0,c=[],f=[];n.forEach(function(p){var h=s.options.addPath;typeof s.options.addPath=="function"&&(h=s.options.addPath(p,r));var g=s.services.interpolator.interpolate(h,{lng:p,ns:r});s.options.request(s.options,g,l,function(y,b){u+=1,c.push(y),f.push(b),u===n.length&&a&&a(c,f)})})}}},{key:"reload",value:function(){var n=this,r=this.services,o=r.backendConnector,i=r.languageUtils,a=r.logger,s=o.language;if(!(s&&s.toLowerCase()==="cimode")){var l=[],u=function(f){var p=i.toResolveHierarchy(f);p.forEach(function(h){l.indexOf(h)<0&&l.push(h)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(c){return u(c)}),l.forEach(function(c){n.allOptions.ns.forEach(function(f){o.read(c,f,"read",null,null,function(p,h){p&&a.warn("loading namespace ".concat(f," for language ").concat(c," failed"),p),!p&&h&&a.log("loaded namespace ".concat(f," for language ").concat(c),h),o.loaded("".concat(c,"|").concat(f),p,h)})})})}}}]),e}();zg.type="backend";var R={exports:{}},he={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var ma=Symbol.for("react.element"),b2=Symbol.for("react.portal"),_2=Symbol.for("react.fragment"),x2=Symbol.for("react.strict_mode"),E2=Symbol.for("react.profiler"),C2=Symbol.for("react.provider"),R2=Symbol.for("react.context"),O2=Symbol.for("react.forward_ref"),k2=Symbol.for("react.suspense"),P2=Symbol.for("react.memo"),T2=Symbol.for("react.lazy"),zh=Symbol.iterator;function L2(e){return e===null||typeof e!="object"?null:(e=zh&&e[zh]||e["@@iterator"],typeof e=="function"?e:null)}var Bg={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Vg=Object.assign,Wg={};function Ho(e,t,n){this.props=e,this.context=t,this.refs=Wg,this.updater=n||Bg}Ho.prototype.isReactComponent={};Ho.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ho.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Hg(){}Hg.prototype=Ho.prototype;function vd(e,t,n){this.props=e,this.context=t,this.refs=Wg,this.updater=n||Bg}var md=vd.prototype=new Hg;md.constructor=vd;Vg(md,Ho.prototype);md.isPureReactComponent=!0;var Bh=Array.isArray,Kg=Object.prototype.hasOwnProperty,gd={current:null},qg={key:!0,ref:!0,__self:!0,__source:!0};function Qg(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)Kg.call(t,r)&&!qg.hasOwnProperty(r)&&(o[r]=t[r]);var s=arguments.length-2;if(s===1)o.children=n;else if(10&&arguments[0]!==void 0?arguments[0]:{};zc=Hh(Hh({},zc),e)}function F2(){return zc}var U2=function(){function e(){jt(this,e),this.usedNamespaces={}}return zt(e,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(o){r.usedNamespaces[o]||(r.usedNamespaces[o]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function j2(e){Gg=e}function z2(){return Gg}var B2={type:"3rdParty",init:function(t){I2(t.options.react),j2(t)}};function V2(){if(console&&console.warn){for(var e,t=arguments.length,n=new Array(t),r=0;r2&&arguments[2]!==void 0?arguments[2]:{},r=t.languages[0],o=t.options?t.options.fallbackLng:!1,i=t.languages[t.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(l,u){var c=t.services.backendConnector.state["".concat(l,"|").concat(u)];return c===-1||c===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!a(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(r,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||a(r,e)&&(!o||a(i,e)))}function H2(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Bc("i18n.languages were undefined or empty",t.languages),!0;var r=t.options.ignoreJSONStructure!==void 0;return r?t.hasLoadedNamespace(e,{precheck:function(i,a){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!a(i.isLanguageChangingTo,e))return!1}}):W2(e,t,n)}function K2(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,a,s;try{for(n=n.call(e);!(o=(a=n.next()).done)&&(r.push(a.value),!(t&&r.length===t));o=!0);}catch(l){i=!0,s=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw s}}return r}}function q2(e,t){return Tg(e)||K2(e,t)||Lg(e,t)||Ng()}function Qh(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Vu(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{},n=t.i18n,r=R.exports.useContext($2)||{},o=r.i18n,i=r.defaultNS,a=n||o||z2();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new U2),!a){Bc("You will need to pass in an i18next instance by using initReactI18next");var s=function(I){return Array.isArray(I)?I[I.length-1]:I},l=[s,{},!1];return l.t=s,l.i18n={},l.ready=!1,l}a.options.react&&a.options.react.wait!==void 0&&Bc("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var u=Vu(Vu(Vu({},F2()),a.options.react),t),c=u.useSuspense,f=u.keyPrefix,p=e||i||a.options&&a.options.defaultNS;p=typeof p=="string"?[p]:p||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(p);var h=(a.isInitialized||a.initializedStoreOnce)&&p.every(function(P){return H2(P,a,u)});function g(){return a.getFixedT(null,u.nsMode==="fallback"?p:p[0],f)}var y=R.exports.useState(g),b=q2(y,2),v=b[0],d=b[1],m=p.join(),S=Q2(m),E=R.exports.useRef(!0);R.exports.useEffect(function(){var P=u.bindI18n,I=u.bindI18nStore;E.current=!0,!h&&!c&&qh(a,p,function(){E.current&&d(g)}),h&&S&&S!==m&&E.current&&d(g);function D(){E.current&&d(g)}return P&&a&&a.on(P,D),I&&a&&a.store.on(I,D),function(){E.current=!1,P&&a&&P.split(" ").forEach(function(W){return a.off(W,D)}),I&&a&&I.split(" ").forEach(function(W){return a.store.off(W,D)})}},[a,m]);var O=R.exports.useRef(!0);R.exports.useEffect(function(){E.current&&!O.current&&d(g),O.current=!1},[a]);var A=[v,a,h];if(A.t=v,A.i18n=a,A.ready=h,h||!h&&!c)return A;throw new Promise(function(P){qh(a,p,function(){P()})})}const Gh={zh:Rn(()=>import("./zh.9b79b7bf.js"),[]),en:Rn(()=>import("./en.fb34eaf7.js"),[])};st.use(zg).use(B2).use(Ig).init({debug:!1,backend:{loadPath:"/__{{lng}}/{{ns}}.json",request:function(e,t,n,r){let o;switch(t){case"/__zh/translation.json":case"/__zh-CN/translation.json":o=Gh.zh;break;case"/__en/translation.json":default:o=Gh.en;break}o&&o.then(i=>{r(null,{status:200,data:i.data})})}},supportedLngs:["en","zh"],fallbackLng:"en",interpolation:{escapeValue:!1}});var ya={exports:{}},Ot={},Xg={exports:{}},Yg={};/** - * @license React - * scheduler.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */(function(e){function t(L,M){var $=L.length;L.push(M);e:for(;0<$;){var F=$-1>>>1,_=L[F];if(0>>1;Fo(ee,$))H<_&&0>o(ne,ee)?(L[F]=ne,L[H]=$,F=H):(L[F]=ee,L[B]=$,F=B);else if(H<_&&0>o(ne,$))L[F]=ne,L[H]=$,F=H;else break e}}return M}function o(L,M){var $=L.sortIndex-M.sortIndex;return $!==0?$:L.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,f=null,p=3,h=!1,g=!1,y=!1,b=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate!="undefined"?setImmediate:null;typeof navigator!="undefined"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(L){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=L)r(u),M.sortIndex=M.expirationTime,t(l,M);else break;M=n(u)}}function S(L){if(y=!1,m(L),!g)if(n(l)!==null)g=!0,U(E);else{var M=n(u);M!==null&&k(S,M.startTime-L)}}function E(L,M){g=!1,y&&(y=!1,v(P),P=-1),h=!0;var $=p;try{for(m(M),f=n(l);f!==null&&(!(f.expirationTime>M)||L&&!W());){var F=f.callback;if(typeof F=="function"){f.callback=null,p=f.priorityLevel;var _=F(f.expirationTime<=M);M=e.unstable_now(),typeof _=="function"?f.callback=_:f===n(l)&&r(l),m(M)}else r(l);f=n(l)}if(f!==null)var V=!0;else{var B=n(u);B!==null&&k(S,B.startTime-M),V=!1}return V}finally{f=null,p=$,h=!1}}var O=!1,A=null,P=-1,I=5,D=-1;function W(){return!(e.unstable_now()-DL||125F?(L.sortIndex=$,t(u,L),n(l)===null&&L===n(u)&&(y?(v(P),P=-1):y=!0,k(S,$-F))):(L.sortIndex=_,t(l,L),g||h||(g=!0,U(E))),L},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(L){var M=p;return function(){var $=p;p=M;try{return L.apply(this,arguments)}finally{p=$}}}})(Yg);Xg.exports=Yg;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Zg=R.exports,Et=Xg.exports;function z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;nt}return!1}function ut(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Xe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Xe[e]=new ut(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Xe[t]=new ut(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Xe[e]=new ut(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Xe[e]=new ut(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Xe[e]=new ut(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Xe[e]=new ut(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Xe[e]=new ut(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Xe[e]=new ut(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Xe[e]=new ut(e,5,!1,e.toLowerCase(),null,!1,!1)});var wd=/[\-:]([a-z])/g;function Sd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(wd,Sd);Xe[t]=new ut(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(wd,Sd);Xe[t]=new ut(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(wd,Sd);Xe[t]=new ut(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Xe[e]=new ut(e,1,!1,e.toLowerCase(),null,!1,!1)});Xe.xlinkHref=new ut("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Xe[e]=new ut(e,1,!1,e.toLowerCase(),null,!0,!0)});function bd(e,t,n,r){var o=Xe.hasOwnProperty(t)?Xe[t]:null;(o!==null?o.type!==0:r||!(2s||o[a]!==i[s]){var l=` -`+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{Hu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Si(e):""}function J2(e){switch(e.tag){case 5:return Si(e.type);case 16:return Si("Lazy");case 13:return Si("Suspense");case 19:return Si("SuspenseList");case 0:case 2:case 15:return e=Ku(e.type,!1),e;case 11:return e=Ku(e.type.render,!1),e;case 1:return e=Ku(e.type,!0),e;default:return""}}function qc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case lo:return"Fragment";case so:return"Portal";case Wc:return"Profiler";case _d:return"StrictMode";case Hc:return"Suspense";case Kc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ty:return(e.displayName||"Context")+".Consumer";case ey:return(e._context.displayName||"Context")+".Provider";case xd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ed:return t=e.displayName||null,t!==null?t:qc(e.type)||"Memo";case In:t=e._payload,e=e._init;try{return qc(e(t))}catch{}}return null}function e_(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return qc(t);case 8:return t===_d?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ur(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ry(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function t_(e){var t=ry(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n!="undefined"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ha(e){e._valueTracker||(e._valueTracker=t_(e))}function oy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ry(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Hs(e){if(e=e||(typeof document!="undefined"?document:void 0),typeof e=="undefined")return null;try{return e.activeElement||e.body}catch{return e.body}}function Qc(e,t){var n=t.checked;return $e({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n!=null?n:e._wrapperState.initialChecked})}function Jh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ur(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function iy(e,t){t=t.checked,t!=null&&bd(e,"checked",t,!1)}function Gc(e,t){iy(e,t);var n=ur(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Xc(e,t.type,n):t.hasOwnProperty("defaultValue")&&Xc(e,t.type,ur(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ev(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Xc(e,t,n){(t!=="number"||Hs(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var bi=Array.isArray;function _o(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ka.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Oi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},n_=["Webkit","ms","Moz","O"];Object.keys(Oi).forEach(function(e){n_.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Oi[t]=Oi[e]})});function uy(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Oi.hasOwnProperty(e)&&Oi[e]?(""+t).trim():t+"px"}function cy(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=uy(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var r_=$e({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Jc(e,t){if(t){if(r_[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function ef(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tf=null;function Cd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nf=null,xo=null,Eo=null;function rv(e){if(e=ba(e)){if(typeof nf!="function")throw Error(z(280));var t=e.stateNode;t&&(t=Bl(t),nf(e.stateNode,e.type,t))}}function fy(e){xo?Eo?Eo.push(e):Eo=[e]:xo=e}function dy(){if(xo){var e=xo,t=Eo;if(Eo=xo=null,rv(e),t)for(e=0;e>>=0,e===0?32:31-(h_(e)/v_|0)|0}var qa=64,Qa=4194304;function _i(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Gs(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var s=a&~o;s!==0?r=_i(s):(i&=a,i!==0&&(r=_i(i)))}else a=n&~o,a!==0?r=_i(a):i!==0&&(r=_i(i));if(r===0)return 0;if(t!==0&&t!==r&&(t&o)===0&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if((r&4)!==0&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function wa(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Zt(t),e[t]=n}function w_(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Pi),dv=String.fromCharCode(32),pv=!1;function Ny(e,t){switch(e){case"keyup":return q_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ay(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var uo=!1;function G_(e,t){switch(e){case"compositionend":return Ay(t);case"keypress":return t.which!==32?null:(pv=!0,dv);case"textInput":return e=t.data,e===dv&&pv?null:e;default:return null}}function X_(e,t){if(uo)return e==="compositionend"||!Ad&&Ny(e,t)?(e=Ty(),_s=Td=Wn=null,uo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=gv(n)}}function Iy(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Iy(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Fy(){for(var e=window,t=Hs();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Hs(e.document)}return t}function Dd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ix(e){var t=Fy(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Iy(n.ownerDocument.documentElement,n)){if(r!==null&&Dd(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=yv(n,i);var a=yv(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,co=null,uf=null,Li=null,cf=!1;function wv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cf||co==null||co!==Hs(r)||(r=co,"selectionStart"in r&&Dd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Li&&Yi(Li,r)||(Li=r,r=Zs(uf,"onSelect"),0ho||(e.current=mf[ho],mf[ho]=null,ho--)}function Ce(e,t){ho++,mf[ho]=e.current,e.current=t}var cr={},rt=wr(cr),ht=wr(!1),jr=cr;function Lo(e,t){var n=e.type.contextTypes;if(!n)return cr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function vt(e){return e=e.childContextTypes,e!=null}function el(){Oe(ht),Oe(rt)}function Rv(e,t,n){if(rt.current!==cr)throw Error(z(168));Ce(rt,t),Ce(ht,n)}function qy(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(z(108,e_(e)||"Unknown",o));return $e({},n,r)}function tl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||cr,jr=rt.current,Ce(rt,e),Ce(ht,ht.current),!0}function Ov(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=qy(e,t,jr),r.__reactInternalMemoizedMergedChildContext=e,Oe(ht),Oe(rt),Ce(rt,e)):Oe(ht),Ce(ht,n)}var bn=null,Vl=!1,ac=!1;function Qy(e){bn===null?bn=[e]:bn.push(e)}function gx(e){Vl=!0,Qy(e)}function Sr(){if(!ac&&bn!==null){ac=!0;var e=0,t=be;try{var n=bn;for(be=1;e>=a,o-=a,_n=1<<32-Zt(t)+o|n<P?(I=A,A=null):I=A.sibling;var D=p(v,A,m[P],S);if(D===null){A===null&&(A=I);break}e&&A&&D.alternate===null&&t(v,A),d=i(D,d,P),O===null?E=D:O.sibling=D,O=D,A=I}if(P===m.length)return n(v,A),Pe&&Or(v,P),E;if(A===null){for(;PP?(I=A,A=null):I=A.sibling;var W=p(v,A,D.value,S);if(W===null){A===null&&(A=I);break}e&&A&&W.alternate===null&&t(v,A),d=i(W,d,P),O===null?E=W:O.sibling=W,O=W,A=I}if(D.done)return n(v,A),Pe&&Or(v,P),E;if(A===null){for(;!D.done;P++,D=m.next())D=f(v,D.value,S),D!==null&&(d=i(D,d,P),O===null?E=D:O.sibling=D,O=D);return Pe&&Or(v,P),E}for(A=r(v,A);!D.done;P++,D=m.next())D=h(A,v,P,D.value,S),D!==null&&(e&&D.alternate!==null&&A.delete(D.key===null?P:D.key),d=i(D,d,P),O===null?E=D:O.sibling=D,O=D);return e&&A.forEach(function(J){return t(v,J)}),Pe&&Or(v,P),E}function b(v,d,m,S){if(typeof m=="object"&&m!==null&&m.type===lo&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case Wa:e:{for(var E=m.key,O=d;O!==null;){if(O.key===E){if(E=m.type,E===lo){if(O.tag===7){n(v,O.sibling),d=o(O,m.props.children),d.return=v,v=d;break e}}else if(O.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===In&&Dv(E)===O.type){n(v,O.sibling),d=o(O,m.props),d.ref=fi(v,O,m),d.return=v,v=d;break e}n(v,O);break}else t(v,O);O=O.sibling}m.type===lo?(d=Fr(m.props.children,v.mode,S,m.key),d.return=v,v=d):(S=Ts(m.type,m.key,m.props,null,v.mode,S),S.ref=fi(v,d,m),S.return=v,v=S)}return a(v);case so:e:{for(O=m.key;d!==null;){if(d.key===O)if(d.tag===4&&d.stateNode.containerInfo===m.containerInfo&&d.stateNode.implementation===m.implementation){n(v,d.sibling),d=o(d,m.children||[]),d.return=v,v=d;break e}else{n(v,d);break}else t(v,d);d=d.sibling}d=hc(m,v.mode,S),d.return=v,v=d}return a(v);case In:return O=m._init,b(v,d,O(m._payload),S)}if(bi(m))return g(v,d,m,S);if(ai(m))return y(v,d,m,S);ts(v,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,d!==null&&d.tag===6?(n(v,d.sibling),d=o(d,m),d.return=v,v=d):(n(v,d),d=pc(m,v.mode,S),d.return=v,v=d),a(v)):n(v,d)}return b}var Ao=n0(!0),r0=n0(!1),_a={},fn=wr(_a),ta=wr(_a),na=wr(_a);function Dr(e){if(e===_a)throw Error(z(174));return e}function Vd(e,t){switch(Ce(na,t),Ce(ta,e),Ce(fn,_a),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Zc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Zc(t,e)}Oe(fn),Ce(fn,t)}function Do(){Oe(fn),Oe(ta),Oe(na)}function o0(e){Dr(na.current);var t=Dr(fn.current),n=Zc(t,e.type);t!==n&&(Ce(ta,e),Ce(fn,n))}function Wd(e){ta.current===e&&(Oe(fn),Oe(ta))}var De=wr(0);function sl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var sc=[];function Hd(){for(var e=0;en?n:4,e(!0);var r=lc.transition;lc.transition={};try{e(!1),t()}finally{be=n,lc.transition=r}}function S0(){return Ut().memoizedState}function bx(e,t,n){var r=rr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},b0(e))_0(t,n);else if(n=Zy(e,t,n,r),n!==null){var o=at();Jt(n,e,r,o),x0(n,t,r)}}function _x(e,t,n){var r=rr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(b0(e))_0(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,s=i(a,n);if(o.hasEagerState=!0,o.eagerState=s,tn(s,a)){var l=t.interleaved;l===null?(o.next=o,zd(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=Zy(e,t,o,r),n!==null&&(o=at(),Jt(n,e,r,o),x0(n,t,r))}}function b0(e){var t=e.alternate;return e===Me||t!==null&&t===Me}function _0(e,t){Ni=ll=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function x0(e,t,n){if((n&4194240)!==0){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Od(e,n)}}var ul={readContext:Ft,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useInsertionEffect:Ye,useLayoutEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useMutableSource:Ye,useSyncExternalStore:Ye,useId:Ye,unstable_isNewReconciler:!1},xx={readContext:Ft,useCallback:function(e,t){return sn().memoizedState=[e,t===void 0?null:t],e},useContext:Ft,useEffect:$v,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Rs(4194308,4,v0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rs(4194308,4,e,t)},useInsertionEffect:function(e,t){return Rs(4,2,e,t)},useMemo:function(e,t){var n=sn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=sn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=bx.bind(null,Me,e),[r.memoizedState,e]},useRef:function(e){var t=sn();return e={current:e},t.memoizedState=e},useState:Mv,useDebugValue:Xd,useDeferredValue:function(e){return sn().memoizedState=e},useTransition:function(){var e=Mv(!1),t=e[0];return e=Sx.bind(null,e[1]),sn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Me,o=sn();if(Pe){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),Ke===null)throw Error(z(349));(Br&30)!==0||s0(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,$v(u0.bind(null,r,i,e),[e]),r.flags|=2048,ia(9,l0.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=sn(),t=Ke.identifierPrefix;if(Pe){var n=xn,r=_n;n=(r&~(1<<32-Zt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ra++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[ln]=t,e[ea]=r,N0(e,t,!1,!1),t.stateNode=e;e:{switch(a=ef(n,r),n){case"dialog":Re("cancel",e),Re("close",e),o=r;break;case"iframe":case"object":case"embed":Re("load",e),o=r;break;case"video":case"audio":for(o=0;o$o&&(t.flags|=128,r=!0,di(i,!1),t.lanes=4194304)}else{if(!r)if(e=sl(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),di(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Pe)return Ze(t),null}else 2*je()-i.renderingStartTime>$o&&n!==1073741824&&(t.flags|=128,r=!0,di(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=je(),t.sibling=null,n=De.current,Ce(De,r?n&1|2:n&1),t):(Ze(t),null);case 22:case 23:return np(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&(t.mode&1)!==0?(bt&1073741824)!==0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function Lx(e,t){switch($d(t),t.tag){case 1:return vt(t.type)&&el(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Do(),Oe(ht),Oe(rt),Hd(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return Wd(t),null;case 13:if(Oe(De),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));No()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Oe(De),null;case 4:return Do(),null;case 10:return jd(t.type._context),null;case 22:case 23:return np(),null;case 24:return null;default:return null}}var rs=!1,nt=!1,Nx=typeof WeakSet=="function"?WeakSet:Set,Q=null;function yo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ie(e,t,r)}else n.current=null}function kf(e,t,n){try{n()}catch(r){Ie(e,t,r)}}var Hv=!1;function Ax(e,t){if(ff=Xs,e=Fy(),Dd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,s=-1,l=-1,u=0,c=0,f=e,p=null;t:for(;;){for(var h;f!==n||o!==0&&f.nodeType!==3||(s=a+o),f!==i||r!==0&&f.nodeType!==3||(l=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===n&&++u===o&&(s=a),p===i&&++c===r&&(l=a),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(df={focusedElem:e,selectionRange:n},Xs=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var g=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,b=g.memoizedState,v=t.stateNode,d=v.getSnapshotBeforeUpdate(t.elementType===t.type?y:Kt(t.type,y),b);v.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(S){Ie(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return g=Hv,Hv=!1,g}function Ai(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&kf(t,n,i)}o=o.next}while(o!==r)}}function Kl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Pf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function M0(e){var t=e.alternate;t!==null&&(e.alternate=null,M0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ln],delete t[ea],delete t[vf],delete t[vx],delete t[mx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function $0(e){return e.tag===5||e.tag===3||e.tag===4}function Kv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||$0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Tf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Js));else if(r!==4&&(e=e.child,e!==null))for(Tf(e,t,n),e=e.sibling;e!==null;)Tf(e,t,n),e=e.sibling}function Lf(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Lf(e,t,n),e=e.sibling;e!==null;)Lf(e,t,n),e=e.sibling}var Qe=null,Gt=!1;function Mn(e,t,n){for(n=n.child;n!==null;)I0(e,t,n),n=n.sibling}function I0(e,t,n){if(cn&&typeof cn.onCommitFiberUnmount=="function")try{cn.onCommitFiberUnmount(Fl,n)}catch{}switch(n.tag){case 5:nt||yo(n,t);case 6:var r=Qe,o=Gt;Qe=null,Mn(e,t,n),Qe=r,Gt=o,Qe!==null&&(Gt?(e=Qe,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Qe.removeChild(n.stateNode));break;case 18:Qe!==null&&(Gt?(e=Qe,n=n.stateNode,e.nodeType===8?ic(e.parentNode,n):e.nodeType===1&&ic(e,n),Gi(e)):ic(Qe,n.stateNode));break;case 4:r=Qe,o=Gt,Qe=n.stateNode.containerInfo,Gt=!0,Mn(e,t,n),Qe=r,Gt=o;break;case 0:case 11:case 14:case 15:if(!nt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&((i&2)!==0||(i&4)!==0)&&kf(n,t,a),o=o.next}while(o!==r)}Mn(e,t,n);break;case 1:if(!nt&&(yo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){Ie(n,t,s)}Mn(e,t,n);break;case 21:Mn(e,t,n);break;case 22:n.mode&1?(nt=(r=nt)||n.memoizedState!==null,Mn(e,t,n),nt=r):Mn(e,t,n);break;default:Mn(e,t,n)}}function qv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Nx),t.forEach(function(r){var o=Bx.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Wt(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=a),r&=~i}if(r=o,r=je()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Mx(r/1960))-r,10e?16:e,Hn===null)var r=!1;else{if(e=Hn,Hn=null,dl=0,(me&6)!==0)throw Error(z(331));var o=me;for(me|=4,Q=e.current;Q!==null;){var i=Q,a=i.child;if((Q.flags&16)!==0){var s=i.deletions;if(s!==null){for(var l=0;lje()-ep?Ir(e,0):Jd|=n),mt(e,t)}function H0(e,t){t===0&&((e.mode&1)===0?t=1:(t=Qa,Qa<<=1,(Qa&130023424)===0&&(Qa=4194304)));var n=at();e=Pn(e,t),e!==null&&(wa(e,t,n),mt(e,n))}function zx(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),H0(e,n)}function Bx(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),H0(e,n)}var K0;K0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ht.current)pt=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return pt=!1,Px(e,t,n);pt=(e.flags&131072)!==0}else pt=!1,Pe&&(t.flags&1048576)!==0&&Gy(t,rl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Os(e,t),e=t.pendingProps;var o=Lo(t,rt.current);Ro(t,n),o=qd(null,t,r,e,o,n);var i=Qd();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,vt(r)?(i=!0,tl(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Bd(t),o.updater=Wl,t.stateNode=o,o._reactInternals=t,bf(t,r,e,n),t=Ef(null,t,r,!0,i,n)):(t.tag=0,Pe&&i&&Md(t),it(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Os(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Wx(r),e=Kt(r,e),o){case 0:t=xf(null,t,r,e,n);break e;case 1:t=Bv(null,t,r,e,n);break e;case 11:t=jv(null,t,r,e,n);break e;case 14:t=zv(null,t,r,Kt(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Kt(r,o),xf(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Kt(r,o),Bv(e,t,r,o,n);case 3:e:{if(P0(t),e===null)throw Error(z(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Jy(e,t),al(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Mo(Error(z(423)),t),t=Vv(e,t,r,n,o);break e}else if(r!==o){o=Mo(Error(z(424)),t),t=Vv(e,t,r,n,o);break e}else for(_t=er(t.stateNode.containerInfo.firstChild),xt=t,Pe=!0,Xt=null,n=r0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(No(),r===o){t=Tn(e,t,n);break e}it(e,t,r,n)}t=t.child}return t;case 5:return o0(t),e===null&&yf(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,pf(r,o)?a=null:i!==null&&pf(r,i)&&(t.flags|=32),k0(e,t),it(e,t,a,n),t.child;case 6:return e===null&&yf(t),null;case 13:return T0(e,t,n);case 4:return Vd(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ao(t,null,r,n):it(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Kt(r,o),jv(e,t,r,o,n);case 7:return it(e,t,t.pendingProps,n),t.child;case 8:return it(e,t,t.pendingProps.children,n),t.child;case 12:return it(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,Ce(ol,r._currentValue),r._currentValue=a,i!==null)if(tn(i.value,a)){if(i.children===o.children&&!ht.current){t=Tn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){a=i.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Cn(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),wf(i.return,n,t),s.lanes|=n;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(z(341));a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),wf(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}it(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Ro(t,n),o=Ft(o),r=r(o),t.flags|=1,it(e,t,r,n),t.child;case 14:return r=t.type,o=Kt(r,t.pendingProps),o=Kt(r.type,o),zv(e,t,r,o,n);case 15:return R0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Kt(r,o),Os(e,t),t.tag=1,vt(r)?(e=!0,tl(t)):e=!1,Ro(t,n),t0(t,r,o),bf(t,r,o,n),Ef(null,t,r,!0,e,n);case 19:return L0(e,t,n);case 22:return O0(e,t,n)}throw Error(z(156,t.tag))};function q0(e,t){return wy(e,t)}function Vx(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mt(e,t,n,r){return new Vx(e,t,n,r)}function op(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wx(e){if(typeof e=="function")return op(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xd)return 11;if(e===Ed)return 14}return 2}function or(e,t){var n=e.alternate;return n===null?(n=Mt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ts(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")op(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case lo:return Fr(n.children,o,i,t);case _d:a=8,o|=8;break;case Wc:return e=Mt(12,n,t,o|2),e.elementType=Wc,e.lanes=i,e;case Hc:return e=Mt(13,n,t,o),e.elementType=Hc,e.lanes=i,e;case Kc:return e=Mt(19,n,t,o),e.elementType=Kc,e.lanes=i,e;case ny:return Ql(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ey:a=10;break e;case ty:a=9;break e;case xd:a=11;break e;case Ed:a=14;break e;case In:a=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Mt(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Fr(e,t,n,r){return e=Mt(7,e,r,t),e.lanes=n,e}function Ql(e,t,n,r){return e=Mt(22,e,r,t),e.elementType=ny,e.lanes=n,e.stateNode={isHidden:!1},e}function pc(e,t,n){return e=Mt(6,e,null,t),e.lanes=n,e}function hc(e,t,n){return t=Mt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hx(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Qu(0),this.expirationTimes=Qu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function ip(e,t,n,r,o,i,a,s,l){return e=new Hx(e,t,n,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Mt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bd(i),e}function Kx(e,t,n){var r=3=0)&&i(l,!c)}function s(l){var u=[].slice.call(l.querySelectorAll("*"),0).reduce(function(c,f){return c.concat(f.shadowRoot?s(f.shadowRoot):[f])},[]);return u.filter(a)}e.exports=t.default})(vl,vl.exports);Object.defineProperty(nn,"__esModule",{value:!0});nn.resetState=oE;nn.log=iE;nn.handleBlur=sa;nn.handleFocus=la;nn.markForFocusLater=aE;nn.returnFocus=sE;nn.popWithoutFocus=lE;nn.setupScopedFocus=uE;nn.teardownScopedFocus=cE;var tE=vl.exports,nE=rE(tE);function rE(e){return e&&e.__esModule?e:{default:e}}var Io=[],So=null,Ff=!1;function oE(){Io=[]}function iE(){}function sa(){Ff=!0}function la(){if(Ff){if(Ff=!1,!So)return;setTimeout(function(){if(!So.contains(document.activeElement)){var e=(0,nE.default)(So)[0]||So;e.focus()}},0)}}function aE(){Io.push(document.activeElement)}function sE(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=null;try{Io.length!==0&&(t=Io.pop(),t.focus({preventScroll:e}));return}catch{console.warn(["You tried to return focus to",t,"but it is not in the DOM anymore"].join(" "))}}function lE(){Io.length>0&&Io.pop()}function uE(e){So=e,window.addEventListener?(window.addEventListener("blur",sa,!1),document.addEventListener("focus",la,!0)):(window.attachEvent("onBlur",sa),document.attachEvent("onFocus",la))}function cE(){So=null,window.addEventListener?(window.removeEventListener("blur",sa),document.removeEventListener("focus",la)):(window.detachEvent("onBlur",sa),document.detachEvent("onFocus",la))}var Uf={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=a;var n=vl.exports,r=o(n);function o(s){return s&&s.__esModule?s:{default:s}}function i(){var s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return s.activeElement.shadowRoot?i(s.activeElement.shadowRoot):s.activeElement}function a(s,l){var u=(0,r.default)(s);if(!u.length){l.preventDefault();return}var c=void 0,f=l.shiftKey,p=u[0],h=u[u.length-1],g=i();if(s===g){if(!f)return;c=h}if(h===g&&!f&&(c=p),p===g&&f&&(c=h),c){l.preventDefault(),c.focus();return}var y=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),b=y!=null&&y[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(!!b){var v=u.indexOf(g);if(v>-1&&(v+=f?-1:1),c=u[v],typeof c=="undefined"){l.preventDefault(),c=f?h:p,c.focus();return}l.preventDefault(),c.focus()}}e.exports=t.default})(Uf,Uf.exports);var rn={},fE=function(){},dE=fE,en={},n1={exports:{}};/*! - Copyright (c) 2015 Jed Watson. - Based on code that is Copyright 2013-2015, Facebook, Inc. - All rights reserved. -*/(function(e){(function(){var t=!!(typeof window!="undefined"&&window.document&&window.document.createElement),n={canUseDOM:t,canUseWorkers:typeof Worker!="undefined",canUseEventListeners:t&&!!(window.addEventListener||window.attachEvent),canUseViewport:t&&!!window.screen};e.exports?e.exports=n:window.ExecutionEnvironment=n})()})(n1);Object.defineProperty(en,"__esModule",{value:!0});en.canUseDOM=en.SafeNodeList=en.SafeHTMLCollection=void 0;var pE=n1.exports,hE=vE(pE);function vE(e){return e&&e.__esModule?e:{default:e}}var eu=hE.default,mE=eu.canUseDOM?window.HTMLElement:{};en.SafeHTMLCollection=eu.canUseDOM?window.HTMLCollection:{};en.SafeNodeList=eu.canUseDOM?window.NodeList:{};en.canUseDOM=eu.canUseDOM;en.default=mE;Object.defineProperty(rn,"__esModule",{value:!0});rn.resetState=bE;rn.log=_E;rn.assertNodeList=r1;rn.setElement=xE;rn.validateElement=up;rn.hide=EE;rn.show=CE;rn.documentNotReadyOrSSRTesting=RE;var gE=dE,yE=SE(gE),wE=en;function SE(e){return e&&e.__esModule?e:{default:e}}var Nt=null;function bE(){Nt&&(Nt.removeAttribute?Nt.removeAttribute("aria-hidden"):Nt.length!=null?Nt.forEach(function(e){return e.removeAttribute("aria-hidden")}):document.querySelectorAll(Nt).forEach(function(e){return e.removeAttribute("aria-hidden")})),Nt=null}function _E(){}function r1(e,t){if(!e||!e.length)throw new Error("react-modal: No elements were found for selector "+t+".")}function xE(e){var t=e;if(typeof t=="string"&&wE.canUseDOM){var n=document.querySelectorAll(t);r1(n,t),t=n}return Nt=t||Nt,Nt}function up(e){var t=e||Nt;return t?Array.isArray(t)||t instanceof HTMLCollection||t instanceof NodeList?t:[t]:((0,yE.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}function EE(e){var t=!0,n=!1,r=void 0;try{for(var o=up(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.setAttribute("aria-hidden","true")}}catch(s){n=!0,r=s}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}function CE(e){var t=!0,n=!1,r=void 0;try{for(var o=up(e)[Symbol.iterator](),i;!(t=(i=o.next()).done);t=!0){var a=i.value;a.removeAttribute("aria-hidden")}}catch(s){n=!0,r=s}finally{try{!t&&o.return&&o.return()}finally{if(n)throw r}}}function RE(){Nt=null}var Qo={};Object.defineProperty(Qo,"__esModule",{value:!0});Qo.resetState=OE;Qo.log=kE;var $i={},Ii={};function nm(e,t){e.classList.remove(t)}function OE(){var e=document.getElementsByTagName("html")[0];for(var t in $i)nm(e,$i[t]);var n=document.body;for(var r in Ii)nm(n,Ii[r]);$i={},Ii={}}function kE(){}var PE=function(t,n){return t[n]||(t[n]=0),t[n]+=1,n},TE=function(t,n){return t[n]&&(t[n]-=1),n},LE=function(t,n,r){r.forEach(function(o){PE(n,o),t.add(o)})},NE=function(t,n,r){r.forEach(function(o){TE(n,o),n[o]===0&&t.remove(o)})};Qo.add=function(t,n){return LE(t.classList,t.nodeName.toLowerCase()=="html"?$i:Ii,n.split(" "))};Qo.remove=function(t,n){return NE(t.classList,t.nodeName.toLowerCase()=="html"?$i:Ii,n.split(" "))};var Go={};Object.defineProperty(Go,"__esModule",{value:!0});Go.log=DE;Go.resetState=ME;function AE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o1=function e(){var t=this;AE(this,e),this.register=function(n){t.openInstances.indexOf(n)===-1&&(t.openInstances.push(n),t.emit("register"))},this.deregister=function(n){var r=t.openInstances.indexOf(n);r!==-1&&(t.openInstances.splice(r,1),t.emit("deregister"))},this.subscribe=function(n){t.subscribers.push(n)},this.emit=function(n){t.subscribers.forEach(function(r){return r(n,t.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},ml=new o1;function DE(){console.log("portalOpenInstances ----------"),console.log(ml.openInstances.length),ml.openInstances.forEach(function(e){return console.log(e)}),console.log("end portalOpenInstances ----------")}function ME(){ml=new o1}Go.default=ml;var cp={};Object.defineProperty(cp,"__esModule",{value:!0});cp.resetState=UE;cp.log=jE;var $E=Go,IE=FE($E);function FE(e){return e&&e.__esModule?e:{default:e}}var Je=void 0,qt=void 0,Ur=[];function UE(){for(var e=[Je,qt],t=0;t0?(document.body.firstChild!==Je&&document.body.insertBefore(Je,document.body.firstChild),document.body.lastChild!==qt&&document.body.appendChild(qt)):(Je.parentElement&&Je.parentElement.removeChild(Je),qt.parentElement&&qt.parentElement.removeChild(qt))}IE.default.subscribe(zE);(function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(w){for(var T=1;T0&&(J-=1,J===0&&h.show(M)),k.props.shouldFocusAfterRender&&(k.props.shouldReturnFocusAfterClose?(u.returnFocus(k.props.preventScroll),u.teardownScopedFocus()):u.popWithoutFocus()),k.props.onAfterClose&&k.props.onAfterClose(),m.default.deregister(k)},k.open=function(){k.beforeOpen(),k.state.afterOpen&&k.state.beforeClose?(clearTimeout(k.closeTimer),k.setState({beforeClose:!1})):(k.props.shouldFocusAfterRender&&(u.setupScopedFocus(k.node),u.markForFocusLater()),k.setState({isOpen:!0},function(){k.openAnimationFrame=requestAnimationFrame(function(){k.setState({afterOpen:!0}),k.props.isOpen&&k.props.onAfterOpen&&k.props.onAfterOpen({overlayEl:k.overlay,contentEl:k.content})})}))},k.close=function(){k.props.closeTimeoutMS>0?k.closeWithTimeout():k.closeWithoutTimeout()},k.focusContent=function(){return k.content&&!k.contentHasFocus()&&k.content.focus({preventScroll:!0})},k.closeWithTimeout=function(){var L=Date.now()+k.props.closeTimeoutMS;k.setState({beforeClose:!0,closesAt:L},function(){k.closeTimer=setTimeout(k.closeWithoutTimeout,k.state.closesAt-Date.now())})},k.closeWithoutTimeout=function(){k.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},k.afterClose)},k.handleKeyDown=function(L){L.keyCode===D&&(0,f.default)(k.content,L),k.props.shouldCloseOnEsc&&L.keyCode===W&&(L.stopPropagation(),k.requestClose(L))},k.handleOverlayOnClick=function(L){k.shouldClose===null&&(k.shouldClose=!0),k.shouldClose&&k.props.shouldCloseOnOverlayClick&&(k.ownerHandlesClose()?k.requestClose(L):k.focusContent()),k.shouldClose=null},k.handleContentOnMouseUp=function(){k.shouldClose=!1},k.handleOverlayOnMouseDown=function(L){!k.props.shouldCloseOnOverlayClick&&L.target==k.overlay&&L.preventDefault()},k.handleContentOnClick=function(){k.shouldClose=!1},k.handleContentOnMouseDown=function(){k.shouldClose=!1},k.requestClose=function(L){return k.ownerHandlesClose()&&k.props.onRequestClose(L)},k.ownerHandlesClose=function(){return k.props.onRequestClose},k.shouldBeClosed=function(){return!k.state.isOpen&&!k.state.beforeClose},k.contentHasFocus=function(){return document.activeElement===k.content||k.content.contains(document.activeElement)},k.buildClassName=function(L,M){var $=(typeof M=="undefined"?"undefined":r(M))==="object"?M:{base:I[L],afterOpen:I[L]+"--after-open",beforeClose:I[L]+"--before-close"},F=$.base;return k.state.afterOpen&&(F=F+" "+$.afterOpen),k.state.beforeClose&&(F=F+" "+$.beforeClose),typeof M=="string"&&M?F+" "+M:F},k.attributesFromObject=function(L,M){return Object.keys(M).reduce(function($,F){return $[L+"-"+F]=M[F],$},{})},k.state={afterOpen:!1,beforeClose:!1},k.shouldClose=null,k.moveFromContentToOverlay=null,k}return o(T,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(k,L){this.props.isOpen&&!k.isOpen?this.open():!this.props.isOpen&&k.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!L.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var k=this.props,L=k.appElement,M=k.ariaHideApp,$=k.htmlOpenClassName,F=k.bodyOpenClassName;F&&y.add(document.body,F),$&&y.add(document.getElementsByTagName("html")[0],$),M&&(J+=1,h.hide(L)),m.default.register(this)}},{key:"render",value:function(){var k=this.props,L=k.id,M=k.className,$=k.overlayClassName,F=k.defaultStyles,_=k.children,V=M?{}:F.content,B=$?{}:F.overlay;if(this.shouldBeClosed())return null;var ee={ref:this.setOverlayRef,className:this.buildClassName("overlay",$),style:n({},B,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},H=n({id:L,ref:this.setContentRef,style:n({},V,this.props.style.content),className:this.buildClassName("content",M),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",n({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),ne=this.props.contentElement(H,_);return this.props.overlayElement(ee,ne)}}]),T}(i.Component);X.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},X.propTypes={isOpen:s.default.bool.isRequired,defaultStyles:s.default.shape({content:s.default.object,overlay:s.default.object}),style:s.default.shape({content:s.default.object,overlay:s.default.object}),className:s.default.oneOfType([s.default.string,s.default.object]),overlayClassName:s.default.oneOfType([s.default.string,s.default.object]),bodyOpenClassName:s.default.string,htmlOpenClassName:s.default.string,ariaHideApp:s.default.bool,appElement:s.default.oneOfType([s.default.instanceOf(v.default),s.default.instanceOf(b.SafeHTMLCollection),s.default.instanceOf(b.SafeNodeList),s.default.arrayOf(s.default.instanceOf(v.default))]),onAfterOpen:s.default.func,onAfterClose:s.default.func,onRequestClose:s.default.func,closeTimeoutMS:s.default.number,shouldFocusAfterRender:s.default.bool,shouldCloseOnOverlayClick:s.default.bool,shouldReturnFocusAfterClose:s.default.bool,preventScroll:s.default.bool,role:s.default.string,contentLabel:s.default.string,aria:s.default.object,data:s.default.object,children:s.default.node,shouldCloseOnEsc:s.default.bool,overlayRef:s.default.func,contentRef:s.default.func,id:s.default.string,overlayElement:s.default.func,contentElement:s.default.func,testId:s.default.string},t.default=X,e.exports=t.default})(If,If.exports);function i1(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function a1(e){function t(n){var r=this.constructor.getDerivedStateFromProps(e,n);return r!=null?r:null}this.setState(t.bind(this))}function s1(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}i1.__suppressDeprecationWarning=!0;a1.__suppressDeprecationWarning=!0;s1.__suppressDeprecationWarning=!0;function BE(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var n=null,r=null,o=null;if(typeof t.componentWillMount=="function"?n="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?o="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(o="UNSAFE_componentWillUpdate"),n!==null||r!==null||o!==null){var i=e.displayName||e.name,a=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs. - -`+i+" uses "+a+" but also contains the following legacy lifecycles:"+(n!==null?` - `+n:"")+(r!==null?` - `+r:"")+(o!==null?` - `+o:"")+` - -The above lifecycles should be removed. Learn more about this warning here: -https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=i1,t.componentWillReceiveProps=a1),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=s1;var s=t.componentDidUpdate;t.componentDidUpdate=function(u,c,f){var p=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:f;s.call(this,u,c,p)}}return e}var VE=Object.freeze(Object.defineProperty({__proto__:null,polyfill:BE},Symbol.toStringTag,{value:"Module"})),WE=d2(VE);Object.defineProperty(Hr,"__esModule",{value:!0});Hr.bodyOpenClassName=Hr.portalClassName=void 0;var om=Object.assign||function(e){for(var t=1;t0},t.onSubscribe=function(){},t.onUnsubscribe=function(){},e}();function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0&&e!==1/0}function Sl(e){return Array.isArray(e)?e:[e]}function c1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ls(e,t,n){return Oa(e)?typeof t=="function"?pe({},n,{queryKey:e,queryFn:t}):pe({},t,{queryKey:e}):e}function W4(e,t,n){return Oa(e)?typeof t=="function"?pe({},n,{mutationKey:e,mutationFn:t}):pe({},t,{mutationKey:e}):typeof e=="function"?pe({},t,{mutationFn:e}):pe({},e)}function Un(e,t,n){return Oa(e)?[pe({},t,{queryKey:e}),n]:[e||{},t]}function oC(e,t){if(e===!0&&t===!0||e==null&&t==null)return"all";if(e===!1&&t===!1)return"none";var n=e!=null?e:!t;return n?"active":"inactive"}function cm(e,t){var n=e.active,r=e.exact,o=e.fetching,i=e.inactive,a=e.predicate,s=e.queryKey,l=e.stale;if(Oa(s)){if(r){if(t.queryHash!==fp(s,t.options))return!1}else if(!bl(t.queryKey,s))return!1}var u=oC(n,i);if(u==="none")return!1;if(u!=="all"){var c=t.isActive();if(u==="active"&&!c||u==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||typeof o=="boolean"&&t.isFetching()!==o||a&&!a(t))}function fm(e,t){var n=e.exact,r=e.fetching,o=e.predicate,i=e.mutationKey;if(Oa(i)){if(!t.options.mutationKey)return!1;if(n){if(Mr(t.options.mutationKey)!==Mr(i))return!1}else if(!bl(t.options.mutationKey,i))return!1}return!(typeof r=="boolean"&&t.state.status==="loading"!==r||o&&!o(t))}function fp(e,t){var n=(t==null?void 0:t.queryKeyHashFn)||Mr;return n(e)}function Mr(e){var t=Sl(e);return iC(t)}function iC(e){return JSON.stringify(e,function(t,n){return zf(n)?Object.keys(n).sort().reduce(function(r,o){return r[o]=n[o],r},{}):n})}function bl(e,t){return f1(Sl(e),Sl(t))}function f1(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(function(n){return!f1(e[n],t[n])}):!1}function _l(e,t){if(e===t)return e;var n=Array.isArray(e)&&Array.isArray(t);if(n||zf(e)&&zf(t)){for(var r=n?e.length:Object.keys(e).length,o=n?t:Object.keys(t),i=o.length,a=n?[]:{},s=0,l=0;l0?this.queries.filter(function(l){return cm(s,l)}):this.queries},n.notify=function(o){var i=this;Fe.batch(function(){i.listeners.forEach(function(a){a(o)})})},n.onFocus=function(){var o=this;Fe.batch(function(){o.queries.forEach(function(i){i.onFocus()})})},n.onOnline=function(){var o=this;Fe.batch(function(){o.queries.forEach(function(i){i.onOnline()})})},t}(Ra),hC=function(){function e(n){this.options=pe({},n.defaultOptions,n.options),this.mutationId=n.mutationId,this.mutationCache=n.mutationCache,this.observers=[],this.state=n.state||vC(),this.meta=n.meta}var t=e.prototype;return t.setState=function(r){this.dispatch({type:"setState",state:r})},t.addObserver=function(r){this.observers.indexOf(r)===-1&&this.observers.push(r)},t.removeObserver=function(r){this.observers=this.observers.filter(function(o){return o!==r})},t.cancel=function(){return this.retryer?(this.retryer.cancel(),this.retryer.promise.then(et).catch(et)):Promise.resolve()},t.continue=function(){return this.retryer?(this.retryer.continue(),this.retryer.promise):this.execute()},t.execute=function(){var r=this,o,i=this.state.status==="loading",a=Promise.resolve();return i||(this.dispatch({type:"loading",variables:this.options.variables}),a=a.then(function(){r.mutationCache.config.onMutate==null||r.mutationCache.config.onMutate(r.state.variables,r)}).then(function(){return r.options.onMutate==null?void 0:r.options.onMutate(r.state.variables)}).then(function(s){s!==r.state.context&&r.dispatch({type:"loading",context:s,variables:r.state.variables})})),a.then(function(){return r.executeMutation()}).then(function(s){o=s,r.mutationCache.config.onSuccess==null||r.mutationCache.config.onSuccess(o,r.state.variables,r.state.context,r)}).then(function(){return r.options.onSuccess==null?void 0:r.options.onSuccess(o,r.state.variables,r.state.context)}).then(function(){return r.options.onSettled==null?void 0:r.options.onSettled(o,null,r.state.variables,r.state.context)}).then(function(){return r.dispatch({type:"success",data:o}),o}).catch(function(s){return r.mutationCache.config.onError==null||r.mutationCache.config.onError(s,r.state.variables,r.state.context,r),El().error(s),Promise.resolve().then(function(){return r.options.onError==null?void 0:r.options.onError(s,r.state.variables,r.state.context)}).then(function(){return r.options.onSettled==null?void 0:r.options.onSettled(void 0,s,r.state.variables,r.state.context)}).then(function(){throw r.dispatch({type:"error",error:s}),s})})},t.executeMutation=function(){var r=this,o;return this.retryer=new h1({fn:function(){return r.options.mutationFn?r.options.mutationFn(r.state.variables):Promise.reject("No mutationFn found")},onFail:function(){r.dispatch({type:"failed"})},onPause:function(){r.dispatch({type:"pause"})},onContinue:function(){r.dispatch({type:"continue"})},retry:(o=this.options.retry)!=null?o:0,retryDelay:this.options.retryDelay}),this.retryer.promise},t.dispatch=function(r){var o=this;this.state=mC(this.state,r),Fe.batch(function(){o.observers.forEach(function(i){i.onMutationUpdate(r)}),o.mutationCache.notify(o)})},e}();function vC(){return{context:void 0,data:void 0,error:null,failureCount:0,isPaused:!1,status:"idle",variables:void 0}}function mC(e,t){switch(t.type){case"failed":return pe({},e,{failureCount:e.failureCount+1});case"pause":return pe({},e,{isPaused:!0});case"continue":return pe({},e,{isPaused:!1});case"loading":return pe({},e,{context:t.context,data:void 0,error:null,isPaused:!1,status:"loading",variables:t.variables});case"success":return pe({},e,{data:t.data,error:null,status:"success",isPaused:!1});case"error":return pe({},e,{data:void 0,error:t.error,failureCount:e.failureCount+1,isPaused:!1,status:"error"});case"setState":return pe({},e,t.state);default:return e}}var gC=function(e){Ca(t,e);function t(r){var o;return o=e.call(this)||this,o.config=r||{},o.mutations=[],o.mutationId=0,o}var n=t.prototype;return n.build=function(o,i,a){var s=new hC({mutationCache:this,mutationId:++this.mutationId,options:o.defaultMutationOptions(i),state:a,defaultOptions:i.mutationKey?o.getMutationDefaults(i.mutationKey):void 0,meta:i.meta});return this.add(s),s},n.add=function(o){this.mutations.push(o),this.notify(o)},n.remove=function(o){this.mutations=this.mutations.filter(function(i){return i!==o}),o.cancel(),this.notify(o)},n.clear=function(){var o=this;Fe.batch(function(){o.mutations.forEach(function(i){o.remove(i)})})},n.getAll=function(){return this.mutations},n.find=function(o){return typeof o.exact=="undefined"&&(o.exact=!0),this.mutations.find(function(i){return fm(o,i)})},n.findAll=function(o){return this.mutations.filter(function(i){return fm(o,i)})},n.notify=function(o){var i=this;Fe.batch(function(){i.listeners.forEach(function(a){a(o)})})},n.onFocus=function(){this.resumePausedMutations()},n.onOnline=function(){this.resumePausedMutations()},n.resumePausedMutations=function(){var o=this.mutations.filter(function(i){return i.state.isPaused});return Fe.batch(function(){return o.reduce(function(i,a){return i.then(function(){return a.continue().catch(et)})},Promise.resolve())})},t}(Ra);function yC(){return{onFetch:function(t){t.fetchFn=function(){var n,r,o,i,a,s,l=(n=t.fetchOptions)==null||(r=n.meta)==null?void 0:r.refetchPage,u=(o=t.fetchOptions)==null||(i=o.meta)==null?void 0:i.fetchMore,c=u==null?void 0:u.pageParam,f=(u==null?void 0:u.direction)==="forward",p=(u==null?void 0:u.direction)==="backward",h=((a=t.state.data)==null?void 0:a.pages)||[],g=((s=t.state.data)==null?void 0:s.pageParams)||[],y=d1(),b=y==null?void 0:y.signal,v=g,d=!1,m=t.options.queryFn||function(){return Promise.reject("Missing queryFn")},S=function(w,T,U,k){return v=k?[T].concat(v):[].concat(v,[T]),k?[U].concat(w):[].concat(w,[U])},E=function(w,T,U,k){if(d)return Promise.reject("Cancelled");if(typeof U=="undefined"&&!T&&w.length)return Promise.resolve(w);var L={queryKey:t.queryKey,signal:b,pageParam:U,meta:t.meta},M=m(L),$=Promise.resolve(M).then(function(_){return S(w,U,_,k)});if(xl(M)){var F=$;F.cancel=M.cancel}return $},O;if(!h.length)O=E([]);else if(f){var A=typeof c!="undefined",P=A?c:hm(t.options,h);O=E(h,A,P)}else if(p){var I=typeof c!="undefined",D=I?c:wC(t.options,h);O=E(h,I,D,!0)}else(function(){v=[];var X=typeof t.options.getNextPageParam=="undefined",w=l&&h[0]?l(h[0],0,h):!0;O=w?E([],X,g[0]):Promise.resolve(S([],g[0],h[0]));for(var T=function(L){O=O.then(function(M){var $=l&&h[L]?l(h[L],L,h):!0;if($){var F=X?g[L]:hm(t.options,M);return E(M,X,F)}return Promise.resolve(S(M,g[L],h[L]))})},U=1;U0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>p.dataUpdateCount||g.errorUpdateCount>p.errorUpdateCount,isFetching:d,isRefetching:d&&m!=="loading",isLoadingError:m==="error"&&g.dataUpdatedAt===0,isPlaceholderData:E,isPreviousData:S,isRefetchError:m==="error"&&g.dataUpdatedAt!==0,isStale:dp(o,i),refetch:this.refetch,remove:this.remove};return W},n.shouldNotifyListeners=function(o,i){if(!i)return!0;var a=this.options,s=a.notifyOnChangeProps,l=a.notifyOnChangePropsExclusions;if(!s&&!l||s==="tracked"&&!this.trackedProps.length)return!0;var u=s==="tracked"?this.trackedProps:s;return Object.keys(o).some(function(c){var f=c,p=o[f]!==i[f],h=u==null?void 0:u.some(function(y){return y===c}),g=l==null?void 0:l.some(function(y){return y===c});return p&&!g&&(!u||h)})},n.updateResult=function(o){var i=this.currentResult;if(this.currentResult=this.createResult(this.currentQuery,this.options),this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,!aC(this.currentResult,i)){var a={cache:!0};(o==null?void 0:o.listeners)!==!1&&this.shouldNotifyListeners(this.currentResult,i)&&(a.listeners=!0),this.notify(pe({},a,o))}},n.updateQuery=function(){var o=this.client.getQueryCache().build(this.client,this.options);if(o!==this.currentQuery){var i=this.currentQuery;this.currentQuery=o,this.currentQueryInitialState=o.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(i==null||i.removeObserver(this),o.addObserver(this))}},n.onQueryUpdate=function(o){var i={};o.type==="success"?i.onSuccess=!0:o.type==="error"&&!As(o.error)&&(i.onError=!0),this.updateResult(i),this.hasListeners()&&this.updateTimers()},n.notify=function(o){var i=this;Fe.batch(function(){o.onSuccess?(i.options.onSuccess==null||i.options.onSuccess(i.currentResult.data),i.options.onSettled==null||i.options.onSettled(i.currentResult.data,null)):o.onError&&(i.options.onError==null||i.options.onError(i.currentResult.error),i.options.onSettled==null||i.options.onSettled(void 0,i.currentResult.error)),o.listeners&&i.listeners.forEach(function(a){a(i.currentResult)}),o.cache&&i.client.getQueryCache().notify({query:i.currentQuery,type:"observerResultsUpdated"})})},t}(Ra);function _C(e,t){return t.enabled!==!1&&!e.state.dataUpdatedAt&&!(e.state.status==="error"&&t.retryOnMount===!1)}function vm(e,t){return _C(e,t)||e.state.dataUpdatedAt>0&&Bf(e,t,t.refetchOnMount)}function Bf(e,t,n){if(t.enabled!==!1){var r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&dp(e,t)}return!1}function mm(e,t,n,r){return n.enabled!==!1&&(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&dp(e,n)}function dp(e,t){return e.isStaleByTime(t.staleTime)}var xC=Z0.unstable_batchedUpdates;Fe.setBatchNotifyFunction(xC);var EC=console;dC(EC);var gm=Y.createContext(void 0),g1=Y.createContext(!1);function y1(e){return e&&typeof window!="undefined"?(window.ReactQueryClientContext||(window.ReactQueryClientContext=gm),window.ReactQueryClientContext):gm}var CC=function(){var t=Y.useContext(y1(Y.useContext(g1)));if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},RC=function(t){var n=t.client,r=t.contextSharing,o=r===void 0?!1:r,i=t.children;Y.useEffect(function(){return n.mount(),function(){n.unmount()}},[n]);var a=y1(o);return Y.createElement(g1.Provider,{value:o},Y.createElement(a.Provider,{value:n},i))};function OC(){var e=!1;return{clearReset:function(){e=!1},reset:function(){e=!0},isReset:function(){return e}}}var kC=Y.createContext(OC()),PC=function(){return Y.useContext(kC)};function TC(e,t,n){return typeof t=="function"?t.apply(void 0,n):typeof t=="boolean"?t:!!e}function LC(e,t){var n=Y.useRef(!1),r=Y.useState(0),o=r[1],i=CC(),a=PC(),s=i.defaultQueryObserverOptions(e);s.optimisticResults=!0,s.onError&&(s.onError=Fe.batchCalls(s.onError)),s.onSuccess&&(s.onSuccess=Fe.batchCalls(s.onSuccess)),s.onSettled&&(s.onSettled=Fe.batchCalls(s.onSettled)),s.suspense&&(typeof s.staleTime!="number"&&(s.staleTime=1e3),s.cacheTime===0&&(s.cacheTime=1)),(s.suspense||s.useErrorBoundary)&&(a.isReset()||(s.retryOnMount=!1));var l=Y.useState(function(){return new t(i,s)}),u=l[0],c=u.getOptimisticResult(s);if(Y.useEffect(function(){n.current=!0,a.clearReset();var f=u.subscribe(Fe.batchCalls(function(){n.current&&o(function(p){return p+1})}));return u.updateResult(),function(){n.current=!1,f()}},[a,u]),Y.useEffect(function(){u.setOptions(s,{listeners:!1})},[s,u]),s.suspense&&c.isLoading)throw u.fetchOptimistic(s).then(function(f){var p=f.data;s.onSuccess==null||s.onSuccess(p),s.onSettled==null||s.onSettled(p,null)}).catch(function(f){a.clearReset(),s.onError==null||s.onError(f),s.onSettled==null||s.onSettled(void 0,f)});if(c.isError&&!a.isReset()&&!c.isFetching&&TC(s.suspense,s.useErrorBoundary,[c.error,u.getCurrentQuery()]))throw c.error;return s.notifyOnChangeProps==="tracked"&&(c=u.trackResult(c,s)),c}function NC(e,t,n){var r=Ls(e,t,n);return LC(r,bC)}var $r;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})($r||($r={}));var ym=function(e){return e},wm="beforeunload",AC="hashchange",DC="popstate";function MC(e){e===void 0&&(e={});var t=e,n=t.window,r=n===void 0?document.defaultView:n,o=r.history;function i(){var P=fr(r.location.hash.substr(1)),I=P.pathname,D=I===void 0?"/":I,W=P.search,J=W===void 0?"":W,X=P.hash,w=X===void 0?"":X,T=o.state||{};return[T.idx,ym({pathname:D,search:J,hash:w,state:T.usr||null,key:T.key||"default"})]}var a=null;function s(){if(a)h.call(a),a=null;else{var P=$r.Pop,I=i(),D=I[0],W=I[1];if(h.length){if(D!=null){var J=c-D;J&&(a={action:P,location:W,retry:function(){O(J*-1)}},O(J))}}else m(P)}}r.addEventListener(DC,s),r.addEventListener(AC,function(){var P=i(),I=P[1];Ui(I)!==Ui(f)&&s()});var l=$r.Pop,u=i(),c=u[0],f=u[1],p=bm(),h=bm();c==null&&(c=0,o.replaceState(pe({},o.state,{idx:c}),""));function g(){var P=document.querySelector("base"),I="";if(P&&P.getAttribute("href")){var D=r.location.href,W=D.indexOf("#");I=W===-1?D:D.slice(0,W)}return I}function y(P){return g()+"#"+(typeof P=="string"?P:Ui(P))}function b(P,I){return I===void 0&&(I=null),ym(pe({pathname:f.pathname,hash:"",search:""},typeof P=="string"?fr(P):P,{state:I,key:$C()}))}function v(P,I){return[{usr:P.state,key:P.key,idx:I},y(P)]}function d(P,I,D){return!h.length||(h.call({action:P,location:I,retry:D}),!1)}function m(P){l=P;var I=i();c=I[0],f=I[1],p.call({action:l,location:f})}function S(P,I){var D=$r.Push,W=b(P,I);function J(){S(P,I)}if(d(D,W,J)){var X=v(W,c+1),w=X[0],T=X[1];try{o.pushState(w,"",T)}catch{r.location.assign(T)}m(D)}}function E(P,I){var D=$r.Replace,W=b(P,I);function J(){E(P,I)}if(d(D,W,J)){var X=v(W,c),w=X[0],T=X[1];o.replaceState(w,"",T),m(D)}}function O(P){o.go(P)}var A={get action(){return l},get location(){return f},createHref:y,push:S,replace:E,go:O,back:function(){O(-1)},forward:function(){O(1)},listen:function(I){return p.push(I)},block:function(I){var D=h.push(I);return h.length===1&&r.addEventListener(wm,Sm),function(){D(),h.length||r.removeEventListener(wm,Sm)}}};return A}function Sm(e){e.preventDefault(),e.returnValue=""}function bm(){var e=[];return{get length(){return e.length},push:function(n){return e.push(n),function(){e=e.filter(function(r){return r!==n})}},call:function(n){e.forEach(function(r){return r&&r(n)})}}}function $C(){return Math.random().toString(36).substr(2,8)}function Ui(e){var t=e.pathname,n=t===void 0?"/":t,r=e.search,o=r===void 0?"":r,i=e.hash,a=i===void 0?"":i;return o&&o!=="?"&&(n+=o.charAt(0)==="?"?o:"?"+o),a&&a!=="#"&&(n+=a.charAt(0)==="#"?a:"#"+a),n}function fr(e){var t={};if(e){var n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));var r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}/** - * React Router v6.3.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */const pp=R.exports.createContext(null),hp=R.exports.createContext(null),tu=R.exports.createContext({outlet:null,matches:[]});function dr(e,t){if(!e)throw new Error(t)}function IC(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?fr(t):t,o=b1(r.pathname||"/",n);if(o==null)return null;let i=w1(e);FC(i);let a=null;for(let s=0;a==null&&s{let a={relativePath:o.path||"",caseSensitive:o.caseSensitive===!0,childrenIndex:i,route:o};a.relativePath.startsWith("/")&&(a.relativePath.startsWith(r)||dr(!1),a.relativePath=a.relativePath.slice(r.length));let s=ir([r,a.relativePath]),l=n.concat(a);o.children&&o.children.length>0&&(o.index===!0&&dr(!1),w1(o.children,t,l,s)),!(o.path==null&&!o.index)&&t.push({path:s,score:HC(s,o.index),routesMeta:l})}),t}function FC(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:KC(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const UC=/^:\w+$/,jC=3,zC=2,BC=1,VC=10,WC=-2,_m=e=>e==="*";function HC(e,t){let n=e.split("/"),r=n.length;return n.some(_m)&&(r+=WC),t&&(r+=zC),n.filter(o=>!_m(o)).reduce((o,i)=>o+(UC.test(i)?jC:i===""?BC:VC),r)}function KC(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function qC(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a{if(c==="*"){let p=s[f]||"";a=i.slice(0,i.length-p.length).replace(/(.)\/+$/,"$1")}return u[c]=XC(s[f]||""),u},{}),pathname:i,pathnameBase:a,pattern:e}}function GC(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,(a,s)=>(r.push(s),"([^\\/]+)"));return e.endsWith("*")?(r.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o+=n?"\\/*$":"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)",[new RegExp(o,t?void 0:"i"),r]}function XC(e,t){try{return decodeURIComponent(e)}catch{return e}}function YC(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?fr(e):e;return{pathname:n?n.startsWith("/")?n:ZC(n,t):t,search:eR(r),hash:tR(o)}}function ZC(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function S1(e,t,n){let r=typeof e=="string"?fr(e):e,o=e===""||r.pathname===""?"/":r.pathname,i;if(o==null)i=n;else{let s=t.length-1;if(o.startsWith("..")){let l=o.split("/");for(;l[0]==="..";)l.shift(),s-=1;r.pathname=l.join("/")}i=s>=0?t[s]:"/"}let a=YC(r,i);return o&&o!=="/"&&o.endsWith("/")&&!a.pathname.endsWith("/")&&(a.pathname+="/"),a}function JC(e){return e===""||e.pathname===""?"/":typeof e=="string"?fr(e).pathname:e.pathname}function b1(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&n!=="/"?null:e.slice(t.length)||"/"}const ir=e=>e.join("/").replace(/\/\/+/g,"/"),_1=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),eR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,tR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function nR(e){ka()||dr(!1);let{basename:t,navigator:n}=R.exports.useContext(pp),{hash:r,pathname:o,search:i}=x1(e),a=o;if(t!=="/"){let s=JC(e),l=s!=null&&s.endsWith("/");a=o==="/"?t+(l?"/":""):ir([t,o])}return n.createHref({pathname:a,search:i,hash:r})}function ka(){return R.exports.useContext(hp)!=null}function Pa(){return ka()||dr(!1),R.exports.useContext(hp).location}function rR(){ka()||dr(!1);let{basename:e,navigator:t}=R.exports.useContext(pp),{matches:n}=R.exports.useContext(tu),{pathname:r}=Pa(),o=JSON.stringify(n.map(s=>s.pathnameBase)),i=R.exports.useRef(!1);return R.exports.useEffect(()=>{i.current=!0}),R.exports.useCallback(function(s,l){if(l===void 0&&(l={}),!i.current)return;if(typeof s=="number"){t.go(s);return}let u=S1(s,JSON.parse(o),r);e!=="/"&&(u.pathname=ir([e,u.pathname])),(l.replace?t.replace:t.push)(u,l.state)},[e,t,o,r])}function x1(e){let{matches:t}=R.exports.useContext(tu),{pathname:n}=Pa(),r=JSON.stringify(t.map(o=>o.pathnameBase));return R.exports.useMemo(()=>S1(e,JSON.parse(r),n),[e,r,n])}function E1(e,t){ka()||dr(!1);let{matches:n}=R.exports.useContext(tu),r=n[n.length-1],o=r?r.params:{};r&&r.pathname;let i=r?r.pathnameBase:"/";r&&r.route;let a=Pa(),s;if(t){var l;let p=typeof t=="string"?fr(t):t;i==="/"||((l=p.pathname)==null?void 0:l.startsWith(i))||dr(!1),s=p}else s=a;let u=s.pathname||"/",c=i==="/"?u:u.slice(i.length)||"/",f=IC(e,{pathname:c});return oR(f&&f.map(p=>Object.assign({},p,{params:Object.assign({},o,p.params),pathname:ir([i,p.pathname]),pathnameBase:p.pathnameBase==="/"?i:ir([i,p.pathnameBase])})),n)}function oR(e,t){return t===void 0&&(t=[]),e==null?null:e.reduceRight((n,r,o)=>R.exports.createElement(tu.Provider,{children:r.route.element!==void 0?r.route.element:n,value:{outlet:n,matches:t.concat(e.slice(0,o+1))}}),null)}function iR(e){let{basename:t="/",children:n=null,location:r,navigationType:o=$r.Pop,navigator:i,static:a=!1}=e;ka()&&dr(!1);let s=_1(t),l=R.exports.useMemo(()=>({basename:s,navigator:i,static:a}),[s,i,a]);typeof r=="string"&&(r=fr(r));let{pathname:u="/",search:c="",hash:f="",state:p=null,key:h="default"}=r,g=R.exports.useMemo(()=>{let y=b1(u,s);return y==null?null:{pathname:y,search:c,hash:f,state:p,key:h}},[s,u,c,f,p,h]);return g==null?null:R.exports.createElement(pp.Provider,{value:l},R.exports.createElement(hp.Provider,{children:n,value:{location:g,navigationType:o}}))}/** - * React Router DOM v6.3.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Vf(){return Vf=Object.assign||function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}const sR=["onClick","reloadDocument","replace","state","target","to"];function lR(e){let{basename:t,children:n,window:r}=e,o=R.exports.useRef();o.current==null&&(o.current=MC({window:r}));let i=o.current,[a,s]=R.exports.useState({action:i.action,location:i.location});return R.exports.useLayoutEffect(()=>i.listen(s),[i]),R.exports.createElement(iR,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:i})}function uR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}const C1=R.exports.forwardRef(function(t,n){let{onClick:r,reloadDocument:o,replace:i=!1,state:a,target:s,to:l}=t,u=aR(t,sR),c=nR(l),f=cR(l,{replace:i,state:a,target:s});function p(h){r&&r(h),!h.defaultPrevented&&!o&&f(h)}return R.exports.createElement("a",Vf({},u,{href:c,onClick:p,ref:n,target:s}))});function cR(e,t){let{target:n,replace:r,state:o}=t===void 0?{}:t,i=rR(),a=Pa(),s=x1(e);return R.exports.useCallback(l=>{if(l.button===0&&(!n||n==="_self")&&!uR(l)){l.preventDefault();let u=!!r||Ui(a)===Ui(s);i(e,{replace:u,state:o})}},[a,i,s,r,o,n,e])}function fR(e){const t=new Error(e);if(t.stack===void 0)try{throw t}catch{}return t}var dR=fR,fe=dR;function pR(e){return!!e&&typeof e.then=="function"}var Te=pR;function hR(e,t){if(e!=null)return e;throw fe(t!=null?t:"Got unexpected null or undefined")}var Le=hR;function ue(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class nu{getValue(){throw fe("BaseLoadable")}toPromise(){throw fe("BaseLoadable")}valueMaybe(){throw fe("BaseLoadable")}valueOrThrow(){throw fe(`Loadable expected value, but in "${this.state}" state`)}promiseMaybe(){throw fe("BaseLoadable")}promiseOrThrow(){throw fe(`Loadable expected promise, but in "${this.state}" state`)}errorMaybe(){throw fe("BaseLoadable")}errorOrThrow(){throw fe(`Loadable expected error, but in "${this.state}" state`)}is(t){return t.state===this.state&&t.contents===this.contents}map(t){throw fe("BaseLoadable")}}class vR extends nu{constructor(t){super(),ue(this,"state","hasValue"),ue(this,"contents",void 0),this.contents=t}getValue(){return this.contents}toPromise(){return Promise.resolve(this.contents)}valueMaybe(){return this.contents}valueOrThrow(){return this.contents}promiseMaybe(){}errorMaybe(){}map(t){try{const n=t(this.contents);return Te(n)?Kr(n):Fo(n)?n:Ta(n)}catch(n){return Te(n)?Kr(n.next(()=>this.map(t))):ru(n)}}}class mR extends nu{constructor(t){super(),ue(this,"state","hasError"),ue(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return Promise.reject(this.contents)}valueMaybe(){}promiseMaybe(){}errorMaybe(){return this.contents}errorOrThrow(){return this.contents}map(t){return this}}class R1 extends nu{constructor(t){super(),ue(this,"state","loading"),ue(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return this.contents}valueMaybe(){}promiseMaybe(){return this.contents}promiseOrThrow(){return this.contents}errorMaybe(){}map(t){return Kr(this.contents.then(n=>{const r=t(n);if(Fo(r)){const o=r;switch(o.state){case"hasValue":return o.contents;case"hasError":throw o.contents;case"loading":return o.contents}}return r}).catch(n=>{if(Te(n))return n.then(()=>this.map(t).contents);throw n}))}}function Ta(e){return Object.freeze(new vR(e))}function ru(e){return Object.freeze(new mR(e))}function Kr(e){return Object.freeze(new R1(e))}function O1(){return Object.freeze(new R1(new Promise(()=>{})))}function gR(e){return e.every(t=>t.state==="hasValue")?Ta(e.map(t=>t.contents)):e.some(t=>t.state==="hasError")?ru(Le(e.find(t=>t.state==="hasError"),"Invalid loadable passed to loadableAll").contents):Kr(Promise.all(e.map(t=>t.contents)))}function k1(e){const n=(Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(o=>e[o])).map(o=>Fo(o)?o:Te(o)?Kr(o):Ta(o)),r=gR(n);return Array.isArray(e)?r:r.map(o=>Object.getOwnPropertyNames(e).reduce((i,a,s)=>ge(te({},i),{[a]:o[s]}),{}))}function Fo(e){return e instanceof nu}const yR={of:e=>Te(e)?Kr(e):Fo(e)?e:Ta(e),error:e=>ru(e),loading:()=>O1(),all:k1,isLoadable:Fo};var Yr={loadableWithValue:Ta,loadableWithError:ru,loadableWithPromise:Kr,loadableLoading:O1,loadableAll:k1,isLoadable:Fo,RecoilLoadable:yR},wR=Yr.loadableWithValue,SR=Yr.loadableWithError,bR=Yr.loadableWithPromise,_R=Yr.loadableLoading,xR=Yr.loadableAll,ER=Yr.isLoadable,CR=Yr.RecoilLoadable,La=Object.freeze({__proto__:null,loadableWithValue:wR,loadableWithError:SR,loadableWithPromise:bR,loadableLoading:_R,loadableAll:xR,isLoadable:ER,RecoilLoadable:CR});const ou=new Map().set("recoil_hamt_2020",!0).set("recoil_sync_external_store",!0).set("recoil_suppress_rerender_in_callback",!0).set("recoil_memory_managament_2020",!0);function iu(e){var t;return(t=ou.get(e))!==null&&t!==void 0?t:!1}iu.setPass=e=>{ou.set(e,!0)};iu.setFail=e=>{ou.set(e,!1)};iu.clear=()=>{ou.clear()};var Ee=iu,vc,mc,gc;const RR=(vc=Y.createMutableSource)!==null&&vc!==void 0?vc:Y.unstable_createMutableSource,P1=(mc=Y.useMutableSource)!==null&&mc!==void 0?mc:Y.unstable_useMutableSource,T1=(gc=Y.useSyncExternalStore)!==null&&gc!==void 0?gc:Y.unstable_useSyncExternalStore;function OR(){return Ee("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:Ee("recoil_sync_external_store")&&T1!=null?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:Ee("recoil_mutable_source")&&P1!=null&&typeof window!="undefined"&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?Ee("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:Ee("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}}function kR(){return!1}var Na={createMutableSource:RR,useMutableSource:P1,useSyncExternalStore:T1,reactMode:OR,isFastRefreshEnabled:kR};class vp{constructor(t){ue(this,"key",void 0),this.key=t}toJSON(){return{key:this.key}}}class L1 extends vp{}class N1 extends vp{}function PR(e){return e instanceof L1||e instanceof N1}var au={AbstractRecoilValue:vp,RecoilState:L1,RecoilValueReadOnly:N1,isRecoilValue:PR},TR=au.AbstractRecoilValue,LR=au.RecoilState,NR=au.RecoilValueReadOnly,AR=au.isRecoilValue,Uo=Object.freeze({__proto__:null,AbstractRecoilValue:TR,RecoilState:LR,RecoilValueReadOnly:NR,isRecoilValue:AR});function DR(e,t){return function*(){let n=0;for(const r of e)yield t(r,n++)}()}var su=DR;function MR(e,t,{error:n}={}){return null}var $R=MR,mp=$R;class A1{}const IR=new A1,qr=new Map,gp=new Map;function FR(e){return su(e,t=>Le(gp.get(t)))}function UR(e){if(qr.has(e.key)){const n=`Duplicate atom key "${e.key}". This is a FATAL ERROR in - production. But it is safe to ignore this warning if it occurred because of - hot module replacement.`;console.warn(n)}qr.set(e.key,e);const t=e.set==null?new Uo.RecoilValueReadOnly(e.key):new Uo.RecoilState(e.key);return gp.set(e.key,t),t}class D1 extends Error{}function jR(e){const t=qr.get(e);if(t==null)throw new D1(`Missing definition for RecoilValue: "${e}""`);return t}function zR(e){return qr.get(e)}const Cl=new Map;function BR(e){var t;if(!Ee("recoil_memory_managament_2020"))return;const n=qr.get(e);if(n!=null&&(t=n.shouldDeleteConfigOnRelease)!==null&&t!==void 0&&t.call(n)){var r;qr.delete(e),(r=M1(e))===null||r===void 0||r(),Cl.delete(e)}}function VR(e,t){!Ee("recoil_memory_managament_2020")||(t===void 0?Cl.delete(e):Cl.set(e,t))}function M1(e){return Cl.get(e)}var wt={nodes:qr,recoilValues:gp,registerNode:UR,getNode:jR,getNodeMaybe:zR,deleteNodeConfigIfPossible:BR,setConfigDeletionHandler:VR,getConfigDeletionHandler:M1,recoilValuesForKeys:FR,NodeMissingError:D1,DefaultValue:A1,DEFAULT_VALUE:IR};function WR(e,t){t()}var HR={enqueueExecution:WR};function KR(e,t){return t={exports:{}},e(t,t.exports),t.exports}var qR=KR(function(e){var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(N){return typeof N}:function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},n={},r=5,o=Math.pow(2,r),i=o-1,a=o/2,s=o/4,l={},u=function(x){return function(){return x}},c=n.hash=function(N){var x=typeof N=="undefined"?"undefined":t(N);if(x==="number")return N;x!=="string"&&(N+="");for(var j=0,K=0,q=N.length;K>1&1431655765,x=(x&858993459)+(x>>2&858993459),x=x+(x>>4)&252645135,x+=x>>8,x+=x>>16,x&127},p=function(x,j){return j>>>x&i},h=function(x){return 1<=j;)q[ae--]=q[ae];return q[j]=K,q}for(var oe=0,ie=0,de=new Array(G+1);oe>>=1;return ae[j]=K,W(x,ie+1,ae)},w=function(x,j,K,q){for(var G=new Array(j-1),ae=0,oe=0,ie=0,de=q.length;ie1?I(x,this.hash,de):de[0]}var ke=q();return ke===l?this:(++oe.value,T(x,K,this.hash,this,G,P(x,G,ae,ke)))},$=function(x,j,K,q,G,ae,oe){var ie=this.mask,de=this.children,ke=p(K,G),ft=h(ke),We=g(ie,ft),Lt=ie&ft,Bt=Lt?de[We]:O,no=Bt._modify(x,j,K+r,q,G,ae,oe);if(Bt===no)return this;var Ua=k(x,this),ti=ie,ni=void 0;if(Lt&&A(no)){if(ti&=~ft,!ti)return O;if(de.length<=2&&J(de[We^1]))return de[We^1];ni=b(Ua,We,de)}else if(!Lt&&!A(no)){if(de.length>=a)return X(x,ke,no,ie,de);ti|=ft,ni=v(Ua,We,no,de)}else ni=y(Ua,We,no,de);return Ua?(this.mask=ti,this.children=ni,this):D(x,ti,ni)},F=function(x,j,K,q,G,ae,oe){var ie=this.size,de=this.children,ke=p(K,G),ft=de[ke],We=(ft||O)._modify(x,j,K+r,q,G,ae,oe);if(ft===We)return this;var Lt=k(x,this),Bt=void 0;if(A(ft)&&!A(We))++ie,Bt=y(Lt,ke,We,de);else if(!A(ft)&&A(We)){if(--ie,ie<=s)return w(x,ie,ke,de);Bt=y(Lt,ke,O,de)}else Bt=y(Lt,ke,We,de);return Lt?(this.size=ie,this.children=Bt,this):W(x,ie,Bt)};O._modify=function(N,x,j,K,q,G,ae){var oe=K();return oe===l?O:(++ae.value,P(N,q,G,oe))};function _(N,x,j,K,q){this._editable=N,this._edit=x,this._config=j,this._root=K,this._size=q}_.prototype.setTree=function(N,x){return this._editable?(this._root=N,this._size=x,this):N===this._root?this:new _(this._editable,this._edit,this._config,N,x)};var V=n.tryGetHash=function(N,x,j,K){for(var q=K._root,G=0,ae=K._config.keyEq;;)switch(q.type){case d:return ae(j,q.key)?q.value:N;case m:{if(x===q.hash)for(var oe=q.children,ie=0,de=oe.length;ie{n.set(o,t(r,o))}),n}var Rl=JR;function eO(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function tO(e){return{nodeDeps:Rl(e.nodeDeps,t=>new Set(t)),nodeToNodeSubscriptions:Rl(e.nodeToNodeSubscriptions,t=>new Set(t))}}function yc(e,t,n,r){const{nodeDeps:o,nodeToNodeSubscriptions:i}=n,a=o.get(e);if(a&&r&&a!==r.nodeDeps.get(e))return;o.set(e,t);const s=a==null?t:ji(t,a);for(const l of s)i.has(l)||i.set(l,new Set),Le(i.get(l)).add(e);if(a){const l=ji(a,t);for(const u of l){if(!i.has(u))return;const c=Le(i.get(u));c.delete(e),c.size===0&&i.delete(u)}}}function nO(e,t,n,r){var o,i,a,s;const l=n.getState();r===l.currentTree.version||r===((o=l.nextTree)===null||o===void 0?void 0:o.version)||((i=l.previousTree)===null||i===void 0||i.version);const u=n.getGraph(r);if(yc(e,t,u),r===((a=l.previousTree)===null||a===void 0?void 0:a.version)){const f=n.getGraph(l.currentTree.version);yc(e,t,f,u)}if(r===((s=l.previousTree)===null||s===void 0?void 0:s.version)||r===l.currentTree.version){var c;const f=(c=l.nextTree)===null||c===void 0?void 0:c.version;if(f!==void 0){const p=n.getGraph(f);yc(e,t,p,u)}}}var Aa={cloneGraph:tO,graph:eO,saveDepsToStore:nO};let rO=0;const oO=()=>rO++;let iO=0;const aO=()=>iO++;let sO=0;const lO=()=>sO++;var lu={getNextTreeStateVersion:oO,getNextStoreID:aO,getNextComponentID:lO};const{persistentMap:xm}=YR,{graph:uO}=Aa,{getNextTreeStateVersion:$1}=lu;function I1(){const e=$1();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:xm(),nonvalidatedAtoms:xm()}}function cO(){const e=I1();return{currentTree:e,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(e.version,uO()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var F1={makeEmptyTreeState:I1,makeEmptyStoreState:cO,getNextTreeStateVersion:$1};class U1{}function fO(){return new U1}var uu={RetentionZone:U1,retentionZone:fO};function dO(e,t){const n=new Set(e);return n.add(t),n}function pO(e,t){const n=new Set(e);return n.delete(t),n}function hO(e,t,n){const r=new Map(e);return r.set(t,n),r}function vO(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r}function mO(e,t){const n=new Map(e);return n.delete(t),n}function gO(e,t){const n=new Map(e);return t.forEach(r=>n.delete(r)),n}var j1={setByAddingToSet:dO,setByDeletingFromSet:pO,mapBySettingInMap:hO,mapByUpdatingInMap:vO,mapByDeletingFromMap:mO,mapByDeletingMultipleFromMap:gO};function*yO(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)}var Sp=yO;function wO(e,t){return new Proxy(e,{get:(r,o)=>(!(o in r)&&o in t&&(r[o]=t[o]()),r[o]),ownKeys:r=>Object.keys(r)})}var z1=wO;const{getNode:Da,getNodeMaybe:SO,recoilValuesForKeys:Em}=wt,{RetentionZone:Cm}=uu,{setByAddingToSet:bO}=j1,_O=Object.freeze(new Set);class xO extends Error{}function EO(e,t,n){if(!Ee("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=e.getState().retention;function o(i){let a=r.get(i);a||r.set(i,a=new Set),a.add(t)}if(n instanceof Cm)o(n);else if(Array.isArray(n))for(const i of n)o(i);return()=>{if(!Ee("recoil_memory_managament_2020"))return;const{retention:i}=e.getState();function a(s){const l=i.nodesRetainedByZone.get(s);l==null||l.delete(t),l&&l.size===0&&i.nodesRetainedByZone.delete(s)}if(n instanceof Cm)a(n);else if(Array.isArray(n))for(const s of n)a(s)}}function bp(e,t,n,r){const o=e.getState();if(o.nodeCleanupFunctions.has(n))return;const i=Da(n),a=EO(e,n,i.retainedBy),s=i.init(e,t,r);o.nodeCleanupFunctions.set(n,()=>{s(),a()})}function CO(e,t,n){bp(e,e.getState().currentTree,t,n)}function RO(e,t){var n;const r=e.getState();(n=r.nodeCleanupFunctions.get(t))===null||n===void 0||n(),r.nodeCleanupFunctions.delete(t)}function OO(e,t,n){return bp(e,t,n,"get"),Da(n).get(e,t)}function B1(e,t,n){return Da(n).peek(e,t)}function kO(e,t,n){var r;const o=SO(t);return o==null||(r=o.invalidate)===null||r===void 0||r.call(o,e),ge(te({},e),{atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:bO(e.dirtyAtoms,t)})}function PO(e,t,n,r){const o=Da(n);if(o.set==null)throw new xO(`Attempt to set read-only RecoilValue: ${n}`);const i=o.set;return bp(e,t,n,"set"),i(e,t,r)}function TO(e,t,n){const r=e.getState(),o=e.getGraph(t.version),i=Da(n).nodeType;return z1({type:i},{loadable:()=>B1(e,t,n),isActive:()=>r.knownAtoms.has(n)||r.knownSelectors.has(n),isSet:()=>i==="selector"?!1:t.atomValues.has(n),isModified:()=>t.dirtyAtoms.has(n),deps:()=>{var a;return Em((a=o.nodeDeps.get(n))!==null&&a!==void 0?a:[])},subscribers:()=>{var a,s;return{nodes:Em(Sp(V1(e,t,new Set([n])),l=>l!==n)),components:su((a=(s=r.nodeToComponentSubscriptions.get(n))===null||s===void 0?void 0:s.values())!==null&&a!==void 0?a:[],([l])=>({name:l}))}}})}function V1(e,t,n){const r=new Set,o=Array.from(n),i=e.getGraph(t.version);for(let s=o.pop();s;s=o.pop()){var a;r.add(s);const l=(a=i.nodeToNodeSubscriptions.get(s))!==null&&a!==void 0?a:_O;for(const u of l)r.has(u)||o.push(u)}return r}var br={getNodeLoadable:OO,peekNodeLoadable:B1,setNodeValue:PO,initializeNode:CO,cleanUpNode:RO,setUnvalidatedAtomValue_DEPRECATED:kO,peekNodeInfo:TO,getDownstreamNodes:V1};let W1=null;function LO(e){W1=e}function NO(){var e;(e=W1)===null||e===void 0||e()}var H1={setInvalidateMemoizedSnapshot:LO,invalidateMemoizedSnapshot:NO};const{getDownstreamNodes:AO,getNodeLoadable:K1,setNodeValue:DO}=br,{getNextComponentID:MO}=lu,{getNode:$O,getNodeMaybe:q1}=wt,{DefaultValue:_p}=wt,{reactMode:IO}=Na,{AbstractRecoilValue:FO,RecoilState:UO,RecoilValueReadOnly:jO,isRecoilValue:zO}=Uo,{invalidateMemoizedSnapshot:BO}=H1;function VO(e,{key:t},n=e.getState().currentTree){var r,o;const i=e.getState();n.version===i.currentTree.version||n.version===((r=i.nextTree)===null||r===void 0?void 0:r.version)||(n.version,(o=i.previousTree)===null||o===void 0||o.version);const a=K1(e,n,t);return a.state==="loading"&&a.contents.catch(()=>{}),a}function WO(e,t){const n=e.clone();return t.forEach((r,o)=>{r.state==="hasValue"&&r.contents instanceof _p?n.delete(o):n.set(o,r)}),n}function HO(e,t,{key:n},r){if(typeof r=="function"){const o=K1(e,t,n);if(o.state==="loading"){const i=`Tried to set atom or selector "${n}" using an updater function while the current state is pending, this is not currently supported.`;throw fe(i)}else if(o.state==="hasError")throw o.contents;return r(o.contents)}else return r}function KO(e,t,n){if(n.type==="set"){const{recoilValue:o,valueOrUpdater:i}=n,a=HO(e,t,o,i),s=DO(e,t,o.key,a);for(const[l,u]of s.entries())Wf(t,l,u)}else if(n.type==="setLoadable"){const{recoilValue:{key:o},loadable:i}=n;Wf(t,o,i)}else if(n.type==="markModified"){const{recoilValue:{key:o}}=n;t.dirtyAtoms.add(o)}else if(n.type==="setUnvalidated"){var r;const{recoilValue:{key:o},unvalidatedValue:i}=n,a=q1(o);a==null||(r=a.invalidate)===null||r===void 0||r.call(a,t),t.atomValues.delete(o),t.nonvalidatedAtoms.set(o,i),t.dirtyAtoms.add(o)}else mp(`Unknown action ${n.type}`)}function Wf(e,t,n){n.state==="hasValue"&&n.contents instanceof _p?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function Q1(e,t){e.replaceState(n=>{const r=G1(n);for(const o of t)KO(e,r,o);return X1(e,r),BO(),r})}function cu(e,t){if(zi.length){const n=zi[zi.length-1];let r=n.get(e);r||n.set(e,r=[]),r.push(t)}else Q1(e,[t])}const zi=[];function qO(){const e=new Map;return zi.push(e),()=>{for(const[t,n]of e)Q1(t,n);zi.pop()}}function G1(e){return ge(te({},e),{atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)})}function X1(e,t){const n=AO(e,t,t.dirtyAtoms);for(const i of n){var r,o;(r=q1(i))===null||r===void 0||(o=r.invalidate)===null||o===void 0||o.call(r,t)}}function Y1(e,t,n){cu(e,{type:"set",recoilValue:t,valueOrUpdater:n})}function QO(e,t,n){if(n instanceof _p)return Y1(e,t,n);cu(e,{type:"setLoadable",recoilValue:t,loadable:n})}function GO(e,t){cu(e,{type:"markModified",recoilValue:t})}function XO(e,t,n){cu(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})}function YO(e,{key:t},n,r=null){const o=MO(),i=e.getState();i.nodeToComponentSubscriptions.has(t)||i.nodeToComponentSubscriptions.set(t,new Map),Le(i.nodeToComponentSubscriptions.get(t)).set(o,[r!=null?r:"",n]);const a=IO();if(a.early&&(a.mode==="LEGACY"||a.mode==="MUTABLE_SOURCE")){const s=e.getState().nextTree;s&&s.dirtyAtoms.has(t)&&n(s)}return{release:()=>{const s=e.getState(),l=s.nodeToComponentSubscriptions.get(t);l===void 0||!l.has(o)||(l.delete(o),l.size===0&&s.nodeToComponentSubscriptions.delete(t))}}}function ZO(e,t){var n;const{currentTree:r}=e.getState(),o=$O(t.key);(n=o.clearCache)===null||n===void 0||n.call(o,e,r)}var vn={RecoilValueReadOnly:jO,AbstractRecoilValue:FO,RecoilState:UO,getRecoilValueAsLoadable:VO,setRecoilValue:Y1,setRecoilValueLoadable:QO,markRecoilValueModified:GO,setUnvalidatedRecoilValue:XO,subscribeToRecoilValue:YO,isRecoilValue:zO,applyAtomValueWrites:WO,batchStart:qO,writeLoadableToTreeState:Wf,invalidateDownstreams:X1,copyTreeState:G1,refreshRecoilValue:ZO};function JO(e,t,n){const r=e.entries();let o=r.next();for(;!o.done;){const i=o.value;if(t.call(n,i[1],i[0],e))return!0;o=r.next()}return!1}var ek=JO;const{cleanUpNode:tk}=br,{deleteNodeConfigIfPossible:nk,getNode:Z1}=wt,{RetentionZone:J1}=uu,rk=12e4,ew=new Set;function tw(e,t){const n=e.getState(),r=n.currentTree;if(n.nextTree)return;const o=new Set;for(const a of t)if(a instanceof J1)for(const s of sk(n,a))o.add(s);else o.add(a);const i=ok(e,o);for(const a of i)ak(e,r,a)}function ok(e,t){const n=e.getState(),r=n.currentTree,o=e.getGraph(r.version),i=new Set,a=new Set;return s(t),i;function s(l){const u=new Set,c=ik(e,r,l,i,a);for(const g of c){var f;if(Z1(g).retainedBy==="recoilRoot"){a.add(g);continue}if(((f=n.retention.referenceCounts.get(g))!==null&&f!==void 0?f:0)>0){a.add(g);continue}if(nw(g).some(b=>n.retention.referenceCounts.get(b))){a.add(g);continue}const y=o.nodeToNodeSubscriptions.get(g);if(y&&ek(y,b=>a.has(b))){a.add(g);continue}i.add(g),u.add(g)}const p=new Set;for(const g of u)for(const y of(h=o.nodeDeps.get(g))!==null&&h!==void 0?h:ew){var h;i.has(y)||p.add(y)}p.size&&s(p)}}function ik(e,t,n,r,o){const i=e.getGraph(t.version),a=[],s=new Set;for(;n.size>0;)l(Le(n.values().next().value));return a;function l(u){if(r.has(u)||o.has(u)){n.delete(u);return}if(s.has(u))return;const c=i.nodeToNodeSubscriptions.get(u);if(c)for(const f of c)l(f);s.add(u),n.delete(u),a.push(u)}}function ak(e,t,n){if(!Ee("recoil_memory_managament_2020"))return;tk(e,n);const r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);const o=nw(n);for(const l of o){var i;(i=r.retention.nodesRetainedByZone.get(l))===null||i===void 0||i.delete(n)}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);const a=r.graphsByVersion.get(t.version);if(a){const l=a.nodeDeps.get(n);if(l!==void 0){a.nodeDeps.delete(n);for(const u of l){var s;(s=a.nodeToNodeSubscriptions.get(u))===null||s===void 0||s.delete(n)}}a.nodeToNodeSubscriptions.delete(n)}nk(n)}function sk(e,t){var n;return(n=e.retention.nodesRetainedByZone.get(t))!==null&&n!==void 0?n:ew}function nw(e){const t=Z1(e).retainedBy;return t===void 0||t==="components"||t==="recoilRoot"?[]:t instanceof J1?[t]:t}function lk(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):tw(e,new Set([t]))}function uk(e,t,n){var r;if(!Ee("recoil_memory_managament_2020"))return;const o=e.getState().retention.referenceCounts,i=((r=o.get(t))!==null&&r!==void 0?r:0)+n;i===0?rw(e,t):o.set(t,i)}function rw(e,t){if(!Ee("recoil_memory_managament_2020"))return;e.getState().retention.referenceCounts.delete(t),lk(e,t)}function ck(e){if(!Ee("recoil_memory_managament_2020"))return;const t=e.getState();tw(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()}function fk(e){return e===void 0?"recoilRoot":e}var Zr={SUSPENSE_TIMEOUT_MS:rk,updateRetainCount:uk,updateRetainCountToZero:rw,releaseScheduledRetainablesNow:ck,retainedByOptionWithDefault:fk};const{unstable_batchedUpdates:dk}=Z0;var pk={unstable_batchedUpdates:dk};const{unstable_batchedUpdates:hk}=pk;var vk={unstable_batchedUpdates:hk};const{batchStart:mk}=vn,{unstable_batchedUpdates:gk}=vk;let xp=gk;const yk=e=>{xp=e},wk=()=>xp,Sk=e=>{xp(()=>{let t=()=>{};try{t=mk(),e()}finally{t()}})};var fu={getBatcher:wk,setBatcher:yk,batchUpdates:Sk};function*bk(e){for(const t of e)for(const n of t)yield n}var ow=bk;const iw=typeof Window=="undefined"||typeof window=="undefined",_k=e=>!iw&&(e===window||e instanceof Window),xk=typeof navigator!="undefined"&&navigator.product==="ReactNative";var Ep={isSSR:iw,isReactNative:xk,isWindow:_k};function Ek(e,t){let n;return(...o)=>{n||(n={});const i=t(...o);return Object.hasOwnProperty.call(n,i)||(n[i]=e(...o)),n[i]}}function Ck(e,t){let n,r;return(...i)=>{const a=t(...i);return n===a||(n=a,r=e(...i)),r}}function Rk(e,t){let n,r;return[(...a)=>{const s=t(...a);return n===s||(n=s,r=e(...a)),r},()=>{n=null}]}var Ok={memoizeWithArgsHash:Ek,memoizeOneWithArgsHash:Ck,memoizeOneWithArgsHashAndInvalidation:Rk};const{batchUpdates:Hf}=fu,{initializeNode:kk,peekNodeInfo:Pk}=br,{graph:Tk}=Aa,{getNextStoreID:Lk}=lu,{DEFAULT_VALUE:Nk,recoilValues:Rm,recoilValuesForKeys:Om}=wt,{AbstractRecoilValue:Ak,getRecoilValueAsLoadable:Dk,setRecoilValue:km,setUnvalidatedRecoilValue:Mk}=vn,{updateRetainCount:Ds}=Zr,{setInvalidateMemoizedSnapshot:$k}=H1,{getNextTreeStateVersion:Ik,makeEmptyStoreState:Fk}=F1,{isSSR:Uk}=Ep,{memoizeOneWithArgsHashAndInvalidation:jk}=Ok;class du{constructor(t,n){ue(this,"_store",void 0),ue(this,"_refCount",1),ue(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),Dk(this._store,r))),ue(this,"getPromise",r=>(this.checkRefCount_INTERNAL(),this.getLoadable(r).toPromise())),ue(this,"getNodes_UNSTABLE",r=>{if(this.checkRefCount_INTERNAL(),(r==null?void 0:r.isModified)===!0){if((r==null?void 0:r.isInitialized)===!1)return[];const a=this._store.getState().currentTree;return Om(a.dirtyAtoms)}const o=this._store.getState().knownAtoms,i=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?Rm.values():r.isInitialized===!0?Om(ow([o,i])):Sp(Rm.values(),({key:a})=>!o.has(a)&&!i.has(a))}),ue(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),Pk(this._store,this._store.getState().currentTree,r))),ue(this,"map",r=>{this.checkRefCount_INTERNAL();const o=new Kf(this,Hf);return r(o),o}),ue(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const o=new Kf(this,Hf);return o.retain(),await r(o),o.autoRelease_INTERNAL(),o}),this._store={storeID:Lk(),parentStoreID:n,getState:()=>t,replaceState:r=>{t.currentTree=r(t.currentTree)},getGraph:r=>{const o=t.graphsByVersion;if(o.has(r))return Le(o.get(r));const i=Tk();return o.set(r,i),i},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw fe("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)kk(this._store,r,"get"),Ds(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0,this._refCount++;let t=!1;return()=>{t||(t=!0,this._release())}}autoRelease_INTERNAL(){Uk||window.setTimeout(()=>this._release(),0)}_release(){if(this._refCount--,this._refCount===0){if(this._store.getState().nodeCleanupFunctions.forEach(t=>t()),this._store.getState().nodeCleanupFunctions.clear(),!Ee("recoil_memory_managament_2020"))return}else this._refCount<0}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){Ee("recoil_memory_managament_2020")&&this._refCount<=0}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}getStoreID(){return this.checkRefCount_INTERNAL(),this._store.storeID}}function aw(e,t,n=!1){const r=e.getState(),o=n?Ik():t.version;return{currentTree:{version:n?o:t.version,stateID:n?o:t.stateID,transactionMetadata:te({},t.transactionMetadata),dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()},commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(o,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(su(r.nodeCleanupFunctions.entries(),([i])=>[i,()=>{}]))}}function zk(e){const t=new du(Fk());return e!=null?t.map(e):t}const[Pm,sw]=jk((e,t)=>{var n;const r=e.getState(),o=t==="latest"?(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree:Le(r.previousTree);return new du(aw(e,o),e.storeID)},(e,t)=>{var n,r;return String(t)+String(e.storeID)+String((n=e.getState().nextTree)===null||n===void 0?void 0:n.version)+String(e.getState().currentTree.version)+String((r=e.getState().previousTree)===null||r===void 0?void 0:r.version)});$k(sw);function Bk(e,t="latest"){const n=Pm(e,t);return n.isRetained()?n:(sw(),Pm(e,t))}class Kf extends du{constructor(t,n){super(aw(t.getStore_INTERNAL(),t.getStore_INTERNAL().getState().currentTree,!0),t.getStoreID()),ue(this,"_batch",void 0),ue(this,"set",(r,o)=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();this._batch(()=>{Ds(i,r.key,1),km(this.getStore_INTERNAL(),r,o)})}),ue(this,"reset",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();this._batch(()=>{Ds(o,r.key,1),km(this.getStore_INTERNAL(),r,Nk)})}),ue(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();Hf(()=>{for(const[i,a]of r.entries())Ds(o,i,1),Mk(o,new Ak(i),a)})}),this._batch=n}}var pu={Snapshot:du,MutableSnapshot:Kf,freshSnapshot:zk,cloneSnapshot:Bk},Vk=pu.Snapshot,Wk=pu.MutableSnapshot,Hk=pu.freshSnapshot,Kk=pu.cloneSnapshot,hu=Object.freeze({__proto__:null,Snapshot:Vk,MutableSnapshot:Wk,freshSnapshot:Hk,cloneSnapshot:Kk});function qk(...e){const t=new Set;for(const n of e)for(const r of n)t.add(r);return t}var Qk=qk;const{useRef:Gk}=Y;function Xk(e){const t=Gk(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var Tm=Xk;const{getNextTreeStateVersion:Yk,makeEmptyStoreState:lw}=F1,{cleanUpNode:Zk,getDownstreamNodes:Jk,initializeNode:eP,setNodeValue:tP,setUnvalidatedAtomValue_DEPRECATED:nP}=br,{graph:rP}=Aa,{cloneGraph:oP}=Aa,{getNextStoreID:uw}=lu,{createMutableSource:wc,reactMode:cw}=Na,{applyAtomValueWrites:iP}=vn,{releaseScheduledRetainablesNow:fw}=Zr,{freshSnapshot:aP}=hu,{useCallback:sP,useContext:dw,useEffect:qf,useMemo:lP,useRef:uP,useState:cP}=Y;function hi(){throw fe("This component must be used inside a component.")}const pw=Object.freeze({storeID:uw(),getState:hi,replaceState:hi,getGraph:hi,subscribeToTransactions:hi,addTransactionMetadata:hi});let Qf=!1;function Lm(e){if(Qf)throw fe("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");const t=e.getState();if(t.nextTree===null){Ee("recoil_memory_managament_2020")&&Ee("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&fw(e);const n=t.currentTree.version,r=Yk();t.nextTree=ge(te({},t.currentTree),{version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}}),t.graphsByVersion.set(r,oP(Le(t.graphsByVersion.get(n))))}}const hw=Y.createContext({current:pw}),vu=()=>dw(hw),vw=Y.createContext(null);function fP(){return dw(vw)}function Cp(e,t,n){const r=Jk(e,n,n.dirtyAtoms);for(const o of r){const i=t.nodeToComponentSubscriptions.get(o);if(i)for(const[a,[s,l]]of i)l(n)}}function mw(e){const t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){for(const[o,i]of t.nodeTransactionSubscriptions)if(r.has(o))for(const[a,s]of i)s(e);for(const[o,i]of t.transactionSubscriptions)i(e);(!cw().early||t.suspendedComponentResolvers.size>0)&&(Cp(e,t,n),t.suspendedComponentResolvers.forEach(o=>o()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(o=>o(n)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function dP(e){const t=e.getState();t.commitDepth++;try{const{nextTree:n}=t;if(n==null)return;t.previousTree=t.currentTree,t.currentTree=n,t.nextTree=null,mw(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):mp("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,Ee("recoil_memory_managament_2020")&&n==null&&fw(e)}finally{t.commitDepth--}}function pP({setNotifyBatcherOfChange:e}){const t=vu(),[,n]=cP([]);return e(()=>n({})),qf(()=>(e(()=>n({})),()=>{e(()=>{})}),[e]),qf(()=>{HR.enqueueExecution("Batcher",()=>{dP(t.current)})}),null}function hP(e,t){const n=lw();return t({set:(r,o)=>{const i=n.currentTree,a=tP(e,i,r.key,o),s=new Set(a.keys()),l=i.nonvalidatedAtoms.clone();for(const u of s)l.delete(u);n.currentTree=ge(te({},i),{dirtyAtoms:Qk(i.dirtyAtoms,s),atomValues:iP(i.atomValues,a),nonvalidatedAtoms:l})},setUnvalidatedAtomValues:r=>{r.forEach((o,i)=>{n.currentTree=nP(n.currentTree,i,o)})}}),n}function vP(e){const t=aP(e),n=t.getStore_INTERNAL().getState();return t.retain(),n.nodeCleanupFunctions.forEach(r=>r()),n.nodeCleanupFunctions.clear(),n}let Nm=0;function mP({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:n,children:r}){let o;const i=h=>{const g=o.current.graphsByVersion;if(g.has(h))return Le(g.get(h));const y=rP();return g.set(h,y),y},a=(h,g)=>{if(g==null){const{transactionSubscriptions:y}=f.current.getState(),b=Nm++;return y.set(b,h),{release:()=>{y.delete(b)}}}else{const{nodeTransactionSubscriptions:y}=f.current.getState();y.has(g)||y.set(g,new Map);const b=Nm++;return Le(y.get(g)).set(b,h),{release:()=>{const v=y.get(g);v&&(v.delete(b),v.size===0&&y.delete(g))}}}},s=h=>{Lm(f.current);for(const g of Object.keys(h))Le(f.current.getState().nextTree).transactionMetadata[g]=h[g]},l=h=>{Lm(f.current);const g=Le(o.current.nextTree);let y;try{Qf=!0,y=h(g)}finally{Qf=!1}y!==g&&(o.current.nextTree=y,cw().early&&Cp(f.current,o.current,y),Le(u.current)())},u=uP(null),c=sP(h=>{u.current=h},[u]),f=Tm(()=>n!=null?n:{storeID:uw(),getState:()=>o.current,replaceState:l,getGraph:i,subscribeToTransactions:a,addTransactionMetadata:s});n!=null&&(f.current=n),o=Tm(()=>e!=null?hP(f.current,e):t!=null?vP(t):lw());const p=lP(()=>wc==null?void 0:wc(o,()=>o.current.currentTree.version),[o]);return qf(()=>{const h=f.current;for(const g of new Set(h.getState().knownAtoms))eP(h,g,"get");return()=>{for(const g of h.getState().knownAtoms)Zk(h,g)}},[f]),Y.createElement(hw.Provider,{value:f},Y.createElement(vw.Provider,{value:p},Y.createElement(pP,{setNotifyBatcherOfChange:c}),r))}function gP(e){const o=e,{override:t}=o,n=xr(o,["override"]),r=vu();return t===!1&&r.current!==pw?e.children:Y.createElement(mP,n)}function yP(){return vu().current.storeID}var Nn={RecoilRoot:gP,useStoreRef:vu,useRecoilMutableSource:fP,useRecoilStoreID:yP,notifyComponents_FOR_TESTING:Cp,sendEndOfBatchNotifications_FOR_TESTING:mw};function wP(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{t.current=e}),t.current}var gw=xP;const{useStoreRef:EP}=Nn,{SUSPENSE_TIMEOUT_MS:CP}=Zr,{updateRetainCount:vi}=Zr,{RetentionZone:RP}=uu,{useEffect:OP,useRef:kP}=Y,{isSSR:Am}=Ep;function PP(e){if(!!Ee("recoil_memory_managament_2020"))return TP(e)}function TP(e){const n=(Array.isArray(e)?e:[e]).map(a=>a instanceof RP?a:a.key),r=EP();OP(()=>{if(!Ee("recoil_memory_managament_2020"))return;const a=r.current;if(o.current&&!Am)window.clearTimeout(o.current),o.current=null;else for(const s of n)vi(a,s,1);return()=>{for(const s of n)vi(a,s,-1)}},[r,...n]);const o=kP(),i=gw(n);if(!Am&&(i===void 0||!SP(i,n))){const a=r.current;for(const s of n)vi(a,s,1);if(i)for(const s of i)vi(a,s,-1);o.current&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null;for(const s of n)vi(a,s,-1)},CP)}}var Rp=PP;function LP(){return""}var Ma=LP;const{batchUpdates:NP}=fu,{DEFAULT_VALUE:yw}=wt,{reactMode:Xo,useMutableSource:AP,useSyncExternalStore:DP}=Na,{useRecoilMutableSource:MP,useStoreRef:mn}=Nn,{AbstractRecoilValue:Gf,getRecoilValueAsLoadable:$a,setRecoilValue:Ol,setUnvalidatedRecoilValue:$P,subscribeToRecoilValue:jo}=vn,{useCallback:gt,useEffect:zo,useMemo:ww,useRef:Bi,useState:Op}=Y,{setByAddingToSet:IP}=j1;function kp(e,t,n){if(e.state==="hasValue")return e.contents;throw e.state==="loading"?new Promise(o=>{n.current.getState().suspendedComponentResolvers.add(o)}):e.state==="hasError"?e.contents:fe(`Invalid value of loadable atom "${t.key}"`)}function FP(){const e=Ma(),t=mn(),[,n]=Op([]),r=Bi(new Set);r.current=new Set;const o=Bi(new Set),i=Bi(new Map),a=gt(l=>{const u=i.current.get(l);u&&(u.release(),i.current.delete(l))},[i]),s=gt((l,u)=>{i.current.has(u)&&n([])},[]);return zo(()=>{const l=t.current;ji(r.current,o.current).forEach(u=>{if(i.current.has(u))return;const c=jo(l,new Gf(u),p=>s(p,u),e);i.current.set(u,c),l.getState().nextTree?l.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{s(l.getState(),u)}):s(l.getState(),u)}),ji(o.current,r.current).forEach(u=>{a(u)}),o.current=r.current}),zo(()=>{const l=i.current;return ji(r.current,new Set(l.keys())).forEach(u=>{const c=jo(t.current,new Gf(u),f=>s(f,u),e);l.set(u,c)}),()=>l.forEach((u,c)=>a(c))},[e,t,a,s]),ww(()=>{function l(g){return y=>{Ol(t.current,g,y)}}function u(g){return()=>Ol(t.current,g,yw)}function c(g){var y;r.current.has(g.key)||(r.current=IP(r.current,g.key));const b=t.current.getState();return $a(t.current,g,Xo().early&&(y=b.nextTree)!==null&&y!==void 0?y:b.currentTree)}function f(g){const y=c(g);return kp(y,g,t)}function p(g){return[f(g),l(g)]}function h(g){return[c(g),l(g)]}return{getRecoilValue:f,getRecoilValueLoadable:c,getRecoilState:p,getRecoilStateLoadable:h,getSetRecoilState:l,getResetRecoilState:u}},[r,t])}const UP={current:0};function jP(e){const t=mn(),n=Ma(),r=gt(()=>{var s;const l=t.current,u=l.getState(),c=Xo().early&&(s=u.nextTree)!==null&&s!==void 0?s:u.currentTree;return{loadable:$a(l,e,c),key:e.key}},[t,e]),o=gt(s=>{let l;return()=>{var u,c;const f=s();return(u=l)!==null&&u!==void 0&&u.loadable.is(f.loadable)&&((c=l)===null||c===void 0?void 0:c.key)===f.key?l:(l=f,f)}},[]),i=ww(()=>o(r),[r,o]),a=gt(s=>{const l=t.current;return jo(l,e,s,n).release},[t,e,n]);return DP(a,i,i).loadable}function zP(e){const t=mn(),n=gt(()=>{var u;const c=t.current,f=c.getState(),p=Xo().early&&(u=f.nextTree)!==null&&u!==void 0?u:f.currentTree;return $a(c,e,p)},[t,e]),r=gt(()=>n(),[n]),o=Ma(),i=gt((u,c)=>{const f=t.current;return jo(f,e,()=>{if(!Ee("recoil_suppress_rerender_in_callback"))return c();const h=n();l.current.is(h)||c(),l.current=h},o).release},[t,e,o,n]),a=MP();if(a==null)throw fe("Recoil hooks must be used in components contained within a component.");const s=AP(a,r,i),l=Bi(s);return zo(()=>{l.current=s}),s}function Sw(e){const t=mn(),n=Ma(),r=gt(()=>{var l;const u=t.current,c=u.getState(),f=Xo().early&&(l=c.nextTree)!==null&&l!==void 0?l:c.currentTree;return $a(u,e,f)},[t,e]),o=gt(()=>({loadable:r(),key:e.key}),[r,e.key]),i=gt(l=>{const u=o();return l.loadable.is(u.loadable)&&l.key===u.key?l:u},[o]);zo(()=>{const l=jo(t.current,e,u=>{s(i)},n);return s(i),l.release},[n,e,t,i]);const[a,s]=Op(o);return a.key!==e.key?o().loadable:a.loadable}function BP(e){const t=mn(),[,n]=Op([]),r=Ma(),o=gt(()=>{var s;const l=t.current,u=l.getState(),c=Xo().early&&(s=u.nextTree)!==null&&s!==void 0?s:u.currentTree;return $a(l,e,c)},[t,e]),i=o(),a=Bi(i);return zo(()=>{a.current=i}),zo(()=>{const s=t.current,l=s.getState(),u=jo(s,e,f=>{var p;if(!Ee("recoil_suppress_rerender_in_callback"))return n([]);const h=o();(p=a.current)!==null&&p!==void 0&&p.is(h)||n(h),a.current=h},r);if(l.nextTree)s.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a.current=null,n([])});else{var c;if(!Ee("recoil_suppress_rerender_in_callback"))return n([]);const f=o();(c=a.current)!==null&&c!==void 0&&c.is(f)||n(f),a.current=f}return u.release},[r,o,e,t]),i}function Pp(e){return Ee("recoil_memory_managament_2020")&&Rp(e),{TRANSITION_SUPPORT:Sw,SYNC_EXTERNAL_STORE:jP,MUTABLE_SOURCE:zP,LEGACY:BP}[Xo().mode](e)}function bw(e){const t=mn(),n=Pp(e);return kp(n,e,t)}function mu(e){const t=mn();return gt(n=>{Ol(t.current,e,n)},[t,e])}function VP(e){const t=mn();return gt(()=>{Ol(t.current,e,yw)},[t,e])}function WP(e){return[bw(e),mu(e)]}function HP(e){return[Pp(e),mu(e)]}function KP(){const e=mn();return(t,n={})=>{NP(()=>{e.current.addTransactionMetadata(n),t.forEach((r,o)=>$P(e.current,new Gf(o),r))})}}function _w(e){return Ee("recoil_memory_managament_2020")&&Rp(e),Sw(e)}function xw(e){const t=mn(),n=_w(e);return kp(n,e,t)}function qP(e){return[xw(e),mu(e)]}var QP={recoilComponentGetRecoilValueCount_FOR_TESTING:UP,useRecoilInterface:FP,useRecoilState:WP,useRecoilStateLoadable:HP,useRecoilValue:bw,useRecoilValueLoadable:Pp,useResetRecoilState:VP,useSetRecoilState:mu,useSetUnvalidatedAtomValues:KP,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:_w,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:xw,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:qP};function GP(e,t){const n=new Map;for(const[r,o]of e)t(o,r)&&n.set(r,o);return n}var XP=GP;function YP(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n}var ZP=YP;function JP(...e){const t=new Map;for(let n=0;nt.current.subscribeToTransactions(e).release,[e,t])}function $m(e){const t=e.atomValues.toMap(),n=Rl(XP(t,(r,o)=>{const a=Ew(o).persistence_UNSTABLE;return a!=null&&a.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return eT(e.nonvalidatedAtoms.toMap(),n)}function lT(e){yu(gu(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(n=t.getState().currentTree);const o=$m(r),i=$m(n),a=Rl(rT,l=>{var u,c,f,p;return{persistence_UNSTABLE:{type:(u=(c=l.persistence_UNSTABLE)===null||c===void 0?void 0:c.type)!==null&&u!==void 0?u:"none",backButton:(f=(p=l.persistence_UNSTABLE)===null||p===void 0?void 0:p.backButton)!==null&&f!==void 0?f:!1}}}),s=ZP(r.dirtyAtoms,l=>o.has(l)||i.has(l));e({atomValues:o,previousAtomValues:i,atomInfo:a,modifiedAtoms:s,transactionMetadata:te({},r.transactionMetadata)})},[e]))}function uT(e){yu(gu(t=>{const n=kl(t,"latest"),r=kl(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))}function cT(){const e=Tp(),[t,n]=sT(()=>kl(e.current)),r=gw(t),o=Dm(),i=Dm();if(yu(gu(s=>n(kl(s)),[])),Cw(()=>{const s=t.retain();if(o.current&&!Mm){var l;window.clearTimeout(o.current),o.current=null,(l=i.current)===null||l===void 0||l.call(i),i.current=null}return s},[t]),r!==t&&!Mm){if(o.current){var a;window.clearTimeout(o.current),o.current=null,(a=i.current)===null||a===void 0||a.call(i),i.current=null}i.current=t.retain(),o.current=window.setTimeout(()=>{var s;o.current=null,(s=i.current)===null||s===void 0||s.call(i),i.current=null},aT)}return t}function Rw(e,t){var n;const r=e.getState(),o=(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree,i=t.getStore_INTERNAL().getState().currentTree;tT(()=>{const a=new Set;for(const u of[o.atomValues.keys(),i.atomValues.keys()])for(const c of u){var s,l;((s=o.atomValues.get(c))===null||s===void 0?void 0:s.contents)!==((l=i.atomValues.get(c))===null||l===void 0?void 0:l.contents)&&Ew(c).shouldRestoreFromSnapshots&&a.add(c)}a.forEach(u=>{iT(e,new oT(u),i.atomValues.has(u)?Le(i.atomValues.get(u)):nT)}),e.replaceState(u=>ge(te({},u),{stateID:t.getID()}))})}function fT(){const e=Tp();return gu(t=>Rw(e.current,t),[e])}var Ow={useRecoilSnapshot:cT,gotoSnapshot:Rw,useGotoRecoilSnapshot:fT,useRecoilTransactionObserver:uT,useTransactionObservation_DEPRECATED:lT,useTransactionSubscription_DEPRECATED:yu};const{peekNodeInfo:dT}=br,{useStoreRef:pT}=Nn;function hT(){const e=pT();return({key:t})=>dT(e.current,e.current.getState().currentTree,t)}var vT=hT;const{reactMode:mT}=Na,{RecoilRoot:gT,useStoreRef:yT}=Nn,{useMemo:wT}=Y;function ST(){mT().mode==="MUTABLE_SOURCE"&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode. Please consider upgrading to recoil_sync_external_store mode.");const e=yT().current;return wT(()=>{function t({children:n}){return Y.createElement(gT,{store_INTERNAL:e},n)}return t},[e])}var bT=ST;const{loadableWithValue:_T}=La,{initializeNode:xT}=br,{DEFAULT_VALUE:ET,getNode:CT}=wt,{copyTreeState:RT,getRecoilValueAsLoadable:OT,invalidateDownstreams:kT,writeLoadableToTreeState:PT}=vn;function Im(e){return CT(e.key).nodeType==="atom"}class TT{constructor(t,n){ue(this,"_store",void 0),ue(this,"_treeState",void 0),ue(this,"_changes",void 0),ue(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!Im(r))throw fe("Reading selectors within atomicUpdate is not supported");const o=OT(this._store,r,this._treeState);if(o.state==="hasValue")return o.contents;throw o.state==="hasError"?o.contents:fe(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),ue(this,"set",(r,o)=>{if(!Im(r))throw fe("Setting selectors within atomicUpdate is not supported");if(typeof o=="function"){const i=this.get(r);this._changes.set(r.key,o(i))}else xT(this._store,r.key,"set"),this._changes.set(r.key,o)}),ue(this,"reset",r=>{this.set(r,ET)}),this._store=t,this._treeState=n,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=RT(this._treeState);for(const[n,r]of this._changes)PT(t,n,_T(r));return kT(this._store,t),t}}function LT(e){return t=>{e.replaceState(n=>{const r=new TT(e,n);return t(r),r.newTreeState_INTERNAL()})}}var NT={atomicUpdater:LT},AT=NT.atomicUpdater,kw=Object.freeze({__proto__:null,atomicUpdater:AT});function DT(e,t){if(!e)throw new Error(t)}var MT=DT,Ei=MT;const{atomicUpdater:$T}=kw,{batchUpdates:IT}=fu,{DEFAULT_VALUE:FT}=wt,{useStoreRef:UT}=Nn,{refreshRecoilValue:jT,setRecoilValue:Fm}=vn,{cloneSnapshot:zT}=hu,{gotoSnapshot:BT}=Ow,{useCallback:VT}=Y;class Pw{}const WT=new Pw;function Tw(e,t,n,r){let o=WT,i;if(IT(()=>{const s="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if(typeof t!="function")throw fe(s);const l=z1(ge(te({},r!=null?r:{}),{set:(c,f)=>Fm(e,c,f),reset:c=>Fm(e,c,FT),refresh:c=>jT(e,c),gotoSnapshot:c=>BT(e,c),transact_UNSTABLE:c=>$T(e)(c)}),{snapshot:()=>{const c=zT(e);return i=c.retain(),c}}),u=t(l);if(typeof u!="function")throw fe(s);o=u(...n)}),o instanceof Pw&&Ei(!1),Te(o))o.finally(()=>{var s;(s=i)===null||s===void 0||s()});else{var a;(a=i)===null||a===void 0||a()}return o}function HT(e,t){const n=UT();return VT((...r)=>Tw(n.current,e,r),t!=null?[...t,n]:void 0)}var Lw={recoilCallback:Tw,useRecoilCallback:HT};const{useStoreRef:KT}=Nn,{refreshRecoilValue:qT}=vn,{useCallback:QT}=Y;function GT(e){const t=KT();return QT(()=>{const n=t.current;qT(n,e)},[e,t])}var XT=GT;const{atomicUpdater:YT}=kw,{useStoreRef:ZT}=Nn,{useMemo:JT}=Y;function eL(e,t){const n=ZT();return JT(()=>(...r)=>{YT(n.current)(i=>{e(i)(...r)})},t!=null?[...t,n]:void 0)}var tL=eL;class nL{constructor(t){ue(this,"value",void 0),this.value=t}}var rL={WrappedValue:nL},oL=rL.WrappedValue,Nw=Object.freeze({__proto__:null,WrappedValue:oL});const{isFastRefreshEnabled:iL}=Na;class Um extends Error{}class aL{constructor(t){var n,r,o;ue(this,"_name",void 0),ue(this,"_numLeafs",void 0),ue(this,"_root",void 0),ue(this,"_onHit",void 0),ue(this,"_onSet",void 0),ue(this,"_mapNodeValue",void 0),this._name=t==null?void 0:t.name,this._numLeafs=0,this._root=null,this._onHit=(n=t==null?void 0:t.onHit)!==null&&n!==void 0?n:()=>{},this._onSet=(r=t==null?void 0:t.onSet)!==null&&r!==void 0?r:()=>{},this._mapNodeValue=(o=t==null?void 0:t.mapNodeValue)!==null&&o!==void 0?o:i=>i}size(){return this._numLeafs}root(){return this._root}get(t,n){var r;return(r=this.getLeafNode(t,n))===null||r===void 0?void 0:r.value}getLeafNode(t,n){if(this._root==null)return;let r=this._root;for(;r;){if(n==null||n.onNodeVisit(r),r.type==="leaf")return this._onHit(r),r;const o=this._mapNodeValue(t(r.nodeKey));r=r.branches.get(o)}}set(t,n,r){const o=()=>{var i,a,s,l;let u,c;for(const[b,v]of t){var f,p,h;const d=this._root;if((d==null?void 0:d.type)==="leaf")throw this.invalidCacheError();const m=u;if(u=m?m.branches.get(c):d,u=(f=u)!==null&&f!==void 0?f:{type:"branch",nodeKey:b,parent:m,branches:new Map,branchKey:c},u.type!=="branch"||u.nodeKey!==b)throw this.invalidCacheError();m==null||m.branches.set(c,u),r==null||(p=r.onNodeVisit)===null||p===void 0||p.call(r,u),c=this._mapNodeValue(v),this._root=(h=this._root)!==null&&h!==void 0?h:u}const g=u?(i=u)===null||i===void 0?void 0:i.branches.get(c):this._root;if(g!=null&&(g.type!=="leaf"||g.branchKey!==c))throw this.invalidCacheError();const y={type:"leaf",value:n,parent:u,branchKey:c};(a=u)===null||a===void 0||a.branches.set(c,y),this._root=(s=this._root)!==null&&s!==void 0?s:y,this._numLeafs++,this._onSet(y),r==null||(l=r.onNodeVisit)===null||l===void 0||l.call(r,y)};try{o()}catch(i){if(i instanceof Um)this.clear(),o();else throw i}}delete(t){const n=this.root();if(!n)return!1;if(t===n)return this._root=null,this._numLeafs=0,!0;let r=t.parent,o=t.branchKey;for(;r;){var i;if(r.branches.delete(o),r===n)return r.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;o=(i=r)===null||i===void 0?void 0:i.branchKey,r=r.parent}for(;r!==n;r=r.parent)if(r==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){const t=iL()?"Possible Fast Refresh module reload detected. This may also be caused by an selector returning inconsistent values. Resetting cache.":"Invalid cache values. This happens when selectors do not return consistent values for the same input dependency values. That may also be caused when using Fast Refresh to change a selector implementation. Resetting cache.";throw mp(t+(this._name!=null?` - ${this._name}`:"")),new Um}}var sL={TreeCache:aL},lL=sL.TreeCache,Aw=Object.freeze({__proto__:null,TreeCache:lL});class uL{constructor(t){var n;ue(this,"_maxSize",void 0),ue(this,"_size",void 0),ue(this,"_head",void 0),ue(this,"_tail",void 0),ue(this,"_map",void 0),ue(this,"_keyMapper",void 0),this._maxSize=t.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(n=t.mapKey)!==null&&n!==void 0?n:r=>r}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(t){return this._map.has(this._keyMapper(t))}get(t){const n=this._keyMapper(t),r=this._map.get(n);if(!!r)return this.set(t,r.value),r.value}set(t,n){const r=this._keyMapper(t);this._map.get(r)&&this.delete(t);const i=this.head(),a={key:t,right:i,left:null,value:n};i?i.left=a:this._tail=a,this._map.set(r,a),this._head=a,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const t=this.tail();t&&this.delete(t.key)}delete(t){const n=this._keyMapper(t);if(!this._size||!this._map.has(n))return;const r=Le(this._map.get(n)),o=r.right,i=r.left;o&&(o.left=r.left),i&&(i.right=r.right),r===this.head()&&(this._head=o),r===this.tail()&&(this._tail=i),this._map.delete(n),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var cL={LRUCache:uL},fL=cL.LRUCache,Dw=Object.freeze({__proto__:null,LRUCache:fL});const{LRUCache:dL}=Dw,{TreeCache:pL}=Aw;function hL({name:e,maxSize:t,mapNodeValue:n=r=>r}){const r=new dL({maxSize:t}),o=new pL({name:e,mapNodeValue:n,onHit:i=>{r.set(i,!0)},onSet:i=>{const a=r.tail();r.set(i,!0),a&&o.size()>t&&o.delete(a.key)}});return o}var jm=hL;function Ht(e,t,n){if(typeof e=="string"&&!e.includes('"')&&!e.includes("\\"))return`"${e}"`;switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if((t==null?void 0:t.allowFunctions)!==!0)throw fe("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(e===null)return"null";if(typeof e!="object"){var r;return(r=JSON.stringify(e))!==null&&r!==void 0?r:""}if(Te(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((o,i)=>Ht(o,t,i.toString()))}]`;if(typeof e.toJSON=="function")return Ht(e.toJSON(n),t,n);if(e instanceof Map){const o={};for(const[i,a]of e)o[typeof i=="string"?i:Ht(i,t)]=a;return Ht(o,t,n)}return e instanceof Set?Ht(Array.from(e).sort((o,i)=>Ht(o,t).localeCompare(Ht(i,t))),t,n):Symbol!==void 0&&e[Symbol.iterator]!=null&&typeof e[Symbol.iterator]=="function"?Ht(Array.from(e),t,n):`{${Object.keys(e).filter(o=>e[o]!==void 0).sort().map(o=>`${Ht(o,t)}:${Ht(e[o],t,o)}`).join(",")}}`}function vL(e,t={allowFunctions:!1}){return Ht(e,t)}var wu=vL;const{TreeCache:mL}=Aw,ss={equality:"reference",eviction:"keep-all",maxSize:1/0};function gL({equality:e=ss.equality,eviction:t=ss.eviction,maxSize:n=ss.maxSize}=ss,r){const o=yL(e);return wL(t,n,o,r)}function yL(e){switch(e){case"reference":return t=>t;case"value":return t=>wu(t)}throw fe(`Unrecognized equality policy ${e}`)}function wL(e,t,n,r){switch(e){case"keep-all":return new mL({name:r,mapNodeValue:n});case"lru":return jm({name:r,maxSize:Le(t),mapNodeValue:n});case"most-recent":return jm({name:r,maxSize:1,mapNodeValue:n})}throw fe(`Unrecognized eviction policy ${e}`)}var SL=gL;function bL(e){return()=>null}var _L={startPerfBlock:bL};const{isLoadable:xL,loadableWithError:ls,loadableWithPromise:EL,loadableWithValue:Sc}=La,{WrappedValue:Mw}=Nw,{getNodeLoadable:us,peekNodeLoadable:CL,setNodeValue:RL}=br,{saveDepsToStore:OL}=Aa,{DEFAULT_VALUE:kL,getConfigDeletionHandler:PL,getNode:TL,registerNode:zm}=wt,{isRecoilValue:LL}=Uo,{markRecoilValueModified:Bm}=vn,{retainedByOptionWithDefault:NL}=Zr,{recoilCallback:AL}=Lw,{startPerfBlock:DL}=_L;class $w{}const mi=new $w,gi=[],cs=new Map,ML=(()=>{let e=0;return()=>e++})();function Iw(e){let t=null;const{key:n,get:r,cachePolicy_UNSTABLE:o}=e,i=e.set!=null?e.set:void 0,a=new Set,s=SL(o!=null?o:{equality:"reference",eviction:"keep-all"},n),l=NL(e.retainedBy_UNSTABLE),u=new Map;let c=0;function f(){return!Ee("recoil_memory_managament_2020")||c>0}function p(_){return _.getState().knownSelectors.add(n),c++,()=>{c--}}function h(){return PL(n)!==void 0&&!f()}function g(_,V,B,ee,H){U(V,ee,H),y(_,B)}function y(_,V){w(_,V)&&X(_),v(V,!0)}function b(_,V){w(_,V)&&(Le(D(_)).stateVersions.clear(),v(V,!1))}function v(_,V){const B=cs.get(_);if(B!=null){for(const ee of B)Bm(ee,Le(t));V&&cs.delete(_)}}function d(_,V){let B=cs.get(V);B==null&&cs.set(V,B=new Set),B.add(_)}function m(_,V,B,ee,H,ne){return V.then(le=>{if(!f())throw X(_),mi;const Z=Sc(le);return g(_,B,H,Z,ee),le}).catch(le=>{if(!f())throw X(_),mi;if(Te(le))return S(_,le,B,ee,H,ne);const Z=ls(le);throw g(_,B,H,Z,ee),le})}function S(_,V,B,ee,H,ne){return V.then(le=>{if(!f())throw X(_),mi;ne.loadingDepKey!=null&&ne.loadingDepPromise===V?B.atomValues.set(ne.loadingDepKey,Sc(le)):_.getState().knownSelectors.forEach(ve=>{B.atomValues.delete(ve)});const Z=A(_,B);if(Z&&Z.state!=="loading"){if((w(_,H)||D(_)==null)&&y(_,H),Z.state==="hasValue")return Z.contents;throw Z.contents}if(!w(_,H)){const ve=I(_,B);if(ve!=null)return ve.loadingLoadable.contents}const[Se,xe]=O(_,B,H);if(Se.state!=="loading"&&g(_,B,H,Se,xe),Se.state==="hasError")throw Se.contents;return Se.contents}).catch(le=>{if(le instanceof $w)throw mi;if(!f())throw X(_),mi;const Z=ls(le);throw g(_,B,H,Z,ee),le})}function E(_,V,B,ee){var H,ne,le,Z;if(w(_,ee)||V.version===((H=_.getState())===null||H===void 0||(ne=H.currentTree)===null||ne===void 0?void 0:ne.version)||V.version===((le=_.getState())===null||le===void 0||(Z=le.nextTree)===null||Z===void 0?void 0:Z.version)){var Se,xe,ve;OL(n,B,_,(Se=(xe=_.getState())===null||xe===void 0||(ve=xe.nextTree)===null||ve===void 0?void 0:ve.version)!==null&&Se!==void 0?Se:_.getState().currentTree.version)}for(const re of B)a.add(re)}function O(_,V,B){const ee=DL(n);let H=!0,ne=!0;const le=()=>{ee(),ne=!1};let Z,Se=!1,xe;const ve={loadingDepKey:null,loadingDepPromise:null},re=new Map;function Ae({key:ct}){const St=us(_,V,ct);switch(re.set(ct,St),H||(E(_,V,new Set(re.keys()),B),b(_,B)),St.state){case"hasValue":return St.contents;case"hasError":throw St.contents;case"loading":throw ve.loadingDepKey=ct,ve.loadingDepPromise=St.contents,St.contents}throw fe("Invalid Loadable state")}const gn=ct=>(...St)=>{if(ne)throw fe("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated. It can be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");return t==null&&Ei(!1),AL(_,ct,St,{node:t})};try{Z=r({get:Ae,getCallback:gn}),Z=LL(Z)?Ae(Z):Z,xL(Z)&&(Z.state==="hasError"&&(Se=!0),Z=Z.contents),Te(Z)?Z=m(_,Z,V,re,B,ve).finally(le):le(),Z=Z instanceof Mw?Z.value:Z}catch(ct){Z=ct,Te(Z)?Z=S(_,Z,V,re,B,ve).finally(le):(Se=!0,le())}return Se?xe=ls(Z):Te(Z)?xe=EL(Z):xe=Sc(Z),H=!1,J(_,B,re),E(_,V,new Set(re.keys()),B),[xe,re]}function A(_,V){let B=V.atomValues.get(n);if(B!=null)return B;const ee=new Set;try{B=s.get(ne=>(typeof ne!="string"&&Ei(!1),us(_,V,ne).contents),{onNodeVisit:ne=>{ne.type==="branch"&&ne.nodeKey!==n&&ee.add(ne.nodeKey)}})}catch(ne){throw fe(`Problem with cache lookup for selector "${n}": ${ne.message}`)}if(B){var H;V.atomValues.set(n,B),E(_,V,ee,(H=D(_))===null||H===void 0?void 0:H.executionID)}return B}function P(_,V){const B=A(_,V);if(B!=null)return X(_),B;const ee=I(_,V);if(ee!=null){var H;return((H=ee.loadingLoadable)===null||H===void 0?void 0:H.state)==="loading"&&d(_,ee.executionID),ee.loadingLoadable}const ne=ML(),[le,Z]=O(_,V,ne);return le.state==="loading"?(W(_,ne,le,Z,V),d(_,ne)):(X(_),U(V,le,Z)),le}function I(_,V){const B=ow([u.has(_)?[Le(u.get(_))]:[],su(Sp(u,([H])=>H!==_),([,H])=>H)]);function ee(H){for(const[ne,le]of H)if(!us(_,V,ne).is(le))return!0;return!1}for(const H of B){if(H.stateVersions.get(V.version)||!ee(H.depValuesDiscoveredSoFarDuringAsyncWork))return H.stateVersions.set(V.version,!0),H;H.stateVersions.set(V.version,!1)}}function D(_){return u.get(_)}function W(_,V,B,ee,H){u.set(_,{depValuesDiscoveredSoFarDuringAsyncWork:ee,executionID:V,loadingLoadable:B,stateVersions:new Map([[H.version,!0]])})}function J(_,V,B){if(w(_,V)){const ee=D(_);ee!=null&&(ee.depValuesDiscoveredSoFarDuringAsyncWork=B)}}function X(_){u.delete(_)}function w(_,V){var B;return V===((B=D(_))===null||B===void 0?void 0:B.executionID)}function T(_){return Array.from(_.entries()).map(([V,B])=>[V,B.contents])}function U(_,V,B){_.atomValues.set(n,V);try{s.set(T(B),V)}catch(ee){throw fe(`Problem with setting cache for selector "${n}": ${ee.message}`)}}function k(_){if(gi.includes(n)){const V=`Recoil selector has circular dependencies: ${gi.slice(gi.indexOf(n)).join(" \u2192 ")}`;return ls(fe(V))}gi.push(n);try{return _()}finally{gi.pop()}}function L(_,V){const B=V.atomValues.get(n);return B!=null?B:s.get(ee=>{var H;return typeof ee!="string"&&Ei(!1),(H=CL(_,V,ee))===null||H===void 0?void 0:H.contents})}function M(_,V){return k(()=>P(_,V))}function $(_){_.atomValues.delete(n)}function F(_,V){t==null&&Ei(!1);for(const ee of a){var B;const H=TL(ee);(B=H.clearCache)===null||B===void 0||B.call(H,_,V)}a.clear(),$(V),s.clear(),Bm(_,t)}return i!=null?t=zm({key:n,nodeType:"selector",peek:L,get:M,set:(V,B,ee)=>{let H=!1;const ne=new Map;function le({key:ve}){if(H)throw fe("Recoil: Async selector sets are not currently supported.");const re=us(V,B,ve);if(re.state==="hasValue")return re.contents;if(re.state==="loading"){const Ae=`Getting value of asynchronous atom or selector "${ve}" in a pending state while setting selector "${n}" is not yet supported.`;throw fe(Ae)}else throw re.contents}function Z(ve,re){if(H)throw fe("Recoil: Async selector sets are not currently supported.");const Ae=typeof re=="function"?re(le(ve)):re;RL(V,B,ve.key,Ae).forEach((ct,St)=>ne.set(St,ct))}function Se(ve){Z(ve,kL)}const xe=i({set:Z,get:le,reset:Se},ee);if(xe!==void 0)throw Te(xe)?fe("Recoil: Async selector sets are not currently supported."):fe("Recoil: selector set should be a void function.");return H=!0,ne},init:p,invalidate:$,clearCache:F,shouldDeleteConfigOnRelease:h,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l}):t=zm({key:n,nodeType:"selector",peek:L,get:M,init:p,invalidate:$,clearCache:F,shouldDeleteConfigOnRelease:h,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l})}Iw.value=e=>new Mw(e);var Bo=Iw;const{isLoadable:$L,loadableWithError:bc,loadableWithPromise:_c,loadableWithValue:io}=La,{WrappedValue:Fw}=Nw,{peekNodeInfo:IL}=br,{DEFAULT_VALUE:Lr,DefaultValue:jn,getConfigDeletionHandler:Uw,registerNode:FL,setConfigDeletionHandler:UL}=wt,{isRecoilValue:jL}=Uo,{getRecoilValueAsLoadable:zL,markRecoilValueModified:BL,setRecoilValue:Vm,setRecoilValueLoadable:VL}=vn,{retainedByOptionWithDefault:WL}=Zr,yi=e=>e instanceof Fw?e.value:e;function HL(e){const{key:t,persistence_UNSTABLE:n}=e,r=WL(e.retainedBy_UNSTABLE);let o=0;function i(d){return _c(d.then(m=>(a=io(m),m)).catch(m=>{throw a=bc(m),m}))}let a=Te(e.default)?i(e.default):$L(e.default)?e.default.state==="loading"?i(e.default.contents):e.default:io(yi(e.default));a.contents;let s;const l=new Map;function u(d){return d}function c(d,m){const S=m.then(E=>{var O,A;return((A=((O=d.getState().nextTree)!==null&&O!==void 0?O:d.getState().currentTree).atomValues.get(t))===null||A===void 0?void 0:A.contents)===S&&Vm(d,v,E),E}).catch(E=>{var O,A;throw((A=((O=d.getState().nextTree)!==null&&O!==void 0?O:d.getState().currentTree).atomValues.get(t))===null||A===void 0?void 0:A.contents)===S&&VL(d,v,bc(E)),E});return S}function f(d,m,S){var E;o++;const O=()=>{var D;o--,(D=l.get(d))===null||D===void 0||D.forEach(W=>W()),l.delete(d)};if(d.getState().knownAtoms.add(t),a.state==="loading"){const D=()=>{var W;((W=d.getState().nextTree)!==null&&W!==void 0?W:d.getState().currentTree).atomValues.has(t)||BL(d,v)};a.contents.finally(D)}const A=(E=e.effects)!==null&&E!==void 0?E:e.effects_UNSTABLE;if(A!=null){let w=function($){if(W&&$.key===t){const F=D;return F instanceof jn?p(d,m):Te(F)?_c(F.then(_=>_ instanceof jn?a.toPromise():_)):io(F)}return zL(d,$)},T=function($){return w($).toPromise()},U=function($){var F;const _=IL(d,(F=d.getState().nextTree)!==null&&F!==void 0?F:d.getState().currentTree,$.key);return W&&$.key===t&&!(D instanceof jn)?ge(te({},_),{isSet:!0,loadable:w($)}):_},D=Lr,W=!0,J=!1,X=null;const k=$=>F=>{if(W){const _=w(v),V=_.state==="hasValue"?_.contents:Lr;D=typeof F=="function"?F(V):F,Te(D)&&(D=D.then(B=>(X={effect:$,value:B},B)))}else{if(Te(F))throw fe("Setting atoms to async values is not implemented.");typeof F!="function"&&(X={effect:$,value:yi(F)}),Vm(d,v,typeof F=="function"?_=>{const V=yi(F(_));return X={effect:$,value:V},V}:yi(F))}},L=$=>()=>k($)(Lr),M=$=>F=>{var _;const{release:V}=d.subscribeToTransactions(B=>{var ee;let{currentTree:H,previousTree:ne}=B.getState();ne||(ne=H);const le=(ee=H.atomValues.get(t))!==null&&ee!==void 0?ee:a;if(le.state==="hasValue"){var Z,Se,xe,ve;const re=le.contents,Ae=(Z=ne.atomValues.get(t))!==null&&Z!==void 0?Z:a,gn=Ae.state==="hasValue"?Ae.contents:Lr;((Se=X)===null||Se===void 0?void 0:Se.effect)!==$||((xe=X)===null||xe===void 0?void 0:xe.value)!==re?F(re,gn,!H.atomValues.has(t)):((ve=X)===null||ve===void 0?void 0:ve.effect)===$&&(X=null)}},t);l.set(d,[...(_=l.get(d))!==null&&_!==void 0?_:[],V])};for(const $ of A)try{const F=$({node:v,storeID:d.storeID,parentStoreID_UNSTABLE:d.parentStoreID,trigger:S,setSelf:k($),resetSelf:L($),onSet:M($),getPromise:T,getLoadable:w,getInfo_UNSTABLE:U});if(F!=null){var P;l.set(d,[...(P=l.get(d))!==null&&P!==void 0?P:[],F])}}catch(F){D=F,J=!0}if(W=!1,!(D instanceof jn)){var I;const $=J?bc(D):Te(D)?_c(c(d,D)):io(yi(D));$.contents,m.atomValues.set(t,$),(I=d.getState().nextTree)===null||I===void 0||I.atomValues.set(t,$)}}return O}function p(d,m){var S,E;return(S=(E=m.atomValues.get(t))!==null&&E!==void 0?E:s)!==null&&S!==void 0?S:a}function h(d,m){if(m.atomValues.has(t))return Le(m.atomValues.get(t));if(m.nonvalidatedAtoms.has(t)){if(s!=null)return s;if(n==null)return a;const S=m.nonvalidatedAtoms.get(t),E=n.validator(S,Lr);return s=E instanceof jn?a:io(E),s}else return a}function g(){s=void 0}function y(d,m,S){if(m.atomValues.has(t)){const E=Le(m.atomValues.get(t));if(E.state==="hasValue"&&S===E.contents)return new Map}else if(!m.nonvalidatedAtoms.has(t)&&S instanceof jn)return new Map;return s=void 0,new Map().set(t,io(S))}function b(){return Uw(t)!==void 0&&o<=0}const v=FL({key:t,nodeType:"atom",peek:p,get:h,set:y,init:f,invalidate:g,shouldDeleteConfigOnRelease:b,dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return v}function Lp(e){const t=xr(e,[]),n="default"in e?e.default:new Promise(()=>{});return jL(n)?KL(ge(te({},t),{default:n})):HL(ge(te({},t),{default:n}))}function KL(e){const t=Lp(ge(te({},e),{default:Lr,persistence_UNSTABLE:e.persistence_UNSTABLE===void 0?void 0:ge(te({},e.persistence_UNSTABLE),{validator:r=>r instanceof jn?r:Le(e.persistence_UNSTABLE).validator(r,Lr)}),effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE})),n=Bo({key:`${e.key}__withFallback`,get:({get:r})=>{const o=r(t);return o instanceof jn?e.default:o},set:({set:r},o)=>r(t,o),dangerouslyAllowMutability:e.dangerouslyAllowMutability});return UL(n.key,Uw(e.key)),n}Lp.value=e=>new Fw(e);var jw=Lp;class qL{constructor(t){var n;ue(this,"_map",void 0),ue(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(n=t==null?void 0:t.mapKey)!==null&&n!==void 0?n:r=>r}size(){return this._map.size}has(t){return this._map.has(this._keyMapper(t))}get(t){return this._map.get(this._keyMapper(t))}set(t,n){this._map.set(this._keyMapper(t),n)}delete(t){this._map.delete(this._keyMapper(t))}clear(){this._map.clear()}}var QL={MapCache:qL},GL=QL.MapCache,XL=Object.freeze({__proto__:null,MapCache:GL});const{LRUCache:Wm}=Dw,{MapCache:YL}=XL,fs={equality:"reference",eviction:"none",maxSize:1/0};function ZL({equality:e=fs.equality,eviction:t=fs.eviction,maxSize:n=fs.maxSize}=fs){const r=JL(e);return eN(t,n,r)}function JL(e){switch(e){case"reference":return t=>t;case"value":return t=>wu(t)}throw fe(`Unrecognized equality policy ${e}`)}function eN(e,t,n){switch(e){case"keep-all":return new YL({mapKey:n});case"lru":return new Wm({mapKey:n,maxSize:Le(t)});case"most-recent":return new Wm({mapKey:n,maxSize:1})}throw fe(`Unrecognized eviction policy ${e}`)}var zw=ZL;const{setConfigDeletionHandler:tN}=wt;function nN(e){var t,n;const r=zw({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i,a;const s=r.get(o);if(s!=null)return s;const p=e,{cachePolicyForParams_UNSTABLE:l}=p,u=xr(p,["cachePolicyForParams_UNSTABLE"]),c="default"in e?e.default:new Promise(()=>{}),f=jw(ge(te({},u),{key:`${e.key}__${(i=wu(o))!==null&&i!==void 0?i:"void"}`,default:typeof c=="function"?c(o):c,retainedBy_UNSTABLE:typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE,effects:typeof e.effects=="function"?e.effects(o):typeof e.effects_UNSTABLE=="function"?e.effects_UNSTABLE(o):(a=e.effects)!==null&&a!==void 0?a:e.effects_UNSTABLE}));return r.set(o,f),tN(f.key,()=>{r.delete(o)}),f}}var rN=nN;const{setConfigDeletionHandler:oN}=wt;let iN=0;function aN(e){var t,n;const r=zw({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return o=>{var i;let a;try{a=r.get(o)}catch(p){throw fe(`Problem with cache lookup for selector ${e.key}: ${p.message}`)}if(a!=null)return a;const s=`${e.key}__selectorFamily/${(i=wu(o,{allowFunctions:!0}))!==null&&i!==void 0?i:"void"}/${iN++}`,l=p=>e.get(o)(p),u=e.cachePolicy_UNSTABLE,c=typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(o):e.retainedBy_UNSTABLE;let f;if(e.set!=null){const p=e.set;f=Bo({key:s,get:l,set:(g,y)=>p(o)(g,y),cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else f=Bo({key:s,get:l,cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return r.set(o,f),oN(f.key,()=>{r.delete(o)}),f}}var _r=aN;const sN=_r({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function lN(e){return sN(e)}var uN=lN;const cN=_r({key:"__error",get:e=>()=>{throw fe(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function fN(e){return cN(e)}var dN=fN;function pN(e){return e}var hN=pN;const{loadableWithError:Bw,loadableWithPromise:Vw,loadableWithValue:Ww}=La;function Su(e,t){const n=Array(t.length).fill(void 0),r=Array(t.length).fill(void 0);for(const[o,i]of t.entries())try{n[o]=e(i)}catch(a){r[o]=a}return[n,r]}function vN(e){return e!=null&&!Te(e)}function bu(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function Xf(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((n,r,o)=>ge(te({},n),{[r]:t[o]}),{})}function ko(e,t,n){const r=n.map((o,i)=>o==null?Ww(t[i]):Te(o)?Vw(o):Bw(o));return Xf(e,r)}function mN(e,t){return t.map((n,r)=>n===void 0?e[r]:n)}const gN=_r({key:"__waitForNone",get:e=>({get:t})=>{const n=bu(e),[r,o]=Su(t,n);return ko(e,r,o)},dangerouslyAllowMutability:!0}),yN=_r({key:"__waitForAny",get:e=>({get:t})=>{const n=bu(e),[r,o]=Su(t,n);return o.some(i=>!Te(i))?ko(e,r,o):new Promise(i=>{for(const[a,s]of o.entries())Te(s)&&s.then(l=>{r[a]=l,o[a]=void 0,i(ko(e,r,o))}).catch(l=>{o[a]=l,i(ko(e,r,o))})})},dangerouslyAllowMutability:!0}),wN=_r({key:"__waitForAll",get:e=>({get:t})=>{const n=bu(e),[r,o]=Su(t,n);if(o.every(a=>a==null))return Xf(e,r);const i=o.find(vN);if(i!=null)throw i;return Promise.all(o).then(a=>Xf(e,mN(r,a)))},dangerouslyAllowMutability:!0}),SN=_r({key:"__waitForAllSettled",get:e=>({get:t})=>{const n=bu(e),[r,o]=Su(t,n);return o.every(i=>!Te(i))?ko(e,r,o):Promise.all(o.map((i,a)=>Te(i)?i.then(s=>{r[a]=s,o[a]=void 0}).catch(s=>{r[a]=void 0,o[a]=s}):null)).then(()=>ko(e,r,o))},dangerouslyAllowMutability:!0}),bN=_r({key:"__noWait",get:e=>({get:t})=>{try{return Bo.value(Ww(t(e)))}catch(n){return Bo.value(Te(n)?Vw(n):Bw(n))}},dangerouslyAllowMutability:!0});var _N={waitForNone:gN,waitForAny:yN,waitForAll:wN,waitForAllSettled:SN,noWait:bN};const{RecoilLoadable:xN}=La,{DefaultValue:EN}=wt,{RecoilRoot:CN,useRecoilStoreID:RN}=Nn,{isRecoilValue:ON}=Uo,{retentionZone:kN}=uu,{freshSnapshot:PN}=hu,{useRecoilState:TN,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:LN,useRecoilStateLoadable:NN,useRecoilValue:AN,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:DN,useRecoilValueLoadable:MN,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:$N,useResetRecoilState:IN,useSetRecoilState:FN}=QP,{useGotoRecoilSnapshot:UN,useRecoilSnapshot:jN,useRecoilTransactionObserver:zN}=Ow,{useRecoilCallback:BN}=Lw,{noWait:VN,waitForAll:WN,waitForAllSettled:HN,waitForAny:KN,waitForNone:qN}=_N;var Np={DefaultValue:EN,isRecoilValue:ON,RecoilLoadable:xN,RecoilRoot:CN,useRecoilStoreID:RN,useRecoilBridgeAcrossReactRoots_UNSTABLE:bT,atom:jw,selector:Bo,atomFamily:rN,selectorFamily:_r,constSelector:uN,errorSelector:dN,readOnlySelector:hN,noWait:VN,waitForNone:qN,waitForAny:KN,waitForAll:WN,waitForAllSettled:HN,useRecoilValue:AN,useRecoilValueLoadable:MN,useRecoilState:TN,useRecoilStateLoadable:NN,useSetRecoilState:FN,useResetRecoilState:IN,useGetRecoilValueInfo_UNSTABLE:vT,useRecoilRefresher_UNSTABLE:XT,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:$N,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:DN,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:LN,useRecoilCallback:BN,useRecoilTransaction_UNSTABLE:tL,useGotoRecoilSnapshot:UN,useRecoilSnapshot:jN,useRecoilTransactionObserver_UNSTABLE:zN,snapshot_UNSTABLE:PN,useRetain:Rp,retentionZone:kN},QN=Np.RecoilRoot,GN=Np.atom,H4=Np.useRecoilState,_u={exports:{}},xu={};/** - * @license React - * react-jsx-runtime.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var XN=R.exports,YN=Symbol.for("react.element"),ZN=Symbol.for("react.fragment"),JN=Object.prototype.hasOwnProperty,eA=XN.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,tA={key:!0,ref:!0,__self:!0,__source:!0};function Hw(e,t,n){var r,o={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)JN.call(t,r)&&!tA.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:YN,type:e,key:i,ref:a,props:o,_owner:eA.current}}xu.Fragment=ZN;xu.jsx=Hw;xu.jsxs=Hw;_u.exports=xu;const C=_u.exports.jsx,ce=_u.exports.jsxs,pr=_u.exports.Fragment;function nA(e,t){if(e==null)return{};var n=rA(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function rA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Ap=R.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=nA(e,["color","size"]);return C("svg",ge(te({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a),{children:C("polyline",{points:"20 6 9 17 4 12"})}))});Ap.propTypes={color:Ne.string,size:Ne.oneOfType([Ne.string,Ne.number])};Ap.displayName="Check";var oA=Ap;function iA(e,t){if(e==null)return{};var n=aA(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function aA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Dp=R.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=iA(e,["color","size"]);return ce("svg",ge(te({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a),{children:[C("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),C("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}))});Dp.propTypes={color:Ne.string,size:Ne.oneOfType([Ne.string,Ne.number])};Dp.displayName="EyeOff";var sA=Dp;function lA(e,t){if(e==null)return{};var n=uA(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function uA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Mp=R.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=lA(e,["color","size"]);return ce("svg",ge(te({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a),{children:[C("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),C("circle",{cx:"12",cy:"12",r:"3"})]}))});Mp.propTypes={color:Ne.string,size:Ne.oneOfType([Ne.string,Ne.number])};Mp.displayName="Eye";var cA=Mp;function fA(e,t){if(e==null)return{};var n=dA(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function dA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var $p=R.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=fA(e,["color","size"]);return C("svg",ge(te({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a),{children:C("path",{d:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"})}))});$p.propTypes={color:Ne.string,size:Ne.oneOfType([Ne.string,Ne.number])};$p.displayName="GitHub";var pA=$p;function hA(e,t){if(e==null)return{};var n=vA(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function vA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Ip=R.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=hA(e,["color","size"]);return ce("svg",ge(te({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a),{children:[C("circle",{cx:"12",cy:"12",r:"10"}),C("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),C("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}))});Ip.propTypes={color:Ne.string,size:Ne.oneOfType([Ne.string,Ne.number])};Ip.displayName="Info";var mA=Ip;function gA(e,t){if(e==null)return{};var n=yA(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,r)||(n[r]=e[r]))}return n}function yA(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Fp=R.exports.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=e.size,i=o===void 0?24:o,a=gA(e,["color","size"]);return ce("svg",ge(te({ref:t,xmlns:"http://www.w3.org/2000/svg",width:i,height:i,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},a),{children:[C("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),C("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}))});Fp.propTypes={color:Ne.string,size:Ne.oneOfType([Ne.string,Ne.number])};Fp.displayName="X";var wA=Fp;function SA(e,t){let n;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function Kw(e){return e.replace(/\/$/,"")}function K4(e,t){let n=String(e);for(;n.length1?t-1:0),r=1;r3?t.i-4:t.i:Array.isArray(e)?1:Up(e)?2:jp(e)?3:0}function Yf(e,t){return Yo(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function OA(e,t){return Yo(e)===2?e.get(t):e[t]}function Xw(e,t,n){var r=Yo(e);r===2?e.set(t,n):r===3?(e.delete(t),e.add(n)):e[t]=n}function kA(e,t){return e===t?e!==0||1/e==1/t:e!=e&&t!=t}function Up(e){return NA&&e instanceof Map}function jp(e){return AA&&e instanceof Set}function Tr(e){return e.o||e.t}function zp(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=MA(e);delete t[Ct];for(var n=Hp(t),r=0;r1&&(e.set=e.add=e.clear=e.delete=PA),Object.freeze(e),t&&ua(e,function(n,r){return Bp(r,!0)},!0)),e}function PA(){Yt(2)}function Vp(e){return e==null||typeof e!="object"||Object.isFrozen(e)}function dn(e){var t=$A[e];return t||Yt(18,e),t}function Km(){return ca}function xc(e,t){t&&(dn("Patches"),e.u=[],e.s=[],e.v=t)}function Pl(e){Zf(e),e.p.forEach(TA),e.p=null}function Zf(e){e===ca&&(ca=e.l)}function qm(e){return ca={p:[],l:ca,h:e,m:!0,_:0}}function TA(e){var t=e[Ct];t.i===0||t.i===1?t.j():t.O=!0}function Ec(e,t){t._=t.p.length;var n=t.p[0],r=e!==void 0&&e!==n;return t.h.g||dn("ES5").S(t,e,r),r?(n[Ct].P&&(Pl(t),Yt(4)),Qr(e)&&(e=Tl(t,e),t.l||Ll(t,e)),t.u&&dn("Patches").M(n[Ct].t,e,t.u,t.s)):e=Tl(t,n,[]),Pl(t),t.u&&t.v(t.u,t.s),e!==Yw?e:void 0}function Tl(e,t,n){if(Vp(t))return t;var r=t[Ct];if(!r)return ua(t,function(i,a){return Qm(e,r,t,i,a,n)},!0),t;if(r.A!==e)return t;if(!r.P)return Ll(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=r.i===4||r.i===5?r.o=zp(r.k):r.o;ua(r.i===3?new Set(o):o,function(i,a){return Qm(e,r,o,i,a,n)}),Ll(e,o,!1),n&&e.u&&dn("Patches").R(r,n,e.u,e.s)}return r.o}function Qm(e,t,n,r,o,i){if(Vo(o)){var a=Tl(e,o,i&&t&&t.i!==3&&!Yf(t.D,r)?i.concat(r):void 0);if(Xw(n,r,a),!Vo(a))return;e.m=!1}if(Qr(o)&&!Vp(o)){if(!e.h.F&&e._<1)return;Tl(e,o),t&&t.A.l||Ll(e,o)}}function Ll(e,t,n){n===void 0&&(n=!1),e.h.F&&e.m&&Bp(t,n)}function Cc(e,t){var n=e[Ct];return(n?Tr(n):e)[t]}function Gm(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Jf(e){e.P||(e.P=!0,e.l&&Jf(e.l))}function Rc(e){e.o||(e.o=zp(e.t))}function ed(e,t,n){var r=Up(t)?dn("MapSet").N(t,n):jp(t)?dn("MapSet").T(t,n):e.g?function(o,i){var a=Array.isArray(o),s={i:a?1:0,A:i?i.A:Km(),P:!1,I:!1,D:{},l:i,t:o,k:null,o:null,j:null,C:!1},l=s,u=td;a&&(l=[s],u=Ci);var c=Proxy.revocable(l,u),f=c.revoke,p=c.proxy;return s.k=p,s.j=f,p}(t,n):dn("ES5").J(t,n);return(n?n.A:Km()).p.push(r),r}function LA(e){return Vo(e)||Yt(22,e),function t(n){if(!Qr(n))return n;var r,o=n[Ct],i=Yo(n);if(o){if(!o.P&&(o.i<4||!dn("ES5").K(o)))return o.t;o.I=!0,r=Xm(n,i),o.I=!1}else r=Xm(n,i);return ua(r,function(a,s){o&&OA(o.t,a)===s||Xw(r,a,t(s))}),i===3?new Set(r):r}(e)}function Xm(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return zp(e)}var Ym,ca,Wp=typeof Symbol!="undefined"&&typeof Symbol("x")=="symbol",NA=typeof Map!="undefined",AA=typeof Set!="undefined",Zm=typeof Proxy!="undefined"&&Proxy.revocable!==void 0&&typeof Reflect!="undefined",Yw=Wp?Symbol.for("immer-nothing"):((Ym={})["immer-nothing"]=!0,Ym),Jm=Wp?Symbol.for("immer-draftable"):"__$immer_draftable",Ct=Wp?Symbol.for("immer-state"):"__$immer_state",DA=""+Object.prototype.constructor,Hp=typeof Reflect!="undefined"&&Reflect.ownKeys?Reflect.ownKeys:Object.getOwnPropertySymbols!==void 0?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,MA=Object.getOwnPropertyDescriptors||function(e){var t={};return Hp(e).forEach(function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)}),t},$A={},td={get:function(e,t){if(t===Ct)return e;var n=Tr(e);if(!Yf(n,t))return function(o,i,a){var s,l=Gm(i,a);return l?"value"in l?l.value:(s=l.get)===null||s===void 0?void 0:s.call(o.k):void 0}(e,n,t);var r=n[t];return e.I||!Qr(r)?r:r===Cc(e.t,t)?(Rc(e),e.o[t]=ed(e.A.h,r,e)):r},has:function(e,t){return t in Tr(e)},ownKeys:function(e){return Reflect.ownKeys(Tr(e))},set:function(e,t,n){var r=Gm(Tr(e),t);if(r!=null&&r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=Cc(Tr(e),t),i=o==null?void 0:o[Ct];if(i&&i.t===n)return e.o[t]=n,e.D[t]=!1,!0;if(kA(n,o)&&(n!==void 0||Yf(e.t,t)))return!0;Rc(e),Jf(e)}return e.o[t]===n&&typeof n!="number"&&(n!==void 0||t in e.o)||(e.o[t]=n,e.D[t]=!0,!0)},deleteProperty:function(e,t){return Cc(e.t,t)!==void 0||t in e.t?(e.D[t]=!1,Rc(e),Jf(e)):delete e.D[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Tr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.i!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty:function(){Yt(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){Yt(12)}},Ci={};ua(td,function(e,t){Ci[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Ci.deleteProperty=function(e,t){return Ci.set.call(this,e,t,void 0)},Ci.set=function(e,t,n){return td.set.call(this,e[0],t,n,e[0])};var IA=function(){function e(n){var r=this;this.g=Zm,this.F=!0,this.produce=function(o,i,a){if(typeof o=="function"&&typeof i!="function"){var s=i;i=o;var l=r;return function(y){var b=this;y===void 0&&(y=s);for(var v=arguments.length,d=Array(v>1?v-1:0),m=1;m1?c-1:0),p=1;p=0;o--){var i=r[o];if(i.path.length===0&&i.op==="replace"){n=i.value;break}}o>-1&&(r=r.slice(o+1));var a=dn("Patches").$;return Vo(n)?a(n,r):this.produce(n,function(s){return a(s,r)})},e}(),Rt=new IA,FA=Rt.produce;Rt.produceWithPatches.bind(Rt);var UA=Rt.setAutoFreeze.bind(Rt);Rt.setUseProxies.bind(Rt);Rt.applyPatches.bind(Rt);Rt.createDraft.bind(Rt);Rt.finishDraft.bind(Rt);UA(!1);const{createContext:Kp,memo:jA,useMemo:zA,useRef:BA,useEffect:VA,useCallback:eg,useContext:nd,useState:WA}=Y,Zw=Kp(null),Jw=Kp(null),eS=Kp(null);function HA(){return nd(eS)}function KA({initialState:e,actions:t={},children:n}){const r=BA(e),[o,i]=WA(e),a=eg(()=>r.current,[]);VA(()=>{},[a]);const s=eg((u,c)=>{if(typeof u=="function")return u(s,a);const f=FA(a(),c);f!==r.current&&(r.current=f,i(f))},[a]),l=zA(()=>tS(t,s),[t,s]);return C(Zw.Provider,{value:o,children:C(Jw.Provider,{value:s,children:C(eS.Provider,{value:l,children:n})})})}function An(e){return t=>{const n=jA(t);function r(o){const i=nd(Zw),a=nd(Jw),s=e(i,o),l=te(te({dispatch:a},o),s);return C(n,te({},l))}return r}}function qA(e,t){return function(...n){return t(e.apply(this,n))}}function tS(e,t){const n={};for(const r in e){const o=e[r];typeof o=="function"?n[r]=qA(o,t):typeof o=="object"&&(n[r]=tS(o,t))}return n}const nS="yacd.haishan.me";function QA(){try{const e=localStorage.getItem(nS);return e?JSON.parse(e):void 0}catch{return}}function Jr(e){try{const t=JSON.stringify(e);localStorage.setItem(nS,t)}catch{}}const rS="/configs";async function oS(e){const{url:t,init:n}=Pt(e);return await fetch(t+rS,n)}function GA(e){return"socks-port"in e&&(e["socket-port"]=e["socks-port"]),e}async function XA(e,t){const{url:n,init:r}=Pt(e),o=JSON.stringify(GA(t));return await fetch(n+rS,ge(te({},r),{body:o,method:"PATCH"}))}const iS="/traffic",YA=new TextDecoder("utf-8"),ds=150,fa={labels:Array(ds).fill(0),up:Array(ds),down:Array(ds),size:ds,subscribers:[],appendData(e){this.up.shift(),this.down.shift(),this.labels.shift();const t=Date.now();this.up.push(e.up),this.down.push(e.down),this.labels.push(t),this.subscribers.forEach(n=>n(e))},subscribe(e){return this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}}};let bo=!1,ps="";function rd(e){fa.appendData(JSON.parse(e))}function aS(e){return e.read().then(({done:t,value:n})=>{ps+=YA.decode(n,{stream:!t});const o=ps.split(` -`),i=o[o.length-1];for(let a=0;a{if(r.ok){const o=r.body.getReader();aS(o)}else bo=!1},r=>{console.log("fetch /traffic error",r),bo=!1}),fa}function tg(e){return t=>{t(`openModal:${e}`,n=>{n.modals[e]=!0})}}function JA(e){return t=>{t(`closeModal:${e}`,n=>{n.modals[e]=!1})}}const e3={apiConfig:!1},Q4=e=>e.configs.configs,t3=e=>e.configs.haveFetchedConfig,G4=e=>e.configs.configs["log-level"];function sS(e){return async(t,n)=>{let r;try{r=await oS(e)}catch{t(tg("apiConfig"));return}if(!r.ok){console.log("Error fetch configs",r.statusText),t(tg("apiConfig"));return}const o=await r.json();t("store/configs#fetchConfigs",a=>{a.configs.configs=o}),t3(n())?qp(e):t(n3())}}function n3(){return e=>{e("store/configs#markHaveFetchedConfig",t=>{t.configs.haveFetchedConfig=!0})}}function X4(e,t){return async n=>{XA(e,t).then(r=>{r.ok===!1&&console.log("Error update configs",r.statusText)},r=>{throw console.log("Error update configs",r),r}).then(()=>{n(sS(e))}),n("storeConfigsOptimisticUpdateConfigs",r=>{r.configs.configs=te(te({},r.configs.configs),t)})}}const r3={configs:{port:7890,"socks-port":7891,"redir-port":0,"allow-lan":!1,mode:"Rule","log-level":"uninit"},haveFetchedConfig:!1},Zo=e=>{const t=e.app.selectedClashAPIConfigIndex;return e.app.clashAPIConfigs[t]},lS=e=>e.app.selectedClashAPIConfigIndex,Qp=e=>e.app.clashAPIConfigs,Gp=e=>e.app.theme,o3=e=>e.app.selectedChartStyleIndex,uS=e=>e.app.latencyTestUrl,Y4=e=>e.app.collapsibleIsOpen,Z4=e=>e.app.proxySortBy,J4=e=>e.app.hideUnavailableProxies,i3=e=>e.app.autoCloseOldConns,eF=e=>e.app.logStreamingPaused,a3=SA(Jr,600);function Xp(e,{baseURL:t,secret:n}){const r=Qp(e());for(let o=0;o{if(Xp(r,{baseURL:e,secret:t}))return;const i={baseURL:e,secret:t,addedAt:Date.now()};n("addClashAPIConfig",a=>{a.app.clashAPIConfigs.push(i)}),Jr(r().app)}}function l3({baseURL:e,secret:t}){return async(n,r)=>{const o=Xp(r,{baseURL:e,secret:t});n("removeClashAPIConfig",i=>{i.app.clashAPIConfigs.splice(o,1)}),Jr(r().app)}}function u3({baseURL:e,secret:t}){return async(n,r)=>{const o=Xp(r,{baseURL:e,secret:t});lS(r())!==o&&n("selectClashAPIConfig",a=>{a.app.selectedClashAPIConfigIndex=o}),Jr(r().app);try{window.location.reload()}catch{}}}const Oc=document.querySelector("html");function cS(e="dark"){e==="auto"?Oc.setAttribute("data-theme","auto"):e==="dark"?Oc.setAttribute("data-theme","dark"):Oc.setAttribute("data-theme","light")}function c3(e="auto"){return(t,n)=>{Gp(n())!==e&&(cS(e),t("storeSwitchTheme",o=>{o.app.theme=e}),Jr(n().app))}}function f3(e){return(t,n)=>{t("appSelectChartStyleIndex",r=>{r.app.selectedChartStyleIndex=Number(e)}),Jr(n().app)}}function ng(e,t){return(n,r)=>{n("appUpdateAppConfig",o=>{o.app[e]=t}),Jr(r().app)}}function d3(e,t,n){return(r,o)=>{r("updateCollapsibleIsOpen",i=>{i.app.collapsibleIsOpen[`${e}:${t}`]=n}),a3(o().app)}}var Og,kg;const p3={baseURL:(kg=(Og=document.getElementById("app"))==null?void 0:Og.getAttribute("data-base-url"))!=null?kg:"http://127.0.0.1:9090",secret:"",addedAt:0},h3={selectedClashAPIConfigIndex:0,clashAPIConfigs:[p3],latencyTestUrl:"http://www.gstatic.com/generate_204",selectedChartStyleIndex:0,theme:"dark",collapsibleIsOpen:{},proxySortBy:"Natural",hideUnavailableProxies:!1,autoCloseOldConns:!1,logStreamingPaused:!1};function v3(){const{search:e}=window.location,t={};if(typeof e!="string"||e==="")return t;const n=e.replace(/^\?/,"").split("&");for(let r=0;rxA("/version",e.apiConfig));return ce(pr,{children:[C(Gw,{title:"About"}),t&&t.version?C(rg,{name:"Clash",version:t.version,link:"https://github.com/Dreamacro/clash"}):null,C(rg,{name:"Yacd",version:"0.3.5",link:"https://github.com/haishanh/yacd"})]})}const b3=e=>({apiConfig:Zo(e)}),_3=An(b3)(S3),x3="_loading_74j3j_1",E3="_spinner_74j3j_9",C3="_rotate_74j3j_1";var og={loading:x3,spinner:E3,rotate:C3};const fS=({height:e})=>{const t=e?{height:e}:{};return C("div",{className:og.loading,style:t,children:C("div",{className:og.spinner})})},R3=e=>({apiConfig:Zo(e),apiConfigs:Qp(e)});function O3({apiConfig:e,apiConfigs:t}){return R.exports.useEffect(()=>{let n="yacd";if(t.length>1)try{n=`${new URL(e.baseURL).host} - yacd`}catch{}document.title=n}),C(pr,{})}const k3=An(R3)(O3),P3=new m1,T3=new SC({queryCache:P3,defaultOptions:{queries:{suspense:!0}}});var Nl="NOT_FOUND";function L3(e){var t;return{get:function(r){return t&&e(t.key,r)?t.value:Nl},put:function(r,o){t={key:r,value:o}},getEntries:function(){return t?[t]:[]},clear:function(){t=void 0}}}function N3(e,t){var n=[];function r(s){var l=n.findIndex(function(c){return t(s,c.key)});if(l>-1){var u=n[l];return l>0&&(n.splice(l,1),n.unshift(u)),u.value}return Nl}function o(s,l){r(s)===Nl&&(n.unshift({key:s,value:l}),n.length>e&&n.pop())}function i(){return n}function a(){n=[]}return{get:r,put:o,getEntries:i,clear:a}}var A3=function(t,n){return t===n};function D3(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;for(var o=n.length,i=0;i1?t-1:0),r=1;re.logs.logs,pS=e=>e.logs.tail,U3=e=>e.logs.searchText,tF=F3(dS,pS,U3,(e,t,n)=>{const r=[];for(let o=t;o>=0;o--)r.push(e[o]);if(e.length===od)for(let o=od-1;o>t;o--)r.push(e[o]);return n===""?r:r.filter(o=>o.payload.toLowerCase().indexOf(n)>=0)});function nF(e){return t=>{t("logsUpdateSearchText",n=>{n.logs.searchText=e.toLowerCase()})}}function rF(e){return(t,n)=>{const r=n(),o=dS(r),i=pS(r),a=i>=od-1?0:i+1;o[a]=e,t("logsAppendLog",s=>{s.logs.tail=a})}}const j3={searchText:"",logs:[],tail:-1},Eu="/connections",Ms=[];function z3(e){let t;try{t=JSON.parse(e)}catch{console.log("JSON.parse error",JSON.parse(e))}Ms.forEach(n=>n(t))}let Pc;function B3(e,t){if(Pc===1&&t)return ig(t);Pc=1;const n=Qw(e,Eu),r=new WebSocket(n);if(r.addEventListener("error",()=>Pc=3),r.addEventListener("message",o=>z3(o.data)),t)return ig(t)}function ig(e){return Ms.push(e),function(){const n=Ms.indexOf(e);Ms.splice(n,1)}}async function oF(e){const{url:t,init:n}=Pt(e);return await fetch(t+Eu,ge(te({},n),{method:"DELETE"}))}async function V3(e){const{url:t,init:n}=Pt(e);return await fetch(t+Eu,te({},n))}async function W3(e,t){const{url:n,init:r}=Pt(e),o=`${n}${Eu}/${t}`;return await fetch(o,ge(te({},r),{method:"DELETE"}))}const Yp="/proxies";async function H3(e){const{url:t,init:n}=Pt(e);return await(await fetch(t+Yp,n)).json()}async function K3(e,t,n){const r={name:n},{url:o,init:i}=Pt(e),a=encodeURIComponent(t),s=`${o}${Yp}/${a}`;return await fetch(s,ge(te({},i),{method:"PUT",body:JSON.stringify(r)}))}async function hS(e,t,n="http://www.gstatic.com/generate_204"){const{url:r,init:o}=Pt(e),i=`timeout=5000&url=${encodeURIComponent(n)}`,a=`${r}${Yp}/${encodeURIComponent(t)}/delay?${i}`;return await fetch(a,o)}async function q3(e){const{url:t,init:n}=Pt(e),r=await fetch(t+"/providers/proxies",n);return r.status===404?{providers:{}}:await r.json()}async function vS(e,t){const{url:n,init:r}=Pt(e),o=ge(te({},r),{method:"PUT"});return await fetch(n+"/providers/proxies/"+t,o)}async function Q3(e,t){const{url:n,init:r}=Pt(e),o=ge(te({},r),{method:"GET"});return await fetch(n+"/providers/proxies/"+t+"/healthcheck",o)}const G3={proxies:{},delay:{},groupNames:[],showModalClosePrevConns:!1},mS=()=>null,X3=["Direct","Reject","Relay","Selector","Fallback","URLTest","LoadBalance","Unknown"],gS=e=>e.proxies.proxies,Y3=e=>e.proxies.delay,iF=e=>e.proxies.groupNames,Z3=e=>e.proxies.proxyProviders||[],J3=e=>e.proxies.dangleProxyNames,aF=e=>e.proxies.showModalClosePrevConns;function eD(e,t){const n={};for(const r of e){const i=(t(r)||{history:[]}).history,a=i[i.length-1];a&&typeof a.delay=="number"&&(n[r]={number:a.delay})}return n}function Jo(e){return async(t,n)=>{const[r,o]=await Promise.all([H3(e),q3(e)]),{proxyProviders:i,providerProxyRecord:a}=sD(o.providers),s=te(te({},a),r.proxies),[l,u]=aD(s),c=te(te({},Y3(n())),eD(Object.keys(s),p=>s[p])),f=[];for(const p of u)a[p]||f.push(p);t("store/proxies#fetchProxies",p=>{p.proxies.proxies=s,p.proxies.groupNames=l,p.proxies.dangleProxyNames=f,p.proxies.delay=c,p.proxies.proxyProviders=i})}}function sF(e,t){return async n=>{try{await vS(e,t)}catch{}n(Jo(e))}}function lF(e,t){return async n=>{for(let r=0;r{await Zp(e,t),await n(Jo(e))}}async function tD(e,t,n){const r=await V3(e);r.ok||console.log("unable to fetch all connections",r.statusText);const i=(await r.json()).connections,a=[];for(const s of i)s.chains.indexOf(t)>-1&&s.chains.indexOf(n)<0&&a.push(s.id);await Promise.all(a.map(s=>W3(e,s).catch(mS)))}function nD(e,t,n){const r=[n,t];let o,i=n;for(;(o=e[i])&&o.now;)r.unshift(o.now),i=o.now;return r}async function rD(e,t,n,r,o){try{if((await K3(n,r,o)).ok===!1)throw new Error("failed to switch proxy: res.statusText")}catch(a){throw console.log(a,"failed to swith proxy"),a}if(e(Jo(n)),i3(t())){const a=gS(t());wS(n,a,{groupName:r,itemName:o})}}function yS(){return e=>{e("closeModalClosePrevConns",t=>{t.proxies.showModalClosePrevConns=!1})}}function wS(e,t,n){const r=nD(t,n.groupName,n.itemName);tD(e,n.groupName,r[0])}function oD(e){return async(t,n)=>{var a;const r=n(),o=(a=r.proxies.switchProxyCtx)==null?void 0:a.to;if(!o){t(yS());return}const i=r.proxies.proxies;wS(e,i,o),t("closePrevConnsAndTheModal",s=>{s.proxies.showModalClosePrevConns=!1,s.proxies.switchProxyCtx=void 0})}}function cF(e,t,n){return async(r,o)=>{rD(r,o,e,t,n).catch(mS),r("store/proxies#switchProxy",i=>{const a=i.proxies.proxies;a[t]&&a[t].now&&(a[t].now=n)})}}function iD(e,t){return async(n,r)=>{const o=gS(r()),i=uS(r()),a=new Map,s=new Map,l=t.map(u=>{const c=o[u];return c.__provider?c.__provider?s.get(c.__provider)?void 0:(s.set(c.__provider,!0),Zp(e,c.__provider)):void 0:a.get(u)?void 0:(a.set(u,!0),hS(e,u,i))});await Promise.all(l),await n(Jo(e))}}function fF(e){return async(t,n)=>{const r=J3(n()),o=uS(n());await Promise.all(r.map(a=>hS(e,a,o)));const i=Z3(n());for(const a of i)await Zp(e,a.name);await t(Jo(e))}}function aD(e){let t=[],n;const r=[];for(const o in e){const i=e[o];i.all&&Array.isArray(i.all)?(t.push(o),o==="GLOBAL"&&(n=Array.from(i.all))):X3.indexOf(i.type)<0&&r.push(o)}return n&&(n.push("GLOBAL"),t=t.map(o=>[n.indexOf(o),o]).sort((o,i)=>o[0]-i[0]).map(o=>o[1])),[t,r]}function sD(e){const t=Object.keys(e),n=[],r={};for(let o=0;on(o=>!o),[]);return[t,r]}function pF(e){const[t,n]=bS(e);return{value:t,set:n}}const pD="_ul_1d6f2_1",hD="_li_1d6f2_10",vD="_close_1d6f2_28",mD="_eye_1d6f2_36",gD="_hasSecret_1d6f2_45",yD="_url_1d6f2_50",wD="_secret_1d6f2_54",SD="_btn_1d6f2_72";var En={ul:pD,li:hD,close:vD,eye:mD,hasSecret:gD,url:yD,secret:wD,btn:SD};const bD=e=>({apiConfigs:Qp(e),selectedClashAPIConfigIndex:lS(e)}),_D=An(bD)(xD);function xD({apiConfigs:e,selectedClashAPIConfigIndex:t}){const{app:{removeClashAPIConfig:n,selectClashAPIConfig:r}}=HA(),o=R.exports.useCallback(a=>{n(a)},[n]),i=R.exports.useCallback(a=>{r(a)},[r]);return C(pr,{children:C("ul",{className:En.ul,children:e.map((a,s)=>C("li",{className:hr(En.li,{[En.hasSecret]:a.secret,[En.isSelected]:s===t}),children:C(ED,{disableRemove:s===t,baseURL:a.baseURL,secret:a.secret,onRemove:o,onSelect:i})},a.baseURL+a.secret))})})}function ED({baseURL:e,secret:t,disableRemove:n,onRemove:r,onSelect:o}){const[i,a]=dD(),s=i?sA:cA,l=R.exports.useCallback(u=>{u.stopPropagation()},[]);return ce(pr,{children:[C(ag,{disabled:n,onClick:()=>r({baseURL:e,secret:t}),className:En.close,children:C(wA,{size:20})}),C("span",{className:En.url,tabIndex:0,role:"button",onClick:()=>o({baseURL:e,secret:t}),onKeyUp:l,children:e}),C("span",{}),t?ce(pr,{children:[C("span",{className:En.secret,children:i?t:"***"}),C(ag,{onClick:a,className:En.eye,children:C(s,{size:20})})]}):null]})}function ag({children:e,onClick:t,className:n,disabled:r}){return C("button",{disabled:r,className:hr(n,En.btn),onClick:t,children:e})}const CD="_root_zwtea_1",RD="_header_zwtea_5",OD="_icon_zwtea_10",kD="_body_zwtea_20",PD="_hostnamePort_zwtea_24",TD="_error_zwtea_36",LD="_footer_zwtea_42";var Er={root:CD,header:RD,icon:OD,body:kD,hostnamePort:PD,error:TD,footer:LD};const ND="_btn_lzu00_1",AD="_circular_lzu00_27",DD="_minimal_lzu00_30",MD="_btnStart_lzu00_48",$D="_loadingContainer_lzu00_55";var Ri={btn:ND,circular:AD,minimal:DD,btnStart:MD,loadingContainer:$D};const ID="_sectionNameType_8lri2_1",FD="_loadingDot_8lri2_66",UD="_dot2_8lri2_1",jD="_dot1_8lri2_1",zD="_dot3_8lri2_1";var _S={sectionNameType:ID,loadingDot:FD,dot2:UD,dot1:jD,dot3:zD};function hF({name:e,type:t}){return ce("h2",{className:_S.sectionNameType,children:[C("span",{children:e}),C("span",{children:t})]})}function BD(){return C("span",{className:_S.loadingDot})}const{forwardRef:VD,useCallback:WD}=gr;function HD(e,t){const y=e,{onClick:n,disabled:r=!1,isLoading:o,kind:i="primary",className:a,children:s,label:l,text:u,start:c}=y,f=xr(y,["onClick","disabled","isLoading","kind","className","children","label","text","start"]),p={children:s,label:l,text:u,start:c},h=WD(b=>{o||n&&n(b)},[o,n]),g=hr(Ri.btn,{[Ri.minimal]:i==="minimal",[Ri.circular]:i==="circular"},a);return C("button",ge(te({className:g,ref:t,onClick:h,disabled:r},f),{children:o?ce(pr,{children:[C("span",{style:{display:"inline-flex",opacity:0},children:C(sg,te({},p))}),C("span",{className:Ri.loadingContainer,children:C(BD,{})})]}):C(sg,te({},p))}))}function sg({children:e,label:t,text:n,start:r}){return ce(pr,{children:[r?C("span",{className:Ri.btnStart,children:typeof r=="function"?r():r}):null,e||t||n]})}var KD=VD(HD);const qD="_root_1or8t_1",QD="_floatAbove_1or8t_32";var lg={root:qD,floatAbove:QD};const{useCallback:GD}=gr;function ug(i){var a=i,{id:e,label:t,value:n,onChange:r}=a,o=xr(a,["id","label","value","onChange"]);const s=GD(l=>r(l),[r]);return ce("div",{className:lg.root,children:[C("input",te({id:e,value:n,onChange:s},o)),C("label",{htmlFor:e,className:lg.floatAbove,children:t})]})}const XD="_path_r8pm3_1",YD="_dash_r8pm3_1";var ZD={path:XD,dash:YD};function Jp({width:e=320,height:t=320,animate:n=!1,c0:r="currentColor",stroke:o="#eee",eye:i="#eee",mouth:a="#eee"}){const s=hr({[ZD.path]:n});return C("svg",{width:e,height:t,viewBox:"0 0 320 320",xmlns:"http://www.w3.org/2000/svg",children:ce("g",{fill:"none",fillRule:"evenodd",children:[C("path",{d:"M71.689 53.055c9.23-1.487 25.684 27.263 41.411 56.663 18.572-8.017 71.708-7.717 93.775 0 4.714-15.612 31.96-57.405 41.626-56.663 3.992.088 13.07 31.705 23.309 94.96 2.743 16.949 7.537 47.492 14.38 91.63-42.339 17.834-84.37 26.751-126.095 26.751-41.724 0-83.756-8.917-126.095-26.751C52.973 116.244 65.536 54.047 71.689 53.055z",stroke:o,strokeWidth:"4",strokeLinecap:"round",fill:r,className:s}),C("circle",{fill:i,cx:"216.5",cy:"181.5",r:"14.5"}),C("circle",{fill:i,cx:"104.5",cy:"181.5",r:"14.5"}),C("g",{stroke:a,strokeLinecap:"round",strokeWidth:"4",children:C("path",{d:"M175.568 218.694c-2.494 1.582-5.534 2.207-8.563 1.508-3.029-.7-5.487-2.594-7.035-5.11M143.981 218.694c2.494 1.582 5.534 2.207 8.563 1.508 3.03-.7 5.488-2.594 7.036-5.11"})})]})})}const{useState:Tc,useRef:cg,useCallback:Lc,useEffect:JD}=gr,xS=0,eM=e=>({apiConfig:Zo(e)});function tM({dispatch:e}){const[t,n]=Tc(""),[r,o]=Tc(""),[i,a]=Tc(""),s=cg(!1),l=cg(null),u=Lc(h=>{s.current=!0,a("");const g=h.target,{name:y}=g,b=g.value;switch(y){case"baseURL":n(b);break;case"secret":o(b);break;default:throw new Error(`unknown input name ${y}`)}},[]),c=Lc(()=>{nM({baseURL:t,secret:r}).then(h=>{h[0]!==xS?a(h[1]):e(s3({baseURL:t,secret:r}))})},[t,r,e]),f=Lc(h=>{h.target instanceof Element&&(!h.target.tagName||h.target.tagName.toUpperCase()!=="INPUT")||h.key==="Enter"&&c()},[c]),p=async()=>{(await fetch("/")).json().then(g=>{g.hello==="clash"&&n(window.location.origin)})};return JD(()=>{p()},[]),ce("div",{className:Er.root,ref:l,onKeyDown:f,children:[C("div",{className:Er.header,children:C("div",{className:Er.icon,children:C(Jp,{width:160,height:160,stroke:"var(--stroke)"})})}),C("div",{className:Er.body,children:ce("div",{className:Er.hostnamePort,children:[C(ug,{id:"baseURL",name:"baseURL",label:"API Base URL",type:"text",placeholder:"http://127.0.0.1:9090",value:t,onChange:u}),C(ug,{id:"secret",name:"secret",label:"Secret(optional)",value:r,type:"text",onChange:u})]})}),C("div",{className:Er.error,children:i||null}),C("div",{className:Er.footer,children:C(KD,{label:"Add",onClick:c})}),C("div",{style:{height:20}}),C(_D,{})]})}var ES=An(eM)(tM);async function nM(e){try{new URL(e.baseURL)}catch{if(e.baseURL){const n=e.baseURL.substring(0,7);if(n!=="http://"&&n!=="https:/")return[1,"Must starts with http:// or https://"]}return[1,"Invalid URL"]}try{const t=await oS(e);return t.status>399?[1,t.statusText]:[xS]}catch{return[1,"Failed to connect"]}}function CS(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Po=CS()?R.exports.useLayoutEffect:R.exports.useEffect;function RS(){var e=R.exports.useState(Object.create(null)),t=e[1];return R.exports.useCallback(function(){t(Object.create(null))},[])}function rM(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var oM=["unstable_skipInitialRender"],iM=function(t){var n=t.children,r=t.type,o=r===void 0?"reach-portal":r,i=t.containerRef,a=R.exports.useRef(null),s=R.exports.useRef(null),l=RS();return Po(function(){if(!!a.current){var u=a.current.ownerDocument,c=(i==null?void 0:i.current)||u.body;return s.current=u==null?void 0:u.createElement(o),c.appendChild(s.current),l(),function(){s.current&&c&&c.removeChild(s.current)}}},[o,l,i]),s.current?ya.exports.createPortal(n,s.current):R.exports.createElement("span",{ref:a})},OS=function(t){var n=t.unstable_skipInitialRender,r=rM(t,oM),o=R.exports.useState(!1),i=o[0],a=o[1];return R.exports.useEffect(function(){n&&a(!0)},[n]),n&&!i?null:R.exports.createElement(iM,r)},aM=["bottom","height","left","right","top","width"],sM=function(t,n){return t===void 0&&(t={}),n===void 0&&(n={}),aM.some(function(r){return t[r]!==n[r]})},$n=new Map,kS,lM=function e(){var t=[];$n.forEach(function(n,r){var o=r.getBoundingClientRect();sM(o,n.rect)&&(n.rect=o,t.push(n))}),t.forEach(function(n){n.callbacks.forEach(function(r){return r(n.rect)})}),kS=window.requestAnimationFrame(e)};function uM(e,t){return{observe:function(){var r=$n.size===0;$n.has(e)?$n.get(e).callbacks.push(t):$n.set(e,{rect:void 0,hasRectChanged:!1,callbacks:[t]}),r&&lM()},unobserve:function(){var r=$n.get(e);if(r){var o=r.callbacks.indexOf(t);o>=0&&r.callbacks.splice(o,1),r.callbacks.length||$n.delete(e),$n.size||cancelAnimationFrame(kS)}}}}function cM(e){return typeof e=="boolean"}function eh(e){return!!(e&&{}.toString.call(e)=="[object Function]")}function fM(e){return typeof e=="string"}function Al(e,t,n){var r,o;if(cM(t))r=t;else{var i;r=(i=t==null?void 0:t.observe)!=null?i:!0,o=t==null?void 0:t.onChange}eh(n)&&(o=n);var a=R.exports.useState(e.current),s=a[0],l=a[1],u=R.exports.useRef(!1),c=R.exports.useRef(!1),f=R.exports.useState(null),p=f[0],h=f[1],g=R.exports.useRef(o);return Po(function(){g.current=o,e.current!==s&&l(e.current)}),Po(function(){s&&!u.current&&(u.current=!0,h(s.getBoundingClientRect()))},[s]),Po(function(){if(!!r){var y=s;if(c.current||(c.current=!0,y=e.current),!!y){var b=uM(y,function(v){g.current==null||g.current(v),h(v)});return b.observe(),function(){b.unobserve()}}}},[r,s,e]),p}function vr(e){return CS()?e?e.ownerDocument:document:null}function fg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return n=e[Symbol.iterator](),n.next.bind(n)}function hM(e,t){if(e!=null)if(eh(e))e(t);else try{e.current=t}catch{throw new Error('Cannot assign value "'+t+'" to ref "'+e+'"')}}function eo(){for(var e=arguments.length,t=new Array(e),n=0;n=0)&&(n[o]=e[o]);return n}var RM=["unstable_skipInitialPortalRender"],OM=["as","targetRef","position","unstable_observableRefs"],kM=R.exports.forwardRef(function(t,n){var r=t.unstable_skipInitialPortalRender,o=DS(t,RM);return R.exports.createElement(OS,{unstable_skipInitialRender:r},R.exports.createElement(PM,Wo({ref:n},o)))}),PM=R.exports.forwardRef(function(t,n){var r=t.as,o=r===void 0?"div":r,i=t.targetRef,a=t.position,s=a===void 0?NM:a,l=t.unstable_observableRefs,u=l===void 0?[]:l,c=DS(t,OM),f=R.exports.useRef(null),p=Al(f,{observe:!c.hidden}),h=Al(i,{observe:!c.hidden}),g=eo(f,n);return DM(i,f),R.exports.createElement(o,Wo({"data-reach-popover":"",ref:g},c,{style:Wo({position:"absolute"},TM.apply(void 0,[s,h,p].concat(u)),c.style)}))});function TM(e,t,n){for(var r=arguments.length,o=new Array(r>3?r-3:0),i=3;i=0)&&(n[o]=e[o]);return n}function qn(){return qn=Object.assign||function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}var HM=["children"];function KM(e,t){var n=R.exports.createContext(t);function r(i){var a=i.children,s=WM(i,HM),l=R.exports.useMemo(function(){return s},Object.values(s));return R.exports.createElement(n.Provider,{value:l},a)}function o(i){var a=R.exports.useContext(n);if(a)return a;if(t)return t;throw Error(i+" must be rendered inside of a "+e+" component.")}return[r,o]}function da(){for(var e=arguments.length,t=new Array(e),n=0;n=0)&&(n[o]=e[o]);return n}function tt(){return tt=Object.assign||function(e){for(var t=1;tAe||ct>Ae)&&(E.current=!0)}!_&&F!=null&&!p&&d({type:Qn,payload:{index:F,dropdownRef:m}})}function xe(){E.current=!0,!_&&F!=null&&!p&&d({type:Qn,payload:{index:F}})}function ve(re){if(!$s(re.nativeEvent)){if(!E.current){E.current=!0;return}r?U.current?U.current=!1:W.current&&W.current.click():p||B()}}return R.exports.useEffect(function(){if(D){var re=window.setTimeout(function(){E.current=!0},400);return function(){window.clearTimeout(re)}}else E.current=!1},[D,E]),R.exports.useEffect(function(){var re=vr(W.current);return re.addEventListener("mouseup",Ae),function(){re.removeEventListener("mouseup",Ae)};function Ae(){U.current=!1}},[]),{data:{disabled:p},props:tt({id:jS(F),tabIndex:-1},b,{ref:V,"data-disabled":p?"":void 0,"data-selected":_?"":void 0,"data-valuetext":X,onClick:Ue(o,ee),onDragStart:Ue(i,H),onMouseDown:Ue(a,ne),onMouseEnter:Ue(s,le),onMouseLeave:Ue(l,Z),onMouseMove:Ue(u,Se),onFocus:Ue(h,xe),onMouseUp:Ue(c,ve)})}}function o$(e){e.id;var t=e.onKeyDown,n=e.ref,r=Cu(e,XM),o=Ia("useDropdownItems"),i=o.dispatch,a=o.triggerRef,s=o.dropdownRef,l=o.selectCallbacks,u=o.dropdownId,c=o.state,f=c.isExpanded,p=c.triggerId,h=c.selectionIndex,g=c.typeaheadQuery,y=zS(),b=eo(s,n);R.exports.useEffect(function(){var E=a$(y,g);g&&E!=null&&i({type:Qn,payload:{index:E,dropdownRef:s}});var O=window.setTimeout(function(){return g&&i({type:sd,payload:""})},1e3);return function(){return window.clearTimeout(O)}},[i,y,g,s]);var v=Ac(y.length),d=Ac(y[h]),m=Ac(h);R.exports.useEffect(function(){h>y.length-1?i({type:Qn,payload:{index:y.length-1,dropdownRef:s}}):v!==y.length&&h>-1&&d&&m===h&&y[h]!==d&&i({type:Qn,payload:{index:y.findIndex(function(E){return E.key===(d==null?void 0:d.key)}),dropdownRef:s}})},[s,i,y,v,d,m,h]);var S=Ue(function(O){var A=O.key;if(!!f)switch(A){case"Enter":case" ":var P=y.find(function(D){return D.index===h});P&&!P.disabled&&(O.preventDefault(),P.isLink&&P.element?P.element.click():(Dl(a.current),l.current[P.index]&&l.current[P.index](),i({type:rh})));break;case"Escape":Dl(a.current),i({type:pa});break;case"Tab":O.preventDefault();break;default:if(fM(A)&&A.length===1){var I=g+A.toLowerCase();i({type:sd,payload:I})}break}},VM(Ru,{currentIndex:h,orientation:"vertical",rotate:!1,filter:function(O){return!O.disabled},callback:function(O){i({type:Qn,payload:{index:O,dropdownRef:s}})},key:"index"}));return{data:{activeDescendant:jS(h)||void 0,triggerId:p},props:tt({tabIndex:-1},r,{ref:b,id:u,onKeyDown:Ue(t,S)})}}function i$(e){var t=e.onBlur,n=e.portal,r=n===void 0?!0:n,o=e.position,i=e.ref,a=Cu(e,YM),s=Ia("useDropdownPopover"),l=s.triggerRef,u=s.triggerClickedRef,c=s.dispatch,f=s.dropdownRef,p=s.popoverRef,h=s.state.isExpanded,g=eo(p,i);return R.exports.useEffect(function(){if(!h)return;var y=vr(p.current);function b(v){u.current?u.current=!1:s$(p.current,v.target)||c({type:pa})}return y.addEventListener("mousedown",b),function(){y.removeEventListener("mousedown",b)}},[u,l,c,f,p,h]),{data:{portal:r,position:o,targetRef:l,isExpanded:h},props:tt({ref:g,hidden:!h,onBlur:Ue(t,function(y){y.currentTarget.contains(y.relatedTarget)||c({type:pa})})},a)}}function a$(e,t){if(t===void 0&&(t=""),!t)return null;var n=e.find(function(r){var o,i,a;return r.disabled?!1:(o=r.element)==null||(i=o.dataset)==null||(a=i.valuetext)==null?void 0:a.toLowerCase().startsWith(t)});return n?e.indexOf(n):null}function jS(e){var t=Ia("useItemId"),n=t.dropdownId;return e!=null&&e>-1?da("option-"+e,n):void 0}function Dl(e){e&&e.focus()}function s$(e,t){return!!(e&&e.contains(t))}function l$(e,t){switch(t===void 0&&(t={}),t.type){case rh:return tt({},e,{isExpanded:!1,selectionIndex:-1});case pa:return tt({},e,{isExpanded:!1,selectionIndex:-1});case ZM:return tt({},e,{isExpanded:!0,selectionIndex:0});case ad:return tt({},e,{isExpanded:!0,selectionIndex:t.payload.index});case IS:return tt({},e,{isExpanded:!0,selectionIndex:-1});case Qn:{var n=t.payload.dropdownRef,r=n===void 0?{current:null}:n;if(t.payload.index>=0&&t.payload.index!==e.selectionIndex){if(r.current){var o=vr(r.current);r.current!==(o==null?void 0:o.activeElement)&&r.current.focus()}return tt({},e,{selectionIndex:t.payload.max!=null?Math.min(Math.max(t.payload.index,0),t.payload.max):Math.max(t.payload.index,0)})}return e}case $S:return tt({},e,{selectionIndex:-1});case FS:return tt({},e,{triggerId:t.payload});case sd:return typeof t.payload!="undefined"?tt({},e,{typeaheadQuery:t.payload}):e;default:return e}}function zS(){return zM(Ru)}var BS={exports:{}},_e={};/** @license React v16.13.1 - * react-is.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var qe=typeof Symbol=="function"&&Symbol.for,oh=qe?Symbol.for("react.element"):60103,ih=qe?Symbol.for("react.portal"):60106,Ou=qe?Symbol.for("react.fragment"):60107,ku=qe?Symbol.for("react.strict_mode"):60108,Pu=qe?Symbol.for("react.profiler"):60114,Tu=qe?Symbol.for("react.provider"):60109,Lu=qe?Symbol.for("react.context"):60110,ah=qe?Symbol.for("react.async_mode"):60111,Nu=qe?Symbol.for("react.concurrent_mode"):60111,Au=qe?Symbol.for("react.forward_ref"):60112,Du=qe?Symbol.for("react.suspense"):60113,u$=qe?Symbol.for("react.suspense_list"):60120,Mu=qe?Symbol.for("react.memo"):60115,$u=qe?Symbol.for("react.lazy"):60116,c$=qe?Symbol.for("react.block"):60121,f$=qe?Symbol.for("react.fundamental"):60117,d$=qe?Symbol.for("react.responder"):60118,p$=qe?Symbol.for("react.scope"):60119;function Tt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case oh:switch(e=e.type,e){case ah:case Nu:case Ou:case Pu:case ku:case Du:return e;default:switch(e=e&&e.$$typeof,e){case Lu:case Au:case $u:case Mu:case Tu:return e;default:return t}}case ih:return t}}}function VS(e){return Tt(e)===Nu}_e.AsyncMode=ah;_e.ConcurrentMode=Nu;_e.ContextConsumer=Lu;_e.ContextProvider=Tu;_e.Element=oh;_e.ForwardRef=Au;_e.Fragment=Ou;_e.Lazy=$u;_e.Memo=Mu;_e.Portal=ih;_e.Profiler=Pu;_e.StrictMode=ku;_e.Suspense=Du;_e.isAsyncMode=function(e){return VS(e)||Tt(e)===ah};_e.isConcurrentMode=VS;_e.isContextConsumer=function(e){return Tt(e)===Lu};_e.isContextProvider=function(e){return Tt(e)===Tu};_e.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===oh};_e.isForwardRef=function(e){return Tt(e)===Au};_e.isFragment=function(e){return Tt(e)===Ou};_e.isLazy=function(e){return Tt(e)===$u};_e.isMemo=function(e){return Tt(e)===Mu};_e.isPortal=function(e){return Tt(e)===ih};_e.isProfiler=function(e){return Tt(e)===Pu};_e.isStrictMode=function(e){return Tt(e)===ku};_e.isSuspense=function(e){return Tt(e)===Du};_e.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Ou||e===Nu||e===Pu||e===ku||e===Du||e===u$||typeof e=="object"&&e!==null&&(e.$$typeof===$u||e.$$typeof===Mu||e.$$typeof===Tu||e.$$typeof===Lu||e.$$typeof===Au||e.$$typeof===f$||e.$$typeof===d$||e.$$typeof===p$||e.$$typeof===c$)};_e.typeOf=Tt;BS.exports=_e;function yt(){return yt=Object.assign||function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}var h$=["as","id","children"],v$=["as"],m$=["as"],g$=["as"],y$=["as"],w$=["portal"],S$=["as"],b$=R.exports.forwardRef(function(e,t){var n=e.as,r=n===void 0?R.exports.Fragment:n,o=e.id,i=e.children,a=to(e,h$),s=R.exports.useMemo(function(){try{return BS.exports.isFragment(R.exports.createElement(r,null))}catch{return!1}},[r]),l=s?{}:yt({ref:t,id:o,"data-reach-menu":""},a);return R.exports.createElement(r,l,R.exports.createElement(t$,{id:o,children:i}))}),_$=R.exports.forwardRef(function(e,t){var n=e.as,r=n===void 0?"button":n,o=to(e,v$),i=n$(yt({},o,{ref:t})),a=i.data,s=a.isExpanded,l=a.controls,u=i.props;return R.exports.createElement(r,yt({"aria-expanded":s?!0:void 0,"aria-haspopup":!0,"aria-controls":l},u,{"data-reach-menu-button":""}))}),x$=R.exports.forwardRef(function(e,t){var n=e.as,r=n===void 0?"div":n,o=to(e,m$),i=r$(yt({},o,{ref:t})),a=i.data.disabled,s=i.props;return R.exports.createElement(r,yt({role:"menuitem"},s,{"aria-disabled":a||void 0,"data-reach-menu-item":""}))}),E$=R.exports.forwardRef(function(e,t){var n=e.as,r=n===void 0?"div":n,o=to(e,g$);return R.exports.createElement(x$,yt({},o,{ref:t,as:r}))}),C$=R.exports.forwardRef(function(e,t){var n=e.as,r=n===void 0?"div":n,o=to(e,y$),i=o$(yt({},o,{ref:t})),a=i.data,s=a.activeDescendant,l=a.triggerId,u=i.props;return R.exports.createElement(r,yt({"aria-activedescendant":s,"aria-labelledby":l||void 0,role:"menu"},u,{"data-reach-menu-items":""}))}),R$=R.exports.forwardRef(function(e,t){var n=e.portal,r=n===void 0?!0:n,o=to(e,w$);return R.exports.createElement(O$,{portal:r},R.exports.createElement(C$,yt({},o,{ref:t,"data-reach-menu-list":""})))}),O$=R.exports.forwardRef(function(e,t){var n=e.as,r=n===void 0?"div":n,o=to(e,S$),i=i$(yt({},o,{ref:t})),a=i.data,s=a.portal,l=a.targetRef,u=a.position,c=i.props,f={"data-reach-menu-popover":""};return s?R.exports.createElement(kM,yt({},c,f,{as:r,targetRef:l,position:u,unstable_skipInitialPortalRender:!0})):R.exports.createElement(r,yt({},c,f))});function k$(e){var t,n,r=vr(e),o=r.defaultView||window;return r?{width:(t=r.documentElement.clientWidth)!=null?t:o.innerWidth,height:(n=r.documentElement.clientHeight)!=null?n:o.innerHeight}:{width:0,height:0}}function Ml(){return Ml=Object.assign||function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}var T$=["as","style"],L$=R.exports.forwardRef(function(t,n){var r=t.as,o=r===void 0?"span":r,i=t.style,a=i===void 0?{}:i,s=P$(t,T$);return R.exports.createElement(o,Ml({ref:n,style:Ml({border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"},a)},s))});function mr(){return mr=Object.assign||function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}var N$=["children","label","ariaLabel","id","DEBUG_STYLE"],A$=["label","ariaLabel","isVisible","id"],D$=["ariaLabel","aria-label","as","id","isVisible","label","position","style","triggerRect"],M$=["type"],vs,Cr,wn,wi,ms,Rr,$$=100,I$=500,we;(function(e){e.Idle="IDLE",e.Focused="FOCUSED",e.Visible="VISIBLE",e.LeavingVisible="LEAVING_VISIBLE",e.Dismissed="DISMISSED"})(we||(we={}));var ye;(function(e){e.Blur="BLUR",e.Focus="FOCUS",e.GlobalMouseMove="GLOBAL_MOUSE_MOVE",e.MouseDown="MOUSE_DOWN",e.MouseEnter="MOUSE_ENTER",e.MouseLeave="MOUSE_LEAVE",e.MouseMove="MOUSE_MOVE",e.Rest="REST",e.SelectWithKeyboard="SELECT_WITH_KEYBOARD",e.TimeComplete="TIME_COMPLETE"})(ye||(ye={}));var ld={initial:we.Idle,states:(Rr={},Rr[we.Idle]={enter:Dc,on:(vs={},vs[ye.MouseEnter]=we.Focused,vs[ye.Focus]=we.Visible,vs)},Rr[we.Focused]={enter:j$,leave:z$,on:(Cr={},Cr[ye.MouseMove]=we.Focused,Cr[ye.MouseLeave]=we.Idle,Cr[ye.MouseDown]=we.Dismissed,Cr[ye.Blur]=we.Idle,Cr[ye.Rest]=we.Visible,Cr)},Rr[we.Visible]={on:(wn={},wn[ye.Focus]=we.Focused,wn[ye.MouseEnter]=we.Focused,wn[ye.MouseLeave]=we.LeavingVisible,wn[ye.Blur]=we.LeavingVisible,wn[ye.MouseDown]=we.Dismissed,wn[ye.SelectWithKeyboard]=we.Dismissed,wn[ye.GlobalMouseMove]=we.LeavingVisible,wn)},Rr[we.LeavingVisible]={enter:B$,leave:function(){V$(),Dc()},on:(wi={},wi[ye.MouseEnter]=we.Visible,wi[ye.Focus]=we.Visible,wi[ye.TimeComplete]=we.Idle,wi)},Rr[we.Dismissed]={leave:function(){Dc()},on:(ms={},ms[ye.MouseLeave]=we.Idle,ms[ye.Blur]=we.Idle,ms)},Rr)},$t={value:ld.initial,context:{id:null}},Is=[];function F$(e){return Is.push(e),function(){Is.splice(Is.indexOf(e),1)}}function U$(){Is.forEach(function(e){return e($t)})}var ud;function j$(){window.clearTimeout(ud),ud=window.setTimeout(function(){Qt({type:ye.Rest})},$$)}function z$(){window.clearTimeout(ud)}var cd;function B$(){window.clearTimeout(cd),cd=window.setTimeout(function(){return Qt({type:ye.TimeComplete})},I$)}function V$(){window.clearTimeout(cd)}function Dc(){$t.context.id=null}function W$(e){var t=e===void 0?{}:e,n=t.id,r=t.onPointerEnter,o=t.onPointerMove,i=t.onPointerLeave,a=t.onPointerDown,s=t.onMouseEnter,l=t.onMouseMove,u=t.onMouseLeave,c=t.onMouseDown,f=t.onFocus,p=t.onBlur,h=t.onKeyDown,g=t.disabled,y=t.ref,b=t.DEBUG_STYLE,v=String(MS(n)),d=R.exports.useState(b?!0:hg(v,!0)),m=d[0],S=d[1],E=R.exports.useRef(null),O=eo(y,E),A=Al(E,{observe:m});R.exports.useEffect(function(){return F$(function(){S(hg(v))})},[v]),R.exports.useEffect(function(){var M=vr(E.current);function $(F){(F.key==="Escape"||F.key==="Esc")&&$t.value===we.Visible&&Qt({type:ye.SelectWithKeyboard})}return M.addEventListener("keydown",$),function(){return M.removeEventListener("keydown",$)}},[]),Y$({disabled:g,isVisible:m,ref:E});function P(M,$){return typeof window!="undefined"&&"PointerEvent"in window?M:Ue(M,$)}function I(M){return function(F){F.pointerType==="mouse"&&M(F)}}function D(){Qt({type:ye.MouseEnter,id:v})}function W(){Qt({type:ye.MouseMove,id:v})}function J(){Qt({type:ye.MouseLeave})}function X(){$t.context.id===v&&Qt({type:ye.MouseDown})}function w(){window.__REACH_DISABLE_TOOLTIPS||Qt({type:ye.Focus,id:v})}function T(){$t.context.id===v&&Qt({type:ye.Blur})}function U(M){(M.key==="Enter"||M.key===" ")&&Qt({type:ye.SelectWithKeyboard})}var k={"aria-describedby":m?da("tooltip",v):void 0,"data-state":m?"tooltip-visible":"tooltip-hidden","data-reach-tooltip-trigger":"",ref:O,onPointerEnter:Ue(r,I(D)),onPointerMove:Ue(o,I(W)),onPointerLeave:Ue(i,I(J)),onPointerDown:Ue(a,I(X)),onMouseEnter:P(s,D),onMouseMove:P(l,W),onMouseLeave:P(u,J),onMouseDown:P(c,X),onFocus:Ue(f,w),onBlur:Ue(p,T),onKeyDown:Ue(h,U)},L={id:v,triggerRect:A,isVisible:m};return[k,L,m]}var H$=R.exports.forwardRef(function(e,t){var n=e.children,r=e.label,o=e.ariaLabel,i=e.id,a=e.DEBUG_STYLE,s=Iu(e,N$),l=R.exports.Children.only(n),u=W$({id:i,onPointerEnter:l.props.onPointerEnter,onPointerMove:l.props.onPointerMove,onPointerLeave:l.props.onPointerLeave,onPointerDown:l.props.onPointerDown,onMouseEnter:l.props.onMouseEnter,onMouseMove:l.props.onMouseMove,onMouseLeave:l.props.onMouseLeave,onMouseDown:l.props.onMouseDown,onFocus:l.props.onFocus,onBlur:l.props.onBlur,onKeyDown:l.props.onKeyDown,disabled:l.props.disabled,ref:l.ref,DEBUG_STYLE:a}),c=u[0],f=u[1];return R.exports.createElement(R.exports.Fragment,null,R.exports.cloneElement(l,c),R.exports.createElement(K$,mr({ref:t,label:r,"aria-label":o},f,s)))}),K$=R.exports.forwardRef(function(t,n){var r=t.label,o=t.ariaLabel,i=t.isVisible,a=t.id,s=Iu(t,A$);return i?R.exports.createElement(OS,null,R.exports.createElement(q$,mr({ref:n,label:r,"aria-label":o,isVisible:i},s,{id:da("tooltip",String(a))}))):null}),q$=R.exports.forwardRef(function(t,n){var r=t.ariaLabel,o=t["aria-label"],i=t.as,a=i===void 0?"div":i,s=t.id,l=t.isVisible,u=t.label,c=t.position,f=c===void 0?X$:c,p=t.style,h=t.triggerRect,g=Iu(t,D$),y=(o||r)!=null,b=R.exports.useRef(null),v=eo(n,b),d=Al(b,{observe:l});return R.exports.createElement(R.exports.Fragment,null,R.exports.createElement(a,mr({role:y?void 0:"tooltip"},g,{ref:v,"data-reach-tooltip":"",id:y?void 0:s,style:mr({},p,Q$(f,h,d))}),u),y&&R.exports.createElement(L$,{role:"tooltip",id:s},o||r))});function Q$(e,t,n){var r=!n;return r?{visibility:"hidden"}:e(t,n)}var G$=8,X$=function(t,n,r){r===void 0&&(r=G$);var o=k$(),i=o.width,a=o.height;if(!t||!n)return{};var s={top:t.top-n.height<0,right:i{delete n[l],t[l]=u}).catch(u=>{r[l]=u}),n[l]}function i(l="default"){t[l]!==void 0||n[l]||o(l)}function a(l="default"){if(t[l]!==void 0)return t[l];throw r[l]?r[l]:n[l]?n[l]:o(l)}function s(l){l?delete t[l]:t={}}return{preload:i,read:a,clear:s}}const sh=J$(()=>Rn(()=>import("./index.8c82c89a.js"),[])),eI="_checkWrapper_1nrct_45",tI="_active_1nrct_51";var vg={checkWrapper:eI,active:tI};function nI({theme:e,dispatch:t}){const{t:n}=ga(),r=R.exports.useMemo(()=>{switch(e){case"dark":return C(mg,{});case"auto":return C(oI,{});case"light":return C(rI,{});default:return console.assert(!1,"Unknown theme"),C(mg,{})}},[e]),o=R.exports.useCallback(i=>t(c3(i)),[t]);return ce(b$,{children:[C(WS,{label:n("switch_theme"),"aria-label":"switch theme",children:C(_$,{children:r})}),ce(R$,{children:[C(Mc,{value:"auto",label:"Auto",active:e==="auto",onSelect:o}),C(Mc,{value:"dark",label:"Dark",active:e==="dark",onSelect:o}),C(Mc,{value:"light",label:"Light",active:e==="light",onSelect:o})]})]})}function Mc(e){const t=hr(vg.checkWrapper,{[vg.active]:e.active});return ce(E$,{onSelect:()=>e.onSelect(e.value),children:[C("span",{className:t,children:C(oA,{size:14})}),C("span",{children:e.label})]})}function mg(){const t=sh.read().motion;return C("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:C(t.path,{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z",initial:{rotate:-30},animate:{rotate:0},transition:{duration:.7}})})}function rI(){const t=sh.read().motion;return ce("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C("circle",{cx:"12",cy:"12",r:"5"}),ce(t.g,{initial:{scale:.7},animate:{scale:1},transition:{duration:.5},children:[C("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),C("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),C("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),C("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),C("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),C("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),C("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),C("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]})]})}function oI(){const t=sh.read().motion;return ce("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C("circle",{cx:"12",cy:"12",r:"11"}),C("clipPath",{id:"cut-off-bottom",children:C(t.rect,{x:"12",y:"0",width:"12",height:"24",initial:{rotate:-30},animate:{rotate:0},transition:{duration:.7}})}),C("circle",{cx:"12",cy:"12",r:"6",clipPath:"url(#cut-off-bottom)",fill:"currentColor"})]})}const iI=e=>({theme:Gp(e)}),HS=An(iI)(nI),fd=0;class aI extends Error{constructor(t,n){super(t),this.message=t,this.code=n,Error.captureStackTrace(this,this.constructor)}}const dd={[fd]:{message:"Browser not supported!",detail:'This browser does not support "fetch", please choose another one.'},default:{message:"Oops, something went wrong!"}};function sI(e){const{code:t}=e;return typeof t=="number"?dd[t]:dd.default}const lI="_content_b98hm_1",uI="_container_b98hm_16",cI="_overlay_b98hm_22",fI="_fixed_b98hm_26";var gs={content:lI,container:uI,overlay:cI,fixed:fI};const dI="_overlay_1i06e_1",pI="_content_1i06e_10";var gg={overlay:dI,content:pI};function hI(a){var s=a,{isOpen:e,onRequestClose:t,className:n,overlayClassName:r,children:o}=s,i=xr(s,["isOpen","onRequestClose","className","overlayClassName","children"]);const l=hr(n,gg.content),u=hr(r,gg.overlay);return C(u1,ge(te({isOpen:e,onRequestClose:t,className:l,overlayClassName:u},i),{children:o}))}var vI=R.exports.memo(hI);const{useCallback:mI,useEffect:gI}=gr;function yI({dispatch:e,apiConfig:t,modals:n}){if(!window.fetch){const{detail:o}=dd[fd];throw new aI(o,fd)}const r=mI(()=>{e(JA("apiConfig"))},[e]);return gI(()=>{e(sS(t))},[e,t]),ce(vI,{isOpen:n.apiConfig,className:gs.content,overlayClassName:gs.overlay,shouldCloseOnOverlayClick:!1,shouldCloseOnEsc:!1,onRequestClose:r,children:[C("div",{className:gs.container,children:C(ES,{})}),C("div",{className:gs.fixed,children:C(HS,{})})]})}const wI=e=>({modals:e.modals,apiConfig:Zo(e)});var SI=An(wI)(yI);const bI="_root_4m2cd_1",_I="_yacd_4m2cd_14",xI="_link_4m2cd_23";var $c={root:bI,yacd:_I,link:xI};function EI({width:e=24,height:t=24}={}){return C("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:C("path",{d:"M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"})})}const CI="https://github.com/haishanh/yacd/issues";function RI({message:e,detail:t}){return ce("div",{className:$c.root,children:[C("div",{className:$c.yacd,children:C(Jp,{width:150,height:150})}),e?C("h1",{children:e}):null,t?C("p",{children:t}):null,C("p",{children:ce("a",{className:$c.link,href:CI,children:[C(EI,{width:16,height:16}),"haishanh/yacd"]})})]})}class OI extends R.exports.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(t){return{error:t}}render(){if(this.state.error){const{message:t,detail:n}=sI(this.state.error);return C(RI,{message:t,detail:n})}else return this.props.children}}const kI="_root_ecp08_1";var yg={root:kI},lh=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(o=r;o--!==0;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(n).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;o--!==0;){var a=i[o];if(!e(t[a],n[a]))return!1}return!0}return t!==t&&n!==n};function wg(e,t,n,r=0,o=!1){for(const a of t)if(lh(n,a.args)){if(o)return;if(a.error)throw a.error;if(a.response)return a.response;throw a.promise}const i={args:n,promise:e(...n).then(a=>i.response=a!=null?a:!0).catch(a=>i.error=a!=null?a:"unknown error").then(()=>{r>0&&setTimeout(()=>{const a=t.indexOf(i);a!==-1&&t.splice(a,1)},r)})};if(t.push(i),!o)throw i.promise}function PI(e,...t){if(t===void 0||t.length===0)e.splice(0,e.length);else{const n=e.find(r=>lh(t,r.args));if(n){const r=e.indexOf(n);r!==-1&&e.splice(r,1)}}}function TI(e,t=0){const n=[];return{read:(...r)=>wg(e,n,r,t),preload:(...r)=>void wg(e,n,r,t,!0),clear:(...r)=>PI(n,...r),peek:(...r)=>{var o;return(o=n.find(i=>lh(r,i.args)))==null?void 0:o.response}}}const Sg=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];function ha(e){if(e<1e3)return e+" B";const t=Math.min(Math.floor(Math.log10(e)/3),Sg.length-1);e=Number((e/Math.pow(1e3,t)).toPrecision(3));const n=Sg[t];return e+" "+n}const LI=TI(()=>Rn(()=>import("./chart-lib.ff648d51.js"),[])),bg={borderWidth:1,pointRadius:0,tension:.2,fill:!0},NI={responsive:!0,maintainAspectRatio:!0,plugins:{legend:{labels:{boxWidth:20}}},scales:{x:{display:!1,type:"category"},y:{type:"linear",display:!0,grid:{display:!0,color:"#555",drawTicks:!1,borderDash:[3,6],drawBorder:!1},ticks:{callback(e){return ha(e)+"/s "}}}}},_g=[{down:{backgroundColor:"rgba(176, 209, 132, 0.8)",borderColor:"rgb(176, 209, 132)"},up:{backgroundColor:"rgba(181, 220, 231, 0.8)",borderColor:"rgb(181, 220, 231)"}},{up:{backgroundColor:"rgb(98, 190, 100)",borderColor:"rgb(78,146,79)"},down:{backgroundColor:"rgb(160, 230, 66)",borderColor:"rgb(110, 156, 44)"}},{up:{backgroundColor:"rgba(94, 175, 223, 0.3)",borderColor:"rgb(94, 175, 223)"},down:{backgroundColor:"rgba(139, 227, 195, 0.3)",borderColor:"rgb(139, 227, 195)"}},{up:{backgroundColor:"rgba(242, 174, 62, 0.3)",borderColor:"rgb(242, 174, 62)"},down:{backgroundColor:"rgba(69, 154, 248, 0.3)",borderColor:"rgb(69, 154, 248)"}}],{useEffect:AI}=Y;function DI(e,t,n,r,o={}){AI(()=>{const i=document.getElementById(t).getContext("2d"),a=te(te({},NI),o),s=new e(i,{type:"line",data:n,options:a}),l=r&&r.subscribe(()=>s.update());return()=>{l&&l(),s.destroy()}},[e,t,n,r,o])}const{useMemo:MI}=gr,$I={position:"relative",maxWidth:1e3},II=e=>({apiConfig:Zo(e),selectedChartStyleIndex:o3(e)});var FI=An(II)(UI);function UI({apiConfig:e,selectedChartStyleIndex:t}){const n=LI.read(),r=qp(e),{t:o}=ga(),i=MI(()=>({labels:r.labels,datasets:[ge(te(te({},bg),_g[t].up),{label:o("Up"),data:r.up}),ge(te(te({},bg),_g[t].down),{label:o("Down"),data:r.down})]}),[r,t,o]);return DI(n.Chart,"trafficChart",i,r),C("div",{style:$I,children:C("canvas",{id:"trafficChart"})})}const jI="_TrafficNow_hzna1_1",zI="_sec_hzna1_10";var ao={TrafficNow:jI,sec:zI};const{useState:KS,useEffect:qS,useCallback:BI}=gr,VI=e=>({apiConfig:Zo(e)});var WI=An(VI)(HI);function HI({apiConfig:e}){const{t}=ga(),{upStr:n,downStr:r}=KI(e),{upTotal:o,dlTotal:i,connNumber:a}=qI(e);return ce("div",{className:ao.TrafficNow,children:[ce("div",{className:ao.sec,children:[C("div",{children:t("Upload")}),C("div",{children:n})]}),ce("div",{className:ao.sec,children:[C("div",{children:t("Download")}),C("div",{children:r})]}),ce("div",{className:ao.sec,children:[C("div",{children:t("Upload Total")}),C("div",{children:o})]}),ce("div",{className:ao.sec,children:[C("div",{children:t("Download Total")}),C("div",{children:i})]}),ce("div",{className:ao.sec,children:[C("div",{children:t("Active Connections")}),C("div",{children:a})]})]})}function KI(e){const[t,n]=KS({upStr:"0 B/s",downStr:"0 B/s"});return qS(()=>qp(e).subscribe(r=>n({upStr:ha(r.up)+"/s",downStr:ha(r.down)+"/s"})),[e]),t}function qI(e){const[t,n]=KS({upTotal:"0 B",dlTotal:"0 B",connNumber:0}),r=BI(({downloadTotal:o,uploadTotal:i,connections:a})=>{n({upTotal:ha(i),dlTotal:ha(o),connNumber:a.length})},[n]);return qS(()=>B3(e,r),[e,r]),t}function QI(){const{t:e}=ga();return ce("div",{children:[C(Gw,{title:e("Overview")}),ce("div",{className:yg.root,children:[C("div",{children:C(WI,{})}),C("div",{className:yg.chart,children:C(R.exports.Suspense,{fallback:C(fS,{height:"200px"}),children:C(FI,{})})})]})]})}const GI="_lo_pmly2_1";var XI={lo:GI};function YI(){return C("div",{className:XI.lo,children:C(Jp,{width:280,height:280,animate:!0,c0:"transparent",c1:"#646464"})})}const ZI="_app_1q2jw_1",JI="_content_1q2jw_17";var QS={app:ZI,content:JI},GS={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},xg=Y.createContext&&Y.createContext(GS),ar=globalThis&&globalThis.__assign||function(){return ar=Object.assign||function(e){for(var t,n=1,r=arguments.length;nC(g4,{to:n,isActive:t.pathname===n,iconId:r,labelText:e(o)},n))}),ce("div",{className:Vn.footer,children:[C(HS,{}),C(WS,{label:e("about"),children:C(C1,{to:"/about",className:Vn.iconWrapper,children:C(mA,{size:20})})})]})]})}const S4="_input_4ejw0_1";var vF={input:S4};const b4="_animate_1w0e8_1";var mF={animate:b4,"zap-pulse":"_zap-pulse_1w0e8_1"};function pd(){return pd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=l)&&this.A(n),this.W&&this.setState({N:!1,j:!1}),this.l=Date.now()},t.prototype.p=function(n){n.preventDefault(),typeof n.button=="number"&&n.button!==0||(this.I(n.clientX),window.addEventListener("mousemove",this.v),window.addEventListener("mouseup",this.g))},t.prototype.v=function(n){n.preventDefault(),this.L(n.clientX)},t.prototype.g=function(n){this.U(n),window.removeEventListener("mousemove",this.v),window.removeEventListener("mouseup",this.g)},t.prototype.k=function(n){this.X=null,this.I(n.touches[0].clientX)},t.prototype.m=function(n){this.L(n.touches[0].clientX)},t.prototype.M=function(n){n.preventDefault(),this.U(n)},t.prototype.$=function(n){Date.now()-this.l>50&&(this.A(n),Date.now()-this.u>50&&this.W&&this.setState({j:!1}))},t.prototype.C=function(){this.u=Date.now()},t.prototype.D=function(){this.setState({j:!0})},t.prototype.O=function(){this.setState({j:!1})},t.prototype.S=function(n){this.H=n},t.prototype.T=function(n){n.preventDefault(),this.H.focus(),this.A(n),this.W&&this.setState({j:!1})},t.prototype.A=function(n){var r=this.props;(0,r.onChange)(!r.checked,n,r.id)},t.prototype.render=function(){var n=this.props,r=n.checked,o=n.disabled,i=n.className,a=n.offColor,s=n.onColor,l=n.offHandleColor,u=n.onHandleColor,c=n.checkedIcon,f=n.uncheckedIcon,p=n.checkedHandleIcon,h=n.uncheckedHandleIcon,g=n.boxShadow,y=n.activeBoxShadow,b=n.height,v=n.width,d=n.borderRadius,m=function(T,U){var k={};for(var L in T)Object.prototype.hasOwnProperty.call(T,L)&&U.indexOf(L)===-1&&(k[L]=T[L]);return k}(n,["checked","disabled","className","offColor","onColor","offHandleColor","onHandleColor","checkedIcon","uncheckedIcon","checkedHandleIcon","uncheckedHandleIcon","boxShadow","activeBoxShadow","height","width","borderRadius","handleDiameter"]),S=this.state,E=S.h,O=S.N,A=S.j,P={position:"relative",display:"inline-block",textAlign:"left",opacity:o?.5:1,direction:"ltr",borderRadius:b/2,WebkitTransition:"opacity 0.25s",MozTransition:"opacity 0.25s",transition:"opacity 0.25s",touchAction:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"},I={height:b,width:v,margin:Math.max(0,(this.t-b)/2),position:"relative",background:Cg(E,this.i,this.o,a,s),borderRadius:typeof d=="number"?d:b/2,cursor:o?"default":"pointer",WebkitTransition:O?null:"background 0.25s",MozTransition:O?null:"background 0.25s",transition:O?null:"background 0.25s"},D={height:b,width:Math.min(1.5*b,v-(this.t+b)/2+1),position:"relative",opacity:(E-this.o)/(this.i-this.o),pointerEvents:"none",WebkitTransition:O?null:"opacity 0.25s",MozTransition:O?null:"opacity 0.25s",transition:O?null:"opacity 0.25s"},W={height:b,width:Math.min(1.5*b,v-(this.t+b)/2+1),position:"absolute",opacity:1-(E-this.o)/(this.i-this.o),right:0,top:0,pointerEvents:"none",WebkitTransition:O?null:"opacity 0.25s",MozTransition:O?null:"opacity 0.25s",transition:O?null:"opacity 0.25s"},J={height:this.t,width:this.t,background:Cg(E,this.i,this.o,l,u),display:"inline-block",cursor:o?"default":"pointer",borderRadius:typeof d=="number"?d-1:"50%",position:"absolute",transform:"translateX("+E+"px)",top:Math.max(0,(b-this.t)/2),outline:0,boxShadow:A?y:g,border:0,WebkitTransition:O?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",MozTransition:O?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s",transition:O?null:"background-color 0.25s, transform 0.25s, box-shadow 0.15s"},X={height:this.t,width:this.t,opacity:Math.max(2*(1-(E-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:O?null:"opacity 0.25s",MozTransition:O?null:"opacity 0.25s",transition:O?null:"opacity 0.25s"},w={height:this.t,width:this.t,opacity:Math.max(2*((E-this.o)/(this.i-this.o)-.5),0),position:"absolute",left:0,top:0,pointerEvents:"none",WebkitTransition:O?null:"opacity 0.25s",MozTransition:O?null:"opacity 0.25s",transition:O?null:"opacity 0.25s"};return Y.createElement("div",{className:i,style:P},Y.createElement("div",{className:"react-switch-bg",style:I,onClick:o?null:this.T,onMouseDown:function(T){return T.preventDefault()}},c&&Y.createElement("div",{style:D},c),f&&Y.createElement("div",{style:W},f)),Y.createElement("div",{className:"react-switch-handle",style:J,onClick:function(T){return T.preventDefault()},onMouseDown:o?null:this.p,onTouchStart:o?null:this.k,onTouchMove:o?null:this.m,onTouchEnd:o?null:this.M,onTouchCancel:o?null:this.O},h&&Y.createElement("div",{style:X},h),p&&Y.createElement("div",{style:w},p)),Y.createElement("input",pd({},{type:"checkbox",role:"switch","aria-checked":r,checked:r,disabled:o,style:{border:0,clip:"rect(0 0 0 0)",height:1,margin:-1,overflow:"hidden",padding:0,position:"absolute",width:1}},m,{ref:this.S,onFocus:this.D,onBlur:this.O,onKeyUp:this.C,onChange:this.$})))},t}(R.exports.Component);Fs.defaultProps={disabled:!1,offColor:"#888",onColor:"#080",offHandleColor:"#fff",onHandleColor:"#fff",uncheckedIcon:_4,checkedIcon:x4,boxShadow:null,activeBoxShadow:"0 0 2px 3px #3bf",height:28,width:56};const E4=Fs.default?Fs.default:Fs;function C4({checked:e=!1,onChange:t,theme:n,name:r}){return C(E4,{onChange:t,checked:e,uncheckedIcon:!1,checkedIcon:!1,offColor:n==="dark"?"#393939":"#e9e9e9",onColor:"#047aff",offHandleColor:"#fff",onHandleColor:"#fff",handleDiameter:24,height:28,width:44,className:"rs",name:r})}var gF=An(e=>({theme:Gp(e)}))(C4);const R4="_ToggleSwitch_10mtp_1",O4="_slider_10mtp_28";var Rg={ToggleSwitch:R4,slider:O4};function k4({options:e,value:t,name:n,onChange:r}){const o=R.exports.useMemo(()=>e.map(s=>s.value).indexOf(t),[e,t]),i=R.exports.useCallback(s=>{const l=Math.floor(100/e.length);if(s===e.length-1)return 100-e.length*l+l;if(s>-1)return l},[e]),a=R.exports.useMemo(()=>({width:i(o)+"%",left:o*i(0)+"%"}),[o,i]);return ce("div",{className:Rg.ToggleSwitch,children:[C("div",{className:Rg.slider,style:a}),e.map((s,l)=>{const u=`${n}-${s.label}`;return ce("label",{htmlFor:u,className:l===0?"":"border-left",style:{width:i(l)+"%"},children:[C("input",{id:u,name:n,type:"radio",value:s.value,checked:t===s.value,onChange:r}),C("div",{children:s.label})]},u)})]})}Y.memo(k4);const{lazy:Fa,Suspense:YS}=gr,P4=Fa(()=>Rn(()=>import("./Connections.57d57b9f.js"),["assets/Connections.57d57b9f.js","assets/Connections.c7e8fa7e.css","assets/useRemainingViewPortHeight.d051faee.js","assets/chevron-down.e7f05dbc.js","assets/index.e97a91e5.js","assets/Fab.93225453.js","assets/Fab.33a60e0e.css","assets/play.56145bca.js"])),T4=Fa(()=>Rn(()=>import("./Config.6828b15b.js"),["assets/Config.6828b15b.js","assets/Config.58870520.css","assets/logs.36f1d416.js","assets/Select.f72e6abf.js","assets/Select.aace7191.css"])),L4=Fa(()=>Rn(()=>import("./Logs.285710c1.js"),["assets/Logs.285710c1.js","assets/Logs.029b1e0c.css","assets/index.esm.390d1b7a.js","assets/logs.36f1d416.js","assets/debounce.d080d5e1.js","assets/useRemainingViewPortHeight.d051faee.js","assets/Fab.93225453.js","assets/Fab.33a60e0e.css","assets/play.56145bca.js"])),N4=Fa(()=>Rn(()=>import("./Proxies.2359f6a1.js"),["assets/Proxies.2359f6a1.js","assets/Proxies.db2d4119.css","assets/chevron-down.e7f05dbc.js","assets/Fab.93225453.js","assets/Fab.33a60e0e.css","assets/TextFitler.f9fb92be.js","assets/TextFitler.3d9182a0.css","assets/debounce.d080d5e1.js","assets/index.e97a91e5.js","assets/Select.f72e6abf.js","assets/Select.aace7191.css"])),A4=Fa(()=>Rn(()=>import("./Rules.2fdbf529.js"),["assets/Rules.2fdbf529.js","assets/Rules.faccd448.css","assets/index.esm.390d1b7a.js","assets/TextFitler.f9fb92be.js","assets/TextFitler.3d9182a0.css","assets/debounce.d080d5e1.js","assets/index.e97a91e5.js","assets/Fab.93225453.js","assets/Fab.33a60e0e.css","assets/useRemainingViewPortHeight.d051faee.js"])),D4=[{path:"/",element:C(QI,{})},{path:"/connections",element:C(P4,{})},{path:"/configs",element:C(T4,{})},{path:"/logs",element:C(L4,{})},{path:"/proxies",element:C(N4,{})},{path:"/rules",element:C(A4,{})},{path:"/about",element:C(_3,{})},!1].filter(Boolean);function M4(){return E1(D4)}function $4(){return ce(pr,{children:[C(SI,{}),C(w4,{}),C("div",{className:QS.content,children:C(YS,{fallback:C(YI,{}),children:C(M4,{})})})]})}function I4(){return E1([{path:"/backend",element:C(ES,{})},{path:"*",element:C($4,{})}])}const F4=()=>C(OI,{children:C(QN,{children:C(KA,{initialState:uD,actions:cD,children:C(RC,{client:T3,children:C(lR,{children:ce("div",{className:QS.app,children:[C(k3,{}),C(YS,{fallback:C(fS,{}),children:C(I4,{})})]})})})})})}),U4=Boolean(window.location.hostname==="localhost"||window.location.hostname==="[::1]"||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));function j4(e){if("serviceWorker"in navigator){if(new URL("./",window.location.href).origin!==window.location.origin)return;window.addEventListener("load",()=>{const n=".//sw.js";U4?(z4(n,e),navigator.serviceWorker.ready.then(()=>{console.log("This web app is being served cache-first by a service worker")})):ZS(n,e)})}}function ZS(e,t){navigator.serviceWorker.register(e).then(n=>{n.onupdatefound=()=>{const r=n.installing;r!=null&&(r.onstatechange=()=>{r.state==="installed"&&(navigator.serviceWorker.controller?(console.log("New content is available and will be used when all tabs for this page are closed. See https://cra.link/PWA."),t&&t.onUpdate&&t.onUpdate(n)):(console.log("Content is cached for offline use."),t&&t.onSuccess&&t.onSuccess(n)))})}}).catch(n=>{console.error("Error during service worker registration:",n)})}function z4(e,t){fetch(e,{headers:{"Service-Worker":"script"}}).then(n=>{const r=n.headers.get("content-type");n.status===404||r!=null&&r.indexOf("javascript")===-1?navigator.serviceWorker.ready.then(o=>{o.unregister().then(()=>{window.location.reload()})}):ZS(e,t)}).catch(()=>{console.log("No internet connection found. App is running in offline mode.")})}const JS=document.getElementById("app"),B4=J0(JS);u1.setAppElement(JS);B4.render(C(R.exports.StrictMode,{children:C(F4,{})}));j4();console.log("Checkout the repo: https://github.com/haishanh/yacd");console.log("Version:","0.3.5");export{gS as $,q4 as A,KD as B,Gw as C,Pt as D,K4 as E,pr as F,U3 as G,nF as H,wA as I,rF as J,tF as K,G4 as L,u1 as M,eF as N,Xn as O,Ne as P,pe as Q,Y as R,Jp as S,mF as T,hF as U,H4 as V,dF as W,X3 as X,W$ as Y,K$ as Z,Ca as _,ys as a,Y3 as a0,cF as a1,pF as a2,WS as a3,Y4 as a4,Z4 as a5,J4 as a6,sF as a7,lF as a8,fF as a9,uF as aa,sh as ab,i3 as ac,Jo as ad,iF as ae,Z3 as af,aF as ag,vC as ah,Fe as ai,Ra as aj,W4 as ak,CC as al,et as am,TC as an,GN as ao,NC as ap,ce as b,hr as c,An as d,oF as e,B3 as f,Zo as g,gr as h,LI as i,C as j,bg as k,_g as l,gg as m,DI as n,Q4 as o,ha as p,sS as q,R as r,vF as s,tg as t,ga as u,X4 as v,HA as w,gF as x,o3 as y,uS as z}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.8c82c89a.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.8c82c89a.js deleted file mode 100644 index e5d84241a..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.8c82c89a.js +++ /dev/null @@ -1 +0,0 @@ -var zi=Object.defineProperty;var Hr=Object.getOwnPropertySymbols;var ki=Object.prototype.hasOwnProperty,Gi=Object.prototype.propertyIsEnumerable;var zr=(t,e,r)=>e in t?zi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,kr=(t,e)=>{for(var r in e||(e={}))ki.call(e,r)&&zr(t,r,e[r]);if(Hr)for(var r of Hr(e))Gi.call(e,r)&&zr(t,r,e[r]);return t};import{r as m,R as to,j as Yi}from"./index.5901d226.js";var Ue=function(t,e){return Ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},Ue(t,e)};function eo(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ue(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var g=function(){return g=Object.assign||function(e){for(var r,n=1,o=arguments.length;n=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function L(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,a=[],i;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(s){i={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function Y(t,e,r){if(r||arguments.length===2)for(var n=0,o=e.length,a;nperformance.now():()=>Date.now(),lo=typeof window!="undefined"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(aa()),uo);function sa(t){let e=[],r=[],n=0,o=!1,a=!1;const i=new WeakSet,s={schedule:(u,l=!1,c=!1)=>{const d=c&&o,v=d?e:r;return l&&i.add(u),v.indexOf(u)===-1&&(v.push(u),d&&o&&(n=e.length)),u},cancel:u=>{const l=r.indexOf(u);l!==-1&&r.splice(l,1),i.delete(u)},process:u=>{if(o){a=!0;return}if(o=!0,[e,r]=[r,e],r.length=0,n=e.length,n)for(let l=0;l(t[e]=sa(()=>zt=!0),t),{}),k=Xt.reduce((t,e)=>{const r=Te[e];return t[e]=(n,o=!1,a=!1)=>(zt||ca(),r.schedule(n,o,a)),t},{}),mt=Xt.reduce((t,e)=>(t[e]=Te[e].cancel,t),{}),Ee=Xt.reduce((t,e)=>(t[e]=()=>Te[e].process(Ct),t),{}),la=t=>Te[t].process(Ct),co=t=>{zt=!1,Ct.delta=He?uo:Math.max(Math.min(t-Ct.timestamp,ua),1),Ct.timestamp=t,ze=!0,Xt.forEach(la),ze=!1,zt&&(He=!1,lo(co))},ca=()=>{zt=!0,He=!0,ze||lo(co)},fe=()=>Ct,de=(t,e,r)=>Math.min(Math.max(r,t),e),Ae=.001,fa=.01,Yr=10,da=.05,va=1;function pa({duration:t=800,bounce:e=.25,velocity:r=0,mass:n=1}){let o,a;Xi(t<=Yr*1e3);let i=1-e;i=de(da,va,i),t=de(fa,Yr,t/1e3),i<1?(o=l=>{const c=l*i,d=c*t,v=c-r,f=ke(l,i),p=Math.exp(-d);return Ae-v/f*p},a=l=>{const d=l*i*t,v=d*r+r,f=Math.pow(i,2)*Math.pow(l,2)*t,p=Math.exp(-d),h=ke(Math.pow(l,2),i);return(-o(l)+Ae>0?-1:1)*((v-f)*p)/h}):(o=l=>{const c=Math.exp(-l*t),d=(l-r)*t+1;return-Ae+c*d},a=l=>{const c=Math.exp(-l*t),d=(r-l)*(t*t);return c*d});const s=5/t,u=ma(o,a,s);if(t=t*1e3,isNaN(u))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(u,2)*n;return{stiffness:l,damping:i*2*Math.sqrt(n*l),duration:t}}}const ha=12;function ma(t,e,r){let n=r;for(let o=1;ot[r]!==void 0)}function xa(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Kr(t,ya)&&Kr(t,ga)){const r=pa(t);e=Object.assign(Object.assign(Object.assign({},e),r),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function lr(t){var{from:e=0,to:r=1,restSpeed:n=2,restDelta:o}=t,a=j(t,["from","to","restSpeed","restDelta"]);const i={done:!1,value:e};let{stiffness:s,damping:u,mass:l,velocity:c,duration:d,isResolvedFromDuration:v}=xa(a),f=Wr,p=Wr;function h(){const y=c?-(c/1e3):0,x=r-e,S=u/(2*Math.sqrt(s*l)),b=Math.sqrt(s/l)/1e3;if(o===void 0&&(o=Math.min(Math.abs(r-e)/100,.4)),S<1){const P=ke(b,S);f=V=>{const M=Math.exp(-S*b*V);return r-M*((y+S*b*x)/P*Math.sin(P*V)+x*Math.cos(P*V))},p=V=>{const M=Math.exp(-S*b*V);return S*b*M*(Math.sin(P*V)*(y+S*b*x)/P+x*Math.cos(P*V))-M*(Math.cos(P*V)*(y+S*b*x)-P*x*Math.sin(P*V))}}else if(S===1)f=P=>r-Math.exp(-b*P)*(x+(y+b*x)*P);else{const P=b*Math.sqrt(S*S-1);f=V=>{const M=Math.exp(-S*b*V),R=Math.min(P*V,300);return r-M*((y+S*b*x)*Math.sinh(R)+P*x*Math.cosh(R))/P}}}return h(),{next:y=>{const x=f(y);if(v)i.done=y>=d;else{const S=p(y)*1e3,b=Math.abs(S)<=n,P=Math.abs(r-x)<=o;i.done=b&&P}return i.value=i.done?r:x,i},flipTarget:()=>{c=-c,[e,r]=[r,e],h()}}}lr.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";const Wr=t=>0,kt=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n},F=(t,e,r)=>-r*t+r*e+t,fo=(t,e)=>r=>Math.max(Math.min(r,e),t),It=t=>t%1?Number(t.toFixed(5)):t,Gt=/(-)?([\d]*\.?[\d])+/g,Ge=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,ba=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function $t(t){return typeof t=="string"}const yt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Ft=Object.assign(Object.assign({},yt),{transform:fo(0,1)}),te=Object.assign(Object.assign({},yt),{default:1}),Zt=t=>({test:e=>$t(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),at=Zt("deg"),tt=Zt("%"),w=Zt("px"),Sa=Zt("vh"),Pa=Zt("vw"),Xr=Object.assign(Object.assign({},tt),{parse:t=>tt.parse(t)/100,transform:t=>tt.transform(t*100)}),cr=(t,e)=>r=>Boolean($t(r)&&ba.test(r)&&r.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(r,e)),vo=(t,e,r)=>n=>{if(!$t(n))return n;const[o,a,i,s]=n.match(Gt);return{[t]:parseFloat(o),[e]:parseFloat(a),[r]:parseFloat(i),alpha:s!==void 0?parseFloat(s):1}},pt={test:cr("hsl","hue"),parse:vo("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+tt.transform(It(e))+", "+tt.transform(It(r))+", "+It(Ft.transform(n))+")"},Ta=fo(0,255),Me=Object.assign(Object.assign({},yt),{transform:t=>Math.round(Ta(t))}),ut={test:cr("rgb","red"),parse:vo("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+Me.transform(t)+", "+Me.transform(e)+", "+Me.transform(r)+", "+It(Ft.transform(n))+")"};function Va(t){let e="",r="",n="",o="";return t.length>5?(e=t.substr(1,2),r=t.substr(3,2),n=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),r=t.substr(2,1),n=t.substr(3,1),o=t.substr(4,1),e+=e,r+=r,n+=n,o+=o),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}}const Ye={test:cr("#"),parse:Va,transform:ut.transform},z={test:t=>ut.test(t)||Ye.test(t)||pt.test(t),parse:t=>ut.test(t)?ut.parse(t):pt.test(t)?pt.parse(t):Ye.parse(t),transform:t=>$t(t)?t:t.hasOwnProperty("red")?ut.transform(t):pt.transform(t)},po="${c}",ho="${n}";function Ca(t){var e,r,n,o;return isNaN(t)&&$t(t)&&((r=(e=t.match(Gt))===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0)+((o=(n=t.match(Ge))===null||n===void 0?void 0:n.length)!==null&&o!==void 0?o:0)>0}function mo(t){typeof t=="number"&&(t=`${t}`);const e=[];let r=0;const n=t.match(Ge);n&&(r=n.length,t=t.replace(Ge,po),e.push(...n.map(z.parse)));const o=t.match(Gt);return o&&(t=t.replace(Gt,ho),e.push(...o.map(yt.parse))),{values:e,numColors:r,tokenised:t}}function go(t){return mo(t).values}function yo(t){const{values:e,numColors:r,tokenised:n}=mo(t),o=e.length;return a=>{let i=n;for(let s=0;stypeof t=="number"?0:t;function Ea(t){const e=go(t);return yo(t)(e.map(wa))}const nt={test:Ca,parse:go,createTransformer:yo,getAnimatableNone:Ea},Aa=new Set(["brightness","contrast","saturate","opacity"]);function Ma(t){let[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(Gt)||[];if(!n)return t;const o=r.replace(n,"");let a=Aa.has(e)?1:0;return n!==r&&(a*=100),e+"("+a+o+")"}const Ra=/([a-z-]*)\(.*?\)/g,Ke=Object.assign(Object.assign({},nt),{getAnimatableNone:t=>{const e=t.match(Ra);return e?e.map(Ma).join(" "):t}});function Re(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function $r({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let o=0,a=0,i=0;if(!e)o=a=i=r;else{const s=r<.5?r*(1+e):r+e-r*e,u=2*r-s;o=Re(u,s,t+1/3),a=Re(u,s,t),i=Re(u,s,t-1/3)}return{red:Math.round(o*255),green:Math.round(a*255),blue:Math.round(i*255),alpha:n}}const La=(t,e,r)=>{const n=t*t,o=e*e;return Math.sqrt(Math.max(0,r*(o-n)+n))},Oa=[Ye,ut,pt],Zr=t=>Oa.find(e=>e.test(t)),xo=(t,e)=>{let r=Zr(t),n=Zr(e),o=r.parse(t),a=n.parse(e);r===pt&&(o=$r(o),r=ut),n===pt&&(a=$r(a),n=ut);const i=Object.assign({},o);return s=>{for(const u in i)u!=="alpha"&&(i[u]=La(o[u],a[u],s));return i.alpha=F(o.alpha,a.alpha,s),r.transform(i)}},We=t=>typeof t=="number",Da=(t,e)=>r=>e(t(r)),Ve=(...t)=>t.reduce(Da);function bo(t,e){return We(t)?r=>F(t,e,r):z.test(t)?xo(t,e):Po(t,e)}const So=(t,e)=>{const r=[...t],n=r.length,o=t.map((a,i)=>bo(a,e[i]));return a=>{for(let i=0;i{const r=Object.assign(Object.assign({},t),e),n={};for(const o in r)t[o]!==void 0&&e[o]!==void 0&&(n[o]=bo(t[o],e[o]));return o=>{for(const a in n)r[a]=n[a](o);return r}};function qr(t){const e=nt.parse(t),r=e.length;let n=0,o=0,a=0;for(let i=0;i{const r=nt.createTransformer(e),n=qr(t),o=qr(e);return n.numHSL===o.numHSL&&n.numRGB===o.numRGB&&n.numNumbers>=o.numNumbers?Ve(So(n.parsed,o.parsed),r):i=>`${i>0?e:t}`},Fa=(t,e)=>r=>F(t,e,r);function ja(t){if(typeof t=="number")return Fa;if(typeof t=="string")return z.test(t)?xo:Po;if(Array.isArray(t))return So;if(typeof t=="object")return Ia}function Ba(t,e,r){const n=[],o=r||ja(t[0]),a=t.length-1;for(let i=0;ir(kt(t,e,n))}function _a(t,e){const r=t.length,n=r-1;return o=>{let a=0,i=!1;if(o<=t[0]?i=!0:o>=t[n]&&(a=n-1,i=!0),!i){let u=1;for(;uo||u===n);u++);a=u-1}const s=kt(t[a],t[a+1],o);return e[a](s)}}function fr(t,e,{clamp:r=!0,ease:n,mixer:o}={}){const a=t.length;ce(a===e.length),ce(!n||!Array.isArray(n)||n.length===a-1),t[0]>t[a-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const i=Ba(e,n,o),s=a===2?Ua(t,i):_a(t,i);return r?u=>s(de(t[0],t[a-1],u)):s}const Ce=t=>e=>1-t(1-e),dr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Na=t=>e=>Math.pow(e,t),To=t=>e=>e*e*((t+1)*e-t),Ha=t=>{const e=To(t);return r=>(r*=2)<1?.5*e(r):.5*(2-Math.pow(2,-10*(r-1)))},Vo=1.525,za=4/11,ka=8/11,Ga=9/10,vr=t=>t,pr=Na(2),Ya=Ce(pr),Co=dr(pr),wo=t=>1-Math.sin(Math.acos(t)),hr=Ce(wo),Ka=dr(hr),mr=To(Vo),Wa=Ce(mr),Xa=dr(mr),$a=Ha(Vo),Za=4356/361,qa=35442/1805,Ja=16061/1805,ve=t=>{if(t===1||t===0)return t;const e=t*t;return tt<.5?.5*(1-ve(1-t*2)):.5*ve(t*2-1)+.5;function es(t,e){return t.map(()=>e||Co).splice(0,t.length-1)}function rs(t){const e=t.length;return t.map((r,n)=>n!==0?n/(e-1):0)}function ns(t,e){return t.map(r=>r*e)}function ae({from:t=0,to:e=1,ease:r,offset:n,duration:o=300}){const a={done:!1,value:t},i=Array.isArray(e)?e:[t,e],s=ns(n&&n.length===i.length?n:rs(i),o);function u(){return fr(s,i,{ease:Array.isArray(r)?r:es(i,r)})}let l=u();return{next:c=>(a.value=l(c),a.done=c>=o,a),flipTarget:()=>{i.reverse(),l=u()}}}function os({velocity:t=0,from:e=0,power:r=.8,timeConstant:n=350,restDelta:o=.5,modifyTarget:a}){const i={done:!1,value:e};let s=r*t;const u=e+s,l=a===void 0?u:a(u);return l!==u&&(s=l-e),{next:c=>{const d=-s*Math.exp(-c/n);return i.done=!(d>o||d<-o),i.value=i.done?l:l+d,i},flipTarget:()=>{}}}const Jr={keyframes:ae,spring:lr,decay:os};function is(t){if(Array.isArray(t.to))return ae;if(Jr[t.type])return Jr[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?ae:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?lr:ae}function Eo(t,e,r=0){return t-e-r}function as(t,e,r=0,n=!0){return n?Eo(e+-t,e,r):e-(t-e)+r}function ss(t,e,r,n){return n?t>=e+r:t<=-r}const us=t=>{const e=({delta:r})=>t(r);return{start:()=>k.update(e,!0),stop:()=>mt.update(e)}};function gr(t){var e,r,{from:n,autoplay:o=!0,driver:a=us,elapsed:i=0,repeat:s=0,repeatType:u="loop",repeatDelay:l=0,onPlay:c,onStop:d,onComplete:v,onRepeat:f,onUpdate:p}=t,h=j(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:y}=h,x,S=0,b=h.duration,P,V=!1,M=!0,R;const E=is(h);!((r=(e=E).needsInterpolation)===null||r===void 0)&&r.call(e,n,y)&&(R=fr([0,100],[n,y],{clamp:!1}),n=0,y=100);const A=E(Object.assign(Object.assign({},h),{from:n,to:y}));function I(){S++,u==="reverse"?(M=S%2===0,i=as(i,b,l,M)):(i=Eo(i,b,l),u==="mirror"&&A.flipTarget()),V=!1,f&&f()}function B(){x.stop(),v&&v()}function K(W){if(M||(W=-W),i+=W,!V){const X=A.next(Math.max(0,i));P=X.value,R&&(P=R(P)),V=M?X.done:i<=0}p==null||p(P),V&&(S===0&&(b!=null||(b=i)),S{d==null||d(),x.stop()}}}function Ao(t,e){return e?t*(1e3/e):0}function ls({from:t=0,velocity:e=0,min:r,max:n,power:o=.8,timeConstant:a=750,bounceStiffness:i=500,bounceDamping:s=10,restDelta:u=1,modifyTarget:l,driver:c,onUpdate:d,onComplete:v,onStop:f}){let p;function h(b){return r!==void 0&&bn}function y(b){return r===void 0?n:n===void 0||Math.abs(r-b){var V;d==null||d(P),(V=b.onUpdate)===null||V===void 0||V.call(b,P)},onComplete:v,onStop:f}))}function S(b){x(Object.assign({type:"spring",stiffness:i,damping:s,restDelta:u},b))}if(h(t))S({from:t,velocity:e,to:y(t)});else{let b=o*e+t;typeof l!="undefined"&&(b=l(b));const P=y(b),V=P===r?-1:1;let M,R;const E=A=>{M=R,R=A,e=Ao(A-M,fe().delta),(V===1&&A>P||V===-1&&Ap==null?void 0:p.stop()}}const Xe=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),Qr=t=>Xe(t)&&t.hasOwnProperty("z"),ee=(t,e)=>Math.abs(t-e);function Mo(t,e){if(We(t)&&We(e))return ee(t,e);if(Xe(t)&&Xe(e)){const r=ee(t.x,e.x),n=ee(t.y,e.y),o=Qr(t)&&Qr(e)?ee(t.z,e.z):0;return Math.sqrt(Math.pow(r,2)+Math.pow(n,2)+Math.pow(o,2))}}const cs=(t,e,r)=>{const n=e-t;return((r-t)%n+n)%n+t},Ro=(t,e)=>1-3*e+3*t,Lo=(t,e)=>3*e-6*t,Oo=t=>3*t,pe=(t,e,r)=>((Ro(e,r)*t+Lo(e,r))*t+Oo(e))*t,Do=(t,e,r)=>3*Ro(e,r)*t*t+2*Lo(e,r)*t+Oo(e),fs=1e-7,ds=10;function vs(t,e,r,n,o){let a,i,s=0;do i=e+(r-e)/2,a=pe(i,n,o)-t,a>0?r=i:e=i;while(Math.abs(a)>fs&&++s=hs?ms(i,d,t,r):v===0?d:vs(i,s,s+re,t,r)}return i=>i===0||i===1?i:pe(a(i),e,n)}function yr(t,e){t.indexOf(e)===-1&&t.push(e)}function xr(t,e){var r=t.indexOf(e);r>-1&&t.splice(r,1)}function ys(t,e,r){var n=L(t),o=n.slice(0),a=e<0?o.length+e:e;if(a>=0&&ae?1:r(kt(t,e,n))}}function cn(t,e){t.min=e.min,t.max=e.max}function J(t,e){cn(t.x,e.x),cn(t.y,e.y)}function Oe(t){return t===void 0||t===1}function Uo(t){var e=t.scale,r=t.scaleX,n=t.scaleY;return!Oe(e)||!Oe(r)||!Oe(n)}function st(t){return Uo(t)||fn(t.x)||fn(t.y)||t.z||t.rotate||t.rotateX||t.rotateY}function fn(t){return t&&t!=="0%"}function me(t,e,r){var n=t-r,o=e*n;return r+o}function dn(t,e,r,n,o){return o!==void 0&&(t=me(t,o,n)),me(t,r,n)+e}function Ze(t,e,r,n,o){e===void 0&&(e=0),r===void 0&&(r=1),t.min=dn(t.min,e,r,n,o),t.max=dn(t.max,e,r,n,o)}function _o(t,e){var r=e.x,n=e.y;Ze(t.x,r.translate,r.scale,r.originPoint),Ze(t.y,n.translate,n.scale,n.originPoint)}function Us(t,e,r,n){var o,a;n===void 0&&(n=!1);var i=r.length;if(!!i){e.x=e.y=1;for(var s,u,l=0;l=0;o--){var a=this.members[o];if(a.isPresent!==!1){n=a;break}}return n?(this.promote(n),!0):!1},t.prototype.promote=function(e,r){var n,o=this.lead;if(e!==o&&(this.prevLead=o,this.lead=e,e.show(),o)){o.instance&&o.scheduleRender(),e.scheduleRender(),e.resumeFrom=o,r&&(e.resumeFrom.preserveOpacity=!0),o.snapshot&&(e.snapshot=o.snapshot,e.snapshot.latestValues=o.animationValues||o.latestValues,e.snapshot.isShared=!0),!((n=e.root)===null||n===void 0)&&n.isUpdating&&(e.isLayoutDirty=!0);var a=e.options.crossfade;a===!1&&o.hide()}},t.prototype.exitAnimationComplete=function(){this.members.forEach(function(e){var r,n,o,a,i;(n=(r=e.options).onExitComplete)===null||n===void 0||n.call(r),(i=(o=e.resumingFrom)===null||o===void 0?void 0:(a=o.options).onExitComplete)===null||i===void 0||i.call(a)})},t.prototype.scheduleRender=function(){this.members.forEach(function(e){e.instance&&e.scheduleRender(!1)})},t.prototype.removeLeadSnapshot=function(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)},t}(),ge={};function Ks(t){Object.assign(ge,t)}var Ws="translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";function Vn(t,e,r){var n=t.x.translate/e.x,o=t.y.translate/e.y,a="translate3d(".concat(n,"px, ").concat(o,"px, 0) ");if(a+="scale(".concat(1/e.x,", ").concat(1/e.y,") "),r){var i=r.rotate,s=r.rotateX,u=r.rotateY;i&&(a+="rotate(".concat(i,"deg) ")),s&&(a+="rotateX(".concat(s,"deg) ")),u&&(a+="rotateY(".concat(u,"deg) "))}var l=t.x.scale*e.x,c=t.y.scale*e.y;return a+="scale(".concat(l,", ").concat(c,")"),a===Ws?"none":a}function Q(t){return[t("x"),t("y")]}var qe=["","X","Y","Z"],Xs=["translate","scale","rotate","skew"],Kt=["transformPerspective","x","y","z"];Xs.forEach(function(t){return qe.forEach(function(e){return Kt.push(t+e)})});function $s(t,e){return Kt.indexOf(t)-Kt.indexOf(e)}var Zs=new Set(Kt);function qt(t){return Zs.has(t)}var qs=new Set(["originX","originY","originZ"]);function zo(t){return qs.has(t)}var Js=function(t,e){return t.depth-e.depth},Qs=function(){function t(){this.children=[],this.isDirty=!1}return t.prototype.add=function(e){yr(this.children,e),this.isDirty=!0},t.prototype.remove=function(e){xr(this.children,e),this.isDirty=!0},t.prototype.forEach=function(e){this.isDirty&&this.children.sort(Js),this.isDirty=!1,this.children.forEach(e)},t}();function ue(t){var e=$(t)?t.get():t;return ws(e)?e.toValue():e}var Cn=1e3,Nt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function ko(t){var e=t.attachResizeListener,r=t.defaultParent,n=t.measureScroll,o=t.resetTransform;return function(){function a(i,s,u){var l=this;s===void 0&&(s={}),u===void 0&&(u=r==null?void 0:r()),this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=function(){l.isUpdating&&(l.isUpdating=!1,l.clearAllSnapshots())},this.updateProjection=function(){l.nodes.forEach(iu),l.nodes.forEach(au)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=i,this.latestValues=s,this.root=u?u.root||u:this,this.path=u?Y(Y([],L(u.path),!1),[u],!1):[],this.parent=u,this.depth=u?u.depth+1:0,i&&this.root.registerPotentialNode(i,this);for(var c=0;c=0;n--)if(Boolean(t.path[n].instance)){r=t.path[n];break}var o=r&&r!==t.root?r.instance:document,a=o.querySelector('[data-projection-id="'.concat(e,'"]'));a&&t.mount(a,!0)}function Mn(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function Rn(t){Mn(t.x),Mn(t.y)}var vu=1;function pu(){return _(function(){if(Nt.hasEverUpdated)return vu++})}var Wt=m.exports.createContext({}),Go=m.exports.createContext({});function hu(t,e,r,n){var o,a=e.layoutId,i=e.layout,s=e.drag,u=e.dragConstraints,l=e.layoutScroll,c=m.exports.useContext(Go);!n||!r||(r==null?void 0:r.projection)||(r.projection=new n(t,r.getLatestValues(),(o=r.parent)===null||o===void 0?void 0:o.projection),r.projection.setOptions({layoutId:a,layout:i,alwaysMeasureLayout:Boolean(s)||u&&Pt(u),visualElement:r,scheduleRender:function(){return r.scheduleRender()},animationType:typeof i=="string"?i:"both",initialPromotionConfig:c,layoutScroll:l}))}var mu=function(t){eo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getSnapshotBeforeUpdate=function(){return this.updateProps(),null},e.prototype.componentDidUpdate=function(){},e.prototype.updateProps=function(){var r=this.props,n=r.visualElement,o=r.props;n&&n.setProps(o)},e.prototype.render=function(){return this.props.children},e}(to.Component);function Yo(t){var e=t.preloadedFeatures,r=t.createVisualElement,n=t.projectionNodeConstructor,o=t.useRender,a=t.useVisualState,i=t.Component;e&&_e(e);function s(u,l){var c=gu(u);u=g(g({},u),{layoutId:c});var d=m.exports.useContext(ct),v=null,f=ia(u),p=d.isStatic?void 0:pu(),h=a(u,d.isStatic);return!d.isStatic&&Mt&&(f.visualElement=ta(i,h,g(g({},d),u),r),hu(p,u,f.visualElement,n||Ht.projectionNodeConstructor),v=Zi(u,f.visualElement,e)),m.exports.createElement(mu,{visualElement:f.visualElement,props:g(g({},d),u)},v,m.exports.createElement(be.Provider,{value:f},o(i,u,p,ea(h,f.visualElement,l),h,d.isStatic,f.visualElement)))}return m.exports.forwardRef(s)}function gu(t){var e,r=t.layoutId,n=(e=m.exports.useContext(Wt))===null||e===void 0?void 0:e.id;return n&&r!==void 0?n+"-"+r:r}function Ko(t){function e(n,o){return o===void 0&&(o={}),Yo(t(n,o))}if(typeof Proxy=="undefined")return e;var r=new Map;return new Proxy(e,{get:function(n,o){return r.has(o)||r.set(o,e(o)),r.get(o)}})}var yu=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function Vr(t){return typeof t!="string"||t.includes("-")?!1:!!(yu.indexOf(t)>-1||/[A-Z]/.test(t))}function Wo(t,e){var r=e.layout,n=e.layoutId;return qt(t)||zo(t)||(r||n!==void 0)&&(!!ge[t]||t==="opacity")}var xu={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function bu(t,e,r,n){var o=t.transform,a=t.transformKeys,i=e.enableHardwareAcceleration,s=i===void 0?!0:i,u=e.allowTransformNone,l=u===void 0?!0:u,c="";a.sort($s);for(var d=!1,v=a.length,f=0;fS&&B,et=Array.isArray(I)?I:[I],it=et.reduce(a,{});K===!1&&(it={});var Rt=A.prevResolvedValues,xt=Rt===void 0?{}:Rt,Jt=g(g({},xt),it),bt=function(C){X=!0,y.delete(C),A.needsAnimating[C]=!0};for(var G in Jt){var O=it[G],T=xt[G];x.hasOwnProperty(G)||(O!==T?Yt(O)&&Yt(T)?!hi(O,T)||W?bt(G):A.protectedKeys[G]=!0:O!==void 0?bt(G):y.add(G):O!==void 0&&y.has(G)?bt(G):A.protectedKeys[G]=!0)}A.prevProp=I,A.prevResolvedValues=it,A.isActive&&(x=g(g({},x),it)),o&&t.blockInitialAnimation&&(X=!1),X&&!N&&h.push.apply(h,Y([],L(et.map(function(C){return{animation:C,options:g({type:E},c)}})),!1))},P=0;P=3;if(!(!f&&!p)){var h=v.point,y=fe().timestamp;o.history.push(g(g({},h),{timestamp:y}));var x=o.handlers,S=x.onStart,b=x.onMove;f||(S&&S(o.lastMoveEvent,v),o.startEvent=o.lastMoveEvent),b&&b(o.lastMoveEvent,v)}}},this.handlePointerMove=function(v,f){if(o.lastMoveEvent=v,o.lastMoveEventInfo=Ie(f,o.transformPagePoint),oi(v)&&v.buttons===0){o.handlePointerUp(v,f);return}k.update(o.updatePoint,!0)},this.handlePointerUp=function(v,f){o.end();var p=o.handlers,h=p.onEnd,y=p.onSessionEnd,x=Fe(Ie(f,o.transformPagePoint),o.history);o.startEvent&&h&&h(v,x),y&&y(v,x)},!(ii(e)&&e.touches.length>1)){this.handlers=r,this.transformPagePoint=i;var s=Or(e),u=Ie(s,this.transformPagePoint),l=u.point,c=fe().timestamp;this.history=[g(g({},l),{timestamp:c})];var d=r.onSessionStart;d&&d(e,Fe(u,this.history)),this.removeListeners=Ve(wt(window,"pointermove",this.handlePointerMove),wt(window,"pointerup",this.handlePointerUp),wt(window,"pointercancel",this.handlePointerUp))}}return t.prototype.updateHandlers=function(e){this.handlers=e},t.prototype.end=function(){this.removeListeners&&this.removeListeners(),mt.update(this.updatePoint)},t}();function Ie(t,e){return e?{point:e(t.point)}:t}function Bn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Fe(t,e){var r=t.point;return{point:r,delta:Bn(r,Ti(e)),offset:Bn(r,El(e)),velocity:Al(e,.1)}}function El(t){return t[0]}function Ti(t){return t[t.length-1]}function Al(t,e){if(t.length<2)return{x:0,y:0};for(var r=t.length-1,n=null,o=Ti(t);r>=0&&(n=t[r],!(o.timestamp-n.timestamp>he(e)));)r--;if(!n)return{x:0,y:0};var a=(o.timestamp-n.timestamp)/1e3;if(a===0)return{x:0,y:0};var i={x:(o.x-n.x)/a,y:(o.y-n.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function Ml(t,e,r){var n=e.min,o=e.max;return n!==void 0&&to&&(t=r?F(o,t,r.max):Math.min(t,o)),t}function Un(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function Rl(t,e){var r=e.top,n=e.left,o=e.bottom,a=e.right;return{x:Un(t.x,n,a),y:Un(t.y,r,o)}}function _n(t,e){var r,n=e.min-t.min,o=e.max-t.max;return e.max-e.minn?r=kt(e.min,e.max-n,t.min):n>o&&(r=kt(t.min,t.max-o,e.min)),de(0,1,r)}function Dl(t,e){var r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}var rr=.35;function Il(t){return t===void 0&&(t=rr),t===!1?t=0:t===!0&&(t=rr),{x:Nn(t,"left","right"),y:Nn(t,"top","bottom")}}function Nn(t,e,r){return{min:Hn(t,e),max:Hn(t,r)}}function Hn(t,e){var r;return typeof t=="number"?t:(r=t[e])!==null&&r!==void 0?r:0}function Vi(t){var e=t.top,r=t.left,n=t.right,o=t.bottom;return{x:{min:r,max:n},y:{min:e,max:o}}}function Fl(t){var e=t.x,r=t.y;return{top:r.min,right:e.max,bottom:r.max,left:e.min}}function jl(t,e){if(!e)return t;var r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function Ci(t,e){return Vi(jl(t.getBoundingClientRect(),e))}function Bl(t,e,r){var n=Ci(t,r),o=e.scroll;return o&&(Tt(n.x,o.x),Tt(n.y,o.y)),n}var Ul=new WeakMap,_l=function(){function t(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=U(),this.visualElement=e}return t.prototype.start=function(e,r){var n=this,o=r===void 0?{}:r,a=o.snapToCursor,i=a===void 0?!1:a;if(this.visualElement.isPresent!==!1){var s=function(d){n.stopAnimation(),i&&n.snapToCursor(Or(d,"page").point)},u=function(d,v){var f,p=n.getProps(),h=p.drag,y=p.dragPropagation,x=p.onDragStart;h&&!y&&(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=li(h),!n.openGlobalLock)||(n.isDragging=!0,n.currentDirection=null,n.resolveConstraints(),n.visualElement.projection&&(n.visualElement.projection.isAnimationBlocked=!0,n.visualElement.projection.target=void 0),Q(function(S){var b,P,V=n.getAxisMotionValue(S).get()||0;if(tt.test(V)){var M=(P=(b=n.visualElement.projection)===null||b===void 0?void 0:b.layout)===null||P===void 0?void 0:P.actual[S];if(M){var R=ot(M);V=R*(parseFloat(V)/100)}}n.originPoint[S]=V}),x==null||x(d,v),(f=n.visualElement.animationState)===null||f===void 0||f.setActive(D.Drag,!0))},l=function(d,v){var f=n.getProps(),p=f.dragPropagation,h=f.dragDirectionLock,y=f.onDirectionLock,x=f.onDrag;if(!(!p&&!n.openGlobalLock)){var S=v.offset;if(h&&n.currentDirection===null){n.currentDirection=Nl(S),n.currentDirection!==null&&(y==null||y(n.currentDirection));return}n.updateAxis("x",v.point,S),n.updateAxis("y",v.point,S),n.visualElement.syncRender(),x==null||x(d,v)}},c=function(d,v){return n.stop(d,v)};this.panSession=new Pi(e,{onSessionStart:s,onStart:u,onMove:l,onSessionEnd:c},{transformPagePoint:this.visualElement.getTransformPagePoint()})}},t.prototype.stop=function(e,r){var n=this.isDragging;if(this.cancel(),!!n){var o=r.velocity;this.startAnimation(o);var a=this.getProps().onDragEnd;a==null||a(e,r)}},t.prototype.cancel=function(){var e,r;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(e=this.panSession)===null||e===void 0||e.end(),this.panSession=void 0;var n=this.getProps().dragPropagation;!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(r=this.visualElement.animationState)===null||r===void 0||r.setActive(D.Drag,!1)},t.prototype.updateAxis=function(e,r,n){var o=this.getProps().drag;if(!(!n||!oe(e,o,this.currentDirection))){var a=this.getAxisMotionValue(e),i=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(i=Ml(i,this.constraints[e],this.elastic[e])),a.set(i)}},t.prototype.resolveConstraints=function(){var e=this,r=this.getProps(),n=r.dragConstraints,o=r.dragElastic,a=(this.visualElement.projection||{}).layout,i=this.constraints;n&&Pt(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&a?this.constraints=Rl(a.actual,n):this.constraints=!1,this.elastic=Il(o),i!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&Q(function(s){e.getAxisMotionValue(s)&&(e.constraints[s]=Dl(a.actual[s],e.constraints[s]))})},t.prototype.resolveRefConstraints=function(){var e=this.getProps(),r=e.dragConstraints,n=e.onMeasureDragConstraints;if(!r||!Pt(r))return!1;var o=r.current,a=this.visualElement.projection;if(!a||!a.layout)return!1;var i=Bl(o,a.root,this.visualElement.getTransformPagePoint()),s=Ll(a.layout.actual,i);if(n){var u=n(Fl(s));this.hasMutatedConstraints=!!u,u&&(s=Vi(u))}return s},t.prototype.startAnimation=function(e){var r=this,n=this.getProps(),o=n.drag,a=n.dragMomentum,i=n.dragElastic,s=n.dragTransition,u=n.dragSnapToOrigin,l=n.onDragTransitionEnd,c=this.constraints||{},d=Q(function(v){var f;if(!!oe(v,o,r.currentDirection)){var p=(f=c==null?void 0:c[v])!==null&&f!==void 0?f:{};u&&(p={min:0,max:0});var h=i?200:1e6,y=i?40:1e7,x=g(g({type:"inertia",velocity:a?e[v]:0,bounceStiffness:h,bounceDamping:y,timeConstant:750,restDelta:1,restSpeed:10},s),p);return r.startAxisValueAnimation(v,x)}});return Promise.all(d).then(l)},t.prototype.startAxisValueAnimation=function(e,r){var n=this.getAxisMotionValue(e);return Tr(e,n,0,r)},t.prototype.stopAnimation=function(){var e=this;Q(function(r){return e.getAxisMotionValue(r).stop()})},t.prototype.getAxisMotionValue=function(e){var r,n,o="_drag"+e.toUpperCase(),a=this.visualElement.getProps()[o];return a||this.visualElement.getValue(e,(n=(r=this.visualElement.getProps().initial)===null||r===void 0?void 0:r[e])!==null&&n!==void 0?n:0)},t.prototype.snapToCursor=function(e){var r=this;Q(function(n){var o=r.getProps().drag;if(!!oe(n,o,r.currentDirection)){var a=r.visualElement.projection,i=r.getAxisMotionValue(n);if(a&&a.layout){var s=a.layout.actual[n],u=s.min,l=s.max;i.set(e[n]-F(u,l,.5))}}})},t.prototype.scalePositionWithinConstraints=function(){var e=this,r,n=this.getProps(),o=n.drag,a=n.dragConstraints,i=this.visualElement.projection;if(!(!Pt(a)||!i||!this.constraints)){this.stopAnimation();var s={x:0,y:0};Q(function(l){var c=e.getAxisMotionValue(l);if(c){var d=c.get();s[l]=Ol({min:d,max:d},e.constraints[l])}});var u=this.visualElement.getProps().transformTemplate;this.visualElement.getInstance().style.transform=u?u({},""):"none",(r=i.root)===null||r===void 0||r.updateScroll(),i.updateLayout(),this.resolveConstraints(),Q(function(l){if(!!oe(l,o,null)){var c=e.getAxisMotionValue(l),d=e.constraints[l],v=d.min,f=d.max;c.set(F(v,f,s[l]))}})}},t.prototype.addListeners=function(){var e=this,r;Ul.set(this.visualElement,this);var n=this.visualElement.getInstance(),o=wt(n,"pointerdown",function(l){var c=e.getProps(),d=c.drag,v=c.dragListener,f=v===void 0?!0:v;d&&f&&e.start(l)}),a=function(){var l=e.getProps().dragConstraints;Pt(l)&&(e.constraints=e.resolveRefConstraints())},i=this.visualElement.projection,s=i.addEventListener("measure",a);i&&!i.layout&&((r=i.root)===null||r===void 0||r.updateScroll(),i.updateLayout()),a();var u=ft(window,"resize",function(){return e.scalePositionWithinConstraints()});return i.addEventListener("didUpdate",function(l){var c=l.delta,d=l.hasLayoutChanged;e.isDragging&&d&&(Q(function(v){var f=e.getAxisMotionValue(v);!f||(e.originPoint[v]+=c[v].translate,f.set(f.get()+c[v].translate))}),e.visualElement.syncRender())}),function(){u(),o(),s()}},t.prototype.getProps=function(){var e=this.visualElement.getProps(),r=e.drag,n=r===void 0?!1:r,o=e.dragDirectionLock,a=o===void 0?!1:o,i=e.dragPropagation,s=i===void 0?!1:i,u=e.dragConstraints,l=u===void 0?!1:u,c=e.dragElastic,d=c===void 0?rr:c,v=e.dragMomentum,f=v===void 0?!0:v;return g(g({},e),{drag:n,dragDirectionLock:a,dragPropagation:s,dragConstraints:l,dragElastic:d,dragMomentum:f})},t}();function oe(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function Nl(t,e){e===void 0&&(e=10);var r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}function Hl(t){var e=t.dragControls,r=t.visualElement,n=_(function(){return new _l(r)});m.exports.useEffect(function(){return e&&e.subscribe(n)},[n,e]),m.exports.useEffect(function(){return n.addListeners()},[n])}function zl(t){var e=t.onPan,r=t.onPanStart,n=t.onPanEnd,o=t.onPanSessionStart,a=t.visualElement,i=e||r||n||o,s=m.exports.useRef(null),u=m.exports.useContext(ct).transformPagePoint,l={onSessionStart:o,onStart:r,onMove:e,onEnd:function(d,v){s.current=null,n&&n(d,v)}};m.exports.useEffect(function(){s.current!==null&&s.current.updateHandlers(l)});function c(d){s.current=new Pi(d,l,{transformPagePoint:u})}xe(a,"pointerdown",i&&c),Dr(function(){return s.current&&s.current.end()})}var wi={pan:lt(zl),drag:lt(Hl)},ie=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];function kl(){var t=ie.map(function(){return new jt}),e={},r={clearAllListeners:function(){return t.forEach(function(n){return n.clear()})},updatePropListeners:function(n){ie.forEach(function(o){var a,i="on"+o,s=n[i];(a=e[o])===null||a===void 0||a.call(e),s&&(e[o]=r[i](s))})}};return t.forEach(function(n,o){r["on"+ie[o]]=function(a){return n.add(a)},r["notify"+ie[o]]=function(){for(var a=[],i=0;i=0?window.pageYOffset:null,l=Ql(e,t,s);return a.length&&a.forEach(function(c){var d=L(c,2),v=d[0],f=d[1];t.getValue(v).set(f)}),t.syncRender(),u!==null&&window.scrollTo({top:u}),{target:l,transitionEnd:n}}else return{target:e,transitionEnd:n}};function ec(t,e,r,n){return $l(e)?tc(t,e,r,n):{target:e,transitionEnd:n}}var rc=function(t,e,r,n){var o=Wl(t,e,n);return e=o.target,n=o.transitionEnd,ec(t,e,r,n)};function nc(t){return window.getComputedStyle(t)}var Li={treeType:"dom",readValueFromInstance:function(t,e){if(qt(e)){var r=br(e);return r&&r.default||0}else{var n=nc(t);return(Xo(e)?n.getPropertyValue(e):n[e])||0}},sortNodePosition:function(t,e){return t.compareDocumentPosition(e)&2?1:-1},getBaseTarget:function(t,e){var r;return(r=t.style)===null||r===void 0?void 0:r[e]},measureViewportBox:function(t,e){var r=e.transformPagePoint;return Ci(t,r)},resetTransform:function(t,e,r){var n=r.transformTemplate;e.style.transform=n?n({},""):"none",t.scheduleRender()},restoreTransform:function(t,e){t.style.transform=e.style.transform},removeValueFromRenderState:function(t,e){var r=e.vars,n=e.style;delete r[t],delete n[t]},makeTargetAnimatable:function(t,e,r,n){var o=r.transformValues;n===void 0&&(n=!0);var a=e.transition,i=e.transitionEnd,s=j(e,["transition","transitionEnd"]),u=xi(s,a||{},t);if(o&&(i&&(i=o(i)),s&&(s=o(s)),u&&(u=o(u))),n){yi(t,s,u);var l=rc(t,s,u,i);i=l.transitionEnd,s=l.target}return g({transition:a,transitionEnd:i},s)},scrapeMotionValuesFromProps:Ar,build:function(t,e,r,n,o){t.isVisible!==void 0&&(e.style.visibility=t.isVisible?"visible":"hidden"),Cr(e,r,n,o.transformTemplate)},render:ti},oc=Br(Li),ic=Br(g(g({},Li),{getBaseTarget:function(t,e){return t[e]},readValueFromInstance:function(t,e){var r;return qt(e)?((r=br(e))===null||r===void 0?void 0:r.default)||0:(e=ei.has(e)?e:Qo(e),t.getAttribute(e))},scrapeMotionValuesFromProps:ni,build:function(t,e,r,n,o){Er(e,r,n,o.transformTemplate)},render:ri})),Ur=function(t,e){return Vr(t)?ic(e,{enableHardwareAcceleration:!1}):oc(e,{enableHardwareAcceleration:!0})};function Wn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}var Dt={correct:function(t,e){if(!e.target)return t;if(typeof t=="string")if(w.test(t))t=parseFloat(t);else return t;var r=Wn(t,e.target.x),n=Wn(t,e.target.y);return"".concat(r,"% ").concat(n,"%")}},Xn="_$css",ac={correct:function(t,e){var r=e.treeScale,n=e.projectionDelta,o=t,a=t.includes("var("),i=[];a&&(t=t.replace(Ai,function(h){return i.push(h),Xn}));var s=nt.parse(t);if(s.length>5)return o;var u=nt.createTransformer(t),l=typeof s[0]!="number"?1:0,c=n.x.scale*r.x,d=n.y.scale*r.y;s[0+l]/=c,s[1+l]/=d;var v=F(c,d,.5);typeof s[2+l]=="number"&&(s[2+l]/=v),typeof s[3+l]=="number"&&(s[3+l]/=v);var f=u(s);if(a){var p=0;f=f.replace(Xn,function(){var h=i[p];return p++,h})}return f}},sc=function(t){eo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.componentDidMount=function(){var r=this,n=this.props,o=n.visualElement,a=n.layoutGroup,i=n.switchLayoutGroup,s=n.layoutId,u=o.projection;Ks(lc),u&&(a!=null&&a.group&&a.group.add(u),(i==null?void 0:i.register)&&s&&i.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",function(){r.safeToRemove()}),u.setOptions(g(g({},u.options),{onExitComplete:function(){return r.safeToRemove()}}))),Nt.hasEverUpdated=!0},e.prototype.getSnapshotBeforeUpdate=function(r){var n=this,o=this.props,a=o.layoutDependency,i=o.visualElement,s=o.drag,u=o.isPresent,l=i.projection;return l&&(l.isPresent=u,s||r.layoutDependency!==a||a===void 0?l.willUpdate():this.safeToRemove(),r.isPresent!==u&&(u?l.promote():l.relegate()||k.postRender(function(){var c;!((c=l.getStack())===null||c===void 0)&&c.members.length||n.safeToRemove()}))),null},e.prototype.componentDidUpdate=function(){var r=this.props.visualElement.projection;r&&(r.root.didUpdate(),!r.currentAnimation&&r.isLead()&&this.safeToRemove())},e.prototype.componentWillUnmount=function(){var r=this.props,n=r.visualElement,o=r.layoutGroup,a=r.switchLayoutGroup,i=n.projection;i&&(i.scheduleCheckAfterUnmount(),o!=null&&o.group&&o.group.remove(i),a!=null&&a.deregister&&a.deregister(i))},e.prototype.safeToRemove=function(){var r=this.props.safeToRemove;r==null||r()},e.prototype.render=function(){return null},e}(to.Component);function uc(t){var e=L(pi(),2),r=e[0],n=e[1],o=m.exports.useContext(Wt);return Yi(sc,kr({},g({},t,{layoutGroup:o,switchLayoutGroup:m.exports.useContext(Go),isPresent:r,safeToRemove:n})))}var lc={borderRadius:g(g({},Dt),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:Dt,borderTopRightRadius:Dt,borderBottomLeftRadius:Dt,borderBottomRightRadius:Dt,boxShadow:ac},Oi={measureLayout:uc},cc=ko({attachResizeListener:function(t,e){return ft(t,"resize",e)},measureScroll:function(){return{x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}}}),ht={current:void 0},_r=ko({measureScroll:function(t){return{x:t.scrollLeft,y:t.scrollTop}},defaultParent:function(){if(!ht.current){var t=new cc(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),ht.current=t}return ht.current},resetTransform:function(t,e){t.style.transform=e!=null?e:"none"}}),Di=g(g(g(g({},Si),di),wi),Oi),Ii=Ko(function(t,e){return Lr(t,e,Di,Ur,_r)});function Xc(t){return Yo(Lr(t,{forwardMotionProps:!1},Di,Ur,_r))}var $c=Ko(Lr);function Fi(){var t=m.exports.useRef(!1);return Et(function(){return t.current=!0,function(){t.current=!1}},[]),t}function Nr(){var t=Fi(),e=L(m.exports.useState(0),2),r=e[0],n=e[1],o=m.exports.useCallback(function(){t.current&&n(r+1)},[r]),a=m.exports.useCallback(function(){return k.postRender(o)},[o]);return[a,r]}var je=function(t){var e=t.children,r=t.initial,n=t.isPresent,o=t.onExitComplete,a=t.custom,i=t.presenceAffectsLayout,s=_(fc),u=vi(),l=m.exports.useMemo(function(){return{id:u,initial:r,isPresent:n,custom:a,onExitComplete:function(c){var d,v;s.set(c,!0);try{for(var f=Ki(s.values()),p=f.next();!p.done;p=f.next()){var h=p.value;if(!h)return}}catch(y){d={error:y}}finally{try{p&&!p.done&&(v=f.return)&&v.call(f)}finally{if(d)throw d.error}}o==null||o()},register:function(c){return s.set(c,!1),function(){return s.delete(c)}}}},i?void 0:[n]);return m.exports.useMemo(function(){s.forEach(function(c,d){return s.set(d,!1)})},[n]),m.exports.useEffect(function(){!n&&!s.size&&(o==null||o())},[n]),m.exports.createElement(At.Provider,{value:l},e)};function fc(){return new Map}var St=function(t){return t.key||""};function dc(t,e){t.forEach(function(r){var n=St(r);e.set(n,r)})}function vc(t){var e=[];return m.exports.Children.forEach(t,function(r){m.exports.isValidElement(r)&&e.push(r)}),e}var Zc=function(t){var e=t.children,r=t.custom,n=t.initial,o=n===void 0?!0:n,a=t.onExitComplete,i=t.exitBeforeEnter,s=t.presenceAffectsLayout,u=s===void 0?!0:s,l=L(Nr(),1),c=l[0],d=m.exports.useContext(Wt).forceRender;d&&(c=d);var v=Fi(),f=vc(e),p=f,h=new Set,y=m.exports.useRef(p),x=m.exports.useRef(new Map).current,S=m.exports.useRef(!0);if(Et(function(){S.current=!1,dc(f,x),y.current=p}),Dr(function(){S.current=!0,x.clear(),h.clear()}),S.current)return m.exports.createElement(m.exports.Fragment,null,p.map(function(E){return m.exports.createElement(je,{key:St(E),isPresent:!0,initial:o?void 0:!1,presenceAffectsLayout:u},E)}));p=Y([],L(p),!1);for(var b=y.current.map(St),P=f.map(St),V=b.length,M=0;M1&&console.warn("You're attempting to animate multiple children within AnimatePresence, but its exitBeforeEnter prop is set to true. This will lead to odd visual behaviour."),m.exports.createElement(m.exports.Fragment,null,h.size?p:p.map(function(E){return m.exports.cloneElement(E)}))},pc=m.exports.createContext(null),hc=function(t){return!t.isLayoutDirty&&t.willUpdate(!1)};function $n(){var t=new Set,e=new WeakMap,r=function(){return t.forEach(hc)};return{add:function(n){t.add(n),e.set(n,n.addEventListener("willUpdate",r))},remove:function(n){var o;t.delete(n),(o=e.get(n))===null||o===void 0||o(),e.delete(n),r()},dirty:r}}var ji=function(t){return t===!0},mc=function(t){return ji(t===!0)||t==="id"},gc=function(t){var e,r,n=t.children,o=t.id,a=t.inheritId,i=t.inherit,s=i===void 0?!0:i;a!==void 0&&(s=a);var u=m.exports.useContext(Wt),l=m.exports.useContext(pc),c=L(Nr(),2),d=c[0],v=c[1],f=m.exports.useRef(null),p=(e=u.id)!==null&&e!==void 0?e:l;f.current===null&&(mc(s)&&p&&(o=o?p+"-"+o:p),f.current={id:o,group:ji(s)&&(r=u==null?void 0:u.group)!==null&&r!==void 0?r:$n()});var h=m.exports.useMemo(function(){return g(g({},f.current),{forceRender:d})},[v]);return m.exports.createElement(Wt.Provider,{value:h},n)},yc=0,qc=function(t){var e=t.children;return m.exports.useEffect(function(){},[]),m.exports.createElement(gc,{id:_(function(){return"asl-".concat(yc++)})},e)};function Jc(t){var e=t.children,r=t.isValidProp,n=j(t,["children","isValidProp"]);r&&qo(r),n=g(g({},m.exports.useContext(ct)),n),n.isStatic=_(function(){return n.isStatic});var o=m.exports.useMemo(function(){return n},[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return m.exports.createElement(ct.Provider,{value:o},e)}function Qc(t){var e=t.children,r=t.features,n=t.strict,o=n===void 0?!1:n,a=L(m.exports.useState(!Be(r)),2),i=a[1],s=m.exports.useRef(void 0);if(!Be(r)){var u=r.renderer,l=j(r,["renderer"]);s.current=u,_e(l)}return m.exports.useEffect(function(){Be(r)&&r().then(function(c){var d=c.renderer,v=j(c,["renderer"]);_e(v),s.current=d,i(!0)})},[]),m.exports.createElement(ur.Provider,{value:{renderer:s.current,strict:o}},e)}function Be(t){return typeof t=="function"}var Bi=m.exports.createContext(null);function xc(t,e,r,n){if(!n)return t;var o=t.findIndex(function(c){return c.value===e});if(o===-1)return t;var a=n>0?1:-1,i=t[o+a];if(!i)return t;var s=t[o],u=i.layout,l=F(u.min,u.max,.5);return a===1&&s.layout.max+r>l||a===-1&&s.layout.min+r.001?1/t:Gc};function hf(t){var e=gt(1),r=gt(1),n=no();t?(e=t.scaleX||e,r=t.scaleY||r):n&&(e=n.getValue("scaleX",1),r=n.getValue("scaleY",1));var o=ir(e,Qn),a=ir(r,Qn);return{scaleX:o,scaleY:a}}export{Zc as AnimatePresence,qc as AnimateSharedLayout,D as AnimationType,pc as DeprecatedLayoutGroupContext,Uc as DragControls,Qs as FlatTree,gc as LayoutGroup,Wt as LayoutGroupContext,Qc as LazyMotion,Jc as MotionConfig,ct as MotionConfigContext,be as MotionContext,bs as MotionValue,At as PresenceContext,tf as Reorder,Go as SwitchLayoutGroupContext,wt as addPointerEvent,Ks as addScaleCorrector,Ds as animate,Fr as animateVisualElement,Bc as animationControls,Si as animations,ot as calcLength,yi as checkTargetForNewValues,U as createBox,Xc as createDomMotionComponent,Yo as createMotionComponent,Lc as domAnimation,ef as domMax,Eu as filterProps,Mt as isBrowser,ci as isDragActive,$ as isMotionValue,ye as isValidMotionProp,$c as m,Rr as makeUseVisualState,Ii as motion,q as motionValue,ue as resolveMotionValue,wc as transform,lf as useAnimation,jc as useAnimationFrame,cf as useCycle,pf as useDeprecatedAnimatedState,hf as useDeprecatedInvertedScale,Je as useDomEvent,ff as useDragControls,af as useElementScroll,Nr as useForceUpdate,Nc as useInstantLayoutTransition,df as useInstantTransition,Wc as useIsPresent,Et as useIsomorphicLayoutEffect,rf as useMotionTemplate,gt as useMotionValue,pi as usePresence,Ji as useReducedMotion,Qi as useReducedMotionConfig,vf as useResetProjection,nf as useSpring,uf as useTime,ir as useTransform,Dr as useUnmountEffect,of as useVelocity,sf as useViewportScroll,no as useVisualElementContext,Br as visualElement,ai as wrapHandler}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.ad2cee1a.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.ad2cee1a.js new file mode 100644 index 000000000..a49dda0e1 --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.ad2cee1a.js @@ -0,0 +1,9 @@ +import{r as p,R as go,b as oi,j as k,F as ts}from"./index.2addc377.js";const q=p.exports.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),we=p.exports.createContext({});function yo(){return p.exports.useContext(we).visualElement}const At=p.exports.createContext(null),vt=typeof document<"u",pt=vt?p.exports.useLayoutEffect:p.exports.useEffect,pn=p.exports.createContext({strict:!1});function ri(t,e,n,s){const o=yo(),i=p.exports.useContext(pn),r=p.exports.useContext(At),a=p.exports.useContext(q).reducedMotion,c=p.exports.useRef(void 0);s=s||i.renderer,!c.current&&s&&(c.current=s(t,{visualState:e,parent:o,props:n,presenceId:r?r.id:void 0,blockInitialAnimation:r?r.initial===!1:!1,reducedMotionConfig:a}));const l=c.current;return pt(()=>{l&&l.syncRender()}),p.exports.useEffect(()=>{l&&l.animationState&&l.animationState.animateChanges()}),pt(()=>()=>l&&l.notifyUnmount(),[]),l}function wt(t){return typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function ii(t,e,n){return p.exports.useCallback(s=>{s&&t.mount&&t.mount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):wt(n)&&(n.current=s))},[e])}function Nt(t){return typeof t=="string"||Array.isArray(t)}function Te(t){return typeof t=="object"&&typeof t.start=="function"}const ai=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function Pe(t){return Te(t.animate)||ai.some(e=>Nt(t[e]))}function vo(t){return Boolean(Pe(t)||t.variants)}function ci(t,e){if(Pe(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Nt(n)?n:void 0,animate:Nt(s)?s:void 0}}return t.inherit!==!1?e:{}}function li(t){const{initial:e,animate:n}=ci(t,p.exports.useContext(we));return p.exports.useMemo(()=>({initial:e,animate:n}),[es(e),es(n)])}function es(t){return Array.isArray(t)?t.join(" "):t}const X=t=>({isEnabled:e=>t.some(n=>!!e[n])}),zt={measureLayout:X(["layout","layoutId","drag"]),animation:X(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:X(["exit"]),drag:X(["drag","dragControls"]),focus:X(["whileFocus"]),hover:X(["whileHover","onHoverStart","onHoverEnd"]),tap:X(["whileTap","onTap","onTapStart","onTapCancel"]),pan:X(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:X(["whileInView","onViewportEnter","onViewportLeave"])};function Ge(t){for(const e in t)e==="projectionNodeConstructor"?zt.projectionNodeConstructor=t[e]:zt[e].Component=t[e]}function j(t){const e=p.exports.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ot={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let ui=1;function fi(){return j(()=>{if(Ot.hasEverUpdated)return ui++})}const $t=p.exports.createContext({});class di extends go.Component{getSnapshotBeforeUpdate(){const{visualElement:e,props:n}=this.props;return e&&e.setProps(n),null}componentDidUpdate(){}render(){return this.props.children}}const xo=p.exports.createContext({}),mn=Symbol.for("motionComponentSymbol");function bo({preloadedFeatures:t,createVisualElement:e,projectionNodeConstructor:n,useRender:s,useVisualState:o,Component:i}){t&&Ge(t);function r(c,l){const u={...p.exports.useContext(q),...c,layoutId:hi(c)},{isStatic:f}=u;let d=null;const h=li(c),m=f?void 0:fi(),v=o(c,f);if(!f&&vt){h.visualElement=ri(i,v,u,e);const S=p.exports.useContext(pn).strict,V=p.exports.useContext(xo);h.visualElement&&(d=h.visualElement.loadFeatures(c,S,t,m,n||zt.projectionNodeConstructor,V))}return oi(di,{visualElement:h.visualElement,props:u,children:[d,k(we.Provider,{value:h,children:s(i,c,m,ii(v,h.visualElement,l),v,f,h.visualElement)})]})}const a=p.exports.forwardRef(r);return a[mn]=i,a}function hi({layoutId:t}){const e=p.exports.useContext($t).id;return e&&t!==void 0?e+"-"+t:t}function So(t){function e(s,o={}){return bo(t(s,o))}if(typeof Proxy>"u")return e;const n=new Map;return new Proxy(e,{get:(s,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const pi=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function gn(t){return typeof t!="string"||t.includes("-")?!1:!!(pi.indexOf(t)>-1||/[A-Z]/.test(t))}const le={};function mi(t){Object.assign(le,t)}const ue=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],mt=new Set(ue);function Vo(t,{layout:e,layoutId:n}){return mt.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!le[t]||t==="opacity")}const N=t=>t===void 0?!1:!!t.getVelocity,gi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yi=(t,e)=>ue.indexOf(t)-ue.indexOf(e);function vi({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:s=!0},o,i){let r="";e.sort(yi);for(const a of e)r+=`${gi[a]||a}(${t[a]}) `;return n&&!t.z&&(r+="translateZ(0)"),r=r.trim(),i?r=i(t,o?"":r):s&&o&&(r="none"),r}function yn(t){return t.startsWith("--")}const xi=(t,e)=>e&&typeof t=="number"?e.transform(t):t,wo=(t,e)=>n=>Math.max(Math.min(n,e),t),It=t=>t%1?Number(t.toFixed(5)):t,Ht=/(-)?([\d]*\.?[\d])+/g,Ye=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,bi=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function Xt(t){return typeof t=="string"}const xt={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},kt=Object.assign(Object.assign({},xt),{transform:wo(0,1)}),Jt=Object.assign(Object.assign({},xt),{default:1}),qt=t=>({test:e=>Xt(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),nt=qt("deg"),Y=qt("%"),T=qt("px"),Si=qt("vh"),Vi=qt("vw"),ns=Object.assign(Object.assign({},Y),{parse:t=>Y.parse(t)/100,transform:t=>Y.transform(t*100)}),vn=(t,e)=>n=>Boolean(Xt(n)&&bi.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),To=(t,e,n)=>s=>{if(!Xt(s))return s;const[o,i,r,a]=s.match(Ht);return{[t]:parseFloat(o),[e]:parseFloat(i),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},dt={test:vn("hsl","hue"),parse:To("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+Y.transform(It(e))+", "+Y.transform(It(n))+", "+It(kt.transform(s))+")"},wi=wo(0,255),Ie=Object.assign(Object.assign({},xt),{transform:t=>Math.round(wi(t))}),it={test:vn("rgb","red"),parse:To("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Ie.transform(t)+", "+Ie.transform(e)+", "+Ie.transform(n)+", "+It(kt.transform(s))+")"};function Ti(t){let e="",n="",s="",o="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),s=t.substr(5,2),o=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),s=t.substr(3,1),o=t.substr(4,1),e+=e,n+=n,s+=s,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:o?parseInt(o,16)/255:1}}const Ke={test:vn("#"),parse:Ti,transform:it.transform},_={test:t=>it.test(t)||Ke.test(t)||dt.test(t),parse:t=>it.test(t)?it.parse(t):dt.test(t)?dt.parse(t):Ke.parse(t),transform:t=>Xt(t)?t:t.hasOwnProperty("red")?it.transform(t):dt.transform(t)},Po="${c}",Co="${n}";function Pi(t){var e,n,s,o;return isNaN(t)&&Xt(t)&&((n=(e=t.match(Ht))===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0)+((o=(s=t.match(Ye))===null||s===void 0?void 0:s.length)!==null&&o!==void 0?o:0)>0}function Ao(t){typeof t=="number"&&(t=`${t}`);const e=[];let n=0;const s=t.match(Ye);s&&(n=s.length,t=t.replace(Ye,Po),e.push(...s.map(_.parse)));const o=t.match(Ht);return o&&(t=t.replace(Ht,Co),e.push(...o.map(xt.parse))),{values:e,numColors:n,tokenised:t}}function Ro(t){return Ao(t).values}function Mo(t){const{values:e,numColors:n,tokenised:s}=Ao(t),o=e.length;return i=>{let r=s;for(let a=0;atypeof t=="number"?0:t;function Ai(t){const e=Ro(t);return Mo(t)(e.map(Ci))}const Z={test:Pi,parse:Ro,createTransformer:Mo,getAnimatableNone:Ai},Ri=new Set(["brightness","contrast","saturate","opacity"]);function Mi(t){let[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(Ht)||[];if(!s)return t;const o=n.replace(s,"");let i=Ri.has(e)?1:0;return s!==n&&(i*=100),e+"("+i+o+")"}const Li=/([a-z-]*)\(.*?\)/g,Xe=Object.assign(Object.assign({},Z),{getAnimatableNone:t=>{const e=t.match(Li);return e?e.map(Mi).join(" "):t}}),ss={...xt,transform:Math.round},Lo={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,radius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,size:T,top:T,right:T,bottom:T,left:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,rotate:nt,rotateX:nt,rotateY:nt,rotateZ:nt,scale:Jt,scaleX:Jt,scaleY:Jt,scaleZ:Jt,skew:nt,skewX:nt,skewY:nt,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:kt,originX:ns,originY:ns,originZ:T,zIndex:ss,fillOpacity:kt,strokeOpacity:kt,numOctaves:ss};function xn(t,e,n,s){const{style:o,vars:i,transform:r,transformKeys:a,transformOrigin:c}=t;a.length=0;let l=!1,u=!1,f=!0;for(const d in e){const h=e[d];if(yn(d)){i[d]=h;continue}const m=Lo[d],v=xi(h,m);if(mt.has(d)){if(l=!0,r[d]=v,a.push(d),!f)continue;h!==(m.default||0)&&(f=!1)}else d.startsWith("origin")?(u=!0,c[d]=v):o[d]=v}if(l||s?o.transform=vi(t,n,f,s):!e.transform&&o.transform&&(o.transform="none"),u){const{originX:d="50%",originY:h="50%",originZ:m=0}=c;o.transformOrigin=`${d} ${h} ${m}`}}const bn=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function Eo(t,e,n){for(const s in e)!N(e[s])&&!Vo(s,n)&&(t[s]=e[s])}function Ei({transformTemplate:t},e,n){return p.exports.useMemo(()=>{const s=bn();return xn(s,e,{enableHardwareAcceleration:!n},t),Object.assign({},s.vars,s.style)},[e])}function Di(t,e,n){const s=t.style||{},o={};return Eo(o,s,t),Object.assign(o,Ei(t,e,n)),t.transformValues?t.transformValues(o):o}function Oi(t,e,n){const s={},o=Di(t,e,n);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),s.style=o,s}const Ii=["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],ki=["whileTap","onTap","onTapStart","onTapCancel"],Fi=["onPan","onPanStart","onPanSessionStart","onPanEnd"],ji=["whileInView","onViewportEnter","onViewportLeave","viewport"],_i=new Set(["initial","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll",...ji,...ki,...Ii,...Fi]);function fe(t){return _i.has(t)}let Do=t=>!fe(t);function Oo(t){!t||(Do=e=>e.startsWith("on")?!fe(e):t(e))}try{Oo(require("@emotion/is-prop-valid").default)}catch{}function Bi(t,e,n){const s={};for(const o in t)(Do(o)||n===!0&&fe(o)||!e&&!fe(o)||t.draggable&&o.startsWith("onDrag"))&&(s[o]=t[o]);return s}function os(t,e,n){return typeof t=="string"?t:T.transform(e+n*t)}function Ui(t,e,n){const s=os(e,t.x,t.width),o=os(n,t.y,t.height);return`${s} ${o}`}const Ni={offset:"stroke-dashoffset",array:"stroke-dasharray"},zi={offset:"strokeDashoffset",array:"strokeDasharray"};function $i(t,e,n=1,s=0,o=!0){t.pathLength=1;const i=o?Ni:zi;t[i.offset]=T.transform(-s);const r=T.transform(e),a=T.transform(n);t[i.array]=`${r} ${a}`}function Sn(t,{attrX:e,attrY:n,originX:s,originY:o,pathLength:i,pathSpacing:r=1,pathOffset:a=0,...c},l,u){xn(t,c,l,u),t.attrs=t.style,t.style={};const{attrs:f,style:d,dimensions:h}=t;f.transform&&(h&&(d.transform=f.transform),delete f.transform),h&&(s!==void 0||o!==void 0||d.transform)&&(d.transformOrigin=Ui(h,s!==void 0?s:.5,o!==void 0?o:.5)),e!==void 0&&(f.x=e),n!==void 0&&(f.y=n),i!==void 0&&$i(f,i,r,a,!1)}const Io=()=>({...bn(),attrs:{}});function Hi(t,e){const n=p.exports.useMemo(()=>{const s=Io();return Sn(s,e,{enableHardwareAcceleration:!1},t.transformTemplate),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};Eo(s,t.style,t),n.style={...s,...n.style}}return n}function Wi(t=!1){return(n,s,o,i,{latestValues:r},a)=>{const l=(gn(n)?Hi:Oi)(s,r,a),f={...Bi(s,typeof n=="string",t),...l,ref:i};return o&&(f["data-projection-id"]=o),p.exports.createElement(n,f)}}const de=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function ko(t,{style:e,vars:n},s,o){Object.assign(t.style,e,o&&o.getProjectionStyles(s));for(const i in n)t.style.setProperty(i,n[i])}const Fo=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function jo(t,e,n,s){ko(t,e,void 0,s);for(const o in e.attrs)t.setAttribute(Fo.has(o)?o:de(o),e.attrs[o])}function Vn(t){const{style:e}=t,n={};for(const s in e)(N(e[s])||Vo(s,t))&&(n[s]=e[s]);return n}function _o(t){const e=Vn(t);for(const n in t)if(N(t[n])){const s=n==="x"||n==="y"?"attr"+n.toUpperCase():n;e[s]=t[n]}return e}function Bo(t,e,n,s={},o={}){return typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,o)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,o)),e}const Wt=t=>Array.isArray(t),Gi=t=>Boolean(t&&typeof t=="object"&&t.mix&&t.toValue),Uo=t=>Wt(t)?t[t.length-1]||0:t;function oe(t){const e=N(t)?t.get():t;return Gi(e)?e.toValue():e}function Yi({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},s,o,i){const r={latestValues:Ki(s,o,i,t),renderState:e()};return n&&(r.mount=a=>n(s,a,r)),r}const wn=t=>(e,n)=>{const s=p.exports.useContext(we),o=p.exports.useContext(At),i=()=>Yi(t,e,s,o);return n?i():j(i)};function Ki(t,e,n,s){const o={},i=s(t);for(const d in i)o[d]=oe(i[d]);let{initial:r,animate:a}=t;const c=Pe(t),l=vo(t);e&&l&&!c&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||r===!1;const f=u?a:r;return f&&typeof f!="boolean"&&!Te(f)&&(Array.isArray(f)?f:[f]).forEach(h=>{const m=Bo(t,h);if(!m)return;const{transitionEnd:v,transition:S,...V}=m;for(const x in V){let g=V[x];if(Array.isArray(g)){const y=u?g.length-1:0;g=g[y]}g!==null&&(o[x]=g)}for(const x in v)o[x]=v[x]}),o}const Xi={useVisualState:wn({scrapeMotionValuesFromProps:_o,createRenderState:Io,onMount:(t,e,{renderState:n,latestValues:s})=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}Sn(n,s,{enableHardwareAcceleration:!1},t.transformTemplate),jo(e,n)}})},qi={useVisualState:wn({scrapeMotionValuesFromProps:Vn,createRenderState:bn})};function Tn(t,{forwardMotionProps:e=!1},n,s,o){return{...gn(t)?Xi:qi,preloadedFeatures:n,useRender:Wi(e),createVisualElement:s,projectionNodeConstructor:o,Component:t}}var R;(function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"})(R||(R={}));function Ce(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function qe(t,e,n,s){p.exports.useEffect(()=>{const o=t.current;if(n&&o)return Ce(o,e,n,s)},[t,e,n,s])}function Zi({whileFocus:t,visualElement:e}){const{animationState:n}=e,s=()=>{n&&n.setActive(R.Focus,!0)},o=()=>{n&&n.setActive(R.Focus,!1)};qe(e,"focus",t?s:void 0),qe(e,"blur",t?o:void 0)}function No(t){return typeof PointerEvent<"u"&&t instanceof PointerEvent?t.pointerType==="mouse":t instanceof MouseEvent}function zo(t){return!!t.touches}function Ji(t){return e=>{const n=e instanceof MouseEvent;(!n||n&&e.button===0)&&t(e)}}const Qi={pageX:0,pageY:0};function ta(t,e="page"){const s=t.touches[0]||t.changedTouches[0]||Qi;return{x:s[e+"X"],y:s[e+"Y"]}}function ea(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function Pn(t,e="page"){return{point:zo(t)?ta(t,e):ea(t,e)}}const $o=(t,e=!1)=>{const n=s=>t(s,Pn(s));return e?Ji(n):n},na=()=>vt&&window.onpointerdown===null,sa=()=>vt&&window.ontouchstart===null,oa=()=>vt&&window.onmousedown===null,ra={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},ia={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Ho(t){return na()?t:sa()?ia[t]:oa()?ra[t]:t}function Pt(t,e,n,s){return Ce(t,Ho(e),$o(n,e==="pointerdown"),s)}function he(t,e,n,s){return qe(t,Ho(e),n&&$o(n,e==="pointerdown"),s)}function Wo(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const rs=Wo("dragHorizontal"),is=Wo("dragVertical");function Go(t){let e=!1;if(t==="y")e=is();else if(t==="x")e=rs();else{const n=rs(),s=is();n&&s?e=()=>{n(),s()}:(n&&n(),s&&s())}return e}function Yo(){const t=Go(!0);return t?(t(),!1):!0}function as(t,e,n){return(s,o)=>{!No(s)||Yo()||(t.animationState&&t.animationState.setActive(R.Hover,e),n&&n(s,o))}}function aa({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:s}){he(s,"pointerenter",t||n?as(s,!0,t):void 0,{passive:!t}),he(s,"pointerleave",e||n?as(s,!1,e):void 0,{passive:!e})}const Ko=(t,e)=>e?t===e?!0:Ko(t,e.parentElement):!1;function Cn(t){return p.exports.useEffect(()=>()=>t(),[])}function An(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,s=Object.getOwnPropertySymbols(t);oMath.min(Math.max(n,t),e),ke=.001,la=.01,cs=10,ua=.05,fa=1;function da({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let o,i;ca(t<=cs*1e3);let r=1-e;r=me(ua,fa,r),t=me(la,cs,t/1e3),r<1?(o=l=>{const u=l*r,f=u*t,d=u-n,h=Ze(l,r),m=Math.exp(-f);return ke-d/h*m},i=l=>{const f=l*r*t,d=f*n+n,h=Math.pow(r,2)*Math.pow(l,2)*t,m=Math.exp(-f),v=Ze(Math.pow(l,2),r);return(-o(l)+ke>0?-1:1)*((d-h)*m)/v}):(o=l=>{const u=Math.exp(-l*t),f=(l-n)*t+1;return-ke+u*f},i=l=>{const u=Math.exp(-l*t),f=(n-l)*(t*t);return u*f});const a=5/t,c=pa(o,i,a);if(t=t*1e3,isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:r*2*Math.sqrt(s*l),duration:t}}}const ha=12;function pa(t,e,n){let s=n;for(let o=1;ot[n]!==void 0)}function ya(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!ls(t,ga)&&ls(t,ma)){const n=da(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}function Rn(t){var{from:e=0,to:n=1,restSpeed:s=2,restDelta:o}=t,i=An(t,["from","to","restSpeed","restDelta"]);const r={done:!1,value:e};let{stiffness:a,damping:c,mass:l,velocity:u,duration:f,isResolvedFromDuration:d}=ya(i),h=us,m=us;function v(){const S=u?-(u/1e3):0,V=n-e,x=c/(2*Math.sqrt(a*l)),g=Math.sqrt(a/l)/1e3;if(o===void 0&&(o=Math.min(Math.abs(n-e)/100,.4)),x<1){const y=Ze(g,x);h=w=>{const A=Math.exp(-x*g*w);return n-A*((S+x*g*V)/y*Math.sin(y*w)+V*Math.cos(y*w))},m=w=>{const A=Math.exp(-x*g*w);return x*g*A*(Math.sin(y*w)*(S+x*g*V)/y+V*Math.cos(y*w))-A*(Math.cos(y*w)*(S+x*g*V)-y*V*Math.sin(y*w))}}else if(x===1)h=y=>n-Math.exp(-g*y)*(V+(S+g*V)*y);else{const y=g*Math.sqrt(x*x-1);h=w=>{const A=Math.exp(-x*g*w),L=Math.min(y*w,300);return n-A*((S+x*g*V)*Math.sinh(L)+y*V*Math.cosh(L))/y}}}return v(),{next:S=>{const V=h(S);if(d)r.done=S>=f;else{const x=m(S)*1e3,g=Math.abs(x)<=s,y=Math.abs(n-V)<=o;r.done=g&&y}return r.value=r.done?n:V,r},flipTarget:()=>{u=-u,[e,n]=[n,e],v()}}}Rn.needsInterpolation=(t,e)=>typeof t=="string"||typeof e=="string";const us=t=>0,Gt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},M=(t,e,n)=>-n*t+n*e+t;function Fe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function fs({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let o=0,i=0,r=0;if(!e)o=i=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;o=Fe(c,a,t+1/3),i=Fe(c,a,t),r=Fe(c,a,t-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(r*255),alpha:s}}const va=(t,e,n)=>{const s=t*t,o=e*e;return Math.sqrt(Math.max(0,n*(o-s)+s))},xa=[Ke,it,dt],ds=t=>xa.find(e=>e.test(t)),Xo=(t,e)=>{let n=ds(t),s=ds(e),o=n.parse(t),i=s.parse(e);n===dt&&(o=fs(o),n=it),s===dt&&(i=fs(i),s=it);const r=Object.assign({},o);return a=>{for(const c in r)c!=="alpha"&&(r[c]=va(o[c],i[c],a));return r.alpha=M(o.alpha,i.alpha,a),n.transform(r)}},Je=t=>typeof t=="number",ba=(t,e)=>n=>e(t(n)),Ae=(...t)=>t.reduce(ba);function qo(t,e){return Je(t)?n=>M(t,e,n):_.test(t)?Xo(t,e):Jo(t,e)}const Zo=(t,e)=>{const n=[...t],s=n.length,o=t.map((i,r)=>qo(i,e[r]));return i=>{for(let r=0;r{const n=Object.assign(Object.assign({},t),e),s={};for(const o in n)t[o]!==void 0&&e[o]!==void 0&&(s[o]=qo(t[o],e[o]));return o=>{for(const i in s)n[i]=s[i](o);return n}};function hs(t){const e=Z.parse(t),n=e.length;let s=0,o=0,i=0;for(let r=0;r{const n=Z.createTransformer(e),s=hs(t),o=hs(e);return s.numHSL===o.numHSL&&s.numRGB===o.numRGB&&s.numNumbers>=o.numNumbers?Ae(Zo(s.parsed,o.parsed),n):r=>`${r>0?e:t}`},Va=(t,e)=>n=>M(t,e,n);function wa(t){if(typeof t=="number")return Va;if(typeof t=="string")return _.test(t)?Xo:Jo;if(Array.isArray(t))return Zo;if(typeof t=="object")return Sa}function Ta(t,e,n){const s=[],o=n||wa(t[0]),i=t.length-1;for(let r=0;rn(Gt(t,e,s))}function Ca(t,e){const n=t.length,s=n-1;return o=>{let i=0,r=!1;if(o<=t[0]?r=!0:o>=t[s]&&(i=s-1,r=!0),!r){let c=1;for(;co||c===s);c++);i=c-1}const a=Gt(t[i],t[i+1],o);return e[i](a)}}function Mn(t,e,{clamp:n=!0,ease:s,mixer:o}={}){const i=t.length;pe(i===e.length),pe(!s||!Array.isArray(s)||s.length===i-1),t[0]>t[i-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const r=Ta(e,s,o),a=i===2?Pa(t,r):Ca(t,r);return n?c=>a(me(t[0],t[i-1],c)):a}const Re=t=>e=>1-t(1-e),Ln=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Aa=t=>e=>Math.pow(e,t),Qo=t=>e=>e*e*((t+1)*e-t),Ra=t=>{const e=Qo(t);return n=>(n*=2)<1?.5*e(n):.5*(2-Math.pow(2,-10*(n-1)))},tr=1.525,Ma=4/11,La=8/11,Ea=9/10,En=t=>t,Dn=Aa(2),Da=Re(Dn),er=Ln(Dn),nr=t=>1-Math.sin(Math.acos(t)),On=Re(nr),Oa=Ln(On),In=Qo(tr),Ia=Re(In),ka=Ln(In),Fa=Ra(tr),ja=4356/361,_a=35442/1805,Ba=16061/1805,ge=t=>{if(t===1||t===0)return t;const e=t*t;return tt<.5?.5*(1-ge(1-t*2)):.5*ge(t*2-1)+.5;function za(t,e){return t.map(()=>e||er).splice(0,t.length-1)}function $a(t){const e=t.length;return t.map((n,s)=>s!==0?s/(e-1):0)}function Ha(t,e){return t.map(n=>n*e)}function re({from:t=0,to:e=1,ease:n,offset:s,duration:o=300}){const i={done:!1,value:t},r=Array.isArray(e)?e:[t,e],a=Ha(s&&s.length===r.length?s:$a(r),o);function c(){return Mn(a,r,{ease:Array.isArray(n)?n:za(r,n)})}let l=c();return{next:u=>(i.value=l(u),i.done=u>=o,i),flipTarget:()=>{r.reverse(),l=c()}}}function Wa({velocity:t=0,from:e=0,power:n=.8,timeConstant:s=350,restDelta:o=.5,modifyTarget:i}){const r={done:!1,value:e};let a=n*t;const c=e+a,l=i===void 0?c:i(c);return l!==c&&(a=l-e),{next:u=>{const f=-a*Math.exp(-u/s);return r.done=!(f>o||f<-o),r.value=r.done?l:l+f,r},flipTarget:()=>{}}}const ps={keyframes:re,spring:Rn,decay:Wa};function Ga(t){if(Array.isArray(t.to))return re;if(ps[t.type])return ps[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?re:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Rn:re}const sr=1/60*1e3,Ya=typeof performance<"u"?()=>performance.now():()=>Date.now(),or=typeof window<"u"?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Ya()),sr);function Ka(t){let e=[],n=[],s=0,o=!1,i=!1;const r=new WeakSet,a={schedule:(c,l=!1,u=!1)=>{const f=u&&o,d=f?e:n;return l&&r.add(c),d.indexOf(c)===-1&&(d.push(c),f&&o&&(s=e.length)),c},cancel:c=>{const l=n.indexOf(c);l!==-1&&n.splice(l,1),r.delete(c)},process:c=>{if(o){i=!0;return}if(o=!0,[e,n]=[n,e],n.length=0,s=e.length,s)for(let l=0;l(t[e]=Ka(()=>Yt=!0),t),{}),B=Zt.reduce((t,e)=>{const n=Me[e];return t[e]=(s,o=!1,i=!1)=>(Yt||Za(),n.schedule(s,o,i)),t},{}),gt=Zt.reduce((t,e)=>(t[e]=Me[e].cancel,t),{}),je=Zt.reduce((t,e)=>(t[e]=()=>Me[e].process(Ct),t),{}),qa=t=>Me[t].process(Ct),rr=t=>{Yt=!1,Ct.delta=Qe?sr:Math.max(Math.min(t-Ct.timestamp,Xa),1),Ct.timestamp=t,tn=!0,Zt.forEach(qa),tn=!1,Yt&&(Qe=!1,or(rr))},Za=()=>{Yt=!0,Qe=!0,tn||or(rr)},ye=()=>Ct;function ir(t,e,n=0){return t-e-n}function Ja(t,e,n=0,s=!0){return s?ir(e+-t,e,n):e-(t-e)+n}function Qa(t,e,n,s){return s?t>=e+n:t<=-n}const tc=t=>{const e=({delta:n})=>t(n);return{start:()=>B.update(e,!0),stop:()=>gt.update(e)}};function kn(t){var e,n,{from:s,autoplay:o=!0,driver:i=tc,elapsed:r=0,repeat:a=0,repeatType:c="loop",repeatDelay:l=0,onPlay:u,onStop:f,onComplete:d,onRepeat:h,onUpdate:m}=t,v=An(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let{to:S}=v,V,x=0,g=v.duration,y,w=!1,A=!0,L;const F=Ga(v);!((n=(e=F).needsInterpolation)===null||n===void 0)&&n.call(e,s,S)&&(L=Mn([0,100],[s,S],{clamp:!1}),s=0,S=100);const I=F(Object.assign(Object.assign({},v),{from:s,to:S}));function U(){x++,c==="reverse"?(A=x%2===0,r=Ja(r,g,l,A)):(r=ir(r,g,l),c==="mirror"&&I.flipTarget()),w=!1,h&&h()}function J(){V.stop(),d&&d()}function W(Q){if(A||(Q=-Q),r+=Q,!w){const K=I.next(Math.max(0,r));y=K.value,L&&(y=L(y)),w=A?K.done:r<=0}m==null||m(y),w&&(x===0&&(g!=null||(g=r)),x{f==null||f(),V.stop()}}}function ar(t,e){return e?t*(1e3/e):0}function ec({from:t=0,velocity:e=0,min:n,max:s,power:o=.8,timeConstant:i=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:c=1,modifyTarget:l,driver:u,onUpdate:f,onComplete:d,onStop:h}){let m;function v(g){return n!==void 0&&gs}function S(g){return n===void 0?s:s===void 0||Math.abs(n-g){var w;f==null||f(y),(w=g.onUpdate)===null||w===void 0||w.call(g,y)},onComplete:d,onStop:h}))}function x(g){V(Object.assign({type:"spring",stiffness:r,damping:a,restDelta:c},g))}if(v(t))x({from:t,velocity:e,to:S(t)});else{let g=o*e+t;typeof l<"u"&&(g=l(g));const y=S(g),w=y===n?-1:1;let A,L;const F=I=>{A=L,L=I,e=ar(I-A,ye().delta),(w===1&&I>y||w===-1&&Im==null?void 0:m.stop()}}const en=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),ms=t=>en(t)&&t.hasOwnProperty("z"),Qt=(t,e)=>Math.abs(t-e);function Fn(t,e){if(Je(t)&&Je(e))return Qt(t,e);if(en(t)&&en(e)){const n=Qt(t.x,e.x),s=Qt(t.y,e.y),o=ms(t)&&ms(e)?Qt(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(s,2)+Math.pow(o,2))}}const nc=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t},cr=(t,e)=>1-3*e+3*t,lr=(t,e)=>3*e-6*t,ur=t=>3*t,ve=(t,e,n)=>((cr(e,n)*t+lr(e,n))*t+ur(e))*t,fr=(t,e,n)=>3*cr(e,n)*t*t+2*lr(e,n)*t+ur(e),sc=1e-7,oc=10;function rc(t,e,n,s,o){let i,r,a=0;do r=e+(n-e)/2,i=ve(r,s,o)-t,i>0?n=r:e=r;while(Math.abs(i)>sc&&++a=ac?cc(r,f,t,n):d===0?f:rc(r,a,a+te,t,n)}return r=>r===0||r===1?r:ve(i(r),e,s)}function uc({onTap:t,onTapStart:e,onTapCancel:n,whileTap:s,visualElement:o}){const i=t||e||n||s,r=p.exports.useRef(!1),a=p.exports.useRef(null),c={passive:!(e||t||n||h)};function l(){a.current&&a.current(),a.current=null}function u(){return l(),r.current=!1,o.animationState&&o.animationState.setActive(R.Tap,!1),!Yo()}function f(m,v){!u()||(Ko(o.getInstance(),m.target)?t&&t(m,v):n&&n(m,v))}function d(m,v){!u()||n&&n(m,v)}function h(m,v){l(),!r.current&&(r.current=!0,a.current=Ae(Pt(window,"pointerup",f,c),Pt(window,"pointercancel",d,c)),o.animationState&&o.animationState.setActive(R.Tap,!0),e&&e(m,v))}he(o,"pointerdown",i?h:void 0,c),Cn(l)}const fc="production",jn=typeof process>"u"||process.env===void 0?fc:"production",gs=new Set;function Le(t,e,n){t||gs.has(e)||(console.warn(e),n&&console.warn(n),gs.add(e))}const nn=new WeakMap,_e=new WeakMap,dc=t=>{const e=nn.get(t.target);e&&e(t)},hc=t=>{t.forEach(dc)};function pc({root:t,...e}){const n=t||document;_e.has(n)||_e.set(n,{});const s=_e.get(n),o=JSON.stringify(e);return s[o]||(s[o]=new IntersectionObserver(hc,{root:t,...e})),s[o]}function mc(t,e,n){const s=pc(e);return nn.set(t,n),s.observe(t),()=>{nn.delete(t),s.unobserve(t)}}function gc({visualElement:t,whileInView:e,onViewportEnter:n,onViewportLeave:s,viewport:o={}}){const i=p.exports.useRef({hasEnteredView:!1,isInView:!1});let r=Boolean(e||n||s);o.once&&i.current.hasEnteredView&&(r=!1),(typeof IntersectionObserver>"u"?xc:vc)(r,i.current,t,o)}const yc={some:0,all:1};function vc(t,e,n,{root:s,margin:o,amount:i="some",once:r}){p.exports.useEffect(()=>{if(!t)return;const a={root:s==null?void 0:s.current,rootMargin:o,threshold:typeof i=="number"?i:yc[i]},c=l=>{const{isIntersecting:u}=l;if(e.isInView===u||(e.isInView=u,r&&!u&&e.hasEnteredView))return;u&&(e.hasEnteredView=!0),n.animationState&&n.animationState.setActive(R.InView,u);const f=n.getProps(),d=u?f.onViewportEnter:f.onViewportLeave;d&&d(l)};return mc(n.getInstance(),a,c)},[t,s,o,i])}function xc(t,e,n,{fallback:s=!0}){p.exports.useEffect(()=>{!t||!s||(jn!=="production"&&Le(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame(()=>{e.hasEnteredView=!0;const{onViewportEnter:o}=n.getProps();o&&o(null),n.animationState&&n.animationState.setActive(R.InView,!0)}))},[t])}const at=t=>e=>(t(e),null),dr={inView:at(gc),tap:at(uc),focus:at(Zi),hover:at(aa)};function hr(){const t=p.exports.useContext(At);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,o=p.exports.useId();return p.exports.useEffect(()=>s(o),[]),!e&&n?[!1,()=>n&&n(o)]:[!0]}function Lf(){return bc(p.exports.useContext(At))}function bc(t){return t===null?!0:t.isPresent}function pr(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;st*1e3,Sc={linear:En,easeIn:Dn,easeInOut:er,easeOut:Da,circIn:nr,circInOut:Oa,circOut:On,backIn:In,backInOut:ka,backOut:Ia,anticipate:Fa,bounceIn:Ua,bounceInOut:Na,bounceOut:ge},ys=t=>{if(Array.isArray(t)){pe(t.length===4);const[e,n,s,o]=t;return lc(e,n,s,o)}else if(typeof t=="string")return Sc[t];return t},Vc=t=>Array.isArray(t)&&typeof t[0]!="number",vs=(t,e)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&Z.test(e)&&!e.startsWith("url(")),ut=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),ee=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Be=()=>({type:"keyframes",ease:"linear",duration:.3}),wc=t=>({type:"keyframes",duration:.8,values:t}),xs={x:ut,y:ut,z:ut,rotate:ut,rotateX:ut,rotateY:ut,rotateZ:ut,scaleX:ee,scaleY:ee,scale:ee,opacity:Be,backgroundColor:Be,color:Be,default:ee},Tc=(t,e)=>{let n;return Wt(e)?n=wc:n=xs[t]||xs.default,{to:e,...n(e)}},Pc={...Lo,color:_,backgroundColor:_,outlineColor:_,fill:_,stroke:_,borderColor:_,borderTopColor:_,borderRightColor:_,borderBottomColor:_,borderLeftColor:_,filter:Xe,WebkitFilter:Xe},_n=t=>Pc[t];function Bn(t,e){var n;let s=_n(t);return s!==Xe&&(s=Z),(n=s.getAnimatableNone)===null||n===void 0?void 0:n.call(s,e)}const sn={current:!1};function Cc({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:o,repeat:i,repeatType:r,repeatDelay:a,from:c,...l}){return!!Object.keys(l).length}function Ac({ease:t,times:e,yoyo:n,flip:s,loop:o,...i}){const r={...i};return e&&(r.offset=e),i.duration&&(r.duration=xe(i.duration)),i.repeatDelay&&(r.repeatDelay=xe(i.repeatDelay)),t&&(r.ease=Vc(t)?t.map(ys):ys(t)),i.type==="tween"&&(r.type="keyframes"),(n||o||s)&&(n?r.repeatType="reverse":o?r.repeatType="loop":s&&(r.repeatType="mirror"),r.repeat=o||n||s||i.repeat),i.type!=="spring"&&(r.type="keyframes"),r}function Rc(t,e){var n,s;return(s=(n=(Un(t,e)||{}).delay)!==null&&n!==void 0?n:t.delay)!==null&&s!==void 0?s:0}function Mc(t){return Array.isArray(t.to)&&t.to[0]===null&&(t.to=[...t.to],t.to[0]=t.from),t}function Lc(t,e,n){return Array.isArray(e.to)&&t.duration===void 0&&(t.duration=.8),Mc(e),Cc(t)||(t={...t,...Tc(n,e.to)}),{...e,...Ac(t)}}function Ec(t,e,n,s,o){const i=Un(s,t)||{};let r=i.from!==void 0?i.from:e.get();const a=vs(t,n);r==="none"&&a&&typeof n=="string"?r=Bn(t,n):bs(r)&&typeof n=="string"?r=Ss(n):!Array.isArray(n)&&bs(n)&&typeof r=="string"&&(n=Ss(r));const c=vs(t,r);function l(){const f={from:r,to:n,velocity:e.getVelocity(),onComplete:o,onUpdate:d=>e.set(d)};return i.type==="inertia"||i.type==="decay"?ec({...f,...i}):kn({...Lc(i,f,t),onUpdate:d=>{f.onUpdate(d),i.onUpdate&&i.onUpdate(d)},onComplete:()=>{f.onComplete(),i.onComplete&&i.onComplete()}})}function u(){const f=Uo(n);return e.set(f),o(),i.onUpdate&&i.onUpdate(f),i.onComplete&&i.onComplete(),{stop:()=>{}}}return!c||!a||i.type===!1?u:l}function bs(t){return t===0||typeof t=="string"&&parseFloat(t)===0&&t.indexOf(" ")===-1}function Ss(t){return typeof t=="number"?0:Bn("",t)}function Un(t,e){return t[e]||t.default||t}function Nn(t,e,n,s={}){return sn.current&&(s={type:!1}),e.start(o=>{let i,r;const a=Ec(t,e,n,s,o),c=Rc(s,t),l=()=>r=a();return c?i=window.setTimeout(l,xe(c)):l(),()=>{clearTimeout(i),r&&r.stop()}})}const Dc=t=>/^\-?\d*\.?\d+$/.test(t),Oc=t=>/^0[^.\s]+$/.test(t);function Ee(t,e){t.indexOf(e)===-1&&t.push(e)}function Kt(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function Ic([...t],e,n){const s=e<0?t.length+e:e;if(s>=0&&sKt(this.subscriptions,e)}notify(e,n,s){const o=this.subscriptions.length;if(!!o)if(o===1)this.subscriptions[0](e,n,s);else for(let i=0;i!isNaN(parseFloat(t));class mr{constructor(e){this.version="7.3.2",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Ft,this.velocityUpdateSubscribers=new Ft,this.renderSubscribers=new Ft,this.canTrackVelocity=!1,this.updateAndNotify=(n,s=!0)=>{this.prev=this.current,this.current=n;const{delta:o,timestamp:i}=ye();this.lastUpdated!==i&&(this.timeDelta=o,this.lastUpdated=i,B.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),s&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>B.postRender(this.velocityCheck),this.velocityCheck=({timestamp:n})=>{n!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=kc(this.current)}onChange(e){return this.updateSubscribers.add(e)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(e){return e(this.get()),this.renderSubscribers.add(e)}attach(e){this.passiveEffect=e}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ar(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.stopAnimation=e(n)}).then(()=>this.clearAnimation())}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function H(t){return new mr(t)}const gr=t=>e=>e.test(t),Fc={test:t=>t==="auto",parse:t=>t},yr=[xt,T,Y,nt,Vi,Si,Fc],Lt=t=>yr.find(gr(t)),jc=[...yr,_,Z],_c=t=>jc.find(gr(t));function Bc(t){const e={};return t.forEachValue((n,s)=>e[s]=n.get()),e}function Uc(t){const e={};return t.forEachValue((n,s)=>e[s]=n.getVelocity()),e}function De(t,e,n){const s=t.getProps();return Bo(s,e,n!==void 0?n:s.custom,Bc(t),Uc(t))}function Nc(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,H(n))}function zn(t,e){const n=De(t,e);let{transitionEnd:s={},transition:o={},...i}=n?t.makeTargetAnimatable(n,!1):{};i={...i,...s};for(const r in i){const a=Uo(i[r]);Nc(t,r,a)}}function on(t,e){[...e].reverse().forEach(s=>{var o;const i=t.getVariant(s);i&&zn(t,i),(o=t.variantChildren)===null||o===void 0||o.forEach(r=>{on(r,e)})})}function zc(t,e){if(Array.isArray(e))return on(t,e);if(typeof e=="string")return on(t,[e]);zn(t,e)}function vr(t,e,n){var s,o;const i=Object.keys(e).filter(a=>!t.hasValue(a)),r=i.length;if(!!r)for(let a=0;arn(t,i,n));s=Promise.all(o)}else if(typeof e=="string")s=rn(t,e,n);else{const o=typeof e=="function"?De(t,e,n.custom):e;s=br(t,o,n)}return s.then(()=>t.notifyAnimationComplete(e))}function rn(t,e,n={}){var s;const o=De(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=o||{};n.transitionOverride&&(i=n.transitionOverride);const r=o?()=>br(t,o,n):()=>Promise.resolve(),a=!((s=t.variantChildren)===null||s===void 0)&&s.size?(l=0)=>{const{delayChildren:u=0,staggerChildren:f,staggerDirection:d}=i;return Hc(t,e,u+l,f,d,n)}:()=>Promise.resolve(),{when:c}=i;if(c){const[l,u]=c==="beforeChildren"?[r,a]:[a,r];return l().then(u)}else return Promise.all([r(),a(n.delay)])}function br(t,e,{delay:n=0,transitionOverride:s,type:o}={}){var i;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...c}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");s&&(r=s);const u=[],f=o&&((i=t.animationState)===null||i===void 0?void 0:i.getState()[o]);for(const d in c){const h=t.getValue(d),m=c[d];if(!h||m===void 0||f&&Yc(f,d))continue;let v={delay:n,...r};t.shouldReduceMotion&&mt.has(d)&&(v={...v,type:!1,delay:0});let S=Nn(d,h,m,v);be(l)&&(l.add(d),S=S.then(()=>l.remove(d))),u.push(S)}return Promise.all(u).then(()=>{a&&zn(t,a)})}function Hc(t,e,n=0,s=0,o=1,i){const r=[],a=(t.variantChildren.size-1)*s,c=o===1?(l=0)=>l*s:(l=0)=>a-l*s;return Array.from(t.variantChildren).sort(Gc).forEach((l,u)=>{r.push(rn(l,e,{...i,delay:n+c(u)}).then(()=>l.notifyAnimationComplete(e)))}),Promise.all(r)}function Wc(t){t.forEachValue(e=>e.stop())}function Gc(t,e){return t.sortNodePosition(e)}function Yc({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}const Hn=[R.Animate,R.InView,R.Focus,R.Hover,R.Tap,R.Drag,R.Exit],Kc=[...Hn].reverse(),Xc=Hn.length;function qc(t){return e=>Promise.all(e.map(({animation:n,options:s})=>$n(t,n,s)))}function Zc(t){let e=qc(t);const n=Qc();let s=!0;const o=(c,l)=>{const u=De(t,l);if(u){const{transition:f,transitionEnd:d,...h}=u;c={...c,...h,...d}}return c};function i(c){e=c(t)}function r(c,l){var u;const f=t.getProps(),d=t.getVariantContext(!0)||{},h=[],m=new Set;let v={},S=1/0;for(let x=0;xS&&A;const J=Array.isArray(w)?w:[w];let W=J.reduce(o,{});L===!1&&(W={});const{prevResolvedValues:ct={}}=y,Q={...ct,...W},K=D=>{U=!0,m.delete(D),y.needsAnimating[D]=!0};for(const D in Q){const tt=W[D],lt=ct[D];v.hasOwnProperty(D)||(tt!==lt?Wt(tt)&&Wt(lt)?!pr(tt,lt)||I?K(D):y.protectedKeys[D]=!0:tt!==void 0?K(D):m.add(D):tt!==void 0&&m.has(D)?K(D):y.protectedKeys[D]=!0)}y.prevProp=w,y.prevResolvedValues=W,y.isActive&&(v={...v,...W}),s&&t.blockInitialAnimation&&(U=!1),U&&!F&&h.push(...J.map(D=>({animation:D,options:{type:g,...c}})))}if(m.size){const x={};m.forEach(g=>{const y=t.getBaseTarget(g);y!==void 0&&(x[g]=y)}),h.push({animation:x})}let V=Boolean(h.length);return s&&f.initial===!1&&!t.manuallyAnimateOnMount&&(V=!1),s=!1,V?e(h):Promise.resolve()}function a(c,l,u){var f;if(n[c].isActive===l)return Promise.resolve();(f=t.variantChildren)===null||f===void 0||f.forEach(h=>{var m;return(m=h.animationState)===null||m===void 0?void 0:m.setActive(c,l)}),n[c].isActive=l;const d=r(u,c);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:r,setActive:a,setAnimateFunction:i,getState:()=>n}}function Jc(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!pr(e,t):!1}function ft(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Qc(){return{[R.Animate]:ft(!0),[R.InView]:ft(),[R.Hover]:ft(),[R.Tap]:ft(),[R.Drag]:ft(),[R.Focus]:ft(),[R.Exit]:ft()}}const Sr={animation:at(({visualElement:t,animate:e})=>{t.animationState||(t.animationState=Zc(t)),Te(e)&&p.exports.useEffect(()=>e.subscribe(t),[e])}),exit:at(t=>{const{custom:e,visualElement:n}=t,[s,o]=hr(),i=p.exports.useContext(At);p.exports.useEffect(()=>{n.isPresent=s;const r=n.animationState&&n.animationState.setActive(R.Exit,!s,{custom:i&&i.custom||e});r&&!s&&r.then(o)},[s])})};class Vr{constructor(e,n,{transformPagePoint:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const l=Ne(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,f=Fn(l.offset,{x:0,y:0})>=3;if(!u&&!f)return;const{point:d}=l,{timestamp:h}=ye();this.history.push({...d,timestamp:h});const{onStart:m,onMove:v}=this.handlers;u||(m&&m(this.lastMoveEvent,l),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,l)},this.handlePointerMove=(l,u)=>{if(this.lastMoveEvent=l,this.lastMoveEventInfo=Ue(u,this.transformPagePoint),No(l)&&l.buttons===0){this.handlePointerUp(l,u);return}B.update(this.updatePoint,!0)},this.handlePointerUp=(l,u)=>{this.end();const{onEnd:f,onSessionEnd:d}=this.handlers,h=Ne(Ue(u,this.transformPagePoint),this.history);this.startEvent&&f&&f(l,h),d&&d(l,h)},zo(e)&&e.touches.length>1)return;this.handlers=n,this.transformPagePoint=s;const o=Pn(e),i=Ue(o,this.transformPagePoint),{point:r}=i,{timestamp:a}=ye();this.history=[{...r,timestamp:a}];const{onSessionStart:c}=n;c&&c(e,Ne(i,this.history)),this.removeListeners=Ae(Pt(window,"pointermove",this.handlePointerMove),Pt(window,"pointerup",this.handlePointerUp),Pt(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),gt.update(this.updatePoint)}}function Ue(t,e){return e?{point:e(t.point)}:t}function Vs(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ne({point:t},e){return{point:t,delta:Vs(t,wr(e)),offset:Vs(t,tl(e)),velocity:el(e,.1)}}function tl(t){return t[0]}function wr(t){return t[t.length-1]}function el(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const o=wr(t);for(;n>=0&&(s=t[n],!(o.timestamp-s.timestamp>xe(e)));)n--;if(!s)return{x:0,y:0};const i=(o.timestamp-s.timestamp)/1e3;if(i===0)return{x:0,y:0};const r={x:(o.x-s.x)/i,y:(o.y-s.y)/i};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function z(t){return t.max-t.min}function ws(t,e=0,n=.01){return Fn(t,e)n&&(t=s?M(n,t,s.max):Math.min(t,n)),t}function As(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function ol(t,{top:e,left:n,bottom:s,right:o}){return{x:As(t.x,n,o),y:As(t.y,e,s)}}function Rs(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.mins?n=Gt(e.min,e.max-s,t.min):s>o&&(n=Gt(t.min,t.max-o,e.min)),me(0,1,n)}function al(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const an=.35;function cl(t=an){return t===!1?t=0:t===!0&&(t=an),{x:Ms(t,"left","right"),y:Ms(t,"top","bottom")}}function Ms(t,e,n){return{min:Ls(t,e),max:Ls(t,n)}}function Ls(t,e){var n;return typeof t=="number"?t:(n=t[e])!==null&&n!==void 0?n:0}const Es=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bt=()=>({x:Es(),y:Es()}),Ds=()=>({min:0,max:0}),O=()=>({x:Ds(),y:Ds()});function G(t){return[t("x"),t("y")]}function Tr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function ll({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function ul(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function ze(t){return t===void 0||t===1}function Pr({scale:t,scaleX:e,scaleY:n}){return!ze(t)||!ze(e)||!ze(n)}function st(t){return Pr(t)||Os(t.x)||Os(t.y)||t.z||t.rotate||t.rotateX||t.rotateY}function Os(t){return t&&t!=="0%"}function Se(t,e,n){const s=t-n,o=e*s;return n+o}function Is(t,e,n,s,o){return o!==void 0&&(t=Se(t,o,s)),Se(t,n,s)+e}function cn(t,e=0,n=1,s,o){t.min=Is(t.min,e,n,s,o),t.max=Is(t.max,e,n,s,o)}function Cr(t,{x:e,y:n}){cn(t.x,e.translate,e.scale,e.originPoint),cn(t.y,n.translate,n.scale,n.originPoint)}function fl(t,e,n,s=!1){var o,i;const r=n.length;if(!r)return;e.x=e.y=1;let a,c;for(let l=0;l{this.stopAnimation(),n&&this.snapToCursor(Pn(a,"page").point)},o=(a,c)=>{var l;const{drag:u,dragPropagation:f,onDragStart:d}=this.getProps();u&&!f&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Go(u),!this.openGlobalLock)||(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),G(h=>{var m,v;let S=this.getAxisMotionValue(h).get()||0;if(Y.test(S)){const V=(v=(m=this.visualElement.projection)===null||m===void 0?void 0:m.layout)===null||v===void 0?void 0:v.actual[h];V&&(S=z(V)*(parseFloat(S)/100))}this.originPoint[h]=S}),d==null||d(a,c),(l=this.visualElement.animationState)===null||l===void 0||l.setActive(R.Drag,!0))},i=(a,c)=>{const{dragPropagation:l,dragDirectionLock:u,onDirectionLock:f,onDrag:d}=this.getProps();if(!l&&!this.openGlobalLock)return;const{offset:h}=c;if(u&&this.currentDirection===null){this.currentDirection=yl(h),this.currentDirection!==null&&(f==null||f(this.currentDirection));return}this.updateAxis("x",c.point,h),this.updateAxis("y",c.point,h),this.visualElement.syncRender(),d==null||d(a,c)},r=(a,c)=>this.stop(a,c);this.panSession=new Vr(e,{onSessionStart:s,onStart:o,onMove:i,onSessionEnd:r},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i==null||i(e,n)}cancel(){var e,n;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),(e=this.panSession)===null||e===void 0||e.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),(n=this.visualElement.animationState)===null||n===void 0||n.setActive(R.Drag,!1)}updateAxis(e,n,s){const{drag:o}=this.getProps();if(!s||!ne(e,o,this.currentDirection))return;const i=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=sl(r,this.constraints[e],this.elastic[e])),i.set(r)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),{layout:s}=this.visualElement.projection||{},o=this.constraints;e&&wt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=ol(s.actual,e):this.constraints=!1,this.elastic=cl(n),o!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&G(i=>{this.getAxisMotionValue(i)&&(this.constraints[i]=al(s.actual[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!wt(e))return!1;const s=e.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=pl(s,o.root,this.visualElement.getTransformPagePoint());let r=rl(o.layout.actual,i);if(n){const a=n(ll(r));this.hasMutatedConstraints=!!a,a&&(r=Tr(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:o,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=G(u=>{var f;if(!ne(u,n,this.currentDirection))return;let d=(f=c==null?void 0:c[u])!==null&&f!==void 0?f:{};r&&(d={min:0,max:0});const h=o?200:1e6,m=o?40:1e7,v={type:"inertia",velocity:s?e[u]:0,bounceStiffness:h,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...d};return this.startAxisValueAnimation(u,v)});return Promise.all(l).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Nn(e,s,0,n)}stopAnimation(){G(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){var n,s;const o="_drag"+e.toUpperCase(),i=this.visualElement.getProps()[o];return i||this.visualElement.getValue(e,(s=(n=this.visualElement.getProps().initial)===null||n===void 0?void 0:n[e])!==null&&s!==void 0?s:0)}snapToCursor(e){G(n=>{const{drag:s}=this.getProps();if(!ne(n,s,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:r,max:a}=o.layout.actual[n];i.set(e[n]-M(r,a,.5))}})}scalePositionWithinConstraints(){var e;const{drag:n,dragConstraints:s}=this.getProps(),{projection:o}=this.visualElement;if(!wt(s)||!o||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};G(a=>{const c=this.getAxisMotionValue(a);if(c){const l=c.get();i[a]=il({min:l,max:l},this.constraints[a])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.getInstance().style.transform=r?r({},""):"none",(e=o.root)===null||e===void 0||e.updateScroll(),o.updateLayout(),this.resolveConstraints(),G(a=>{if(!ne(a,n,null))return;const c=this.getAxisMotionValue(a),{min:l,max:u}=this.constraints[a];c.set(M(l,u,i[a]))})}addListeners(){var e;ml.set(this.visualElement,this);const n=this.visualElement.getInstance(),s=Pt(n,"pointerdown",l=>{const{drag:u,dragListener:f=!0}=this.getProps();u&&f&&this.start(l)}),o=()=>{const{dragConstraints:l}=this.getProps();wt(l)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,r=i.addEventListener("measure",o);i&&!i.layout&&((e=i.root)===null||e===void 0||e.updateScroll(),i.updateLayout()),o();const a=Ce(window,"resize",()=>this.scalePositionWithinConstraints()),c=i.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(G(f=>{const d=this.getAxisMotionValue(f);!d||(this.originPoint[f]+=l[f].translate,d.set(d.get()+l[f].translate))}),this.visualElement.syncRender())});return()=>{a(),s(),r(),c==null||c()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:r=an,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:o,dragConstraints:i,dragElastic:r,dragMomentum:a}}}function ne(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function yl(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}function vl(t){const{dragControls:e,visualElement:n}=t,s=j(()=>new gl(n));p.exports.useEffect(()=>e&&e.subscribe(s),[s,e]),p.exports.useEffect(()=>s.addListeners(),[s])}function xl({onPan:t,onPanStart:e,onPanEnd:n,onPanSessionStart:s,visualElement:o}){const i=t||e||n||s,r=p.exports.useRef(null),{transformPagePoint:a}=p.exports.useContext(q),c={onSessionStart:s,onStart:e,onMove:t,onEnd:(u,f)=>{r.current=null,n&&n(u,f)}};p.exports.useEffect(()=>{r.current!==null&&r.current.updateHandlers(c)});function l(u){r.current=new Vr(u,c,{transformPagePoint:a})}he(o,"pointerdown",i&&l),Cn(()=>r.current&&r.current.end())}const Rr={pan:at(xl),drag:at(vl)},Ve={current:null},Wn={current:!1};function Mr(){if(Wn.current=!0,!!vt)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ve.current=t.matches;t.addListener(e),e()}else Ve.current=!1}const se=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","LayoutAnimationStart","SetAxisTarget","Unmount"];function bl(){const t=se.map(()=>new Ft),e={},n={clearAllListeners:()=>t.forEach(s=>s.clear()),updatePropListeners:s=>{se.forEach(o=>{var i;const r="on"+o,a=s[r];(i=e[o])===null||i===void 0||i.call(e),a&&(e[o]=n[r](a))})}};return t.forEach((s,o)=>{n["on"+se[o]]=i=>s.add(i),n["notify"+se[o]]=(...i)=>s.notify(...i)}),n}function Sl(t,e,n){const{willChange:s}=e;for(const o in e){const i=e[o],r=n[o];if(N(i))t.addValue(o,i),be(s)&&s.add(o);else if(N(r))t.addValue(o,H(i)),be(s)&&s.remove(o);else if(r!==i)if(t.hasValue(o)){const a=t.getValue(o);!a.hasAnimated&&a.set(i)}else{const a=t.getStaticValue(o);t.addValue(o,H(a!==void 0?a:i))}}for(const o in n)e[o]===void 0&&t.removeValue(o);return e}const Lr=Object.keys(zt),Vl=Lr.length,Gn=({treeType:t="",build:e,getBaseTarget:n,makeTargetAnimatable:s,measureViewportBox:o,render:i,readValueFromInstance:r,removeValueFromRenderState:a,sortNodePosition:c,scrapeMotionValuesFromProps:l})=>({parent:u,props:f,presenceId:d,blockInitialAnimation:h,visualState:m,reducedMotionConfig:v},S={})=>{let V=!1;const{latestValues:x,renderState:g}=m;let y;const w=bl(),A=new Map,L=new Map;let F={};const I={...x};let U;function J(){!y||!V||(W(),i(y,g,f.style,C.projection))}function W(){e(C,g,x,S,f)}function ct(){w.notifyUpdate(x)}function Q(b,P){const E=P.onChange(et=>{x[b]=et,f.onUpdate&&B.update(ct,!1,!0)}),bt=P.onRenderRequest(C.scheduleRender);L.set(b,()=>{E(),bt()})}const{willChange:K,...D}=l(f);for(const b in D){const P=D[b];x[b]!==void 0&&N(P)&&(P.set(x[b],!1),be(K)&&K.add(b))}const tt=Pe(f),lt=vo(f),C={treeType:t,current:null,depth:u?u.depth+1:0,parent:u,children:new Set,presenceId:d,shouldReduceMotion:null,variantChildren:lt?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(u==null?void 0:u.isMounted()),blockInitialAnimation:h,isMounted:()=>Boolean(y),mount(b){V=!0,y=C.current=b,C.projection&&C.projection.mount(b),lt&&u&&!tt&&(U=u==null?void 0:u.addVariantChild(C)),A.forEach((P,E)=>Q(E,P)),Wn.current||Mr(),C.shouldReduceMotion=v==="never"?!1:v==="always"?!0:Ve.current,u==null||u.children.add(C),C.setProps(f)},unmount(){var b;(b=C.projection)===null||b===void 0||b.unmount(),gt.update(ct),gt.render(J),L.forEach(P=>P()),U==null||U(),u==null||u.children.delete(C),w.clearAllListeners(),y=void 0,V=!1},loadFeatures(b,P,E,bt,et,ni){const Qn=[];for(let Rt=0;RtC.scheduleRender(),animationType:typeof St=="string"?St:"both",initialPromotionConfig:ni,layoutScroll:si})}return Qn},addVariantChild(b){var P;const E=C.getClosestVariantNode();if(E)return(P=E.variantChildren)===null||P===void 0||P.add(b),()=>E.variantChildren.delete(b)},sortNodePosition(b){return!c||t!==b.treeType?0:c(C.getInstance(),b.getInstance())},getClosestVariantNode:()=>lt?C:u==null?void 0:u.getClosestVariantNode(),getLayoutId:()=>f.layoutId,getInstance:()=>y,getStaticValue:b=>x[b],setStaticValue:(b,P)=>x[b]=P,getLatestValues:()=>x,setVisibility(b){C.isVisible!==b&&(C.isVisible=b,C.scheduleRender())},makeTargetAnimatable(b,P=!0){return s(C,b,f,P)},measureViewportBox(){return o(y,f)},addValue(b,P){C.hasValue(b)&&C.removeValue(b),A.set(b,P),x[b]=P.get(),Q(b,P)},removeValue(b){var P;A.delete(b),(P=L.get(b))===null||P===void 0||P(),L.delete(b),delete x[b],a(b,g)},hasValue:b=>A.has(b),getValue(b,P){let E=A.get(b);return E===void 0&&P!==void 0&&(E=H(P),C.addValue(b,E)),E},forEachValue:b=>A.forEach(b),readValue:b=>x[b]!==void 0?x[b]:r(y,b,S),setBaseTarget(b,P){I[b]=P},getBaseTarget(b){if(n){const P=n(f,b);if(P!==void 0&&!N(P))return P}return I[b]},...w,build(){return W(),g},scheduleRender(){B.render(J,!1,!0)},syncRender:J,setProps(b){(b.transformTemplate||f.transformTemplate)&&C.scheduleRender(),f=b,w.updatePropListeners(b),F=Sl(C,l(f),F)},getProps:()=>f,getVariant:b=>{var P;return(P=f.variants)===null||P===void 0?void 0:P[b]},getDefaultTransition:()=>f.transition,getTransformPagePoint:()=>f.transformPagePoint,getVariantContext(b=!1){if(b)return u==null?void 0:u.getVariantContext();if(!tt){const E=(u==null?void 0:u.getVariantContext())||{};return f.initial!==void 0&&(E.initial=f.initial),E}const P={};for(let E=0;E{const i=o.get();if(!ln(i))return;const r=un(i,s);r&&o.set(r)});for(const o in e){const i=e[o];if(!ln(i))continue;const r=un(i,s);!r||(e[o]=r,n&&n[o]===void 0&&(n[o]=i))}return{target:e,transitionEnd:n}}const Cl=new Set(["width","height","top","left","right","bottom","x","y"]),Or=t=>Cl.has(t),Al=t=>Object.keys(t).some(Or),Ir=(t,e)=>{t.set(e,!1),t.set(e)},Fs=t=>t===xt||t===T;var js;(function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"})(js||(js={}));const _s=(t,e)=>parseFloat(t.split(", ")[e]),Bs=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const o=s.match(/^matrix3d\((.+)\)$/);if(o)return _s(o[1],e);{const i=s.match(/^matrix\((.+)\)$/);return i?_s(i[1],t):0}},Rl=new Set(["x","y","z"]),Ml=ue.filter(t=>!Rl.has(t));function Ll(t){const e=[];return Ml.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e.length&&t.syncRender(),e}const Us={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Bs(4,13),y:Bs(5,14)},El=(t,e,n)=>{const s=e.measureViewportBox(),o=e.getInstance(),i=getComputedStyle(o),{display:r}=i,a={};r==="none"&&e.setStaticValue("display",t.display||"block"),n.forEach(l=>{a[l]=Us[l](s,i)}),e.syncRender();const c=e.measureViewportBox();return n.forEach(l=>{const u=e.getValue(l);Ir(u,a[l]),t[l]=Us[l](c,i)}),t},Dl=(t,e,n={},s={})=>{e={...e},s={...s};const o=Object.keys(e).filter(Or);let i=[],r=!1;const a=[];if(o.forEach(c=>{const l=t.getValue(c);if(!t.hasValue(c))return;let u=n[c],f=Lt(u);const d=e[c];let h;if(Wt(d)){const m=d.length,v=d[0]===null?1:0;u=d[v],f=Lt(u);for(let S=v;S=0?window.pageYOffset:null,l=El(e,t,a);return i.length&&i.forEach(([u,f])=>{t.getValue(u).set(f)}),t.syncRender(),vt&&c!==null&&window.scrollTo({top:c}),{target:l,transitionEnd:s}}else return{target:e,transitionEnd:s}};function Ol(t,e,n,s){return Al(e)?Dl(t,e,n,s):{target:e,transitionEnd:s}}const Il=(t,e,n,s)=>{const o=Pl(t,e,s);return e=o.target,s=o.transitionEnd,Ol(t,e,n,s)};function kl(t){return window.getComputedStyle(t)}const kr={treeType:"dom",readValueFromInstance(t,e){if(mt.has(e)){const n=_n(e);return n&&n.default||0}else{const n=kl(t),s=(yn(e)?n.getPropertyValue(e):n[e])||0;return typeof s=="string"?s.trim():s}},sortNodePosition(t,e){return t.compareDocumentPosition(e)&2?1:-1},getBaseTarget(t,e){var n;return(n=t.style)===null||n===void 0?void 0:n[e]},measureViewportBox(t,{transformPagePoint:e}){return Ar(t,e)},resetTransform(t,e,n){const{transformTemplate:s}=n;e.style.transform=s?s({},""):"none",t.scheduleRender()},restoreTransform(t,e){t.style.transform=e.style.transform},removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]},makeTargetAnimatable(t,{transition:e,transitionEnd:n,...s},{transformValues:o},i=!0){let r=xr(s,e||{},t);if(o&&(n&&(n=o(n)),s&&(s=o(s)),r&&(r=o(r))),i){vr(t,s,r);const a=Il(t,s,r,n);n=a.transitionEnd,s=a.target}return{transition:e,transitionEnd:n,...s}},scrapeMotionValuesFromProps:Vn,build(t,e,n,s,o){t.isVisible!==void 0&&(e.style.visibility=t.isVisible?"visible":"hidden"),xn(e,n,s,o.transformTemplate)},render:ko},Fl=Gn(kr),jl=Gn({...kr,getBaseTarget(t,e){return t[e]},readValueFromInstance(t,e){var n;return mt.has(e)?((n=_n(e))===null||n===void 0?void 0:n.default)||0:(e=Fo.has(e)?e:de(e),t.getAttribute(e))},scrapeMotionValuesFromProps:_o,build(t,e,n,s,o){Sn(e,n,s,o.transformTemplate)},render:jo}),Yn=(t,e)=>gn(t)?jl(e,{enableHardwareAcceleration:!1}):Fl(e,{enableHardwareAcceleration:!0});function Ns(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Et={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(T.test(t))t=parseFloat(t);else return t;const n=Ns(t,e.target.x),s=Ns(t,e.target.y);return`${n}% ${s}%`}},zs="_$css",_l={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,o=t.includes("var("),i=[];o&&(t=t.replace(Dr,h=>(i.push(h),zs)));const r=Z.parse(t);if(r.length>5)return s;const a=Z.createTransformer(t),c=typeof r[0]!="number"?1:0,l=n.x.scale*e.x,u=n.y.scale*e.y;r[0+c]/=l,r[1+c]/=u;const f=M(l,u,.5);typeof r[2+c]=="number"&&(r[2+c]/=f),typeof r[3+c]=="number"&&(r[3+c]/=f);let d=a(r);if(o){let h=0;d=d.replace(zs,()=>{const m=i[h];return h++,m})}return d}};class Bl extends go.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:o}=this.props,{projection:i}=e;mi(Nl),i&&(n.group&&n.group.add(i),s&&s.register&&o&&s.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Ot.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:o,isPresent:i}=this.props,r=s.projection;return r&&(r.isPresent=i,o||e.layoutDependency!==n||n===void 0?r.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?r.promote():r.relegate()||B.postRender(()=>{var a;!((a=r.getStack())===null||a===void 0)&&a.members.length||this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),!e.currentAnimation&&e.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:o}=e;o&&(o.scheduleCheckAfterUnmount(),n!=null&&n.group&&n.group.remove(o),s!=null&&s.deregister&&s.deregister(o))}safeToRemove(){const{safeToRemove:e}=this.props;e==null||e()}render(){return null}}function Ul(t){const[e,n]=hr(),s=p.exports.useContext($t);return k(Bl,{...t,layoutGroup:s,switchLayoutGroup:p.exports.useContext(xo),isPresent:e,safeToRemove:n})}const Nl={borderRadius:{...Et,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Et,borderTopRightRadius:Et,borderBottomLeftRadius:Et,borderBottomRightRadius:Et,boxShadow:_l},Fr={measureLayout:Ul};function zl(t,e,n={}){const s=N(t)?t:H(t);return Nn("",s,e,n),{stop:()=>s.stop(),isAnimating:()=>s.isAnimating()}}const jr=["TopLeft","TopRight","BottomLeft","BottomRight"],$l=jr.length,$s=t=>typeof t=="string"?parseFloat(t):t,Hs=t=>typeof t=="number"||T.test(t);function Hl(t,e,n,s,o,i){var r,a,c,l;o?(t.opacity=M(0,(r=n.opacity)!==null&&r!==void 0?r:1,Wl(s)),t.opacityExit=M((a=e.opacity)!==null&&a!==void 0?a:1,0,Gl(s))):i&&(t.opacity=M((c=e.opacity)!==null&&c!==void 0?c:1,(l=n.opacity)!==null&&l!==void 0?l:1,s));for(let u=0;u<$l;u++){const f=`border${jr[u]}Radius`;let d=Ws(e,f),h=Ws(n,f);if(d===void 0&&h===void 0)continue;d||(d=0),h||(h=0),d===0||h===0||Hs(d)===Hs(h)?(t[f]=Math.max(M($s(d),$s(h),s),0),(Y.test(h)||Y.test(d))&&(t[f]+="%")):t[f]=h}(e.rotate||n.rotate)&&(t.rotate=M(e.rotate||0,n.rotate||0,s))}function Ws(t,e){var n;return(n=t[e])!==null&&n!==void 0?n:t.borderRadius}const Wl=_r(0,.5,On),Gl=_r(.5,.95,En);function _r(t,e,n){return s=>se?1:n(Gt(t,e,s))}function Gs(t,e){t.min=e.min,t.max=e.max}function $(t,e){Gs(t.x,e.x),Gs(t.y,e.y)}function Ys(t,e,n,s,o){return t-=e,t=Se(t,1/n,s),o!==void 0&&(t=Se(t,1/o,s)),t}function Yl(t,e=0,n=1,s=.5,o,i=t,r=t){if(Y.test(e)&&(e=parseFloat(e),e=M(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=M(i.min,i.max,s);t===i&&(a-=e),t.min=Ys(t.min,e,n,a,o),t.max=Ys(t.max,e,n,a,o)}function Ks(t,e,[n,s,o],i,r){Yl(t,e[n],e[s],e[o],e.scale,i,r)}const Kl=["x","scaleX","originX"],Xl=["y","scaleY","originY"];function Xs(t,e,n,s){Ks(t.x,e,Kl,n==null?void 0:n.x,s==null?void 0:s.x),Ks(t.y,e,Xl,n==null?void 0:n.y,s==null?void 0:s.y)}function qs(t){return t.translate===0&&t.scale===1}function Br(t){return qs(t.x)&&qs(t.y)}function Ur(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function Zs(t){return z(t.x)/z(t.y)}function ql(t,e,n=.01){return Fn(t,e)<=n}class Zl{constructor(){this.members=[]}add(e){Ee(this.members,e),e.scheduleRender()}remove(e){if(Kt(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(o=>e===o);if(n===0)return!1;let s;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){s=i;break}}return s?(this.promote(s),!0):!1}promote(e,n){var s;const o=this.lead;if(e!==o&&(this.prevLead=o,this.lead=e,e.show(),o)){o.instance&&o.scheduleRender(),e.scheduleRender(),e.resumeFrom=o,n&&(e.resumeFrom.preserveOpacity=!0),o.snapshot&&(e.snapshot=o.snapshot,e.snapshot.latestValues=o.animationValues||o.latestValues,e.snapshot.isShared=!0),!((s=e.root)===null||s===void 0)&&s.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&o.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var n,s,o,i,r;(s=(n=e.options).onExitComplete)===null||s===void 0||s.call(n),(r=(o=e.resumingFrom)===null||o===void 0?void 0:(i=o.options).onExitComplete)===null||r===void 0||r.call(i)})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Jl="translate3d(0px, 0px, 0) scale(1, 1) scale(1, 1)";function Js(t,e,n){const s=t.x.translate/e.x,o=t.y.translate/e.y;let i=`translate3d(${s}px, ${o}px, 0) `;if(i+=`scale(${1/e.x}, ${1/e.y}) `,n){const{rotate:c,rotateX:l,rotateY:u}=n;c&&(i+=`rotate(${c}deg) `),l&&(i+=`rotateX(${l}deg) `),u&&(i+=`rotateY(${u}deg) `)}const r=t.x.scale*e.x,a=t.y.scale*e.y;return i+=`scale(${r}, ${a})`,i===Jl?"none":i}const Ql=(t,e)=>t.depth-e.depth;class tu{constructor(){this.children=[],this.isDirty=!1}add(e){Ee(this.children,e),this.isDirty=!0}remove(e){Kt(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ql),this.isDirty=!1,this.children.forEach(e)}}const Qs=["","X","Y","Z"],to=1e3;function Nr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(r,a={},c=e==null?void 0:e()){this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(iu),this.nodes.forEach(au)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.id=r,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0,r&&this.root.registerPotentialNode(r,this);for(let l=0;lthis.root.updateBlockedByResize=!1;t(r,()=>{this.root.updateBlockedByResize=!0,clearTimeout(d),d=window.setTimeout(h,250),Ot.hasAnimatedSinceResize&&(Ot.hasAnimatedSinceResize=!1,this.nodes.forEach(ru))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&f&&(l||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeTargetChanged:m,layout:v})=>{var S,V,x,g,y;if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=(V=(S=this.options.transition)!==null&&S!==void 0?S:f.getDefaultTransition())!==null&&V!==void 0?V:du,{onLayoutAnimationStart:A,onLayoutAnimationComplete:L}=f.getProps(),F=!this.targetLayout||!Ur(this.targetLayout,v)||m,I=!h&&m;if(((x=this.resumeFrom)===null||x===void 0?void 0:x.instance)||I||h&&(F||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(d,I);const U={...Un(w,"layout"),onPlay:A,onComplete:L};f.shouldReduceMotion&&(U.delay=0,U.type=!1),this.startAnimation(U)}else!h&&this.animationProgress===0&&this.finishAnimation(),this.isLead()&&((y=(g=this.options).onExitComplete)===null||y===void 0||y.call(g));this.targetLayout=v})}unmount(){var r,a;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),(r=this.getStack())===null||r===void 0||r.remove(this),(a=this.parent)===null||a===void 0||a.children.delete(this),this.instance=void 0,gt.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var r;return this.isAnimationBlocked||((r=this.parent)===null||r===void 0?void 0:r.isTreeAnimationBlocked())||!1}startUpdate(){var r;this.isUpdateBlocked()||(this.isUpdating=!0,(r=this.nodes)===null||r===void 0||r.forEach(cu))}willUpdate(r=!0){var a,c,l;if(this.root.isUpdateBlocked()){(c=(a=this.options).onExitComplete)===null||c===void 0||c.call(a);return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){if(this.snapshot||!this.instance)return;const r=this.measure(),a=this.removeTransform(this.removeElementScroll(r));ro(a),this.snapshot={measured:r,layout:a,latestValues:{}}}updateLayout(){var r;if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let l=0;l{var x;const g=V/1e3;no(d.x,r.x,g),no(d.y,r.y,g),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&((x=this.relativeParent)===null||x===void 0?void 0:x.layout)&&(_t(h,this.layout.actual,this.relativeParent.layout.actual),uu(this.relativeTarget,this.relativeTargetOrigin,h,g)),m&&(this.animationValues=f,Hl(f,u,this.latestValues,g,S,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=g},this.mixTargetDelta(0)}startAnimation(r){var a,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)===null||a===void 0||a.stop(),this.resumingFrom&&((c=this.resumingFrom.currentAnimation)===null||c===void 0||c.stop()),this.pendingAnimation&&(gt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=B.update(()=>{Ot.hasAnimatedSinceResize=!0,this.currentAnimation=zl(0,to,{...r,onUpdate:l=>{var u;this.mixTargetDelta(l),(u=r.onUpdate)===null||u===void 0||u.call(r,l)},onComplete:()=>{var l;(l=r.onComplete)===null||l===void 0||l.call(r),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var r;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),(r=this.getStack())===null||r===void 0||r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var r;this.currentAnimation&&((r=this.mixTargetDelta)===null||r===void 0||r.call(this,to),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=r;if(!(!a||!c||!l)){if(this!==r&&this.layout&&l&&zr(this.options.animationType,this.layout.actual,l.actual)){c=this.target||O();const f=z(this.layout.actual.x);c.x.min=r.target.x.min,c.x.max=c.x.min+f;const d=z(this.layout.actual.y);c.y.min=r.target.y.min,c.y.max=c.y.min+d}$(a,c),Tt(a,u),jt(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(r,a){var c,l,u;this.sharedNodes.has(r)||this.sharedNodes.set(r,new Zl),this.sharedNodes.get(r).add(a),a.promote({transition:(c=a.options.initialPromotionConfig)===null||c===void 0?void 0:c.transition,preserveFollowOpacity:(u=(l=a.options.initialPromotionConfig)===null||l===void 0?void 0:l.shouldPreserveFollowOpacity)===null||u===void 0?void 0:u.call(l,a)})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var r;const{layoutId:a}=this.options;return a?((r=this.getStack())===null||r===void 0?void 0:r.lead)||this:this}getPrevLead(){var r;const{layoutId:a}=this.options;return a?(r=this.getStack())===null||r===void 0?void 0:r.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const c={};for(let l=0;l{var a;return(a=r.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(eo),this.root.sharedNodes.clear()}}}function eu(t){t.updateLayout()}function nu(t){var e,n,s;const o=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{actual:i,measured:r}=t.layout,{animationType:a}=t.options;a==="size"?G(d=>{const h=o.isShared?o.measured[d]:o.layout[d],m=z(h);h.min=i[d].min,h.max=h.min+m}):zr(a,o.layout,i)&&G(d=>{const h=o.isShared?o.measured[d]:o.layout[d],m=z(i[d]);h.max=h.min+m});const c=Bt();jt(c,i,o.layout);const l=Bt();o.isShared?jt(l,t.applyTransform(r,!0),o.measured):jt(l,i,o.layout);const u=!Br(c);let f=!1;if(!t.resumeFrom&&(t.relativeParent=t.getClosestProjectingParent(),t.relativeParent&&!t.relativeParent.resumeFrom)){const{snapshot:d,layout:h}=t.relativeParent;if(d&&h){const m=O();_t(m,o.layout,d.layout);const v=O();_t(v,i,h.actual),Ur(m,v)||(f=!0)}}t.notifyListeners("didUpdate",{layout:i,snapshot:o,delta:l,layoutDelta:c,hasLayoutChanged:u,hasRelativeTargetChanged:f})}else t.isLead()&&((s=(n=t.options).onExitComplete)===null||s===void 0||s.call(n));t.options.transition=void 0}function su(t){t.clearSnapshot()}function eo(t){t.clearMeasurements()}function ou(t){const{visualElement:e}=t.options;e!=null&&e.getProps().onBeforeLayoutMeasure&&e.notifyBeforeLayoutMeasure(),t.resetTransform()}function ru(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function iu(t){t.resolveTargetDelta()}function au(t){t.calcProjection()}function cu(t){t.resetRotation()}function lu(t){t.removeLeadSnapshot()}function no(t,e,n){t.translate=M(e.translate,0,n),t.scale=M(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function so(t,e,n,s){t.min=M(e.min,n.min,s),t.max=M(e.max,n.max,s)}function uu(t,e,n,s){so(t.x,e.x,n.x,s),so(t.y,e.y,n.y,s)}function fu(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const du={duration:.45,ease:[.4,0,.1,1]};function hu(t,e){let n=t.root;for(let i=t.path.length-1;i>=0;i--)if(Boolean(t.path[i].instance)){n=t.path[i];break}const o=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);o&&t.mount(o,!0)}function oo(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function ro(t){oo(t.x),oo(t.y)}function zr(t,e,n){return t==="position"||t==="preserve-aspect"&&!ql(Zs(e),Zs(n))}const pu=Nr({attachResizeListener:(t,e)=>Ce(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ht={current:void 0},Kn=Nr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ht.current){const t=new pu(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),ht.current=t}return ht.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>Boolean(window.getComputedStyle(t).position==="fixed")}),$r={...Sr,...dr,...Rr,...Fr},Hr=So((t,e)=>Tn(t,e,$r,Yn,Kn));function Df(t){return bo(Tn(t,{forwardMotionProps:!1},$r,Yn,Kn))}const Of=So(Tn);function Wr(){const t=p.exports.useRef(!1);return pt(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function Xn(){const t=Wr(),[e,n]=p.exports.useState(0),s=p.exports.useCallback(()=>{t.current&&n(e+1)},[e]);return[p.exports.useCallback(()=>B.postRender(s),[s]),e]}class mu extends p.exports.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function gu({children:t,isPresent:e}){const n=p.exports.useId(),s=p.exports.useRef(null),o=p.exports.useRef({width:0,height:0,top:0,left:0});return p.exports.useInsertionEffect(()=>{const{width:i,height:r,top:a,left:c}=o.current;if(e||!s.current||!i||!r)return;s.current.dataset.motionPopId=n;const l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(` + [data-motion-pop-id="${n}"] { + position: absolute !important; + width: ${i}px !important; + height: ${r}px !important; + top: ${a}px !important; + left: ${c}px !important; + } + `),()=>{document.head.removeChild(l)}},[e]),k(mu,{isPresent:e,childRef:s,sizeRef:o,children:p.exports.cloneElement(t,{ref:s})})}const $e=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:o,presenceAffectsLayout:i,mode:r})=>{const a=j(yu),c=p.exports.useId(),l=p.exports.useMemo(()=>({id:c,initial:e,isPresent:n,custom:o,onExitComplete:u=>{a.set(u,!0);for(const f of a.values())if(!f)return;s&&s()},register:u=>(a.set(u,!1),()=>a.delete(u))}),i?void 0:[n]);return p.exports.useMemo(()=>{a.forEach((u,f)=>a.set(f,!1))},[n]),p.exports.useEffect(()=>{!n&&!a.size&&s&&s()},[n]),r==="popLayout"&&(t=k(gu,{isPresent:n,children:t})),k(At.Provider,{value:l,children:t})};function yu(){return new Map}const Vt=t=>t.key||"";function vu(t,e){t.forEach(n=>{const s=Vt(n);e.set(s,n)})}function xu(t){const e=[];return p.exports.Children.forEach(t,n=>{p.exports.isValidElement(n)&&e.push(n)}),e}const If=({children:t,custom:e,initial:n=!0,onExitComplete:s,exitBeforeEnter:o,presenceAffectsLayout:i=!0,mode:r="sync"})=>{o&&(r="wait",Le(!1,"Replace exitBeforeEnter with mode='wait'"));let[a]=Xn();const c=p.exports.useContext($t).forceRender;c&&(a=c);const l=Wr(),u=xu(t);let f=u;const d=new Set,h=p.exports.useRef(f),m=p.exports.useRef(new Map).current,v=p.exports.useRef(!0);if(pt(()=>{v.current=!1,vu(u,m),h.current=f}),Cn(()=>{v.current=!0,m.clear(),d.clear()}),v.current)return k(ts,{children:f.map(g=>k($e,{isPresent:!0,initial:n?void 0:!1,presenceAffectsLayout:i,mode:r,children:g},Vt(g)))});f=[...f];const S=h.current.map(Vt),V=u.map(Vt),x=S.length;for(let g=0;g{if(V.indexOf(g)!==-1)return;const y=m.get(g);if(!y)return;const w=S.indexOf(g),A=()=>{m.delete(g),d.delete(g);const L=h.current.findIndex(F=>F.key===g);if(h.current.splice(L,1),!d.size){if(h.current=u,l.current===!1)return;a(),s&&s()}};f.splice(w,0,k($e,{isPresent:!1,onExitComplete:A,custom:e,presenceAffectsLayout:i,mode:r,children:y},Vt(y)))}),f=f.map(g=>{const y=g.key;return d.has(y)?g:k($e,{isPresent:!0,presenceAffectsLayout:i,mode:r,children:g},Vt(g))}),jn!=="production"&&r==="wait"&&f.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`),k(ts,{children:d.size?f:f.map(g=>p.exports.cloneElement(g))})},bu=p.exports.createContext(null),Su=t=>!t.isLayoutDirty&&t.willUpdate(!1);function io(){const t=new Set,e=new WeakMap,n=()=>t.forEach(Su);return{add:s=>{t.add(s),e.set(s,s.addEventListener("willUpdate",n))},remove:s=>{var o;t.delete(s),(o=e.get(s))===null||o===void 0||o(),e.delete(s),n()},dirty:n}}const Gr=t=>t===!0,Vu=t=>Gr(t===!0)||t==="id",wu=({children:t,id:e,inheritId:n,inherit:s=!0})=>{n!==void 0&&(s=n);const o=p.exports.useContext($t),i=p.exports.useContext(bu),[r,a]=Xn(),c=p.exports.useRef(null),l=o.id||i;c.current===null&&(Vu(s)&&l&&(e=e?l+"-"+e:l),c.current={id:e,group:Gr(s)&&o.group||io()});const u=p.exports.useMemo(()=>({...c.current,forceRender:r}),[a]);return k($t.Provider,{value:u,children:t})};let Tu=0;const kf=({children:t})=>(p.exports.useEffect(()=>{},[]),k(wu,{id:j(()=>`asl-${Tu++}`),children:t}));function Ff({children:t,isValidProp:e,...n}){e&&Oo(e),n={...p.exports.useContext(q),...n},n.isStatic=j(()=>n.isStatic);const s=p.exports.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return k(q.Provider,{value:s,children:t})}function jf({children:t,features:e,strict:n=!1}){const[,s]=p.exports.useState(!He(e)),o=p.exports.useRef(void 0);if(!He(e)){const{renderer:i,...r}=e;o.current=i,Ge(r)}return p.exports.useEffect(()=>{He(e)&&e().then(({renderer:i,...r})=>{Ge(r),o.current=i,s(!0)})},[]),k(pn.Provider,{value:{renderer:o.current,strict:n},children:t})}function He(t){return typeof t=="function"}const Yr=p.exports.createContext(null);function Pu(t,e,n,s){if(!s)return t;const o=t.findIndex(u=>u.value===e);if(o===-1)return t;const i=s>0?1:-1,r=t[o+i];if(!r)return t;const a=t[o],c=r.layout,l=M(c.min,c.max,.5);return i===1&&a.layout.max+n>l||i===-1&&a.layout.min+nHr(e)),c=[],l=p.exports.useRef(!1),u={axis:n,registerItem:(f,d)=>{d&&c.findIndex(h=>f===h.value)===-1&&(c.push({value:f,layout:d[n]}),c.sort(Mu))},updateOrder:(f,d,h)=>{if(l.current)return;const m=Pu(c,f,d,h);c!==m&&(l.current=!0,s(m.map(Ru).filter(v=>o.indexOf(v)!==-1)))}};return p.exports.useEffect(()=>{l.current=!1}),k(a,{...i,ref:r,children:k(Yr.Provider,{value:u,children:t})})}const Au=p.exports.forwardRef(Cu);function Ru(t){return t.value}function Mu(t,e){return t.layout.min-e.layout.min}function yt(t){const e=j(()=>H(t)),{isStatic:n}=p.exports.useContext(q);if(n){const[,s]=p.exports.useState(t);p.exports.useEffect(()=>e.onChange(s),[])}return e}const Lu=t=>typeof t=="object"&&t.mix,Eu=t=>Lu(t)?t.mix:void 0;function Du(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],o=t[1+n],i=t[2+n],r=t[3+n],a=Mn(o,i,{mixer:Eu(i[0]),...r});return e?a(s):a}function Ou(t,e){pt(()=>{if(N(t))return t.onChange(e)},[e])}function Iu(t,e){pt(()=>{const n=t.map(s=>s.onChange(e));return()=>n.forEach(s=>s())})}function Kr(t,e){const n=yt(e()),s=()=>n.set(e());return s(),Iu(t,()=>B.update(s,!1,!0)),n}function fn(t,e,n,s){const o=typeof e=="function"?e:Du(e,n,s);return Array.isArray(t)?ao(t,o):ao([t],([i])=>o(i))}function ao(t,e){const n=j(()=>[]);return Kr(t,()=>{n.length=0;const s=t.length;for(let o=0;oHr(s)),l=p.exports.useContext(Yr),u={x:co(e.x),y:co(e.y)},f=fn([u.x,u.y],([S,V])=>S||V?1:"unset"),d=p.exports.useRef(null),{axis:h,registerItem:m,updateOrder:v}=l;return p.exports.useEffect(()=>{m(n,d.current)},[l]),k(c,{drag:h,...r,dragSnapToOrigin:!0,style:{...e,x:u.x,y:u.y,zIndex:f},layout:i,onDrag:(S,V)=>{const{velocity:x}=V;x[h]&&v(n,u[h].get(),x[h]),o&&o(S,V)},onLayoutMeasure:S=>{d.current=S},ref:a,children:t})}const Fu=p.exports.forwardRef(ku),_f={Group:Au,Item:Fu},ju={renderer:Yn,...Sr,...dr},Bf={...ju,...Rr,...Fr,projectionNodeConstructor:Kn};function Uf(t,...e){const n=t.length;function s(){let o="";for(let i=0;io.attach((i,r)=>n?r(i):(s.current&&s.current.stop(),s.current=kn({from:o.get(),to:i,velocity:o.getVelocity(),...e,onUpdate:r}),o.get())),[JSON.stringify(e)]),Ou(t,i=>o.set(parseFloat(i))),o}function zf(t){const e=yt(t.getVelocity());return p.exports.useEffect(()=>t.velocityUpdateSubscribers.add(n=>{e.set(n)}),[t]),e}const _u=(t,e,n)=>Math.min(Math.max(n,t),e),qn=t=>typeof t=="number",Bu=t=>Array.isArray(t)&&!qn(t[0]),Uu=(t,e,n)=>{const s=e-t;return((n-t)%s+s)%s+t};function Nu(t,e){return Bu(t)?t[Uu(0,t.length,e)]:t}const Xr=(t,e,n)=>-n*t+n*e+t,qr=t=>t,Zn=(t,e,n)=>e-t===0?1:(n-t)/(e-t);function Zr(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const o=Zn(0,e,s);t.push(Xr(n,1,o))}}function Jr(t){const e=[0];return Zr(e,t-1),e}function zu(t,e=Jr(t.length),n=qr){const s=t.length,o=s-e.length;return o>0&&Zr(e,o),i=>{let r=0;for(;rtypeof t=="function",Qr=t=>typeof t=="string";function $u(t,e){return e?t*(1e3/e):0}function ti(t,e){var n;return typeof t=="string"?e?((n=e[t])!==null&&n!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const Hu={any:0,all:1};function Wu(t,e,{root:n,margin:s,amount:o="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const i=ti(t),r=new WeakMap,a=l=>{l.forEach(u=>{const f=r.get(u.target);if(u.isIntersecting!==Boolean(f))if(u.isIntersecting){const d=e(u);Jn(d)?r.set(u.target,d):c.unobserve(u.target)}else f&&(f(u),r.delete(u.target))})},c=new IntersectionObserver(a,{root:n,rootMargin:s,threshold:typeof o=="number"?o:Hu[o]});return i.forEach(l=>c.observe(l)),()=>c.disconnect()}const ae=new WeakMap;let ot;function Gu(t,e){if(e){const{inlineSize:n,blockSize:s}=e[0];return{width:n,height:s}}else return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}function Yu({target:t,contentRect:e,borderBoxSize:n}){var s;(s=ae.get(t))===null||s===void 0||s.forEach(o=>{o({target:t,contentSize:e,get size(){return Gu(t,n)}})})}function Ku(t){t.forEach(Yu)}function Xu(){typeof ResizeObserver>"u"||(ot=new ResizeObserver(Ku))}function qu(t,e){ot||Xu();const n=ti(t);return n.forEach(s=>{let o=ae.get(s);o||(o=new Set,ae.set(s,o)),o.add(e),ot==null||ot.observe(s)}),()=>{n.forEach(s=>{const o=ae.get(s);o==null||o.delete(e),o!=null&&o.size||ot==null||ot.unobserve(s)})}}const ce=new Set;let Ut;function Zu(){Ut=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};ce.forEach(n=>n(e))},window.addEventListener("resize",Ut)}function Ju(t){return ce.add(t),Ut||Zu(),()=>{ce.delete(t),!ce.size&&Ut&&(Ut=void 0)}}function Qu(t,e){return Jn(t)?Ju(t):qu(t,e)}const tf=50,lo=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),ef=()=>({time:0,x:lo(),y:lo()}),nf={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function uo(t,e,n,s){const o=n[e],{length:i,position:r}=nf[e],a=o.current,c=n.time;o.current=t["scroll"+r],o.scrollLength=t["scroll"+i]-t["client"+i],o.offset.length=0,o.offset[0]=0,o.offset[1]=o.scrollLength,o.progress=Zn(0,o.scrollLength,o.current);const l=s-c;o.velocity=l>tf?0:$u(o.current-a,l)}function sf(t,e,n){uo(t,"x",e,n),uo(t,"y",e,n),e.time=n}function of(t,e){let n={x:0,y:0},s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if(s instanceof SVGGraphicsElement&&"getBBox"in s){const{top:o,left:i}=s.getBBox();for(n.x+=i,n.y+=o;s&&s.tagName!=="svg";)s=s.parentNode}return n}const rf={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},dn={start:0,center:.5,end:1};function fo(t,e,n=0){let s=0;if(dn[t]!==void 0&&(t=dn[t]),Qr(t)){const o=parseFloat(t);t.endsWith("px")?s=o:t.endsWith("%")?t=o/100:t.endsWith("vw")?s=o/100*document.documentElement.clientWidth:t.endsWith("vh")?s=o/100*document.documentElement.clientHeight:t=o}return qn(t)&&(s=e*t),n+s}const af=[0,0];function cf(t,e,n,s){let o=Array.isArray(t)?t:af,i=0,r=0;return qn(t)?o=[t,t]:Qr(t)&&(t=t.trim(),t.includes(" ")?o=t.split(" "):o=[t,dn[t]?t:"0"]),i=fo(o[0],n,s),r=fo(o[1],e),i-r}const lf={x:0,y:0};function uf(t,e,n){let{offset:s=rf.All}=n;const{target:o=t,axis:i="y"}=n,r=i==="y"?"height":"width",a=o!==t?of(o,t):lf,c=o===t?{width:t.scrollWidth,height:t.scrollHeight}:{width:o.clientWidth,height:o.clientHeight},l={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let u=!e[i].interpolate;const f=s.length;for(let d=0;dff(t,s.target,n),update:i=>{sf(t,n,i),(s.offset||s.target)&&uf(t,n,s)},notify:Jn(e)?()=>e(n):hf(e,n[o])}}function hf(t,e){return t.pause(),t.forEachNative((n,{easing:s})=>{var o,i;if(n.updateDuration)s||(n.easing=qr),n.updateDuration(1);else{const r={duration:1e3};s||(r.easing="linear"),(i=(o=n.effect)===null||o===void 0?void 0:o.updateTiming)===null||i===void 0||i.call(o,r)}}),()=>{t.currentTime=e.progress}}const Dt=new WeakMap,ho=new WeakMap,We=new WeakMap,po=t=>t===document.documentElement?window:t;function pf(t,e={}){var{container:n=document.documentElement}=e,s=An(e,["container"]);let o=We.get(n);o||(o=new Set,We.set(n,o));const i=ef(),r=df(n,t,i,s);if(o.add(r),!Dt.has(n)){const l=()=>{const f=performance.now();for(const d of o)d.measure();for(const d of o)d.update(f);for(const d of o)d.notify()};Dt.set(n,l);const u=po(n);window.addEventListener("resize",l,{passive:!0}),n!==document.documentElement&&ho.set(n,Qu(n,l)),u.addEventListener("scroll",l,{passive:!0})}const a=Dt.get(n),c=requestAnimationFrame(a);return()=>{var l;typeof t!="function"&&t.stop(),cancelAnimationFrame(c);const u=We.get(n);if(!u||(u.delete(r),u.size))return;const f=Dt.get(n);Dt.delete(n),f&&(po(n).removeEventListener("scroll",f),(l=ho.get(n))===null||l===void 0||l(),window.removeEventListener("resize",f))}}const mf=()=>({scrollX:H(0),scrollY:H(0),scrollXProgress:H(0),scrollYProgress:H(0)});function ei({container:t,target:e,...n}={}){const s=j(mf);return pt(()=>pf(({x:o,y:i})=>{s.scrollX.set(o.current),s.scrollXProgress.set(o.progress),s.scrollY.set(i.current),s.scrollYProgress.set(i.progress)},{...n,container:(t==null?void 0:t.current)||void 0,target:(e==null?void 0:e.current)||void 0}),[]),s}function $f(t){return Le(!1,"useElementScroll is deprecated. Convert to useScroll({ container: ref })."),ei({container:t})}function Hf(){return Le(!1,"useViewportScroll is deprecated. Convert to useScroll()."),ei()}function gf(t){const e=p.exports.useRef(0),{isStatic:n}=p.exports.useContext(q);p.exports.useEffect(()=>{if(n)return;const s=({timestamp:o})=>{e.current||(e.current=o),t(o-e.current)};return B.update(s,!0),()=>gt.update(s)},[t])}function Wf(){const t=yt(0);return gf(e=>t.set(e)),t}class yf extends mr{constructor(){super(...arguments),this.members=[],this.transforms=new Set}add(e){let n;mt.has(e)?(this.transforms.add(e),n="transform"):!e.startsWith("origin")&&!yn(e)&&e!=="willChange"&&(n=de(e)),n&&(Ee(this.members,n),this.update())}remove(e){mt.has(e)?(this.transforms.delete(e),this.transforms.size||Kt(this.members,"transform")):Kt(this.members,de(e)),this.update()}update(){this.set(this.members.length?this.members.join(", "):"auto")}}function Gf(){return j(()=>new yf("auto"))}function vf(){!Wn.current&&Mr();const[t]=p.exports.useState(Ve.current);return t}function Yf(){const t=vf(),{reducedMotion:e}=p.exports.useContext(q);return e==="never"?!1:e==="always"?!0:t}function xf(){let t=!1;const e=[],n=new Set,s={subscribe(o){return n.add(o),()=>void n.delete(o)},start(o,i){if(t){const r=[];return n.forEach(a=>{r.push($n(a,o,{transitionOverride:i}))}),Promise.all(r)}else return new Promise(r=>{e.push({animation:[o,i],resolve:r})})},set(o){return n.forEach(i=>{zc(i,o)})},stop(){n.forEach(o=>{Wc(o)})},mount(){return t=!0,e.forEach(({animation:o,resolve:i})=>{s.start(...o).then(i)}),()=>{t=!1,s.stop()}}};return s}function bf(){const t=j(xf);return p.exports.useEffect(t.mount,[]),t}const Kf=bf;function Xf(...t){const e=p.exports.useRef(0),[n,s]=p.exports.useState(t[e.current]),o=p.exports.useCallback(i=>{e.current=typeof i!="number"?nc(0,t.length,e.current+1):i,s(t[e.current])},[t.length,...t]);return[n,o]}function qf(t,{root:e,margin:n,amount:s,once:o=!1}={}){const[i,r]=p.exports.useState(!1);return p.exports.useEffect(()=>{if(!t.current||o&&i)return;const a=()=>(r(!0),o?void 0:()=>r(!1)),c={root:e&&e.current||void 0,margin:n,amount:s==="some"?"any":s};return Wu(t.current,a,c)},[e,t,n,o]),i}class Sf{constructor(){this.componentControls=new Set}subscribe(e){return this.componentControls.add(e),()=>this.componentControls.delete(e)}start(e,n){this.componentControls.forEach(s=>{s.start(e.nativeEvent||e,n)})}}const Vf=()=>new Sf;function Zf(){return j(Vf)}function wf(t){return t!==null&&typeof t=="object"&&mn in t}function Jf(t){if(wf(t))return t[mn]}function Tf(){return Pf}function Pf(t){!ht.current||(ht.current.isUpdating=!1,ht.current.blockUpdate(),t&&t())}function Qf(){const[t,e]=Xn(),n=Tf();return p.exports.useEffect(()=>{B.postRender(()=>B.postRender(()=>sn.current=!1))},[e]),s=>{n(()=>{sn.current=!0,t(),s()})}}function td(){return p.exports.useCallback(()=>{const e=ht.current;!e||e.resetTree()},[])}const hn=()=>({}),Cf=Gn({build(){},measureViewportBox:O,resetTransform(){},restoreTransform(){},removeValueFromRenderState(){},render(){},scrapeMotionValuesFromProps:hn,readValueFromInstance(t,e,n){return n.initialState[e]||0},makeTargetAnimatable(t,{transition:e,transitionEnd:n,...s}){const o=xr(s,e||{},t);return vr(t,s,o),{transition:e,transitionEnd:n,...s}}}),Af=wn({scrapeMotionValuesFromProps:hn,createRenderState:hn});function ed(t){const[e,n]=p.exports.useState(t),s=Af({},!1),o=j(()=>Cf({props:{},visualState:s},{initialState:t}));p.exports.useEffect(()=>(o.mount({}),o.unmount),[o]),p.exports.useEffect(()=>{o.setProps({onUpdate:r=>{n({...r})}})},[n,o]);const i=j(()=>r=>$n(o,r));return[e,i]}const Rf=1e5,mo=t=>t>.001?1/t:Rf;function nd(t){let e=yt(1),n=yt(1);const s=yo();t?(e=t.scaleX||e,n=t.scaleY||n):s&&(e=s.getValue("scaleX",1),n=s.getValue("scaleY",1));const o=fn(e,mo),i=fn(n,mo);return{scaleX:o,scaleY:i}}export{If as AnimatePresence,kf as AnimateSharedLayout,R as AnimationType,bu as DeprecatedLayoutGroupContext,Sf as DragControls,tu as FlatTree,wu as LayoutGroup,$t as LayoutGroupContext,jf as LazyMotion,Ff as MotionConfig,q as MotionConfigContext,we as MotionContext,mr as MotionValue,At as PresenceContext,_f as Reorder,xo as SwitchLayoutGroupContext,Pt as addPointerEvent,mi as addScaleCorrector,zl as animate,$n as animateVisualElement,xf as animationControls,Sr as animations,z as calcLength,vr as checkTargetForNewValues,O as createBox,Df as createDomMotionComponent,bo as createMotionComponent,ju as domAnimation,Bf as domMax,Bi as filterProps,vt as isBrowser,Yo as isDragActive,wf as isMotionComponent,N as isMotionValue,fe as isValidMotionProp,Of as m,wn as makeUseVisualState,Hr as motion,H as motionValue,oe as resolveMotionValue,Du as transform,Jf as unwrapMotionComponent,Kf as useAnimation,bf as useAnimationControls,gf as useAnimationFrame,Xf as useCycle,ed as useDeprecatedAnimatedState,nd as useDeprecatedInvertedScale,qe as useDomEvent,Zf as useDragControls,$f as useElementScroll,Xn as useForceUpdate,qf as useInView,Tf as useInstantLayoutTransition,Qf as useInstantTransition,Lf as useIsPresent,pt as useIsomorphicLayoutEffect,Uf as useMotionTemplate,yt as useMotionValue,hr as usePresence,vf as useReducedMotion,Yf as useReducedMotionConfig,td as useResetProjection,ei as useScroll,Nf as useSpring,Wf as useTime,fn as useTransform,Cn as useUnmountEffect,zf as useVelocity,Hf as useViewportScroll,yo as useVisualElementContext,Gf as useWillChange,Gn as visualElement,$o as wrapHandler}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.e97a91e5.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.e97a91e5.js deleted file mode 100644 index 73ddb47aa..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/index.e97a91e5.js +++ /dev/null @@ -1 +0,0 @@ -function m(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function l(e){m(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console!="undefined"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function y(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function g(e,t){m(2,arguments);var a=l(e),n=l(t),i=a.getTime()-n.getTime();return i<0?-1:i>0?1:i}function N(e,t){m(2,arguments);var a=l(e),n=l(t),i=a.getFullYear()-n.getFullYear(),r=a.getMonth()-n.getMonth();return i*12+r}function F(e,t){return m(2,arguments),l(e).getTime()-l(t).getTime()}var D={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(e){return e<0?Math.ceil(e):Math.floor(e)}},x="trunc";function k(e){return e?D[e]:D[x]}function A(e){m(1,arguments);var t=l(e);return t.setHours(23,59,59,999),t}function C(e){m(1,arguments);var t=l(e),a=t.getMonth();return t.setFullYear(t.getFullYear(),a+1,0),t.setHours(23,59,59,999),t}function X(e){m(1,arguments);var t=l(e);return A(t).getTime()===C(t).getTime()}function I(e,t){m(2,arguments);var a=l(e),n=l(t),i=g(a,n),r=Math.abs(N(a,n)),o;if(r<1)o=0;else{a.getMonth()===1&&a.getDate()>27&&a.setDate(30),a.setMonth(a.getMonth()-i*r);var s=g(a,n)===-i;X(l(e))&&r===1&&g(e,n)===1&&(s=!1),o=i*(r-Number(s))}return o===0?0:o}function O(e,t,a){m(2,arguments);var n=F(e,t)/1e3;return k(a==null?void 0:a.roundingMethod)(n)}var j={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},E=function(e,t,a){var n,i=j[e];return typeof i=="string"?n=i:t===1?n=i.one:n=i.other.replace("{{count}}",t.toString()),a!=null&&a.addSuffix?a.comparison&&a.comparison>0?"in "+n:n+" ago":n},R=E;function M(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=t.width?String(t.width):e.defaultWidth,n=e.formats[a]||e.formats[e.defaultWidth];return n}}var Y={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},_={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},z={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},L={date:M({formats:Y,defaultWidth:"full"}),time:M({formats:_,defaultWidth:"full"}),dateTime:M({formats:z,defaultWidth:"full"})},V=L,q={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},H=function(e,t,a,n){return q[e]},J=H;function c(e){return function(t,a){var n=a||{},i=n.context?String(n.context):"standalone",r;if(i==="formatting"&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,s=n.width?String(n.width):o;r=e.formattingValues[s]||e.formattingValues[o]}else{var d=e.defaultWidth,h=n.width?String(n.width):e.defaultWidth;r=e.values[h]||e.values[d]}var u=e.argumentCallback?e.argumentCallback(t):t;return r[u]}}var U={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Q={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},$={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},B={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},K={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},G={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Z=function(e,t){var a=Number(e),n=a%100;if(n>20||n<10)switch(n%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},ee={ordinalNumber:Z,era:c({values:U,defaultWidth:"wide"}),quarter:c({values:Q,defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:c({values:$,defaultWidth:"wide"}),day:c({values:B,defaultWidth:"wide"}),dayPeriod:c({values:K,defaultWidth:"wide",formattingValues:G,defaultFormattingWidth:"wide"})},te=ee;function v(e){return function(t){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=a.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],r=t.match(i);if(!r)return null;var o=r[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],d=Array.isArray(s)?ne(s,function(f){return f.test(o)}):ae(s,function(f){return f.test(o)}),h;h=e.valueCallback?e.valueCallback(d):d,h=a.valueCallback?a.valueCallback(h):h;var u=t.slice(o.length);return{value:h,rest:u}}}function ae(e,t){for(var a in e)if(e.hasOwnProperty(a)&&t(e[a]))return a}function ne(e,t){for(var a=0;a1&&arguments[1]!==void 0?arguments[1]:{},n=t.match(e.matchPattern);if(!n)return null;var i=n[0],r=t.match(e.parsePattern);if(!r)return null;var o=e.valueCallback?e.valueCallback(r[0]):r[0];o=a.valueCallback?a.valueCallback(o):o;var s=t.slice(i.length);return{value:o,rest:s}}}var ie=/^(\d+)(th|st|nd|rd)?/i,oe=/\d+/i,ue={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},se={any:[/^b/i,/^(a|c)/i]},le={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},de={any:[/1/i,/2/i,/3/i,/4/i]},fe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},me={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},he={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ce={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ve={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},ge={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},be={ordinalNumber:re({matchPattern:ie,parsePattern:oe,valueCallback:function(e){return parseInt(e,10)}}),era:v({matchPatterns:ue,defaultMatchWidth:"wide",parsePatterns:se,defaultParseWidth:"any"}),quarter:v({matchPatterns:le,defaultMatchWidth:"wide",parsePatterns:de,defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:v({matchPatterns:fe,defaultMatchWidth:"wide",parsePatterns:me,defaultParseWidth:"any"}),day:v({matchPatterns:he,defaultMatchWidth:"wide",parsePatterns:ce,defaultParseWidth:"any"}),dayPeriod:v({matchPatterns:ve,defaultMatchWidth:"any",parsePatterns:ge,defaultParseWidth:"any"})},Me=be,pe={code:"en-US",formatDistance:R,formatLong:V,formatRelative:J,localize:te,match:Me,options:{weekStartsOn:0,firstWeekContainsDate:1}},we=pe;function ye(e,t){if(e==null)throw new TypeError("assign requires that input parameter not be null or undefined");t=t||{};for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}function De(e){return ye({},e)}var P=1440,Pe=2520,p=43200,Se=86400;function Te(e,t){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};m(2,arguments);var n=a.locale||we;if(!n.formatDistance)throw new RangeError("locale must contain formatDistance property");var i=g(e,t);if(isNaN(i))throw new RangeError("Invalid time value");var r=De(a);r.addSuffix=Boolean(a.addSuffix),r.comparison=i;var o,s;i>0?(o=l(t),s=l(e)):(o=l(e),s=l(t));var d=O(s,o),h=(y(s)-y(o))/1e3,u=Math.round((d-h)/60),f;if(u<2)return a.includeSeconds?d<5?n.formatDistance("lessThanXSeconds",5,r):d<10?n.formatDistance("lessThanXSeconds",10,r):d<20?n.formatDistance("lessThanXSeconds",20,r):d<40?n.formatDistance("halfAMinute",null,r):d<60?n.formatDistance("lessThanXMinutes",1,r):n.formatDistance("xMinutes",1,r):u===0?n.formatDistance("lessThanXMinutes",1,r):n.formatDistance("xMinutes",u,r);if(u<45)return n.formatDistance("xMinutes",u,r);if(u<90)return n.formatDistance("aboutXHours",1,r);if(u=0)&&(r[a]=n[a]);return r}var U=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function ne(n,e){return!!(n===e||U(n)&&U(e))}function ae(n,e){if(n.length!==e.length)return!1;for(var r=0;r=e?n.call(null):a.id=requestAnimationFrame(i)}var a={id:requestAnimationFrame(i)};return a}var C=null;function H(n){if(n===void 0&&(n=!1),C===null||n){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var i=document.createElement("div"),a=i.style;return a.width="100px",a.height="100px",e.appendChild(i),document.body.appendChild(e),e.scrollLeft>0?C="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?C="negative":C="positive-ascending"),document.body.removeChild(e),C}return C}var le=150,ce=function(e,r){return e};function j(n){var e,r=n.getItemOffset,i=n.getEstimatedTotalSize,a=n.getItemSize,s=n.getOffsetForIndexAndAlignment,c=n.getStartIndexForOffset,u=n.getStopIndexForStartIndex,v=n.initInstanceProps,y=n.shouldResetStyleCacheOnItemSizeChange,M=n.validateProps;return e=function(x){re(p,x);function p(h){var t;return t=x.call(this,h)||this,t._instanceProps=v(t.props,k(t)),t._outerRef=void 0,t._resetIsScrollingTimeoutId=null,t.state={instance:k(t),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof t.props.initialScrollOffset=="number"?t.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},t._callOnItemsRendered=void 0,t._callOnItemsRendered=N(function(o,l,f,d){return t.props.onItemsRendered({overscanStartIndex:o,overscanStopIndex:l,visibleStartIndex:f,visibleStopIndex:d})}),t._callOnScroll=void 0,t._callOnScroll=N(function(o,l,f){return t.props.onScroll({scrollDirection:o,scrollOffset:l,scrollUpdateWasRequested:f})}),t._getItemStyle=void 0,t._getItemStyle=function(o){var l=t.props,f=l.direction,d=l.itemSize,g=l.layout,m=t._getItemStyleCache(y&&d,y&&g,y&&f),I;if(m.hasOwnProperty(o))I=m[o];else{var z=r(t.props,o,t._instanceProps),O=a(t.props,o,t._instanceProps),T=f==="horizontal"||g==="horizontal",R=f==="rtl",b=T?z:0;m[o]=I={position:"absolute",left:R?void 0:b,right:R?b:void 0,top:T?0:z,height:T?"100%":O,width:T?O:"100%"}}return I},t._getItemStyleCache=void 0,t._getItemStyleCache=N(function(o,l,f){return{}}),t._onScrollHorizontal=function(o){var l=o.currentTarget,f=l.clientWidth,d=l.scrollLeft,g=l.scrollWidth;t.setState(function(m){if(m.scrollOffset===d)return null;var I=t.props.direction,z=d;if(I==="rtl")switch(H()){case"negative":z=-d;break;case"positive-descending":z=g-f-d;break}return z=Math.max(0,Math.min(z,g-f)),{isScrolling:!0,scrollDirection:m.scrollOffset0)for(var w=ee;w<=te;w++)A.push(E.exports.createElement(o,{data:O,key:R(w,O),index:w,isScrolling:J?L:void 0,style:this._getItemStyle(w)}));var D=i(this.props,this._instanceProps);return E.exports.createElement(G||Q||"div",{className:l,onScroll:Y,ref:this._outerRefSetter,style:ie({position:"relative",height:d,width:X,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},Z)},E.exports.createElement(m||I||"div",{children:A,ref:g,style:{height:F?"100%":D,pointerEvents:L?"none":void 0,width:F?D:"100%"}}))},S._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var t=this.props.itemCount;if(t>0){var o=this._getRangeToRender(),l=o[0],f=o[1],d=o[2],g=o[3];this._callOnItemsRendered(l,f,d,g)}}if(typeof this.props.onScroll=="function"){var m=this.state,I=m.scrollDirection,z=m.scrollOffset,O=m.scrollUpdateWasRequested;this._callOnScroll(I,z,O)}},S._getRangeToRender=function(){var t=this.props,o=t.itemCount,l=t.overscanCount,f=this.state,d=f.isScrolling,g=f.scrollDirection,m=f.scrollOffset;if(o===0)return[0,0,0,0];var I=c(this.props,m,this._instanceProps),z=u(this.props,I,m,this._instanceProps),O=!d||g==="backward"?Math.max(1,l):1,T=!d||g==="forward"?Math.max(1,l):1;return[Math.max(0,I-O),Math.max(0,Math.min(o-1,z+T)),I,z]},p}(E.exports.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var ue=function(e,r){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,r.instance},fe=50,_=function(e,r,i){var a=e,s=a.itemSize,c=i.itemMetadataMap,u=i.lastMeasuredIndex;if(r>u){var v=0;if(u>=0){var y=c[u];v=y.offset+y.size}for(var M=u+1;M<=r;M++){var x=s(M);c[M]={offset:v,size:x},v+=x}i.lastMeasuredIndex=r}return c[r]},de=function(e,r,i){var a=r.itemMetadataMap,s=r.lastMeasuredIndex,c=s>0?a[s].offset:0;return c>=i?B(e,r,s,0,i):me(e,r,Math.max(0,s),i)},B=function(e,r,i,a,s){for(;a<=i;){var c=a+Math.floor((i-a)/2),u=_(e,c,r).offset;if(u===s)return c;us&&(i=c-1)}return a>0?a-1:0},me=function(e,r,i,a){for(var s=e.itemCount,c=1;i=i&&(c=i-1),c>=0){var v=a[c];u=v.offset+v.size}var y=i-c-1,M=y*s;return u+M},Se=j({getItemOffset:function(e,r,i){return _(e,r,i).offset},getItemSize:function(e,r,i){return i.itemMetadataMap[r].size},getEstimatedTotalSize:K,getOffsetForIndexAndAlignment:function(e,r,i,a,s){var c=e.direction,u=e.height,v=e.layout,y=e.width,M=c==="horizontal"||v==="horizontal",x=M?y:u,p=_(e,r,s),S=K(e,s),h=Math.max(0,Math.min(S-x,p.offset)),t=Math.max(0,p.offset-x+p.size);switch(i==="smart"&&(a>=t-x&&a<=h+x?i="auto":i="center"),i){case"start":return h;case"end":return t;case"center":return Math.round(t+(h-t)/2);case"auto":default:return a>=t&&a<=h?a:a=t-p&&a<=h+p?i="auto":i="center"),i){case"start":return h;case"end":return t;case"center":{var o=Math.round(t+(h-t)/2);return oS+Math.floor(p/2)?S:o}case"auto":default:return a>=t&&a<=h?a:a=0)&&(r[a]=n[a]);return r}function nt(n,t){n.prototype=Object.create(t.prototype),n.prototype.constructor=n,rt(n,t)}var U=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function at(n,t){return!!(n===t||U(n)&&U(t))}function ot(n,t){if(n.length!==t.length)return!1;for(var r=0;r=t?n.call(null):a.id=requestAnimationFrame(i)}var a={id:requestAnimationFrame(i)};return a}var C=null;function H(n){if(n===void 0&&(n=!1),C===null||n){var t=document.createElement("div"),r=t.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var i=document.createElement("div"),a=i.style;return a.width="100px",a.height="100px",t.appendChild(i),document.body.appendChild(t),t.scrollLeft>0?C="positive-descending":(t.scrollLeft=1,t.scrollLeft===0?C="negative":C="positive-ascending"),document.body.removeChild(t),C}return C}var ct=150,ut=function(t,r){return t};function j(n){var t,r=n.getItemOffset,i=n.getEstimatedTotalSize,a=n.getItemSize,s=n.getOffsetForIndexAndAlignment,c=n.getStartIndexForOffset,u=n.getStopIndexForStartIndex,v=n.initInstanceProps,z=n.shouldResetStyleCacheOnItemSizeChange,M=n.validateProps;return t=function(x){nt(p,x);function p(h){var e;return e=x.call(this,h)||this,e._instanceProps=v(e.props,k(e)),e._outerRef=void 0,e._resetIsScrollingTimeoutId=null,e.state={instance:k(e),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof e.props.initialScrollOffset=="number"?e.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},e._callOnItemsRendered=void 0,e._callOnItemsRendered=N(function(o,l,f,d){return e.props.onItemsRendered({overscanStartIndex:o,overscanStopIndex:l,visibleStartIndex:f,visibleStopIndex:d})}),e._callOnScroll=void 0,e._callOnScroll=N(function(o,l,f){return e.props.onScroll({scrollDirection:o,scrollOffset:l,scrollUpdateWasRequested:f})}),e._getItemStyle=void 0,e._getItemStyle=function(o){var l=e.props,f=l.direction,d=l.itemSize,g=l.layout,m=e._getItemStyleCache(z&&d,z&&g,z&&f),I;if(m.hasOwnProperty(o))I=m[o];else{var y=r(e.props,o,e._instanceProps),O=a(e.props,o,e._instanceProps),T=f==="horizontal"||g==="horizontal",R=f==="rtl",b=T?y:0;m[o]=I={position:"absolute",left:R?void 0:b,right:R?b:void 0,top:T?0:y,height:T?"100%":O,width:T?O:"100%"}}return I},e._getItemStyleCache=void 0,e._getItemStyleCache=N(function(o,l,f){return{}}),e._onScrollHorizontal=function(o){var l=o.currentTarget,f=l.clientWidth,d=l.scrollLeft,g=l.scrollWidth;e.setState(function(m){if(m.scrollOffset===d)return null;var I=e.props.direction,y=d;if(I==="rtl")switch(H()){case"negative":y=-d;break;case"positive-descending":y=g-f-d;break}return y=Math.max(0,Math.min(y,g-f)),{isScrolling:!0,scrollDirection:m.scrollOffset0)for(var w=tt;w<=et;w++)A.push(E.exports.createElement(o,{data:O,key:R(w,O),index:w,isScrolling:J?P:void 0,style:this._getItemStyle(w)}));var D=i(this.props,this._instanceProps);return E.exports.createElement(G||Q||"div",{className:l,onScroll:Y,ref:this._outerRefSetter,style:it({position:"relative",height:d,width:X,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:f},Z)},E.exports.createElement(m||I||"div",{children:A,ref:g,style:{height:F?"100%":D,pointerEvents:P?"none":void 0,width:F?D:"100%"}}))},S._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var e=this.props.itemCount;if(e>0){var o=this._getRangeToRender(),l=o[0],f=o[1],d=o[2],g=o[3];this._callOnItemsRendered(l,f,d,g)}}if(typeof this.props.onScroll=="function"){var m=this.state,I=m.scrollDirection,y=m.scrollOffset,O=m.scrollUpdateWasRequested;this._callOnScroll(I,y,O)}},S._getRangeToRender=function(){var e=this.props,o=e.itemCount,l=e.overscanCount,f=this.state,d=f.isScrolling,g=f.scrollDirection,m=f.scrollOffset;if(o===0)return[0,0,0,0];var I=c(this.props,m,this._instanceProps),y=u(this.props,I,m,this._instanceProps),O=!d||g==="backward"?Math.max(1,l):1,T=!d||g==="forward"?Math.max(1,l):1;return[Math.max(0,I-O),Math.max(0,Math.min(o-1,y+T)),I,y]},p}(E.exports.PureComponent),t.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},t}var ft=function(t,r){t.children,t.direction,t.height,t.layout,t.innerTagName,t.outerTagName,t.width,r.instance},dt=50,_=function(t,r,i){var a=t,s=a.itemSize,c=i.itemMetadataMap,u=i.lastMeasuredIndex;if(r>u){var v=0;if(u>=0){var z=c[u];v=z.offset+z.size}for(var M=u+1;M<=r;M++){var x=s(M);c[M]={offset:v,size:x},v+=x}i.lastMeasuredIndex=r}return c[r]},mt=function(t,r,i){var a=r.itemMetadataMap,s=r.lastMeasuredIndex,c=s>0?a[s].offset:0;return c>=i?B(t,r,s,0,i):ht(t,r,Math.max(0,s),i)},B=function(t,r,i,a,s){for(;a<=i;){var c=a+Math.floor((i-a)/2),u=_(t,c,r).offset;if(u===s)return c;us&&(i=c-1)}return a>0?a-1:0},ht=function(t,r,i,a){for(var s=t.itemCount,c=1;i=i&&(c=i-1),c>=0){var v=a[c];u=v.offset+v.size}var z=i-c-1,M=z*s;return u+M},It=j({getItemOffset:function(t,r,i){return _(t,r,i).offset},getItemSize:function(t,r,i){return i.itemMetadataMap[r].size},getEstimatedTotalSize:K,getOffsetForIndexAndAlignment:function(t,r,i,a,s){var c=t.direction,u=t.height,v=t.layout,z=t.width,M=c==="horizontal"||v==="horizontal",x=M?z:u,p=_(t,r,s),S=K(t,s),h=Math.max(0,Math.min(S-x,p.offset)),e=Math.max(0,p.offset-x+p.size);switch(i==="smart"&&(a>=e-x&&a<=h+x?i="auto":i="center"),i){case"start":return h;case"end":return e;case"center":return Math.round(e+(h-e)/2);case"auto":default:return a>=e&&a<=h?a:a=e-p&&a<=h+p?i="auto":i="center"),i){case"start":return h;case"end":return e;case"center":{var o=Math.round(e+(h-e)/2);return oS+Math.floor(p/2)?S:o}case"auto":default:return a>=e&&a<=h?a:at in e?$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t)=>{for(var n in t||(t={}))E.call(t,n)&&S(e,n,t[n]);if(h)for(var n of h(t))A.call(t,n)&&S(e,n,t[n]);return e},v=(e,t)=>k(e,y(t));import{A as O,D as R,E as u}from"./index.5901d226.js";const L="/logs",x=new TextDecoder("utf-8"),F=()=>Math.floor((1+Math.random())*65536).toString(16);let p=!1,i=!1,f="",s,g;function m(e,t){let n;try{n=JSON.parse(e)}catch{console.log("JSON.parse error",JSON.parse(e))}const r=new Date,l=H(r);n.time=l,n.id=+r-0+F(),n.even=p=!p,t(n)}function H(e){const t=e.getFullYear()%100,n=u(e.getMonth()+1,2),r=u(e.getDate(),2),l=u(e.getHours(),2),o=u(e.getMinutes(),2),c=u(e.getSeconds(),2);return`${t}-${n}-${r} ${l}:${o}:${c}`}function M(e,t){return e.read().then(({done:n,value:r})=>{f+=x.decode(r,{stream:!n});const o=f.split(` -`),c=o[o.length-1];for(let d=0;de[n]).join("|")}let w,a;function J(e,t){if(e.logLevel==="uninit"||i||s&&s.readyState===1)return;g=t;const n=O(e,L);s=new WebSocket(n),s.addEventListener("error",()=>{N(e,t)}),s.addEventListener("message",function(r){m(r.data,t)})}function Y(){s.close(),a&&a.abort()}function j(e){!g||!s||(s.close(),i=!1,J(e,g))}function N(e,t){if(a&&D(e)!==w)a.abort();else if(i)return;i=!0,w=D(e),a=new AbortController;const n=a.signal,{url:r,init:l}=R(e);fetch(r+L+"?level="+e.logLevel,v(b({},l),{signal:n})).then(o=>{const c=o.body.getReader();M(c,t)},o=>{i=!1,!n.aborted&&console.log("GET /logs error:",o.message)})}export{J as f,j as r,Y as s}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/logs.e4cdcb93.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/logs.e4cdcb93.js new file mode 100644 index 000000000..d3e51abd0 --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/logs.e4cdcb93.js @@ -0,0 +1,2 @@ +import{D,E as w,G as u}from"./index.2addc377.js";const v="/logs",L=new TextDecoder("utf-8"),M=()=>Math.floor((1+Math.random())*65536).toString(16);let h=!1,i=!1,f="",s,g;function m(e,n){let t;try{t=JSON.parse(e)}catch{console.log("JSON.parse error",JSON.parse(e))}const r=new Date,l=$(r);t.time=l,t.id=+r-0+M(),t.even=h=!h,n(t)}function $(e){const n=e.getFullYear()%100,t=u(e.getMonth()+1,2),r=u(e.getDate(),2),l=u(e.getHours(),2),o=u(e.getMinutes(),2),c=u(e.getSeconds(),2);return`${n}-${t}-${r} ${l}:${o}:${c}`}function p(e,n){return e.read().then(({done:t,value:r})=>{f+=L.decode(r,{stream:!t});const o=f.split(` +`),c=o[o.length-1];for(let d=0;de[t]).join("|")}let b,a;function k(e,n){if(e.logLevel==="uninit"||i||s&&s.readyState===1)return;g=n;const t=D(e,v);s=new WebSocket(t),s.addEventListener("error",()=>{y(e,n)}),s.addEventListener("message",function(r){m(r.data,n)})}function O(){s.close(),a&&a.abort()}function R(e){!g||!s||(s.close(),i=!1,k(e,g))}function y(e,n){if(a&&S(e)!==b)a.abort();else if(i)return;i=!0,b=S(e),a=new AbortController;const t=a.signal,{url:r,init:l}=w(e);fetch(r+v+"?level="+e.logLevel,{...l,signal:t}).then(o=>{const c=o.body.getReader();p(c,n)},o=>{i=!1,!t.aborted&&console.log("GET /logs error:",o.message)})}export{k as f,R as r,O as s}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/play.56145bca.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/play.56145bca.js deleted file mode 100644 index 9cf8ca5dc..000000000 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/play.56145bca.js +++ /dev/null @@ -1 +0,0 @@ -var h=Object.defineProperty,d=Object.defineProperties;var w=Object.getOwnPropertyDescriptors;var y=Object.getOwnPropertySymbols;var b=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable;var v=(e,t,r)=>t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,p=(e,t)=>{for(var r in t||(t={}))b.call(t,r)&&v(e,r,t[r]);if(y)for(var r of y(t))O.call(t,r)&&v(e,r,t[r]);return e},f=(e,t)=>d(e,w(t));import{r as g,b as j,j as a,P as s}from"./index.5901d226.js";function P(e,t){if(e==null)return{};var r=k(e,t),i,o;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}function k(e,t){if(e==null)return{};var r={},i=Object.keys(e),o,n;for(n=0;n=0)&&(r[o]=e[o]);return r}var c=g.exports.forwardRef(function(e,t){var r=e.color,i=r===void 0?"currentColor":r,o=e.size,n=o===void 0?24:o,l=P(e,["color","size"]);return j("svg",f(p({ref:t,xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),{children:[a("rect",{x:"6",y:"4",width:"4",height:"16"}),a("rect",{x:"14",y:"4",width:"4",height:"16"})]}))});c.propTypes={color:s.string,size:s.oneOfType([s.string,s.number])};c.displayName="Pause";var L=c;function x(e,t){if(e==null)return{};var r=m(e,t),i,o;if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&(!Object.prototype.propertyIsEnumerable.call(e,i)||(r[i]=e[i]))}return r}function m(e,t){if(e==null)return{};var r={},i=Object.keys(e),o,n;for(n=0;n=0)&&(r[o]=e[o]);return r}var u=g.exports.forwardRef(function(e,t){var r=e.color,i=r===void 0?"currentColor":r,o=e.size,n=o===void 0?24:o,l=x(e,["color","size"]);return a("svg",f(p({ref:t,xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:i,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},l),{children:a("polygon",{points:"5 3 19 12 5 21 5 3"})}))});u.propTypes={color:s.string,size:s.oneOfType([s.string,s.number])};u.displayName="Play";var W=u;export{W as P,L as a}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/play.f2fb5ccc.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/play.f2fb5ccc.js new file mode 100644 index 000000000..d946ddf54 --- /dev/null +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/play.f2fb5ccc.js @@ -0,0 +1 @@ +import{r as c,b as u,j as p,i as s}from"./index.2addc377.js";function y(e,n){if(e==null)return{};var i=g(e,n),t,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&(!Object.prototype.propertyIsEnumerable.call(e,t)||(i[t]=e[t]))}return i}function g(e,n){if(e==null)return{};var i={},t=Object.keys(e),r,o;for(o=0;o=0)&&(i[r]=e[r]);return i}var l=c.exports.forwardRef(function(e,n){var i=e.color,t=i===void 0?"currentColor":i,r=e.size,o=r===void 0?24:r,a=y(e,["color","size"]);return u("svg",{ref:n,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:[p("rect",{x:"6",y:"4",width:"4",height:"16"}),p("rect",{x:"14",y:"4",width:"4",height:"16"})]})});l.propTypes={color:s.exports.string,size:s.exports.oneOfType([s.exports.string,s.exports.number])};l.displayName="Pause";const d=l;function h(e,n){if(e==null)return{};var i=v(e,n),t,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&(!Object.prototype.propertyIsEnumerable.call(e,t)||(i[t]=e[t]))}return i}function v(e,n){if(e==null)return{};var i={},t=Object.keys(e),r,o;for(o=0;o=0)&&(i[r]=e[r]);return i}var f=c.exports.forwardRef(function(e,n){var i=e.color,t=i===void 0?"currentColor":i,r=e.size,o=r===void 0?24:r,a=h(e,["color","size"]);return p("svg",{ref:n,xmlns:"http://www.w3.org/2000/svg",width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...a,children:p("polygon",{points:"5 3 19 12 5 21 5 3"})})});f.propTypes={color:s.exports.string,size:s.exports.oneOfType([s.exports.string,s.exports.number])};f.displayName="Play";const w=f;export{w as P,d as a}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/roboto-mono-latin-400-normal.7295944e.woff2 b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/roboto-mono-latin-400-normal.7295944e.woff2 new file mode 100644 index 000000000..f8894bab5 Binary files /dev/null and b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/roboto-mono-latin-400-normal.7295944e.woff2 differ diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/roboto-mono-latin-400-normal.2dfc0e86.woff b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/roboto-mono-latin-400-normal.dffdffa7.woff similarity index 97% rename from luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/roboto-mono-latin-400-normal.2dfc0e86.woff rename to luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/roboto-mono-latin-400-normal.dffdffa7.woff index f319fbfa4..be3eb4c4c 100644 Binary files a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/roboto-mono-latin-400-normal.2dfc0e86.woff and b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/roboto-mono-latin-400-normal.dffdffa7.woff differ diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/roboto-mono-latin-400-normal.e1fd013a.woff2 b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/roboto-mono-latin-400-normal.e1fd013a.woff2 deleted file mode 100644 index ed384d22f..000000000 Binary files a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/roboto-mono-latin-400-normal.e1fd013a.woff2 and /dev/null differ diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/useRemainingViewPortHeight.d051faee.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/useRemainingViewPortHeight.4e5a0898.js similarity index 81% rename from luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/useRemainingViewPortHeight.d051faee.js rename to luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/useRemainingViewPortHeight.4e5a0898.js index bd270a7a7..2f7241cc0 100644 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/useRemainingViewPortHeight.d051faee.js +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/assets/useRemainingViewPortHeight.4e5a0898.js @@ -1 +1 @@ -import{h as r}from"./index.5901d226.js";const{useState:s,useRef:u,useCallback:a,useLayoutEffect:c}=r;function d(){const t=u(null),[n,i]=s(200),e=a(()=>{const{top:o}=t.current.getBoundingClientRect();i(window.innerHeight-o)},[]);return c(()=>(e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}),[e]),[t,n]}export{d as u}; +import{h as r}from"./index.2addc377.js";const{useState:s,useRef:u,useCallback:a,useLayoutEffect:c}=r;function d(){const t=u(null),[n,i]=s(200),e=a(()=>{const{top:o}=t.current.getBoundingClientRect();i(window.innerHeight-o)},[]);return c(()=>(e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}),[e]),[t,n]}export{d as u}; diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/index.html b/luci-app-openclash/root/usr/share/openclash/ui/yacd/index.html index 13d5136f3..ceb4b968b 100644 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/index.html +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/index.html @@ -7,14 +7,16 @@ + + yacd - - - + + +
diff --git a/luci-app-openclash/root/usr/share/openclash/ui/yacd/sw.js b/luci-app-openclash/root/usr/share/openclash/ui/yacd/sw.js index adfa1bbc3..d71344cbd 100644 --- a/luci-app-openclash/root/usr/share/openclash/ui/yacd/sw.js +++ b/luci-app-openclash/root/usr/share/openclash/ui/yacd/sw.js @@ -1,2 +1,2 @@ -var X=Object.defineProperty,Y=Object.defineProperties;var Z=Object.getOwnPropertyDescriptors;var A=Object.getOwnPropertySymbols;var ee=Object.prototype.hasOwnProperty,te=Object.prototype.propertyIsEnumerable;var v=(s,e,t)=>e in s?X(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,O=(s,e)=>{for(var t in e||(e={}))ee.call(e,t)&&v(s,t,e[t]);if(A)for(var t of A(e))te.call(e,t)&&v(s,t,e[t]);return s},S=(s,e)=>Y(s,Z(e));try{self["workbox:core:6.5.2"]&&_()}catch{}const se=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},ne=se;class l extends Error{constructor(e,t){const n=ne(e,t);super(n),this.name=e,this.details=t}}const V=new Set;function ae(s){V.add(s)}const d={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration!="undefined"?registration.scope:""},E=s=>[d.prefix,s,d.suffix].filter(e=>e&&e.length>0).join("-"),re=s=>{for(const e of Object.keys(d))s(e)},x={updateDetails:s=>{re(e=>{typeof s[e]=="string"&&(d[e]=s[e])})},getGoogleAnalyticsName:s=>s||E(d.googleAnalytics),getPrecacheName:s=>s||E(d.precache),getPrefix:()=>d.prefix,getRuntimeName:s=>s||E(d.runtime),getSuffix:()=>d.suffix};function W(s,e){const t=new URL(s);for(const n of e)t.searchParams.delete(n);return t.href}async function ie(s,e,t,n){const a=W(e.url,t);if(e.url===a)return s.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await s.keys(e,r);for(const c of i){const o=W(c.url,t);if(a===o)return s.match(c,n)}}let m;function ce(){if(m===void 0){const s=new Response("");if("body"in s)try{new Response(s.body),m=!0}catch{m=!1}m=!1}return m}function $(s){s.then(()=>{})}class oe{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}async function he(){for(const s of V)await s()}const le=s=>new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),"");function ue(s){return new Promise(e=>setTimeout(e,s))}function B(s,e){const t=e();return s.waitUntil(t),t}async function de(s,e){let t=null;if(s.url&&(t=new URL(s.url).origin),t!==self.location.origin)throw new l("cross-origin-copy-response",{origin:t});const n=s.clone(),a={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},r=e?e(a):a,i=ce()?n.body:await n.blob();return new Response(i,r)}function fe(){self.addEventListener("activate",()=>self.clients.claim())}const pe=(s,e)=>e.some(t=>s instanceof t);let j,q;function ge(){return j||(j=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function me(){return q||(q=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const G=new WeakMap,P=new WeakMap,Q=new WeakMap,D=new WeakMap,I=new WeakMap;function ye(s){const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("success",r),s.removeEventListener("error",i)},r=()=>{t(f(s.result)),a()},i=()=>{n(s.error),a()};s.addEventListener("success",r),s.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&G.set(t,s)}).catch(()=>{}),I.set(e,s),e}function we(s){if(P.has(s))return;const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("complete",r),s.removeEventListener("error",i),s.removeEventListener("abort",i)},r=()=>{t(),a()},i=()=>{n(s.error||new DOMException("AbortError","AbortError")),a()};s.addEventListener("complete",r),s.addEventListener("error",i),s.addEventListener("abort",i)});P.set(s,e)}let k={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return P.get(s);if(e==="objectStoreNames")return s.objectStoreNames||Q.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return f(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function _e(s){k=s(k)}function Re(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const n=s.call(L(this),e,...t);return Q.set(n,e.sort?e.sort():[e]),f(n)}:me().includes(s)?function(...e){return s.apply(L(this),e),f(G.get(this))}:function(...e){return f(s.apply(L(this),e))}}function be(s){return typeof s=="function"?Re(s):(s instanceof IDBTransaction&&we(s),pe(s,ge())?new Proxy(s,k):s)}function f(s){if(s instanceof IDBRequest)return ye(s);if(D.has(s))return D.get(s);const e=be(s);return e!==s&&(D.set(s,e),I.set(e,s)),e}const L=s=>I.get(s);function Ce(s,e,{blocked:t,upgrade:n,blocking:a,terminated:r}={}){const i=indexedDB.open(s,e),c=f(i);return n&&i.addEventListener("upgradeneeded",o=>{n(f(i.result),o.oldVersion,o.newVersion,f(i.transaction))}),t&&i.addEventListener("blocked",()=>t()),c.then(o=>{r&&o.addEventListener("close",()=>r()),a&&o.addEventListener("versionchange",()=>a())}).catch(()=>{}),c}function xe(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",()=>e()),f(t).then(()=>{})}const Ee=["get","getKey","getAll","getAllKeys","count"],De=["put","add","delete","clear"],U=new Map;function F(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(U.get(e))return U.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,a=De.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||Ee.includes(t)))return;const r=async function(i,...c){const o=this.transaction(i,a?"readwrite":"readonly");let h=o.store;return n&&(h=h.index(c.shift())),(await Promise.all([h[t](...c),a&&o.done]))[0]};return U.set(e,r),r}_e(s=>S(O({},s),{get:(e,t,n)=>F(e,t)||s.get(e,t,n),has:(e,t)=>!!F(e,t)||s.has(e,t)}));try{self["workbox:expiration:6.5.2"]&&_()}catch{}const Le="workbox-expiration",y="cache-entries",H=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class Ue{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(y,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&xe(this._cacheName)}async setTimestamp(e,t){e=H(e);const n={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},r=(await this.getDb()).transaction(y,"readwrite",{durability:"relaxed"});await r.store.put(n),await r.done}async getTimestamp(e){const n=await(await this.getDb()).get(y,this._getId(e));return n==null?void 0:n.timestamp}async expireEntries(e,t){const n=await this.getDb();let a=await n.transaction(y).store.index("timestamp").openCursor(null,"prev");const r=[];let i=0;for(;a;){const o=a.value;o.cacheName===this._cacheName&&(e&&o.timestamp=t?r.push(a.value):i++),a=await a.continue()}const c=[];for(const o of r)await n.delete(y,o.id),c.push(o.url);return c}_getId(e){return this._cacheName+"|"+H(e)}async getDb(){return this._db||(this._db=await Ce(Le,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class Te{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new Ue(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),n=await self.caches.open(this._cacheName);for(const a of t)await n.delete(a,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,$(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),n=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t{if(!r)return null;const i=this._isResponseDateFresh(r),c=this._getCacheExpiration(a);$(c.expireEntries());const o=c.updateTimestamp(n.url);if(t)try{t.waitUntil(o)}catch{}return i?r:null},this.cacheDidUpdate=async({cacheName:t,request:n})=>{const a=this._getCacheExpiration(t);await a.updateTimestamp(n.url),await a.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&ae(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===x.getRuntimeName())throw new l("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new Te(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const n=Date.now();return t>=n-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),a=new Date(t).getTime();return isNaN(a)?null:a}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}try{self["workbox:precaching:6.5.2"]&&_()}catch{}const ke="__WB_REVISION__";function Ie(s){if(!s)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(typeof s=="string"){const r=new URL(s,location.href);return{cacheKey:r.href,url:r.href}}const{revision:e,url:t}=s;if(!t)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(!e){const r=new URL(t,location.href);return{cacheKey:r.href,url:r.href}}const n=new URL(t,location.href),a=new URL(t,location.href);return n.searchParams.set(ke,e),{cacheKey:n.href,url:a.href}}class Me{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const a=t.originalRequest.url;n?this.notUpdatedURLs.push(a):this.updatedURLs.push(a)}return n}}}class Ne{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:n})=>{const a=(n==null?void 0:n.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return a?new Request(a,{headers:t.headers}):t},this._precacheController=e}}try{self["workbox:strategies:6.5.2"]&&_()}catch{}function b(s){return typeof s=="string"?new Request(s):s}class Ke{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new oe,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let n=b(e);if(n.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const i=await t.preloadResponse;if(i)return i}const a=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const i of this.iterateCallbacks("requestWillFetch"))n=await i({request:n.clone(),event:t})}catch(i){if(i instanceof Error)throw new l("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=n.clone();try{let i;i=await fetch(n,n.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const c of this.iterateCallbacks("fetchDidSucceed"))i=await c({event:t,request:r,response:i});return i}catch(i){throw a&&await this.runCallbacks("fetchDidFail",{error:i,event:t,originalRequest:a.clone(),request:r.clone()}),i}}async fetchAndCachePut(e){const t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){const t=b(e);let n;const{cacheName:a,matchOptions:r}=this._strategy,i=await this.getCacheKey(t,"read"),c=Object.assign(Object.assign({},r),{cacheName:a});n=await caches.match(i,c);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await o({cacheName:a,matchOptions:r,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(e,t){const n=b(e);await ue(0);const a=await this.getCacheKey(n,"write");if(!t)throw new l("cache-put-with-no-response",{url:le(a.url)});const r=await this._ensureResponseSafeToCache(t);if(!r)return!1;const{cacheName:i,matchOptions:c}=this._strategy,o=await self.caches.open(i),h=this.hasCallback("cacheDidUpdate"),g=h?await ie(o,a.clone(),["__WB_REVISION__"],c):null;try{await o.put(a,h?r.clone():r)}catch(u){if(u instanceof Error)throw u.name==="QuotaExceededError"&&await he(),u}for(const u of this.iterateCallbacks("cacheDidUpdate"))await u({cacheName:i,oldResponse:g,newResponse:r.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){const n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let a=e;for(const r of this.iterateCallbacks("cacheKeyWillBeUsed"))a=b(await r({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[n]=a}return this._cacheKeys[n]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const n=this._pluginStateMap.get(t);yield r=>{const i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(const a of this.iterateCallbacks("cacheWillUpdate"))if(t=await a({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}}class z{constructor(e={}){this.cacheName=x.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,n=typeof e.request=="string"?new Request(e.request):e.request,a="params"in e?e.params:void 0,r=new Ke(this,{event:t,request:n,params:a}),i=this._getResponse(r,n,t),c=this._awaitComplete(i,r,n,t);return[i,c]}async _getResponse(e,t,n){await e.runCallbacks("handlerWillStart",{event:n,request:t});let a;try{if(a=await this._handle(t,e),!a||a.type==="error")throw new l("no-response",{url:t.url})}catch(r){if(r instanceof Error){for(const i of e.iterateCallbacks("handlerDidError"))if(a=await i({error:r,event:n,request:t}),a)break}if(!a)throw r}for(const r of e.iterateCallbacks("handlerWillRespond"))a=await r({event:n,request:t,response:a});return a}async _awaitComplete(e,t,n,a){let r,i;try{r=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:a,request:n,response:r}),await t.doneWaiting()}catch(c){c instanceof Error&&(i=c)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:n,response:r,error:i}),t.destroy(),i)throw i}}class p extends z{constructor(e={}){e.cacheName=x.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(p.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const n=await t.cacheMatch(e);return n||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let n;const a=t.params||{};if(this._fallbackToNetwork){const r=a.integrity,i=e.integrity,c=!i||i===r;n=await t.fetch(new Request(e,{integrity:i||r})),r&&c&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,n.clone()))}else throw new l("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return n}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const n=await t.fetch(e);if(!await t.cachePut(e,n.clone()))throw new l("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[n,a]of this.plugins.entries())a!==p.copyRedirectedCacheableResponsesPlugin&&(a===p.defaultPrecacheCacheabilityPlugin&&(e=n),a.cacheWillUpdate&&t++);t===0?this.plugins.push(p.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}p.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:s}){return!s||s.status>=400?null:s}};p.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:s}){return s.redirected?await de(s):s}};class Ae{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new p({cacheName:x.getPrecacheName(e),plugins:[...t,new Ne({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const t=[];for(const n of e){typeof n=="string"?t.push(n):n&&n.revision===void 0&&t.push(n.url);const{cacheKey:a,url:r}=Ie(n),i=typeof n!="string"&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(r)&&this._urlsToCacheKeys.get(r)!==a)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(r),secondEntry:a});if(typeof n!="string"&&n.integrity){if(this._cacheKeysToIntegrities.has(a)&&this._cacheKeysToIntegrities.get(a)!==n.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:r});this._cacheKeysToIntegrities.set(a,n.integrity)}if(this._urlsToCacheKeys.set(r,a),this._urlsToCacheModes.set(r,i),t.length>0){const c=`Workbox is precaching URLs without revision info: ${t.join(", ")} -This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return B(e,async()=>{const t=new Me;this.strategy.plugins.push(t);for(const[r,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:h,event:e}))}const{updatedURLs:n,notUpdatedURLs:a}=t;return{updatedURLs:n,notUpdatedURLs:a}})}activate(e){return B(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),r=[];for(const i of n)a.has(i.url)||(await t.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let T;const M=()=>(T||(T=new Ae),T);try{self["workbox:routing:6.5.2"]&&_()}catch{}const J="GET",C=s=>s&&typeof s=="object"?s:{handle:s};class R{constructor(e,t,n=J){this.handler=C(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=C(e)}}class ve extends R{constructor(e,t,n){const a=({url:r})=>{const i=e.exec(r.href);if(!!i&&!(r.origin!==location.origin&&i.index!==0))return i.slice(1)};super(a,t,n)}}class Oe{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const r=new Request(...a);return this.handleRequest({request:r,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let h;try{h=c.handle({url:n,request:e,event:t,params:r})}catch(u){h=Promise.reject(u)}const g=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||g)&&(h=h.catch(async u=>{if(g)try{return await g.handle({url:n,request:e,event:t,params:r})}catch(K){K instanceof Error&&(u=K)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:n,event:a}){const r=this._routes.get(n.method)||[];for(const i of r){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=J){this._defaultHandlerMap.set(t,C(e))}setCatchHandler(e){this._catchHandler=C(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let w;const Se=()=>(w||(w=new Oe,w.addFetchListener(),w.addCacheListener()),w);function N(s,e,t){let n;if(typeof s=="string"){const r=new URL(s,location.href),i=({url:c})=>c.href===r.href;n=new R(i,e,t)}else if(s instanceof RegExp)n=new ve(s,e,t);else if(typeof s=="function")n=new R(s,e,t);else if(s instanceof R)n=s;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return Se().registerRoute(n),n}function We(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*Be(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(s,location.href);r.hash="",yield r.href;const i=We(r,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:r});for(const o of c)yield o.href}}class je extends R{constructor(e,t){const n=({request:a})=>{const r=e.getURLsToCacheKeys();for(const i of Be(a.url,t)){const c=r.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function qe(s){const e=M(),t=new je(e,s);N(t)}function Fe(s){return M().createHandlerBoundToURL(s)}function He(s){M().precache(s)}function Ve(s,e){He(s),qe(e)}const $e={cacheWillUpdate:async({response:s})=>s.status===200||s.status===0?s:null};class Ge extends z{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift($e)}async _handle(e,t){const n=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(n);let a=await t.cacheMatch(e),r;if(!a)try{a=await n}catch(i){i instanceof Error&&(r=i)}if(!a)throw new l("no-response",{url:e.url,error:r});return a}}fe();Ve([{"revision":null,"url":"assets/chart-lib.ff648d51.js"},{"revision":null,"url":"assets/chevron-down.e7f05dbc.js"},{"revision":null,"url":"assets/Config.58870520.css"},{"revision":null,"url":"assets/Config.6828b15b.js"},{"revision":null,"url":"assets/Connections.57d57b9f.js"},{"revision":null,"url":"assets/Connections.c7e8fa7e.css"},{"revision":null,"url":"assets/debounce.d080d5e1.js"},{"revision":null,"url":"assets/en.fb34eaf7.js"},{"revision":null,"url":"assets/Fab.33a60e0e.css"},{"revision":null,"url":"assets/Fab.93225453.js"},{"revision":null,"url":"assets/index.0e7e7dfd.css"},{"revision":null,"url":"assets/index.5901d226.js"},{"revision":null,"url":"assets/index.8c82c89a.js"},{"revision":null,"url":"assets/index.e97a91e5.js"},{"revision":null,"url":"assets/index.esm.390d1b7a.js"},{"revision":null,"url":"assets/Logs.029b1e0c.css"},{"revision":null,"url":"assets/Logs.285710c1.js"},{"revision":null,"url":"assets/logs.36f1d416.js"},{"revision":null,"url":"assets/play.56145bca.js"},{"revision":null,"url":"assets/Proxies.2359f6a1.js"},{"revision":null,"url":"assets/Proxies.db2d4119.css"},{"revision":null,"url":"assets/Rules.2fdbf529.js"},{"revision":null,"url":"assets/Rules.faccd448.css"},{"revision":null,"url":"assets/Select.aace7191.css"},{"revision":null,"url":"assets/Select.f72e6abf.js"},{"revision":null,"url":"assets/TextFitler.3d9182a0.css"},{"revision":null,"url":"assets/TextFitler.f9fb92be.js"},{"revision":null,"url":"assets/useRemainingViewPortHeight.d051faee.js"},{"revision":null,"url":"assets/zh.9b79b7bf.js"},{"revision":"e31a7dbf43bf24c2aa5866f72be34248","url":"index.html"},{"revision":"402b66900e731ca748771b6fc5e7a068","url":"registerSW.js"},{"revision":"c0f9cb6aaf647e778bdc01c59944755b","url":"manifest.webmanifest"}]);const Qe=new RegExp("/[^/?]+\\.[^/]+$");N(({request:s,url:e})=>!(s.mode!=="navigate"||e.pathname.startsWith("/_")||e.pathname.match(Qe)),Fe("index.html"));N(({url:s})=>s.origin===self.location.origin&&s.pathname.endsWith(".png"),new Ge({cacheName:"images",plugins:[new Pe({maxEntries:50})]}));self.addEventListener("message",s=>{s.data&&s.data.type==="SKIP_WAITING"&&self.skipWaiting()}); +try{self["workbox:core:6.5.3"]&&_()}catch{}const G=(s,...e)=>{let t=s;return e.length>0&&(t+=` :: ${JSON.stringify(e)}`),t},Q=G;class l extends Error{constructor(e,t){const n=Q(e,t);super(n),this.name=e,this.details=t}}const j=new Set;function z(s){j.add(s)}const d={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:typeof registration<"u"?registration.scope:""},E=s=>[d.prefix,s,d.suffix].filter(e=>e&&e.length>0).join("-"),J=s=>{for(const e of Object.keys(d))s(e)},x={updateDetails:s=>{J(e=>{typeof s[e]=="string"&&(d[e]=s[e])})},getGoogleAnalyticsName:s=>s||E(d.googleAnalytics),getPrecacheName:s=>s||E(d.precache),getPrefix:()=>d.prefix,getRuntimeName:s=>s||E(d.runtime),getSuffix:()=>d.suffix};function A(s,e){const t=new URL(s);for(const n of e)t.searchParams.delete(n);return t.href}async function X(s,e,t,n){const a=A(e.url,t);if(e.url===a)return s.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),i=await s.keys(e,r);for(const c of i){const o=A(c.url,t);if(a===o)return s.match(c,n)}}let m;function Y(){if(m===void 0){const s=new Response("");if("body"in s)try{new Response(s.body),m=!0}catch{m=!1}m=!1}return m}function q(s){s.then(()=>{})}class Z{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}async function ee(){for(const s of j)await s()}const te=s=>new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),"");function se(s){return new Promise(e=>setTimeout(e,s))}function v(s,e){const t=e();return s.waitUntil(t),t}async function ne(s,e){let t=null;if(s.url&&(t=new URL(s.url).origin),t!==self.location.origin)throw new l("cross-origin-copy-response",{origin:t});const n=s.clone(),a={headers:new Headers(n.headers),status:n.status,statusText:n.statusText},r=e?e(a):a,i=Y()?n.body:await n.blob();return new Response(i,r)}function ae(){self.addEventListener("activate",()=>self.clients.claim())}const re=(s,e)=>e.some(t=>s instanceof t);let O,S;function ie(){return O||(O=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function ce(){return S||(S=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const F=new WeakMap,P=new WeakMap,H=new WeakMap,D=new WeakMap,I=new WeakMap;function oe(s){const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("success",r),s.removeEventListener("error",i)},r=()=>{t(f(s.result)),a()},i=()=>{n(s.error),a()};s.addEventListener("success",r),s.addEventListener("error",i)});return e.then(t=>{t instanceof IDBCursor&&F.set(t,s)}).catch(()=>{}),I.set(e,s),e}function he(s){if(P.has(s))return;const e=new Promise((t,n)=>{const a=()=>{s.removeEventListener("complete",r),s.removeEventListener("error",i),s.removeEventListener("abort",i)},r=()=>{t(),a()},i=()=>{n(s.error||new DOMException("AbortError","AbortError")),a()};s.addEventListener("complete",r),s.addEventListener("error",i),s.addEventListener("abort",i)});P.set(s,e)}let k={get(s,e,t){if(s instanceof IDBTransaction){if(e==="done")return P.get(s);if(e==="objectStoreNames")return s.objectStoreNames||H.get(s);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return f(s[e])},set(s,e,t){return s[e]=t,!0},has(s,e){return s instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in s}};function le(s){k=s(k)}function ue(s){return s===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const n=s.call(L(this),e,...t);return H.set(n,e.sort?e.sort():[e]),f(n)}:ce().includes(s)?function(...e){return s.apply(L(this),e),f(F.get(this))}:function(...e){return f(s.apply(L(this),e))}}function de(s){return typeof s=="function"?ue(s):(s instanceof IDBTransaction&&he(s),re(s,ie())?new Proxy(s,k):s)}function f(s){if(s instanceof IDBRequest)return oe(s);if(D.has(s))return D.get(s);const e=de(s);return e!==s&&(D.set(s,e),I.set(e,s)),e}const L=s=>I.get(s);function fe(s,e,{blocked:t,upgrade:n,blocking:a,terminated:r}={}){const i=indexedDB.open(s,e),c=f(i);return n&&i.addEventListener("upgradeneeded",o=>{n(f(i.result),o.oldVersion,o.newVersion,f(i.transaction))}),t&&i.addEventListener("blocked",()=>t()),c.then(o=>{r&&o.addEventListener("close",()=>r()),a&&o.addEventListener("versionchange",()=>a())}).catch(()=>{}),c}function pe(s,{blocked:e}={}){const t=indexedDB.deleteDatabase(s);return e&&t.addEventListener("blocked",()=>e()),f(t).then(()=>{})}const ge=["get","getKey","getAll","getAllKeys","count"],me=["put","add","delete","clear"],U=new Map;function W(s,e){if(!(s instanceof IDBDatabase&&!(e in s)&&typeof e=="string"))return;if(U.get(e))return U.get(e);const t=e.replace(/FromIndex$/,""),n=e!==t,a=me.includes(t);if(!(t in(n?IDBIndex:IDBObjectStore).prototype)||!(a||ge.includes(t)))return;const r=async function(i,...c){const o=this.transaction(i,a?"readwrite":"readonly");let h=o.store;return n&&(h=h.index(c.shift())),(await Promise.all([h[t](...c),a&&o.done]))[0]};return U.set(e,r),r}le(s=>({...s,get:(e,t,n)=>W(e,t)||s.get(e,t,n),has:(e,t)=>!!W(e,t)||s.has(e,t)}));try{self["workbox:expiration:6.5.3"]&&_()}catch{}const ye="workbox-expiration",y="cache-entries",B=s=>{const e=new URL(s,location.href);return e.hash="",e.href};class we{constructor(e){this._db=null,this._cacheName=e}_upgradeDb(e){const t=e.createObjectStore(y,{keyPath:"id"});t.createIndex("cacheName","cacheName",{unique:!1}),t.createIndex("timestamp","timestamp",{unique:!1})}_upgradeDbAndDeleteOldDbs(e){this._upgradeDb(e),this._cacheName&&pe(this._cacheName)}async setTimestamp(e,t){e=B(e);const n={url:e,timestamp:t,cacheName:this._cacheName,id:this._getId(e)},r=(await this.getDb()).transaction(y,"readwrite",{durability:"relaxed"});await r.store.put(n),await r.done}async getTimestamp(e){const n=await(await this.getDb()).get(y,this._getId(e));return n==null?void 0:n.timestamp}async expireEntries(e,t){const n=await this.getDb();let a=await n.transaction(y).store.index("timestamp").openCursor(null,"prev");const r=[];let i=0;for(;a;){const o=a.value;o.cacheName===this._cacheName&&(e&&o.timestamp=t?r.push(a.value):i++),a=await a.continue()}const c=[];for(const o of r)await n.delete(y,o.id),c.push(o.url);return c}_getId(e){return this._cacheName+"|"+B(e)}async getDb(){return this._db||(this._db=await fe(ye,1,{upgrade:this._upgradeDbAndDeleteOldDbs.bind(this)})),this._db}}class _e{constructor(e,t={}){this._isRunning=!1,this._rerunRequested=!1,this._maxEntries=t.maxEntries,this._maxAgeSeconds=t.maxAgeSeconds,this._matchOptions=t.matchOptions,this._cacheName=e,this._timestampModel=new we(e)}async expireEntries(){if(this._isRunning){this._rerunRequested=!0;return}this._isRunning=!0;const e=this._maxAgeSeconds?Date.now()-this._maxAgeSeconds*1e3:0,t=await this._timestampModel.expireEntries(e,this._maxEntries),n=await self.caches.open(this._cacheName);for(const a of t)await n.delete(a,this._matchOptions);this._isRunning=!1,this._rerunRequested&&(this._rerunRequested=!1,q(this.expireEntries()))}async updateTimestamp(e){await this._timestampModel.setTimestamp(e,Date.now())}async isURLExpired(e){if(this._maxAgeSeconds){const t=await this._timestampModel.getTimestamp(e),n=Date.now()-this._maxAgeSeconds*1e3;return t!==void 0?t{if(!r)return null;const i=this._isResponseDateFresh(r),c=this._getCacheExpiration(a);q(c.expireEntries());const o=c.updateTimestamp(n.url);if(t)try{t.waitUntil(o)}catch{}return i?r:null},this.cacheDidUpdate=async({cacheName:t,request:n})=>{const a=this._getCacheExpiration(t);await a.updateTimestamp(n.url),await a.expireEntries()},this._config=e,this._maxAgeSeconds=e.maxAgeSeconds,this._cacheExpirations=new Map,e.purgeOnQuotaError&&z(()=>this.deleteCacheAndMetadata())}_getCacheExpiration(e){if(e===x.getRuntimeName())throw new l("expire-custom-caches-only");let t=this._cacheExpirations.get(e);return t||(t=new _e(e,this._config),this._cacheExpirations.set(e,t)),t}_isResponseDateFresh(e){if(!this._maxAgeSeconds)return!0;const t=this._getDateHeaderTimestamp(e);if(t===null)return!0;const n=Date.now();return t>=n-this._maxAgeSeconds*1e3}_getDateHeaderTimestamp(e){if(!e.headers.has("date"))return null;const t=e.headers.get("date"),a=new Date(t).getTime();return isNaN(a)?null:a}async deleteCacheAndMetadata(){for(const[e,t]of this._cacheExpirations)await self.caches.delete(e),await t.delete();this._cacheExpirations=new Map}}try{self["workbox:precaching:6.5.3"]&&_()}catch{}const be="__WB_REVISION__";function Ce(s){if(!s)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(typeof s=="string"){const r=new URL(s,location.href);return{cacheKey:r.href,url:r.href}}const{revision:e,url:t}=s;if(!t)throw new l("add-to-cache-list-unexpected-type",{entry:s});if(!e){const r=new URL(t,location.href);return{cacheKey:r.href,url:r.href}}const n=new URL(t,location.href),a=new URL(t,location.href);return n.searchParams.set(be,e),{cacheKey:n.href,url:a.href}}class xe{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:e,state:t})=>{t&&(t.originalRequest=e)},this.cachedResponseWillBeUsed=async({event:e,state:t,cachedResponse:n})=>{if(e.type==="install"&&t&&t.originalRequest&&t.originalRequest instanceof Request){const a=t.originalRequest.url;n?this.notUpdatedURLs.push(a):this.updatedURLs.push(a)}return n}}}class Ee{constructor({precacheController:e}){this.cacheKeyWillBeUsed=async({request:t,params:n})=>{const a=(n==null?void 0:n.cacheKey)||this._precacheController.getCacheKeyForURL(t.url);return a?new Request(a,{headers:t.headers}):t},this._precacheController=e}}try{self["workbox:strategies:6.5.3"]&&_()}catch{}function b(s){return typeof s=="string"?new Request(s):s}class De{constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new Z,this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const n of this._plugins)this._pluginStateMap.set(n,{});this.event.waitUntil(this._handlerDeferred.promise)}async fetch(e){const{event:t}=this;let n=b(e);if(n.mode==="navigate"&&t instanceof FetchEvent&&t.preloadResponse){const i=await t.preloadResponse;if(i)return i}const a=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const i of this.iterateCallbacks("requestWillFetch"))n=await i({request:n.clone(),event:t})}catch(i){if(i instanceof Error)throw new l("plugin-error-request-will-fetch",{thrownErrorMessage:i.message})}const r=n.clone();try{let i;i=await fetch(n,n.mode==="navigate"?void 0:this._strategy.fetchOptions);for(const c of this.iterateCallbacks("fetchDidSucceed"))i=await c({event:t,request:r,response:i});return i}catch(i){throw a&&await this.runCallbacks("fetchDidFail",{error:i,event:t,originalRequest:a.clone(),request:r.clone()}),i}}async fetchAndCachePut(e){const t=await this.fetch(e),n=t.clone();return this.waitUntil(this.cachePut(e,n)),t}async cacheMatch(e){const t=b(e);let n;const{cacheName:a,matchOptions:r}=this._strategy,i=await this.getCacheKey(t,"read"),c=Object.assign(Object.assign({},r),{cacheName:a});n=await caches.match(i,c);for(const o of this.iterateCallbacks("cachedResponseWillBeUsed"))n=await o({cacheName:a,matchOptions:r,cachedResponse:n,request:i,event:this.event})||void 0;return n}async cachePut(e,t){const n=b(e);await se(0);const a=await this.getCacheKey(n,"write");if(!t)throw new l("cache-put-with-no-response",{url:te(a.url)});const r=await this._ensureResponseSafeToCache(t);if(!r)return!1;const{cacheName:i,matchOptions:c}=this._strategy,o=await self.caches.open(i),h=this.hasCallback("cacheDidUpdate"),g=h?await X(o,a.clone(),["__WB_REVISION__"],c):null;try{await o.put(a,h?r.clone():r)}catch(u){if(u instanceof Error)throw u.name==="QuotaExceededError"&&await ee(),u}for(const u of this.iterateCallbacks("cacheDidUpdate"))await u({cacheName:i,oldResponse:g,newResponse:r.clone(),request:a,event:this.event});return!0}async getCacheKey(e,t){const n=`${e.url} | ${t}`;if(!this._cacheKeys[n]){let a=e;for(const r of this.iterateCallbacks("cacheKeyWillBeUsed"))a=b(await r({mode:t,request:a,event:this.event,params:this.params}));this._cacheKeys[n]=a}return this._cacheKeys[n]}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}async runCallbacks(e,t){for(const n of this.iterateCallbacks(e))await n(t)}*iterateCallbacks(e){for(const t of this._strategy.plugins)if(typeof t[e]=="function"){const n=this._pluginStateMap.get(t);yield r=>{const i=Object.assign(Object.assign({},r),{state:n});return t[e](i)}}}waitUntil(e){return this._extendLifetimePromises.push(e),e}async doneWaiting(){let e;for(;e=this._extendLifetimePromises.shift();)await e}destroy(){this._handlerDeferred.resolve(null)}async _ensureResponseSafeToCache(e){let t=e,n=!1;for(const a of this.iterateCallbacks("cacheWillUpdate"))if(t=await a({request:this.request,response:t,event:this.event})||void 0,n=!0,!t)break;return n||t&&t.status!==200&&(t=void 0),t}}class V{constructor(e={}){this.cacheName=x.getRuntimeName(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}handle(e){const[t]=this.handleAll(e);return t}handleAll(e){e instanceof FetchEvent&&(e={event:e,request:e.request});const t=e.event,n=typeof e.request=="string"?new Request(e.request):e.request,a="params"in e?e.params:void 0,r=new De(this,{event:t,request:n,params:a}),i=this._getResponse(r,n,t),c=this._awaitComplete(i,r,n,t);return[i,c]}async _getResponse(e,t,n){await e.runCallbacks("handlerWillStart",{event:n,request:t});let a;try{if(a=await this._handle(t,e),!a||a.type==="error")throw new l("no-response",{url:t.url})}catch(r){if(r instanceof Error){for(const i of e.iterateCallbacks("handlerDidError"))if(a=await i({error:r,event:n,request:t}),a)break}if(!a)throw r}for(const r of e.iterateCallbacks("handlerWillRespond"))a=await r({event:n,request:t,response:a});return a}async _awaitComplete(e,t,n,a){let r,i;try{r=await e}catch{}try{await t.runCallbacks("handlerDidRespond",{event:a,request:n,response:r}),await t.doneWaiting()}catch(c){c instanceof Error&&(i=c)}if(await t.runCallbacks("handlerDidComplete",{event:a,request:n,response:r,error:i}),t.destroy(),i)throw i}}class p extends V{constructor(e={}){e.cacheName=x.getPrecacheName(e.cacheName),super(e),this._fallbackToNetwork=e.fallbackToNetwork!==!1,this.plugins.push(p.copyRedirectedCacheableResponsesPlugin)}async _handle(e,t){const n=await t.cacheMatch(e);return n||(t.event&&t.event.type==="install"?await this._handleInstall(e,t):await this._handleFetch(e,t))}async _handleFetch(e,t){let n;const a=t.params||{};if(this._fallbackToNetwork){const r=a.integrity,i=e.integrity,c=!i||i===r;n=await t.fetch(new Request(e,{integrity:e.mode!=="no-cors"?i||r:void 0})),r&&c&&e.mode!=="no-cors"&&(this._useDefaultCacheabilityPluginIfNeeded(),await t.cachePut(e,n.clone()))}else throw new l("missing-precache-entry",{cacheName:this.cacheName,url:e.url});return n}async _handleInstall(e,t){this._useDefaultCacheabilityPluginIfNeeded();const n=await t.fetch(e);if(!await t.cachePut(e,n.clone()))throw new l("bad-precaching-response",{url:e.url,status:n.status});return n}_useDefaultCacheabilityPluginIfNeeded(){let e=null,t=0;for(const[n,a]of this.plugins.entries())a!==p.copyRedirectedCacheableResponsesPlugin&&(a===p.defaultPrecacheCacheabilityPlugin&&(e=n),a.cacheWillUpdate&&t++);t===0?this.plugins.push(p.defaultPrecacheCacheabilityPlugin):t>1&&e!==null&&this.plugins.splice(e,1)}}p.defaultPrecacheCacheabilityPlugin={async cacheWillUpdate({response:s}){return!s||s.status>=400?null:s}};p.copyRedirectedCacheableResponsesPlugin={async cacheWillUpdate({response:s}){return s.redirected?await ne(s):s}};class Le{constructor({cacheName:e,plugins:t=[],fallbackToNetwork:n=!0}={}){this._urlsToCacheKeys=new Map,this._urlsToCacheModes=new Map,this._cacheKeysToIntegrities=new Map,this._strategy=new p({cacheName:x.getPrecacheName(e),plugins:[...t,new Ee({precacheController:this})],fallbackToNetwork:n}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this._strategy}precache(e){this.addToCacheList(e),this._installAndActiveListenersAdded||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this._installAndActiveListenersAdded=!0)}addToCacheList(e){const t=[];for(const n of e){typeof n=="string"?t.push(n):n&&n.revision===void 0&&t.push(n.url);const{cacheKey:a,url:r}=Ce(n),i=typeof n!="string"&&n.revision?"reload":"default";if(this._urlsToCacheKeys.has(r)&&this._urlsToCacheKeys.get(r)!==a)throw new l("add-to-cache-list-conflicting-entries",{firstEntry:this._urlsToCacheKeys.get(r),secondEntry:a});if(typeof n!="string"&&n.integrity){if(this._cacheKeysToIntegrities.has(a)&&this._cacheKeysToIntegrities.get(a)!==n.integrity)throw new l("add-to-cache-list-conflicting-integrities",{url:r});this._cacheKeysToIntegrities.set(a,n.integrity)}if(this._urlsToCacheKeys.set(r,a),this._urlsToCacheModes.set(r,i),t.length>0){const c=`Workbox is precaching URLs without revision info: ${t.join(", ")} +This is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(c)}}}install(e){return v(e,async()=>{const t=new xe;this.strategy.plugins.push(t);for(const[r,i]of this._urlsToCacheKeys){const c=this._cacheKeysToIntegrities.get(i),o=this._urlsToCacheModes.get(r),h=new Request(r,{integrity:c,cache:o,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:i},request:h,event:e}))}const{updatedURLs:n,notUpdatedURLs:a}=t;return{updatedURLs:n,notUpdatedURLs:a}})}activate(e){return v(e,async()=>{const t=await self.caches.open(this.strategy.cacheName),n=await t.keys(),a=new Set(this._urlsToCacheKeys.values()),r=[];for(const i of n)a.has(i.url)||(await t.delete(i),r.push(i.url));return{deletedURLs:r}})}getURLsToCacheKeys(){return this._urlsToCacheKeys}getCachedURLs(){return[...this._urlsToCacheKeys.keys()]}getCacheKeyForURL(e){const t=new URL(e,location.href);return this._urlsToCacheKeys.get(t.href)}getIntegrityForCacheKey(e){return this._cacheKeysToIntegrities.get(e)}async matchPrecache(e){const t=e instanceof Request?e.url:e,n=this.getCacheKeyForURL(t);if(n)return(await self.caches.open(this.strategy.cacheName)).match(n)}createHandlerBoundToURL(e){const t=this.getCacheKeyForURL(e);if(!t)throw new l("non-precached-url",{url:e});return n=>(n.request=new Request(e),n.params=Object.assign({cacheKey:t},n.params),this.strategy.handle(n))}}let T;const M=()=>(T||(T=new Le),T);try{self["workbox:routing:6.5.3"]&&_()}catch{}const $="GET",C=s=>s&&typeof s=="object"?s:{handle:s};class R{constructor(e,t,n=$){this.handler=C(t),this.match=e,this.method=n}setCatchHandler(e){this.catchHandler=C(e)}}class Ue extends R{constructor(e,t,n){const a=({url:r})=>{const i=e.exec(r.href);if(!!i&&!(r.origin!==location.origin&&i.index!==0))return i.slice(1)};super(a,t,n)}}class Te{constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)})}addCacheListener(){self.addEventListener("message",e=>{if(e.data&&e.data.type==="CACHE_URLS"){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map(a=>{typeof a=="string"&&(a=[a]);const r=new Request(...a);return this.handleRequest({request:r,event:e})}));e.waitUntil(n),e.ports&&e.ports[0]&&n.then(()=>e.ports[0].postMessage(!0))}})}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const a=n.origin===location.origin,{params:r,route:i}=this.findMatchingRoute({event:t,request:e,sameOrigin:a,url:n});let c=i&&i.handler;const o=e.method;if(!c&&this._defaultHandlerMap.has(o)&&(c=this._defaultHandlerMap.get(o)),!c)return;let h;try{h=c.handle({url:n,request:e,event:t,params:r})}catch(u){h=Promise.reject(u)}const g=i&&i.catchHandler;return h instanceof Promise&&(this._catchHandler||g)&&(h=h.catch(async u=>{if(g)try{return await g.handle({url:n,request:e,event:t,params:r})}catch(K){K instanceof Error&&(u=K)}if(this._catchHandler)return this._catchHandler.handle({url:n,request:e,event:t});throw u})),h}findMatchingRoute({url:e,sameOrigin:t,request:n,event:a}){const r=this._routes.get(n.method)||[];for(const i of r){let c;const o=i.match({url:e,sameOrigin:t,request:n,event:a});if(o)return c=o,(Array.isArray(c)&&c.length===0||o.constructor===Object&&Object.keys(o).length===0||typeof o=="boolean")&&(c=void 0),{route:i,params:c}}return{}}setDefaultHandler(e,t=$){this._defaultHandlerMap.set(t,C(e))}setCatchHandler(e){this._catchHandler=C(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(e){if(!this._routes.has(e.method))throw new l("unregister-route-but-not-found-with-method",{method:e.method});const t=this._routes.get(e.method).indexOf(e);if(t>-1)this._routes.get(e.method).splice(t,1);else throw new l("unregister-route-route-not-registered")}}let w;const Pe=()=>(w||(w=new Te,w.addFetchListener(),w.addCacheListener()),w);function N(s,e,t){let n;if(typeof s=="string"){const r=new URL(s,location.href),i=({url:c})=>c.href===r.href;n=new R(i,e,t)}else if(s instanceof RegExp)n=new Ue(s,e,t);else if(typeof s=="function")n=new R(s,e,t);else if(s instanceof R)n=s;else throw new l("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});return Pe().registerRoute(n),n}function ke(s,e=[]){for(const t of[...s.searchParams.keys()])e.some(n=>n.test(t))&&s.searchParams.delete(t);return s}function*Ie(s,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:t="index.html",cleanURLs:n=!0,urlManipulation:a}={}){const r=new URL(s,location.href);r.hash="",yield r.href;const i=ke(r,e);if(yield i.href,t&&i.pathname.endsWith("/")){const c=new URL(i.href);c.pathname+=t,yield c.href}if(n){const c=new URL(i.href);c.pathname+=".html",yield c.href}if(a){const c=a({url:r});for(const o of c)yield o.href}}class Me extends R{constructor(e,t){const n=({request:a})=>{const r=e.getURLsToCacheKeys();for(const i of Ie(a.url,t)){const c=r.get(i);if(c){const o=e.getIntegrityForCacheKey(c);return{cacheKey:c,integrity:o}}}};super(n,e.strategy)}}function Ne(s){const e=M(),t=new Me(e,s);N(t)}function Ke(s){return M().createHandlerBoundToURL(s)}function Ae(s){M().precache(s)}function ve(s,e){Ae(s),Ne(e)}const Oe={cacheWillUpdate:async({response:s})=>s.status===200||s.status===0?s:null};class Se extends V{constructor(e={}){super(e),this.plugins.some(t=>"cacheWillUpdate"in t)||this.plugins.unshift(Oe)}async _handle(e,t){const n=t.fetchAndCachePut(e).catch(()=>{});t.waitUntil(n);let a=await t.cacheMatch(e),r;if(!a)try{a=await n}catch(i){i instanceof Error&&(r=i)}if(!a)throw new l("no-response",{url:e.url,error:r});return a}}ae();ve([{"revision":null,"url":"assets/chart-lib.a8ad03fd.js"},{"revision":null,"url":"assets/chevron-down.0fe59cac.js"},{"revision":null,"url":"assets/Config.7bc73fad.css"},{"revision":null,"url":"assets/Config.fa1e4fae.js"},{"revision":null,"url":"assets/Connections.1e70ab68.css"},{"revision":null,"url":"assets/Connections.55a90f3d.js"},{"revision":null,"url":"assets/debounce.c2d20996.js"},{"revision":null,"url":"assets/en.fb34eaf7.js"},{"revision":null,"url":"assets/Fab.a0a7e573.css"},{"revision":null,"url":"assets/Fab.ac4f3b29.js"},{"revision":null,"url":"assets/index.2addc377.js"},{"revision":null,"url":"assets/index.47b45d26.js"},{"revision":null,"url":"assets/index.487e7aa0.css"},{"revision":null,"url":"assets/index.ad2cee1a.js"},{"revision":null,"url":"assets/index.esm.d79e6b4f.js"},{"revision":null,"url":"assets/Logs.3d717679.js"},{"revision":null,"url":"assets/Logs.4b8e75d1.css"},{"revision":null,"url":"assets/logs.e4cdcb93.js"},{"revision":null,"url":"assets/play.f2fb5ccc.js"},{"revision":null,"url":"assets/Proxies.3fa3509d.css"},{"revision":null,"url":"assets/Proxies.98885c78.js"},{"revision":null,"url":"assets/Rules.651d070a.js"},{"revision":null,"url":"assets/Rules.e03c54a8.css"},{"revision":null,"url":"assets/Select.1e55eba1.css"},{"revision":null,"url":"assets/Select.ef9dc454.js"},{"revision":null,"url":"assets/TextFitler.3362aec6.js"},{"revision":null,"url":"assets/TextFitler.b21c0577.css"},{"revision":null,"url":"assets/useRemainingViewPortHeight.4e5a0898.js"},{"revision":null,"url":"assets/zh.9b79b7bf.js"},{"revision":"8f0cc90b14289dd30ce5176dc9930d3a","url":"index.html"},{"revision":"402b66900e731ca748771b6fc5e7a068","url":"registerSW.js"},{"revision":"c0f9cb6aaf647e778bdc01c59944755b","url":"manifest.webmanifest"}]);const We=new RegExp("/[^/?]+\\.[^/]+$");N(({request:s,url:e})=>!(s.mode!=="navigate"||e.pathname.startsWith("/_")||e.pathname.match(We)),Ke("index.html"));N(({url:s})=>s.origin===self.location.origin&&s.pathname.endsWith(".png"),new Se({cacheName:"images",plugins:[new Re({maxEntries:50})]}));self.addEventListener("message",s=>{s.data&&s.data.type==="SKIP_WAITING"&&self.skipWaiting()}); diff --git a/luci-app-openclash/root/usr/share/openclash/yml_change.sh b/luci-app-openclash/root/usr/share/openclash/yml_change.sh index ea32a3f07..7109778c3 100644 --- a/luci-app-openclash/root/usr/share/openclash/yml_change.sh +++ b/luci-app-openclash/root/usr/share/openclash/yml_change.sh @@ -81,6 +81,7 @@ yml_auth_get() if [ -z "$username" ] || [ -z "$password" ]; then return else + LOG_OUT "Tip: You have seted the authentication of SOCKS5/HTTP(S) proxy with【$username:$password】" echo " - $username:$password" >>/tmp/yaml_openclash_auth fi } diff --git a/luci-app-openclash/root/usr/share/openclash/yml_proxys_set.sh b/luci-app-openclash/root/usr/share/openclash/yml_proxys_set.sh index 7597880f7..38c940933 100644 --- a/luci-app-openclash/root/usr/share/openclash/yml_proxys_set.sh +++ b/luci-app-openclash/root/usr/share/openclash/yml_proxys_set.sh @@ -971,7 +971,7 @@ EOF fi cat /tmp/Proxy_Provider >> $SERVER_FILE 2>/dev/null cat >> "$SERVER_FILE" <<-EOF - url: https://cp.cloudflare.com/generate_204 + url: http://cp.cloudflare.com/generate_204 interval: "600" tolerance: "150" - name: Proxy @@ -1069,7 +1069,7 @@ EOF fi cat /tmp/Proxy_Provider >> $SERVER_FILE 2>/dev/null cat >> "$SERVER_FILE" <<-EOF - url: https://cp.cloudflare.com/generate_204 + url: http://cp.cloudflare.com/generate_204 interval: "600" tolerance: "150" - name: Proxy @@ -1159,20 +1159,6 @@ cat >> "$SERVER_FILE" <<-EOF EOF fi cat /tmp/Proxy_Provider >> $SERVER_FILE 2>/dev/null -cat >> "$SERVER_FILE" <<-EOF - - name: Douyin - type: select - proxies: - - DIRECT - - Asian TV -EOF -cat /tmp/Proxy_Server >> $SERVER_FILE 2>/dev/null -if [ -f "/tmp/Proxy_Provider" ]; then -cat >> "$SERVER_FILE" <<-EOF - use: -EOF -fi -cat /tmp/Proxy_Provider >> $SERVER_FILE 2>/dev/null cat >> "$SERVER_FILE" <<-EOF - name: Bahamut type: select @@ -1404,6 +1390,20 @@ cat >> "$SERVER_FILE" <<-EOF EOF fi cat /tmp/Proxy_Provider >> $SERVER_FILE 2>/dev/null +cat >> "$SERVER_FILE" <<-EOF + - name: Discord + type: select + proxies: + - Proxy + - DIRECT +EOF +cat /tmp/Proxy_Server >> $SERVER_FILE 2>/dev/null +if [ -f "/tmp/Proxy_Provider" ]; then +cat >> "$SERVER_FILE" <<-EOF + use: +EOF +fi +cat /tmp/Proxy_Provider >> $SERVER_FILE 2>/dev/null cat >> "$SERVER_FILE" <<-EOF - name: PayPal type: select @@ -1431,7 +1431,6 @@ ${uci_set}AsianTV="Asian TV" ${uci_set}Proxy="Proxy" ${uci_set}Youtube="Youtube" ${uci_set}Bilibili="Bilibili" -${uci_set}Douyin="Douyin" ${uci_set}Bahamut="Bahamut" ${uci_set}HBOMax="HBO Max" ${uci_set}HBOGo="HBO Go" @@ -1450,6 +1449,7 @@ ${uci_set}AdBlock="AdBlock" ${uci_set}Speedtest="Speedtest" ${uci_set}Telegram="Telegram" ${uci_set}Crypto="Crypto" +${uci_set}Discord="Discord" ${uci_set}PayPal="PayPal" ${uci_set}Domestic="Domestic" ${uci_set}Others="Others" @@ -1461,7 +1461,6 @@ ${uci_set}Others="Others" ${UCI_DEL_LIST}="Proxy" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Proxy" >/dev/null 2>&1 ${UCI_DEL_LIST}="Youtube" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Youtube" >/dev/null 2>&1 ${UCI_DEL_LIST}="Bilibili" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Bilibili" >/dev/null 2>&1 - ${UCI_DEL_LIST}="Douyin" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Douyin" >/dev/null 2>&1 ${UCI_DEL_LIST}="Bahamut" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Bahamut" >/dev/null 2>&1 ${UCI_DEL_LIST}="HBO Max" >/dev/null 2>&1 && ${UCI_ADD_LIST}="HBO Max" >/dev/null 2>&1 ${UCI_DEL_LIST}="HBO Go" >/dev/null 2>&1 && ${UCI_ADD_LIST}="HBO Go" >/dev/null 2>&1 @@ -1479,6 +1478,7 @@ ${uci_set}Others="Others" ${UCI_DEL_LIST}="Steam" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Steam" >/dev/null 2>&1 ${UCI_DEL_LIST}="Telegram" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Telegram" >/dev/null 2>&1 ${UCI_DEL_LIST}="Crypto" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Crypto" >/dev/null 2>&1 + ${UCI_DEL_LIST}="Discord" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Discord" >/dev/null 2>&1 ${UCI_DEL_LIST}="PayPal" >/dev/null 2>&1 && ${UCI_ADD_LIST}="PayPal" >/dev/null 2>&1 ${UCI_DEL_LIST}="Speedtest" >/dev/null 2>&1 && ${UCI_ADD_LIST}="Speedtest" >/dev/null 2>&1 } @@ -1502,7 +1502,7 @@ EOF fi cat /tmp/Proxy_Provider >> $SERVER_FILE 2>/dev/null cat >> "$SERVER_FILE" <<-EOF - url: https://cp.cloudflare.com/generate_204 + url: http://cp.cloudflare.com/generate_204 interval: "600" tolerance: "150" - name: Proxy diff --git a/luci-app-openclash/root/usr/share/openclash/yml_rules_change.sh b/luci-app-openclash/root/usr/share/openclash/yml_rules_change.sh index 222da5c06..f516d42c2 100644 --- a/luci-app-openclash/root/usr/share/openclash/yml_rules_change.sh +++ b/luci-app-openclash/root/usr/share/openclash/yml_rules_change.sh @@ -549,7 +549,7 @@ yml_other_set() if defined? Value_2 then Value_2.each{|x| if ${10} != 1 then - if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then + if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|^SUB-RULE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then puts '${LOGTIME} Warning: Skip the Custom Rule that Core not Support【' + x + '】' next end; @@ -583,7 +583,7 @@ yml_other_set() end; Value_4.each{|x| if ${10} != 1 then - if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then + if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|^SUB-RULE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then puts '${LOGTIME} Warning: Skip the Custom Rule that Core not Support【' + x + '】' next end; @@ -602,7 +602,7 @@ yml_other_set() if not Value_1['rules'].to_a.empty? and Value_1['rules'].class.to_s == 'Array' then Value_1.each{|x| if ${10} != 1 then - if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then + if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|^SUB-RULE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then puts '${LOGTIME} Warning: Skip the Custom Rule that Core not Support【' + x + '】' Value_1.delete(x); end; @@ -614,7 +614,7 @@ yml_other_set() elsif Value_1.class.to_s == 'Array' then Value_1.each{|x| if ${10} != 1 then - if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then + if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|^SUB-RULE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then puts '${LOGTIME} Warning: Skip the Custom Rule that Core not Support【' + x + '】' Value_1.delete(x); end; @@ -633,7 +633,7 @@ yml_other_set() if not Value_2['rules'].to_a.empty? and Value_2['rules'].class.to_s == 'Array' then Value_2.each{|x| if ${10} != 1 then - if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then + if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|^SUB-RULE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then puts '${LOGTIME} Warning: Skip the Custom Rule that Core not Support【' + x + '】' Value_2.delete(x); end; @@ -645,7 +645,7 @@ yml_other_set() elsif Value_2.class.to_s == 'Array' then Value_2.each{|x| if ${10} != 1 then - if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then + if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|^SUB-RULE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then puts '${LOGTIME} Warning: Skip the Custom Rule that Core not Support【' + x + '】' Value_2.delete(x); end; @@ -675,7 +675,7 @@ yml_other_set() end Value_3.each{|x| if ${10} != 1 then - if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then + if x =~ /(^GEOSITE,|^AND,|^OR,|^NOT,|^IP-SUFFIX,|^SRC-IP-SUFFIX,|^IN-TYPE,|^SUB-RULE,|PORT,[0-9]+\/+|PORT,[0-9]+-+)/ or x.split(',')[-1] == 'tcp' or x.split(',')[-1] == 'udp' then puts '${LOGTIME} Warning: Skip the Custom Rule that Core not Support【' + x + '】' next end; @@ -688,6 +688,54 @@ yml_other_set() end; end; end; + #SUB-RULE + if ${10} == 1 then + if Value.has_key?('sub-rules') and not Value['sub-rules'].to_a.empty? then + if File::exist?('/etc/openclash/custom/openclash_custom_rules.list') then + Value_1 = YAML.load_file('/etc/openclash/custom/openclash_custom_rules.list'); + if Value_1 != false then + if Value_1.class.to_s == 'Hash' then + if not Value_1['sub-rules'].to_a.empty? and Value_1['sub-rules'].class.to_s == 'Hash' then + Value['sub-rules'] = Value['sub-rules'].merge!(Value_1['sub-rules']); + end; + end; + end; + end; + if File::exist?('/etc/openclash/custom/openclash_custom_rules_2.list') then + Value_2 = YAML.load_file('/etc/openclash/custom/openclash_custom_rules_2.list'); + if Value_2 != false then + if Value_2.class.to_s == 'Hash' then + if not Value_2['sub-rules'].to_a.empty? and Value_2['sub-rules'].class.to_s == 'Hash' then + Value['sub-rules'] = Value['sub-rules'].merge!(Value_2['sub-rules']); + end; + end; + end; + end; + else + if File::exist?('/etc/openclash/custom/openclash_custom_rules.list') then + Value_1 = YAML.load_file('/etc/openclash/custom/openclash_custom_rules.list'); + if Value_1 != false then + if Value_1.class.to_s == 'Hash' then + if not Value_1['sub-rules'].to_a.empty? and Value_1['sub-rules'].class.to_s == 'Hash' then + Value['sub-rules'] = Value_1['sub-rules']; + end; + end; + end; + end; + if File::exist?('/etc/openclash/custom/openclash_custom_rules_2.list') then + Value_2 = YAML.load_file('/etc/openclash/custom/openclash_custom_rules_2.list'); + if Value_2 != false then + if Value_2.class.to_s == 'Hash' then + if not Value_2['sub-rules'].to_a.empty? and Value_2['sub-rules'].class.to_s == 'Hash' then + Value['sub-rules'] = Value_2['sub-rules']; + end; + end; + end; + end; + end; + else + puts '${LOGTIME} Warning: Skip the Custom Rule that Core not Support【sub-rules】' + end; end; }.join; rescue Exception => e @@ -795,6 +843,7 @@ yml_other_rules_get() config_get "Speedtest" "$section" "Speedtest" "" config_get "Telegram" "$section" "Telegram" "" config_get "Crypto" "$section" "Crypto" "$Proxy" + config_get "Discord" "$section" "Discord" "$Proxy" config_get "Microsoft" "$section" "Microsoft" "" config_get "PayPal" "$section" "PayPal" "" config_get "Domestic" "$section" "Domestic" "" @@ -802,7 +851,6 @@ yml_other_rules_get() config_get "GoogleFCM" "$section" "GoogleFCM" "DIRECT" config_get "Discovery" "$section" "Discovery" "$GlobalTV" config_get "DAZN" "$section" "DAZN" "$GlobalTV" - config_get "Douyin" "$section" "Douyin" "$AsianTV" } if [ "$1" != "0" ]; then @@ -856,7 +904,7 @@ if [ "$1" != "0" ]; then || [ -z "$(grep -F "$Speedtest" /tmp/Proxy_Group)" ]\ || [ -z "$(grep -F "$Telegram" /tmp/Proxy_Group)" ]\ || [ -z "$(grep -F "$Crypto" /tmp/Proxy_Group)" ]\ - || [ -z "$(grep -F "$Douyin" /tmp/Proxy_Group)" ]\ + || [ -z "$(grep -F "$Discord" /tmp/Proxy_Group)" ]\ || [ -z "$(grep -F "$Microsoft" /tmp/Proxy_Group)" ]\ || [ -z "$(grep -F "$PayPal" /tmp/Proxy_Group)" ]\ || [ -z "$(grep -F "$Others" /tmp/Proxy_Group)" ]\ @@ -909,12 +957,12 @@ if [ "$1" != "0" ]; then .gsub(/,Netflix$/, ',$Netflix#d') .gsub(/,Disney$/, ',$Disney#d') .gsub(/,Spotify$/, ',$Spotify#d') - .gsub(/,Douyin$/, ',$Douyin#d') .gsub(/,Steam$/, ',$Steam#d') .gsub(/,AdBlock$/, ',$AdBlock#d') .gsub(/,Speedtest$/, ',$Speedtest#d') .gsub(/,Telegram$/, ',$Telegram#d') .gsub(/,Crypto$/, ',$Crypto#d') + .gsub(/,Discord$/, ',$Discord#d') .gsub(/,Microsoft$/, ',$Microsoft#d') .to_s.gsub(/,PayPal$/, ',$PayPal#d') .gsub(/,Domestic$/, ',$Domestic#d') @@ -938,12 +986,12 @@ if [ "$1" != "0" ]; then .gsub!(/: \"Netflix\"/,': \"$Netflix#d\"') .gsub!(/: \"Disney\"/,': \"$Disney#d\"') .gsub!(/: \"Spotify\"/,': \"$Spotify#d\"') - .gsub!(/: \"Douyin\"/,': \"$Douyin#d\"') .gsub!(/: \"Steam\"/,': \"$Steam#d\"') .gsub!(/: \"AdBlock\"/,': \"$AdBlock#d\"') .gsub!(/: \"Speedtest\"/,': \"$Speedtest#d\"') .gsub!(/: \"Telegram\"/,': \"$Telegram#d\"') .gsub!(/: \"Crypto\"/,': \"$Crypto#d\"') + .gsub!(/: \"Discord\"/,': \"$Discord#d\"') .gsub!(/: \"Microsoft\"/,': \"$Microsoft#d\"') .gsub!(/: \"PayPal\"/,': \"$PayPal#d\"') .gsub!(/: \"Domestic\"/,': \"$Domestic#d\"') diff --git a/luci-app-openclash/root/www/luci-static/resources/openclash/img/version.svg b/luci-app-openclash/root/www/luci-static/resources/openclash/img/version.svg index def2ee1dc..19377693f 100644 --- a/luci-app-openclash/root/www/luci-static/resources/openclash/img/version.svg +++ b/luci-app-openclash/root/www/luci-static/resources/openclash/img/version.svg @@ -1 +1 @@ -Current Version: v0.45.51-betaCurrent Versionv0.45.51-beta \ No newline at end of file +Current Version: v0.45.59-betaCurrent Versionv0.45.59-beta \ No newline at end of file diff --git a/naiveproxy/Makefile b/naiveproxy/Makefile index ae1da3611..07cd7236f 100644 --- a/naiveproxy/Makefile +++ b/naiveproxy/Makefile @@ -136,13 +136,13 @@ define Build/Compile endef define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/include + $(INSTALL_DIR) $(1)/usr/include/libcronet $(CP) \ $(PKG_BUILD_DIR)/src/components/grpc_support/include/bidirectional_stream_c.h \ $(PKG_BUILD_DIR)/src/components/cronet/native/generated/cronet.idl_c.h \ $(PKG_BUILD_DIR)/src/components/cronet/native/include/cronet_c.h \ $(PKG_BUILD_DIR)/src/components/cronet/native/include/cronet_export.h \ - $(1)/usr/include/ + $(1)/usr/include//libcronet/ endef define Package/naiveproxy/install